:root {
  color-scheme: light;
  --bg: #f4f0e8;
  --surface: #fffdf9;
  --surface-2: #ece7dc;
  --text: #17342f;
  --muted: #71807b;
  --line: rgba(23, 52, 47, .12);
  --primary: #174b43;
  --primary-2: #27695e;
  --accent: #d96842;
  --gold: #e6b45d;
  --ok: #2f8b71;
  --shadow: 0 18px 50px rgba(25, 46, 41, .12);
  --font: "Onest", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, a:focus-visible {
  outline: 3px solid rgba(217, 104, 66, .42);
  outline-offset: 2px;
}
a { color: inherit; }
.hidden { display: none !important; }

.brand-lockup {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: .17em;
  font-size: 14px;
}
.brand-mark {
  width: 39px;
  height: 39px;
  border-radius: 13px 13px 13px 4px;
  display: inline-grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.06em;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}
.eyebrow {
  font-size: 10px;
  line-height: 1.3;
  letter-spacing: .18em;
  font-weight: 800;
  color: var(--accent);
}

.auth-screen {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 12%, rgba(230,180,93,.22), transparent 32%),
    linear-gradient(135deg, #173c36 0%, #174b43 46%, #e9e1d4 46%, #f4f0e8 100%);
}
.auth-card {
  width: min(100%, 460px);
  background: var(--surface);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 30px;
}
.auth-card .brand-lockup { margin-bottom: 42px; }
.auth-card h1,
.topbar h1 {
  margin: 8px 0 10px;
  font-size: clamp(31px, 5vw, 52px);
  line-height: 1;
  letter-spacing: -.05em;
}
.auth-card p {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}
.auth-form {
  display: grid;
  gap: 14px;
}
label span {
  display: block;
  margin: 0 0 7px;
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
}
input {
  width: 100%;
  height: 50px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 0 14px;
}
.auth-hint {
  display: block;
  margin-top: 15px;
  color: var(--muted);
}

.dashboard-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 260px 1fr;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 30px;
  padding: 28px 22px;
  background: #174b43;
  color: #f7f1e6;
}
.side-nav {
  display: grid;
  gap: 8px;
}
.side-nav a {
  text-decoration: none;
  border-radius: 8px;
  padding: 12px 13px;
  color: rgba(247,241,230,.68);
  font-size: 13px;
  font-weight: 700;
}
.side-nav a.active,
.side-nav a:hover {
  color: #fff;
  background: rgba(255,255,255,.1);
}
.sidebar-note {
  margin-top: auto;
  border-top: 1px solid rgba(255,255,255,.14);
  padding-top: 20px;
}
.sidebar-note strong,
.sidebar-note small { display: block; }
.sidebar-note strong {
  margin: 7px 0 5px;
  font-size: 15px;
}
.sidebar-note small {
  color: rgba(247,241,230,.55);
}

.content {
  min-width: 0;
  padding: 28px clamp(18px, 4vw, 46px) 46px;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 24px;
}
.topbar h1 { font-size: clamp(34px, 4.6vw, 64px); }

.primary-button,
.secondary-button {
  border: 0;
  border-radius: 8px;
  min-height: 46px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .18s ease, opacity .18s ease, background .18s ease;
}
.primary-button {
  background: var(--accent);
  color: #fff;
}
.secondary-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--primary);
}
.compact { min-height: 38px; padding-inline: 13px; }
.primary-button:hover,
.secondary-button:hover { transform: translateY(-1px); }

.metric-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.metric-card,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(25,46,41,.06);
}
.metric-card {
  min-height: 142px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.metric-card span,
.metric-card small {
  color: var(--muted);
  font-size: 12px;
}
.metric-card strong {
  display: block;
  margin: 10px 0;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1;
  letter-spacing: -.04em;
}
.metric-card.accent {
  background: var(--primary);
  color: #fff;
}
.metric-card.accent span,
.metric-card.accent small { color: rgba(255,255,255,.68); }

.work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
  gap: 14px;
  margin-bottom: 14px;
}
.panel { padding: 20px; }
.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}
.panel-title h2 {
  margin: 5px 0 0;
  font-size: 23px;
  line-height: 1.1;
  letter-spacing: -.04em;
}
.status-pill {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(47,139,113,.12);
  color: var(--ok);
  font-size: 10px;
  font-weight: 800;
}
.pos-form {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 12px;
}
.pos-form .primary-button { min-width: 170px; }
.qr-result {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 154px 1fr;
  gap: 18px;
  align-items: center;
  padding: 14px;
  border-radius: 8px;
  background: var(--bg);
}
.qr-code {
  width: 154px;
  aspect-ratio: 1;
  border: 9px solid #fff;
  background:
    linear-gradient(90deg, #17342f 50%, transparent 0) 0 0/22px 22px,
    linear-gradient(#17342f 50%, transparent 0) 0 0/22px 22px,
    linear-gradient(90deg, transparent 50%, #17342f 0) 11px 11px/22px 22px,
    #f8faf5;
  box-shadow: inset 0 0 0 10px #f8faf5;
}
.qr-result strong {
  display: block;
  margin: 8px 0;
  font-size: 28px;
  letter-spacing: -.04em;
}
.qr-result p {
  margin: 0;
  max-width: 360px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.activity-list {
  display: grid;
  gap: 10px;
}
.activity-list div {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  background: var(--bg);
  font-size: 12px;
}
.activity-list b { color: var(--accent); }
.activity-list span { color: var(--muted); }

.table-wrap {
  width: 100%;
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}
th, td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
}
th {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
}
td strong { font-size: 13px; }
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(47,139,113,.12);
  color: var(--ok);
  font-size: 10px;
  font-weight: 800;
}
.badge.wait {
  background: rgba(230,180,93,.18);
  color: #9a6a15;
}

.tabbar {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
}
.tabbar button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  min-height: 32px;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.tabbar button.active {
  background: var(--surface);
  color: var(--primary);
}
.business-groups {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.business-group {
  padding: 14px;
  border-radius: 8px;
  background: var(--bg);
}
.business-group span,
.business-group small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.business-group strong {
  display: block;
  margin: 7px 0;
  font-size: 22px;
  letter-spacing: -.04em;
}

@media (max-width: 980px) {
  .dashboard-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
  .side-nav {
    grid-template-columns: repeat(3, auto);
    margin-left: auto;
  }
  .sidebar-note { display: none; }
  .metric-grid,
  .work-grid,
  .business-groups { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .auth-screen { padding: 0; background: var(--bg); }
  .auth-card {
    min-height: 100dvh;
    width: 100%;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 26px 18px;
  }
  .content { padding: 20px 14px 32px; }
  .topbar,
  .panel-title,
  .sidebar { align-items: stretch; }
  .topbar,
  .sidebar { flex-direction: column; }
  .side-nav { grid-template-columns: 1fr; margin-left: 0; }
  .pos-form,
  .qr-result { grid-template-columns: 1fr; }
  .pos-form .primary-button { min-width: 0; width: 100%; }
  .qr-code { width: min(100%, 220px); }
  .tabbar { width: 100%; }
  .tabbar button { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}
