/* ==========================================================================
   KLINIK UTAMA "PERMATA" — V3 Design System
   Bright, calm, trustworthy healthcare. Tokens → base → components → layouts → pages.
   Breakpoints: mobile ≤767 · tablet 768–1099 · desktop ≥1100 (see docs/DESIGN_SYSTEM.md)
   ========================================================================== */

@font-face { font-family: "Plus Jakarta Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/plus-jakarta-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/plus-jakarta-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/plus-jakarta-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/plus-jakarta-sans-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 800; font-style: normal; font-display: swap; src: url("../fonts/plus-jakarta-sans-latin-800-normal.woff2") format("woff2"); }

/* ------------------------------------------------------------------ tokens */
:root {
  /* brand */
  --c-primary: #0b63c5;
  --c-primary-600: #0a56ab;
  --c-primary-700: #094990;
  --c-navy: #0b2e57;
  --c-sky-25: #f7fbff;
  --c-sky-50: #eff6fe;
  --c-sky-100: #e2effc;
  --c-sky-200: #c9e0f8;
  --c-sky-300: #a6caf0;
  /* neutrals */
  --c-ink: #0f2340;
  --c-ink-2: #3d5069;
  --c-muted: #5b6d84;
  --c-line: #dde7f2;
  --c-line-strong: #c6d5e6;
  --c-bg: #f5f8fc;
  --c-surface: #ffffff;
  /* semantic (text on tint ≥ 4.5:1) */
  --c-success: #12784a; --c-success-bg: #e3f5eb; --c-success-line: #b7e3c9;
  --c-warning: #9a5300; --c-warning-bg: #fff1dc; --c-warning-line: #f6d39c;
  --c-danger: #b42318;  --c-danger-bg: #fdecea;  --c-danger-line: #f5c2bd;
  --c-info: var(--c-primary); --c-info-bg: var(--c-sky-50); --c-info-line: var(--c-sky-200);
  --c-neutral-bg: #eef2f7;
  /* type */
  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --fs-xs: .8125rem; --fs-sm: .875rem; --fs-md: 1rem; --fs-lg: 1.125rem; --fs-xl: 1.3125rem;
  --fs-2xl: clamp(1.375rem, 1.1rem + 1vw, 1.75rem);
  --fs-3xl: clamp(1.75rem, 1.3rem + 1.8vw, 2.5rem);
  --fs-hero: clamp(2.125rem, 1.4rem + 3.2vw, 3.75rem);
  --lh-tight: 1.15; --lh: 1.6;
  /* space */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-7: 32px; --s-8: 40px; --s-9: 56px; --s-10: 72px; --s-11: 96px;
  --section: clamp(56px, 7vw, 104px);
  --gutter: 16px;
  --container: 1200px;
  /* shape */
  --r-sm: 10px; --r-md: 14px; --r-lg: 20px; --r-xl: 28px; --r-pill: 999px;
  --sh-1: 0 1px 2px rgba(15, 35, 64, .06), 0 1px 1px rgba(15, 35, 64, .03);
  --sh-2: 0 6px 20px rgba(15, 35, 64, .07);
  --sh-3: 0 18px 48px rgba(15, 35, 64, .12);
  --ring: 0 0 0 3px rgba(11, 99, 197, .32);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --header-h: 72px;
  --sidebar-w: 264px;
  --bottomnav-h: 68px;
}
@media (min-width: 768px) { :root { --gutter: 24px; } }
@media (min-width: 1100px) { :root { --gutter: 32px; } }

/* -------------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); font-size: var(--fs-md); line-height: var(--lh); color: var(--c-ink); background: var(--c-bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden; }
img, svg, video { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0 0 var(--s-3); line-height: var(--lh-tight); color: var(--c-navy); letter-spacing: -.015em; font-weight: 800; }
h1 { font-size: var(--fs-3xl); } h2 { font-size: var(--fs-2xl); } h3 { font-size: var(--fs-xl); font-weight: 700; } h4 { font-size: var(--fs-lg); font-weight: 700; }
p { margin: 0 0 var(--s-4); }
a { color: var(--c-primary); text-underline-offset: 3px; }
a:hover { color: var(--c-primary-700); }
small { font-size: var(--fs-sm); }
hr { border: 0; border-top: 1px solid var(--c-line); margin: var(--s-6) 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid rgba(11, 99, 197, .45); outline-offset: 2px; border-radius: 6px; }
.icon { width: 1.25em; height: 1.25em; flex: none; stroke-width: 1.8; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 200; background: var(--c-navy); color: #fff; padding: 10px 16px; border-radius: var(--r-sm); font-weight: 700; }
.skip-link:focus { top: 12px; color: #fff; }
.container { width: min(var(--container), 100% - 2 * var(--gutter)); margin-inline: auto; }
.muted { color: var(--c-muted); }
.text-sm { font-size: var(--fs-sm); } .text-xs { font-size: var(--fs-xs); }
.text-right { text-align: right; } .text-center { text-align: center; }
.nowrap { white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.stack > * + * { margin-top: var(--s-4); }
.stack-sm > * + * { margin-top: var(--s-2); }
.stack-lg > * + * { margin-top: var(--s-6); }
.row { display: flex; gap: var(--s-3); align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: var(--s-3); align-items: center; justify-content: space-between; flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.grid { display: grid; gap: var(--s-5); }
.grid-2 { display: grid; gap: var(--s-5); grid-template-columns: 1fr; }
.grid-3 { display: grid; gap: var(--s-5); grid-template-columns: 1fr; }
.grid-4 { display: grid; gap: var(--s-4); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.hide-mobile { } .only-mobile { display: none !important; }
@media (max-width: 767px) { .hide-mobile { display: none !important; } .only-mobile { display: revert !important; } }
@media (min-width: 1100px) { .hide-desktop { display: none !important; } }
@media (max-width: 1099px) { .only-desktop { display: none !important; } }

/* ----------------------------------------------------------------- buttons */
.btn { --bg: var(--c-surface); --fg: var(--c-ink); --bd: var(--c-line-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: var(--r-pill);
  border: 1px solid var(--bd); background: var(--bg); color: var(--fg); font-weight: 700; font-size: var(--fs-sm); line-height: 1.2; text-decoration: none; cursor: pointer;
  transition: background .18s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease), transform .18s var(--ease); white-space: nowrap; }
.btn:hover { border-color: var(--c-primary); color: var(--c-primary-700); }
.btn:active { transform: translateY(1px); }
.btn .icon { width: 18px; height: 18px; }
.btn-primary { --bg: var(--c-primary); --fg: #fff; --bd: var(--c-primary); box-shadow: 0 6px 16px rgba(11, 99, 197, .22); }
.btn-primary:hover { --bg: var(--c-primary-600); color: #fff; border-color: var(--c-primary-600); }
.btn-soft { --bg: var(--c-sky-50); --fg: var(--c-primary-700); --bd: var(--c-sky-100); }
.btn-soft:hover { --bg: var(--c-sky-100); }
.btn-ghost { --bg: transparent; --bd: transparent; --fg: var(--c-ink-2); }
.btn-ghost:hover { --bg: var(--c-sky-50); border-color: transparent; }
.btn-danger { --bg: #fff; --fg: var(--c-danger); --bd: var(--c-danger-line); }
.btn-danger:hover { --bg: var(--c-danger-bg); color: var(--c-danger); border-color: var(--c-danger); }
.btn-danger-solid { --bg: var(--c-danger); --fg: #fff; --bd: var(--c-danger); }
.btn-danger-solid:hover { --bg: #9b1c13; color: #fff; }
.btn-success { --bg: var(--c-success); --fg: #fff; --bd: var(--c-success); }
.btn-success:hover { --bg: #0e623c; color: #fff; }
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: var(--fs-xs); }
.btn-lg { min-height: 54px; padding: 14px 26px; font-size: var(--fs-md); }
.btn-block { width: 100%; }
.btn-icon { width: 44px; padding: 0; }
.btn-sm.btn-icon { width: 36px; }
.btn[disabled], .btn.is-disabled { opacity: .55; pointer-events: none; box-shadow: none; }
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after { content: ""; position: absolute; width: 18px; height: 18px; border: 2.5px solid currentColor; border-color: rgba(255,255,255,.9) rgba(255,255,255,.9) transparent transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn:not(.btn-primary):not(.btn-danger-solid):not(.btn-success).is-loading::after { border-color: var(--c-primary) var(--c-primary) transparent transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.link-btn { background: none; border: 0; padding: 0; color: var(--c-primary); font-weight: 700; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; text-decoration: none; font-size: var(--fs-sm); }
.link-btn:hover { text-decoration: underline; }

/* ------------------------------------------------------------------- cards */
.card { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: var(--s-6); min-width: 0; }
.card-flat { box-shadow: none; }
.card-tint { background: var(--c-sky-25); border-color: var(--c-sky-100); box-shadow: none; }
.card-head { display: flex; gap: var(--s-3); align-items: center; justify-content: space-between; margin-bottom: var(--s-4); flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; font-size: var(--fs-lg); display: flex; gap: 10px; align-items: center; }
.card-head h2 .icon, .card-head h3 .icon { color: var(--c-primary); }
.card-sub { color: var(--c-muted); font-size: var(--fs-sm); margin: -8px 0 var(--s-4); }
.card-pad-sm { padding: var(--s-4); }
@media (max-width: 767px) { .card { padding: var(--s-5); border-radius: var(--r-md); } }
.section-title { display: flex; justify-content: space-between; align-items: end; gap: var(--s-4); margin-bottom: var(--s-6); flex-wrap: wrap; }
.section-title h2 { margin: 0; font-size: var(--fs-3xl); }
.section-title p { margin: 6px 0 0; color: var(--c-muted); max-width: 60ch; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-xs); letter-spacing: .12em; text-transform: uppercase; font-weight: 800; color: var(--c-primary); margin-bottom: var(--s-3); }

/* ------------------------------------------------------------------ badges */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 700; line-height: 1.3; white-space: nowrap; border: 1px solid transparent; }
.badge-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-success { color: var(--c-success); background: var(--c-success-bg); border-color: var(--c-success-line); }
.badge-warning { color: var(--c-warning); background: var(--c-warning-bg); border-color: var(--c-warning-line); }
.badge-danger { color: var(--c-danger); background: var(--c-danger-bg); border-color: var(--c-danger-line); }
.badge-info, .badge-primary { color: var(--c-primary-700); background: var(--c-sky-50); border-color: var(--c-sky-200); }
.badge-primary { color: #fff; background: var(--c-primary); border-color: var(--c-primary); }
.badge-neutral { color: var(--c-ink-2); background: var(--c-neutral-bg); border-color: var(--c-line); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--r-pill); background: var(--c-sky-50); color: var(--c-primary-700); font-size: var(--fs-xs); font-weight: 700; border: 1px solid var(--c-sky-100); }
.chip .icon { width: 15px; height: 15px; }

/* ------------------------------------------------------------------- forms */
.form-grid { display: grid; gap: var(--s-4) var(--s-5); grid-template-columns: 1fr; }
@media (min-width: 768px) { .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .form-grid .span-2 { grid-column: 1 / -1; } }
.form-grid-3 { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label { font-weight: 700; font-size: var(--fs-sm); color: var(--c-ink); display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.req { color: var(--c-danger); font-weight: 800; }
.opt { color: var(--c-muted); font-weight: 500; font-size: var(--fs-xs); }
.input, .select, .textarea { width: 100%; min-height: 48px; padding: 11px 14px; border: 1px solid var(--c-line-strong); border-radius: var(--r-md); background: #fff; color: var(--c-ink); font-size: 1rem; transition: border-color .15s, box-shadow .15s; }
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%235b6d84' stroke-width='2' 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; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--c-sky-300); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--c-primary); box-shadow: var(--ring); }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--c-danger); background: #fffafa; }
.input[disabled], .select[disabled], .input[readonly] { background: var(--c-neutral-bg); color: var(--c-ink-2); }
.input-sm { min-height: 40px; padding: 8px 12px; font-size: var(--fs-sm); border-radius: var(--r-sm); }
.field-hint { font-size: var(--fs-xs); color: var(--c-muted); margin: 0; }
.field-error { font-size: var(--fs-xs); color: var(--c-danger); font-weight: 700; margin: 0; display: flex; gap: 6px; align-items: center; }
.field-error::before { content: "!"; display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--c-danger); color: #fff; font-size: 11px; flex: none; }
.form-actions { display: flex; gap: var(--s-3); justify-content: flex-end; flex-wrap: wrap; margin-top: var(--s-6); padding-top: var(--s-5); border-top: 1px solid var(--c-line); }
@media (max-width: 767px) { .form-actions { flex-direction: column-reverse; } .form-actions .btn { width: 100%; } }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: var(--fs-sm); cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--c-primary); flex: none; }
/* segmented choice cards (WNI/WNA etc.) */
.choice-group { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.choice { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1.5px solid var(--c-line-strong); border-radius: var(--r-md); background: #fff; cursor: pointer; transition: border-color .15s, background .15s; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice .choice-mark { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--c-line-strong); flex: none; margin-top: 1px; display: grid; place-items: center; }
.choice b { display: block; font-size: var(--fs-md); }
.choice span { display: block; font-size: var(--fs-xs); color: var(--c-muted); }
.choice:has(input:checked) { border-color: var(--c-primary); background: var(--c-sky-25); box-shadow: 0 0 0 1px var(--c-primary) inset; }
.choice:has(input:checked) .choice-mark { border-color: var(--c-primary); background: radial-gradient(circle, var(--c-primary) 45%, transparent 50%); }
.choice:has(input:focus-visible) { box-shadow: var(--ring); }
.upload { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: var(--s-6); border: 2px dashed var(--c-sky-300); border-radius: var(--r-md); background: var(--c-sky-25); text-align: center; cursor: pointer; color: var(--c-ink-2); }
.upload:hover, .upload.is-drag { border-color: var(--c-primary); background: var(--c-sky-50); }
.upload input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload .icon { width: 32px; height: 32px; color: var(--c-primary); }
.upload-name { font-weight: 700; color: var(--c-primary-700); font-size: var(--fs-sm); word-break: break-all; }
.search-input { position: relative; }
.search-input .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--c-muted); pointer-events: none; }
.search-input .input { padding-left: 44px; }
.filters { display: flex; gap: var(--s-3); flex-wrap: wrap; align-items: end; margin-bottom: var(--s-5); }
.filters .field { flex: 1 1 160px; }
.filters .btn { flex: none; }

/* ------------------------------------------------------------------ alerts */
.alert { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r-md); border: 1px solid var(--c-info-line); background: var(--c-info-bg); color: var(--c-ink); font-size: var(--fs-sm); align-items: flex-start; }
.alert .icon { color: var(--c-primary); margin-top: 1px; }
.alert b { color: var(--c-navy); }
.alert p:last-child { margin-bottom: 0; }
.alert-success { background: var(--c-success-bg); border-color: var(--c-success-line); } .alert-success .icon { color: var(--c-success); }
.alert-warning { background: var(--c-warning-bg); border-color: var(--c-warning-line); } .alert-warning .icon { color: var(--c-warning); }
.alert-danger { background: var(--c-danger-bg); border-color: var(--c-danger-line); } .alert-danger .icon { color: var(--c-danger); }

/* ------------------------------------------------------------------- toast */
.toast-region { position: fixed; z-index: 120; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 32px)); }
.has-bottomnav .toast-region { bottom: calc(var(--bottomnav-h) + 16px + env(safe-area-inset-bottom)); }
@media (max-width: 767px) { .toast-region { left: 16px; right: 16px; max-width: none; } }
.toast { display: flex; gap: 12px; align-items: flex-start; background: var(--c-navy); color: #fff; padding: 14px 16px; border-radius: var(--r-md); box-shadow: var(--sh-3); font-size: var(--fs-sm); font-weight: 600; animation: toast-in .35s var(--ease); }
.toast .icon { margin-top: 1px; }
.toast-success .icon { color: #7ee2ae; } .toast-error { background: #7a1810; } .toast-error .icon { color: #ffb4ab; } .toast-info .icon { color: #a6caf0; }
.toast button { margin-left: auto; background: none; border: 0; color: inherit; opacity: .7; cursor: pointer; padding: 0 0 0 6px; }
.toast.is-leaving { opacity: 0; transform: translateY(8px); transition: .25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }

/* ------------------------------------------------------------------ dialog */
dialog.modal { border: 0; padding: 0; border-radius: var(--r-lg); width: min(520px, calc(100vw - 32px)); box-shadow: var(--sh-3); color: var(--c-ink); }
dialog.modal::backdrop { background: rgba(11, 30, 56, .45); backdrop-filter: blur(2px); }
.modal-body { padding: var(--s-6); }
.modal-body h2 { font-size: var(--fs-xl); }
.modal-actions { display: flex; gap: var(--s-3); justify-content: flex-end; padding: var(--s-4) var(--s-6); background: var(--c-sky-25); border-top: 1px solid var(--c-line); flex-wrap: wrap; }
@media (max-width: 767px) { dialog.modal { margin: auto auto 0; width: 100%; max-width: 100%; border-radius: var(--r-lg) var(--r-lg) 0 0; } .modal-actions .btn { flex: 1; } }
details.disclosure { border: 1px solid var(--c-line); border-radius: var(--r-md); background: #fff; }
details.disclosure > summary { cursor: pointer; padding: 14px 16px; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 10px; align-items: center; }
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary::after { content: "+"; font-size: 1.3rem; color: var(--c-primary); line-height: 1; }
details.disclosure[open] > summary::after { content: "–"; }
details.disclosure > .disclosure-body { padding: 0 16px 16px; }

/* ------------------------------------------------------------------- table */
.table-wrap { width: 100%; overflow-x: auto; border-radius: var(--r-md); }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-sm); }
.table th { text-align: left; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--c-muted); font-weight: 800; padding: 10px 14px; background: var(--c-sky-25); border-bottom: 1px solid var(--c-line); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--c-line); vertical-align: middle; }
.table tbody tr:hover td { background: #fbfdff; }
.table tr:last-child td { border-bottom: 0; }
.table .cell-main { font-weight: 700; color: var(--c-ink); }
.table .cell-sub { display: block; font-size: var(--fs-xs); color: var(--c-muted); font-weight: 500; }
.table td.actions { text-align: right; white-space: nowrap; }
/* Mobile: tables become stacked data cards (no forced horizontal scrolling) */
@media (max-width: 767px) {
  .table-responsive thead { display: none; }
  .table-responsive, .table-responsive tbody, .table-responsive tr, .table-responsive td { display: block; width: 100%; }
  .table-responsive tr { border: 1px solid var(--c-line); border-radius: var(--r-md); padding: 12px 14px; margin-bottom: 12px; background: #fff; }
  .table-responsive td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .table-responsive td::before { content: attr(data-label); font-weight: 700; color: var(--c-muted); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .04em; text-align: left; flex: none; max-width: 45%; }
  .table-responsive td[data-label=""]::before, .table-responsive td:not([data-label])::before { display: none; }
  .table-responsive td.actions { justify-content: flex-end; flex-wrap: wrap; padding-top: 10px; }
  .table-responsive td.td-primary { text-align: left; display: block; font-size: var(--fs-md); padding-bottom: 8px; border-bottom: 1px dashed var(--c-line); margin-bottom: 4px; }
  .table-responsive td.td-primary::before { display: none; }
  .table-wrap { overflow: visible; }
}

/* ------------------------------------------------------- key-value / lists */
.kv { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: 10px 16px; font-size: var(--fs-sm); margin: 0; }
.kv dt { color: var(--c-muted); font-weight: 600; }
.kv dd { margin: 0; font-weight: 700; color: var(--c-ink); min-width: 0; overflow-wrap: anywhere; }
.list { list-style: none; padding: 0; margin: 0; }
.list > li { padding: 12px 0; border-bottom: 1px solid var(--c-line); }
.list > li:last-child { border-bottom: 0; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 22px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--c-line); }
.timeline li { position: relative; padding: 0 0 16px; font-size: var(--fs-sm); }
.timeline li::before { content: ""; position: absolute; left: -20px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--c-sky-300); }
.timeline li.is-done::before { border-color: var(--c-success); background: var(--c-success); }
.timeline li.is-current::before { border-color: var(--c-primary); box-shadow: 0 0 0 4px var(--c-sky-100); }
.timeline time { display: block; font-size: var(--fs-xs); color: var(--c-muted); }

/* -------------------------------------------------- empty / skeleton / misc */
.empty { text-align: center; padding: var(--s-8) var(--s-5); color: var(--c-muted); }
.empty .empty-icon { width: 64px; height: 64px; margin: 0 auto var(--s-4); display: grid; place-items: center; border-radius: 50%; background: var(--c-sky-50); color: var(--c-primary); }
.empty .empty-icon .icon { width: 28px; height: 28px; }
.empty h3 { font-size: var(--fs-lg); margin-bottom: 6px; color: var(--c-ink); }
.empty p { max-width: 42ch; margin: 0 auto var(--s-4); font-size: var(--fs-sm); }
.skeleton { background: linear-gradient(90deg, var(--c-neutral-bg) 0, #f6f9fc 50%, var(--c-neutral-bg) 100%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: var(--r-sm); min-height: 16px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--c-sky-100); color: var(--c-primary-700); display: inline-grid; place-items: center; font-weight: 800; font-size: var(--fs-sm); flex: none; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--c-line); }
.avatar-lg { width: 64px; height: 64px; font-size: var(--fs-lg); }
.avatar-xl { width: 96px; height: 96px; }
.photo { border-radius: var(--r-md); object-fit: cover; background: var(--c-sky-100); }
.divider-label { display: flex; align-items: center; gap: 12px; color: var(--c-muted); font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin: var(--s-5) 0; }
.divider-label::before, .divider-label::after { content: ""; flex: 1; border-top: 1px solid var(--c-line); }
.pill-tabs { display: flex; gap: 6px; padding: 5px; background: var(--c-neutral-bg); border-radius: var(--r-pill); overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.pill-tabs::-webkit-scrollbar { display: none; }
.pill-tabs a, .pill-tabs button { flex: none; padding: 8px 14px; border-radius: var(--r-pill); font-weight: 700; font-size: var(--fs-sm); color: var(--c-ink-2); text-decoration: none; border: 0; background: none; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; min-height: 38px; }
.pill-tabs a[aria-current="page"], .pill-tabs button[aria-selected="true"] { background: #fff; color: var(--c-primary-700); box-shadow: var(--sh-1); }
.pill-tabs .count { background: var(--c-sky-100); color: var(--c-primary-700); border-radius: var(--r-pill); padding: 0 7px; font-size: 11px; }
.code-box { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: var(--fs-xl); letter-spacing: .04em; color: var(--c-navy); padding: 10px 16px; background: var(--c-sky-50); border: 1px dashed var(--c-sky-300); border-radius: var(--r-md); }
.stepper { display: flex; gap: 6px; list-style: none; margin: 0 0 var(--s-6); padding: 0; counter-reset: step; overflow-x: auto; scrollbar-width: none; }
.stepper li { flex: 1 1 0; min-width: 84px; display: flex; flex-direction: column; gap: 8px; font-size: var(--fs-xs); font-weight: 700; color: var(--c-muted); counter-increment: step; }
.stepper li::before { content: counter(step); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--c-neutral-bg); color: var(--c-muted); font-weight: 800; }
.stepper li::after { content: ""; height: 3px; border-radius: 3px; background: var(--c-line); order: -1; margin-bottom: 2px; }
.stepper li.is-done { color: var(--c-success); } .stepper li.is-done::before { content: "✓"; background: var(--c-success-bg); color: var(--c-success); } .stepper li.is-done::after { background: var(--c-success); }
.stepper li.is-current { color: var(--c-primary-700); } .stepper li.is-current::before { background: var(--c-primary); color: #fff; } .stepper li.is-current::after { background: var(--c-primary); }
.progress { height: 8px; border-radius: 8px; background: var(--c-neutral-bg); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--c-primary); border-radius: 8px; }

/* ----------------------------------------------------------- doctor card */
.doctor-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--c-line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-1); transition: transform .25s var(--ease), box-shadow .25s var(--ease); min-width: 0; }
a.doctor-card { text-decoration: none; color: inherit; }
a.doctor-card:hover { transform: translateY(-3px); box-shadow: var(--sh-2); }
.doctor-card .dc-photo { aspect-ratio: 4 / 3.2; width: 100%; object-fit: cover; object-position: center 22%; background: var(--c-sky-100); }
.doctor-card .dc-body { padding: var(--s-4) var(--s-5) var(--s-5); display: flex; flex-direction: column; gap: 6px; flex: 1; }
.doctor-card .dc-name { font-weight: 800; color: var(--c-navy); font-size: var(--fs-md); line-height: 1.3; }
.doctor-card .dc-spec { color: var(--c-muted); font-size: var(--fs-sm); }
.doctor-card .dc-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: auto; padding-top: 10px; font-size: var(--fs-xs); color: var(--c-ink-2); font-weight: 600; }
.doctor-card .dc-meta .icon { width: 16px; height: 16px; color: var(--c-primary); }
.doctor-row { display: flex; gap: 14px; align-items: center; min-width: 0; }
.doctor-row img { width: 56px; height: 56px; border-radius: var(--r-md); object-fit: cover; flex: none; background: var(--c-sky-100); }
.doctor-row .dr-name { font-weight: 800; color: var(--c-navy); line-height: 1.3; }
.doctor-row .dr-sub { font-size: var(--fs-xs); color: var(--c-muted); }
/* selectable doctor option (booking) */
.option-card { position: relative; display: flex; gap: 14px; align-items: center; padding: 14px; border: 1.5px solid var(--c-line); border-radius: var(--r-md); background: #fff; cursor: pointer; transition: border-color .15s, background .15s; }
.option-card input { position: absolute; opacity: 0; }
.option-card:hover { border-color: var(--c-sky-300); }
.option-card:has(input:checked) { border-color: var(--c-primary); background: var(--c-sky-25); box-shadow: 0 0 0 1px var(--c-primary) inset; }
.option-card:has(input:focus-visible) { box-shadow: var(--ring); }
.option-card.is-disabled { opacity: .6; cursor: not-allowed; }
.option-card img { width: 64px; height: 64px; border-radius: var(--r-md); object-fit: cover; flex: none; }

/* --------------------------------------------------- appointment card */
.appt { display: flex; gap: var(--s-4); align-items: stretch; padding: var(--s-4); border: 1px solid var(--c-line); border-radius: var(--r-md); background: #fff; min-width: 0; }
.appt-date { flex: none; width: 76px; border-radius: var(--r-md); background: var(--c-sky-50); color: var(--c-primary-700); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 8px 4px; text-align: center; }
.appt-date .d { font-size: 1.75rem; font-weight: 800; line-height: 1; color: var(--c-navy); }
.appt-date .m { font-size: var(--fs-xs); font-weight: 700; }
.appt-date .w { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.appt-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.appt-title { font-weight: 800; color: var(--c-navy); }
.appt-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: var(--fs-sm); color: var(--c-ink-2); }
.appt-meta span { display: inline-flex; gap: 6px; align-items: center; }
.appt-meta .icon { width: 16px; height: 16px; color: var(--c-muted); }
.appt-doc { display: flex; gap: 10px; align-items: center; margin-top: 6px; font-size: var(--fs-sm); font-weight: 700; }
.appt-doc img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }

/* ------------------------------------------------------ queue card */
.qcard { border-radius: var(--r-lg); background: linear-gradient(180deg, var(--c-sky-50), #fff 60%); border: 1px solid var(--c-sky-100); padding: var(--s-5); }
.qcard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); }
.qstat small { display: block; font-size: var(--fs-xs); color: var(--c-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.qstat strong { display: block; font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem); font-weight: 800; color: var(--c-navy); line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.qstat.is-mine strong { color: var(--c-primary); }
.qstat span { font-size: var(--fs-sm); color: var(--c-ink-2); }
.ticket-big { font-size: clamp(3rem, 2rem + 6vw, 5rem); font-weight: 800; color: var(--c-primary); letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }

/* -------------------------------------------------- document card */
.doc-item { display: flex; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--c-line); border-radius: var(--r-md); background: #fff; }
.doc-item .doc-icon { width: 44px; height: 52px; border-radius: 8px; background: var(--c-sky-50); color: var(--c-primary); display: grid; place-items: center; flex: none; border: 1px solid var(--c-sky-100); }
.doc-item .doc-title { font-weight: 800; color: var(--c-navy); }
.doc-item .doc-sub { font-size: var(--fs-xs); color: var(--c-muted); }
@media (max-width: 767px) { .doc-item { flex-wrap: wrap; } .doc-item .doc-actions { width: 100%; display: flex; gap: 8px; } .doc-item .doc-actions .btn { flex: 1; } }

/* --------------------------------------------------- stat tiles */
.stat { background: #fff; border: 1px solid var(--c-line); border-radius: var(--r-lg); padding: var(--s-5); display: flex; flex-direction: column; gap: 4px; min-width: 0; text-decoration: none; color: inherit; box-shadow: var(--sh-1); }
a.stat:hover { border-color: var(--c-sky-300); }
.stat .stat-label { font-size: var(--fs-xs); font-weight: 800; color: var(--c-muted); text-transform: uppercase; letter-spacing: .06em; display: flex; gap: 8px; align-items: center; }
.stat .stat-label .icon { width: 18px; height: 18px; color: var(--c-primary); }
.stat .stat-value { font-size: clamp(1.625rem, 1.2rem + 1.4vw, 2.125rem); font-weight: 800; color: var(--c-navy); letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat .stat-note { font-size: var(--fs-xs); color: var(--c-ink-2); }
.stat.is-alert { border-color: var(--c-warning-line); background: #fffaf2; }
.stat.is-alert .stat-label .icon { color: var(--c-warning); }
.stat.is-danger { border-color: var(--c-danger-line); background: #fff8f7; }
.action-tile { display: flex; gap: 14px; align-items: center; padding: var(--s-4) var(--s-5); border-radius: var(--r-lg); border: 1px solid var(--c-line); background: #fff; text-decoration: none; color: var(--c-ink); font-weight: 700; min-height: 76px; transition: border-color .15s, transform .2s var(--ease); }
.action-tile:hover { border-color: var(--c-primary); color: var(--c-primary-700); transform: translateY(-2px); }
.action-tile .at-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--c-sky-50); color: var(--c-primary); flex: none; }
.action-tile small { display: block; font-weight: 500; color: var(--c-muted); font-size: var(--fs-xs); }
.action-tile .chev { margin-left: auto; color: var(--c-muted); }
.action-tile.is-primary { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.action-tile.is-primary .at-icon { background: rgba(255,255,255,.16); color: #fff; }
.action-tile.is-primary small, .action-tile.is-primary .chev { color: rgba(255,255,255,.85); }
.action-tile.is-primary:hover { color: #fff; background: var(--c-primary-600); }

/* ------------------------------------------------- slot picker / calendar */
.cal { user-select: none; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s-3); }
.cal-head b { font-size: var(--fs-lg); color: var(--c-navy); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-grid .dow { text-align: center; font-size: 11px; font-weight: 800; color: var(--c-muted); text-transform: uppercase; padding: 4px 0; }
.cal-day { position: relative; display: grid; place-items: center; aspect-ratio: 1 / 1; min-height: 40px; border-radius: 12px; border: 1px solid transparent; font-weight: 700; font-size: var(--fs-sm); color: var(--c-muted); text-decoration: none; background: transparent; }
.cal-day.is-available { background: var(--c-success-bg); color: var(--c-success); border-color: var(--c-success-line); }
.cal-day.is-limited { background: var(--c-warning-bg); color: var(--c-warning); border-color: var(--c-warning-line); }
.cal-day.is-full { background: var(--c-neutral-bg); color: #8696aa; text-decoration: line-through; }
.cal-day.is-off, .cal-day.is-past, .cal-day.is-beyond, .cal-day.is-holiday, .cal-day.is-leave { color: #a3b1c2; }
.cal-day.is-holiday { color: var(--c-danger); opacity: .6; }
a.cal-day:hover { border-color: var(--c-primary); }
.cal-day.is-selected { background: var(--c-primary); color: #fff; border-color: var(--c-primary); box-shadow: 0 6px 14px rgba(11,99,197,.28); }
.cal-day.is-today::after { content: ""; position: absolute; bottom: 6px; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: var(--fs-xs); color: var(--c-ink-2); margin-top: var(--s-3); }
.cal-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 6px; vertical-align: -2px; border: 1px solid var(--c-line); }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.slot { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 58px; padding: 8px; border-radius: var(--r-md); border: 1.5px solid var(--c-line-strong); background: #fff; cursor: pointer; font-weight: 800; font-variant-numeric: tabular-nums; }
.slot input { position: absolute; opacity: 0; }
.slot small { font-size: 11px; font-weight: 700; color: var(--c-success); }
.slot.is-limited small { color: var(--c-warning); }
.slot:hover { border-color: var(--c-primary); }
.slot:has(input:checked) { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.slot:has(input:checked) small { color: #fff; }
.slot:has(input:focus-visible) { box-shadow: var(--ring); }
.slot.is-full { background: var(--c-neutral-bg); color: #8696aa; cursor: not-allowed; border-style: dashed; }
.slot.is-full small { color: #8696aa; }

/* --------------------------------------------------------- reveal motion */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } .reveal { opacity: 1; transform: none; } }

/* ==========================================================================
   LAYOUT — public site
   ========================================================================== */
.brand { display: flex; gap: 12px; align-items: center; text-decoration: none; color: var(--c-navy); min-width: 0; }
.brand img { width: 44px; height: 44px; flex: none; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text b { font-size: 15px; font-weight: 800; letter-spacing: .02em; line-height: 1.2; white-space: nowrap; }
.brand-text small { font-size: 12px; color: var(--c-muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-header { position: sticky; top: 0; z-index: 60; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--c-line); }
.site-header-inner { height: var(--header-h); display: flex; align-items: center; gap: var(--s-6); }
.site-nav { display: flex; gap: 4px; margin-left: auto; }
.site-nav a { padding: 10px 12px; border-radius: var(--r-pill); font-weight: 700; font-size: var(--fs-sm); color: var(--c-ink-2); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { background: var(--c-sky-50); color: var(--c-primary-700); }
.site-actions { display: flex; gap: 8px; align-items: center; }
.nav-toggle { display: none; margin-left: auto; }
.mobile-menu { border-top: 1px solid var(--c-line); background: #fff; padding: var(--s-4) var(--gutter) var(--s-6); box-shadow: var(--sh-2); }
.mobile-menu nav { display: grid; gap: 2px; margin-bottom: var(--s-4); }
.mobile-menu nav a { padding: 14px 12px; border-radius: var(--r-md); font-weight: 700; color: var(--c-ink); text-decoration: none; display: flex; gap: 12px; align-items: center; }
.mobile-menu nav a .icon { color: var(--c-primary); }
.mobile-menu nav a:hover { background: var(--c-sky-50); }
.mobile-menu .btn { width: 100%; margin-top: 8px; }
@media (max-width: 1099px) {
  .site-nav { display: none; }
  .nav-toggle { display: inline-flex; }
  .site-actions .btn-cta-secondary { display: none; }
}
@media (max-width: 767px) {
  :root { --header-h: 64px; }
  .site-actions { display: none; }
  .brand img { width: 38px; height: 38px; }
  .brand-text b { font-size: 14px; }
}
@media (min-width: 1100px) { .mobile-menu { display: none !important; } }

.site-footer { background: var(--c-navy); color: #c9d8ea; margin-top: var(--section); padding: var(--s-10) 0 var(--s-6); font-size: var(--fs-sm); }
.site-footer a { color: #fff; }
.site-footer h3 { color: #fff; font-size: var(--fs-md); margin-bottom: var(--s-3); }
.footer-grid { display: grid; gap: var(--s-8); grid-template-columns: 1fr; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer-brand { display: flex; gap: 14px; align-items: center; margin-bottom: var(--s-4); }
.footer-brand img { width: 52px; height: 52px; background: #fff; border-radius: 14px; padding: 6px; }
.footer-brand b { color: #fff; font-size: var(--fs-lg); display: block; }
.footer-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.footer-list li { display: flex; gap: 10px; align-items: flex-start; }
.footer-list .icon { width: 18px; height: 18px; color: #8fb8e8; margin-top: 2px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: var(--s-8); padding-top: var(--s-5); display: flex; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; font-size: var(--fs-xs); color: #9fb4cc; }

.page { padding: var(--s-8) 0 var(--s-10); }
.page-head { display: flex; gap: var(--s-4); justify-content: space-between; align-items: flex-end; margin-bottom: var(--s-6); flex-wrap: wrap; }
.page-head h1 { margin: 0 0 6px; }
.page-head p { margin: 0; color: var(--c-muted); max-width: 64ch; }
.breadcrumb { display: flex; gap: 6px; flex-wrap: wrap; font-size: var(--fs-xs); font-weight: 700; color: var(--c-muted); margin-bottom: var(--s-3); list-style: none; padding: 0; }
.breadcrumb a { color: var(--c-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--c-primary); }
.breadcrumb li + li::before { content: "/"; margin-right: 6px; opacity: .6; }
@media (max-width: 767px) { .page { padding: var(--s-5) 0 var(--s-9); } .page-head .btn { width: 100%; } }

/* ==========================================================================
   LAYOUT — patient portal
   ========================================================================== */
.portal { display: block; min-height: 100vh; }
.portal-sidebar { display: none; }
.portal-main { min-width: 0; }
.portal-topbar { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.94); backdrop-filter: blur(14px); border-bottom: 1px solid var(--c-line); }
.portal-topbar-inner { height: 64px; display: flex; align-items: center; gap: 12px; }
.portal-topbar .tb-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.icon-btn { position: relative; width: 44px; height: 44px; border-radius: 50%; display: inline-grid; place-items: center; background: #fff; border: 1px solid var(--c-line); color: var(--c-ink-2); text-decoration: none; cursor: pointer; }
.icon-btn:hover { color: var(--c-primary); border-color: var(--c-sky-300); }
.icon-btn .dot { position: absolute; top: 9px; right: 10px; width: 9px; height: 9px; border-radius: 50%; background: #e5484d; border: 2px solid #fff; }
.portal-tabs { display: none; background: #fff; border-bottom: 1px solid var(--c-line); }
.portal-tabs .pill-tabs { background: none; padding: 8px 0; }
.portal-content { padding: var(--s-6) 0 calc(var(--bottomnav-h) + var(--s-8)); }
.bottom-nav { position: fixed; z-index: 70; left: 0; right: 0; bottom: 0; height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: rgba(255,255,255,.97); backdrop-filter: blur(16px); border-top: 1px solid var(--c-line); display: grid; grid-template-columns: repeat(5, 1fr); box-shadow: 0 -8px 24px rgba(15,35,64,.06); }
.bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--c-muted); font-size: 11.5px; font-weight: 700; position: relative; }
.bottom-nav a .bn-ic { width: 52px; height: 30px; display: grid; place-items: center; border-radius: 999px; transition: background .2s; }
.bottom-nav a .icon { width: 22px; height: 22px; }
.bottom-nav a[aria-current="page"] { color: var(--c-primary-700); }
.bottom-nav a[aria-current="page"] .bn-ic { background: var(--c-sky-100); }
@media (min-width: 768px) {
  .bottom-nav { display: none; }
  .portal-tabs { display: block; }
  .portal-content { padding-bottom: var(--s-10); }
  .has-bottomnav .toast-region { bottom: 16px; }
}
@media (min-width: 1100px) {
  .portal { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .portal-sidebar { display: flex; flex-direction: column; gap: var(--s-5); position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: var(--s-6) var(--s-4); background: #fff; border-right: 1px solid var(--c-line); }
  .portal-tabs { display: none; }
  .portal-topbar .brand { display: none; }
  .portal-content { padding-top: var(--s-7); }
}
.side-nav { display: grid; gap: 2px; }
.side-nav a, .side-nav button { display: flex; gap: 12px; align-items: center; padding: 11px 12px; border-radius: var(--r-md); color: var(--c-ink-2); text-decoration: none; font-weight: 700; font-size: var(--fs-sm); background: none; border: 0; width: 100%; cursor: pointer; text-align: left; }
.side-nav a .icon, .side-nav button .icon { width: 20px; height: 20px; color: var(--c-muted); }
.side-nav a:hover, .side-nav button:hover { background: var(--c-sky-50); color: var(--c-primary-700); }
.side-nav a[aria-current="page"] { background: var(--c-primary); color: #fff; box-shadow: 0 6px 16px rgba(11,99,197,.22); }
.side-nav a[aria-current="page"] .icon { color: #fff; }
.side-nav .nav-count { margin-left: auto; background: var(--c-danger); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 7px; }
.side-nav a[aria-current="page"] .nav-count { background: #fff; color: var(--c-primary); }
.side-group-label { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--c-muted); padding: var(--s-4) 12px 6px; }
.me-card { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: var(--r-md); background: var(--c-sky-25); border: 1px solid var(--c-sky-100); min-width: 0; }
.me-card b { display: block; color: var(--c-navy); font-size: var(--fs-sm); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-card span { font-size: var(--fs-xs); color: var(--c-muted); font-weight: 700; }

/* ==========================================================================
   LAYOUT — staff workspace
   ========================================================================== */
.staff { min-height: 100vh; }
.staff-sidebar { position: fixed; z-index: 90; inset: 0 auto 0 0; width: min(300px, 86vw); background: #0d2a4d; color: #c7d6e8; display: flex; flex-direction: column; transform: translateX(-102%); transition: transform .3s var(--ease); overflow-y: auto; }
.staff-sidebar.is-open { transform: none; box-shadow: var(--sh-3); }
.staff-backdrop { position: fixed; inset: 0; z-index: 85; background: rgba(8, 22, 42, .5); opacity: 0; pointer-events: none; transition: opacity .25s; }
.staff-sidebar.is-open + .staff-backdrop { opacity: 1; pointer-events: auto; }
.staff-brand { display: flex; gap: 12px; align-items: center; padding: var(--s-5) var(--s-5) var(--s-4); color: #fff; text-decoration: none; }
.staff-brand img { width: 40px; height: 40px; background: #fff; border-radius: 12px; padding: 4px; }
.staff-brand b { font-size: 14px; line-height: 1.2; display: block; }
.staff-brand small { font-size: 11px; color: #8fb0d6; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.staff-nav { padding: 0 var(--s-3) var(--s-6); display: grid; gap: 2px; }
.staff-nav .side-group-label { color: #7f9cc0; }
.staff-nav a { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; color: #d3e0ef; text-decoration: none; font-weight: 600; font-size: var(--fs-sm); }
.staff-nav a .icon { width: 19px; height: 19px; color: #8fb0d6; }
.staff-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.staff-nav a[aria-current="page"] { background: #fff; color: var(--c-navy); font-weight: 800; }
.staff-nav a[aria-current="page"] .icon { color: var(--c-primary); }
.staff-nav .nav-count { margin-left: auto; background: #f59e0b; color: #1f1300; border-radius: 999px; font-size: 11px; font-weight: 800; padding: 1px 8px; }
.staff-user { margin-top: auto; padding: var(--s-4) var(--s-5); border-top: 1px solid rgba(255,255,255,.08); display: flex; gap: 12px; align-items: center; }
.staff-user b { color: #fff; font-size: var(--fs-sm); display: block; line-height: 1.25; }
.staff-user span { font-size: 11px; color: #8fb0d6; font-weight: 700; }
.staff-main { min-width: 0; }
.staff-topbar { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.95); backdrop-filter: blur(14px); border-bottom: 1px solid var(--c-line); }
.staff-topbar-inner { height: 64px; display: flex; gap: 12px; align-items: center; padding: 0 var(--gutter); }
.staff-search { flex: 1; max-width: 560px; }
.staff-search .input { min-height: 44px; border-radius: var(--r-pill); background: var(--c-bg); }
.staff-topbar .tb-right { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.staff-topbar .tb-date { font-size: var(--fs-xs); color: var(--c-muted); font-weight: 700; text-align: right; line-height: 1.3; }
.staff-content { padding: var(--s-6) var(--gutter) var(--s-10); max-width: 1480px; }
.staff-content .page-head { margin-bottom: var(--s-5); }
@media (min-width: 1100px) {
  .staff { display: grid; grid-template-columns: 260px minmax(0, 1fr); }
  .staff-sidebar { position: sticky; top: 0; height: 100vh; transform: none; width: auto; }
  .staff-backdrop, .staff-menu-btn { display: none !important; }
}
@media (max-width: 767px) {
  .staff-topbar .tb-date { display: none; }
  .staff-content { padding-top: var(--s-5); }
}

/* ==========================================================================
   AUTH screens (patient login, staff login)
   ========================================================================== */
.auth-wrap { min-height: calc(100vh - var(--header-h)); display: grid; place-items: center; padding: var(--s-8) var(--gutter); }
.auth-card { width: min(460px, 100%); }
.auth-card .auth-logo { width: 64px; height: 64px; margin: 0 auto var(--s-4); }
.auth-split { display: grid; gap: var(--s-6); width: min(1040px, 100%); align-items: stretch; }
@media (min-width: 1100px) { .auth-split { grid-template-columns: 1fr 1fr; } }
.auth-aside { border-radius: var(--r-xl); background: var(--c-sky-100); position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; min-height: 520px; padding: var(--s-7); }
.auth-aside img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.auth-aside .aa-note { position: relative; background: rgba(255,255,255,.94); border-radius: var(--r-lg); padding: var(--s-5); box-shadow: var(--sh-2); }
@media (max-width: 1099px) { .auth-aside { display: none; } }

/* ==========================================================================
   PAGE — landing
   ========================================================================== */
.section { padding: var(--section) 0; }
.section-tint { background: linear-gradient(180deg, #fff 0, var(--c-sky-25) 18%, var(--c-sky-25) 82%, #fff 100%); }
.hero { position: relative; padding: clamp(32px, 5vw, 72px) 0 clamp(40px, 5vw, 80px); background: radial-gradient(1100px 520px at 85% 10%, var(--c-sky-100), transparent 60%), #fff; overflow: hidden; }
.hero-grid { display: grid; gap: var(--s-8); align-items: center; grid-template-columns: 1fr; }
.hero h1 { font-size: var(--fs-hero); letter-spacing: -.03em; line-height: 1.08; margin-bottom: var(--s-5); max-width: 16ch; }
.hero h1 .hl { color: var(--c-primary); }
.hero-lead { font-size: var(--fs-lg); color: var(--c-ink-2); max-width: 52ch; margin-bottom: var(--s-7); }
.hero-ctas { display: flex; gap: var(--s-3); flex-wrap: wrap; }
.hero-trust { list-style: none; padding: 0; margin: var(--s-7) 0 0; display: flex; gap: var(--s-3) var(--s-6); flex-wrap: wrap; font-size: var(--fs-sm); font-weight: 700; color: var(--c-ink-2); }
.hero-trust li { display: flex; gap: 8px; align-items: center; }
.hero-trust .icon { color: var(--c-success); }
.hero-visual { position: relative; }
.hero-photo { border-radius: var(--r-xl); overflow: hidden; background: #e8f3fd; box-shadow: var(--sh-3); aspect-ratio: 738 / 700; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.hero-float { position: absolute; display: flex; gap: 12px; align-items: center; background: rgba(255,255,255,.97); border-radius: var(--r-lg); padding: 12px 16px; box-shadow: var(--sh-2); border: 1px solid var(--c-line); }
.hero-float b { display: block; color: var(--c-navy); font-size: var(--fs-md); line-height: 1.2; }
.hero-float small { display: block; color: var(--c-muted); font-size: var(--fs-xs); font-weight: 600; }
.hf-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--c-success-bg); color: var(--c-success); display: grid; place-items: center; }
.hero-float-a { left: -28px; bottom: 56px; }
.hero-float-b { right: -18px; top: 34px; }
.hero-float-b b { font-size: 1.6rem; color: var(--c-primary); font-variant-numeric: tabular-nums; }
@media (min-width: 1100px) {
  .hero-grid { grid-template-columns: 1.08fr .92fr; gap: var(--s-10); }
  .hero-visual { max-width: 520px; justify-self: end; width: 100%; }
}
@media (min-width: 768px) and (max-width: 1099px) {
  .hero-grid { grid-template-columns: 1.1fr .9fr; gap: var(--s-7); }
  .hero-float-a { left: -12px; } .hero-float-b { right: -6px; }
  .hero h1 { max-width: none; }
}
@media (max-width: 767px) {
  .hero { padding-top: var(--s-5); }
  .hero-grid { gap: var(--s-5); }
  .hero-copy { display: contents; }
  .hero-copy .eyebrow { order: 1; margin-bottom: -8px; }
  .hero h1 { order: 2; margin: 0; font-size: 2rem; }
  .hero-visual { order: 3; }
  .hero-lead { order: 4; margin: 0; font-size: var(--fs-md); }
  .hero-ctas { order: 5; flex-direction: column; }
  .hero-ctas .btn { width: 100%; }
  .hero-trust { order: 6; margin-top: 0; flex-direction: column; gap: 8px; }
  .hero-photo { aspect-ratio: 4 / 3.4; border-radius: var(--r-lg); }
  .hero-float { padding: 10px 12px; }
  .hero-float-a { left: 10px; bottom: 10px; }
  .hero-float-b { right: 10px; top: 10px; }
  .hero-float-b b { font-size: 1.25rem; }
  .hf-icon { width: 34px; height: 34px; }
}
.info-strip { background: var(--c-navy); color: #dce8f6; }
.info-strip-grid { display: grid; grid-template-columns: 1fr; gap: 0; }
.info-strip-grid > div { display: flex; gap: 14px; align-items: center; padding: 18px 0; border-bottom: 1px solid rgba(255,255,255,.1); }
.info-strip-grid > div:last-child { border-bottom: 0; }
.info-strip .icon { width: 24px; height: 24px; color: #8fc0f5; }
.info-strip small { display: block; font-size: var(--fs-xs); color: #9fb6cf; font-weight: 600; }
.info-strip b, .info-strip a { color: #fff; font-size: var(--fs-sm); text-decoration: none; }
@media (min-width: 768px) { .info-strip-grid { grid-template-columns: repeat(3, 1fr); } .info-strip-grid > div { border-bottom: 0; border-right: 1px solid rgba(255,255,255,.1); padding: 22px 24px; } .info-strip-grid > div:first-child { padding-left: 0; } .info-strip-grid > div:last-child { border-right: 0; } }

.service-grid { display: grid; gap: var(--s-4); grid-template-columns: 1fr; }
@media (min-width: 600px) { .service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .service-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.service-card { display: flex; flex-direction: column; gap: 8px; padding: var(--s-6); border-radius: var(--r-lg); background: #fff; border: 1px solid var(--c-line); text-decoration: none; color: var(--c-ink-2); font-size: var(--fs-sm); transition: border-color .2s, transform .25s var(--ease), box-shadow .25s; }
.service-card:hover { border-color: var(--c-sky-300); transform: translateY(-3px); box-shadow: var(--sh-2); color: var(--c-ink-2); }
.service-card b { color: var(--c-navy); font-size: var(--fs-lg); }
.service-card .sc-icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--c-sky-50); color: var(--c-primary); margin-bottom: 6px; }
.service-card .sc-icon .icon { width: 26px; height: 26px; }
.service-card .sc-link { margin-top: auto; padding-top: 8px; display: inline-flex; gap: 6px; align-items: center; color: var(--c-primary); font-weight: 700; }
.service-card .sc-link .icon { width: 16px; height: 16px; transition: transform .2s; }
.service-card:hover .sc-link .icon { transform: translateX(3px); }
.service-card.is-jpets { background: var(--c-primary); border-color: var(--c-primary); color: #dbeafc; }
.service-card.is-jpets b, .service-card.is-jpets .sc-link { color: #fff; }
.service-card.is-jpets .sc-icon { background: rgba(255,255,255,.15); color: #fff; }

.jpets-grid { display: grid; gap: var(--s-8); align-items: center; grid-template-columns: 1fr; }
@media (min-width: 1100px) { .jpets-grid { grid-template-columns: .85fr 1.15fr; gap: var(--s-10); } }
.jpets-visual { position: relative; border-radius: var(--r-xl); overflow: hidden; aspect-ratio: 5 / 4.4; background: #e8f3fd; max-width: 520px; }
.jpets-visual img { width: 100%; height: 100%; object-fit: cover; object-position: center 12%; }
.jpets-badge { position: absolute; left: 16px; bottom: 16px; display: flex; gap: 12px; align-items: center; background: var(--c-navy); color: #fff; border-radius: var(--r-lg); padding: 12px 16px; }
.jpets-badge .icon { width: 30px; height: 30px; color: #8fc0f5; }
.jpets-badge small { display: block; color: #b9cde4; font-size: var(--fs-xs); }
@media (max-width: 1099px) { .jpets-visual { max-width: none; aspect-ratio: 16 / 9; } .jpets-visual img { object-position: center 18%; } }
.jpets-steps { list-style: none; counter-reset: js; padding: 0; margin: var(--s-6) 0 var(--s-7); display: grid; gap: var(--s-3); }
@media (min-width: 768px) { .jpets-steps { grid-template-columns: repeat(2, 1fr); } }
.jpets-steps li { counter-increment: js; background: #fff; border: 1px solid var(--c-line); border-radius: var(--r-md); padding: 16px 16px 16px 60px; position: relative; font-size: var(--fs-sm); color: var(--c-ink-2); }
.jpets-steps li::before { content: counter(js); position: absolute; left: 16px; top: 16px; width: 30px; height: 30px; border-radius: 50%; background: var(--c-sky-100); color: var(--c-primary-700); font-weight: 800; display: grid; place-items: center; }
.jpets-steps b { display: block; color: var(--c-navy); }

.doctor-grid { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
@media (max-width: 599px) { .doctor-grid { grid-template-columns: 1fr 1fr; gap: 12px; } .doctor-card .dc-body { padding: 12px; } .doctor-card .dc-name { font-size: var(--fs-sm); } .doctor-card .dc-spec { font-size: var(--fs-xs); } .doctor-card .badge { font-size: 11px; padding: 3px 8px; } }
.schedule-card { padding: 0; overflow: hidden; }
.schedule-table td { vertical-align: top; }
.schedule-table td:first-child { min-width: 260px; }
.sched-chip { display: inline-flex; flex-direction: column; padding: 6px 10px; margin: 2px 4px 2px 0; border-radius: 10px; background: var(--c-sky-50); color: var(--c-primary-700); font-weight: 800; font-size: var(--fs-xs); line-height: 1.25; }
.sched-chip small { font-weight: 600; color: var(--c-muted); font-size: 11px; }
.sched-list { padding: var(--s-4); display: grid; gap: var(--s-3); }
.how-grid { display: grid; gap: var(--s-5); grid-template-columns: 1fr; }
@media (min-width: 1100px) { .how-grid { grid-template-columns: 1fr 1fr; } }
.how-card { padding: var(--s-7); }
.how-steps { list-style: none; padding: 0; margin: var(--s-5) 0 var(--s-6); display: grid; gap: var(--s-4); }
.how-steps li { display: flex; gap: 14px; }
.how-steps p { margin: 2px 0 0; font-size: var(--fs-sm); color: var(--c-muted); }
.how-steps b { color: var(--c-navy); }
.hs-n { width: 34px; height: 34px; flex: none; border-radius: 50%; background: var(--c-primary); color: #fff; font-weight: 800; display: grid; place-items: center; }
.queue-summary { display: grid; gap: var(--s-4); grid-template-columns: 1fr; }
@media (min-width: 768px) { .queue-summary { grid-template-columns: repeat(3, 1fr); } }
.queue-summary > p { grid-column: 1 / -1; margin: 0; }
.queue-tile { background: #fff; border: 1px solid var(--c-line); border-radius: var(--r-lg); padding: var(--s-5) var(--s-6); box-shadow: var(--sh-1); }
.queue-tile .qt-head { display: flex; gap: 10px; align-items: center; margin-bottom: var(--s-4); color: var(--c-navy); }
.qt-code { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--c-primary); color: #fff; font-weight: 800; }
[data-queue="B"] .qt-code { background: var(--c-success); } [data-queue="C"] .qt-code { background: #c26a00; }
.queue-tile small { font-size: var(--fs-xs); color: var(--c-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.queue-tile strong { display: block; font-size: 2.75rem; line-height: 1.1; color: var(--c-navy); font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.queue-tile .qt-foot { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: var(--fs-xs); color: var(--c-ink-2); margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--c-line); }
.is-flash { animation: flash 1.6s var(--ease); }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 6px rgba(11,99,197,.35); } 100% { box-shadow: var(--sh-1); } }
.is-error { color: var(--c-danger) !important; }
.info-grid { display: grid; gap: var(--s-8); grid-template-columns: 1fr; align-items: start; }
@media (min-width: 1100px) { .info-grid { grid-template-columns: 1fr 1.1fr; } }
.kv-lg { font-size: var(--fs-md); margin-top: var(--s-5); }
.mt { margin-top: var(--s-7); }
.hours-list { list-style: none; padding: 0; margin: 0 0 var(--s-3); display: grid; gap: 2px; max-width: 420px; }
.hours-list li { display: flex; justify-content: space-between; padding: 10px 14px; border-radius: 10px; font-size: var(--fs-sm); }
.hours-list li:nth-child(odd) { background: var(--c-sky-25); }
.hours-list li.is-today { background: var(--c-primary); color: #fff; }
.hours-list li.is-today b { color: #fff; }
.map-card { border-radius: var(--r-xl); overflow: hidden; min-height: 360px; background: var(--c-sky-50); border: 1px solid var(--c-sky-100); }
.map-card iframe { width: 100%; height: 100%; min-height: 380px; border: 0; }
.map-placeholder { min-height: 380px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: var(--s-7); background-image: linear-gradient(var(--c-sky-100) 1px, transparent 1px), linear-gradient(90deg, var(--c-sky-100) 1px, transparent 1px); background-size: 36px 36px; }
.map-placeholder b { color: var(--c-navy); font-size: var(--fs-lg); }
.map-placeholder .btn { margin-top: var(--s-4); }
.mp-pin { width: 64px; height: 64px; border-radius: 50%; background: var(--c-primary); color: #fff; display: grid; place-items: center; box-shadow: 0 0 0 10px rgba(11,99,197,.12); margin-bottom: 10px; }
.mp-pin .icon { width: 30px; height: 30px; }
.faq-grid { display: grid; gap: var(--s-7); grid-template-columns: 1fr; }
@media (min-width: 1100px) { .faq-grid { grid-template-columns: .8fr 1.2fr; } }

/* ==========================================================================
   PAGE — public queue board & TV display
   ========================================================================== */
.board { display: grid; gap: var(--s-5); grid-template-columns: 1fr; }
@media (min-width: 900px) { .board { grid-template-columns: repeat(3, 1fr); } }
.board-status { grid-column: 1 / -1; margin: 0; }
.board-card { background: #fff; border: 1px solid var(--c-line); border-radius: var(--r-xl); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--sh-1); }
.board-card header { display: flex; gap: 12px; align-items: center; padding: var(--s-5); border-bottom: 1px solid var(--c-line); }
.board-card header b { display: block; color: var(--c-navy); }
.board-card header small { color: var(--c-muted); font-weight: 600; }
.board-now { padding: var(--s-6) var(--s-5); text-align: center; background: var(--c-sky-25); }
.board-now small, .board-next small { font-size: var(--fs-xs); font-weight: 800; letter-spacing: .08em; color: var(--c-muted); text-transform: uppercase; }
.board-now strong { display: block; font-size: clamp(3rem, 2rem + 4vw, 4.5rem); line-height: 1.05; font-weight: 800; color: var(--c-primary); font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.board-next { padding: var(--s-5); }
.board-next ul { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.board-next li { padding: 6px 12px; border-radius: 10px; background: var(--c-neutral-bg); font-weight: 800; font-variant-numeric: tabular-nums; }
.board-card footer { margin-top: auto; display: flex; justify-content: space-between; gap: 8px; padding: 12px var(--s-5); font-size: var(--fs-xs); color: var(--c-ink-2); border-top: 1px solid var(--c-line); flex-wrap: wrap; }

.layout-tv { background: #071b33; color: #fff; min-height: 100vh; }
.tv { min-height: 100vh; display: flex; flex-direction: column; padding: clamp(16px, 2vw, 36px); gap: clamp(16px, 2vw, 28px); }
.tv-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.tv-brand { display: flex; gap: 18px; align-items: center; }
.tv-brand img { width: clamp(52px, 5vw, 84px); height: auto; background: #fff; border-radius: 18px; padding: 8px; }
.tv-brand b { display: block; font-size: clamp(1.25rem, 2.2vw, 2.4rem); letter-spacing: .02em; }
.tv-brand span { color: #9cb7d6; font-size: clamp(.85rem, 1.1vw, 1.2rem); font-weight: 600; }
.tv-clock { text-align: right; }
.tv-clock strong { display: block; font-size: clamp(2rem, 4vw, 4.5rem); line-height: 1; font-variant-numeric: tabular-nums; }
.tv-clock span { color: #9cb7d6; font-weight: 700; font-size: clamp(.85rem, 1.1vw, 1.25rem); }
.tv-grid { flex: 1; display: grid; gap: clamp(14px, 1.6vw, 28px); grid-template-columns: repeat(3, 1fr); }
@media (max-width: 899px) { .tv-grid { grid-template-columns: 1fr; } .tv-head { flex-direction: column; align-items: flex-start; } .tv-clock { text-align: left; } }
.tv-card { background: #0d2a4d; border: 1px solid rgba(255,255,255,.08); border-radius: 28px; display: flex; flex-direction: column; overflow: hidden; }
.tv-card h2 { color: #fff; margin: 0; padding: clamp(14px, 1.6vw, 24px); font-size: clamp(1.1rem, 1.7vw, 1.9rem); letter-spacing: .04em; display: flex; gap: 14px; align-items: center; background: var(--c-primary); }
.tv-card h2 span { width: 1.9em; height: 1.9em; border-radius: 14px; background: #fff; color: var(--c-primary); display: grid; place-items: center; }
.tv-b h2 { background: #12784a; } .tv-b h2 span { color: #12784a; }
.tv-c h2 { background: #b25e00; } .tv-c h2 span { color: #b25e00; }
.tv-now { text-align: center; padding: clamp(18px, 2.4vw, 40px) 12px; }
.tv-now small, .tv-next small { color: #9cb7d6; font-weight: 800; letter-spacing: .14em; font-size: clamp(.8rem, 1vw, 1.1rem); }
.tv-now strong { display: block; font-size: clamp(4rem, 9vw, 10rem); line-height: 1; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; margin: 8px 0; }
.tv-now b { color: #ffd88a; font-size: clamp(1rem, 1.6vw, 1.8rem); }
.tv-next { padding: 0 clamp(16px, 2vw, 28px) clamp(16px, 2vw, 28px); }
.tv-next ul { list-style: none; padding: 0; margin: 10px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(5.5em, 1fr)); gap: 10px; }
.tv-next li { background: rgba(255,255,255,.08); border-radius: 14px; padding: 10px; text-align: center; font-weight: 800; font-size: clamp(1rem, 1.6vw, 1.75rem); font-variant-numeric: tabular-nums; }
.tv-next .muted { color: #9cb7d6; grid-column: 1 / -1; }
.tv-card footer { margin-top: auto; padding: 14px clamp(16px, 2vw, 28px); border-top: 1px solid rgba(255,255,255,.08); color: #9cb7d6; font-weight: 700; font-size: clamp(.9rem, 1.1vw, 1.25rem); }
.tv-card.is-flash { animation: tvflash 2s var(--ease); }
@keyframes tvflash { 0%, 50% { box-shadow: 0 0 0 8px #ffd88a; } 100% { box-shadow: none; } }
.tv-foot { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; color: #9cb7d6; font-weight: 600; font-size: clamp(.85rem, 1.1vw, 1.2rem); }
.tv-foot p { margin: 0; flex: 1; min-width: 260px; }
.tv-sound { display: inline-flex; gap: 8px; align-items: center; background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.2); border-radius: 999px; padding: 10px 18px; font-weight: 700; cursor: pointer; }
.tv-sound[aria-pressed="true"] { background: #12784a; }
.tv-status { font-size: .85rem; }
.layout-tv .toast-region { display: none; }

/* ==========================================================================
   PAGE — registration, login, profile
   ========================================================================== */
.register-grid { display: grid; gap: var(--s-7); grid-template-columns: 1fr; align-items: start; }
@media (min-width: 1100px) { .register-grid { grid-template-columns: minmax(0, 1fr) 340px; } .register-aside { position: sticky; top: calc(var(--header-h) + 24px); } }
.register-aside { display: grid; gap: var(--s-4); }
.form-section-title { display: flex; gap: 10px; align-items: center; font-size: var(--fs-lg); margin: var(--s-2) 0 0; padding-top: var(--s-5); border-top: 1px solid var(--c-line); }
.form-section-title .icon { color: var(--c-primary); }
.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; font-size: var(--fs-sm); }
.check-list li { display: flex; gap: 10px; align-items: flex-start; }
.check-list .icon { color: var(--c-success); margin-top: 2px; }
.success-icon { width: 76px; height: 76px; margin: 0 auto var(--s-4); border-radius: 50%; display: grid; place-items: center; background: var(--c-success-bg); color: var(--c-success); box-shadow: 0 0 0 10px rgba(18,120,74,.08); }
.success-icon .icon { width: 38px; height: 38px; stroke-width: 2.4; }
.rm-display { margin: var(--s-6) auto; padding: var(--s-5); border-radius: var(--r-lg); background: var(--c-sky-50); border: 1px dashed var(--c-sky-300); display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 380px; }
.rm-display small { color: var(--c-muted); font-weight: 700; }
.rm-display strong { font-size: clamp(2rem, 1.5rem + 2vw, 2.75rem); color: var(--c-navy); letter-spacing: .02em; line-height: 1; }
.input-lg { min-height: 54px; font-size: 1.125rem; }
.profile-grid { display: grid; gap: var(--s-6); grid-template-columns: 1fr; align-items: start; }
@media (min-width: 1100px) { .profile-grid { grid-template-columns: 360px minmax(0, 1fr); } }
@media (min-width: 768px) and (max-width: 1099px) { .profile-grid { grid-template-columns: 300px minmax(0, 1fr); } }
.profile-photo { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--r-lg); margin-bottom: var(--s-5); background: var(--c-sky-100); }
.profile-name { font-size: var(--fs-2xl); margin-bottom: 4px; }
@media (max-width: 767px) { .profile-photo { width: 140px; border-radius: 50%; margin: 0 auto var(--s-4); } .profile-card { text-align: center; } .profile-card .row { justify-content: center; } .profile-card .kv { text-align: left; } }

/* ==========================================================================
   PAGE — patient dashboard (independent desktop / tablet / mobile compositions)
   ========================================================================== */
.pd-grid { display: grid; gap: var(--s-5); grid-template-columns: minmax(0, 1fr); }
.p-hero { position: relative; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); border-radius: var(--r-xl); background: #e7f2fd; border: 1px solid var(--c-sky-100); overflow: hidden; min-height: 280px; }
.p-hero-copy { padding: var(--s-7); position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; }
.p-hello { margin: 0; font-weight: 700; color: var(--c-ink-2); font-size: var(--fs-lg); }
.p-hero h1 { font-size: clamp(1.6rem, 1.1rem + 1.6vw, 2.35rem); margin: 2px 0 10px; }
.p-hero-sub { color: var(--c-ink-2); max-width: 42ch; margin-bottom: var(--s-5); }
.p-status { margin-top: var(--s-3); }
.rm-chip { display: flex; gap: 14px; align-items: center; background: rgba(255,255,255,.92); border-radius: var(--r-lg); padding: 12px 12px 12px 14px; box-shadow: var(--sh-1); border: 1px solid #fff; }
.rm-chip small { display: block; color: var(--c-muted); font-size: var(--fs-xs); font-weight: 700; }
.rm-chip strong { display: block; font-size: 1.5rem; color: var(--c-navy); line-height: 1.2; }
.rm-ic { width: 46px; height: 46px; border-radius: 14px; background: var(--c-sky-50); color: var(--c-primary); display: grid; place-items: center; flex: none; }
.p-hero-img { position: relative; }
.p-hero-img img { position: absolute; right: 0; bottom: 0; height: 100%; width: 100%; object-fit: cover; object-position: 30% top; }
.pd-next .next-doctor { display: flex; gap: 14px; align-items: center; padding: 12px; border-radius: var(--r-md); background: var(--c-sky-25); border: 1px solid var(--c-sky-100); }
.next-doctor img { width: 64px; height: 64px; border-radius: 16px; object-fit: cover; flex: none; }
.next-doctor b { display: block; color: var(--c-navy); line-height: 1.3; }
.next-doctor span { font-size: var(--fs-xs); color: var(--c-muted); }
.next-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: var(--s-4) 0; }
.next-meta dt { font-size: var(--fs-xs); color: var(--c-muted); font-weight: 700; display: flex; gap: 6px; align-items: center; }
.next-meta dt .icon { width: 15px; height: 15px; }
.next-meta dd { margin: 2px 0 0; font-weight: 800; color: var(--c-ink); font-size: var(--fs-sm); }
.pd-actions { display: grid; gap: var(--s-3); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hist-row { display: flex; gap: 14px; align-items: center; text-decoration: none; color: inherit; }
.hist-row .grow { display: flex; flex-direction: column; }
.hist-row b { color: var(--c-navy); }
.hist-row > .icon { color: var(--c-muted); }
.hist-date { width: 52px; flex: none; text-align: center; border-radius: 12px; background: var(--c-sky-50); color: var(--c-primary-700); font-size: 11px; font-weight: 700; padding: 6px 0; line-height: 1.2; }
.hist-date b { display: block; font-size: 1.25rem; color: var(--c-navy); }
.svc-icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.svc-icons a { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 14px 8px; border-radius: var(--r-md); border: 1px solid var(--c-line); text-decoration: none; color: var(--c-ink); font-size: var(--fs-xs); font-weight: 700; background: #fff; }
.svc-icons a:hover { border-color: var(--c-primary); }
.svc-icons span { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--c-sky-50); color: var(--c-primary); }
.qcard.is-called { background: linear-gradient(180deg, var(--c-success-bg), #fff 70%); border-color: var(--c-success-line); }
@media (min-width: 1100px) {
  .pd-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .p-hero { grid-column: span 8; }
  .pd-next { grid-column: span 4; }
  .pd-actions { grid-column: span 12; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pd-queue { grid-column: span 12; }
  .pd-queue .stack { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: var(--s-4); }
  .pd-queue .stack > * + * { margin-top: 0; }
  .pd-queue .qcard-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pd-jpets { grid-column: span 12; }
  .pd-history, .pd-rx, .pd-docs { grid-column: span 4; }
  .pd-services { grid-column: span 12; }
  .svc-icons { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (min-width: 768px) and (max-width: 1099px) {
  .pd-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .p-hero, .pd-actions, .pd-queue, .pd-services, .pd-jpets { grid-column: 1 / -1; }
  .pd-next { grid-column: 1 / -1; }
  .pd-docs { grid-column: 1 / -1; }
}
@media (max-width: 767px) {
  .p-hero { order: 1; grid-template-columns: minmax(0, 1fr) 42%; min-height: 0; border-radius: var(--r-lg); }
  .pd-actions { order: 2; }
  .pd-next { order: 3; }
  .pd-queue { order: 4; }
  .pd-jpets { order: 5; }
  .pd-services { order: 6; }
  .pd-history { order: 7; } .pd-rx { order: 8; } .pd-docs { order: 9; }
  .p-hero-copy { padding: var(--s-5) 0 var(--s-5) var(--s-5); }
  .p-hello { font-size: var(--fs-sm); }
  .p-hero h1 { font-size: 1.45rem; }
  .p-hero-sub { font-size: var(--fs-xs); margin-bottom: var(--s-4); }
  .rm-chip { padding: 10px; gap: 10px; width: calc(100% + 40%); position: relative; z-index: 2; }
  .rm-chip strong { font-size: 1.2rem; }
  .rm-ic { width: 38px; height: 38px; }
  .p-status { display: none; }
  .p-hero-img img { object-position: 28% top; }
  .pd-actions .action-tile { flex-direction: column; align-items: flex-start; gap: 10px; min-height: 0; padding: 14px; font-size: var(--fs-sm); }
  .pd-actions .action-tile .chev { display: none; }
  .pd-actions .action-tile .at-icon { width: 40px; height: 40px; border-radius: 12px; }
  .next-meta { grid-template-columns: 1fr 1fr; }
  .svc-icons { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 380px) { .rm-chip { width: calc(100% + 30%); } .p-hero { grid-template-columns: minmax(0, 1fr) 36%; } }

/* ---------------------------------------------------------------- booking */
.booking-grid { display: grid; gap: var(--s-6); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1100px) { .booking-grid { grid-template-columns: minmax(0, 1fr) 360px; } .booking-summary { position: sticky; top: 88px; } }
.svc-pick { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 768px) { .svc-pick { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.svc-pick .at-icon, .option-card .at-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--c-sky-50); color: var(--c-primary); flex: none; }
.option-card > .icon { color: var(--c-muted); flex: none; }
a.option-card { text-decoration: none; color: inherit; }
.chosen { display: flex; gap: 8px; align-items: center; margin: 0; }
.chosen .icon { color: var(--c-success); }
.date-slot-grid { display: grid; gap: var(--s-6); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 768px) { .date-slot-grid { grid-template-columns: minmax(0, 340px) minmax(0, 1fr); } }
.appt-list { display: grid; gap: var(--s-3); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) { .appt-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
a.appt:hover { border-color: var(--c-sky-300); }
.ticket-grid { display: grid; gap: var(--s-6); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1100px) { .ticket-grid { grid-template-columns: 440px minmax(0, 1fr); } }
.ticket-card { border-top: 6px solid var(--c-primary); }
.ticket-top { display: flex; gap: 12px; align-items: center; padding-bottom: var(--s-4); border-bottom: 1px dashed var(--c-line-strong); margin-bottom: var(--s-4); }
.ticket-top b { display: block; color: var(--c-navy); font-size: var(--fs-sm); }
.ticket-top small { color: var(--c-muted); font-size: var(--fs-xs); }
.ticket-main { display: flex; gap: var(--s-5); align-items: center; margin-bottom: var(--s-5); flex-wrap: wrap; }
.ticket-qr svg { width: 132px; height: 132px; border-radius: 12px; border: 1px solid var(--c-line); }
.ticket-doctor { display: flex; gap: 14px; align-items: center; padding: 12px; background: var(--c-sky-25); border-radius: var(--r-md); margin-bottom: var(--s-4); }
.ticket-doctor img { width: 60px; height: 60px; border-radius: 16px; object-fit: cover; }
.ticket-doctor b { display: block; color: var(--c-navy); }
.ticket-doctor span { font-size: var(--fs-xs); color: var(--c-muted); }
.queue-mine { display: grid; gap: var(--s-4); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) { .queue-mine { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.notif-list li { padding: 0; }
.notif-list a { display: flex; gap: 14px; padding: 16px var(--s-5); text-decoration: none; color: inherit; }
.notif-list a:hover { background: var(--c-sky-25); }
.notif-list .grow { display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-sm); }
.notif-list b { color: var(--c-navy); }
.notif-list time { font-size: var(--fs-xs); color: var(--c-muted); }
.notif-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex: none; background: transparent; border: 2px solid var(--c-line-strong); }
.is-unread .notif-dot { background: var(--c-primary); border-color: var(--c-primary); }
.is-unread { background: #fbfdff; }
@media print {
  .portal-sidebar, .portal-topbar, .portal-tabs, .bottom-nav, .no-print, .toast-region, .breadcrumb, .alert, .site-header, .site-footer { display: none !important; }
  body { background: #fff; }
  .portal { display: block; }
  .ticket-grid { display: block; }
  .ticket-card { box-shadow: none; border: 1px solid #999; max-width: 480px; margin: 0 auto; }
  .portal-content { padding: 0; }
}
.rx-items { list-style: none; padding: 0; margin: 0 0 var(--s-4); display: grid; gap: 8px; }
.rx-items li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 12px; border-radius: 12px; background: var(--c-sky-25); border: 1px solid var(--c-sky-100); font-size: var(--fs-sm); }
.rx-items li b { color: var(--c-navy); }
.rx-items li span:nth-child(2) { grid-column: 1; color: var(--c-ink-2); font-size: var(--fs-xs); }
.rx-items li span.mono { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-weight: 800; }
.vitals-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; }
.vitals-row > div { padding: 10px 12px; border-radius: 12px; background: var(--c-sky-25); border: 1px solid var(--c-sky-100); }
.vitals-row small { display: block; font-size: 11px; color: var(--c-muted); font-weight: 700; text-transform: uppercase; }
.vitals-row b { font-size: var(--fs-lg); color: var(--c-navy); }
.vitals-row span { font-size: 11px; color: var(--c-muted); margin-left: 3px; }
.doc-grid { display: grid; gap: var(--s-3); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) { .doc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.doc-item .doc-sub { display: block; }
.doc-item .grow { min-width: 0; }
.jpets-mini { border-radius: var(--r-md); overflow: hidden; aspect-ratio: 16 / 9; background: #e8f3fd; }
.jpets-mini img { width: 100%; height: 100%; object-fit: cover; object-position: center 15%; }
.stepper li a { color: inherit; }

/* ==========================================================================
   DOCUMENTS (screen + print)
   ========================================================================== */
.layout-document { background: #e9eef5; }
.doc-toolbar { position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px var(--gutter); background: rgba(255,255,255,.95); backdrop-filter: blur(10px); border-bottom: 1px solid var(--c-line); flex-wrap: wrap; }
.doc-stage { padding: var(--s-7) var(--gutter) var(--s-10); }
.paper { position: relative; background: #fff; color: #111; max-width: 794px; margin: 0 auto; padding: 48px 56px; box-shadow: 0 20px 50px rgba(15,35,64,.15); font-family: var(--font); font-size: 14px; line-height: 1.6; border-radius: 4px; }
.paper p { margin: 0 0 12px; }
.paper-head { display: flex; gap: 18px; align-items: center; padding-bottom: 14px; border-bottom: 3px double #0b2e57; margin-bottom: 22px; }
.paper-head img { width: 64px; height: 64px; }
.paper-head b { display: block; font-size: 20px; color: #0b2e57; letter-spacing: .02em; }
.paper-head span { display: block; font-size: 12px; color: #333; }
.paper-title { text-align: center; font-size: 20px; color: #111; letter-spacing: .06em; margin: 8px 0 6px; }
.paper-title small { display: block; font-size: 12px; letter-spacing: .04em; color: #444; font-weight: 600; }
.paper-title.underline { text-decoration: underline; text-underline-offset: 5px; }
.paper-center { text-align: center; font-size: 13px; color: #333; }
.paper-meta { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; padding: 8px 0 12px; border-bottom: 1px solid #ddd; margin-bottom: 14px; }
.paper-kv { display: grid; grid-template-columns: 150px 1fr; gap: 4px 12px; margin: 0 0 14px; }
.paper-kv dt { color: #444; } .paper-kv dt::after { content: " :"; }
.paper-kv dd { margin: 0; font-weight: 600; }
.paper-label { font-weight: 700; margin-bottom: 4px !important; }
.rx-paper { list-style: none; padding: 0; margin: 0 0 16px; }
.rx-paper li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px dashed #ccc; }
.rx-r { font-family: Georgia, serif; font-style: italic; font-weight: 700; font-size: 18px; color: #0b2e57; width: 28px; flex: none; }
.rx-paper li > div { flex: 1; }
.rx-qty { float: right; font-weight: 700; }
.rx-s { color: #333; }
.rx-det { font-style: italic; font-weight: 700; color: #0b2e57; align-self: center; }
.paper-note { font-size: 12px; color: #444; }
.paper-two { display: grid; grid-template-columns: 1fr 240px; gap: 24px; align-items: end; margin-top: 20px; }
.paper-sign { display: flex; flex-direction: column; align-items: center; text-align: center; margin-left: auto; width: 240px; margin-top: 18px; font-size: 13px; }
.sign-space { height: 54px; }
.sign-note { font-size: 10px; color: #666; font-style: italic; }
.paper-warning { margin-top: 22px; border: 1.5px solid #333; padding: 8px; text-align: center; font-weight: 800; font-size: 12px; letter-spacing: .02em; }
.paper-box { border: 1px solid #b9c7d8; background: #f6f9fc; border-radius: 6px; padding: 14px 16px; margin: 14px 0; }
.paper-sub { font-size: 14px; color: #0b2e57; margin: 14px 0 4px; }
.pre { white-space: pre-line; }
.paper-table { width: 100%; border-collapse: collapse; margin: 10px 0 14px; font-size: 13px; }
.paper-table th, .paper-table td { border-bottom: 1px solid #ddd; padding: 7px 6px; text-align: left; }
.paper-table th:nth-child(n+2), .paper-table td:nth-child(n+2) { text-align: right; }
.paper-table tfoot td { font-weight: 600; } .paper-table tfoot td:first-child { text-align: right; }
.paper-table tr.total td { font-weight: 800; border-top: 2px solid #333; }
.paper-foot { display: flex; gap: 14px; align-items: center; margin-top: 28px; padding-top: 12px; border-top: 1px solid #ddd; font-size: 11px; color: #444; }
.paper-foot span { display: block; }
.paper-qr svg { width: 84px; height: 84px; }
.paper-revoked { position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%) rotate(-18deg); border: 4px solid #b42318; color: #b42318; font-weight: 800; font-size: 26px; padding: 8px 18px; opacity: .85; background: rgba(255,255,255,.8); white-space: nowrap; }
@media (max-width: 767px) {
  .paper { padding: 24px 18px; font-size: 13px; }
  .paper-head { flex-direction: column; text-align: center; }
  .paper-kv { grid-template-columns: 110px 1fr; }
  .paper-two { grid-template-columns: 1fr; }
  .paper-sign { margin-right: auto; }
  .paper-revoked { font-size: 16px; }
}
@media print {
  @page { size: A4; margin: 14mm; }
  .layout-document { background: #fff; }
  .doc-toolbar, .toast-region { display: none !important; }
  .doc-stage { padding: 0; }
  .paper { box-shadow: none; padding: 0; max-width: none; }
}
@media (min-width: 1100px) {
  .portal { background: linear-gradient(90deg, #fff var(--sidebar-w), transparent var(--sidebar-w)); }
  .portal-sidebar .brand-text b { font-size: 13px; }
}

/* ==========================================================================
   STAFF pages
   ========================================================================== */
.alert-stack { display: grid; gap: 10px; margin-bottom: var(--s-5); }
.alert-action { align-items: center; flex-wrap: wrap; }
.alert-action .btn { margin-left: auto; }
.metric-grid { display: grid; gap: var(--s-4); grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: var(--s-5); }
@media (min-width: 768px) { .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .metric-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 767px) { .metric-grid .stat { padding: 14px; } .metric-grid .stat-label { font-size: 11px; } }
.dash-grid { display: grid; gap: var(--s-5); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) { .dash-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.dash-queues { display: grid; gap: 10px; }
.dq { display: flex; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--c-line); border-radius: var(--r-md); text-decoration: none; color: inherit; }
.dq:hover { border-color: var(--c-sky-300); }
.dq .grow { display: flex; flex-direction: column; }
.dq strong { font-size: 1.6rem; color: var(--c-navy); font-variant-numeric: tabular-nums; }
.bucket-grid { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bucket { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--c-sky-25); border: 1px solid var(--c-sky-100); text-decoration: none; color: var(--c-ink-2); font-size: var(--fs-xs); font-weight: 700; }
.bucket b { font-size: 1.4rem; color: var(--c-navy); }
.bucket:hover { border-color: var(--c-primary); }
kbd { font-family: inherit; font-size: .85em; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--c-line-strong); background: #fff; }
.detail-grid { display: grid; gap: var(--s-5); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1100px) { .detail-grid { grid-template-columns: minmax(0, 1fr) 380px; } .detail-grid.wide-side { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); } }
.side-sticky { position: sticky; top: 84px; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.inline-form .field { flex: 1 1 160px; }
.mini-list { display: grid; gap: 6px; }
.mini-list > div { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 10px; background: var(--c-sky-25); font-size: var(--fs-sm); align-items: center; }
.section-gap { margin-top: var(--s-5); }
.tag-list { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.qc-now { border-top: 5px solid var(--c-primary); }
.qc-tickets { display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap; }
.qc-small { font-size: 1.5rem; font-weight: 800; color: var(--c-muted); font-variant-numeric: tabular-nums; }
.qc-row { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--c-line); flex-wrap: wrap; }
.qc-row .grow { min-width: 200px; }
.qc-row.is-called { background: var(--c-sky-25); margin: 0 calc(-1 * var(--s-6)); padding: 12px var(--s-6); }
.qc-pos { width: 30px; height: 30px; border-radius: 50%; background: var(--c-neutral-bg); display: grid; place-items: center; font-weight: 800; font-size: var(--fs-xs); flex: none; }
@media (max-width: 767px) { .qc-row.is-called { margin: 0 calc(-1 * var(--s-5)); padding: 12px var(--s-5); } .qc-now .row-between form { text-align: left !important; width: 100%; } .qc-now .row-between .btn-lg { width: 100%; } }
.enc-grid { display: grid; gap: var(--s-5); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1100px) { .enc-grid { grid-template-columns: 300px minmax(0, 1fr); } .enc-side { position: sticky; top: 84px; } }
@media (max-width: 1099px) { .enc-side { order: 2; } }
.finalize-card { border: 2px solid var(--c-primary); background: var(--c-sky-25); }
.doc-issue-grid { display: grid; gap: 8px; }
textarea[readonly], input[readonly] { background: var(--c-sky-25); border-color: var(--c-line); }
.doctor-admin-grid { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.doc-admin.is-inactive { opacity: .7; background: var(--c-neutral-bg); }
.doc-admin-photo { width: 88px; height: 88px; border-radius: 20px; object-fit: cover; flex: none; background: var(--c-sky-100); }
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.week-strip span { text-align: center; font-size: 11px; font-weight: 800; padding: 6px 0; border-radius: 8px; background: var(--c-neutral-bg); color: #8696aa; }
.week-strip span.on { background: var(--c-sky-100); color: var(--c-primary-700); }
.days-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.day-chip { flex: 0 0 82px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border-radius: 14px; border: 1px solid var(--c-line); text-decoration: none; color: var(--c-ink-2); background: #fff; font-size: 11px; text-align: center; }
.day-chip b { font-size: 1.25rem; color: var(--c-navy); }
.day-chip.is-available { border-color: var(--c-success-line); background: var(--c-success-bg); }
.day-chip.is-limited { border-color: var(--c-warning-line); background: var(--c-warning-bg); }
.day-chip.is-full { background: var(--c-danger-bg); border-color: var(--c-danger-line); }
.day-chip.is-sel { outline: 3px solid var(--c-primary); }
.weekday-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.weekday-pick label { position: relative; }
.weekday-pick input { position: absolute; opacity: 0; }
.weekday-pick span { display: inline-flex; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--c-line-strong); font-weight: 700; font-size: var(--fs-sm); cursor: pointer; }
.weekday-pick input:checked + span { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.weekday-pick input:focus-visible + span { box-shadow: var(--ring); }
.weekday-pick .is-closed span { opacity: .45; cursor: not-allowed; text-decoration: line-through; }
.jpets-buckets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) { .jpets-buckets { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .jpets-buckets { grid-template-columns: repeat(9, minmax(0, 1fr)); } }
.bucket.is-sel { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.bucket.is-sel b { color: #fff; }
.stage-track { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.stage-track li { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: var(--fs-xs); font-weight: 700; color: var(--c-muted); position: relative; }
.stage-track li span { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--c-neutral-bg); font-weight: 800; z-index: 1; }
.stage-track li::before { content: ""; position: absolute; top: 16px; left: -50%; width: 100%; height: 3px; background: var(--c-line); }
.stage-track li:first-child::before { display: none; }
.stage-track li.is-done { color: var(--c-success); } .stage-track li.is-done span { background: var(--c-success); color: #fff; } .stage-track li.is-done::before { background: var(--c-success); }
.stage-track li.is-current { color: var(--c-primary-700); } .stage-track li.is-current span { background: var(--c-primary); color: #fff; box-shadow: 0 0 0 5px var(--c-sky-100); } .stage-track li.is-current::before { background: var(--c-primary); }
@media (max-width: 767px) { .stage-track { grid-template-columns: 1fr; } .stage-track li { flex-direction: row; text-align: left; } .stage-track li::before { display: none; } }
.totals { margin: var(--s-4) 0 0 auto; max-width: 360px; display: grid; gap: 6px; }
.totals > div { display: flex; justify-content: space-between; gap: 12px; font-size: var(--fs-sm); }
.totals dt { color: var(--c-ink-2); } .totals dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.totals .grand { border-top: 2px solid var(--c-ink); padding-top: 8px; font-size: var(--fs-lg); }
.totals .grand dt, .totals .grand dd { color: var(--c-navy); font-weight: 800; }
.pay-total { padding: 14px; border-radius: var(--r-md); background: var(--c-sky-50); text-align: center; }
.pay-total small { display: block; color: var(--c-muted); font-weight: 700; }
.pay-total strong { font-size: 1.75rem; color: var(--c-navy); font-variant-numeric: tabular-nums; }
.report-grid { display: grid; gap: var(--s-5); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1100px) { .report-grid { grid-template-columns: 240px minmax(0, 1fr); } .report-nav { position: sticky; top: 84px; } }
.report-nav { display: flex; flex-direction: column; gap: 2px; }
.report-nav a { padding: 9px 12px; border-radius: 10px; text-decoration: none; color: var(--c-ink-2); font-weight: 700; font-size: var(--fs-sm); }
.report-nav a:hover { background: var(--c-sky-50); }
.report-nav a[aria-current="page"] { background: var(--c-primary); color: #fff; }
@media (max-width: 1099px) { .report-nav { flex-direction: row; overflow-x: auto; } .report-nav a { flex: none; } }
.audit-diff code { word-break: break-all; font-size: 11px; }
.doc-toolbar form { display: inline; }
.table td.mono, .dq strong { white-space: nowrap; }

/* ---------------------------------------------------------------- V3.1: Google Maps data, gallery, WhatsApp, settings */
.rating-chip { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: var(--s-5); padding: 8px 14px; border-radius: var(--r-pill); background: #fff; border: 1px solid var(--c-line); box-shadow: var(--sh-1); color: var(--c-ink-2); font-size: var(--fs-sm); text-decoration: none; }
.rating-chip:hover { border-color: var(--c-sky-300); }
.rating-chip b { color: var(--c-ink); font-size: var(--fs-md); }
.rating-chip > .icon { width: 14px; height: 14px; color: var(--c-muted); }
.rc-stars { display: inline-flex; gap: 1px; color: #e3a008; }
.rc-stars .icon { width: 15px; height: 15px; fill: currentColor; }

.map-card { display: flex; flex-direction: column; }
.map-card iframe { flex: 1; }
.map-meta { display: flex; gap: var(--s-3); align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 14px 18px; background: #fff; border-top: 1px solid var(--c-sky-100); }
.map-meta b { display: block; }
.map-rating { display: inline-flex; gap: 4px; align-items: center; font-size: var(--fs-sm); color: var(--c-ink-2); font-weight: 700; }
.map-rating .icon { width: 15px; height: 15px; color: #e3a008; fill: currentColor; }

.gallery-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-4); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gallery-grid figure { margin: 0; position: relative; border-radius: var(--r-lg); overflow: hidden; background: var(--c-sky-50); aspect-ratio: 4 / 3; height: 100%; }
.gallery-grid img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s var(--ease); }
.gallery-grid li:hover img { transform: scale(1.03); }
.gallery-grid figcaption { position: absolute; left: 10px; bottom: 10px; right: 10px; padding: 6px 10px; border-radius: var(--r-sm); background: rgba(11, 46, 87, .78); color: #fff; font-size: var(--fs-xs); font-weight: 600; }
.gallery-grid .is-wide { grid-column: 1 / -1; }
.gallery-grid .is-wide figure { aspect-ratio: 16 / 9; }
@media (min-width: 768px) {
  .gallery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gallery-grid .is-wide { grid-column: span 2; grid-row: span 2; }
  .gallery-grid .is-wide figure { aspect-ratio: auto; }
}
@media (min-width: 1100px) { .gallery-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.gallery-admin { list-style: none; padding: 0; margin: var(--s-6) 0 0; display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.gallery-admin .card { padding: 10px; display: grid; gap: 8px; }
.gallery-admin img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-sm); display: block; }

.wa-float { position: fixed; right: 16px; bottom: 16px; z-index: 40; display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: var(--r-pill); background: var(--c-success); color: #fff; font-weight: 800; font-size: var(--fs-sm); text-decoration: none; box-shadow: var(--sh-3); min-height: 48px; }
.wa-float:hover { background: #0e6a40; color: #fff; }
.wa-float .icon { width: 20px; height: 20px; }
@media (max-width: 599px) { .wa-float span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } .wa-float { padding: 12px; } }
@media print { .wa-float { display: none; } }

.pd-help { grid-column: 1 / -1; }
.pd-help-inner { display: flex; gap: var(--s-4); align-items: center; flex-wrap: wrap; }
.pd-help-inner .grow { flex: 1 1 260px; min-width: 0; }
.pd-help-icon { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--c-success-bg); color: var(--c-success); flex: none; }

.hours-edit { display: grid; gap: 10px; }
.hours-row { display: grid; grid-template-columns: 96px auto minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px 10px; align-items: center; border: 1px solid var(--c-line); border-radius: var(--r-md); padding: 10px 12px; margin: 0; }
.hours-row legend { float: left; font-weight: 800; padding: 0; width: 96px; }
.hours-row .hr-closed { display: inline-flex; gap: 6px; align-items: center; font-size: var(--fs-sm); color: var(--c-ink-2); white-space: nowrap; }
.hours-row .hr-closed input { width: 18px; height: 18px; accent-color: var(--c-primary); }
.hours-row .input { min-width: 0; }
.hours-row .field-error { grid-column: 1 / -1; margin: 0; }
.hours-row.has-error { border-color: var(--c-danger-line); background: var(--c-danger-bg); }
.hours-row.is-closed .hr-time, .hours-row.is-closed > span { opacity: .4; }
@media (max-width: 599px) {
  .hours-row { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  .hours-row legend { width: auto; grid-column: 1 / 2; }
  .hours-row .hr-closed { grid-column: 2 / 4; justify-self: end; }
}
.input-money { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 767px) {
  .table-responsive td > .input { flex: 1 1 100%; min-width: 0; margin-top: 4px; }
  .table-responsive td { flex-wrap: wrap; align-items: center; }
  .table-responsive td > .field-error { flex-basis: 100%; text-align: left; }
}
