/* ===========================================================
   CELLOVITA · Clinic Operations — design system
   Palette taken from the Cellovita mark: deep teal, crimson,
   surgical silver. Navy-teal structure, crimson as only accent.
   =========================================================== */
:root {
  --teal-950: #062421;
  --teal-900: #0a312d;
  --teal-800: #0d403a;
  --teal-700: #0e5049;
  --teal-600: #0e6b62;
  --teal-500: #12887c;
  --teal-100: #e4f1ee;
  --crimson-700: #8e1b2a;
  --crimson-600: #b01e35;
  --crimson-500: #c9364b;
  --crimson-100: #fbeaec;
  --amber-600: #a86612;
  --amber-100: #fdf2df;
  --silver-50: #f7faf9;
  --silver-100: #eef2f1;
  --silver-200: #dde5e4;
  --silver-300: #c6d2d0;
  --ink: #0b1d1b;
  --muted: #5f7a77;
  --white: #ffffff;
  --bg: #f2f6f5;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow-sm: 0 1px 2px rgba(10, 49, 45, 0.05);
  --shadow-md: 0 2px 6px rgba(10, 49, 45, 0.06), 0 18px 34px -26px rgba(10, 49, 45, 0.45);
  --shadow-lg: 0 30px 70px -40px rgba(6, 36, 33, 0.55), 0 6px 18px -12px rgba(6, 36, 33, 0.35);
  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.5;
}
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.015em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
img { max-width: 100%; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--silver-300); border-radius: 20px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- layout ---------------- */
#app { display: flex; min-height: 100vh; }

#sidebar {
  width: 268px; flex: 0 0 268px;
  position: fixed; top: 0; left: 0; bottom: 0;
  background: linear-gradient(180deg, var(--teal-900) 0%, var(--teal-950) 65%);
  background-color: var(--teal-950);
  padding: 20px 14px 18px;
  display: flex; flex-direction: column; gap: 16px;
  overflow-y: auto;
  z-index: 40;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}
#sidebar:before {
  content: ''; position: absolute; inset: 0 0 auto; height: 220px;
  background: radial-gradient(90% 120% at 20% 0%, rgba(18, 136, 124, 0.4), transparent 70%);
  pointer-events: none;
}
.brand { position: relative; display: flex; flex-direction: column; gap: 8px; align-items: center; padding: 4px 0 6px; }
.brand-plate {
  background: #fff; border-radius: 14px; padding: 8px 10px; width: 100%;
  display: flex; justify-content: center; box-shadow: 0 10px 26px -18px #000;
}
.brand-plate img { width: 132px; height: auto; display: block; }
.brand-sub {
  font-size: 9.5px; letter-spacing: 0.19em; text-transform: uppercase;
  color: rgba(220, 236, 233, 0.62); font-weight: 700; text-align: center;
}
.nav { display: flex; flex-direction: column; gap: 2px; position: relative; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: 10px;
  color: rgba(214, 231, 228, 0.78); font-weight: 600; font-size: 13px;
  border-left: 3px solid transparent; transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(201, 54, 75, 0.26), rgba(201, 54, 75, 0.06));
  color: #fff; border-left-color: var(--crimson-500);
}
.nav-item .ni-ico { width: 18px; height: 18px; display: inline-flex; flex: 0 0 18px; opacity: 0.95; }
.nav-item .ni-ico svg { width: 18px; height: 18px; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; position: relative; }
.live-pill {
  display: inline-flex; align-items: center; gap: 7px; align-self: flex-start;
  background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cfe5e1; padding: 5px 10px; border-radius: 20px; font-size: 11px; font-weight: 600;
}
.live-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: #46d39b; box-shadow: 0 0 0 0 rgba(70, 211, 155, 0.6); animation: pulse 2.2s infinite; }
.live-pill.off .dot { background: #e0a03a; animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(70, 211, 155, 0.55); } 70% { box-shadow: 0 0 0 7px rgba(70, 211, 155, 0); } 100% { box-shadow: 0 0 0 0 rgba(70, 211, 155, 0); } }
.side-note { font-size: 10.5px; color: rgba(206, 228, 224, 0.45); line-height: 1.45; }

#main { flex: 1 1 auto; min-width: 0; margin-left: 268px; display: flex; flex-direction: column; }
#topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(242, 246, 245, 0.88); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--silver-200);
  padding: 12px 22px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.tb-title h1 { font-size: 19px; line-height: 1.2; }
.tb-title p { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.tb-spacer { flex: 1 1 auto; }
.tb-date { display: flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--silver-200); border-radius: 12px; padding: 4px 6px; }
.tb-date input[type='date'] {
  border: none; outline: none; font-family: inherit; font-size: 12.5px; font-weight: 700;
  color: var(--teal-800); background: transparent; padding: 4px 2px;
}
.tb-role select {
  font-family: inherit; font-size: 12.5px; font-weight: 700; color: var(--teal-800);
  border: 1px solid var(--silver-200); background: #fff; border-radius: 12px; padding: 8px 10px;
}
#view { padding: 20px 22px 64px; }
.only-mobile { display: none !important; }

/* ---------------- buttons / controls ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-weight: 700; font-size: 12.5px; letter-spacing: 0.01em;
  border-radius: 11px; border: 1px solid transparent; padding: 9px 14px;
  cursor: pointer; transition: transform 0.12s, box-shadow 0.15s, background 0.15s;
  background: var(--silver-100); color: var(--teal-800); white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: linear-gradient(180deg, var(--teal-600), var(--teal-700)); color: #fff; box-shadow: 0 8px 18px -12px rgba(14, 107, 98, 0.9); }
.btn-primary:hover { background: linear-gradient(180deg, var(--teal-500), var(--teal-600)); }
.btn-crimson { background: linear-gradient(180deg, var(--crimson-500), var(--crimson-600)); color: #fff; box-shadow: 0 8px 18px -12px rgba(176, 30, 53, 0.9); }
.btn-crimson:hover { filter: brightness(1.06); }
.btn-ghost { background: #fff; border-color: var(--silver-200); color: var(--teal-800); }
.btn-ghost:hover { border-color: var(--teal-500); color: var(--teal-600); }
.btn-danger-ghost { background: #fff; border-color: var(--crimson-100); color: var(--crimson-600); }
.btn-sm { padding: 6px 10px; font-size: 11.5px; border-radius: 9px; }
.btn-xs { padding: 4px 8px; font-size: 11px; border-radius: 8px; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 9px; border: 1px solid transparent;
  background: transparent; color: var(--teal-800); cursor: pointer;
}
.icon-btn:hover { background: var(--silver-100); }
.icon-btn svg { width: 16px; height: 16px; }

/* ---------------- generic surfaces ---------------- */
.card {
  background: #fff; border: 1px solid var(--silver-200); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 16px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--silver-100); flex-wrap: wrap; }
.card-head h3 { font-size: 13.5px; }
.card-head p { font-size: 11.5px; color: var(--muted); }
.card-head .spacer { flex: 1 1 auto; }
.section { display: flex; flex-direction: column; gap: 14px; }
.grid { display: grid; gap: 14px; }
.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)); }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.tiny { font-size: 11px; }
.mono { font-variant-numeric: tabular-nums; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 4px 0 0; }
.section-title h2 { font-size: 15px; }
.section-title .spacer { flex: 1 1 auto; }
.hint { font-size: 11.5px; color: var(--muted); }
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 34px 18px; text-align: center; color: var(--muted); font-size: 12.5px;
}
.empty svg { width: 30px; height: 30px; opacity: 0.4; }
.empty strong { color: var(--teal-800); font-size: 13px; }

/* ---------------- KPI ---------------- */
.kpi { padding: 14px 15px; border-radius: var(--radius); background: #fff; border: 1px solid var(--silver-200); box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.kpi:after { content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--teal-500); opacity: 0.9; }
.kpi.crimson:after { background: var(--crimson-600); }
.kpi.amber:after { background: var(--amber-600); }
.kpi .kpi-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.09em; color: var(--muted); font-weight: 800; }
.kpi .kpi-value { font-size: 25px; font-weight: 800; line-height: 1.15; margin-top: 6px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi .kpi-value small { font-size: 12px; font-weight: 700; color: var(--muted); margin-left: 3px; }
.kpi .kpi-meta { font-size: 11px; color: var(--muted); margin-top: 4px; display: flex; align-items: center; gap: 6px; }
.kpi .kpi-ico { position: absolute; top: 12px; right: 12px; width: 26px; height: 26px; color: var(--teal-500); opacity: 0.22; }
.kpi .kpi-ico svg { width: 26px; height: 26px; }
.delta { font-weight: 800; font-size: 11px; }
.delta.up { color: var(--teal-600); }
.delta.down { color: var(--crimson-600); }

/* ---------------- chips / status ---------------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.02em;
  padding: 3px 8px; border-radius: 20px; background: var(--silver-100); color: var(--teal-800);
  white-space: nowrap;
}
.chip:before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: 0.8; }
.chip.nodot:before { display: none; }
.chip.scheduled { background: var(--teal-100); color: var(--teal-700); }
.chip.arrived { background: #e2f5ef; color: #0c6b52; }
.chip.late { background: var(--amber-100); color: var(--amber-600); }
.chip.completed { background: #eaf2f0; color: #33544f; }
.chip.cancelled { background: var(--silver-100); color: #7c8f8c; }
.chip.no_show { background: var(--crimson-100); color: var(--crimson-700); }
.chip.rescheduled { background: #eef0fa; color: #4a4f8a; }
.chip.waiting { background: var(--amber-100); color: var(--amber-600); }
.chip.in_progress { background: var(--crimson-100); color: var(--crimson-700); }
.chip.done { background: var(--teal-100); color: var(--teal-700); }
.chip.pending { background: var(--silver-100); color: #7c8f8c; }
.chip.skipped { background: var(--silver-100); color: #7c8f8c; }
.chip.solid { background: var(--crimson-600); color: #fff; }
.tier { font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 20px; background: var(--silver-100); color: var(--muted); }
.tier.vip { background: linear-gradient(120deg, #f4e3c3, #f7eddc); color: #8a6417; }
.tier.gold { background: #f6efd9; color: #8a6417; }

/* ---------------- tables ---------------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.tbl th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); font-weight: 800; padding: 9px 12px; border-bottom: 1px solid var(--silver-200);
  background: var(--silver-50); white-space: nowrap;
}
table.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--silver-100); vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: none; }
table.tbl tr:hover td { background: #fbfdfc; }
table.tbl .num { font-variant-numeric: tabular-nums; text-align: right; font-weight: 700; }

/* ---------------- forms ---------------- */
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 11px; font-weight: 800; color: var(--teal-800); text-transform: uppercase; letter-spacing: 0.06em; }
.field input, .field select, .field textarea {
  font-family: inherit; font-size: 13px; color: var(--ink);
  border: 1px solid var(--silver-300); border-radius: 10px; padding: 9px 11px;
  background: #fff; outline: none; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--teal-500); box-shadow: 0 0 0 3px rgba(18, 136, 124, 0.12); }
.field textarea { resize: vertical; min-height: 74px; }
.field .err { font-size: 11px; color: var(--crimson-600); font-weight: 700; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: var(--teal-800); }
.switch input { width: 16px; height: 16px; accent-color: var(--teal-600); }

/* ---------------- modal ---------------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 90; background: rgba(6, 36, 33, 0.45);
  backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center;
  padding: 4vh 16px; overflow-y: auto;
}
.modal {
  background: #fff; border-radius: 18px; width: 100%; max-width: 620px;
  box-shadow: var(--shadow-lg); border: 1px solid var(--silver-200);
  animation: modalIn 0.18s ease-out;
}
.modal.wide { max-width: 860px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(0.99); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: flex-start; gap: 10px; padding: 16px 18px 12px; border-bottom: 1px solid var(--silver-100); }
.modal-head h3 { font-size: 15px; }
.modal-head p { font-size: 11.5px; color: var(--muted); }
.modal-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px 16px; border-top: 1px solid var(--silver-100); flex-wrap: wrap; }

/* ---------------- toast ---------------- */
.toast-root { position: fixed; right: 18px; bottom: 18px; z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast {
  background: var(--teal-900); color: #eaf6f3; padding: 10px 14px; border-radius: 11px;
  font-size: 12.5px; font-weight: 600; box-shadow: var(--shadow-lg); max-width: 340px;
  animation: toastIn 0.2s ease-out; border-left: 3px solid var(--teal-500);
}
.toast.error { background: var(--crimson-700); border-left-color: #ff9aa8; }
.toast.warn { background: #7a4b0c; border-left-color: #f3b64b; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------------- timeline (schedule) ---------------- */
.tl-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--silver-100); flex-wrap: wrap; }
.tl-wrap { overflow-x: auto; padding: 0 0 6px; }
.tl { min-width: 860px; }
.tl-hours { display: grid; grid-template-columns: 132px 1fr; align-items: end; }
.tl-scale { position: relative; height: 26px; border-bottom: 1px solid var(--silver-200); margin-left: 0; }
.tl-scale span {
  position: absolute; top: 6px; transform: translateX(-50%); font-size: 10px; font-weight: 800;
  color: var(--muted); font-variant-numeric: tabular-nums;
}
.tl-row { display: grid; grid-template-columns: 132px 1fr; align-items: stretch; border-bottom: 1px solid var(--silver-100); }
.tl-row:last-child { border-bottom: none; }
.tl-room { padding: 8px 10px 8px 14px; border-right: 1px solid var(--silver-200); display: flex; flex-direction: column; gap: 2px; justify-content: center; background: var(--silver-50); }
.tl-room strong { font-size: 12px; }
.tl-room span { font-size: 10px; color: var(--muted); font-weight: 700; }
.tl-track { position: relative; height: 52px; }
.tl-track:before {
  content: ''; position: absolute; inset: 0;
  background-image: repeating-linear-gradient(90deg, var(--silver-100) 0 1px, transparent 1px 100%);
  background-size: calc(100% / 12) 100%;
}
.tl-track.past { background: repeating-linear-gradient(135deg, rgba(0,0,0,0.015) 0 6px, transparent 6px 12px); }
.tl-block {
  position: absolute; top: 6px; height: 40px; border-radius: 9px; padding: 4px 7px;
  font-size: 10.5px; font-weight: 700; color: #fff; overflow: hidden; cursor: pointer;
  box-shadow: 0 4px 12px -8px rgba(0, 0, 0, 0.5); border: 1px solid rgba(255, 255, 255, 0.3);
  display: flex; flex-direction: column; gap: 1px; line-height: 1.25; transition: transform 0.12s;
}
.tl-block:hover { transform: translateY(-1px); }
.tl-block .tb-name { font-weight: 800; font-size: 10.5px; }
.tl-block .tb-svc { opacity: 0.88; font-size: 9.5px; }
.tl-block.st-cancelled { opacity: 0.42; text-decoration: line-through; }
.tl-block.st-no_show { opacity: 0.5; }
.tl-block.st-completed { opacity: 0.85; }
.tl-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--crimson-600); z-index: 5; pointer-events: none; }
.tl-now:after { content: ''; position: absolute; top: -3px; left: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--crimson-600); }
.tl-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 10.5px; color: var(--muted); font-weight: 700; }
.tl-legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 4px; }

/* agenda (mobile schedule) */
.agenda { display: flex; flex-direction: column; }
.agenda-row { display: flex; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--silver-100); align-items: flex-start; }
.agenda-row:last-child { border-bottom: none; }
.agenda-time { flex: 0 0 54px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--teal-800); font-size: 13px; }
.agenda-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }

/* ---------------- queue board ---------------- */
.qboard { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.qcol { background: #fff; border: 1px solid var(--silver-200); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 120px; }
.qcol-head { padding: 11px 13px; border-bottom: 1px solid var(--silver-100); display: flex; align-items: center; gap: 8px; }
.qcol-head h3 { font-size: 12.5px; }
.qcol-head .count { margin-left: auto; font-size: 11px; font-weight: 800; color: var(--muted); }
.qcol-body { padding: 10px; display: flex; flex-direction: column; gap: 9px; max-height: 70vh; overflow-y: auto; }
.qcard { border: 1px solid var(--silver-200); border-radius: 12px; padding: 10px 11px; background: #fff; display: flex; flex-direction: column; gap: 7px; box-shadow: var(--shadow-sm); border-left: 3px solid var(--teal-500); }
.qcard.over { border-left-color: var(--crimson-600); background: linear-gradient(180deg, #fff, #fff6f7); }
.qcard.running { border-left-color: var(--crimson-500); }
.qcard.done { opacity: 0.75; }
.qcard .qc-top { display: flex; align-items: flex-start; gap: 8px; }
.qcard .qc-name { font-weight: 800; font-size: 12.5px; }
.qcard .qc-svc { font-size: 11px; color: var(--muted); font-weight: 600; }
.qcard .qc-meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 10.5px; color: var(--muted); font-weight: 700; }
.qcard .qc-timer { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 15px; letter-spacing: -0.01em; }
.qcard .qc-timer.over { color: var(--crimson-600); }
.qbar { height: 4px; background: var(--silver-100); border-radius: 4px; overflow: hidden; }
.qbar i { display: block; height: 100%; background: var(--teal-500); border-radius: 4px; transition: width 0.4s; }
.qbar i.over { background: var(--crimson-600); }
.qcard .qc-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------------- misc widgets ---------------- */
.avatar { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; color: #fff; background: var(--teal-600); flex: 0 0 auto; }
.avatar.lg { width: 42px; height: 42px; font-size: 14px; }
.bar-row { display: flex; flex-direction: column; gap: 4px; padding: 7px 0; }
.bar-row .bar-top { display: flex; justify-content: space-between; font-size: 11.5px; font-weight: 700; }
.bar-row .bar-track { height: 6px; border-radius: 6px; background: var(--silver-100); overflow: hidden; }
.bar-row .bar-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--teal-500), var(--teal-600)); }
.bar-row .bar-fill.warn { background: linear-gradient(90deg, #e0a03a, #a86612); }
.bar-row .bar-fill.danger { background: linear-gradient(90deg, var(--crimson-500), var(--crimson-700)); }
.alert-item { display: flex; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--silver-50); border: 1px solid var(--silver-200); }
.alert-item.danger { background: var(--crimson-100); border-color: #f4cdd3; }
.alert-item.warning { background: var(--amber-100); border-color: #f2dcbb; }
.alert-item.ok { background: var(--teal-100); border-color: #cae6e0; }
.alert-item .ai-ico { width: 20px; height: 20px; flex: 0 0 20px; color: var(--teal-700); }
.alert-item.danger .ai-ico { color: var(--crimson-700); }
.alert-item.warning .ai-ico { color: var(--amber-600); }
.alert-item strong { font-size: 12px; display: block; }
.alert-item span { font-size: 11.5px; color: var(--muted); }
.insight-card { border: 1px solid var(--silver-200); border-radius: 13px; padding: 12px; background: #fff; display: flex; gap: 10px; }
.insight-card .ic-body { flex: 1 1 auto; min-width: 0; }
.insight-card h4 { font-size: 12.5px; margin-bottom: 2px; }
.insight-card p { font-size: 11.5px; color: var(--muted); }
.insight-card .lvl { width: 8px; border-radius: 8px; flex: 0 0 8px; background: var(--teal-500); }
.insight-card.danger .lvl { background: var(--crimson-600); }
.insight-card.warning .lvl { background: #d39433; }
.insight-card.info .lvl { background: var(--teal-500); }
.pill-tabs { display: inline-flex; background: var(--silver-100); border-radius: 11px; padding: 3px; gap: 2px; }
.pill-tabs button {
  border: none; background: transparent; font-family: inherit; font-size: 11.5px; font-weight: 800;
  color: var(--muted); padding: 6px 11px; border-radius: 8px; cursor: pointer;
}
.pill-tabs button.active { background: #fff; color: var(--teal-800); box-shadow: var(--shadow-sm); }
.chart-box { position: relative; height: 230px; }
.chart-box.tall { height: 280px; }
.sk { background: linear-gradient(90deg, var(--silver-100), #f7fbfa, var(--silver-100)); background-size: 200% 100%; animation: sk 1.3s infinite; border-radius: 10px; }
@keyframes sk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.boot-skeleton { display: flex; flex-direction: column; gap: 14px; }
.sk-title { height: 24px; width: 220px; }
.sk-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.sk-card { height: 88px; }
.sk-block { height: 300px; }
.banner { display: flex; align-items: center; gap: 12px; background: linear-gradient(120deg, var(--teal-900), var(--teal-700)); color: #eaf6f3; padding: 14px 16px; border-radius: var(--radius); flex-wrap: wrap; }
.banner h3 { font-size: 14px; }
.banner p { font-size: 12px; color: rgba(234, 246, 243, 0.75); }
.banner .spacer { flex: 1 1 auto; }
.mini-stat { display: flex; flex-direction: column; gap: 1px; }
.mini-stat b { font-size: 16px; font-variant-numeric: tabular-nums; }
.mini-stat span { font-size: 10px; color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
.split { display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; align-items: start; }
.split-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.scroll-y { max-height: 380px; overflow-y: auto; }
.timeline-list { display: flex; flex-direction: column; gap: 0; }
.tl-item { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--silver-200); }
.tl-item:last-child { border-bottom: none; }
.tl-item .tl-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal-500); margin-top: 5px; flex: 0 0 8px; }
.tl-item .tl-body { flex: 1 1 auto; min-width: 0; }
.tl-item .tl-body b { font-size: 12px; }
.tl-item .tl-body div { font-size: 11px; color: var(--muted); }
.rating { display: inline-flex; gap: 2px; color: #d39433; }
.drawer-scrim { position: fixed; inset: 0; background: rgba(6, 36, 33, 0.45); z-index: 35; }

/* ---------------- responsive ---------------- */
@media (max-width: 1180px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split, .split-3 { grid-template-columns: 1fr; }
  .qboard { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .only-mobile { display: inline-flex !important; }
  #sidebar { transform: translateX(-100%); transition: transform 0.22s ease; width: 280px; flex-basis: 280px; }
  #sidebar.open { transform: none; box-shadow: 0 0 60px rgba(6, 36, 33, 0.5); }
  #main { margin-left: 0; }
  #topbar { padding: 10px 14px; gap: 9px; }
  #view { padding: 14px 14px 80px; }
  .tb-title h1 { font-size: 16px; }
  .tb-title p { display: none; }
  .mobile-brand img { height: 30px; width: auto; display: block; border-radius: 6px; }
  .mobile-brand { background: #fff; border: 1px solid var(--silver-200); padding: 3px 5px; border-radius: 8px; }
  .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qboard { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .chart-box { height: 210px; }
}
@media (max-width: 640px) {
  .g2, .g3, .g4, .sk-grid { grid-template-columns: 1fr; }
  .tb-date .btn-ghost { display: none; }
  .kpi .kpi-value { font-size: 22px; }
  table.tbl th, table.tbl td { padding: 8px 9px; }
  .card.pad-md { padding: 12px; }
}
@media (min-width: 721px) {
  .tl-mobile { display: none; }
}
@media (max-width: 720px) {
  .tl-desktop { display: none; }
  .tl-mobile { display: block; }
  #view { padding-bottom: 40px; }
}
