/* ============================================================
   InClin — modern clinic UI
   ============================================================ */

:root {
  --bg: #f3f6f8;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e6ebf1;
  --line-strong: #d7dfe8;
  --brand: #0d9488;
  --brand-600: #0f766e;
  --brand-700: #115e59;
  --brand-50: #ecfdf9;
  --brand-100: #ccfbef;
  --accent: #6366f1;
  --danger: #dc2626;
  --danger-50: #fef2f2;
  --warn: #b45309;
  --warn-50: #fffbeb;
  --ok: #15803d;
  --ok-50: #f0fdf4;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 10px 30px -18px rgba(15, 23, 42, .22);
  --shadow-lg: 0 30px 70px -30px rgba(15, 23, 42, .35);
  --font: 'Plus Jakarta Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: none; }
button { font-family: inherit; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.02em; }
p { margin: 0; }
::selection { background: var(--brand-100); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.strong { font-weight: 700; }
.mono { font-variant-numeric: tabular-nums; }
.ico { width: 18px; height: 18px; flex: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 11px;
  border: 1.5px solid transparent;
  background: #fff;
  color: var(--ink);
  font: 600 13.5px/1.1 var(--font);
  cursor: pointer;
  transition: .16s ease;
  white-space: nowrap;
  text-decoration: none;
}
.btn .ico { width: 17px; height: 17px; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }
.btn-primary {
  background: linear-gradient(135deg, #10b3a3, #0d9488 45%, #0f766e);
  color: #fff;
  box-shadow: 0 12px 24px -12px rgba(13, 148, 136, .8);
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-outline { background: #fff; border-color: var(--line-strong); color: var(--ink-2); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand-700); background: var(--brand-50); }
.btn-soft { background: var(--brand-50); color: var(--brand-700); border-color: #c8f3e9; }
.btn-soft:hover { background: var(--brand-100); }
.btn-danger { background: var(--danger-50); color: var(--danger); border-color: #fecaca; }
.btn-danger:hover { background: #fee2e2; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.btn-dark { background: #0f172a; color: #fff; }
.btn-sm { padding: 7px 11px; font-size: 12.5px; border-radius: 9px; }
.btn-lg { padding: 14px 22px; font-size: 15px; border-radius: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  cursor: pointer;
  transition: .15s;
}
.icon-btn:hover { border-color: var(--brand); color: var(--brand-700); }

/* ---------- Shell / sidebar ---------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 250px;
  flex: 0 0 250px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 18px 12px 14px;
  color: #cbd5e1;
  background:
    radial-gradient(420px 220px at 10% 0%, rgba(13, 148, 136, .25), transparent 70%),
    linear-gradient(180deg, #0b1220 0%, #0c1a29 55%, #0a2b26 100%);
  z-index: 40;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 10px 18px;
  color: #fff;
}
.brand-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #04221e;
  font-weight: 800;
  font-size: 20px;
  background: linear-gradient(135deg, #5eead4, #14b8a6 60%, #0d9488);
  box-shadow: 0 10px 22px -8px rgba(13, 148, 136, .8);
}
.brand-plus { width: 20px; height: 20px; stroke-width: 2.6; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text strong { font-size: 17px; font-weight: 800; letter-spacing: -.02em; }
.brand-text small { font-size: 11px; color: #94a3b8; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }

.nav { display: flex; flex-direction: column; gap: 3px; overflow-y: auto; flex: 1; padding: 2px 0 8px; }
.nav::-webkit-scrollbar { width: 5px; }
.nav::-webkit-scrollbar-thumb { background: #334155; }
.nav-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #64748b;
  padding: 14px 12px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #cbd5e1;
  font-size: 13.5px;
  font-weight: 500;
  transition: .15s;
}
.nav-ico { width: 18px; height: 18px; opacity: .8; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(13, 148, 136, .95), rgba(13, 148, 136, .5));
  color: #fff;
  box-shadow: 0 10px 22px -12px rgba(13, 148, 136, .9);
}
.nav-item.active .nav-ico { opacity: 1; }

.sidebar-foot { border-top: 1px solid rgba(255, 255, 255, .08); padding-top: 12px; margin-top: 4px; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 4px 8px; }
.side-user-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; flex: 1; }
.side-user-text strong { color: #fff; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-text small { color: #94a3b8; font-size: 11px; }
.side-logout { width: 32px; height: 32px; border: none; background: rgba(255, 255, 255, .06); color: #cbd5e1; }
.side-logout:hover { background: rgba(220, 38, 38, .25); color: #fecaca; }
.side-logout .ico { width: 16px; height: 16px; }

.avatar {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #14b8a6, #0f766e);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .02em;
}
.avatar-sm { width: 30px; height: 30px; flex-basis: 30px; font-size: 11px; }
.avatar-lg { width: 54px; height: 54px; flex-basis: 54px; font-size: 18px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.scrim { display: none; }
.menu-btn { display: none; }
.bottom-nav { display: none; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 28px;
  background: rgba(243, 246, 248, .86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(226, 232, 240, .85);
}
.topbar-title { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.topbar-title strong { font-size: 15.5px; font-weight: 700; letter-spacing: -.015em; }
.topbar-title span { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  box-shadow: var(--shadow);
}
.live-pill:hover { border-color: var(--brand); color: var(--brand-700); }
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 0 rgba(16, 185, 129, .5); animation: pulse 2s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, .5); }
  70% { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.user-pill { display: flex; align-items: center; gap: 9px; padding: 4px 10px 4px 4px; border-radius: 999px; background: #fff; border: 1px solid var(--line); }
.user-pill-text { display: flex; flex-direction: column; line-height: 1.2; }
.user-pill-text strong { font-size: 12px; font-weight: 700; }
.user-pill-text small { font-size: 10.5px; color: var(--muted); }

.page { width: 100%; max-width: 1280px; margin: 0 auto; padding: 24px 28px 70px; }
.page-wide { max-width: 1480px; }

/* ---------- Page heading ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-title { font-size: 23px; font-weight: 800; letter-spacing: -.025em; }
.page-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.page-actions { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }
.head-icon { width: 44px; height: 44px; border-radius: 13px; background: var(--brand-50); color: var(--brand-700); display: grid; place-items: center; }
.head-icon .ico { width: 22px; height: 22px; }

.section-title { font-size: 14.5px; font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }

/* ---------- Grids ---------- */
.grid { display: grid; gap: 16px; }
.grid-2 { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; gap: 20px; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; }
.split-2 { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); align-items: start; }
.stack > * + * { margin-top: 16px; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-title { font-size: 14.5px; font-weight: 700; }
.card-body { padding: 20px; }
.card-body.flush { padding: 0; }
.card-link { font-size: 12.5px; font-weight: 600; color: var(--brand-600); display: inline-flex; align-items: center; gap: 4px; }
.card-link .ico { width: 14px; height: 14px; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 16px 17px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: var(--shadow);
  transition: .16s ease;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-ico { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 12px; display: grid; place-items: center; }
.stat-ico .ico { width: 21px; height: 21px; }
.tint-teal { background: var(--brand-50); color: var(--brand-700); }
.tint-blue { background: #eff6ff; color: #1d4ed8; }
.tint-purple { background: #f5f3ff; color: #6d28d9; }
.tint-green { background: #f0fdf4; color: #15803d; }
.tint-amber { background: #fffbeb; color: #b45309; }
.tint-rose { background: #fff1f2; color: #be123c; }
.stat-text { display: flex; flex-direction: column; line-height: 1.2; }
.stat-value { font-size: 22px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 11.5px; color: var(--muted); font-weight: 600; margin-top: 3px; }

/* ---------- Platform console ---------- */
.mix-row { display: grid; grid-template-columns: 82px minmax(0, 1fr) minmax(0, auto); gap: 10px; align-items: center; padding: 7px 0; font-size: 12.5px; }
.mix-name { font-weight: 700; }
.mix-bar { height: 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.mix-fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #14b8a6, #0d9488); }
.mix-fill.over { background: linear-gradient(90deg, #f87171, #dc2626); }
.mix-val { text-align: right; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.plan-card { padding: 16px; box-shadow: none; }
.plan-card.current { border-color: #5eead4; box-shadow: 0 0 0 3px rgba(13, 148, 136, .1); }
.plan-price { font-size: 24px; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; }
.plan-price small { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.plan-card ul { margin: 4px 0 0; padding-left: 16px; font-size: 12px; color: var(--ink-2); line-height: 1.7; }
.attention-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.attention-row:last-child { border-bottom: 0; }
.attention-row .att-main { flex: 1; min-width: 0; }
.attention-row strong { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attention-row small { color: var(--muted); font-size: 11.5px; }
.usage-row { padding: 9px 0; border-bottom: 1px dashed var(--line); }
.usage-row:last-child { border-bottom: 0; }
.usage-top { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; margin-bottom: 6px; }
.usage-top strong { font-weight: 700; }
.usage-top span { color: var(--muted); font-variant-numeric: tabular-nums; }
.owner-box { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px dashed var(--line); margin-bottom: 10px; }
.owner-box .avatar { width: 46px; height: 46px; flex: 0 0 46px; font-size: 16px; }
.owner-box strong { display: block; font-size: 14px; }
.owner-box small { color: var(--muted); font-size: 12px; }
.team-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.team-row:last-child { border-bottom: 0; }
.team-row .team-main { flex: 1; min-width: 0; }
.team-row strong { display: block; font-size: 13px; }
.team-row small { color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }


/* ---------- Badges & chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .01em; white-space: nowrap; }
.b-amber { background: #fff7ed; color: #c2410c; }
.b-blue { background: #eff6ff; color: #1d4ed8; }
.b-purple { background: #f5f3ff; color: #6d28d9; }
.b-green { background: #f0fdf4; color: #15803d; }
.b-gray { background: #f1f5f9; color: #475569; }
.b-teal { background: var(--brand-50); color: var(--brand-700); }
.b-rose { background: #fff1f2; color: #be123c; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; color: var(--ink-2); font-weight: 500; }
.chip .ico { width: 14px; height: 14px; color: var(--muted); }

.p-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.p-cell .p-meta { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.p-cell .p-meta strong { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-cell .p-meta small { font-size: 11px; color: var(--muted); }

/* ---------- Tables ---------- */
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left;
  padding: 11px 14px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #fbfdfd; }
.table .num { font-variant-numeric: tabular-nums; }
.t-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 15px; }
.form-grid { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.form-grid .span-2 { grid-column: span 2; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.field .hint { font-size: 11px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: 500 13.5px/1.4 var(--font);
  transition: .15s;
}
.input::placeholder, .textarea::placeholder { color: #94a3b8; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(13, 148, 136, .13); }
.textarea { resize: vertical; min-height: 88px; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
.input-lg { padding: 13px 14px; font-size: 15px; border-radius: 12px; }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding-top: 4px; }
.form-actions .spacer { flex: 1; }
.inline-form { display: inline-flex; gap: 8px; align-items: center; }

.vitals-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.vital-box { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; text-align: center; }
.vital-box small { display: block; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.vital-box strong { display: block; font-size: 16px; font-weight: 800; margin-top: 2px; font-variant-numeric: tabular-nums; }
.vital-box strong span { font-size: 10px; font-weight: 600; color: var(--muted); margin-left: 2px; }

/* ---------- Banners, toasts, empty ---------- */
.banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 15px; border-radius: 12px; font-size: 13px; margin-bottom: 16px; border: 1px solid; }
.banner .ico { width: 18px; height: 18px; margin-top: 1px; }
.banner a { text-decoration: underline; font-weight: 600; }
.banner-warn { background: var(--warn-50); border-color: #fde68a; color: #92400e; }
.banner-danger { background: var(--danger-50); border-color: #fecaca; color: #991b1b; }
.banner-info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }

.toast {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 120;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 14px 12px 16px;
  border-radius: 12px;
  background: #0f172a;
  color: #f8fafc;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toast-in .3s ease;
  border-left: 4px solid var(--brand);
}
.toast-success { border-left-color: #10b981; }
.toast-error { border-left-color: #ef4444; }
.toast-info { border-left-color: #3b82f6; }
.toast-x { background: none; border: none; color: #94a3b8; font-size: 18px; line-height: 1; cursor: pointer; padding: 2px; }
.toast-x:hover { color: #fff; }
.toast-out { opacity: 0; transform: translateY(-8px); transition: .5s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } }

.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; padding: 46px 20px; color: var(--muted); }
.empty-ico { width: 54px; height: 54px; border-radius: 16px; background: var(--brand-50); color: var(--brand-600); display: grid; place-items: center; margin-bottom: 4px; }
.empty-ico .ico { width: 26px; height: 26px; }
.empty strong { color: var(--ink); font-size: 14.5px; }
.empty p { font-size: 12.5px; max-width: 360px; }

/* ---------- Queue components ---------- */
.queue-item { display: flex; align-items: center; gap: 14px; padding: 13px 20px; border-bottom: 1px solid var(--line); }
.queue-item:last-child { border-bottom: none; }
.queue-token {
  min-width: 54px;
  padding: 8px 8px;
  text-align: center;
  border-radius: 10px;
  background: var(--brand-50);
  border: 1px solid #bff0e5;
  color: var(--brand-700);
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.queue-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.queue-main strong { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue-main small { font-size: 11.5px; color: var(--muted); }
.queue-actions { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

.token-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 22px;
  border-radius: 16px;
  background: linear-gradient(135deg, #0d9488, #0f766e);
  color: #fff;
  box-shadow: 0 20px 40px -22px rgba(13, 148, 136, .9);
}
.token-hero small { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; opacity: .85; font-weight: 700; }
.token-hero strong { font-size: 40px; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.token-hero span { font-size: 11.5px; opacity: .9; }

.now-card {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  padding: 26px;
  color: #fff;
  background: linear-gradient(135deg, #0f172a, #115e59);
  box-shadow: var(--shadow-lg);
}
.now-card::after { content: ""; position: absolute; width: 240px; height: 240px; border-radius: 50%; right: -70px; top: -90px; background: rgba(45, 212, 191, .16); }
.now-card small { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; opacity: .75; font-weight: 700; }
.now-token { font-size: 56px; font-weight: 800; letter-spacing: -.04em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.now-name { font-size: 14px; opacity: .9; margin-top: 2px; }

/* ---------- Misc ---------- */
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.kv:last-child { border-bottom: none; }
.kv span { color: var(--muted); }
.kv strong { font-weight: 600; text-align: right; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.hr-space { height: 18px; }

.link-arrow { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--brand-600); }
.link-arrow .ico { width: 14px; height: 14px; }

.history-item { position: relative; padding: 0 0 18px 22px; border-left: 2px solid var(--line); }
.history-item:last-child { padding-bottom: 0; border-left-color: transparent; }
.history-item::before { content: ""; position: absolute; left: -6px; top: 2px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
.history-date { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.history-title { font-size: 13px; font-weight: 600; margin: 2px 0; }
.history-sub { font-size: 12px; color: var(--muted); }

.med-scroll { overflow-x: auto; }
.med-row { display: grid; grid-template-columns: 34px minmax(0, 1.4fr) minmax(0, .8fr) minmax(0, .9fr) minmax(0, .7fr) minmax(0, 1fr) 38px; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.med-row:last-child { border-bottom: none; }
.med-no { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 700; }
.med-row .input, .med-row .select { padding: 8px 9px; font-size: 12.5px; }
.med-head { display: grid; grid-template-columns: 34px minmax(0, 1.4fr) minmax(0, .8fr) minmax(0, .9fr) minmax(0, .7fr) minmax(0, 1fr) 38px; gap: 8px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding-bottom: 4px; }
.tpl-chips { display: flex; gap: 7px; flex-wrap: wrap; }
.tpl-chip { border: 1px solid var(--line); background: #fff; color: var(--ink-2); font-size: 11.5px; font-weight: 600; padding: 5px 10px; border-radius: 999px; cursor: pointer; transition: .15s; }
.tpl-chip:hover { border-color: var(--brand); color: var(--brand-700); background: var(--brand-50); }
.row-spacer { width: 38px; }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tab { padding: 9px 14px; font-size: 13px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.active { color: var(--brand-700); border-bottom-color: var(--brand); }

.qr-box { display: inline-flex; align-items: center; justify-content: center; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.qr-box img, .qr-box canvas { display: block; }

/* ============================================================
   Auth pages
   ============================================================ */
.auth-body { background: #0b1220; }
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.02fr .98fr; }
.auth-side {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 46px 52px;
  color: #e2e8f0;
  background:
    radial-gradient(900px 500px at 15% 5%, rgba(20, 184, 166, .32), transparent 62%),
    radial-gradient(700px 480px at 90% 95%, rgba(99, 102, 241, .3), transparent 60%),
    linear-gradient(160deg, #07111d, #0b1f2c 65%, #06302a);
}
.auth-side::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 30% 30%, #000, transparent 75%);
  pointer-events: none;
}
.auth-side > * { position: relative; z-index: 1; }
.auth-brand { display: flex; align-items: center; gap: 12px; color: #fff; }
.auth-brand strong { font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
.auth-brand small { display: block; font-size: 11px; color: #94a3b8; letter-spacing: .14em; text-transform: uppercase; margin-top: 2px; }
.auth-copy h2 { font-size: clamp(28px, 3.2vw, 40px); font-weight: 800; line-height: 1.15; letter-spacing: -.03em; color: #fff; }
.auth-copy h2 em { font-style: normal; background: linear-gradient(90deg, #5eead4, #99f6e4); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-copy p { margin-top: 14px; color: #94a3b8; font-size: 14px; max-width: 420px; line-height: 1.65; }
.auth-points { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-direction: column; gap: 12px; }
.auth-points li { display: flex; gap: 11px; align-items: center; font-size: 13.5px; color: #cbd5e1; }
.auth-points span { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: rgba(20, 184, 166, .18); color: #5eead4; flex: none; }
.auth-points span .ico { width: 15px; height: 15px; }
.auth-foot { font-size: 11.5px; color: #64748b; }

.auth-main { display: grid; place-items: center; padding: 36px 24px; background: var(--bg); }
.auth-card { width: 100%; max-width: 430px; background: #fff; border-radius: 22px; padding: 34px 32px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.auth-card h1 { font-size: 24px; font-weight: 800; letter-spacing: -.025em; }
.auth-card .auth-sub { color: var(--muted); font-size: 13px; margin-top: 5px; margin-bottom: 22px; }
.auth-switch { text-align: center; font-size: 12.5px; color: var(--muted); margin-top: 18px; }
.auth-switch a { font-weight: 700; color: var(--brand-600); }
.demo-box { margin-top: 20px; border: 1px dashed var(--line-strong); border-radius: 12px; padding: 12px 14px; background: var(--surface-2); font-size: 11.5px; color: var(--muted); }
.demo-box strong { color: var(--ink-2); display: block; margin-bottom: 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; }
.demo-box code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; background: #fff; border: 1px solid var(--line); padding: 1px 5px; border-radius: 5px; color: var(--ink-2); }

/* ============================================================
   Public booking page
   ============================================================ */
.pub-body { background: #f2f7f6; min-height: 100vh; }
.pub-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  background: rgba(255, 255, 255, .88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.pub-head .brand-mark { width: 36px; height: 36px; flex-basis: 36px; font-size: 18px; }
.pub-title { display: flex; flex-direction: column; line-height: 1.2; }
.pub-title strong { font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.pub-title small { font-size: 11px; color: var(--muted); }
.pub-head-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.pub-wrap { max-width: 1060px; margin: 0 auto; padding: 30px 20px 70px; }
.pub-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 22px; align-items: start; }
.pub-card { background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 26px; }
.pub-hero { padding: 26px; border-radius: 20px; color: #fff; background: linear-gradient(135deg, #0f172a, #115e59); position: relative; overflow: hidden; box-shadow: var(--shadow-lg); }
.pub-hero::after { content: ""; position: absolute; width: 220px; height: 220px; right: -80px; top: -100px; border-radius: 50%; background: rgba(45, 212, 191, .18); }
.pub-hero small { font-size: 10.5px; text-transform: uppercase; letter-spacing: .16em; opacity: .75; font-weight: 700; }
.pub-hero h1 { font-size: 26px; font-weight: 800; letter-spacing: -.03em; margin-top: 6px; line-height: 1.2; color: #fff; }
.pub-hero p { opacity: .8; font-size: 13px; margin-top: 8px; line-height: 1.6; }
.pub-hero .pub-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; position: relative; z-index: 1; }
.pub-meta span { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; padding: 5px 10px; border-radius: 999px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .14); }
.pub-meta .ico { width: 13px; height: 13px; }
.pub-form-title { font-size: 17px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 3px; }
.pub-form-sub { font-size: 12.5px; color: var(--muted); margin-bottom: 18px; }
.pub-note { display: flex; gap: 8px; font-size: 11.5px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-top: 14px; }
.pub-note .ico { width: 15px; height: 15px; flex: none; color: var(--brand-600); margin-top: 1px; }
.pub-side .pub-card + .pub-card { margin-top: 16px; }
.pub-step { display: flex; gap: 11px; align-items: flex-start; padding: 9px 0; }
.pub-step span { width: 24px; height: 24px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-700); font-size: 11px; font-weight: 800; }
.pub-step div { font-size: 12.5px; color: var(--ink-2); line-height: 1.45; }
.pub-step strong { font-weight: 700; color: var(--ink); }
.token-card { text-align: center; padding: 30px 24px; }
.token-ring { width: 148px; height: 148px; margin: 8px auto 18px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(from 210deg, #14b8a6, #0d9488, #0f766e, #14b8a6); padding: 8px; box-shadow: 0 24px 50px -22px rgba(13, 148, 136, .8); }
.token-ring-inner { width: 100%; height: 100%; border-radius: 50%; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.token-ring-inner small { font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.token-ring-inner strong { font-size: 42px; font-weight: 800; color: var(--brand-700); letter-spacing: -.04em; margin-top: 6px; }
.token-card h2 { font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
.token-card .muted { font-size: 13px; margin-top: 5px; }
.token-info { text-align: left; margin: 20px 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.token-info .kv { padding: 10px 14px; margin: 0; }
.token-info .kv:nth-child(odd) { background: var(--surface-2); }

/* ============================================================
   Live queue screen
   ============================================================ */
.screen-body {
  min-height: 100vh;
  color: #e2e8f0;
  background:
    radial-gradient(1100px 550px at 18% -10%, rgba(13, 148, 136, .38), transparent 65%),
    radial-gradient(900px 500px at 100% 110%, rgba(99, 102, 241, .25), transparent 60%),
    linear-gradient(160deg, #050c14, #0a1a24 55%, #05221f);
}
.screen-wrap { max-width: 1280px; margin: 0 auto; padding: 28px 30px 40px; min-height: 100vh; display: flex; flex-direction: column; }
.screen-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-bottom: 22px; border-bottom: 1px solid rgba(255, 255, 255, .09); }
.screen-brand { display: flex; align-items: center; gap: 13px; }
.screen-brand .brand-mark { width: 46px; height: 46px; flex-basis: 46px; border-radius: 14px; }
.screen-brand h1 { color: #fff; font-size: 22px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.screen-brand small { color: #94a3b8; font-size: 12px; }
.screen-clock { text-align: right; }
.screen-clock strong { display: block; font-size: 24px; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.screen-clock span { font-size: 12px; color: #94a3b8; }
.screen-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 24px; flex: 1; padding-top: 26px; }
.screen-now {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: linear-gradient(150deg, rgba(13, 148, 136, .94), rgba(15, 118, 110, .9) 55%, rgba(8, 47, 73, .95));
  box-shadow: 0 40px 90px -40px rgba(13, 148, 136, .75);
  border: 1px solid rgba(255, 255, 255, .12);
}
.screen-now::after { content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%; right: -140px; top: -160px; background: rgba(94, 234, 212, .14); }
.screen-now small { font-size: 13px; letter-spacing: .28em; text-transform: uppercase; font-weight: 700; color: #a7f3d0; }
.screen-now .big-token { font-size: clamp(86px, 12vw, 148px); font-weight: 800; letter-spacing: -.06em; line-height: .98; color: #fff; font-variant-numeric: tabular-nums; margin-top: 8px; }
.screen-now .big-name { font-size: clamp(20px, 2.4vw, 28px); font-weight: 700; color: #ecfeff; margin-top: 8px; }
.screen-now .screen-hint { margin-top: 24px; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: #ccfbf1; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .14); border-radius: 999px; padding: 8px 14px; width: fit-content; }
.screen-side { display: flex; flex-direction: column; gap: 18px; }
.screen-panel { background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1); border-radius: 22px; padding: 24px; backdrop-filter: blur(8px); }
.screen-panel h2 { font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: #94a3b8; font-weight: 700; }
.next-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; }
.next-list li { display: flex; align-items: center; gap: 16px; padding: 13px 0; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.next-list li:last-child { border-bottom: none; }
.next-list .nt { font-size: 26px; font-weight: 800; color: #5eead4; min-width: 86px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.next-list .nm { font-size: 16px; color: #e2e8f0; font-weight: 500; }
.next-list .empty-li { color: #64748b; font-size: 14px; padding: 20px 0; }
.screen-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, .09); margin-top: 22px; }
.screen-foot .scan { display: flex; align-items: center; gap: 14px; }
.screen-foot .scan .qr-box { background: #fff; padding: 8px; border-radius: 12px; }
.screen-foot .scan .qr-box canvas, .screen-foot .scan .qr-box img { width: 86px; height: 86px; }
.screen-foot .scan p { font-size: 12.5px; color: #94a3b8; max-width: 230px; line-height: 1.45; }
.screen-foot .scan strong { color: #fff; display: block; font-size: 13.5px; }
.screen-foot .live-dot { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: #94a3b8; }
.screen-empty { color: #94a3b8; font-size: 18px; font-weight: 500; }

/* ============================================================
   Landing
   ============================================================ */
.landing { background: #f5f8f9; }
.land-nav { max-width: 1160px; margin: 0 auto; padding: 20px 24px; display: flex; align-items: center; gap: 12px; }
.land-brand { display: flex; align-items: center; gap: 10px; }
.land-brand strong { font-size: 18px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.land-nav-right { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.hero {
  position: relative;
  max-width: 1160px;
  margin: 8px auto 0;
  padding: 52px 46px;
  border-radius: 28px;
  overflow: hidden;
  color: #e2e8f0;
  background:
    radial-gradient(800px 420px at 12% 0%, rgba(20, 184, 166, .35), transparent 60%),
    radial-gradient(700px 500px at 100% 100%, rgba(99, 102, 241, .3), transparent 60%),
    linear-gradient(150deg, #07111d, #0b1f2c 60%, #06302a);
  box-shadow: var(--shadow-lg);
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 40px; align-items: center; position: relative; z-index: 1; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: rgba(45, 212, 191, .12); border: 1px solid rgba(45, 212, 191, .25); color: #99f6e4; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.hero h1 { font-size: clamp(32px, 4.6vw, 50px); font-weight: 800; line-height: 1.08; letter-spacing: -.035em; color: #fff; margin-top: 18px; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, #5eead4, #99f6e4); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { margin-top: 16px; font-size: 15px; line-height: 1.7; color: #94a3b8; max-width: 480px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.hero-stats { display: flex; gap: 26px; margin-top: 34px; flex-wrap: wrap; }
.hero-stats div { line-height: 1.3; }
.hero-stats strong { display: block; font-size: 20px; font-weight: 800; color: #fff; letter-spacing: -.02em; }
.hero-stats span { font-size: 11.5px; color: #94a3b8; }
.hero-art { position: relative; }
.mock-card { background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .14); border-radius: 20px; padding: 22px; backdrop-filter: blur(10px); box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .6); }
.mock-card + .mock-card { margin-top: 14px; margin-left: 34px; }
.mock-label { font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: #94a3b8; font-weight: 700; }
.mock-token { font-size: 46px; font-weight: 800; letter-spacing: -.04em; color: #5eead4; line-height: 1.1; font-variant-numeric: tabular-nums; }
.mock-row { display: flex; align-items: center; gap: 10px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .1); margin-top: 12px; font-size: 12.5px; }
.mock-row span.dot { width: 8px; height: 8px; border-radius: 50%; background: #5eead4; box-shadow: 0 0 12px #5eead4; }
.mock-row .muted { color: #94a3b8; }
.mock-pill { margin-left: auto; font-size: 10.5px; padding: 3px 9px; border-radius: 999px; background: rgba(94, 234, 212, .14); color: #99f6e4; font-weight: 700; }
.land-section { max-width: 1160px; margin: 0 auto; padding: 64px 24px 0; }
.land-section-head { text-align: center; max-width: 640px; margin: 0 auto 36px; }
.land-section-head small { font-size: 11.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--brand-600); }
.land-section-head h2 { font-size: clamp(26px, 3vw, 34px); font-weight: 800; letter-spacing: -.03em; margin-top: 8px; }
.land-section-head p { color: var(--muted); font-size: 14px; margin-top: 10px; line-height: 1.6; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 24px; box-shadow: var(--shadow); }
.feature .f-ico { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-700); margin-bottom: 16px; }
.feature .f-ico .ico { width: 22px; height: 22px; }
.feature h3 { font-size: 15.5px; font-weight: 700; }
.feature p { color: var(--muted); font-size: 13px; line-height: 1.6; margin-top: 6px; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; counter-reset: step; }
.step-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 22px; position: relative; }
.step-num { width: 34px; height: 34px; border-radius: 10px; background: #0f172a; color: #5eead4; display: grid; place-items: center; font-weight: 800; font-size: 14px; margin-bottom: 14px; }
.step-card h4 { font-size: 14px; font-weight: 700; }
.step-card p { color: var(--muted); font-size: 12.5px; margin-top: 5px; line-height: 1.55; }
.land-cta { max-width: 1160px; margin: 64px auto 0; padding: 0 24px; }
.cta-card { border-radius: 24px; padding: 42px; text-align: center; color: #fff; background: linear-gradient(135deg, #0f766e, #0d9488 50%, #115e59); box-shadow: var(--shadow-lg); }
.cta-card h2 { font-size: clamp(24px, 3vw, 32px); font-weight: 800; letter-spacing: -.03em; }
.cta-card p { color: #ccfbf1; margin-top: 8px; font-size: 14px; }
.cta-card .hero-cta { justify-content: center; }
.land-foot { max-width: 1160px; margin: 0 auto; padding: 40px 24px 50px; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 12px; }

/* ============================================================
   Print documents
   ============================================================ */
.paper-body { background: #e8edf2; padding: 26px 14px 60px; }
.paper-toolbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  padding: 12px 14px;
  margin-bottom: 18px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.print-sheet {
  background: #fff;
  color: #111827;
  margin: 0 auto;
  box-shadow: 0 24px 60px -28px rgba(15, 23, 42, .45);
  border-radius: 6px;
  overflow: hidden;
}
.rx-sheet { width: 138mm; min-height: 198mm; padding: 8mm; }
.slip-sheet { width: 138mm; min-height: 198mm; padding: 7mm; }
.poster-sheet { width: 190mm; min-height: 277mm; padding: 13mm; }

.doc-head { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 10px; border-bottom: 2.5px solid #0f766e; }
.doc-clinic h1 { font-size: 20px; font-weight: 800; letter-spacing: -.02em; color: #0f172a; line-height: 1.15; }
.doc-clinic .doc-doc { font-size: 12px; font-weight: 700; color: #0f766e; margin-top: 3px; }
.doc-clinic p { font-size: 10.5px; color: #475569; margin-top: 2px; }
.doc-right { text-align: right; font-size: 10px; color: #475569; line-height: 1.5; max-width: 44%; }
.doc-rx-title { font-size: 10px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: #0f766e; }
.doc-patient { display: grid; grid-template-columns: 1.3fr 1fr; gap: 4px 18px; margin-top: 10px; font-size: 11px; }
.doc-patient div { display: flex; gap: 4px; }
.doc-patient span { color: #64748b; }
.doc-patient strong { font-weight: 600; color: #111827; }
.doc-vitals { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; margin-top: 10px; }
.doc-vitals div { border: 1px solid #dbe3ea; border-radius: 5px; padding: 4px 6px; text-align: center; }
.doc-vitals small { display: block; font-size: 7.5px; letter-spacing: .06em; text-transform: uppercase; color: #64748b; font-weight: 700; }
.doc-vitals strong { font-size: 11px; font-weight: 800; color: #111827; }
.doc-section { margin-top: 12px; }
.doc-section h3 { font-size: 8.5px; letter-spacing: .12em; text-transform: uppercase; color: #0f766e; font-weight: 800; margin-bottom: 3px; }
.doc-section p { font-size: 11px; line-height: 1.55; color: #1f2937; }
.doc-rx-symbol { font-family: Georgia, 'Times New Roman', serif; font-size: 30px; font-weight: 700; color: #0f766e; line-height: 1; }
.rx-table { width: 100%; border-collapse: collapse; margin-top: 4px; }
.rx-table th { text-align: left; font-size: 8px; letter-spacing: .06em; text-transform: uppercase; color: #64748b; border-bottom: 1px solid #0f766e; padding: 4px 5px; }
.rx-table td { font-size: 10.5px; padding: 5px; border-bottom: 1px solid #e5e7eb; vertical-align: top; }
.rx-table td:first-child { width: 26px; color: #64748b; font-weight: 700; }
.doc-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-top: 16px; padding-top: 8px; border-top: 1px dashed #cbd5e1; font-size: 9px; color: #64748b; }
.doc-sign { text-align: center; min-width: 120px; }
.doc-sign .sig-line { border-top: 1px solid #64748b; margin-bottom: 3px; padding-top: 26px; font-size: 9.5px; font-weight: 600; color: #111827; }
.doc-brandline { font-size: 8.5px; color: #94a3b8; margin-top: 6px; text-align: center; }

.slip-token { text-align: center; padding: 8px 0 6px; }
.slip-token small { font-size: 8.5px; letter-spacing: .16em; text-transform: uppercase; color: #64748b; font-weight: 700; }
.slip-token strong { display: block; font-size: 44px; font-weight: 800; color: #0f766e; letter-spacing: -.04em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.slip-token span { font-size: 9.5px; color: #475569; }
.slip-patient { text-align: center; margin-top: 4px; }
.slip-patient strong { font-size: 13px; font-weight: 800; }
.slip-patient p { font-size: 10px; color: #475569; }
.slip-vitals { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-top: 10px; }
.slip-vitals div { border: 1px solid #dbe3ea; border-radius: 5px; padding: 5px 7px; display: flex; justify-content: space-between; align-items: baseline; }
.slip-vitals small { font-size: 7.5px; text-transform: uppercase; letter-spacing: .06em; color: #64748b; font-weight: 700; }
.slip-vitals strong { font-size: 10.5px; font-weight: 800; }
.slip-footer { margin-top: 12px; padding-top: 8px; border-top: 1px dashed #cbd5e1; font-size: 8.5px; color: #64748b; text-align: center; line-height: 1.6; }
.slip-qr { display: flex; justify-content: center; margin-top: 8px; }
.slip-qr .qr-box { padding: 4px; border-radius: 6px; }
.slip-qr .qr-box img, .slip-qr .qr-box canvas { width: 62px; height: 62px; }

.poster-inner { height: 251mm; display: flex; flex-direction: column; align-items: center; text-align: center; border: 3px solid #0f766e; border-radius: 10px; padding: 14mm 10mm; }
.poster-inner .brand-mark { width: 58px; height: 58px; flex-basis: 58px; border-radius: 16px; font-size: 28px; }
.poster-kicker { margin-top: 10mm; font-size: 11px; letter-spacing: .26em; text-transform: uppercase; font-weight: 800; color: #0f766e; }
.poster-title { font-size: 38px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; color: #0f172a; margin-top: 4mm; }
.poster-sub { font-size: 15px; color: #475569; margin-top: 4mm; line-height: 1.5; max-width: 120mm; }
.poster-qr { margin-top: 10mm; padding: 8mm; border: 1px solid #dbe3ea; border-radius: 16px; background: #fff; }
.poster-qr img, .poster-qr canvas { width: 70mm; height: 70mm; display: block; }
.poster-steps { display: flex; gap: 8mm; margin-top: 10mm; }
.poster-step { display: flex; flex-direction: column; align-items: center; gap: 2mm; font-size: 10px; color: #475569; max-width: 38mm; }
.poster-step b { width: 8mm; height: 8mm; border-radius: 50%; background: #0f766e; color: #fff; display: grid; place-items: center; font-size: 10px; }
.poster-clinic { margin-top: auto; font-size: 12px; color: #475569; line-height: 1.6; }
.poster-clinic strong { display: block; font-size: 16px; color: #0f172a; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1120px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .hero-grid { grid-template-columns: 1fr; gap: 30px; }
  .hero-art { max-width: 520px; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display: none; }
}

@media (max-width: 1024px) {
  .shell { display: block; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    height: 100dvh;
    transform: translateX(-106%);
    transition: transform .25s ease;
    box-shadow: none;
  }
  .sidebar.open { transform: none; box-shadow: 30px 0 80px rgba(2, 6, 23, .45); }
  .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(2, 6, 23, .45); opacity: 0; pointer-events: none; transition: .2s; }
  .scrim.show { opacity: 1; pointer-events: auto; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 12px 18px; }
  .page { padding: 20px 18px 60px; }
  .auth-main { padding: 28px 16px; }
  .split, .split-2, .pub-grid, .screen-grid { grid-template-columns: 1fr; }
  .screen-now { padding: 30px; min-height: 300px; }
}

@media (max-width: 760px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .vitals-grid { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 13px; gap: 10px; }
  .stat-value { font-size: 19px; }
  .stat-ico { width: 38px; height: 38px; flex-basis: 38px; }
  .topbar-title span { display: none; }
  .user-pill-text { display: none; }
  .live-pill { display: none; }
  .page-title { font-size: 20px; }
  .feature-grid, .steps { grid-template-columns: 1fr; }
  .hero { padding: 34px 22px; border-radius: 22px; }
  .land-nav { padding: 16px; }
  .cta-card { padding: 30px 20px; }
  .paper-body { padding: 10px 6px 40px; }
  .print-sheet { border-radius: 0; }
  .rx-sheet, .slip-sheet, .poster-sheet { width: 100%; min-height: 0; padding: 8mm; }
  .med-row, .med-head { min-width: 640px; }
  .med-row .input, .med-row .select { font-size: 12px; padding: 7px 7px; }
  .token-ring { width: 128px; height: 128px; }
  .token-ring-inner strong { font-size: 36px; }
  .screen-wrap { padding: calc(20px + env(safe-area-inset-top)) 16px calc(30px + env(safe-area-inset-bottom)); }
  .screen-clock strong { font-size: 18px; }
  .screen-now .big-token { font-size: 96px; }
  .screen-foot { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   App-like mobile (bottom tabs + compact forms)
   ============================================================ */
@media (max-width: 760px) {
  body { background: #f4f7f9; }
  .menu-btn { display: none; }
  .topbar { padding: calc(10px + env(safe-area-inset-top)) 14px 10px; min-height: 56px; gap: 10px; }
  .topbar-title strong { font-size: 16px; }
  .topbar-right { gap: 6px; }
  .user-pill { border: 0; background: transparent; padding: 0; box-shadow: none; }
  .page { padding: 16px 14px calc(92px + env(safe-area-inset-bottom)); }
  .page-title { font-size: 21px; }
  .page-head { gap: 12px; margin-bottom: 16px; align-items: flex-start; }
  .page-actions { width: 100%; }
  .page-actions > .btn, .page-actions > form > .btn { flex: 1 1 auto; justify-content: center; }

  .card { border-radius: 16px; }
  .card-body { padding: 16px; }
  .card-head { padding: 14px 16px; }
  .stat { border-radius: 14px; }

  .input, .select, .textarea { font-size: 16px; padding: 12px; min-height: 46px; }
  .textarea { min-height: 90px; }
  .btn { min-height: 44px; }
  .btn-sm { min-height: 36px; }
  .icon-btn { width: 42px; height: 42px; }

  /* Sidebar sheet sits above bottom tabs */
  .sidebar { width: min(86vw, 320px); z-index: 80; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .scrim { z-index: 70; }

  /* Bottom tab bar */
  .bottom-nav {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .95);
    backdrop-filter: blur(18px);
    border-top: 1px solid var(--line);
    box-shadow: 0 -14px 36px -24px rgba(15, 23, 42, .55);
  }
  .bn-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 50px;
    padding: 4px;
    border: 0;
    border-radius: 12px;
    background: none;
    color: #64748b;
    font: 600 10.5px/1 var(--font);
    cursor: pointer;
    transition: .16s;
  }
  .bn-item .ico { width: 21px; height: 21px; }
  .bn-item.active { color: var(--brand-700); background: var(--brand-50); }
  .bn-item:active { transform: scale(.96); }

  /* Queue rows stack actions */
  .queue-item { flex-wrap: wrap; gap: 10px; padding: 12px 14px; }
  .queue-actions { width: 100%; justify-content: flex-start; }

  /* Tables: hide secondary columns, keep key info */
  .hide-sm { display: none !important; }
  .table { font-size: 12.5px; }
  .table th, .table td { padding: 10px 11px; }
  .t-actions { justify-content: flex-start; }

  /* Medicine rows become cards */
  .med-scroll { overflow: visible; }
  .med-head { display: none; }
  .med-row {
    min-width: 0;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 46px 12px 12px;
    margin: 0 0 10px;
    border: 1px solid var(--line);
    border-radius: 14px;
    position: relative;
    background: #fff;
  }
  .med-row:last-child { border-bottom: 1px solid var(--line); }
  .med-row .med-no {
    position: absolute;
    left: 12px;
    top: 12px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--brand-50);
    color: var(--brand-700);
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: 800;
  }
  .med-row input[name="med[]"] { grid-column: 1 / -1; }
  .med-row .input, .med-row .select { font-size: 16px; padding: 11px; min-height: 44px; }
  .med-row [data-remove-row] {
    position: absolute;
    right: 8px;
    top: 8px;
    width: 34px;
    height: 34px;
    border: 0;
    background: #fef2f2;
    color: #be123c;
  }

  .form-actions .btn-block { min-height: 50px; }
  .toast { top: 10px; right: 10px; left: 10px; max-width: none; }

  /* Patient booking page */
  .pub-head { padding: calc(10px + env(safe-area-inset-top)) 14px 10px; }
  .pub-wrap { padding: 18px 14px 42px; }
  .pub-card { padding: 18px; border-radius: 18px; }
  .pub-hero { padding: 20px; border-radius: 18px; }
  .pub-hero h1 { font-size: 22px; }
  .pub-form-title { font-size: 16px; }
  .auth-main { padding: 20px 14px; }
  .auth-card { padding: 22px 18px; }
}

/* ============================================================
   Print
   ============================================================ */
@media print {
  .no-print, .paper-toolbar { display: none !important; }
  .paper-body { background: #fff !important; padding: 0 !important; }
  .print-sheet { box-shadow: none !important; margin: 0 !important; border-radius: 0 !important; }
  .toast { display: none !important; }
}

/* ---------- Payment activation ---------- */
.banner-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.pay-plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pay-plan { position: relative; display: flex; flex-direction: column; gap: 3px; border: 1.5px solid var(--line-strong); border-radius: 14px; padding: 12px 13px; background: #fff; cursor: pointer; transition: .15s; }
.pay-plan:hover { border-color: var(--brand); }
.pay-plan input { position: absolute; opacity: 0; pointer-events: none; }
.pay-plan:has(input:checked) { border-color: var(--brand); background: var(--brand-50); box-shadow: 0 0 0 3px rgba(13, 148, 136, .12); }
.pay-plan-name { font-size: 13px; font-weight: 700; color: var(--ink); }
.pay-plan-price { font-size: 19px; font-weight: 800; color: var(--brand-700); letter-spacing: -.02em; }
.pay-plan-price small { font-size: 10.5px; font-weight: 600; color: var(--muted); }
.pay-plan-meta { font-size: 10.5px; color: var(--muted); line-height: 1.35; }
.pay-total { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; font-size: 13px; margin: 16px 0 0; display: flex; justify-content: space-between; align-items: center; }
.pay-total strong { font-size: 18px; color: var(--brand-700); }
.qr-box { background: #fff; border: 1px dashed var(--line-strong); border-radius: 16px; padding: 14px; text-align: center; margin: 14px 0; }
.qr-box img { width: 220px; max-width: 100%; display: block; margin: 0 auto; border-radius: 8px; }
.qr-meta { display: grid; grid-template-columns: auto 1fr; gap: 5px 16px; font-size: 12.5px; margin: 10px 0 0; }
.qr-meta span { color: var(--muted); }
.qr-meta strong { text-align: right; word-break: break-word; }
.proof-img { display: block; width: 100%; max-height: 520px; object-fit: contain; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
@media (max-width: 600px) {
  .pay-plans { grid-template-columns: 1fr; }
}

/* Google sign-in */
.btn-google {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; min-height: 46px; padding: 11px 16px;
    border: 1px solid var(--line-strong); border-radius: 12px;
    background: #fff; color: var(--ink); font-weight: 700; font-size: 14px;
    text-decoration: none; transition: background .15s, border-color .15s;
}
.btn-google:hover { background: var(--brand-50); border-color: var(--brand); color: var(--brand-700); }
.auth-divider {
    display: flex; align-items: center; gap: 12px; margin: 16px 0;
    color: var(--muted); font-size: 11px; font-weight: 700;
    letter-spacing: .08em; text-transform: uppercase;
}
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
