/* ChamberDesk — application styles. No build step: edit this file directly. */

:root {
    --bg: #f3f6f5;
    --surface: #ffffff;
    --surface-2: #f7faf9;
    --border: #e1e8e5;
    --border-strong: #cfd9d5;
    --text: #13211d;
    --text-2: #364641;
    --muted: #6a7873;
    --primary: #0f766e;
    --primary-700: #0b5f58;
    --primary-50: #e8f4f2;
    --primary-100: #cfe9e5;
    --green: #15803d;
    --green-50: #e9f7ee;
    --amber: #b45309;
    --amber-50: #fdf3e4;
    --red: #b91c1c;
    --red-50: #fdecec;
    --blue: #1d4ed8;
    --blue-50: #e9effd;
    --violet: #6d28d9;
    --violet-50: #f1ebfd;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 1px 2px rgba(16, 40, 34, .05), 0 4px 14px rgba(16, 40, 34, .04);
    --shadow-lg: 0 12px 32px rgba(16, 40, 34, .14);
    --sidebar: 252px;
    --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans Bengali", "Hind Siliguri", "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14.5px; line-height: 1.5; color: var(--text); background: var(--bg); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 650; }
p { margin: 0; }
code { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: .86em; background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; color: var(--text-2); }
.icon { width: 18px; height: 18px; flex: none; }
.icon-small { width: 14px; height: 14px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.block { display: block; }
.text-green { color: var(--green); }
.text-amber { color: var(--amber); }
.empty { color: var(--muted); padding: 22px 4px; text-align: center; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.eyebrow a { color: var(--muted); }

/* ---------- App shell ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar); display: flex; flex-direction: column;
    background: #0d2b27; color: #cfe2dd; padding: 20px 14px; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 11px; color: inherit; padding: 4px 8px 18px; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: linear-gradient(140deg, #14b8a6, #0f766e); color: #fff; flex: none; }
.brand-mark .icon { width: 21px; height: 21px; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { color: #fff; font-size: 16px; letter-spacing: -.01em; }
.brand-text small { color: #8fb3ab; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-heading { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #6f958c; margin: 18px 10px 6px; }
.nav-link, .nav-display {
    display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 10px;
    color: #c4d9d3; font-weight: 500;
}
.nav-link:hover, .nav-display:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.nav-link.is-active { background: rgba(45, 212, 191, .14); color: #fff; box-shadow: inset 3px 0 0 #2dd4bf; }
.nav-link.is-active .icon { color: #5eead4; }
.nav-display { border: 1px dashed rgba(255, 255, 255, .18); margin-top: 12px; font-size: 13px; }

.main { flex: 1; margin-left: var(--sidebar); min-width: 0; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px;
    height: 64px; padding: 0 28px; background: rgba(243, 246, 245, .86); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}
.topbar-date { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 500; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.sidebar-toggle { display: none; }
.content { padding: 26px 28px 48px; max-width: 1660px; width: 100%; display: flex; flex-direction: column; gap: 20px; }

.user-menu { position: relative; }
.user-menu summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 4px 8px 4px 4px; border-radius: 12px; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover { background: var(--surface); }
.user-meta { display: flex; flex-direction: column; line-height: 1.2; }
.user-meta strong { font-size: 13.5px; }
.user-meta small { color: var(--muted); font-size: 12px; }
.user-menu-panel {
    position: absolute; right: 0; top: calc(100% + 8px); width: 220px; background: var(--surface); border: 1px solid var(--border);
    border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px;
}
.user-menu-panel a, .user-menu-panel button {
    display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; border: 0; background: none;
    font: inherit; color: var(--text); cursor: pointer; text-align: left;
}
.user-menu-panel a:hover, .user-menu-panel button:hover { background: var(--surface-2); text-decoration: none; }

.avatar {
    width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
    background: linear-gradient(140deg, #14b8a6, #0f766e); color: #fff; font-weight: 700; font-size: 14px;
}
.avatar-soft { background: var(--primary-50); color: var(--primary-700); width: 32px; height: 32px; font-size: 13px; }
.avatar-large { width: 56px; height: 56px; font-size: 22px; }

/* ---------- Buttons ---------- */
.button {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 16px;
    border-radius: 10px; border: 1px solid transparent; font: inherit; font-weight: 600; font-size: 14px;
    cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s;
}
.button:hover { text-decoration: none; }
.button-primary { background: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(15, 118, 110, .3); }
.button-primary:hover { background: var(--primary-700); }
.button-ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.button-ghost:hover { border-color: var(--primary); color: var(--primary-700); }
.button-danger-ghost { background: transparent; color: var(--red); border-color: #f2c9c9; }
.button-danger-ghost:hover { background: var(--red-50); }
.button-small { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.button-block { width: 100%; }
.icon-button {
    width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 9px; border: 1px solid var(--border);
    background: var(--surface); color: var(--text); cursor: pointer; font-size: 18px; line-height: 1;
}
.icon-button:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.icon-button-muted { border-color: transparent; background: transparent; color: var(--muted); }
.icon-button-muted:hover { background: var(--red-50); color: var(--red); border-color: transparent; }
.link { font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.icon-link { color: var(--muted); display: inline-flex; vertical-align: middle; margin-left: 8px; }
.icon-link:hover { color: var(--primary); }

/* ---------- Page structure ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card > h2 { margin-bottom: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.section-title { font-size: 15px; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.card-head .section-title { margin-bottom: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-profile { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; }
.queue-layout { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
.rx-layout { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
.rx-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.rx-side { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 84px; }
.rx-side > .card { display: flex; flex-direction: column; gap: 12px; }
.rx-side > .card > .section-title { margin-bottom: 2px; }
.chart-card { display: flex; flex-direction: column; }
.chart-card .bar-chart { flex: 1; min-height: 220px; max-height: 320px; height: auto; }
.settings-layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }

/* ---------- Alerts, tags, pills ---------- */
.alert { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 11px; font-weight: 500; border: 1px solid; }
.alert-success { background: var(--green-50); color: #14532d; border-color: #c6ebd2; }
.alert-error { background: var(--red-50); color: #7f1d1d; border-color: #f5c9c9; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.tag-new { background: var(--blue-50); color: var(--blue); border-color: #d3defb; }
.tag-follow_up { background: var(--primary-50); color: var(--primary-700); border-color: var(--primary-100); }
.tag-report { background: var(--violet-50); color: var(--violet); border-color: #e2d6fb; }
.role-admin { background: #10241f; color: #fff; border-color: #10241f; }
.role-doctor { background: var(--primary-50); color: var(--primary-700); border-color: var(--primary-100); }
.role-assistant { background: var(--amber-50); color: var(--amber); border-color: #f6dfbd; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.pill-ok { background: var(--green-50); color: var(--green); }
.pill-warn { background: var(--amber-50); color: var(--amber); }
.pill-info { background: var(--blue-50); color: var(--blue); }
.pill-danger { background: var(--red-50); color: var(--red); }
.badge { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); padding: 2px 9px; border-radius: 999px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12.5px; color: var(--text-2); }
.chip-link:hover { border-color: var(--primary); text-decoration: none; }
.chip-link.is-active { background: var(--primary-50); border-color: var(--primary-100); color: var(--primary-700); font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot-waiting { background: #f59e0b; }
.dot-progress { background: #14b8a6; box-shadow: 0 0 0 3px rgba(20, 184, 166, .2); }
.dot-done { background: #22c55e; }
.dot-cancelled { background: #cbd5d1; }

/* ---------- Dashboard ---------- */
.now-serving { display: grid; grid-template-columns: auto 1fr; gap: 6px 36px; align-items: center; background: linear-gradient(120deg, #0f766e, #115e59 55%, #134e4a); color: #fff; border: 0; padding: 24px 28px; }
.now-serving .eyebrow { color: #99f6e4; }
.token-big { font-size: 56px; font-weight: 800; line-height: 1; letter-spacing: -.03em; }
.token-empty { opacity: .5; }
.now-name { font-size: 17px; font-weight: 600; margin-top: 6px; }
.now-serving .muted { color: #a7d3cc; }
.queue-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.meter-item { background: rgba(255, 255, 255, .09); border: 1px solid rgba(255, 255, 255, .12); border-radius: 12px; padding: 12px 14px; display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 8px; }
.meter-item strong { font-size: 24px; }
.meter-item small { grid-column: 1 / -1; color: #b8ded8; font-size: 12.5px; }
.progress-track { grid-column: 1 / -1; height: 6px; background: rgba(255, 255, 255, .15); border-radius: 99px; overflow: hidden; margin-top: 12px; }
.progress-fill { display: block; height: 100%; width: 0; background: #5eead4; border-radius: 99px; transition: width .6s ease; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.stat-grid-5 { grid-template-columns: repeat(5, 1fr); }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 8px; }
.tone-teal { background: var(--primary-50); color: var(--primary); }
.tone-green { background: var(--green-50); color: var(--green); }
.tone-blue { background: var(--blue-50); color: var(--blue); }
.tone-amber { background: var(--amber-50); color: var(--amber); }
.stat-label { color: var(--muted); font-weight: 500; font-size: 13px; }
.stat-value { font-size: 26px; font-weight: 750; letter-spacing: -.02em; }
.stat-foot { color: var(--muted); font-size: 12.5px; }
.bar-chart { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; height: 200px; align-items: end; padding-top: 8px; }
.bar-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.bar { width: 100%; max-width: 46px; height: 4px; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, #2dd4bf, #0f766e); transition: height .6s ease; }
.bar-value { font-weight: 700; font-size: 13px; }
.bar-label { font-size: 12px; color: var(--muted); }
.list { list-style: none; margin: 0; padding: 0; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: 0; }
.list-main { flex: 1; display: flex; flex-direction: column; }
.list-main a { font-weight: 600; color: var(--text); }
.date-chip { width: 44px; height: 46px; border-radius: 10px; background: var(--primary-50); color: var(--primary-700); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.date-chip strong { font-size: 17px; }
.date-chip small { font-size: 11px; text-transform: uppercase; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:hover td { background: #fafcfb; }
.table tbody tr:last-child td { border-bottom: 0; }
.table a { font-weight: 600; color: var(--text); }
.table a:hover { color: var(--primary); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions .link { color: var(--primary); }
.row-muted td { color: var(--muted); }
.person { display: inline-flex; align-items: center; gap: 10px; }
.bar-cell { width: 35%; }
.inline-bar { display: block; height: 8px; width: 0; border-radius: 6px; background: linear-gradient(90deg, #5eead4, #0f766e); transition: width .6s ease; }

/* ---------- Toolbar & forms ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.toolbar-wrap { flex-wrap: wrap; }
.search { flex: 1; min-width: 220px; position: relative; display: flex; align-items: center; }
.search .icon { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.search input[type="search"] { padding-left: 38px; }
.inline-field { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 500; }
.inline-field input { width: 160px; }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="number"], input[type="date"], input[type="search"], select, textarea {
    width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface);
    font: inherit; color: var(--text); transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 64px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15, 118, 110, .14); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field em { color: var(--red); font-style: normal; }
.field-small { max-width: 120px; }
.field-error { color: var(--red); font-size: 12.5px; font-weight: 500; }
.hint { color: var(--muted); font-size: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.form-grid-2 { grid-template-columns: repeat(2, 1fr); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: 1 / -1; }
.form-stack { display: flex; flex-direction: column; gap: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-card { display: flex; flex-direction: column; gap: 18px; }
.form-narrow { max-width: 720px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 4px; }
.form-subhead { font-weight: 700; margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--border); }
.check { display: inline-flex; align-items: center; gap: 9px; font-weight: 500; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--primary); }
.queue-option { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--primary-50); border: 1px solid var(--primary-100); border-radius: 12px; flex-wrap: wrap; }
.queue-option select { width: auto; min-width: 180px; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form select { height: 32px; width: auto; font-size: 13px; }

/* ---------- Queue ---------- */
.day-switch { display: flex; align-items: center; gap: 8px; }
.day-switch input { width: 160px; }
.queue-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.queue-row { display: grid; grid-template-columns: 64px 1fr auto auto; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.queue-row.status-in_progress { border-color: #5eead4; background: linear-gradient(90deg, #ecfdf9, #fff 60%); box-shadow: 0 0 0 3px rgba(45, 212, 191, .14); }
.queue-row.status-done { background: var(--surface-2); }
.queue-row.status-done .token { background: var(--green-50); color: var(--green); }
.queue-row.status-cancelled { opacity: .6; }
.queue-row.status-cancelled .queue-patient a { text-decoration: line-through; }
.token { height: 44px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 18px; background: var(--amber-50); color: var(--amber); }
.status-in_progress .token { background: var(--primary); color: #fff; }
.queue-patient { display: flex; flex-direction: column; min-width: 0; }
.queue-patient a { font-weight: 650; color: var(--text); }
.status-badge { font-size: 12px; font-weight: 650; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.badge-waiting { background: var(--amber-50); color: var(--amber); }
.badge-in_progress { background: var(--primary-50); color: var(--primary-700); }
.badge-done { background: var(--green-50); color: var(--green); }
.badge-cancelled { background: var(--surface-2); color: var(--muted); }
.queue-actions { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.queue-actions form { display: inline; }
.queue-add { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 84px; }
.queue-add h2 { margin: 0; }
.match-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.match-list li { border: 1px solid var(--border); border-radius: 11px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.match-form { display: flex; gap: 8px; }
.match-form select { height: 32px; font-size: 13px; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ---------- Patient profile ---------- */
.profile-card { display: flex; flex-direction: column; gap: 16px; }
.profile-top { display: flex; align-items: center; gap: 14px; }
.profile-name { font-size: 18px; font-weight: 700; }
.details { margin: 0; display: flex; flex-direction: column; }
.details div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--border); }
.details dt { color: var(--muted); }
.details dd { margin: 0; font-weight: 600; text-align: right; }
.callout { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; }
.callout-danger { background: var(--red-50); color: #7f1d1d; }
.notes-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 4px; }
.profile-queue { padding-top: 4px; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 6px; }
.timeline-item { position: relative; padding: 0 0 18px 24px; border-left: 2px solid var(--border); }
.timeline-item:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline-dot { position: absolute; left: -7px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--primary); }
.timeline-body { display: flex; flex-direction: column; gap: 4px; }
.timeline-top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.timeline-actions { display: flex; gap: 14px; }

/* ---------- Prescription form & view ---------- */
.patient-strip { display: flex; align-items: center; gap: 14px; padding: 14px 18px; flex-wrap: wrap; }
.patient-strip-main { display: flex; flex-direction: column; flex: 1; min-width: 200px; }
.patient-strip-main strong { font-size: 16px; }
.vitals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 16px 0; padding: 14px; background: var(--surface-2); border-radius: 12px; border: 1px solid var(--border); }
.rx-symbol { font-family: Georgia, "Times New Roman", serif; font-size: 22px; color: var(--primary); font-weight: 700; }
.med-table { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.med-head, .med-row { display: grid; grid-template-columns: 2.2fr 1fr 1fr 1.4fr 34px; gap: 8px; align-items: center; }
.med-head span { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.mini-history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.mini-history li { display: flex; flex-direction: column; font-size: 13px; }
.mini-history a { font-weight: 600; }
.visit-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.visit-meta div { display: flex; flex-direction: column; gap: 2px; }
.vital-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.rx-list { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 12px; }
.rx-list li::marker { color: var(--primary); font-weight: 700; }
.rx-list strong { display: block; }
.rx-dose { color: var(--text-2); font-size: 13.5px; }
.note-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px; }
.bill { margin: 0 0 14px; }
.bill div { display: flex; justify-content: space-between; padding: 7px 0; }
.bill dt { color: var(--muted); }
.bill dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.bill-total { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 10px !important; }
.bill-total dd { font-size: 17px; }
.bill-due dd { color: var(--amber); font-size: 17px; }
.bill-clear dd { color: var(--green); }
.payment-list { list-style: none; margin: 0 0 14px; padding: 10px 12px; background: var(--surface-2); border-radius: 10px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.payment-list li { display: flex; justify-content: space-between; gap: 10px; }
.payment-form { padding-top: 14px; border-top: 1px solid var(--border); }

/* ---------- Reports ---------- */
.preset-links { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.share-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.share-list li { display: grid; grid-template-columns: 130px 1fr 110px; gap: 12px; align-items: center; }
.share-label { font-weight: 600; }
.share-track { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; border: 1px solid var(--border); }
.share-fill { display: block; height: 100%; width: 0; border-radius: 99px; transition: width .6s ease; border: 0; padding: 0; }
.share-fill.tag-new { background: #3b82f6; }
.share-fill.tag-follow_up { background: #14b8a6; }
.share-fill.tag-report { background: #8b5cf6; }
.method-cash { background: #22c55e; }
.method-mobile { background: #f59e0b; }
.method-card { background: #3b82f6; }
.share-value { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Users ---------- */
.role-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.role-grid p { margin-top: 8px; color: var(--text-2); }

/* ---------- Pagination & misc ---------- */
.pagination { display: flex; justify-content: space-between; align-items: center; padding-top: 14px; margin-top: 4px; border-top: 1px solid var(--border); }
.pagination-info { color: var(--muted); font-size: 13px; }
.pagination-links { display: flex; gap: 8px; }
.error-page { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.error-code { font-size: 64px; font-weight: 800; color: var(--primary); line-height: 1; }
.minimal-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }

/* ---------- Auth ---------- */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 520px) 1fr; }
.auth-panel { background: var(--surface); padding: 48px 56px; display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.auth-panel .brand { color: var(--text); padding: 0 0 18px; }
.auth-panel .brand-text strong { color: var(--text); font-size: 20px; }
.auth-panel .brand-text small { color: var(--muted); }
.brand-large .brand-mark { width: 46px; height: 46px; border-radius: 13px; }
.auth-title { font-size: 28px; }
.auth-aside {
    background: radial-gradient(1200px 600px at 80% 0%, #14b8a6 0%, transparent 55%), linear-gradient(150deg, #0f766e, #0d2b27 70%);
    color: #e6f6f3; display: flex; align-items: center; padding: 64px;
}
.auth-aside-inner { max-width: 520px; display: flex; flex-direction: column; gap: 22px; }
.auth-aside .eyebrow { color: #99f6e4; }
.auth-aside h2 { font-size: 38px; font-weight: 750; line-height: 1.15; color: #fff; }
.auth-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; font-size: 16px; }
.auth-points li { display: flex; align-items: center; gap: 12px; }
.auth-points .icon { width: 34px; height: 34px; padding: 8px; border-radius: 10px; background: rgba(255, 255, 255, .12); color: #5eead4; }
.demo-box { border: 1px dashed var(--primary-100); background: var(--primary-50); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.demo-title { font-weight: 700; color: var(--primary-700); }
.demo-roles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.demo-role { min-width: 0; border: 1px solid var(--primary-100); background: var(--surface); border-radius: 10px; padding: 10px; cursor: pointer; font: inherit; color: var(--text); display: flex; flex-direction: column; gap: 2px; text-align: left; }
.demo-role small { display: block; white-space: nowrap; }
.demo-role:hover { border-color: var(--primary); }
.demo-role small { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.checklist li { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.checklist .ok { color: var(--green); }
.checklist .fail { color: var(--red); font-weight: 600; }

/* ---------- Waiting-room display ---------- */
.display { background: #071a17; color: #e6f6f3; min-height: 100vh; }
.display-board { min-height: 100vh; display: flex; flex-direction: column; padding: 4vh 5vw; gap: 4vh; }
.display-head { display: flex; justify-content: space-between; align-items: center; }
.display-clinic { font-size: 3.2vh; font-weight: 750; color: #fff; }
.display-doctor { font-size: 2.2vh; color: #8fc9bf; }
.display-clock { font-size: 5vh; font-weight: 700; font-variant-numeric: tabular-nums; color: #5eead4; }
.display-main { flex: 1; display: grid; grid-template-columns: 1.4fr 1fr; gap: 4vw; }
.display-current { background: linear-gradient(150deg, #0f766e, #0b3d37); border-radius: 3vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 4vh; box-shadow: 0 0 0 1px rgba(94, 234, 212, .25), 0 30px 80px rgba(0, 0, 0, .35); }
.display-label { font-size: 2.4vh; text-transform: uppercase; letter-spacing: .2em; color: #99f6e4; }
.display-token { font-size: 26vh; font-weight: 800; line-height: 1; color: #fff; letter-spacing: -.04em; }
.display-token.is-flash { animation: flash 1.2s ease 2; }
.display-name { font-size: 4.2vh; font-weight: 650; }
.display-next { background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08); border-radius: 3vh; padding: 4vh; display: flex; flex-direction: column; gap: 2vh; }
.display-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1.4vh; flex: 1; }
.display-list li { display: flex; align-items: center; gap: 2vw; font-size: 3.6vh; padding: 1.4vh 2vh; border-radius: 1.6vh; background: rgba(255, 255, 255, .05); }
.display-list b { min-width: 9vh; color: #fbbf24; font-size: 4.2vh; }
.display-waiting { font-size: 2.4vh; color: #8fc9bf; }
.display-foot { text-align: center; color: #6f9d95; font-size: 2vh; }
@keyframes flash { 50% { color: #fbbf24; transform: scale(1.04); } }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
    .stat-grid, .stat-grid-5 { grid-template-columns: repeat(2, 1fr); }
    .queue-meter { grid-template-columns: repeat(2, 1fr); }
    .form-grid { grid-template-columns: repeat(2, 1fr); }
    .span-3 { grid-column: 1 / -1; }
}
@media (max-width: 1000px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
    body.sidebar-open .sidebar { transform: none; }
    body.sidebar-open .sidebar-backdrop { position: fixed; inset: 0; background: rgba(7, 26, 23, .45); z-index: 25; }
    .main { margin-left: 0; }
    .sidebar-toggle { display: inline-grid; }
    .grid-2, .grid-profile, .queue-layout, .rx-layout, .settings-layout { grid-template-columns: 1fr; }
    .rx-side, .queue-add { position: static; }
    .now-serving { grid-template-columns: 1fr; }
    .auth-shell { grid-template-columns: 1fr; }
    .auth-aside { display: none; }
}
@media (max-width: 640px) {
    .topbar { padding: 0 16px; }
    .topbar-date, .user-meta { display: none; }
    .content { padding: 18px 16px 40px; }
    .stat-grid, .stat-grid-5, .form-grid, .form-grid-2, .vitals, .visit-meta, .note-grid, .role-grid, .form-row { grid-template-columns: 1fr; }
    .span-2, .span-3 { grid-column: auto; }
    .queue-row { grid-template-columns: 52px 1fr; }
    .queue-actions { grid-column: 1 / -1; justify-content: flex-start; flex-wrap: wrap; }
    .med-head { display: none; }
    .med-row { grid-template-columns: 1fr 1fr; padding: 10px; border: 1px solid var(--border); border-radius: 10px; }
    .med-row input:first-child { grid-column: 1 / -1; }
    .auth-panel { padding: 32px 20px; }
    .demo-roles { grid-template-columns: 1fr; }
    .display-main { grid-template-columns: 1fr; }
    .share-list li { grid-template-columns: 90px 1fr 80px; }
}
