/* Billbuk Appointment Tracker — iOS-inspired blue design system, tablet-first */

:root {
    /* iOS system blue as the brand accent; Billbuk orange only for the avatar / small brand touches */
    --primary: #007AFF;
    --primary-strong: #0062CC;
    --primary-soft: rgba(0, 122, 255, .11);
    /* Gradients follow --primary so a hospital accent colour still applies */
    --primary-grad: linear-gradient(135deg, color-mix(in srgb, var(--primary) 88%, #fff) 0%, var(--primary-strong) 100%);
    --hero-grad: linear-gradient(150deg, color-mix(in srgb, var(--primary) 85%, #fff) 0%, var(--primary) 42%, color-mix(in srgb, var(--primary) 55%, #0B1A4A) 100%);
    --brand: #FF5A1F;
    --brand-soft: rgba(255, 90, 31, .12);

    --bg: #F2F2F7;
    --bg-grad: radial-gradient(1100px 520px at 100% -10%, rgba(0,122,255,.09), transparent 60%),
               radial-gradient(800px 460px at -10% 0%, rgba(88,86,214,.06), transparent 60%);
    --surface: #FFFFFF;
    --surface-2: #F7F7FA;
    --surface-3: #EBEBF0;
    --glass: rgba(249,249,251,.82);
    --text: #1C1C1E;
    --text-2: #545458;
    --text-3: #8E8E93;
    --sep: rgba(60, 60, 67, .10);
    --sep-strong: rgba(60, 60, 67, .18);

    --blue: #007AFF;
    --green: #1FA855;
    --orange: #FF9500;
    --red: #FF3B30;
    --purple: #AF52DE;
    --indigo: #5856D6;
    --pink: #FF2D55;
    --teal: #30B0C7;
    --gray: #8E8E93;
    --wa: #25D366;
    --wa-text: #128C4B;

    --r-xl: 26px;
    --r-lg: 20px;
    --r-md: 14px;
    --r-sm: 11px;
    --r-xs: 8px;

    --shadow-1: 0 1px 1px rgba(0,0,0,.03), 0 1px 3px rgba(0,0,0,.05);
    --shadow-2: 0 2px 6px rgba(0,0,0,.04), 0 10px 28px -8px rgba(0,30,80,.14);
    --shadow-3: 0 22px 60px -12px rgba(0,20,60,.30);

    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, sans-serif;
    --ease: cubic-bezier(.2, .8, .2, 1);
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --primary: #0A84FF;
        --primary-strong: #409CFF;
        --primary-soft: rgba(10,132,255,.18);
        --bg: #000000;
        --bg-grad: radial-gradient(1100px 520px at 100% -10%, rgba(10,132,255,.12), transparent 60%);
        --surface: #1C1C1E;
        --surface-2: #232326;
        --surface-3: #2C2C2E;
        --glass: rgba(28,28,30,.82);
        --text: #F5F5F7;
        --text-2: #C7C7CC;
        --text-3: #8E8E93;
        --sep: rgba(84,84,88,.45);
        --sep-strong: rgba(84,84,88,.75);
        --green: #30D158;
        --wa-text: #30D158;
        --shadow-1: 0 1px 2px rgba(0,0,0,.5);
        --shadow-2: 0 10px 30px -10px rgba(0,0,0,.7);
        --shadow-3: 0 24px 64px -12px rgba(0,0,0,.8);
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --primary: #0A84FF;
    --primary-strong: #409CFF;
    --primary-soft: rgba(10,132,255,.18);
    --bg: #000000;
    --bg-grad: radial-gradient(1100px 520px at 100% -10%, rgba(10,132,255,.12), transparent 60%);
    --surface: #1C1C1E;
    --surface-2: #232326;
    --surface-3: #2C2C2E;
    --glass: rgba(28,28,30,.82);
    --text: #F5F5F7;
    --text-2: #C7C7CC;
    --text-3: #8E8E93;
    --sep: rgba(84,84,88,.45);
    --sep-strong: rgba(84,84,88,.75);
    --green: #30D158;
    --wa-text: #30D158;
    color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.45;
    color: var(--text);
    background: var(--bg);
    background-image: var(--bg-grad);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    min-height: 100vh;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

::selection { background: var(--primary-soft); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 2px; border-radius: 10px; }

/* ---------- Typography ---------- */
.t-display { font-family: var(--font-display); font-weight: 700; letter-spacing: -.02em; }
.t-title { font-size: 22px; font-weight: 700; letter-spacing: -.015em; margin: 0; }
.t-sub { color: var(--text-2); font-size: 14px; margin: 2px 0 0; }
.t-muted { color: var(--text-3); }
.t-small { font-size: 13px; }
.t-xs { font-size: 12px; }
.t-num { font-variant-numeric: tabular-nums; }
.t-strong { font-weight: 650; }
.t-ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eyebrow { font-size: 12px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }

/* ---------- Buttons ---------- */
.btn {
    --btn-bg: var(--surface-3);
    --btn-fg: var(--text);
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 0 18px;
    border: 0; border-radius: 14px;
    background: var(--btn-bg); color: var(--btn-fg);
    font-weight: 600; font-size: 15px; white-space: nowrap;
    cursor: pointer; user-select: none;
    transition: transform .15s var(--ease), background .2s, box-shadow .2s, opacity .2s;
}
.btn:hover { filter: brightness(.98); }
.btn:active { transform: scale(.97); }
.btn[disabled], .btn.is-busy { opacity: .55; pointer-events: none; }
.btn i { font-size: 19px; line-height: 1; }
.btn-primary { --btn-bg: var(--primary); --btn-fg: #fff; box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--primary) 70%, transparent); }
.btn-primary:hover { --btn-bg: var(--primary-strong); }
.btn-tinted { --btn-bg: var(--primary-soft); --btn-fg: var(--primary-strong); }
.btn-danger { --btn-bg: var(--red); --btn-fg: #fff; }
.btn-danger-soft { --btn-bg: rgba(239,59,54,.12); --btn-fg: var(--red); }
.btn-warn-soft { --btn-bg: rgba(245,158,11,.14); --btn-fg: #B76E00; }
.btn-green { --btn-bg: var(--green); --btn-fg: #fff; }
.btn-ghost { --btn-bg: transparent; --btn-fg: var(--text-2); }
.btn-ghost:hover { --btn-bg: var(--surface-3); }
.btn-plain { --btn-bg: var(--surface); box-shadow: var(--shadow-1); }
.btn-lg { min-height: 56px; padding: 0 24px; font-size: 17px; border-radius: 18px; }
.btn-xl { min-height: 72px; padding: 0 28px; font-size: 20px; border-radius: 22px; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 11px; }
.btn-block { width: 100%; }
.btn-icon { width: 44px; padding: 0; }
.btn-icon.btn-sm { width: 36px; }
.btn-emergency { --btn-bg: rgba(239,59,54,.10); --btn-fg: var(--red); }
.is-busy::after { content: ""; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Form controls ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field > label, .label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--text-3); }
.input, .select, .textarea {
    width: 100%; min-height: 48px; padding: 12px 14px;
    border: 1px solid var(--sep-strong); border-radius: 14px;
    background: var(--surface); color: var(--text);
    font-size: 16px; outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238A90A0' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.input-group { position: relative; }
.input-group > i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: 18px; pointer-events: none; }
.input-group > .input { padding-left: 42px; }
.input-prefix { display: flex; align-items: stretch; border: 1px solid var(--sep-strong); border-radius: 14px; background: var(--surface); overflow: hidden; }
.input-prefix span { display: flex; align-items: center; padding: 0 12px; background: var(--surface-2); color: var(--text-2); font-weight: 600; border-right: 1px solid var(--sep); }
.input-prefix .input { border: 0; border-radius: 0; }
.input-prefix:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
@media (max-width: 600px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* Segmented control */
.segmented { display: inline-flex; padding: 3px; background: var(--surface-3); border-radius: 13px; gap: 2px; position: relative; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.segmented::-webkit-scrollbar { display: none; }
.segmented button {
    border: 0; background: transparent; min-height: 38px; padding: 0 14px; border-radius: 10px;
    font-weight: 600; font-size: 14px; color: var(--text-2); cursor: pointer; white-space: nowrap;
    transition: background .2s, color .2s, box-shadow .2s;
}
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.segmented.block { display: flex; }
.segmented.block button { flex: 1; }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px;
    border: 1px solid var(--sep-strong); border-radius: 999px; background: var(--surface);
    font-weight: 600; font-size: 14px; color: var(--text-2); cursor: pointer; transition: all .15s;
}
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip .count { font-size: 12px; padding: 1px 7px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); }
.chip.active .count { background: rgba(255,255,255,.25); color: #fff; }

/* Toggle */
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; cursor: pointer; }
.toggle input { display: none; }
.toggle .track { width: 51px; height: 31px; border-radius: 999px; background: var(--surface-3); position: relative; flex-shrink: 0; transition: background .2s; box-shadow: inset 0 0 0 1px var(--sep); }
.toggle .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.15); transition: transform .25s var(--ease); }
.toggle input:checked + .track { background: var(--green); }
.toggle input:checked + .track::after { transform: translateX(20px); }

/* Stepper */
.stepper { display: flex; align-items: center; width: 100%; max-width: 220px; border: 1px solid var(--sep-strong); border-radius: 14px; overflow: hidden; background: var(--surface); }
.stepper button { flex: 0 0 40px; width: 40px; min-height: 46px; border: 0; background: var(--surface-2); font-size: 20px; cursor: pointer; color: var(--primary); }
.stepper input { flex: 1 1 0; width: 0; min-width: 0; text-align: center; border: 0; background: transparent; font-size: 17px; font-weight: 650; outline: none; }

/* Badges / status pills */
.pill { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 650; white-space: nowrap; background: var(--surface-3); color: var(--text-2); }
.pill i { font-size: 14px; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-Waiting { background: rgba(10,122,255,.12); color: var(--blue); }
.pill-InConsultation { background: rgba(139,92,246,.14); color: var(--purple); }
.pill-Completed { background: rgba(34,165,91,.13); color: var(--green); }
.pill-Skipped { background: rgba(245,158,11,.16); color: #B76E00; }
.pill-OnHold { background: rgba(88,86,214,.13); color: var(--indigo); }
.pill-NoShow { background: rgba(138,144,160,.18); color: var(--text-2); }
.pill-Cancelled, .pill-Rescheduled { background: rgba(239,59,54,.11); color: var(--red); }
.pill-Emergency { background: var(--red); color: #fff; }
.pill-Priority { background: rgba(245,158,11,.16); color: #B76E00; }
.pill-live { background: rgba(34,165,91,.13); color: var(--green); }
.pill-live .dot { animation: pulse 1.6s infinite; }
.pill-WhatsApp { background: rgba(37,211,102,.14); color: #128C4B; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(34,165,91,.6); } 70% { box-shadow: 0 0 0 8px rgba(34,165,91,0); } 100% { box-shadow: 0 0 0 0 rgba(34,165,91,0); } }

/* ---------- Cards ---------- */
.card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-1); border: 1px solid var(--sep); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 10px; }
.card-head h3 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.card-head h3 i { color: var(--primary); font-size: 20px; }
.card-body { padding: 8px 20px 20px; }
.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--sep); }
.list-row:last-child { border-bottom: 0; }
.empty { text-align: center; padding: 36px 16px; color: var(--text-3); }
.empty i { font-size: 40px; display: block; margin-bottom: 8px; opacity: .6; }
.empty strong { display: block; color: var(--text-2); font-size: 15px; margin-bottom: 4px; }

/* ---------- App shell ---------- */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 40;
    display: flex; align-items: center; gap: 16px;
    padding: 12px max(24px, env(safe-area-inset-left)) 12px max(24px, env(safe-area-inset-right));
    background: var(--glass); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--sep);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-logo { width: 44px; height: 44px; border-radius: 13px; object-fit: contain; background: var(--surface); box-shadow: var(--shadow-1); flex-shrink: 0; }
.brand-mark { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--primary-grad); color: #fff; font-size: 22px; flex-shrink: 0; }
.brand-name { font-weight: 750; font-size: 17px; letter-spacing: -.01em; line-height: 1.15; }
.brand-tag { font-size: 12.5px; color: var(--text-3); }
.topbar .spacer { flex: 1; }
.datenav { display: flex; align-items: center; gap: 4px; background: var(--surface); border-radius: 14px; padding: 4px; box-shadow: var(--shadow-1); border: 1px solid var(--sep); }
.datenav button { border: 0; background: transparent; min-height: 38px; min-width: 38px; border-radius: 10px; cursor: pointer; color: var(--text-2); font-size: 20px; }
.datenav button:hover { background: var(--surface-3); }
.datenav .date-label { position: relative; padding: 0 10px; font-weight: 650; font-size: 15px; min-width: 150px; text-align: center; cursor: pointer; }
.datenav .date-label input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.datenav .today-btn { font-size: 13px; font-weight: 650; padding: 0 10px; color: var(--primary); }
.clock { font-variant-numeric: tabular-nums; font-weight: 650; color: var(--text-2); font-size: 15px; }
.avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--brand), #FF8A3D); border: 0; cursor: pointer; flex-shrink: 0; font-size: 15px; }
.avatar-sm { width: 34px; height: 34px; font-size: 13px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 4px 4px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--sep); box-shadow: var(--shadow-1); cursor: pointer; }
.user-chip .who { line-height: 1.15; text-align: right; }
.user-chip .who b { font-size: 14px; display: block; }
.user-chip .who span { font-size: 12px; color: var(--text-3); }

.main { flex: 1; width: 100%; max-width: 1440px; margin: 0 auto; padding: 24px; }
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.hero h1 { margin: 0; font-family: var(--font-display); font-size: 30px; font-weight: 750; letter-spacing: -.025em; }
.hero p { margin: 4px 0 0; color: var(--text-2); }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi {
    position: relative; overflow: hidden; text-align: left; cursor: pointer;
    padding: 16px 16px 14px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--sep); box-shadow: var(--shadow-1);
    transition: transform .2s var(--ease), box-shadow .2s;
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.kpi .kpi-icon { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-size: 19px; margin-bottom: 12px; }
.kpi .kpi-value { font-family: var(--font-display); font-size: 30px; font-weight: 750; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi .kpi-label { margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.kpi .kpi-foot { margin-top: 2px; font-size: 12px; color: var(--text-3); }
.kpi .kpi-bar { position: absolute; left: 0; bottom: 0; height: 3px; background: currentColor; opacity: .5; transition: width .6s var(--ease); }
.tone-blue .kpi-icon { background: rgba(10,122,255,.12); color: var(--blue); }
.tone-purple .kpi-icon { background: rgba(139,92,246,.14); color: var(--purple); }
.tone-green .kpi-icon { background: rgba(34,165,91,.13); color: var(--green); }
.tone-orange .kpi-icon { background: rgba(245,158,11,.16); color: #C77700; }
.tone-red .kpi-icon { background: rgba(239,59,54,.12); color: var(--red); }
.tone-teal .kpi-icon { background: var(--primary-soft); color: var(--primary); }
.tone-blue { color: var(--blue); } .tone-purple { color: var(--purple); } .tone-green { color: var(--green); }
.tone-orange { color: var(--orange); } .tone-red { color: var(--red); } .tone-teal { color: var(--primary); }
.kpi .kpi-value, .kpi .kpi-label { color: var(--text); }
.kpi .kpi-label { color: var(--text-2); }

.layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(320px, 1fr); gap: 20px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
@media (max-width: 1080px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1024px) { .layout { grid-template-columns: 1fr; } }
@media (max-width: 720px) {
    .main { padding: 16px; }
    .topbar { padding: 10px 16px; gap: 10px; flex-wrap: wrap; }
    .topbar .clock, .user-chip .who, .brand-tag { display: none; }
    .datenav { order: 5; width: 100%; justify-content: space-between; }
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .hero h1 { font-size: 24px; }
    .hero-actions { width: 100%; }
    .hero-actions .btn { flex: 1; }
}

/* Session (slot) timeline */
.sessions { display: flex; flex-direction: column; gap: 12px; padding: 4px 20px 20px; }
.session {
    display: grid; grid-template-columns: 84px 1fr auto; gap: 16px; align-items: center;
    padding: 16px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--sep);
    position: relative; transition: box-shadow .2s, transform .2s var(--ease);
}
.session:hover { box-shadow: var(--shadow-2); }
.session::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 0 4px 4px 0; background: var(--slot-color, var(--primary)); }
.session.is-live { background: linear-gradient(135deg, color-mix(in srgb, var(--green) 9%, var(--surface)), var(--surface)); border-color: color-mix(in srgb, var(--green) 30%, transparent); }
.session.is-done { opacity: .82; }
.session-time { text-align: center; }
.session-time b { display: block; font-size: 17px; font-weight: 750; font-variant-numeric: tabular-nums; }
.session-time span { font-size: 12px; color: var(--text-3); }
.session-title { font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.session-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--text-2); font-size: 13px; margin-top: 4px; }
.session-meta span { display: inline-flex; align-items: center; gap: 4px; }
.capacity { margin-top: 10px; display: flex; align-items: center; gap: 10px; }
.capacity-track { flex: 1; height: 7px; border-radius: 999px; background: var(--surface-3); overflow: hidden; display: flex; }
.capacity-track span { height: 100%; transition: width .5s var(--ease); }
.capacity small { font-size: 12px; color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.session-actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.serving { display: flex; align-items: baseline; gap: 6px; font-size: 13px; color: var(--text-2); margin-top: 6px; }
.serving b { font-size: 20px; color: var(--green); font-variant-numeric: tabular-nums; }
@media (max-width: 720px) {
    .session { grid-template-columns: 64px 1fr; }
    .session-actions { grid-column: 1 / -1; flex-direction: row; }
    .session-actions .btn { flex: 1; }
}

/* Appointment list */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 0 20px 12px; }
.toolbar .input-group { flex: 1; min-width: 200px; }
.appt-list { padding: 0 12px 12px; }
.appt {
    display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 14px; align-items: center;
    padding: 12px; border-radius: 16px; cursor: pointer; transition: background .15s;
}
.appt:hover { background: var(--surface-2); }
.appt + .appt { border-top: 1px solid var(--sep); }
.appt:hover + .appt, .appt:hover { border-color: transparent; }
.token { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--surface-3); font-weight: 800; font-size: 19px; font-variant-numeric: tabular-nums; position: relative; }
.token small { position: absolute; top: 5px; left: 7px; font-size: 10px; color: var(--text-3); font-weight: 700; }
.token.t-Waiting { background: rgba(10,122,255,.10); color: var(--blue); }
.token.t-InConsultation { background: var(--purple); color: #fff; }
.token.t-InConsultation small { color: rgba(255,255,255,.8); }
.token.t-Completed { background: rgba(34,165,91,.12); color: var(--green); }
.token.t-Emergency { box-shadow: inset 0 0 0 2px var(--red); }
.appt-name { font-weight: 650; font-size: 15.5px; display: flex; align-items: center; gap: 8px; min-width: 0; }
.appt-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appt-meta { font-size: 13px; color: var(--text-3); display: flex; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.appt-meta span { display: inline-flex; align-items: center; gap: 4px; }
.appt-side { display: flex; align-items: center; gap: 8px; }

/* Live queue widget */
.live { padding: 0 20px 20px; }
.now-card {
    border-radius: var(--r-lg); padding: 20px; color: #fff; position: relative; overflow: hidden;
    background: var(--hero-grad);
}
.now-card::after { content: ""; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255,255,255,.08); }
.now-card .eyebrow { color: rgba(255,255,255,.78); }
.now-token { font-family: var(--font-display); font-size: 64px; font-weight: 800; letter-spacing: -.03em; line-height: 1; margin: 6px 0 4px; font-variant-numeric: tabular-nums; }
.now-name { font-size: 17px; font-weight: 650; }
.now-sub { font-size: 13px; opacity: .85; }
.up-next { display: flex; gap: 8px; margin-top: 14px; overflow-x: auto; scrollbar-width: none; }
.up-next .tok { min-width: 54px; padding: 8px 0; text-align: center; border-radius: 13px; background: var(--surface-2); border: 1px solid var(--sep); font-weight: 750; font-variant-numeric: tabular-nums; }
.up-next .tok small { display: block; font-size: 10.5px; color: var(--text-3); font-weight: 600; }
.up-next .tok.first { background: var(--primary-soft); border-color: transparent; color: var(--primary-strong); }

/* Charts */
.chart { padding: 4px 20px 20px; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 150px; }
.bars .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars .stack-bar { width: 100%; max-width: 34px; display: flex; flex-direction: column-reverse; border-radius: 9px; overflow: hidden; background: var(--surface-3); min-height: 4px; transition: height .6s var(--ease); }
.bars .stack-bar span { display: block; width: 100%; }
.bars .bar-label { font-size: 11.5px; color: var(--text-3); font-weight: 600; }
.bars .bar-col.is-sel .bar-label { color: var(--primary); }
.bars .bar-val { font-size: 11.5px; font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); margin-top: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.donut-wrap { display: flex; align-items: center; gap: 20px; }
.donut { width: 132px; height: 132px; flex-shrink: 0; }
.donut text { font-family: var(--font-display); }

/* Tool grid */
.tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 0 20px 20px; }
.tool {
    display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; min-height: 96px;
    border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--sep); cursor: pointer; text-align: left;
    transition: transform .15s var(--ease), background .2s;
}
.tool:hover { background: var(--surface-3); }
.tool:active { transform: scale(.97); }
.tool i { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-size: 19px; color: #fff; }
.tool b { font-size: 14px; font-weight: 650; }
.tool small { display: block; font-size: 12px; color: var(--text-3); font-weight: 500; margin-top: 1px; }
@media (max-width: 720px) { .tools { grid-template-columns: repeat(2, 1fr); } }

/* Footer */
.footer { border-top: 1px solid var(--sep); background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.footer-inner { max-width: 1440px; margin: 0 auto; padding: 18px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); }
.footer-hosp { display: flex; align-items: center; gap: 12px; min-width: 0; }
.footer-hosp img { width: 32px; height: 32px; border-radius: 9px; object-fit: contain; background: var(--surface); }
.footer-hosp b { color: var(--text); display: block; font-size: 14px; }
.footer-contact { display: flex; gap: 14px; flex-wrap: wrap; }
.footer-contact span { display: inline-flex; align-items: center; gap: 5px; }
.footer-dev { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.footer-dev img { height: 22px; border-radius: 5px; }

/* ---------- Modal / sheet ---------- */
.overlay {
    position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 24px;
    background: rgba(10, 12, 18, .38); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    opacity: 0; transition: opacity .25s var(--ease);
}
.overlay.show { opacity: 1; }
.modal {
    width: 100%; max-width: 560px; max-height: calc(100vh - 48px); display: flex; flex-direction: column;
    background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-3); overflow: hidden;
    transform: translateY(24px) scale(.98); transition: transform .35s var(--ease);
}
.overlay.show .modal { transform: none; }
.modal.size-sm { max-width: 420px; }
.modal.size-lg { max-width: 860px; }
.modal.size-xl { max-width: 1180px; }
.modal.size-full { max-width: none; width: calc(100vw - 32px); height: calc(100vh - 32px); max-height: none; }
.overlay.is-full { padding: 16px; }
.modal-head { display: flex; align-items: flex-start; gap: 14px; padding: 22px 24px 14px; border-bottom: 1px solid transparent; }
.modal-head.scrolled { border-color: var(--sep); }
.modal-head .mh-icon { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-size: 22px; background: var(--primary-soft); color: var(--primary); flex-shrink: 0; }
.modal-head h2 { margin: 0; font-size: 20px; font-weight: 750; letter-spacing: -.015em; }
.modal-head p { margin: 2px 0 0; color: var(--text-2); font-size: 14px; }
.modal-head .mh-text { flex: 1; min-width: 0; }
.modal-close { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--surface-3); color: var(--text-2); font-size: 20px; cursor: pointer; display: grid; place-items: center; flex-shrink: 0; }
.modal-body { padding: 8px 24px 24px; overflow-y: auto; flex: 1; overscroll-behavior: contain; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 24px; border-top: 1px solid var(--sep); background: var(--surface); flex-wrap: wrap; }
.modal-foot .grow { flex: 1; }
@media (max-width: 720px) {
    .overlay { align-items: flex-end; padding: 0; }
    .modal, .modal.size-full { max-width: none; width: 100%; height: auto; max-height: 94vh; border-radius: 26px 26px 0 0; transform: translateY(100%); }
    .modal.size-full { height: 94vh; }
    .modal-head { padding-top: 26px; position: relative; }
    .modal-head::before { content: ""; position: absolute; top: 8px; left: 50%; width: 38px; height: 5px; margin-left: -19px; border-radius: 3px; background: var(--sep-strong); }
    .modal-foot { padding-bottom: max(14px, env(safe-area-inset-bottom)); }
    .modal-foot .btn { flex: 1; }
}

/* Side panel */
.overlay.is-panel { justify-content: flex-end; padding: 0; }
.overlay.is-panel .modal { max-width: 520px; height: 100vh; max-height: none; border-radius: 28px 0 0 28px; transform: translateX(100%); }
.overlay.is-panel.show .modal { transform: none; }
@media (max-width: 720px) {
    .overlay.is-panel { align-items: flex-end; }
    .overlay.is-panel .modal { height: 94vh; border-radius: 26px 26px 0 0; transform: translateY(100%); }
}

/* Confirm dialog (iOS alert) */
.alert-modal { max-width: 360px; text-align: center; }
.alert-modal .modal-body { padding: 28px 24px 8px; }
.alert-modal .alert-icon { width: 60px; height: 60px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; font-size: 28px; background: var(--primary-soft); color: var(--primary); }
.alert-modal .alert-icon.danger { background: rgba(239,59,54,.12); color: var(--red); }
.alert-modal h2 { margin: 0 0 6px; font-size: 19px; font-weight: 750; }
.alert-modal p { margin: 0; color: var(--text-2); }
.alert-modal .modal-foot { border: 0; justify-content: stretch; padding: 18px 24px 22px; }
.alert-modal .modal-foot .btn { flex: 1; }
@media (max-width: 720px) {
    .overlay.is-alert { align-items: center; padding: 24px; }
    .overlay.is-alert .modal { border-radius: 26px; transform: scale(.94); max-width: 360px; }
    .overlay.is-alert.show .modal { transform: none; }
    .overlay.is-alert .modal-head::before { display: none; }
}

/* Toast */
.toasts { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast {
    display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 999px;
    background: rgba(28, 30, 36, .92); color: #fff; font-weight: 600; font-size: 14.5px; box-shadow: var(--shadow-3);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    animation: toast-in .35s var(--ease); pointer-events: auto;
}
.toast i { font-size: 20px; }
.toast.ok i { color: #4ADE80; }
.toast.err i { color: #FF6B66; }
.toast.out { animation: toast-out .25s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-14px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-10px) scale(.96); } }

/* Menu popover */
.menu { position: fixed; z-index: 200; min-width: 220px; padding: 6px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-3); border: 1px solid var(--sep); animation: toast-in .2s var(--ease); }
.menu button { display: flex; width: 100%; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border: 0; background: transparent; border-radius: 11px; cursor: pointer; font-weight: 550; text-align: left; }
.menu button:hover { background: var(--surface-3); }
.menu button i { font-size: 18px; color: var(--text-2); }
.menu button.danger, .menu button.danger i { color: var(--red); }
.menu hr { border: 0; border-top: 1px solid var(--sep); margin: 6px 4px; }
.menu .menu-head { padding: 10px 12px 8px; }
.menu .menu-head b { display: block; }
.menu .menu-head span { font-size: 13px; color: var(--text-3); }

/* ---------- Queue console ---------- */
.console { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr); gap: 20px; min-height: 100%; }
@media (max-width: 1024px) { .console { grid-template-columns: 1fr; } }
.serving-card {
    border-radius: var(--r-xl); padding: 26px; color: #fff; position: relative; overflow: hidden;
    background: var(--hero-grad);
    box-shadow: 0 20px 40px -18px color-mix(in srgb, var(--primary) 80%, transparent);
}
.serving-card.idle { background: linear-gradient(140deg, #3A4152, #1F232D); }
.serving-card::before { content: ""; position: absolute; width: 320px; height: 320px; right: -110px; top: -140px; border-radius: 50%; background: rgba(255,255,255,.07); }
.serving-card .big-token { font-family: var(--font-display); font-size: clamp(64px, 9vw, 112px); font-weight: 800; line-height: .95; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.serving-card .who { font-size: 24px; font-weight: 700; margin-top: 8px; letter-spacing: -.01em; }
.serving-card .facts { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px; font-size: 14px; opacity: .9; }
.serving-card .facts span { display: inline-flex; gap: 5px; align-items: center; }
.serving-card .timer { position: absolute; right: 24px; top: 24px; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.16); font-weight: 650; font-variant-numeric: tabular-nums; font-size: 14px; }
.serving-card .textarea { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.2); color: #fff; min-height: 72px; margin-top: 16px; }
.serving-card .textarea::placeholder { color: rgba(255,255,255,.65); }
.serving-card .textarea:focus { box-shadow: 0 0 0 4px rgba(255,255,255,.18); border-color: rgba(255,255,255,.5); }
.console-actions { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 10px; margin-top: 16px; }
.console-actions .btn { min-height: 64px; flex-direction: column; gap: 4px; font-size: 13.5px; border-radius: 18px; }
.console-actions .btn i { font-size: 22px; }
.console-actions .btn-next { font-size: 18px; flex-direction: row; gap: 10px; }
.console-actions .btn-next i { font-size: 26px; }
.btn-onglass { --btn-bg: rgba(255,255,255,.16); --btn-fg: #fff; }
.btn-white { --btn-bg: #fff; --btn-fg: var(--primary-strong); }
@media (max-width: 600px) { .console-actions { grid-template-columns: repeat(3, 1fr); } .console-actions .btn-next { grid-column: 1 / -1; } }
.next-strip { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid var(--sep); margin-top: 16px; }
.next-strip .token { width: 60px; height: 60px; font-size: 22px; }
.console-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 16px; }
.qrow { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 6px; border-bottom: 1px solid var(--sep); }
.qrow:last-child { border-bottom: 0; }
.qrow .token { width: 48px; height: 48px; font-size: 16px; border-radius: 14px; }
.qrow .pos { font-size: 12px; color: var(--text-3); }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stat { padding: 12px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--sep); }
.stat b { display: block; font-size: 22px; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat span { font-size: 12px; color: var(--text-3); font-weight: 600; }
.progress-ring { transform: rotate(-90deg); }
.start-hero { text-align: center; padding: 40px 20px; border-radius: var(--r-xl); background: linear-gradient(160deg, var(--primary-soft), transparent); border: 1px dashed color-mix(in srgb, var(--primary) 35%, transparent); }
.start-hero .start-icon { width: 84px; height: 84px; margin: 0 auto 16px; border-radius: 26px; display: grid; place-items: center; font-size: 40px; color: #fff; background: var(--primary-grad); box-shadow: 0 16px 32px -14px var(--primary); }
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-md); font-size: 14px; margin-bottom: 14px; }
.banner i { font-size: 20px; margin-top: -1px; }
.banner-warn { background: rgba(245,158,11,.13); color: #8A5300; }
.banner-info { background: rgba(10,122,255,.10); color: #0A57B5; }
.banner-danger { background: rgba(239,59,54,.10); color: #B3201C; }
.banner-ok { background: rgba(34,165,91,.11); color: #13723C; }
:root[data-theme="dark"] .banner-warn, .dark .banner-warn { color: #FBBF24; }
@media (prefers-color-scheme: dark) {
    .banner-warn { color: #FBBF24; } .banner-info { color: #7DB8FF; } .banner-danger { color: #FF8C88; } .banner-ok { color: #6EE7A2; }
    .pill-Skipped, .pill-Priority { color: #FBBF24; }
}

/* Tabs (underline) */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--sep); margin: 0 0 16px; overflow-x: auto; scrollbar-width: none; }
.tabs button { border: 0; background: transparent; padding: 12px 14px; font-weight: 650; color: var(--text-3); cursor: pointer; border-bottom: 2.5px solid transparent; white-space: nowrap; }
.tabs button.active { color: var(--text); border-color: var(--primary); }
.tabs button .count { font-size: 12px; margin-left: 4px; color: var(--text-3); }

/* Tables */
.table-wrap { overflow-x: auto; border-radius: var(--r-md); border: 1px solid var(--sep); }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; padding: 12px 14px; background: var(--surface-2); position: sticky; top: 0; cursor: pointer; white-space: nowrap; user-select: none; }
.table th.sorted::after { content: " ↓"; }
.table th.sorted.asc::after { content: " ↑"; }
.table td { padding: 12px 14px; border-top: 1px solid var(--sep); white-space: nowrap; font-variant-numeric: tabular-nums; }
.table tr:hover td { background: var(--surface-2); }
.table td.wrap { white-space: normal; min-width: 200px; }
.utilbar { width: 110px; height: 7px; border-radius: 999px; background: var(--surface-3); display: inline-block; vertical-align: middle; overflow: hidden; margin-right: 8px; }
.utilbar span { display: block; height: 100%; border-radius: 999px; }

/* Timeline */
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: var(--sep-strong); border-radius: 2px; }
.tl-item { position: relative; padding: 0 0 16px; }
.tl-item::before { content: ""; position: absolute; left: -23px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--tl, var(--primary)); }
.tl-item b { font-size: 14px; }
.tl-item p { margin: 2px 0 0; font-size: 13px; color: var(--text-2); }
.tl-item time { font-size: 12px; color: var(--text-3); }

/* Info grid */
.info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--sep); border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--sep); margin-bottom: 18px; }
.info-grid > div { background: var(--surface); padding: 12px 14px; }
.info-grid span { display: block; font-size: 12px; color: var(--text-3); font-weight: 600; }
.info-grid b { font-weight: 650; font-size: 15px; word-break: break-word; }
.section-title { font-size: 13px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; margin: 18px 0 10px; }

/* Slot picker */
.slot-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.slot-opt { text-align: left; padding: 14px; border-radius: var(--r-md); border: 1.5px solid var(--sep-strong); background: var(--surface); cursor: pointer; transition: all .15s; position: relative; }
.slot-opt:hover { border-color: var(--primary); }
.slot-opt.active { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px var(--primary-soft); }
.slot-opt.full { opacity: .75; }
.slot-opt.closed { opacity: .45; pointer-events: none; }
.slot-opt b { display: block; font-size: 15px; }
.slot-opt span { font-size: 13px; color: var(--text-2); }
.slot-opt .avail { margin-top: 8px; font-size: 12.5px; font-weight: 650; }
.date-strip { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: thin; }
.date-opt { min-width: 64px; padding: 10px 0; border-radius: 16px; border: 1.5px solid var(--sep-strong); background: var(--surface); text-align: center; cursor: pointer; flex-shrink: 0; }
.date-opt small { display: block; font-size: 11.5px; color: var(--text-3); font-weight: 650; text-transform: uppercase; }
.date-opt b { font-size: 20px; font-weight: 750; }
.date-opt.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.date-opt.active small { color: rgba(255,255,255,.8); }
.weekdays { display: flex; gap: 6px; flex-wrap: wrap; }
.weekdays button { width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid var(--sep-strong); background: var(--surface); font-weight: 700; cursor: pointer; font-size: 13px; }
.weekdays button.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatches button { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1.5px var(--sep-strong); cursor: pointer; }
.swatches button.active { box-shadow: 0 0 0 2.5px var(--text); }
.typeahead { position: relative; }
.typeahead-list { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 10; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-3); border: 1px solid var(--sep); max-height: 280px; overflow-y: auto; padding: 6px; }
.typeahead-list button { display: flex; width: 100%; gap: 12px; align-items: center; padding: 10px; border: 0; background: transparent; border-radius: 11px; text-align: left; cursor: pointer; }
.typeahead-list button:hover, .typeahead-list button.hl { background: var(--surface-3); }
.picked { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-md); background: var(--primary-soft); margin-bottom: 16px; }

/* Patient portal */
.my-live {
    border-radius: var(--r-xl); padding: 26px; color: #fff; position: relative; overflow: hidden; margin-bottom: 20px;
    background: var(--hero-grad);
}
.my-live .grid { display: grid; grid-template-columns: auto 1fr; gap: 26px; align-items: center; }
.my-live .ring { position: relative; width: 150px; height: 150px; }
.my-live .ring .center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.my-live .ring .center b { display: block; font-size: 42px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.my-live .ring .center small { font-size: 12px; opacity: .85; }
.my-live .facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.my-live .facts div { background: rgba(255,255,255,.13); border-radius: 16px; padding: 12px; }
.my-live .facts b { display: block; font-size: 22px; font-weight: 750; font-variant-numeric: tabular-nums; }
.my-live .facts span { font-size: 12px; opacity: .85; }
@media (max-width: 600px) { .my-live .grid { grid-template-columns: 1fr; justify-items: center; text-align: center; } .my-live .facts { grid-template-columns: repeat(3, 1fr); } }

/* Setup */
.setup { max-width: 560px; margin: 8vh auto; text-align: center; }
.setup .start-icon { width: 84px; height: 84px; margin: 0 auto 18px; border-radius: 26px; display: grid; place-items: center; font-size: 40px; color: #fff; background: var(--primary-grad); }

/* Skeleton */
.skeleton { background: linear-gradient(90deg, var(--surface-3) 0%, var(--surface-2) 50%, var(--surface-3) 100%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 12px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Utilities */
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wrap { flex-wrap: wrap; }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.gap-6 { gap: 6px; } .gap-16 { gap: 16px; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.fade-in { animation: fade .35s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }
.divider { height: 1px; background: var(--sep); margin: 16px 0; }
.kbd { font-size: 12px; padding: 2px 6px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); font-weight: 600; }

@media print {
    .topbar, .footer, .modal-foot, .modal-close, .no-print, .toolbar .btn { display: none !important; }
    body { background: #fff; }
    .overlay { position: static; background: none; backdrop-filter: none; padding: 0; }
    .modal { box-shadow: none; max-height: none; width: 100% !important; height: auto !important; }
    .modal-body { overflow: visible; }
    body.printing > .app { display: none; }
}

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

/* =====================================================================
   v2 components: date picker, minimized session bar, validation,
   WhatsApp / phone contact badges, consent card, attention list
   ===================================================================== */

/* Date field (opens the shared date picker) */
.datefield {
    display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px; width: 100%;
    border: 1px solid var(--sep-strong); border-radius: 14px; background: var(--surface); color: var(--text);
    font-size: 16px; font-weight: 550; cursor: pointer; text-align: left; transition: border-color .2s, box-shadow .2s;
}
.datefield i { color: var(--primary); font-size: 19px; }
.datefield .df-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.datefield .df-label.placeholder { color: var(--text-3); font-weight: 500; }
.datefield:focus-visible, .datefield.open { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); outline: none; }
.datefield.inline { width: auto; min-height: 40px; padding: 0 12px; font-size: 14px; border-radius: 12px; }

/* Calendar popover */
.dp {
    position: fixed; z-index: 400; width: 336px; padding: 14px; border-radius: 22px;
    background: var(--surface); border: 1px solid var(--sep); box-shadow: var(--shadow-3);
    animation: dp-in .22s var(--ease); user-select: none;
}
@keyframes dp-in { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.dp-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.dp-title { flex: 1; font-weight: 750; font-size: 17px; letter-spacing: -.01em; padding-left: 6px; }
.dp-title small { color: var(--primary); font-weight: 650; font-size: 17px; }
.dp-nav { width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--primary); font-size: 22px; cursor: pointer; display: grid; place-items: center; }
.dp-nav:hover { background: var(--primary-soft); }
.dp-nav[disabled] { color: var(--text-3); opacity: .4; pointer-events: none; }
.dp-week, .dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.dp-week span { text-align: center; font-size: 11.5px; font-weight: 650; color: var(--text-3); text-transform: uppercase; padding: 4px 0 8px; }
.dp-grid button {
    height: 40px; margin: 1px; border: 0; border-radius: 50%; background: transparent; color: var(--text);
    font-size: 15.5px; font-weight: 550; cursor: pointer; font-variant-numeric: tabular-nums; position: relative;
    transition: background .15s, color .15s;
}
.dp-grid button:hover { background: var(--surface-3); }
.dp-grid button.muted { color: var(--text-3); opacity: .55; }
.dp-grid button.today { color: var(--primary); font-weight: 800; }
.dp-grid button.sel { background: var(--primary); color: #fff; font-weight: 750; box-shadow: 0 6px 14px -6px var(--primary); }
.dp-grid button.kbd-focus { box-shadow: inset 0 0 0 2px var(--primary); }
.dp-grid button[disabled] { color: var(--text-3); opacity: .3; pointer-events: none; }
.dp-foot { display: flex; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--sep); flex-wrap: wrap; }
.dp-foot button { flex: 1; min-height: 36px; border: 0; border-radius: 10px; background: var(--surface-2); color: var(--primary); font-weight: 650; font-size: 13.5px; cursor: pointer; white-space: nowrap; }
.dp-foot button:hover { background: var(--primary-soft); }
.dp-backdrop { position: fixed; inset: 0; z-index: 399; }
@media (max-width: 720px) {
    .dp { left: 8px !important; right: 8px; top: auto !important; bottom: 8px; width: auto; border-radius: 26px; padding-bottom: max(14px, env(safe-area-inset-bottom)); animation: sheet-in .3s var(--ease); }
    .dp-backdrop { background: rgba(0,0,0,.3); }
    .dp-grid button { height: 46px; }
}
@keyframes sheet-in { from { transform: translateY(100%); } }

/* Topbar date button */
.datenav .date-btn { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; min-width: 168px; justify-content: center; font-weight: 650; font-size: 15px; color: var(--text); }
.datenav .date-btn i { color: var(--primary); font-size: 18px; }

/* Minimized live session */
.minibar {
    position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 90;
    display: flex; align-items: center; gap: 14px; padding: 10px 10px 10px 18px; border-radius: 999px;
    background: rgba(28,28,30,.92); color: #fff; box-shadow: var(--shadow-3); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    max-width: calc(100vw - 24px);
}
.minibar .dot { width: 9px; height: 9px; border-radius: 50%; background: #30D158; animation: pulse 1.6s infinite; flex-shrink: 0; }
.minibar .mb-text { line-height: 1.2; min-width: 0; }
.minibar .mb-text b { display: block; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.minibar .mb-text span { font-size: 12.5px; opacity: .75; white-space: nowrap; }
.minibar .mb-token { font-family: var(--font-display); font-weight: 800; font-size: 22px; font-variant-numeric: tabular-nums; padding: 0 4px; }
.minibar .btn { --btn-bg: #fff; --btn-fg: #0062CC; min-height: 40px; border-radius: 999px; }
.modal-head .mh-actions { display: flex; gap: 8px; }

/* Validation */
.field.invalid .input, .field.invalid .input-prefix, .field.invalid .datefield { border-color: var(--red); box-shadow: 0 0 0 4px rgba(255,59,48,.12); }
.field .err-text { display: none; font-size: 12.5px; color: var(--red); font-weight: 550; }
.field.invalid .err-text { display: flex; align-items: center; gap: 4px; }
.field.invalid .hint { display: none; }

/* Contact channel badges */
.ch { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; font-size: 14px; flex-shrink: 0; }
.ch-wa { background: rgba(37,211,102,.16); color: var(--wa-text); }
.ch-phone { background: var(--surface-3); color: var(--text-2); }
.ch-lg { width: 30px; height: 30px; border-radius: 9px; font-size: 18px; }

/* Consent card in the booking form */
.consent { border: 1px solid var(--sep-strong); border-radius: var(--r-md); padding: 14px; background: var(--surface-2); }
.consent .consent-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.consent .consent-head b { font-size: 14.5px; display: block; }
.consent .consent-head div > span { font-size: 12.5px; color: var(--text-3); display: block; }
.consent-opts { display: grid; gap: 8px; }
.consent-opt { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 12px; border: 1.5px solid var(--sep); background: var(--surface); cursor: pointer; text-align: left; }
.consent-opt input { margin-top: 3px; accent-color: var(--primary); width: 18px; height: 18px; flex-shrink: 0; }
.consent-opt.active { border-color: var(--primary); background: var(--primary-soft); }
.consent-opt b { font-size: 14px; display: block; }
.consent-opt span { font-size: 12.5px; color: var(--text-2); }
.qr-box { display: flex; gap: 16px; align-items: center; padding: 12px; border-radius: 14px; background: var(--surface); border: 1px dashed var(--sep-strong); margin-top: 10px; }
.qr-box img { width: 132px; height: 132px; border-radius: 10px; background: #fff; padding: 6px; flex-shrink: 0; }

/* Attention badge & list */
.badge-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--red); color: #fff; font-size: 12px; font-weight: 750; display: inline-grid; place-items: center; }
.tool { position: relative; }
.tool .badge-count { position: absolute; top: 10px; right: 10px; }
.attn-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 14px 4px; border-bottom: 1px solid var(--sep); }
.attn-row:last-child { border-bottom: 0; }
.attn-row .ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 19px; background: rgba(255,59,48,.1); color: var(--red); }
.attn-row .ico.notsent { background: rgba(255,149,0,.13); color: #C46A00; }
.attn-actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.pill-Delivered, .pill-Read { background: rgba(31,168,85,.13); color: var(--green); }
.pill-Accepted, .pill-Sent { background: rgba(0,122,255,.11); color: var(--blue); }
.pill-Failed, .pill-Expired { background: rgba(255,59,48,.11); color: var(--red); }
.pill-NotSent { background: rgba(255,149,0,.15); color: #B86400; }
.pill-Retrying { background: rgba(88,86,214,.13); color: var(--indigo); }
.pill-Simulated { background: var(--surface-3); color: var(--text-2); }
@media (max-width: 600px) { .attn-row { grid-template-columns: 38px minmax(0, 1fr); } .attn-actions { grid-column: 2; flex-direction: row; } }

/* Super admin working inside a hospital */
.acting-bar { width: calc(100% - 48px); max-width: 1392px; margin: 16px auto 0; align-items: center; }
@media (max-width: 640px) { .acting-bar { width: calc(100% - 32px); flex-wrap: wrap; } .acting-bar .grow { flex: 1 1 calc(100% - 44px); } .acting-bar .btn { flex: 1 1 100%; } }

/* Buttons never squeeze their label */
a.btn { text-decoration: none; }
.btn-sm i { font-size: 17px; }
.hactions { display: flex; flex-wrap: wrap; gap: 8px; }
.hactions > .btn { flex: 1 1 auto; min-width: 0; }
.hactions > .btn-primary { flex-basis: 150px; }
.logo-review { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px; border-radius: 14px; background: rgba(245,158,11,.10); border: 1px dashed rgba(245,158,11,.45); }
.logo-review .hlogo { width: 44px; height: 44px; border-radius: 12px; }
.logo-review .grow { flex: 1 1 calc(100% - 60px); min-width: 0; }
.logo-review .btn { flex: 1 1 0; }

/* Icon badges: centre the glyph whatever layout the parent applies (e.g. .appt-meta span is inline-flex). */
span.ch.ch.ch { display: inline-flex; align-items: center; justify-content: center; line-height: 1; gap: 0; padding: 0; width: 22px; height: 22px; font-size: 14px; border: 0; }
span.ch.ch.ch-lg { width: 30px; height: 30px; font-size: 18px; }
.ch > i, .mh-icon > i, .alert-icon > i, .brand-mark > i, .start-icon > i, .hlogo > i { display: block; line-height: 1; }

/* Phones: keep logo, name and the user button on one line; long names shorten with "…" */
@media (max-width: 720px) {
    .topbar .brand { flex: 1 1 0; min-width: 0; }
    .topbar .brand > div { min-width: 0; }
    .topbar .brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }
    .topbar .spacer { display: none; }
    .topbar .brand-logo, .topbar .brand-mark { width: 38px; height: 38px; }
}
