/* Orgif Care HMS — design system */
:root {
  --brand: #0f766e; --brand-600: #0d9488; --brand-50: #ecfdf8; --brand-100: #ccfbef; --brand-700: #115e59;
  --accent: #2563eb; --accent-50: #eff6ff;
  --bg: #f3f6fa; --surface: #ffffff; --surface-2: #f8fafc; --border: #e3e8ef; --border-strong: #cbd5e1;
  --text: #0f172a; --text-2: #334155; --muted: #64748b; --faint: #94a3b8;
  --ok: #15803d; --ok-bg: #dcfce7; --warn: #b45309; --warn-bg: #fef3c7; --bad: #b91c1c; --bad-bg: #fee2e2; --info: #1d4ed8; --info-bg: #dbeafe; --violet: #6d28d9; --violet-bg: #ede9fe;
  --radius: 12px; --radius-sm: 8px; --shadow: 0 1px 2px rgba(15,23,42,.05), 0 1px 3px rgba(15,23,42,.06); --shadow-lg: 0 12px 32px rgba(15,23,42,.14);
  --sidebar: 248px; --topbar: 60px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
[data-theme="dark"] {
  --bg: #0b1220; --surface: #111a2c; --surface-2: #0f1727; --border: #1f2a40; --border-strong: #2c3a55; --text: #e5edf8; --text-2: #c3cfe0; --muted: #8fa0b8; --faint: #64748b;
  --brand-50: #0f2a29; --brand-100: #134e4a; --accent-50: #10203d; --ok-bg: #0f2e1d; --warn-bg: #33250b; --bad-bg: #3a1414; --info-bg: #0f2346; --violet-bg: #251a45; --shadow: none;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 14px; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; line-height: 1.45; }
a { color: var(--brand); text-decoration: none; } a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 700; } h2 { font-size: 17px; font-weight: 650; } h3 { font-size: 15px; font-weight: 650; } h4 { font-size: 13px; font-weight: 650; color: var(--text-2); }
svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: middle; }
.muted { color: var(--muted); } .small { font-size: 12px; } .tiny { font-size: 11px; } .bold { font-weight: 650; } .right { text-align: right; } .center { text-align: center; } .nowrap { white-space: nowrap; } .mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
.row { display: flex; align-items: center; gap: 10px; } .row.wrap { flex-wrap: wrap; } .row.top { align-items: flex-start; } .col { display: flex; flex-direction: column; gap: 10px; } .grow { flex: 1; min-width: 0; } .space { justify-content: space-between; }
.gap-s { gap: 6px; } .gap-l { gap: 16px; } .mt { margin-top: 14px; } .mt-s { margin-top: 8px; } .mb { margin-bottom: 14px; } .hide { display: none !important; }

/* boot */
.boot { height: 100vh; display: grid; place-content: center; text-align: center; color: var(--muted); }
.boot-logo { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 16px; background: linear-gradient(135deg, var(--brand), #0ea5e9); animation: pulse 1.2s infinite ease-in-out; }
@keyframes pulse { 50% { transform: scale(.9); opacity: .7; } }

/* shell */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { background: #0b2b29; color: #cfe7e3; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 16px 18px; color: #fff; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, #14b8a6, #0ea5e9); display: grid; place-items: center; color: #fff; font-weight: 800; flex: none; overflow: hidden; }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.brand b { display: block; font-size: 15px; } .brand span { font-size: 11px; color: #8fbcb6; }
.nav { padding: 6px 10px 16px; display: flex; flex-direction: column; gap: 1px; }
.nav-sec { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: #6f9f99; padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 9px; color: #cfe7e3; font-weight: 500; text-decoration: none; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: rgba(20,184,166,.18); color: #fff; box-shadow: inset 3px 0 0 #2dd4bf; }
.nav a .badge { margin-left: auto; }
.sidebar-foot { margin-top: auto; padding: 12px 18px; font-size: 11px; color: #6f9f99; border-top: 1px solid rgba(255,255,255,.06); }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: var(--topbar); background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; padding: 0 22px; position: sticky; top: 0; z-index: 20; }
.menu-btn { display: none; }
.search-trigger { flex: 1; max-width: 520px; display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); color: var(--muted); cursor: text; }
.search-trigger kbd { margin-left: auto; font-family: inherit; font-size: 11px; border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; background: var(--surface); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.netpill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 4px 10px; border-radius: 99px; background: var(--ok-bg); color: var(--ok); font-weight: 600; }
.netpill.off { background: var(--warn-bg); color: var(--warn); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; background: var(--brand); flex: none; }
.avatar.lg { width: 56px; height: 56px; font-size: 20px; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 4px 6px 4px 4px; border-radius: 99px; cursor: pointer; }
.user-chip:hover { background: var(--surface-2); }
.user-chip b { font-size: 13px; display: block; } .user-chip span { font-size: 11px; color: var(--muted); }
.content { padding: 22px; max-width: 1480px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 3px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.card-h .actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card-b { padding: 16px; } .card-b.tight { padding: 0; }
.grid { display: grid; gap: 16px; } .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-main { grid-template-columns: minmax(0, 1fr) 360px; }
.kpi { padding: 16px; display: flex; gap: 14px; align-items: center; }
.kpi .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.kpi .ic svg { width: 22px; height: 22px; }
.kpi b { font-size: 22px; display: block; letter-spacing: -.02em; } .kpi span { color: var(--muted); font-size: 12.5px; }
.tone-teal { background: var(--brand-50); color: var(--brand); } .tone-blue { background: var(--info-bg); color: var(--info); } .tone-amber { background: var(--warn-bg); color: var(--warn); } .tone-violet { background: var(--violet-bg); color: var(--violet); } .tone-red { background: var(--bad-bg); color: var(--bad); } .tone-green { background: var(--ok-bg); color: var(--ok); }

/* buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s; text-decoration: none !important; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; } .btn.primary:hover { background: var(--brand-700); }
.btn.blue { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { color: var(--bad); border-color: #fecaca; } .btn.danger:hover { background: var(--bad-bg); }
.btn.ghost { border-color: transparent; background: transparent; } .btn.ghost:hover { background: var(--surface-2); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; } .btn.lg { height: 44px; padding: 0 20px; font-size: 15px; }
.btn.icon { width: 36px; padding: 0; } .btn.sm.icon { width: 30px; }
.btn.wa { background: #16a34a; border-color: #16a34a; color: #fff; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
label.f { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--text-2); min-width: 0; }
label.f .hint { font-weight: 400; color: var(--muted); font-size: 11.5px; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 9px; padding: 8px 11px; height: 38px; width: 100%; outline: none; transition: border-color .12s, box-shadow .12s; }
textarea { height: auto; min-height: 76px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: var(--brand-600); box-shadow: 0 0 0 3px rgba(13,148,136,.15); }
input[type=checkbox], input[type=radio] { width: 17px; height: 17px; accent-color: var(--brand); }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 14px; }
.form-grid .span2 { grid-column: span 2; } .form-grid .full { grid-column: 1 / -1; }
.input-icon { position: relative; } .input-icon svg { position: absolute; left: 11px; top: 10px; color: var(--muted); z-index: 2; pointer-events: none; } .input-icon input { padding-left: 36px; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* tables */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 650; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); position: sticky; top: 0; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: var(--surface-2); }
.tbl-wrap { overflow: auto; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 650; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; } .badge.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; } .badge.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; } .badge.info { background: var(--info-bg); color: var(--info); border-color: transparent; } .badge.violet { background: var(--violet-bg); color: var(--violet); border-color: transparent; } .badge.teal { background: var(--brand-50); color: var(--brand); border-color: transparent; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty svg { width: 40px; height: 40px; color: var(--faint); margin-bottom: 8px; }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none; }
.tabs a.on { color: var(--brand); border-color: var(--brand); }
.tabs a:hover { color: var(--text); }

/* patient header */
.pt-head { display: flex; gap: 16px; align-items: center; padding: 18px; flex-wrap: wrap; }
.pt-head .meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); margin-top: 4px; font-size: 13px; }
.alert-strip { display: flex; gap: 8px; align-items: center; padding: 9px 14px; border-radius: 10px; background: var(--bad-bg); color: var(--bad); font-weight: 600; font-size: 13px; }
.alert-strip.warn { background: var(--warn-bg); color: var(--warn); } .alert-strip.info { background: var(--info-bg); color: var(--info); }

/* appointment list */
.appt { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.appt:last-child { border-bottom: 0; }
.appt .time { font-weight: 700; font-size: 15px; } .appt .time small { display: block; font-weight: 500; color: var(--muted); font-size: 11px; }
.appt .who b { font-size: 14px; } .appt .who .muted { font-size: 12.5px; }
.doc-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }

/* lab compare */
.lab-grid { width: 100%; border-collapse: separate; border-spacing: 0; }
.lab-grid th, .lab-grid td { padding: 9px 12px; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; }
.lab-grid th:first-child, .lab-grid td:first-child { text-align: left; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.lab-grid thead th { background: var(--surface-2); font-size: 12px; color: var(--muted); position: sticky; top: 0; z-index: 2; }
.lab-grid thead th:first-child { z-index: 3; background: var(--surface-2); }
.lab-grid .panel-row td { background: var(--brand-50); color: var(--brand); font-weight: 700; text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.lab-grid td.val { font-weight: 600; font-variant-numeric: tabular-nums; }
.lab-grid td.val.high { color: var(--bad); background: rgba(239,68,68,.06); } .lab-grid td.val.low { color: var(--info); background: rgba(59,130,246,.06); }
.lab-grid td.latest { box-shadow: inset 2px 0 0 var(--brand-100); }
.trend { font-size: 11px; font-weight: 700; margin-left: 4px; } .trend.up { color: var(--bad); } .trend.down { color: var(--ok); } .trend.flat { color: var(--muted); }
.lab-grid tr.sel td { background: var(--accent-50) !important; }
.ref { color: var(--muted); font-size: 12px; font-weight: 400; }

/* rx builder */
.rx-wrap { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; align-items: start; }
.med-card { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); display: flex; gap: 10px; align-items: flex-start; }
.med-card + .med-card { margin-top: 8px; }
.med-card b { font-size: 13.5px; } .med-card .muted { font-size: 12px; }
.med-card.stopped { opacity: .55; text-decoration: line-through; }
.rx-line { display: grid; grid-template-columns: 26px minmax(170px, 2fr) 0.8fr 0.9fr 1fr 0.9fr 34px; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.rx-line input, .rx-line select { height: 34px; padding: 6px 9px; }
.rx-line .num { color: var(--muted); font-weight: 700; text-align: center; }
.rx-head { font-size: 11px; text-transform: uppercase; color: var(--muted); font-weight: 700; letter-spacing: .04em; border-bottom: 1px solid var(--border); }
.ac { position: relative; }
.ac-list { position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; right: 0; min-width: 320px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); max-height: 320px; overflow: auto; }
.ac-item { padding: 9px 12px; cursor: pointer; border-bottom: 1px solid var(--border); }
.ac-item:last-child { border-bottom: 0; }
.ac-item.on, .ac-item:hover { background: var(--brand-50); }
.ac-item b { font-size: 13.5px; } .ac-item .muted { font-size: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 5px 10px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); font-size: 12.5px; cursor: pointer; font-weight: 500; }
.chip:hover, .chip.on { border-color: var(--brand); color: var(--brand); background: var(--brand-50); }
.vitals { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.vital { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.vital span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; } .vital b { display: block; font-size: 17px; margin-top: 2px; }

/* timeline */
.tl { position: relative; padding-left: 28px; }
.tl::before { content: ""; position: absolute; left: 11px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding: 0 0 18px; }
.tl-item .ic { position: absolute; left: -28px; top: 0; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--border); }
.tl-item .ic svg { width: 12px; height: 12px; }
.tl-date { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 4px 0 10px -28px; }

/* docs gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.doc-tile { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); cursor: pointer; transition: box-shadow .12s, transform .12s; }
.doc-tile:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.doc-tile .thumb { height: 120px; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; }
.doc-tile .thumb img { width: 100%; height: 100%; object-fit: cover; }
.doc-tile .thumb svg { width: 38px; height: 38px; color: var(--faint); }
.doc-tile .meta { padding: 9px 11px; } .doc-tile .meta b { font-size: 13px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropzone { border: 2px dashed var(--border-strong); border-radius: 12px; padding: 22px; text-align: center; color: var(--muted); cursor: pointer; background: var(--surface-2); }
.dropzone.over { border-color: var(--brand); background: var(--brand-50); color: var(--brand); }

/* modal */
.modal-bg { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 100; display: grid; place-items: center; padding: 20px; animation: fade .12s; backdrop-filter: blur(2px); }
.modal { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); width: 100%; max-width: 640px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; animation: pop .14s; }
.modal.wide { max-width: 980px; } .modal.full { max-width: 1240px; height: calc(100vh - 40px); }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-b { padding: 20px; overflow: auto; flex: 1; }
.modal-f { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--border); flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } } @keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }

/* toasts */
#toasts { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #0f172a; color: #fff; padding: 11px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: center; max-width: 420px; animation: pop .15s; }
.toast.err { background: #991b1b; } .toast.ok { background: #065f46; }

/* search palette */
.palette { max-width: 680px; align-self: start; margin-top: 8vh; }
.palette input { height: 52px; border: 0; font-size: 16px; padding-left: 48px; border-radius: 16px 16px 0 0; box-shadow: none !important; }
.palette .res { max-height: 60vh; overflow: auto; border-top: 1px solid var(--border); }
.res-item { display: flex; gap: 12px; align-items: center; padding: 10px 16px; cursor: pointer; }
.res-item.on, .res-item:hover { background: var(--brand-50); }
.res-item .type { font-size: 11px; font-weight: 700; color: var(--muted); width: 84px; text-transform: uppercase; }

/* login */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art { background: radial-gradient(1200px 600px at 10% 10%, #14b8a6 0%, #0f766e 40%, #0b2b29 100%); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-art h1 { font-size: 38px; line-height: 1.15; max-width: 520px; letter-spacing: -.02em; }
.auth-art p { color: #c8efe9; font-size: 16px; max-width: 480px; }
.auth-art .feat { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 560px; }
.auth-art .feat div { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); border-radius: 12px; padding: 12px 14px; display: flex; gap: 10px; align-items: center; font-weight: 600; font-size: 13.5px; }
.auth-art .blob { position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; background: rgba(255,255,255,.06); }
.auth-form { display: grid; place-items: center; padding: 32px; background: var(--surface); }
.auth-form .box { width: 100%; max-width: 400px; }
.sso-btn { width: 100%; justify-content: flex-start; height: 42px; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 16px 0; } .divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* video */
.video-stage { position: relative; background: #0b1220; border-radius: 16px; overflow: hidden; aspect-ratio: 16/9; max-height: 72vh; width: 100%; }
.video-stage video.remote { width: 100%; height: 100%; object-fit: cover; background: #0b1220; }
.video-stage video.local { position: absolute; right: 14px; bottom: 74px; width: 22%; min-width: 120px; border-radius: 12px; border: 2px solid rgba(255,255,255,.7); background: #111; object-fit: cover; transform: scaleX(-1); }
.video-stage .bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: 12px; padding: 14px; background: linear-gradient(transparent, rgba(0,0,0,.6)); }
.video-stage .bar .btn { border-radius: 50%; width: 48px; height: 48px; padding: 0; background: rgba(255,255,255,.15); border: 0; color: #fff; }
.video-stage .bar .btn.end { background: #dc2626; }
.video-stage .status { position: absolute; inset: 0; display: grid; place-items: center; color: #cbd5e1; text-align: center; padding: 20px; pointer-events: none; }

/* charts */
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .grid line { stroke: var(--border); }
.bars rect { transition: opacity .1s; } .bars rect:hover { opacity: .8; }

/* news */
.news-item { display: flex; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.news-item:last-child { border-bottom: 0; }
.news-item h3 { font-size: 14.5px; margin-bottom: 4px; } .news-item h3 a { color: var(--text); }
.news-item .src { font-size: 11.5px; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: .04em; }

/* bed board */
.beds { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.bed { border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: var(--surface); cursor: pointer; min-height: 88px; }
.bed.available { border-color: #86efac; background: #f0fdf4; } .bed.occupied { border-color: #fca5a5; background: #fff5f5; } .bed.cleaning { border-color: #fcd34d; background: #fffbeb; }
[data-theme="dark"] .bed.available { background: #0f2e1d; } [data-theme="dark"] .bed.occupied { background: #3a1414; } [data-theme="dark"] .bed.cleaning { background: #33250b; }
.bed b { font-size: 15px; }

/* AI panel */
.ai-answer { white-space: pre-wrap; line-height: 1.6; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; font-size: 13.5px; }
.ai-badge { background: linear-gradient(135deg, #7c3aed, #2563eb); color: #fff; border: 0; }

/* print */
@media print { .sidebar, .topbar, .no-print, #toasts { display: none !important; } .shell { display: block; } .content { padding: 0; } .card { box-shadow: none; border: 0; } }

/* responsive */
@media (max-width: 1180px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-main { grid-template-columns: 1fr; } .rx-wrap { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; z-index: 60; transform: translateX(-100%); transition: transform .2s; }
  .shell.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .shell.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 50; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 0 12px; padding-top: env(safe-area-inset-top); height: calc(var(--topbar) + env(safe-area-inset-top)); }
  .search-trigger kbd, .user-chip div, .netpill .lbl { display: none; }
  .content { padding: 14px; padding-bottom: 90px; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .auth-wrap { grid-template-columns: 1fr; } .auth-art { display: none; }
  .rx-line { grid-template-columns: 22px 1fr 1fr 34px; } .rx-line .opt { grid-column: 2 / 4; }
  .rx-head { display: none !important; }
  .form-grid .span2 { grid-column: auto; }
  .bottom-nav { display: flex !important; }
  .appt { grid-template-columns: 52px 1fr; } .appt .acts { grid-column: 1 / -1; }
}
@media (max-width: 560px) { .g4 { grid-template-columns: 1fr 1fr; } .kpi { padding: 12px; } .kpi b { font-size: 18px; } .kpi .ic { width: 36px; height: 36px; } h1 { font-size: 19px; } }
.bottom-nav { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; }
.bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; color: var(--muted); font-weight: 600; padding: 4px 8px; text-decoration: none; }
.bottom-nav a.active { color: var(--brand); }
