:root {
  --ink: #14231f;
  --ink-2: #26443b;
  --muted: #667870;
  --muted-2: #85948d;
  --paper: #f3f1ea;
  --paper-2: #ebe9df;
  --surface: #fffdf8;
  --surface-2: #f8f6ef;
  --line: #dedfd4;
  --line-strong: #cbcfc2;
  --forest: #0d3b32;
  --forest-2: #114d41;
  --forest-3: #196352;
  --mint: #dff1e7;
  --mint-2: #c9e8d9;
  --lime: #c8f169;
  --amber: #e9a23b;
  --amber-soft: #fbf0da;
  --coral: #d2604c;
  --coral-soft: #fae8e3;
  --blue: #4f7da8;
  --blue-soft: #e7eef6;
  --good: #2c7a5e;
  --good-soft: #e1f2e8;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow-sm: 0 1px 2px rgba(20, 35, 31, 0.05), 0 12px 30px -22px rgba(20, 35, 31, 0.35);
  --shadow: 0 22px 60px -34px rgba(20, 35, 31, 0.42);
  --shadow-lg: 0 32px 90px -30px rgba(10, 40, 32, 0.45);
  --sans: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --serif: "DM Serif Display", "Iowan Old Style", Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { width: 20px; height: 20px; display: block; }
::selection { background: var(--lime); color: var(--forest); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Brand */
.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--lime); color: var(--forest);
  box-shadow: inset 0 0 0 1px rgba(13, 59, 50, 0.1);
  flex: none;
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-word { font-weight: 800; letter-spacing: -0.03em; font-size: 17px; }
.brand-word span { font-weight: 500; color: var(--muted); }
.brand-light .brand-word { color: #f5f7ec; }
.brand-light .brand-word span { color: #a7c3b7; }

/* Buttons */
.button {
  border: 0; border-radius: 12px; padding: 11px 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-weight: 700; font-size: 13px; letter-spacing: -0.01em;
  transition: transform 150ms ease, background 150ms ease, box-shadow 150ms ease, color 150ms ease;
}
.button:active { transform: translateY(1px); }
.button:focus-visible, .icon-button:focus-visible, .text-button:focus-visible, .nav-item:focus-visible, .demo-account:focus-visible {
  outline: 2px solid var(--forest-3); outline-offset: 3px;
}
.button:disabled { opacity: 0.55; cursor: wait; transform: none; }
.button-primary { background: var(--forest); color: #f7faec; box-shadow: 0 10px 24px -14px rgba(13, 59, 50, 0.75); }
.button-primary:hover { background: var(--forest-2); }
.button-wide { width: 100%; padding: 15px 18px; border-radius: 13px; font-size: 14px; }
.button-icon { margin-left: auto; display: flex; }
.button-icon svg { width: 18px; height: 18px; }
.button-quiet { background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); box-shadow: var(--shadow-sm); }
.button-quiet:hover { border-color: var(--line-strong); background: #fff; }
.button-danger { background: var(--coral-soft); color: #a23e2d; border: 1px solid #efc7bf; }
.button-danger:hover { background: #f7d9d2; }
.button-good { background: var(--forest); color: #f7faec; }
.button-good:hover { background: var(--forest-2); }
.button-ghost { background: transparent; border: 1px solid var(--line); color: var(--ink-2); }
.button-ghost:hover { background: var(--surface-2); }
.button svg { width: 17px; height: 17px; }
.text-button { border: 0; background: transparent; color: var(--forest-3); font-weight: 700; padding: 0; }
.text-button:hover { text-decoration: underline; text-underline-offset: 3px; }
.icon-button {
  width: 38px; height: 38px; border: 1px solid transparent; border-radius: 10px;
  display: grid; place-items: center; background: transparent; color: var(--ink-2);
}
.icon-button:hover { background: rgba(20, 35, 31, 0.06); }
.icon-button-on-dark { color: #c3d8ce; }
.icon-button-on-dark:hover { background: rgba(255, 255, 255, 0.08); }

/* Auth */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(430px, 0.92fr); }
.auth-story {
  position: relative; overflow: hidden; display: flex; flex-direction: column;
  padding: 38px 54px 34px; color: #f2f6e9; background: var(--forest);
  isolation: isolate;
}
.auth-story::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0.18;
  background-image: radial-gradient(rgba(255,255,255,0.5) 0.7px, transparent 0.7px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
}
.story-glow { position: absolute; border-radius: 999px; filter: blur(2px); pointer-events: none; z-index: -1; }
.story-glow-a { width: 560px; height: 560px; right: -210px; top: -190px; background: radial-gradient(circle, rgba(200, 241, 105, 0.2), transparent 66%); }
.story-glow-b { width: 620px; height: 620px; left: -290px; bottom: -330px; background: radial-gradient(circle, rgba(90, 190, 150, 0.23), transparent 68%); }
.story-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.story-eyebrow {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em;
  color: #b8d0c5; border: 1px solid rgba(255,255,255,0.16); border-radius: 999px; padding: 7px 12px;
}
.story-copy { max-width: 570px; margin: auto 0; padding: 58px 0 44px; }
.kicker {
  margin: 0 0 14px; font-size: 11px; font-weight: 800; letter-spacing: 0.16em;
  text-transform: uppercase; color: #9cbeaf;
}
.kicker.ink { color: var(--muted); }
.story-copy h1 {
  font-family: var(--serif); font-weight: 400; font-size: clamp(42px, 4.5vw, 70px);
  line-height: 0.98; letter-spacing: -0.035em; margin: 0 0 24px;
}
.story-copy h1 em { font-style: italic; color: var(--lime); }
.story-lede { max-width: 470px; margin: 0 0 38px; color: #c4d8cd; font-size: 15px; line-height: 1.7; }
.story-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; max-width: 490px; }
.story-points li { display: flex; gap: 15px; align-items: flex-start; }
.point-icon {
  width: 31px; height: 31px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
  border: 1px solid rgba(200, 241, 105, 0.25); background: rgba(200, 241, 105, 0.08);
  color: var(--lime); font-size: 10px; font-weight: 800; letter-spacing: 0.04em;
}
.story-points strong { display: block; font-size: 13.5px; color: #f1f5e9; margin-bottom: 2px; }
.story-points small { display: block; font-size: 12px; color: #9db6aa; line-height: 1.55; }
.story-foot {
  display: flex; align-items: center; gap: 10px; color: #9db6aa;
  font-size: 11px; letter-spacing: 0.02em; padding-top: 26px; border-top: 1px solid rgba(255,255,255,0.1);
}
.story-rule { width: 22px; height: 1px; background: rgba(255,255,255,0.22); }
.live-dot { width: 7px; height: 7px; border-radius: 999px; background: var(--lime); box-shadow: 0 0 0 4px rgba(200,241,105,0.12); flex: none; }

.auth-panel { background: var(--paper); display: grid; place-items: center; padding: 32px; overflow-y: auto; }
.auth-panel-inner { width: min(424px, 100%); padding: 20px 0; }
.auth-mobile-brand { display: none; align-items: center; gap: 10px; margin-bottom: 40px; }
.auth-mobile-brand .brand-mark { background: var(--forest); color: var(--lime); }
.login-form h2 { font-family: var(--serif); font-weight: 400; font-size: 43px; letter-spacing: -0.035em; line-height: 1; margin: 0 0 13px; }
.auth-sub { color: var(--muted); font-size: 13.5px; line-height: 1.65; margin: 0 0 30px; max-width: 370px; }
.field { display: grid; gap: 8px; margin-bottom: 10px; }
.field > span { font-size: 11.5px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.phone-field { display: flex; align-items: center; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 13px; overflow: hidden; transition: border 150ms ease, box-shadow 150ms ease; }
.phone-field:focus-within { border-color: var(--forest-3); box-shadow: 0 0 0 3px rgba(25, 99, 82, 0.11); }
.phone-prefix { padding: 0 0 0 16px; font-weight: 700; color: var(--muted); font-size: 14px; }
.phone-field input, .field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--line-strong); background: var(--surface);
  border-radius: 13px; padding: 14px 15px; font-size: 15px; font-weight: 600;
  outline: none; transition: border 150ms ease, box-shadow 150ms ease;
}
.phone-field input { border: 0; background: transparent; padding: 14px 15px 14px 8px; letter-spacing: 0.04em; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--forest-3); box-shadow: 0 0 0 3px rgba(25, 99, 82, 0.11); }
.field input::placeholder, .field textarea::placeholder { color: #9aa69f; font-weight: 500; }
.otp-input { font-size: 24px !important; letter-spacing: 0.35em; text-align: center; font-weight: 700 !important; padding: 13px 10px !important; }
.field-hint { margin: 0 0 22px; color: var(--muted-2); font-size: 11.5px; line-height: 1.5; }
.form-error { min-height: 18px; margin: 11px 0 0; color: #a23e2d; font-size: 12px; font-weight: 600; line-height: 1.45; }
.demo-code-hint { margin: 8px 0 14px; padding: 9px 11px; border-radius: 9px; background: var(--mint); color: var(--forest-2); font-size: 11.5px; font-weight: 700; }
.back-button { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 28px; color: var(--muted); font-size: 12px; }
.back-button svg { width: 15px; height: 15px; }
.resend-button { margin-top: 16px; font-size: 12px; color: var(--muted); font-weight: 600; }
.demo-box { margin-top: 28px; padding: 17px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255, 253, 248, 0.66); }
.demo-box-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; }
.demo-dot { width: 6px; height: 6px; border-radius: 999px; background: var(--amber); box-shadow: 0 0 0 3px rgba(233,162,59,0.16); }
.demo-accounts { display: grid; gap: 7px; }
.demo-account {
  display: flex; align-items: center; gap: 10px; width: 100%; border: 1px solid transparent;
  background: var(--surface); border-radius: 11px; padding: 9px 10px; text-align: left;
  transition: border 150ms ease, transform 150ms ease;
}
.demo-account:hover { border-color: var(--line-strong); transform: translateX(2px); }
.demo-avatar { width: 29px; height: 29px; border-radius: 8px; background: var(--mint); color: var(--forest); display: grid; place-items: center; font-size: 9px; font-weight: 800; flex: none; }
.demo-avatar.alt { background: var(--blue-soft); color: #365d82; }
.demo-account strong { display: block; font-size: 11.5px; line-height: 1.3; }
.demo-account small { display: block; font-size: 10.5px; color: var(--muted-2); margin-top: 1px; }
.demo-note { margin: 11px 0 0; color: var(--muted-2); font-size: 10px; line-height: 1.5; }
.demo-note code { font-size: 9.5px; background: var(--paper-2); padding: 2px 4px; border-radius: 4px; }
.legal-copy { margin: 22px 0 0; color: var(--muted-2); font-size: 10px; line-height: 1.6; }

/* Boot */
.boot-view { min-height: 100vh; display: grid; place-items: center; align-content: center; gap: 18px; background: var(--forest); color: #c8dacf; }
.boot-mark { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 18px; background: rgba(255,255,255,0.06); animation: breathe 1.8s ease-in-out infinite; }
.boot-mark .brand-mark { width: 44px; height: 44px; border-radius: 13px; }
.boot-view p { margin: 0; font-size: 12px; letter-spacing: 0.02em; }
@keyframes breathe { 0%,100% { transform: scale(1); opacity: 0.9; } 50% { transform: scale(1.05); opacity: 1; } }

/* App shell */
.app-shell { min-height: 100vh; display: flex; background: var(--paper); }
.sidebar {
  width: 256px; flex: none; display: flex; flex-direction: column;
  min-height: 100vh; padding: 24px 16px 18px;
  background: var(--forest); color: #d7e4dc;
  position: sticky; top: 0; height: 100vh; z-index: 30;
}
.sidebar-top { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 26px; }
.sidebar-close { display: none; }
.org-card { margin: 0 2px 24px; padding: 13px; border-radius: 13px; background: rgba(255, 255, 255, 0.055); border: 1px solid rgba(255,255,255,0.08); }
.org-card-label { display: block; font-size: 9px; text-transform: uppercase; letter-spacing: 0.14em; color: #86a89a; font-weight: 800; margin-bottom: 9px; }
.org-card-row { display: flex; align-items: center; gap: 9px; }
.org-avatar { width: 30px; height: 30px; border-radius: 8px; background: var(--lime); color: var(--forest); display: grid; place-items: center; font-size: 11px; font-weight: 800; flex: none; }
.org-card-copy { min-width: 0; }
.org-card-copy strong { display: block; font-size: 11.5px; color: #f0f6ea; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org-card-copy span { display: block; font-size: 9.5px; color: #8eac9e; margin-top: 1px; }
.mini-status { display: inline-flex; align-items: center; margin-top: 10px; padding: 3px 7px; border-radius: 999px; font-size: 8.5px; font-weight: 700; letter-spacing: 0.02em; background: rgba(233, 162, 59, 0.13); color: #ecc37f; }
.mini-status.verified { background: rgba(200, 241, 105, 0.12); color: var(--lime); }
.nav-list { display: grid; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 11px; border-radius: 10px;
  color: #a8c1b5; font-size: 12.5px; font-weight: 600; transition: background 140ms ease, color 140ms ease;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: #eaf2e8; }
.nav-item.active { background: rgba(200, 241, 105, 0.12); color: #f0f8e3; }
.nav-item.active .nav-icon { color: var(--lime); }
.nav-icon { width: 18px; height: 18px; display: grid; place-items: center; color: #82a596; }
.nav-icon svg { width: 17px; height: 17px; }
.nav-count { margin-left: auto; min-width: 20px; height: 18px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center; background: var(--lime); color: var(--forest); font-size: 9px; font-weight: 800; }
.sidebar-spacer { flex: 1; min-height: 24px; }
.side-note { display: flex; gap: 9px; padding: 12px 10px; border-top: 1px solid rgba(255,255,255,0.08); border-bottom: 1px solid rgba(255,255,255,0.08); margin-bottom: 12px; }
.side-note-icon { color: #7fa392; flex: none; }
.side-note-icon svg { width: 15px; height: 15px; }
.side-note p { margin: 0; font-size: 9.5px; line-height: 1.55; color: #829f90; }
.account-block { display: flex; align-items: center; gap: 9px; padding: 8px 4px 0; }
.account-avatar { width: 31px; height: 31px; border-radius: 999px; background: #245a4c; color: #dff0e6; display: grid; place-items: center; font-size: 10px; font-weight: 800; flex: none; }
.account-copy { min-width: 0; flex: 1; }
.account-copy strong { display: block; font-size: 10.5px; color: #eff5ea; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-copy span { display: block; font-size: 9px; color: #88a79a; }
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  min-height: 86px; display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 18px 34px; background: rgba(243, 241, 234, 0.9); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
}
.topbar-left { display: flex; align-items: center; gap: 13px; min-width: 0; }
.topbar-kicker { margin: 0 0 2px; font-size: 9px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted-2); }
.topbar h1 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 27px; letter-spacing: -0.03em; line-height: 1; }
.menu-button { display: none; }
.topbar-right { display: flex; align-items: center; gap: 9px; }
.org-select-wrap {
  display: flex; align-items: center; gap: 7px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 11px; padding: 0 10px; box-shadow: var(--shadow-sm); max-width: 300px;
}
.org-select-icon { color: var(--forest-3); display: grid; place-items: center; }
.org-select-icon svg { width: 15px; height: 15px; }
.org-select-wrap select { border: 0; background: transparent; padding: 10px 22px 10px 0; font-size: 11.5px; font-weight: 700; outline: none; max-width: 235px; cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='m6 9 6 6 6-6' stroke='%23667870' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0 center;
}
.main-content { padding: 32px 34px 56px; max-width: 1420px; width: 100%; margin: 0 auto; }
.page { animation: page-in 280ms cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes page-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
.page-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 27px; }
.page-intro h2 { margin: 0 0 7px; font-family: var(--serif); font-weight: 400; font-size: 38px; letter-spacing: -0.035em; line-height: 1.02; }
.page-lede { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.55; max-width: 540px; }
.queue-live { display: flex; align-items: center; gap: 7px; white-space: nowrap; color: var(--muted); font-size: 10px; font-weight: 700; padding-bottom: 5px; }
.queue-live .live-dot { width: 6px; height: 6px; background: var(--good); box-shadow: 0 0 0 3px rgba(44,122,94,0.12); }

/* Stats */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.stat-card { padding: 17px 18px 15px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.stat-card::after { content: ""; position: absolute; width: 100px; height: 100px; right: -42px; top: -48px; border-radius: 999px; background: var(--paper-2); opacity: 0.62; }
.stat-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 11px; position: relative; z-index: 1; }
.stat-top > span:first-child { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 800; color: var(--muted); }
.stat-icon { width: 27px; height: 27px; border-radius: 8px; display: grid; place-items: center; background: var(--paper-2); color: var(--ink-2); }
.stat-icon svg { width: 14px; height: 14px; }
.stat-card strong { display: block; font-size: 32px; font-weight: 700; letter-spacing: -0.05em; line-height: 1; position: relative; z-index: 1; }
.stat-card small { display: block; margin-top: 6px; font-size: 9.5px; color: var(--muted-2); line-height: 1.35; position: relative; z-index: 1; }
.stat-warn .stat-icon { background: var(--amber-soft); color: #a86c10; }
.stat-info .stat-icon { background: var(--blue-soft); color: #3d6a93; }
.stat-good .stat-icon { background: var(--good-soft); color: var(--good); }
.stat-ink .stat-icon { background: var(--mint); color: var(--forest-2); }
.stat-warn strong { color: #a86c10; }
.stat-info strong { color: #3d6a93; }
.stat-good strong { color: var(--good); }
.stat-ink strong { color: var(--forest); }

/* Queue */
.queue-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }
.queue-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: rgba(248, 246, 239, 0.55); }
.filter-tabs { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; }
.filter-tab { border: 0; background: transparent; border-radius: 8px; padding: 7px 9px; font-size: 10.5px; font-weight: 700; color: var(--muted); transition: background 140ms ease, color 140ms ease; white-space: nowrap; }
.filter-tab:hover { background: var(--paper-2); color: var(--ink); }
.filter-tab.active { background: var(--forest); color: #f5f8eb; }
.filter-tab .tab-count { display: inline-grid; place-items: center; min-width: 16px; height: 15px; padding: 0 4px; margin-left: 3px; border-radius: 999px; background: rgba(20,35,31,0.08); color: inherit; font-size: 8.5px; }
.filter-tab.active .tab-count { background: rgba(255,255,255,0.18); }
.search-field { display: flex; align-items: center; gap: 7px; min-width: 230px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); padding: 0 9px; }
.search-field svg { width: 14px; height: 14px; color: var(--muted-2); flex: none; }
.search-field input { width: 100%; border: 0; background: transparent; outline: none; padding: 8px 0; font-size: 11px; }
.search-field:focus-within { border-color: var(--forest-3); box-shadow: 0 0 0 3px rgba(25,99,82,0.08); }
.queue-content { min-height: 260px; }
.queue-foot { display: flex; justify-content: space-between; gap: 14px; padding: 11px 18px; border-top: 1px solid var(--line); color: var(--muted-2); font-size: 9.5px; background: rgba(248,246,239,0.48); }
.queue-foot-note { color: #97a49c; }
.table-scroll { overflow-x: auto; }
.orders-table { width: 100%; border-collapse: collapse; min-width: 830px; }
.orders-table th { text-align: left; font-size: 8.5px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 800; color: var(--muted-2); padding: 12px 14px; border-bottom: 1px solid var(--line); background: rgba(248,246,239,0.42); white-space: nowrap; }
.orders-table td { padding: 13px 14px; border-bottom: 1px solid #ecece2; vertical-align: middle; font-size: 11.5px; }
.orders-table tr:last-child td { border-bottom: 0; }
.order-row { cursor: pointer; transition: background 130ms ease; }
.order-row:hover { background: #faf9f2; }
.order-row:focus-visible { outline: 2px solid var(--forest-3); outline-offset: -2px; }
.order-id { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10.5px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.order-id span { color: var(--muted-2); }
.order-medicine { font-weight: 700; color: var(--ink); display: block; max-width: 190px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.order-medicine small { display: block; font-weight: 500; color: var(--muted-2); font-size: 9.5px; margin-top: 2px; }
.customer-name { font-weight: 600; display: block; max-width: 155px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.customer-sub { display: block; color: var(--muted-2); font-size: 9.5px; margin-top: 2px; }
.money { font-weight: 700; white-space: nowrap; }
.pay-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 9px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.pay-pill svg { width: 11px; height: 11px; }
.status-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 999px; font-size: 9px; font-weight: 800; white-space: nowrap; letter-spacing: 0.01em; }
.status-badge::before { content: ""; width: 5px; height: 5px; border-radius: 999px; background: currentColor; }
.status-pending_pharmacist_review { color: #99610d; background: var(--amber-soft); }
.status-pharmacist_verified { color: #3d6a93; background: var(--blue-soft); }
.status-ready_for_dispatch { color: var(--good); background: var(--good-soft); }
.status-out_for_delivery { color: #576a2e; background: #eef2dc; }
.status-delivered { color: #386250; background: var(--mint); }
.status-rejected, .status-cancelled { color: #a23e2d; background: var(--coral-soft); }
.row-chevron { color: #a9b3ac; display: grid; place-items: center; }
.row-chevron svg { width: 14px; height: 14px; }
.table-empty, .table-loading { padding: 54px 24px; text-align: center; }
.empty-art { width: 52px; height: 52px; border-radius: 15px; margin: 0 auto 13px; display: grid; place-items: center; background: var(--mint); color: var(--forest-2); }
.empty-art svg { width: 23px; height: 23px; }
.table-empty h3 { margin: 0 0 5px; font-family: var(--serif); font-weight: 400; font-size: 20px; letter-spacing: -0.02em; }
.table-empty p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.table-loading p { margin: 10px 0 0; color: var(--muted); font-size: 11px; }
.skeleton-line { height: 10px; border-radius: 999px; background: linear-gradient(90deg, #ebeae0 25%, #f5f4eb 50%, #ebeae0 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; margin: 12px auto; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Pharmacies */
.pharmacy-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.pharmacy-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; transition: transform 180ms ease, box-shadow 180ms ease; }
.pharmacy-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.pharmacy-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 17px; }
.pharmacy-identity { display: flex; gap: 11px; min-width: 0; }
.pharmacy-logo { width: 42px; height: 42px; border-radius: 11px; background: var(--mint); color: var(--forest); display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; }
.pharmacy-identity h3 { margin: 0 0 3px; font-size: 14px; line-height: 1.25; letter-spacing: -0.02em; }
.pharmacy-identity p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
.verification-chip { font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.07em; padding: 4px 7px; border-radius: 999px; white-space: nowrap; background: var(--amber-soft); color: #96610f; }
.verification-chip.verified { background: var(--good-soft); color: var(--good); }
.pharmacy-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 18px; }
.meta-cell { padding: 9px 10px; border-radius: 9px; background: var(--surface-2); border: 1px solid #eeede4; }
.meta-cell span { display: block; font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.09em; color: var(--muted-2); margin-bottom: 3px; }
.meta-cell strong { display: block; font-size: 10.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta-cell small { display: block; font-size: 9px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pharmacy-stats { display: flex; gap: 16px; padding: 13px 0; border-top: 1px solid var(--line); margin-top: auto; }
.pharmacy-stat { display: grid; gap: 1px; }
.pharmacy-stat strong { font-size: 16px; letter-spacing: -0.03em; line-height: 1.1; }
.pharmacy-stat span { font-size: 8px; color: var(--muted-2); text-transform: uppercase; letter-spacing: 0.07em; font-weight: 700; }
.pharmacy-actions { display: flex; gap: 7px; margin-top: 15px; }
.pharmacy-actions .button { flex: 1; font-size: 10px; padding: 9px 11px; }
.pharmacy-empty { grid-column: 1 / -1; padding: 60px 24px; border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); text-align: center; background: rgba(255,253,248,0.5); }
.pharmacy-empty h3 { margin: 0 0 6px; font-family: var(--serif); font-weight: 400; font-size: 22px; }
.pharmacy-empty p { margin: 0 0 16px; color: var(--muted); font-size: 11px; }

/* Drawer */
.drawer-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(11, 31, 25, 0.34); backdrop-filter: blur(3px); animation: fade-in 180ms ease; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 61; width: min(510px, 100%); background: var(--surface);
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  animation: drawer-in 320ms cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes drawer-in { from { transform: translateX(28px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.drawer-head { padding: 20px 23px 17px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.drawer-kicker { margin: 0 0 4px; font-size: 8.5px; letter-spacing: 0.13em; text-transform: uppercase; font-weight: 800; color: var(--muted-2); }
.drawer-head h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 25px; letter-spacing: -0.03em; line-height: 1.05; }
.drawer-body { padding: 22px 23px; overflow-y: auto; flex: 1; }
.drawer-foot { padding: 15px 23px 19px; border-top: 1px solid var(--line); background: var(--surface-2); }
.order-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0 17px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.order-total { font-size: 25px; font-weight: 700; letter-spacing: -0.05em; line-height: 1; }
.order-total small { display: block; margin-top: 4px; font-size: 8px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted-2); font-weight: 800; }
.detail-block { margin-bottom: 20px; }
.detail-label { margin: 0 0 8px; font-size: 8.5px; text-transform: uppercase; letter-spacing: 0.11em; font-weight: 800; color: var(--muted-2); }
.detail-row { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 9px; }
.detail-row:last-child { margin-bottom: 0; }
.detail-icon { width: 24px; height: 24px; border-radius: 7px; background: var(--paper-2); color: var(--ink-2); display: grid; place-items: center; flex: none; }
.detail-icon svg { width: 13px; height: 13px; }
.detail-row strong { display: block; font-size: 11px; line-height: 1.45; font-weight: 700; }
.detail-row span { display: block; font-size: 9.5px; color: var(--muted); margin-top: 1px; line-height: 1.45; }
.medicine-line { display: flex; justify-content: space-between; gap: 12px; padding: 11px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid #eeede4; }
.medicine-line strong { font-size: 11px; }
.medicine-line span { font-size: 9.5px; color: var(--muted); display: block; margin-top: 2px; }
.medicine-line .line-total { font-size: 12px; font-weight: 700; white-space: nowrap; }
.note-box { padding: 11px 12px; border-radius: 10px; background: var(--amber-soft); color: #6f4a12; font-size: 10.5px; line-height: 1.55; border: 1px solid #f0dcba; }
.note-box.rejected { background: var(--coral-soft); color: #7d3024; border-color: #efc9c0; }
.timeline { display: grid; gap: 0; margin: 4px 0 20px; }
.timeline-step { display: flex; gap: 10px; position: relative; padding-bottom: 14px; }
.timeline-step:last-child { padding-bottom: 0; }
.timeline-step::before { content: ""; position: absolute; left: 5px; top: 12px; bottom: 0; width: 1px; background: var(--line); }
.timeline-step:last-child::before { display: none; }
.timeline-dot { width: 11px; height: 11px; border-radius: 999px; border: 2px solid var(--line-strong); background: var(--surface); flex: none; margin-top: 1px; z-index: 1; }
.timeline-step.done .timeline-dot { background: var(--forest); border-color: var(--forest); }
.timeline-step.current .timeline-dot { border-color: var(--forest); box-shadow: 0 0 0 3px rgba(25,99,82,0.12); background: var(--lime); }
.timeline-copy strong { display: block; font-size: 10.5px; color: var(--muted); font-weight: 600; }
.timeline-step.done .timeline-copy strong, .timeline-step.current .timeline-copy strong { color: var(--ink); font-weight: 700; }
.timeline-copy span { display: block; font-size: 9px; color: var(--muted-2); margin-top: 1px; }
.decision-notes { display: grid; gap: 6px; margin-bottom: 11px; }
.decision-notes label { font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.decision-notes textarea { width: 100%; min-height: 72px; resize: vertical; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); padding: 10px 11px; font-size: 11px; outline: none; }
.decision-notes textarea:focus { border-color: var(--forest-3); box-shadow: 0 0 0 3px rgba(25,99,82,0.1); }
.decision-error { min-height: 14px; margin: 0 0 5px; font-size: 10px; color: #a23e2d; font-weight: 600; }
.action-row { display: flex; gap: 7px; }
.action-row .button { flex: 1; font-size: 10.5px; padding: 11px 12px; }
.action-row .button + .button { flex: 0.72; }
.action-hint { margin: 9px 0 0; font-size: 9px; color: var(--muted-2); line-height: 1.45; }
.drawer-empty { padding: 30px 0; text-align: center; color: var(--muted); font-size: 11px; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(11,31,25,0.4); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 22px; animation: fade-in 160ms ease; }
.modal { width: min(510px, 100%); max-height: calc(100vh - 44px); overflow-y: auto; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-lg); animation: modal-in 240ms cubic-bezier(0.22,1,0.36,1); }
@keyframes modal-in { from { transform: translateY(12px) scale(0.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 21px 23px 15px; }
.modal-head h2 { margin: 0 0 3px; font-family: var(--serif); font-weight: 400; font-size: 25px; letter-spacing: -0.03em; }
.modal-head p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.modal-body { padding: 0 23px 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-grid .field.full { grid-column: 1 / -1; }
.form-grid .field { margin-bottom: 0; gap: 6px; }
.form-grid .field > span { font-size: 9px; }
.form-grid .field input { padding: 10px 11px; font-size: 12px; border-radius: 9px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 23px 18px; border-top: 1px solid var(--line); background: var(--surface-2); }
.modal-foot .button { font-size: 11px; padding: 10px 14px; }
.modal-error { min-height: 16px; margin: 9px 0 0; font-size: 10.5px; color: #a23e2d; font-weight: 600; }

/* Toasts */
.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: grid; gap: 8px; max-width: 360px; }
.toast { display: flex; gap: 9px; align-items: flex-start; background: var(--forest); color: #eef5e7; padding: 12px 14px; border-radius: 11px; box-shadow: var(--shadow-lg); font-size: 11px; line-height: 1.45; animation: toast-in 260ms cubic-bezier(0.22,1,0.36,1); border: 1px solid rgba(255,255,255,0.1); }
.toast.error { background: #7d3024; }
.toast-icon { width: 16px; height: 16px; flex: none; color: var(--lime); margin-top: 1px; }
.toast.error .toast-icon { color: #ffc9bf; }
.toast strong { display: block; font-size: 10.5px; }
.toast span { display: block; color: #bdd2c4; font-size: 10px; margin-top: 1px; }
.toast.error span { color: #f2c8c0; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Responsive */
@media (max-width: 1150px) {
  .auth-story { padding: 32px 38px; }
  .story-copy h1 { font-size: 48px; }
  .main-content { padding: 26px 24px 48px; }
  .topbar { padding: 16px 24px; }
  .sidebar { width: 232px; }
  .stat-card strong { font-size: 28px; }
}
@media (max-width: 960px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-story { display: none; }
  .auth-panel { min-height: 100vh; padding: 24px; }
  .auth-mobile-brand { display: flex; }
  .auth-panel-inner { padding: 8px 0 24px; }
  .pharmacy-grid { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); transition: transform 240ms cubic-bezier(0.22,1,0.36,1); box-shadow: var(--shadow-lg); width: 268px; }
  .sidebar.open { transform: none; }
  .sidebar-close { display: grid; }
  .sidebar-overlay { position: fixed; inset: 0; z-index: 25; background: rgba(11,31,25,0.35); backdrop-filter: blur(2px); }
  .menu-button { display: grid; }
  .topbar { min-height: 76px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .topbar { padding: 13px 17px; gap: 10px; }
  .topbar h1 { font-size: 23px; }
  .topbar-kicker { display: none; }
  .topbar-right { gap: 7px; }
  .org-select-wrap { max-width: 175px; }
  .org-select-wrap select { max-width: 130px; font-size: 10px; padding-right: 16px; }
  .button-quiet span { display: none; }
  .button-quiet { padding: 9px; width: 36px; height: 36px; }
  .button-quiet svg { width: 16px; height: 16px; }
  .main-content { padding: 21px 16px 42px; }
  .page-intro { align-items: flex-start; flex-direction: column; gap: 15px; margin-bottom: 20px; }
  .page-intro h2 { font-size: 32px; }
  .page-lede { font-size: 11.5px; }
  .queue-live { display: none; }
  .stat-grid { gap: 9px; margin-bottom: 16px; }
  .stat-card { padding: 13px 13px 12px; border-radius: 13px; }
  .stat-card strong { font-size: 25px; }
  .stat-card small { font-size: 8.5px; }
  .stat-top > span:first-child { font-size: 8.5px; }
  .stat-icon { width: 23px; height: 23px; }
  .stat-icon svg { width: 12px; height: 12px; }
  .queue-toolbar { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px 13px; }
  .filter-tabs { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; scrollbar-width: none; }
  .filter-tabs::-webkit-scrollbar { display: none; }
  .filter-tab { padding: 6px 8px; font-size: 9.5px; }
  .search-field { min-width: 0; width: 100%; }
  .queue-foot { flex-direction: column; gap: 3px; padding: 10px 13px; font-size: 8.5px; }
  .queue-foot-note { display: none; }
  .orders-table { min-width: 680px; }
  .orders-table th, .orders-table td { padding: 11px 12px; }
  .drawer { width: 100%; }
  .drawer-head { padding: 17px 18px 14px; }
  .drawer-body { padding: 18px; }
  .drawer-foot { padding: 13px 18px 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .modal { border-radius: 16px; }
  .modal-head { padding: 18px 18px 13px; }
  .modal-body { padding: 0 18px 16px; }
  .modal-foot { padding: 12px 18px 15px; }
  .toast-region { right: 12px; left: 12px; bottom: 12px; max-width: none; }
  .pharmacy-card { padding: 17px; }
  .pharmacy-meta { gap: 6px; }
  .pharmacy-stats { gap: 12px; }
}
@media (max-width: 420px) {
  .auth-panel { padding: 18px; }
  .login-form h2 { font-size: 36px; }
  .topbar { flex-wrap: wrap; }
  .topbar-right { width: 100%; justify-content: space-between; }
  .org-select-wrap { display: flex; flex: 1; max-width: none; }
  .org-select-wrap select { width: 100%; max-width: none; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .pharmacy-meta { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

body.drawer-open { overflow: hidden; }
.required-mark { margin-left: 4px; font-size: 8px; font-weight: 800; letter-spacing: 0.04em; text-transform: none; color: #a86c10; }
.optional-mark { margin-left: 4px; font-size: 8px; font-weight: 600; letter-spacing: 0.02em; text-transform: none; color: var(--muted-2); }
