/* =====================================================================
   CareLoop design system – white, light, calm, readable
   ===================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #f9fbfc;
  --border: #e5eaf0;
  --border-strong: #d3dbe4;
  --text: #0f1b2d;
  --text-2: #3c4a5d;
  --muted: #6a788b;
  --primary: #0e9384;
  --primary-600: #0b7c6f;
  --primary-50: #e8f6f4;
  --primary-100: #cdeee9;
  --accent: #4f5bd5;
  --accent-50: #eef0fd;
  --success: #12a150;
  --success-50: #e8f7ee;
  --warn: #d98a06;
  --warn-50: #fff6e5;
  --danger: #e0464d;
  --danger-50: #fdeced;
  --info: #2b7fd9;
  --info-50: #eaf3fd;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 27, 45, 0.05);
  --shadow: 0 1px 3px rgba(16, 27, 45, 0.06), 0 6px 20px rgba(16, 27, 45, 0.05);
  --shadow-lg: 0 10px 40px rgba(16, 27, 45, 0.12);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --nav-h: 64px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary-600); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { display: block; }
h1, h2, h3, h4 { margin: 0 0 0.4em; line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 800; }
h2 { font-size: 1.35rem; font-weight: 700; }
h3 { font-size: 1.08rem; font-weight: 700; }
h4 { font-size: 0.95rem; font-weight: 700; }
p { margin: 0 0 0.8em; }
small, .small { font-size: 0.84rem; }
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.82rem; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.right { text-align: right; }
.hidden { display: none !important; }
hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }

/* ---------- layout ---------- */
.container { width: 100%; max-width: 1220px; margin: 0 auto; padding: 0 20px; }
main.container { padding-top: 26px; padding-bottom: 60px; min-height: calc(100vh - var(--nav-h) - 120px); }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-side { grid-template-columns: minmax(0, 1fr) 360px; }
.g-side-l { grid-template-columns: 300px minmax(0, 1fr); }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.top { align-items: flex-start; }
.col { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.gap-s { gap: 6px; }
.gap-l { gap: 18px; }
.mt { margin-top: 18px; }
.mt-s { margin-top: 8px; }
.mt-l { margin-top: 30px; }
.mb { margin-bottom: 18px; }
.mb-s { margin-bottom: 8px; }
@media (max-width: 1000px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-side, .g-side-l { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); }
  .container { padding: 0 16px; }
}

/* ---------- page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { margin: 0; font-size: 1.65rem; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.crumbs { font-size: 0.82rem; color: var(--muted); margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }
.crumbs a { color: var(--muted); }

/* ---------- navigation ---------- */
.nav { position: sticky; top: 0; z-index: 50; height: var(--nav-h); background: rgba(255, 255, 255, 0.92); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border); }
.nav .container { height: 100%; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 1.12rem; color: var(--text); letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.brand .logo { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, #12b3a1, #0b7c6f); display: grid; place-items: center; color: #fff; box-shadow: 0 4px 12px rgba(14, 147, 132, 0.3); }
.brand small { display: block; white-space: nowrap; font-size: 0.66rem; font-weight: 600; color: var(--muted); letter-spacing: 0.02em; margin-top: -3px; }
.nav-links { display: flex; align-items: center; gap: 2px; flex: 1; }
.nav-links a, .nav-more > button { display: flex; align-items: center; gap: 6px; padding: 8px 11px; border-radius: 9px; color: var(--text-2); font-weight: 600; font-size: 0.88rem; border: 0; background: none; cursor: pointer; font-family: inherit; white-space: nowrap; }
.nav-links a:hover, .nav-more > button:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-links a.active { color: var(--primary-600); background: var(--primary-50); }
.nav-right { display: flex; align-items: center; gap: 8px; }
.nav-more { position: relative; }
.dropdown { position: absolute; top: calc(100% + 6px); right: 0; min-width: 220px; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; display: none; z-index: 60; }
.dropdown.open { display: block; }
.dropdown a, .dropdown button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--text-2); font-weight: 500; font-size: 0.9rem; background: none; border: 0; cursor: pointer; font-family: inherit; text-align: left; }
.dropdown a:hover, .dropdown button:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.dropdown .sep { height: 1px; background: var(--border); margin: 6px 4px; }
.dropdown .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.icon-btn { position: relative; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--border); background: #fff; color: var(--text-2); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); text-decoration: none; }
.icon-btn .dot { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 0.68rem; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff; }
.sos { background: var(--danger-50); color: var(--danger) !important; border: 1px solid #f7c9cb; }
.sos:hover { background: #fbdcdd !important; }
.burger { display: none; }
@media (max-width: 1100px) {
  .burger { display: grid; }
  .nav-links { display: none; position: absolute; top: var(--nav-h); left: 0; right: 0; background: #fff; flex-direction: column; align-items: stretch; padding: 10px 16px 16px; border-bottom: 1px solid var(--border); box-shadow: var(--shadow); }
  .nav-links.open { display: flex; }
  .nav-links .nav-more .dropdown { position: static; display: block; box-shadow: none; border: 0; padding: 0 0 0 12px; }
  .nav-links .nav-more > button { display: none; }
  .nav-right .dropdown { position: fixed; top: calc(var(--nav-h) - 4px); right: 12px; }
}

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); min-width: 0; }
.card.pad-l { padding: 26px; }
.card.flat { box-shadow: none; }
.card.hover { transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s; }
.card.hover:hover { box-shadow: var(--shadow); border-color: var(--border-strong); transform: translateY(-1px); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head h3 { margin: 0; display: flex; align-items: center; gap: 8px; }
.card-head .sub { color: var(--muted); font-size: 0.84rem; }
.card.tint { background: linear-gradient(180deg, #f3fbfa, #fff); border-color: var(--primary-100); }
.card.tint-accent { background: linear-gradient(180deg, #f4f5fe, #fff); border-color: #dfe2fb; }
.card.tint-warn { background: var(--warn-50); border-color: #f6dfb2; }
.card.tint-danger { background: var(--danger-50); border-color: #f7c9cb; }
.section-title { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; margin: 0 0 10px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--border-strong); background: #fff; color: var(--text); font-weight: 600; font-size: 0.9rem; font-family: inherit; cursor: pointer; transition: background 0.15s, border-color 0.15s, box-shadow 0.15s; white-space: nowrap; line-height: 1.2; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(14, 147, 132, 0.25); }
.btn-primary:hover { background: var(--primary-600); border-color: var(--primary-600); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: #3f4ac2; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #c93a40; }
.btn-soft { background: var(--primary-50); border-color: var(--primary-100); color: var(--primary-600); }
.btn-soft:hover { background: var(--primary-100); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 6px 11px; font-size: 0.82rem; border-radius: 8px; }
.btn-lg { padding: 13px 22px; font-size: 1rem; border-radius: 12px; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; color: var(--primary-600); font-weight: 600; cursor: pointer; padding: 0; font-family: inherit; font-size: inherit; }

/* ---------- forms ---------- */
label { display: block; font-weight: 600; font-size: 0.85rem; color: var(--text-2); margin-bottom: 6px; }
.field { margin-bottom: 14px; }
.input, select, textarea, input:not([type]), input[type='text'], input[type='email'], input[type='password'], input[type='number'], input[type='date'], input[type='tel'], input[type='search'] {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: #fff; font-family: inherit; font-size: 0.92rem; color: var(--text); transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { resize: vertical; min-height: 90px; }
.input:focus, select:focus, textarea:focus, input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(14, 147, 132, 0.15); }
.hint { font-size: 0.8rem; color: var(--muted); margin-top: 5px; }
.check { display: flex; align-items: flex-start; gap: 9px; font-weight: 500; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--primary); width: 16px; height: 16px; }
input[type='range'] { width: 100%; accent-color: var(--primary); }
.search-box { position: relative; }
.search-box svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-box input { padding-left: 38px; }
.form-error { background: var(--danger-50); color: #a5262c; border: 1px solid #f7c9cb; padding: 10px 12px; border-radius: 10px; font-size: 0.88rem; margin-bottom: 14px; }

/* ---------- segmented / tabs / chips ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs button { padding: 10px 14px; border: 0; background: none; font-family: inherit; font-weight: 600; font-size: 0.9rem; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: flex; align-items: center; gap: 7px; }
.tabs button.active { color: var(--primary-600); border-bottom-color: var(--primary); }
.tabs button .count { background: var(--surface-2); border: 1px solid var(--border); border-radius: 20px; padding: 0 7px; font-size: 0.72rem; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { padding: 7px 12px; border: 0; background: none; border-radius: 8px; font-family: inherit; font-weight: 600; font-size: 0.84rem; color: var(--muted); cursor: pointer; }
.seg button.active { background: #fff; color: var(--text); box-shadow: var(--shadow-sm); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border-strong); background: #fff; font-size: 0.84rem; font-weight: 600; color: var(--text-2); cursor: pointer; font-family: inherit; transition: all 0.12s; }
.chip:hover { border-color: var(--primary); color: var(--primary-600); }
.chip.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.chip.red-on { background: var(--danger); border-color: var(--danger); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 0.74rem; font-weight: 700; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; }
.badge.green { background: var(--success-50); color: #0c7a3c; border-color: #c4ebd4; }
.badge.teal { background: var(--primary-50); color: var(--primary-600); border-color: var(--primary-100); }
.badge.blue { background: var(--info-50); color: #1d63ae; border-color: #cfe2f8; }
.badge.indigo { background: var(--accent-50); color: #3a44b0; border-color: #dadefb; }
.badge.amber { background: var(--warn-50); color: #9a6200; border-color: #f6dfb2; }
.badge.red { background: var(--danger-50); color: #b42a31; border-color: #f7c9cb; }
.badge.gray { background: #f1f3f6; color: #586477; }
.badge.lg { font-size: 0.82rem; padding: 5px 12px; }
.pill-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: currentColor; }

/* ---------- KPI tiles ---------- */
.kpi { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; min-width: 0; }
.kpi .label { font-size: 0.8rem; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 7px; }
.kpi .value { font-size: 1.65rem; font-weight: 800; letter-spacing: -0.02em; margin-top: 4px; }
.kpi .value small { font-size: 0.9rem; color: var(--muted); font-weight: 600; }
.kpi .delta { font-size: 0.78rem; font-weight: 700; margin-top: 2px; }
.delta.up { color: var(--success); }
.delta.down { color: var(--danger); }
.kpi .ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary-600); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th { text-align: left; font-weight: 700; color: var(--muted); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.05em; padding: 11px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfcfd; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- lists ---------- */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
.avatar { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; font-size: 0.9rem; color: #fff; flex-shrink: 0; }
.avatar.sm { width: 34px; height: 34px; border-radius: 10px; font-size: 0.78rem; }
.avatar.lg { width: 64px; height: 64px; border-radius: 18px; font-size: 1.3rem; }
.ico-box { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; background: var(--primary-50); color: var(--primary-600); }
.ico-box.indigo { background: var(--accent-50); color: var(--accent); }
.ico-box.amber { background: var(--warn-50); color: var(--warn); }
.ico-box.red { background: var(--danger-50); color: var(--danger); }
.ico-box.blue { background: var(--info-50); color: var(--info); }
.ico-box.green { background: var(--success-50); color: var(--success); }
.ico-box.gray { background: #f1f3f6; color: #586477; }

/* ---------- progress ---------- */
.bar { height: 8px; background: #eef2f6; border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--primary); border-radius: 99px; transition: width 0.5s; }
.bar.amber > span { background: var(--warn); }
.bar.red > span { background: var(--danger); }
.bar.indigo > span { background: var(--accent); }

/* ---------- empty / loading ---------- */
.empty { text-align: center; padding: 36px 20px; color: var(--muted); }
.empty .ico-box { margin: 0 auto 12px; width: 52px; height: 52px; border-radius: 15px; }
.skeleton { background: linear-gradient(90deg, #eef2f6 25%, #f6f8fa 37%, #eef2f6 63%); background-size: 400% 100%; animation: sk 1.3s ease infinite; border-radius: 10px; min-height: 16px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.spinner { width: 18px; height: 18px; border: 2.5px solid rgba(255, 255, 255, 0.4); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; }
.spinner.dark { border-color: var(--border); border-top-color: var(--primary); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- toast & modal ---------- */
.toasts { position: fixed; bottom: 22px; right: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; max-width: calc(100vw - 44px); }
.toast { background: #0f1b2d; color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 0.9rem; display: flex; align-items: center; gap: 10px; animation: tin 0.25s ease; max-width: 420px; }
.toast.success { background: #0c7a3c; }
.toast.error { background: #b42a31; }
@keyframes tin { from { transform: translateY(10px); opacity: 0; } }
.modal-bg { position: fixed; inset: 0; background: rgba(15, 27, 45, 0.38); z-index: 150; display: grid; place-items: center; padding: 20px; animation: fade 0.15s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; max-height: calc(100vh - 40px); overflow: auto; }
.modal.wide { max-width: 820px; }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: #fff; z-index: 1; }
.modal-head h3 { margin: 0; }
.modal-body { padding: 20px 22px; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; background: var(--surface-2); border-radius: 0 0 18px 18px; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--border); background: #fff; padding: 26px 0; color: var(--muted); font-size: 0.84rem; }
.footer .container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer a { color: var(--muted); }

/* ---------- landing ---------- */
.hero { padding: 64px 0 40px; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; inset: 0; background: radial-gradient(800px 380px at 85% 10%, rgba(18, 179, 161, 0.1), transparent 70%), radial-gradient(600px 300px at 0% 80%, rgba(79, 91, 213, 0.07), transparent 70%); pointer-events: none; }
.hero h1 { font-size: clamp(2rem, 4.4vw, 3.3rem); line-height: 1.1; letter-spacing: -0.03em; }
.hero .lead { font-size: 1.12rem; color: var(--text-2); max-width: 580px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--primary-50); color: var(--primary-600); font-weight: 700; font-size: 0.8rem; border: 1px solid var(--primary-100); margin-bottom: 16px; }
.grad-text { background: linear-gradient(90deg, #0e9384, #4f5bd5); -webkit-background-clip: text; background-clip: text; color: transparent; }
.loop-visual { position: relative; aspect-ratio: 1; max-width: 460px; margin-left: auto; }
.feature { padding: 22px; }
.feature .ico-box { margin-bottom: 14px; }
.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.stat-strip > div { background: #fff; padding: 18px; text-align: center; }
.stat-strip b { display: block; font-size: 1.6rem; letter-spacing: -0.02em; }
@media (max-width: 640px) { .stat-strip { grid-template-columns: repeat(2, 1fr); } }
.steps-flow { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; counter-reset: s; }
.steps-flow .s { position: relative; padding: 18px 16px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); }
.steps-flow .s::before { counter-increment: s; content: counter(s); position: absolute; top: -12px; left: 16px; width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 800; font-size: 0.78rem; display: grid; place-items: center; }
@media (max-width: 900px) { .steps-flow { grid-template-columns: repeat(2, 1fr); } }

/* ---------- hospital & doctor cards ---------- */
.h-cover { height: 86px; border-radius: 12px; margin: -6px -6px 14px; position: relative; overflow: hidden; }
.h-cover .tag { position: absolute; top: 10px; left: 10px; }
.h-cover .tag-r { position: absolute; top: 10px; right: 10px; }
.trust { display: inline-flex; align-items: center; gap: 8px; }
.trust-ring { width: 46px; height: 46px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 0.84rem; color: var(--muted); }
.meta span { display: inline-flex; align-items: center; gap: 5px; }
.stars { color: #f5a623; letter-spacing: 1px; font-size: 0.9rem; }
.stars.lg { font-size: 1.4rem; cursor: pointer; }
.stars.lg span { transition: transform 0.1s; display: inline-block; }
.stars.lg span:hover { transform: scale(1.2); }
.reasons { display: flex; flex-wrap: wrap; gap: 6px; }
.reason { font-size: 0.78rem; padding: 4px 9px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); display: inline-flex; align-items: center; gap: 5px; }
.reason.good { background: var(--success-50); border-color: #c4ebd4; color: #0c7a3c; }
.reason.bad { background: var(--warn-50); border-color: #f6dfb2; color: #9a6200; }
.score-ring { position: relative; width: 64px; height: 64px; flex-shrink: 0; }
.score-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.05rem; font-weight: 800; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.slot { padding: 9px 6px; text-align: center; border: 1px solid var(--border-strong); border-radius: 10px; background: #fff; font-weight: 700; font-size: 0.85rem; cursor: pointer; font-family: inherit; }
.slot:hover:not(:disabled) { border-color: var(--primary); color: var(--primary-600); }
.slot.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.slot:disabled { background: #f3f5f8; color: #aab4c0; text-decoration: line-through; cursor: not-allowed; border-color: var(--border); }
.date-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.date-pill { flex: 0 0 auto; width: 70px; padding: 9px 6px; border: 1px solid var(--border-strong); border-radius: 12px; background: #fff; text-align: center; cursor: pointer; font-family: inherit; }
.date-pill .d { font-size: 0.72rem; color: var(--muted); font-weight: 700; text-transform: uppercase; }
.date-pill .n { font-size: 1.2rem; font-weight: 800; }
.date-pill .f { font-size: 0.68rem; color: var(--success); font-weight: 700; }
.date-pill.on { border-color: var(--primary); background: var(--primary-50); }
.date-pill:disabled { opacity: 0.45; cursor: not-allowed; }
.date-pill:disabled .f { color: var(--muted); }

/* ---------- timeline ---------- */
.timeline { position: relative; padding-left: 28px; }
.timeline::before { content: ''; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding: 0 0 18px; }
.tl-item .dot { position: absolute; left: -28px; top: 2px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 2px solid var(--primary); color: var(--primary); }
.tl-item .dot.lab { border-color: var(--accent); color: var(--accent); }
.tl-item .dot.prescription { border-color: var(--success); color: var(--success); }
.tl-item .dot.vitals { border-color: var(--info); color: var(--info); }
.tl-item .dot.allergy, .tl-item .dot.warn { border-color: var(--danger); color: var(--danger); }
.tl-item .dot.condition { border-color: var(--warn); color: var(--warn); }
.tl-date { font-size: 0.76rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }

/* ---------- queue ---------- */
.queue-board { display: flex; gap: 6px; flex-wrap: wrap; }
.qtok { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 0.82rem; background: #f1f3f6; color: #8a95a5; }
.qtok.done { background: var(--success-50); color: var(--success); }
.qtok.now { background: var(--warn); color: #fff; box-shadow: 0 0 0 4px rgba(217, 138, 6, 0.2); animation: pulse 1.6s infinite; }
.qtok.me { background: var(--primary); color: #fff; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(217, 138, 6, 0.08); } }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); display: inline-block; box-shadow: 0 0 0 0 rgba(18, 161, 80, 0.5); animation: live 1.8s infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 7px rgba(18, 161, 80, 0); } 100% { box-shadow: 0 0 0 0 rgba(18, 161, 80, 0); } }

/* ---------- charts ---------- */
.chart { width: 100%; position: relative; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--font); fill: var(--muted); font-size: 11px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 0.8rem; color: var(--text-2); margin-top: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.chart-tip { position: absolute; pointer-events: none; background: #0f1b2d; color: #fff; font-size: 0.76rem; padding: 6px 9px; border-radius: 8px; white-space: nowrap; transform: translate(-50%, -110%); opacity: 0; transition: opacity 0.1s; z-index: 5; }

/* ---------- misc ---------- */
.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); font-size: 0.9rem; }
.callout.info { background: var(--info-50); border-color: #cfe2f8; }
.callout.warn { background: var(--warn-50); border-color: #f6dfb2; }
.callout.danger { background: var(--danger-50); border-color: #f7c9cb; }
.callout.success { background: var(--success-50); border-color: #c4ebd4; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 0.9rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
.divider-v { width: 1px; align-self: stretch; background: var(--border); }
.cmp-yes { color: var(--success); font-weight: 700; }
.cmp-no { color: #b3bcc8; }
.partner-logo { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; color: #fff; font-size: 0.72rem; flex-shrink: 0; letter-spacing: -0.02em; }
.sticky { position: sticky; top: calc(var(--nav-h) + 16px); }
.status-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.status-dot.up { background: var(--success); box-shadow: 0 0 0 3px var(--success-50); }
.status-dot.down { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-50); }
.status-dot.maintenance { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-50); }
.switch { position: relative; width: 40px; height: 22px; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #cfd7e1; border-radius: 22px; cursor: pointer; transition: 0.2s; }
.switch span::before { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: 0.2s; box-shadow: var(--shadow-sm); }
.switch input:checked + span { background: var(--success); }
.switch input:checked + span::before { transform: translateX(18px); }
.code { background: #f4f6f9; border: 1px solid var(--border); border-radius: 10px; padding: 12px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.78rem; overflow-x: auto; white-space: pre; }
.method { font-family: ui-monospace, Menlo, monospace; font-size: 0.72rem; font-weight: 700; padding: 2px 7px; border-radius: 6px; }
.method.GET { background: var(--info-50); color: #1d63ae; }
.method.POST { background: var(--success-50); color: #0c7a3c; }
.method.PATCH { background: var(--warn-50); color: #9a6200; }
.method.DELETE { background: var(--danger-50); color: #b42a31; }
.doc-print { display: none; }

/* ---------- print (reports) ---------- */
@media print {
  .nav, .footer, .no-print, .toasts { display: none !important; }
  body { background: #fff; font-size: 12px; }
  main.container { padding: 0; max-width: none; }
  .card { box-shadow: none; break-inside: avoid; }
  .doc-print { display: block; }
}

/* ---------- small-screen navigation (kept last to win the cascade) ---------- */
@media (max-width: 640px) {
  .brand small { display: none; }
  .brand > span:last-child { font-size: 1rem; }
  .nav .container { gap: 8px; }
  .nav-right { gap: 6px; }
  .nav-right .sos { padding: 6px 8px; font-size: 0; gap: 0; }
  .nav-right .sos svg { width: 16px; height: 16px; }
  .nav-right .btn-ghost { display: none; }
}
