:root {
  --bg: #f3efe7;
  --ink: #201b16;
  --muted: #74695d;
  --surface: #fffaf0;
  --line: #d8c9b6;
  --accent: #1f8a5b;
  --accent-dark: #146342;
  --coin: #d99f2b;
  --danger: #a33a2e;
  --shadow: 0 24px 70px rgba(46, 34, 22, 0.16);
  font-family: Avenir Next, Avenir, Helvetica Neue, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(31, 138, 91, 0.12), transparent 34%),
    radial-gradient(circle at 88% 16%, rgba(217, 159, 43, 0.18), transparent 25%),
    var(--bg);
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  padding: 0 18px;
  color: #fff;
  background: var(--accent);
  font: 700 0.95rem/1 Avenir Next, Avenir, Helvetica Neue, Helvetica, sans-serif;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

button:hover,
button:focus-visible {
  background: var(--accent-dark);
  box-shadow: 0 10px 24px rgba(31, 138, 91, 0.22);
  transform: translateY(-1px);
}

button:focus-visible {
  outline: 3px solid rgba(31, 138, 91, 0.28);
  outline-offset: 3px;
}

button.secondary {
  color: var(--ink);
  background: #ede1ce;
}

button.secondary:hover,
button.secondary:focus-visible {
  background: #e2d1b9;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.monitor {
  min-height: calc(100vh - 64px);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  grid-template-rows: auto auto 1fr;
  gap: 24px;
  align-items: stretch;
}

.topbar,
.register,
.metrics article,
.activity {
  background: rgba(255, 250, 240, 0.82);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.topbar {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 22px 24px;
}

.eyebrow,
.label,
.section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 5.6rem);
  line-height: 0.92;
}

h2 {
  font-size: 1.1rem;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 156px;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  color: var(--muted);
  background: #fff7e8;
  font-weight: 700;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--coin);
}

.status.ready .status-dot {
  background: var(--accent);
}

.status.error .status-dot,
.status.needs_config .status-dot {
  background: var(--danger);
}

.register {
  grid-row: span 2;
  padding: 28px;
  display: grid;
  align-content: center;
  gap: 26px;
}

.register-face {
  position: relative;
  min-height: 360px;
  border: 1px solid #a56f35;
  border-radius: 8px;
  background:
    linear-gradient(180deg, #bd8a4c 0 45%, #9e6635 45% 100%),
    #b87a3d;
  overflow: hidden;
  box-shadow: inset 0 -18px 0 rgba(0, 0, 0, 0.12);
}

.register-face::before {
  content: "";
  position: absolute;
  inset: 28px 40px auto;
  height: 122px;
  border-radius: 6px;
  background: #2f2b25;
  box-shadow: inset 0 0 0 8px #473e34;
}

.display {
  position: absolute;
  left: 64px;
  right: 64px;
  top: 56px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  color: #c8ff96;
  background: #171f17;
  font-family: Menlo, Monaco, Consolas, monospace;
  font-size: clamp(1.35rem, 4vw, 2.5rem);
  font-weight: 800;
  text-align: center;
  text-shadow: 0 0 10px rgba(200, 255, 150, 0.42);
}

.drawer {
  position: absolute;
  left: 40px;
  right: 40px;
  bottom: 42px;
  height: 116px;
  border: 1px solid rgba(0, 0, 0, 0.22);
  border-radius: 6px;
  background:
    linear-gradient(90deg, transparent 0 32%, rgba(0, 0, 0, 0.18) 32% 34%, transparent 34% 66%, rgba(0, 0, 0, 0.18) 66% 68%, transparent 68%),
    #c99a60;
}

.drawer::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 36px;
  width: 48px;
  height: 12px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #4b3728;
}

.register.ring .register-face {
  animation: ring 540ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.metrics article {
  min-height: 180px;
  padding: 24px;
  display: grid;
  align-content: end;
}

.metrics strong {
  margin-top: 18px;
  display: block;
  font-size: clamp(3.2rem, 8vw, 6.2rem);
  line-height: 0.88;
}

.metrics span {
  margin-top: 12px;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 700;
}

.activity {
  padding: 24px;
  min-height: 320px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: baseline;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.sales-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sales-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid rgba(216, 201, 182, 0.7);
}

.sales-list li:last-child {
  border-bottom: 0;
}

.sale-description {
  overflow-wrap: anywhere;
  font-weight: 800;
}

.sale-time {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.88rem;
}

.sale-amount {
  font-weight: 900;
  white-space: nowrap;
}

.empty {
  padding: 28px 0;
  color: var(--muted);
  font-weight: 700;
}

@keyframes ring {
  0%,
  100% {
    transform: translateX(0) rotate(0);
  }
  20% {
    transform: translateX(-6px) rotate(-1deg);
  }
  42% {
    transform: translateX(5px) rotate(1deg);
  }
  64% {
    transform: translateX(-3px) rotate(-0.5deg);
  }
}

@media (max-width: 820px) {
  .shell {
    width: min(100% - 20px, 640px);
    padding: 10px 0;
  }

  .monitor {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .status {
    min-width: 0;
  }

  .register {
    padding: 16px;
  }

  .register-face {
    min-height: 300px;
  }

  .display {
    left: 42px;
    right: 42px;
  }

  .drawer {
    left: 28px;
    right: 28px;
  }

  .metrics {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .metrics article {
    min-height: 144px;
  }

  .section-heading {
    display: block;
  }

  .section-heading p {
    margin-top: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
  }
}
