/* ---------- self-hosted fonts (Inter + Noto Sans Ethiopic) — no external requests, works offline ---------- */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2-variations"), url("../fonts/inter-latin-wght-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/inter-latin-ext-wght-normal.woff2") format("woff2-variations"), url("../fonts/inter-latin-ext-wght-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Noto Sans Ethiopic"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/noto-sans-ethiopic-ethiopic-wght-normal.woff2") format("woff2-variations"), url("../fonts/noto-sans-ethiopic-ethiopic-wght-normal.woff2") format("woff2"); unicode-range: U+1200-137F, U+1380-139F, U+2D80-2DDF, U+AB00-AB2F; }

/* =====================================================================
   10-pro.css — "Aurora" design system (loaded LAST, wins over 1–9)
   Indigo → violet brand, teal / amber / rose signals, soft glass surfaces.
   Sections: 1 tokens · 2 base · 3 shell · 4 controls · 5 cards/kpi · 6 ribbon+tabs
             7 tables (desktop + phone cards) · 8 charts · 9 reports · 10 mobile-compact · 11 print
   ===================================================================== */

/* ---------- 1. TOKENS: Next.js + Modern Excel Clean Design System ---------- */
:root {
  --bg: #f8fafc; --card: #ffffff; --tx: #0f172a; --mu: #64748b; --bd: #e2e8f0;
  --ac: #107c41; --ac2: #0b5e31; --acl: #e8f5e9; --act: #107c41;
  --rd: #ef4444; --rdl: #fee2e2; --rdt: #dc2626; --yl: #f59e0b; --yll: #fef3c7; --gr: #107c41;
  --c1: #107c41; --c2: #2563eb; --c3: #f59e0b; --c4: #ec4899; --c5: #0284c7; --c6: #84cc16;
  --ok: #107c41; --okl: #e8f5e9; --warn: #f59e0b; --bad: #ef4444;
  --tx-h: #0f172a; --tx-m: #475569; --bd-c: #cbd5e1;
  --xg: #107c41; --xg2: #0b5e31; --xgl: #e8f5e9; --xgrid: #e2e8f0; --xhd: #f1f5f9; --xrn: #eef2f6;
  --xalt: #fcfdfd; --xhl: #f0fdf4; --xtot: #e8f5e9;
  --silva-primary: #107c41; --silva-primary-hover: #0b5e31; --silva-primary-subtle: rgba(16, 124, 65, .12);
  --silva-primary-light: rgba(16, 124, 65, .06); --silva-indigo: #107c41; --silva-purple: #7c3aed;
  --silva-danger: #ef4444; --silva-warning: #f59e0b; --silva-info: #0284c7; --silva-blue: #2563eb;
  --silva-border: #e2e8f0; --silva-card-radius: 12px; --silva-sidebar-dark: #111827;
  --cell: #f8fafc; --s2: #f1f5f9; --silva-surface: #f8fafc;
  --ex-head: #107c41; --ex-headink: #ffffff; --ex-cell: #f8fafc; --ex-sel: #f0fdf4; --ex-line: #e2e8f0;
  --r: 8px; --r2: 12px; --r3: 16px;
  --sh-s: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --sh1: 0 1px 3px 0 rgba(15, 23, 42, 0.06), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
  --sh2: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --grad: #107c41;
  --grad-hero: #107c41;
  --ring: 0 0 0 3px rgba(16, 124, 65, .2);
  --fs: "Inter", "Noto Sans Ethiopic", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
:root[data-theme="dark"] {
  --bg: #090d16; --card: #111827; --tx: #f8fafc; --mu: #94a3b8; --bd: #1e293b;
  --ac: #22c55e; --ac2: #16a34a; --acl: rgba(34, 197, 94, .14); --act: #4ade80;
  --rd: #ef4444; --rdl: rgba(239, 68, 68, .16); --rdt: #fca5a5; --yl: #f59e0b; --yll: rgba(245, 158, 11, .16); --gr: #22c55e;
  --c1: #22c55e; --c2: #60a5fa; --c3: #fbbf24; --c4: #f472b6; --c5: #38bdf8; --c6: #a3e635;
  --ok: #22c55e; --okl: rgba(34, 197, 94, .14); --warn: #f59e0b; --bad: #ef4444;
  --tx-h: #f8fafc; --tx-m: #94a3b8; --bd-c: #334155;
  --xg: #22c55e; --xg2: #16a34a; --xgl: rgba(34, 197, 94, .14); --xgrid: #1e293b; --xhd: #141e30; --xrn: #0f172a;
  --xalt: #0d1424; --xhl: rgba(34, 197, 94, .14); --xtot: rgba(34, 197, 94, .16);
  --silva-primary: #22c55e; --silva-primary-hover: #16a34a; --silva-primary-subtle: rgba(34, 197, 94, .14);
  --silva-primary-light: rgba(34, 197, 94, .08); --silva-danger: #ef4444; --silva-blue: #38bdf8; --silva-border: #1e293b;
  --silva-sidebar-dark: #090d16; --cell: #0d1424; --s2: #141e30; --silva-surface: #111827;
  --ex-head: #141e30; --ex-headink: #f8fafc; --ex-cell: #111827; --ex-sel: rgba(34, 197, 94, .14); --ex-line: #1e293b;
  --sh-s: 0 1px 2px 0 rgba(0, 0, 0, .5); --sh1: 0 1px 3px 0 rgba(0, 0, 0, .4); --sh2: 0 10px 25px -5px rgba(0, 0, 0, .5);
  --grad: #16a34a;
  --grad-hero: #16a34a;
  --ring: 0 0 0 3px rgba(34, 197, 94, .3);
}
/* beat 9-silva / 7-clinic "body.clinic{--ac:…!important}" */
:root body.clinic { --ac: #107c41 !important; --act: #107c41 !important; --acl: #e8f5e9 !important; --xg: #107c41 !important; --xg2: #0b5e31 !important; --xgl: #e8f5e9 !important; }
:root[data-theme="dark"] body.clinic {
  --ac: #22c55e !important; --act: #4ade80 !important; --acl: rgba(34, 197, 94, .14) !important;
  --xg: #22c55e !important; --xg2: #16a34a !important; --xgl: rgba(34, 197, 94, .14) !important;
  --silva-primary: #22c55e !important; --silva-primary-hover: #16a34a !important;
  --silva-primary-subtle: rgba(34, 197, 94, .14) !important; --silva-primary-light: rgba(34, 197, 94, .08) !important;
  --silva-border: #1e293b !important; --silva-sidebar-dark: #090d16 !important;
  --cell: #0d1424 !important; --s2: #141e30 !important; --silva-surface: #111827 !important;
  --ex-head: #141e30 !important; --ex-headink: #f8fafc !important; --ex-cell: #111827 !important;
  --ex-sel: rgba(34, 197, 94, .14) !important; --ex-line: #1e293b !important;
}

/* ---------- 2. BASE ---------- */
* { font-family: var(--fs) !important; }
body { font-family: var(--fs) !important; color: var(--tx); font-size: 14.5px; line-height: 1.5; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
:root[data-theme="light"] body, :root:not([data-theme]) body {
  background: var(--bg) !important;
}
:root[data-theme="dark"] body {
  background: #090d16 !important;
  color: #f8fafc !important;
}
:root[data-theme="dark"] ::selection {
  background: rgba(34, 197, 94, .3) !important;
  color: #ffffff !important;
}
h1, h2, h3, h4 { letter-spacing: -.015em; font-weight: 700; }
::selection { background: rgba(16, 124, 65, .18); }
:focus-visible { outline: 0 !important; box-shadow: var(--ring) !important; border-radius: 8px; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--mu) 30%, transparent); border: 2px solid transparent; background-clip: padding-box; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ---------- 3. SHELL (Next.js Simple & Powerful Sidebar / Topbar) ---------- */
#topbar { height: 52px; background: color-mix(in srgb, var(--card) 90%, transparent) !important; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 1px 0 var(--bd) !important; padding: 0 20px !important; }
#topbar h1 { font-size: 17px !important; font-weight: 700 !important; letter-spacing: -.01em; }
#topbar small { font-size: 12px !important; font-weight: 500 !important; color: var(--mu) !important; }
#back { border-radius: 8px !important; width: 34px !important; height: 34px !important; border: 1px solid var(--bd) !important; }
.logo-m, #side .brand .logo-m { background: var(--ac) !important; box-shadow: none !important; border-radius: 8px !important; width: 32px !important; height: 32px !important; font-size: 16px !important; color: #fff !important; }
#side .brand span#brn { font-size: 15px !important; font-weight: 700 !important; letter-spacing: -.01em !important; color: #000000 !important; }
:root[data-theme="dark"] #side .brand span#brn { color: #ffffff !important; }

/* Menu styling - simple, powerful, high contrast in light theme */
nav { background: color-mix(in srgb, var(--card) 92%, transparent) !important; border-top: 1px solid var(--bd) !important; }
#side nav button, nav button { color: #000000 !important; font-weight: 600 !important; font-size: 13.5px !important; }
#side nav button span svg, nav button span svg { stroke: #000000 !important; width: 18px !important; height: 18px !important; stroke-width: 1.8 !important; }
:root[data-theme="dark"] #side nav button, :root[data-theme="dark"] nav button { color: #94a3b8 !important; }
:root[data-theme="dark"] #side nav button span svg, :root[data-theme="dark"] nav button span svg { stroke: #94a3b8 !important; }
#side nav button.on, nav button.on { color: #000000 !important; font-weight: 700 !important; }
nav button.on span { background: var(--acl) !important; }
nav button.on span svg { stroke: var(--act) !important; }

@media (min-width: 960px) {
  /* Layout: Fixed Sidebar + Independent Main Content Scroll */
  body:not(.authing) .shell {
    display: block !important;
    min-height: 100vh !important;
    position: relative !important;
  }
  body:not(.authing) .content {
    margin-left: 250px !important;
    width: calc(100% - 250px) !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  /* Fixed Footer: stays pinned at the bottom, never moves with page scroll */
  body:not(.authing) .app-footer {
    position: fixed !important;
    bottom: 0 !important;
    left: 250px !important;
    right: 0 !important;
    height: 42px !important;
    line-height: 42px !important;
    margin: 0 !important;
    padding: 0 24px !important;
    z-index: 95 !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    background: var(--card, #ffffff) !important;
    border-top: 1px solid var(--bd, #e2e8f0) !important;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.04) !important;
    opacity: 1 !important;
    visibility: visible !important;
  }
  :root[data-theme="dark"] body:not(.authing) .app-footer {
    background: #0f172a !important;
    border-top: 1px solid #1e293b !important;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3) !important;
    color: #94a3b8 !important;
  }
  .app-footer-inner {
    width: 100% !important;
    max-width: 1400px !important;
    margin: 0 auto !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
    gap: 16px !important;
    overflow: visible !important;
  }
  .app-footer-copy {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    font-size: 12.5px !important;
    font-weight: 500 !important;
    color: #334155 !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }
  .app-footer-copy b {
    color: #0f172a !important;
    font-weight: 700 !important;
  }
  :root[data-theme="dark"] .app-footer-copy {
    color: #94a3b8 !important;
  }
  :root[data-theme="dark"] .app-footer-copy b {
    color: #f8fafc !important;
  }
  .app-footer-brand {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    color: #0f172a !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }
  :root[data-theme="dark"] .app-footer-brand {
    color: #f8fafc !important;
  }
  .app-footer-badge {
    display: inline-block !important;
    background: var(--acl, #e8f5e9) !important;
    color: var(--act, #107c41) !important;
    font-weight: 800 !important;
    font-size: 11px !important;
    padding: 2px 8px !important;
    border-radius: 6px !important;
    border: 1px solid rgba(16, 124, 65, 0.2) !important;
  }
  :root[data-theme="dark"] .app-footer-badge {
    background: rgba(34, 197, 94, 0.15) !important;
    color: #4ade80 !important;
    border-color: rgba(74, 222, 128, 0.3) !important;
  }
  .app-footer-author {
    color: #107c41 !important;
    font-weight: 800 !important;
    letter-spacing: 0.3px !important;
    display: inline-block !important;
  }
  :root[data-theme="dark"] .app-footer-author {
    color: #4ade80 !important;
    font-weight: 800 !important;
  }
  body:not(.authing) #app {
    padding-bottom: 56px !important;
  }
  .cb, #t {
    bottom: 50px !important;
  }

  /* Fixed Desktop Sidebar: Page scroll will NEVER move the sidebar */
  #side {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 250px !important;
    height: 100vh !important;
    max-height: 100vh !important;
    z-index: 40 !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
    background: #ffffff !important;
    border-right: 1px solid var(--bd) !important;
    box-shadow: 1px 0 0 rgba(0, 0, 0, .05) !important;
    padding: 16px 12px 14px !important;
    overflow: hidden !important;
    overscroll-behavior: contain !important;
  }
  :root[data-theme="dark"] #side {
    background: #000000 !important;
    border-right: 1px solid #262626 !important;
    box-shadow: none !important;
  }

  /* Modal & Fullscreen Sheets (Patient Files): ALWAYS in front of sidebar */
  #m {
    position: fixed !important;
    inset: 0 !important;
    z-index: 20000 !important;
  }
  #m.on {
    display: flex !important;
    z-index: 20000 !important;
  }
  #m.fsm {
    align-items: stretch !important;
    justify-content: stretch !important;
    padding: 0 !important;
    background: var(--bg) !important;
    z-index: 20000 !important;
  }
  #m .sheet, #m .sheet.fs {
    z-index: 20001 !important;
  }
  .sheet.fs .xcl {
    z-index: 20005 !important;
  }

  /* When ANY modal / sheet / patient file is open, hide sidebar & footer completely so nothing is covered */
  body.mopen #side,
  body:has(#m.on) #side {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
    z-index: -1 !important;
  }
  body.mopen .app-footer,
  body:has(#m.on) .app-footer {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
    z-index: -1 !important;
  }

  #side .brand {
    flex-shrink: 0 !important;
    border-bottom: 1px solid var(--bd) !important;
    padding: 4px 6px 14px !important;
    margin-bottom: 10px !important;
    gap: 10px !important;
    display: flex !important;
    align-items: center !important;
  }

  /* Sidebar nav: Independent scrolling - scrolling menu NEVER moves the page */
  #side nav {
    box-shadow: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: none !important;
    gap: 3px !important;
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
    padding-right: 2px !important;
  }
  #side nav::-webkit-scrollbar {
    width: 4px !important;
  }
  #side nav::-webkit-scrollbar-track {
    background: transparent !important;
  }
  #side nav::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.18) !important;
    border-radius: 4px !important;
  }
  :root[data-theme="dark"] #side nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2) !important;
  }

  #side nav::before {
    font-size: 11px !important;
    letter-spacing: .08em !important;
    font-weight: 800 !important;
    color: #000000 !important;
    padding: 4px 10px 6px !important;
    text-transform: uppercase !important;
    opacity: .85;
    flex-shrink: 0 !important;
  }
  :root[data-theme="dark"] #side nav::before {
    color: #94a3b8 !important;
  }

  /* Menu buttons: Deep black in light theme */
  #side nav button, nav button {
    border-radius: 8px !important;
    color: #000000 !important;
    padding: 8px 12px !important;
    height: 38px !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    transition: all .12s ease !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    text-align: left !important;
  }
  #side nav button span svg, nav button span svg {
    stroke: #000000 !important;
  }
  #side nav button:hover, nav button:hover {
    background: #f1f5f9 !important;
    color: #000000 !important;
  }
  #side nav button:hover span svg, nav button:hover span svg {
    stroke: #000000 !important;
  }
  #side nav button.on, nav button.on {
    background: var(--acl) !important;
    color: #000000 !important;
    font-weight: 700 !important;
    box-shadow: none !important;
    border-left: 3px solid var(--ac) !important;
  }
  #side nav button.on span svg, nav button.on span svg {
    stroke: var(--ac) !important;
  }
  #side nav button.on span, nav button.on span {
    background: none !important;
  }

  .bdg2 {
    background: var(--rd) !important;
    color: #fff !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    border-radius: 999px !important;
    padding: 1px 7px !important;
    margin-left: auto !important;
  }

  #usr {
    flex-shrink: 0 !important;
    margin-top: auto !important;
    border-top: 1px solid var(--bd) !important;
    padding-top: 12px !important;
  }
  #usr .ua {
    width: 32px !important;
    height: 32px !important;
    border-radius: 8px !important;
    background: var(--acl) !important;
    color: var(--act) !important;
    font-size: 13px !important;
    font-weight: 700 !important;
  }
  #usr .ui b {
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #000000 !important;
  }
  #usr .ui small {
    font-size: 11.5px !important;
    color: #475569 !important;
    font-weight: 500 !important;
  }
  #usr .lo {
    width: 30px !important;
    height: 30px !important;
    border-radius: 8px !important;
    color: #475569 !important;
  }
  #usr .lo:hover {
    background: var(--rdl) !important;
    color: var(--rdt) !important;
  }
}
@media (max-width: 959px) {
  nav { border-radius: 16px 16px 0 0; box-shadow: 0 -4px 18px rgba(0, 0, 0, .08) !important; height: 60px !important; }
  nav button { padding: 6px 8px 4px !important; }
  nav button span { width: 36px !important; height: 26px !important; border-radius: 8px !important; }
}
#app { max-width: 1240px; }
@media (min-width: 960px) { #app { max-width: 1320px; padding: 22px 28px 50px !important; } }
@media (min-width: 1500px) { #app[data-t^="c_"], #app[data-t="home"] { max-width: 1560px; } }
.app-footer { opacity: 1 !important; font-size: 12.5px !important; }
.app-footer-badge { background: var(--acl) !important; color: var(--act) !important; border-radius: 6px !important; font-weight: 700 !important; }
.app-footer-author { color: #107c41 !important; font-weight: 800 !important; letter-spacing: 0.3px !important; }

/* ---------- 4. CONTROLS: Clean Next.js Inputs & Buttons ---------- */
input, select, textarea { border: 1px solid var(--bd) !important; background: var(--card) !important; color: var(--tx) !important; border-radius: 8px !important; padding: 9px 12px !important; font-size: 14px !important; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--ac) !important; box-shadow: var(--ring) !important; outline: 0; }
.big, body.clinic .big, body.clinic .pbtn, .pbtn { background: var(--ac) !important; color: #fff !important; border: 0 !important; border-radius: 8px !important; font-weight: 600 !important; font-size: 14px !important; padding: 10px 18px !important; box-shadow: var(--sh-s) !important; }
.big:hover, body.clinic .big:hover, .pbtn:hover { filter: brightness(0.92) !important; }
.big.o, body.clinic .big.o { background: var(--card) !important; color: var(--tx) !important; border: 1px solid var(--bd) !important; box-shadow: none !important; }
.big.o:hover, body.clinic .big.o:hover { background: var(--bg) !important; }
.big.y, body.clinic .big.y { background: #f59e0b !important; color: #fff !important; }
.big.r, body.clinic .big.r { background: var(--rd) !important; color: #fff !important; }
.ib { border-radius: 8px !important; border: 1px solid var(--bd); background: var(--card); color: var(--tx); font-weight: 600; font-size: 13px; padding: 7px 12px; }
.ib:hover { background: var(--bg); }
.ib.pr { background: var(--ac) !important; color: #fff !important; border-color: transparent; }
.ib.pr:hover { filter: brightness(0.92); }
.chip { border-radius: 6px; background: var(--acl); color: var(--act); font-weight: 600; padding: 2px 8px; font-size: 11.5px; }
.chip.pr { background: var(--acl); color: var(--act); }
.chip.bad { background: var(--rdl); color: var(--rdt); }
.seg button.on, .xtabs button.on { background: var(--ac) !important; color: #fff !important; border-color: transparent !important; }

/* ---------- 5. CARDS + KPI ---------- */
.card { background: var(--card) !important; border: 1px solid var(--bd) !important; border-radius: var(--r2) !important; box-shadow: var(--sh1) !important; }
.hero, .balance-card { background: var(--ac) !important; border-radius: var(--r2) !important; box-shadow: var(--sh2) !important; }
.hero.bad { background: #be123c !important; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 14px; }
.kc { position: relative; overflow: hidden; background: var(--card); border: 1px solid var(--bd); border-radius: var(--r2); padding: 14px 16px 12px; box-shadow: var(--sh1); min-width: 0; display: flex; flex-direction: column; gap: 4px; transition: transform .12s, box-shadow .12s; }
.kc[onclick] { cursor: pointer; }
@media (hover: hover) { .kc[onclick]:hover { transform: translateY(-1px); box-shadow: var(--sh2); } }
.kc-t { display: flex; align-items: center; gap: 8px; min-width: 0; }
.kc-t small { flex: 1; min-width: 0; color: var(--mu); font-weight: 600; font-size: 12px; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kc-i { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--acl); font-size: 15px; flex: none; }
.kc-v { font-size: 24px; font-weight: 700; letter-spacing: -.02em; color: var(--tx-h); line-height: 1.15; font-variant-numeric: tabular-nums; word-break: break-word; }
.kc-n { color: var(--mu); font-size: 12px; font-weight: 500; }
.kc-s { height: 34px; margin: 4px -4px -2px; }
.kd { font-style: normal; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; flex: none; }
.kd.up { background: var(--okl); color: var(--ok); } .kd.dn { background: var(--rdl); color: var(--rdt); }
.kd.inv.up { background: var(--rdl); color: var(--rdt); } .kd.inv.dn { background: var(--okl); color: var(--ok); }
.kc.hi { background: var(--ac); border-color: transparent; color: #fff; box-shadow: var(--sh2); }
.kc.hi .kc-t small, .kc.hi .kc-n { color: rgba(255, 255, 255, .82); } .kc.hi .kc-v { color: #fff; font-size: 28px; } .kc.hi .kc-i { background: rgba(255, 255, 255, .2); }
.kc.hi.bad { background: #be123c; }
.kc.hi .kd { background: rgba(255, 255, 255, .2); color: #fff; }
@media (max-width: 1000px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 380px) { .kc-v { font-size: 20px; } .kc.hi .kc-v { font-size: 24px; } }

/* old KPI cells (.xkc) */
.xkp { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.xkc { background: var(--card) !important; border: 1px solid var(--bd) !important; border-radius: var(--r2) !important; box-shadow: var(--sh1) !important; }
.xkc::before { background: var(--ac) !important; }

/* ---------- 6. RIBBON + TABS (Excel Ribbon / Modern Toolbar Feel) ---------- */
.xrb, :root[data-theme="dark"] .xrb { background: var(--card) !important; border: 1px solid var(--bd) !important; border-bottom: 0 !important; border-radius: var(--r2) var(--r2) 0 0 !important; box-shadow: var(--sh-s) !important; padding: 10px 14px !important; }
.xrb .xb { background: var(--card) !important; color: var(--tx) !important; border: 1px solid var(--bd) !important; border-radius: 8px !important; font-weight: 600; font-size: 13px; }
.xrb .xb:hover { background: var(--bg) !important; }
.xrb .xb.pr { background: var(--ac) !important; color: #fff !important; border-color: var(--ac) !important; }
.xfx { background: var(--card) !important; border: 1px solid var(--bd) !important; border-top: 0 !important; border-radius: 0 0 var(--r2) var(--r2); }
.xtabs { gap: 6px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; background: transparent !important; border: 0 !important; padding: 6px 0 !important; }
.xtabs::-webkit-scrollbar { display: none; }
.xtabs button { flex: none; background: var(--card) !important; border: 1px solid var(--bd) !important; border-radius: 8px !important; color: var(--tx-m) !important; font-weight: 600; font-size: 13px; padding: 7px 14px; white-space: nowrap; }
.xtabs button:hover { background: var(--bg) !important; color: var(--tx-h) !important; }
.xtabs button.on { background: var(--ac) !important; color: #fff !important; border-color: var(--ac) !important; }
.xtabs button i { background: var(--acl); color: var(--act); border-radius: 6px; padding: 1px 6px; font-style: normal; font-size: 11px; margin-left: 4px; }
.xtabs button.on i { background: rgba(255, 255, 255, .25); color: #fff; }
.xpg { background: var(--card) !important; border: 1px solid var(--bd) !important; border-radius: 0 0 var(--r2) var(--r2); padding: 8px 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.xpg button { border: 1px solid var(--bd); background: var(--card); color: var(--tx); border-radius: 8px; min-width: 32px; height: 32px; font-weight: 600; font-size: 13px; }
.xpg button.on { background: var(--ac); color: #fff; border-color: transparent; }
.xpg button:disabled { opacity: .4; }

/* ---------- 7. TABLES: Authentic Excel Spreadsheet Gridlines & Headers ---------- */
.xlw, .tw { position: relative; overflow: auto; -webkit-overflow-scrolling: touch; background: var(--card) !important; border: 1px solid var(--bd) !important; border-radius: var(--r2) !important; box-shadow: var(--sh-s); max-height: 74vh; overscroll-behavior: contain; }
.xrb + .xfx + .xlw, .xfx + .xlw, .xpg + .xlw, .xrb + .xlw { border-top-left-radius: 0 !important; border-top-right-radius: 0 !important; }
table.xl, table.tbl-pro { border-collapse: separate !important; border-spacing: 0; width: 100%; font-size: 13px; background: transparent; font-variant-numeric: tabular-nums; }
table.xl th, table.xl td { border: 0 !important; border-bottom: 1px solid var(--xgrid) !important; border-right: 1px solid var(--xgrid) !important; padding: 8px 12px; text-align: left; vertical-align: middle; color: var(--tx) !important; white-space: nowrap; background: transparent; }
table.xl th:last-child, table.xl td:last-child { border-right: 0 !important; }
table.xl thead th { position: sticky; top: 0; z-index: 2; background: var(--xhd) !important; color: var(--tx-m) !important; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; border-bottom: 1.5px solid var(--bd-c) !important; box-shadow: 0 1px 0 var(--bd); }
table.xl .rn, table.xl thead .rn { width: 38px; text-align: center; color: var(--mu) !important; background: var(--xrn) !important; font-size: 11px; font-weight: 600; border-right: 1.5px solid var(--bd-c) !important; position: sticky; left: 0; z-index: 1; }
table.xl thead .rn { z-index: 3; }
table.xl tbody tr:nth-child(even) td:not(.rn) { background: var(--xalt) !important; }
table.xl tbody tr { transition: background .1s; }
table.xl tbody tr:hover td:not(.rn) { background: var(--xhl) !important; }
table.xl td.n, table.xl th.n { text-align: right; font-weight: 600; color: var(--tx-h) !important; }
table.xl td b, table.xl th b { color: var(--tx-h) !important; font-weight: 600; }
table.xl td.act { text-align: right; width: 1%; white-space: nowrap; }
table.xl td.xe { text-align: center; color: var(--mu) !important; padding: 32px 16px !important; white-space: normal; font-weight: 500; }
table.xl tfoot td { position: sticky; bottom: 0; background: var(--xtot) !important; font-weight: 700; color: var(--tx-h) !important; border-top: 2px solid var(--ac) !important; border-bottom: 0 !important; }
table.xl tr.xhl td:not(.rn) { background: var(--xhl) !important; }
table.xl tr.xdim td { opacity: .5; }
table.xl td .xb, table.xl td .ib { border-radius: 6px; padding: 4px 10px; font-size: 12px; font-weight: 600; border: 1px solid var(--bd); background: var(--card); color: var(--act); cursor: pointer; }
table.xl td .xb:hover, table.xl td .ib:hover { background: var(--bg); }
table.xl td .xb.pr { background: var(--ac); color: #fff; border-color: transparent; }
table.xl td.xi input { width: 100%; min-width: 90px; padding: 6px 8px; border-radius: 6px !important; font-size: 13px; }
table.xl tbody tr:last-child td { border-bottom: 0 !important; }

/* Settings List Layout - setting ውስጥ ያሉ menu ሁሉ እንደ list ይቀመጡ */
.set-menu-wrap { max-width: 840px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; width: 100%; }
.set-hero-card { display: flex; align-items: center; gap: 16px; background: var(--card) !important; border: 1px solid var(--bd) !important; border-radius: var(--r2) !important; padding: 16px 20px !important; box-shadow: var(--sh-s) !important; }
.set-hero-avatar { width: 50px !important; height: 50px !important; border-radius: 10px !important; background: var(--acl) !important; border: 1px solid var(--bd) !important; display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0; overflow: hidden; }
.set-hero-avatar img { width: 100%; height: 100%; object-fit: contain; }
.set-hero-details h3 { margin: 0 0 3px; font-size: 17px; font-weight: 700; color: var(--tx-h); }
.set-hero-subtitle { font-size: 12.5px; color: var(--tx-m); margin-bottom: 6px; font-weight: 500; }
.set-hero-tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.set-hero-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 6px; background: var(--bg); border: 1px solid var(--bd); }

.set-list-card, .set-grid { display: flex !important; flex-direction: column !important; background: var(--card) !important; border: 1px solid var(--bd) !important; border-radius: var(--r2) !important; overflow: hidden !important; box-shadow: var(--sh-s) !important; margin: 6px 0 16px !important; gap: 0 !important; padding: 0 !important; }
.set-list-item, .set-menu-item { display: flex !important; align-items: center !important; gap: 14px !important; padding: 12px 18px !important; border: 0 !important; border-bottom: 1px solid var(--bd) !important; border-radius: 0 !important; background: transparent !important; width: 100% !important; min-height: 52px !important; height: auto !important; box-shadow: none !important; cursor: pointer; text-align: left; transition: background .12s ease !important; transform: none !important; }
.set-list-item:last-child, .set-menu-item:last-child { border-bottom: 0 !important; }
.set-list-item:hover, .set-menu-item:hover { background: var(--bg) !important; border-color: var(--bd) !important; transform: none !important; box-shadow: none !important; }
:root[data-theme="dark"] .set-list-item:hover, :root[data-theme="dark"] .set-menu-item:hover { background: rgba(255, 255, 255, 0.04) !important; }
.set-list-icon, .set-menu-icon { width: 34px !important; height: 34px !important; border-radius: 8px !important; font-size: 17px !important; display: grid !important; place-items: center !important; flex-shrink: 0 !important; transform: none !important; }
.set-list-item:hover .set-list-icon, .set-menu-item:hover .set-menu-icon { transform: none !important; }
.set-list-text, .set-menu-text { flex: 1 !important; min-width: 0 !important; }
.set-list-title-row, .set-menu-title-row { display: flex !important; align-items: center !important; gap: 8px !important; margin-bottom: 2px !important; }
.set-list-title-row b, .set-menu-title-row b { font-size: 13.5px !important; font-weight: 600 !important; color: var(--tx-h) !important; }
.set-list-desc, .set-menu-desc { font-size: 12px !important; color: var(--mu) !important; line-height: 1.3 !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; }
.set-list-chv, .set-menu-chv { margin-left: auto !important; color: var(--mu) !important; opacity: .4 !important; transition: transform .15s ease, opacity .15s ease, color .15s ease !important; flex-shrink: 0; }
.set-list-item:hover .set-list-chv, .set-menu-item:hover .set-menu-chv { opacity: 1 !important; color: var(--ac) !important; transform: translateX(2px) !important; }

.set-pill-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 6px; }
.set-pill-badge.ok { background: var(--okl); color: var(--ok); }
.set-pill-badge.warn { background: var(--yll); color: var(--yl); }
.set-pill-badge.info { background: var(--acl); color: var(--act); }
.set-pill-badge.muted { background: var(--bg); color: var(--mu); border: 1px solid var(--bd); }
/* scroll shadows */
.sh-l { box-shadow: inset 12px 0 10px -12px rgba(15, 23, 42, .35), var(--sh1); } .sh-r { box-shadow: inset -12px 0 10px -12px rgba(15, 23, 42, .35), var(--sh1); } .sh-l.sh-r { box-shadow: inset 12px 0 10px -12px rgba(15, 23, 42, .3), inset -12px 0 10px -12px rgba(15, 23, 42, .3), var(--sh1); }
/* Subpage headers & navigation */
.set-subpage-header { display: flex !important; align-items: center !important; justify-content: space-between !important; gap: 12px !important; margin-bottom: 16px !important; padding-bottom: 12px !important; border-bottom: 1px solid var(--bd) !important; flex-wrap: wrap !important; }
.set-subpage-header h3 { margin: 0 !important; font-size: 17px !important; font-weight: 700 !important; color: var(--tx-h) !important; }
.set-back-btn { display: inline-flex !important; align-items: center !important; gap: 6px !important; padding: 7px 12px !important; border-radius: 8px !important; border: 1px solid var(--bd) !important; background: var(--card) !important; color: var(--tx) !important; font-weight: 600 !important; font-size: 13px !important; cursor: pointer !important; transition: all .12s ease !important; }
.set-back-btn:hover { background: var(--bg) !important; color: var(--ac) !important; border-color: var(--bd) !important; }

/* generic settings tables - Excel spreadsheet styling */
table.set-test-table { border-collapse: separate !important; border-spacing: 0 !important; width: 100% !important; font-size: 13px !important; font-variant-numeric: tabular-nums !important; }
table.set-test-table th { background: var(--xhd) !important; color: var(--tx-m) !important; font-size: 11px !important; text-transform: uppercase !important; letter-spacing: .05em !important; font-weight: 700 !important; padding: 8px 12px !important; border-bottom: 1.5px solid var(--bd-c) !important; border-right: 1px solid var(--xgrid) !important; }
table.set-test-table th:last-child { border-right: 0 !important; }
table.set-test-table td { padding: 8px 12px !important; border-bottom: 1px solid var(--xgrid) !important; border-right: 1px solid var(--xgrid) !important; font-size: 13px !important; color: var(--tx) !important; }
table.set-test-table td:last-child { border-right: 0 !important; }
table.set-test-table tbody tr:nth-child(even) td { background: var(--xalt) !important; }
table.set-test-table tbody tr:hover td { background: var(--xhl) !important; }
table.set-test-table td .ib, table.set-test-table td .xb { border-radius: 6px !important; padding: 4px 10px !important; font-size: 12px !important; }
.mr-t { display: none; }

/* ---- PHONE: rows become cards, only key fields show, the rest opens with "More" ---- */
@media (max-width: 640px) {
  .xlw, .tw { max-height: none; overflow: visible; border: 0 !important; background: transparent !important; box-shadow: none !important; border-radius: 0 !important; }
  table.xl.tbl-pro, table.tbl-pro, table.tbl-pro tbody, table.tbl-pro tfoot, table.tbl-pro tr { display: block !important; width: 100% !important; min-width: 0 !important; max-width: 100% !important; }
  table.tbl-pro thead { display: none !important; }
  table.xl.tbl-pro tr { display: flex !important; flex-direction: column; }
  table.tbl-pro td:empty:not(.mr-t):not(.act) { display: none !important; }
  table.tbl-pro tr { background: var(--card); border: 1px solid var(--bd); border-radius: 16px; padding: 6px 14px 8px; margin: 0 0 10px; box-shadow: var(--sh1); position: relative; }
  table.tbl-pro tbody tr:nth-child(even) td, table.xl.tbl-pro tbody tr:hover td:not(.rn) { background: transparent !important; }
  table.xl.tbl-pro td, table.set-test-table.tbl-pro td { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; width: 100%; padding: 8px 0 !important; border: 0 !important; border-bottom: 1px dashed var(--bd) !important; text-align: right !important; white-space: normal !important; background: transparent !important; word-break: break-word; font-size: 14px; }
  table.tbl-pro td::before { content: attr(data-label); flex: none; max-width: 46%; text-align: left; color: var(--mu); font-size: 11.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
  table.tbl-pro td.rn { display: none !important; }
  table.tbl-pro td.ti { order: -2; display: block; text-align: left !important; font-size: 16px; font-weight: 800; padding: 10px 0 8px !important; border-bottom: 1px solid var(--bd) !important; color: var(--tx-h) !important; }
  table.tbl-pro td.ti::before { display: none; }
  table.tbl-pro td.c2 { display: none !important; }
  table.tbl-pro tr.open td.c2 { display: flex !important; }
  table.tbl-pro td.act { order: 5; justify-content: flex-end; flex-wrap: wrap; gap: 8px; border-bottom: 0 !important; padding-top: 10px !important; }
  table.tbl-pro td.act::before, table.tbl-pro td.mr-t::before { display: none; }
  table.tbl-pro td.act .xb, table.tbl-pro td.act .ib { padding: 9px 14px; font-size: 13.5px; min-height: 40px; }
  table.tbl-pro.has-more td.mr-t { display: block; order: 4; border: 0 !important; padding: 6px 0 0 !important; text-align: left !important; }
  .mr-b { border: 0; background: var(--acl); color: var(--act); font-weight: 700; font-size: 12.5px; padding: 6px 12px; border-radius: 999px; cursor: pointer; }
  table.tbl-pro tr.tr-empty { text-align: center; }
  table.tbl-pro tr.tr-empty td.xe { display: block !important; text-align: center !important; padding: 26px 8px !important; }
  table.tbl-pro tr.tr-empty td.xe::before, table.tbl-pro tr.tr-empty td.rn { display: none !important; }
  table.tbl-pro tfoot tr { background: var(--xtot); border-color: var(--ac); }
  table.xl.tbl-pro tfoot td { position: static; border: 0 !important; border-bottom: 1px dashed var(--bd) !important; background: transparent !important; font-weight: 800; }
  table.xl.tbl-pro td.xi input { max-width: 58%; }
  .xrb { flex-wrap: wrap; gap: 8px; padding: 12px 14px !important; border-radius: var(--r2) !important; margin-bottom: 8px; }
  .xrb .xbt { display: flex; gap: 6px; flex-wrap: wrap; width: 100%; }
  .xrb .xb { flex: 1 1 auto; min-height: 38px; }
  .xfx { border-radius: var(--r) !important; border-top: 1px solid var(--bd) !important; margin-bottom: 8px; }
  .xpg { border-radius: var(--r) !important; margin: 0 0 8px; justify-content: center; }
}

/* ---------- 8. CHARTS ---------- */
.ch { width: 100%; height: auto; display: block; overflow: visible; }
.ch-grid { stroke: var(--bd); stroke-width: 1; stroke-dasharray: 3 4; }
.ch-ax { fill: var(--mu); font-size: 11px; font-weight: 600; font-family: var(--fs) !important; }
.ch-line { stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.ch-dot { fill: var(--card); stroke-width: 2.2; }
.ch-bar { transition: opacity .15s; } .ch-bar:hover { opacity: .78; }
.ch-track { stroke: var(--xrn); }
.ch-donut { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: center; }
.ch-dn { width: 168px; height: 168px; flex: none; }
.ch-c1 { fill: var(--tx-h); font-size: 24px; font-weight: 800; font-family: var(--fs) !important; } .ch-c2 { fill: var(--mu); font-size: 11px; font-weight: 700; font-family: var(--fs) !important; }
.ch-lg { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; flex: 1; min-width: 150px; }
.ch-donut .ch-lg { margin: 0; }
.ch-lg li { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; min-width: 0; }
.ch-lg li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--tx-m); }
.ch-lg li b { color: var(--tx-h); font-variant-numeric: tabular-nums; }
.ch-lg li i { width: 10px; height: 10px; border-radius: 4px; flex: none; }
.ch-lg-row { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; }
.ch-lg-row li { flex: none; }
.ch-sp { width: 100%; height: 34px; display: block; }
.ch-empty { color: var(--mu); text-align: center; padding: 28px 12px; font-weight: 600; font-size: 13.5px; }
.ch-hb { display: grid; gap: 12px; }
.ch-hl { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; font-weight: 700; }
.ch-hl span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; color: var(--tx); }
.ch-hl b { color: var(--tx-h); font-variant-numeric: tabular-nums; flex: none; }
.ch-ht { height: 9px; border-radius: 999px; background: var(--xrn); overflow: hidden; margin-top: 5px; }
.ch-ht i { display: block; height: 100%; border-radius: 999px; }
.ch-hr small { color: var(--mu); font-size: 12px; font-weight: 600; }

/* ---------- 9. REPORTS ---------- */
.rp { display: grid; gap: 14px; }
.rp-head { position: relative; overflow: hidden; background: var(--grad-hero); color: #fff; border-radius: var(--r3); padding: 20px 22px; box-shadow: 0 26px 54px -26px rgba(6, 26, 61, .75); }
.rp-head::after { content: ""; position: absolute; right: -70px; top: -90px; width: 260px; height: 260px; border-radius: 50%; background: rgba(255, 255, 255, .07); pointer-events: none; }
.rp-head h2 { margin: 0; color: #fff; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.rp-head h2::before { display: none !important; }
.rp-head p { margin: 4px 0 0; color: rgba(255, 255, 255, .75); font-size: 13.5px; font-weight: 600; }
.rp-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-top: 16px; position: relative; z-index: 1; }
.rp-per { display: flex; gap: 6px; flex-wrap: wrap; }
.rp-per button, .rp-act button { border: 1px solid rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .12); color: #fff; font-weight: 700; font-size: 13px; padding: 8px 14px; border-radius: 999px; cursor: pointer; min-height: 38px; }
.rp-per button.on { background: #fff; color: #0b3a82; border-color: #fff; }
.rp-per button:hover:not(.on), .rp-act button:hover { background: rgba(255, 255, 255, .24); }
.rp-act { display: flex; gap: 8px; flex-wrap: wrap; }
.rp-act .pri { background: #fff; color: #0b3a82; border-color: #fff; }
.rp-dates { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; position: relative; z-index: 1; }
.rp-dates label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: rgba(255, 255, 255, .8); }
.rp-dates input { background: rgba(255, 255, 255, .14) !important; color: #fff !important; border: 1px solid rgba(255, 255, 255, .28) !important; padding: 8px 10px !important; font-size: 14px !important; border-radius: 10px !important; color-scheme: dark; min-width: 0; }
.rp-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.rp-tabs::-webkit-scrollbar { display: none; }
.rp-tabs button { flex: none; border: 1px solid var(--bd); background: var(--card); color: var(--tx-m); font-weight: 700; font-size: 13.5px; padding: 9px 16px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.rp-tabs button.on { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 10px 20px -10px rgba(11, 58, 130, .65); }
.rp-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.rp-c4 { grid-column: span 4; } .rp-c5 { grid-column: span 5; } .rp-c6 { grid-column: span 6; } .rp-c7 { grid-column: span 7; } .rp-c8 { grid-column: span 8; } .rp-c12 { grid-column: span 12; }
@media (max-width: 1000px) { .rp-c4, .rp-c5, .rp-c6, .rp-c7, .rp-c8 { grid-column: span 12; } }
.rp-card { background: var(--card); border: 1px solid var(--bd); border-radius: var(--r2); box-shadow: var(--sh1); min-width: 0; overflow: hidden; }
.rp-card > header, .rp-d > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px 0; }
.rp-card h3, .rp-d summary h3 { margin: 0; font-size: 15px; font-weight: 800; letter-spacing: -.01em; color: var(--tx-h); }
.rp-card header small, .rp-d summary small { color: var(--mu); font-weight: 600; font-size: 12px; }
.rp-body { padding: 12px 18px 18px; min-width: 0; }
.rp-body.flush { padding: 8px 0 0; }
.rp-d > summary { cursor: pointer; list-style: none; padding-bottom: 14px; }
.rp-d > summary::-webkit-details-marker { display: none; }
.rp-d > summary::after { content: "▾"; color: var(--mu); transition: transform .2s; }
.rp-d[open] > summary::after { transform: rotate(180deg); }
.rp-d[open] > summary { padding-bottom: 0; }
/* profit & loss statement */
.pl { display: grid; }
.pl-r { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--xgrid); font-size: 14px; }
.pl-r span:first-child { min-width: 0; color: var(--tx-m); font-weight: 600; }
.pl-r.s span:first-child { padding-left: 14px; color: var(--mu); }
.pl-r.h { font-weight: 800; } .pl-r.h span:first-child { color: var(--tx-h); }
.pl-r b, .pl-r .amt { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--tx-h); white-space: nowrap; }
.pl-r.t { border: 0; border-radius: 12px; background: var(--okl); padding: 12px 14px; margin-top: 8px; font-size: 15.5px; } .pl-r.t.neg { background: var(--rdl); }
.pl-r.t span:first-child { color: var(--tx-h); font-weight: 800; }
.pos { color: var(--ok) !important; } .neg2 { color: var(--bad) !important; }
.rp-sum { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.rp-pill { background: var(--acl); color: var(--act); border-radius: 999px; padding: 5px 12px; font-size: 12.5px; font-weight: 800; }
.rp-state { text-align: center; padding: 50px 16px; color: var(--mu); font-weight: 700; }
.rp-state .sp { width: 34px; height: 34px; border: 3px solid var(--bd); border-top-color: var(--ac); border-radius: 50%; margin: 0 auto 12px; animation: rpspin .8s linear infinite; }
@keyframes rpspin { to { transform: rotate(360deg); } }
.rp-card, .rp-d { content-visibility: auto; contain-intrinsic-size: auto 260px; }
@media (max-width: 640px) {
  .rp-head { padding: 16px; border-radius: 20px; } .rp-head h2 { font-size: 19px; }
  .rp-bar { margin-top: 12px; } .rp-act { width: 100%; } .rp-act button { flex: 1; }
  .rp-per { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; width: 100%; } .rp-per::-webkit-scrollbar { display: none; } .rp-per button { flex: none; }
  .rp-dates { display: grid; grid-template-columns: 1fr 1fr; } .rp-dates label { flex-direction: column; align-items: stretch; gap: 3px; }
  .rp-body { padding: 10px 14px 14px; } .rp-card > header, .rp-d > summary { padding: 12px 14px 0; }
  .ch-dn { width: 150px; height: 150px; }
  .hide-sm { display: none !important; }
}
@media (min-width: 641px) { .only-sm { display: none !important; } }

/* ---------- 10. MOBILE-COMPACT: only what matters on a phone ---------- */
@media (max-width: 640px) {
  #app { padding: 12px 12px 24px !important; }
  .card { padding: 12px 14px; border-radius: 16px !important; }
  .c-hide-sm, .xk { display: none !important; }
  .app-footer {
    display: flex !important;
    position: static !important;
    width: 100% !important;
    margin: 20px 0 0 0 !important;
    padding: 12px 10px calc(env(safe-area-inset-bottom, 0px) + 72px) !important;
  }
  h2 { font-size: 17px; margin: 14px 0 8px; }
  .xtabs { margin: 0 -12px; padding-left: 12px !important; padding-right: 12px !important; }
  .grid { gap: 10px; }
  .big { padding: 14px; font-size: 15.5px; }
  .xtwo { grid-template-columns: 1fr !important; }
  input, select, textarea { font-size: 16px !important; } /* no iOS zoom */
  #m .sheet { border-radius: 24px 24px 0 0; max-height: 92%; }
}
@media (max-width: 380px) { .kpis { gap: 8px; } .kc { padding: 12px; } }

/* ---------- 11. PRINT ---------- */
@media print {
  body { background: #fff !important; color: #000; }
  .rp-head { background: #fff !important; color: #000; box-shadow: none; border: 1px solid #ccc; } .rp-head h2, .rp-head p { color: #000 !important; }
  .rp-per, .rp-act, .rp-dates, .rp-tabs { display: none !important; }
  .rp-card, .kc { box-shadow: none !important; break-inside: avoid; border: 1px solid #ccc; } .kc.hi { background: #fff !important; color: #000; } .kc.hi .kc-v, .kc.hi .kc-t small { color: #000 !important; }
  .rp-d { display: block; } .rp-d > summary::after { display: none; }
  .rp-d:not([open]) > .rp-body { display: block !important; }
  .xlw, .tw { max-height: none !important; overflow: visible !important; }
  table.xl thead th { position: static; } .mr-b, td.mr-t { display: none !important; }
  body.prx #rcp .rxp { background: #ffffff !important; color: #0f172a !important; max-width: none !important; margin: 0 !important; }
  body.prx #rcp .rxp * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
}

/* readable lab panel results inside table cells */
.res-pn { display: grid; gap: 3px; min-width: 150px; white-space: normal; }
.res-ln { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; line-height: 1.35; }
.res-ln span { color: var(--mu); font-weight: 600; } .res-ln b { color: var(--tx-h); font-weight: 700; text-align: right; }
.res-ln.ab b { color: var(--bad); } .res-more { color: var(--act); font-weight: 700; font-size: 11.5px; }

/* ---------- help button + tutorials (open only on request) ---------- */
#help-fab { position: fixed; right: 16px; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); z-index: 30; width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer; background: var(--grad); color: #fff; font-size: 21px; font-weight: 800; box-shadow: 0 14px 30px -10px rgba(11, 47, 107, .75); display: grid; place-items: center; transition: transform .15s; }
#help-fab:hover { transform: scale(1.08); } #help-fab span { font-family: var(--fs) !important; line-height: 1; }
@media (min-width: 960px) { #help-fab { bottom: 54px !important; right: 26px !important; width: 50px; height: 50px; } }

/* animated spotlight tour */
.tt-layer { position: fixed; inset: 0; z-index: 90; background: rgba(6, 26, 61, .6); opacity: 0; transition: opacity .25s; -webkit-backdrop-filter: blur(1.5px); backdrop-filter: blur(1.5px); }
.tt-layer.on { opacity: 1; } .tt-layer.sp { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
.tt-block { position: absolute; inset: 0; }
.tt-spot { position: fixed; border-radius: 16px; pointer-events: none; opacity: 0; box-shadow: 0 0 0 9999px rgba(6, 26, 61, .62), 0 0 0 3px #12a06b, 0 0 28px 6px rgba(18, 160, 107, .45); transition: left .5s cubic-bezier(.4, 0, .2, 1), top .5s cubic-bezier(.4, 0, .2, 1), width .5s cubic-bezier(.4, 0, .2, 1), height .5s cubic-bezier(.4, 0, .2, 1), opacity .3s; }
.tt-spot.show { opacity: 1; }
.tt-spot::after { content: ""; position: absolute; inset: -3px; border-radius: 18px; border: 3px solid #1d4fb3; animation: ttpulse 1.6s ease-out infinite; }
@keyframes ttpulse { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(1.12); opacity: 0; } }
.tt-ptr { position: fixed; width: 0; height: 0; pointer-events: none; opacity: 0; z-index: 2; transform: translate(70px, 90px); transition: left .5s cubic-bezier(.4, 0, .2, 1), top .5s cubic-bezier(.4, 0, .2, 1); }
.tt-ptr svg { position: absolute; width: 34px; height: 34px; left: -6px; top: -4px; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .4)); transition: transform .2s; }
.tt-ptr.show { opacity: 1; transform: none; animation: ttland .7s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes ttland { from { opacity: 0; transform: translate(80px, 100px) rotate(8deg); } to { opacity: 1; transform: none; } }
.tt-ptr.tap svg { animation: tttap .5s ease-in-out 2; }
@keyframes tttap { 50% { transform: scale(.82) translate(2px, 3px); } }
.tt-ptr i { position: absolute; left: -16px; top: -16px; width: 32px; height: 32px; border-radius: 50%; background: rgba(18, 160, 107, .4); opacity: 0; }
.tt-ptr.tap i { animation: ttrip .9s ease-out 2; } @keyframes ttrip { 0% { transform: scale(.3); opacity: .9; } 100% { transform: scale(2.4); opacity: 0; } }
.tt-pop { position: fixed; max-width: calc(100vw - 24px); background: var(--card); color: var(--tx); border: 1px solid var(--bd); border-radius: 22px; padding: 16px 18px 14px; box-shadow: 0 30px 70px -20px rgba(6, 26, 61, .7); opacity: 0; transform: translateY(14px) scale(.97); transition: opacity .3s, transform .3s, left .5s cubic-bezier(.4, 0, .2, 1), top .5s cubic-bezier(.4, 0, .2, 1); max-height: calc(100vh - 24px); overflow: auto; z-index: 3; }
.tt-pop.show { opacity: 1; transform: none; }
.tt-pop.center { left: 50% !important; top: 50% !important; width: min(430px, calc(100vw - 24px)) !important; transform: translate(-50%, -48%) scale(.97); } .tt-pop.center.show { transform: translate(-50%, -50%); }
.tt-h { display: flex; align-items: center; gap: 12px; } .tt-h > div { flex: 1; min-width: 0; } .tt-h b { display: block; font-size: 16px; font-weight: 800; } .tt-h small { color: var(--mu); font-weight: 600; font-size: 12px; }
.tt-i { width: 42px; height: 42px; border-radius: 14px; background: var(--grad); display: grid; place-items: center; font-size: 21px; flex: none; animation: ttbob 2.2s ease-in-out infinite; } @keyframes ttbob { 50% { transform: translateY(-3px) rotate(-4deg); } }
.tt-x { border: 0; background: var(--xrn); color: var(--mu); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 14px; }
.tt-bar { height: 5px; background: var(--xrn); border-radius: 99px; margin: 12px 0 2px; overflow: hidden; } .tt-bar i { display: block; height: 100%; background: var(--grad); border-radius: 99px; animation: ttbar .6s ease-out; } @keyframes ttbar { from { width: 0; } }
.tt-b { margin: 10px 0 8px; animation: ttin .4s ease-out; } @keyframes ttin { from { opacity: 0; transform: translateY(8px); } }
.tt-n { font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ac); }
.tt-b h4 { margin: 4px 0 6px; font-size: 18px; font-weight: 800; } .tt-b p { margin: 0; color: var(--tx-m); font-size: 14.5px; line-height: 1.55; }
.tt-tip { margin-top: 12px; background: var(--yll); color: var(--tx); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; font-weight: 600; }
.tt-f { display: flex; align-items: center; gap: 8px; margin-top: 4px; } .tt-f span { flex: 1; }
.tt-f button { border: 1.5px solid var(--bd); background: var(--card); color: var(--tx); border-radius: 12px; padding: 9px 15px; font-weight: 700; cursor: pointer; font-size: 14px; min-height: 42px; }
.tt-f button.pri { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 10px 20px -10px rgba(11, 47, 107, .7); } .tt-f .tt-l { border: 0; background: none; font-size: 18px; padding: 8px; }
.tt-list { display: grid; gap: 8px; margin-top: 14px; max-height: 52vh; overflow: auto; }
.tt-list button { display: flex; align-items: center; gap: 12px; text-align: left; border: 1px solid var(--bd); background: var(--card); color: var(--tx); border-radius: 14px; padding: 10px 12px; cursor: pointer; transition: transform .15s, background .15s; }
.tt-list button:hover { background: var(--acl); transform: translateX(3px); } .tt-list span { font-size: 22px; } .tt-list div { flex: 1; } .tt-list b { display: block; font-size: 14.5px; } .tt-list small { color: var(--mu); font-weight: 600; } .tt-list em { color: var(--ac); font-style: normal; font-size: 13px; }

/* one font everywhere (Inter): forms, tables, charts, print */
html, body, button, input, select, textarea, table, th, td, svg text { font-family: var(--fs) !important; }
input, select, textarea, button { font-size: max(1em, 15px); }
table.xl, .kc-v, .pl-r .amt, .ch-ax { font-variant-numeric: tabular-nums; }
.kc-v, .kc.hi .kc-v { font-weight: 800; letter-spacing: -.025em; }
input[type="date"], input[type="datetime-local"], input[type="time"], input[type="month"], .lab-print-page, .lab-print-page * { font-family: var(--fs) !important; }

/* =====================================================================
   SIMPLE, CLEAN & POWERFUL LOGIN SYSTEM
   ===================================================================== */
body.authing {
  background: var(--bg) !important;
  min-height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  overflow-x: hidden !important;
}

body.authing .shell {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 100vh !important;
  width: 100% !important;
  padding: 24px 16px !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  position: relative !important;
}

body.authing #hero,
body.authing #side {
  display: none !important;
}

body.authing .app-footer {
  display: none !important;
}

body.authing #topbar {
  position: fixed !important;
  top: 14px !important;
  right: 18px !important;
  left: auto !important;
  height: auto !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  z-index: 50 !important;
  display: flex !important;
}
body.authing #topbar #back,
body.authing #topbar .tt,
body.authing #topbar #topsearch,
body.authing #topbar #act,
body.authing #topbar #rfw,
body.authing #topbar #bellw {
  display: none !important;
}
body.authing #topbar #tg {
  display: flex !important;
}

body.authing .content {
  margin: 0 !important;
  width: 100% !important;
  max-width: 440px !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
}

body.authing #app {
  width: 100% !important;
  max-width: 440px !important;
  padding: 0 !important;
  margin: 0 auto !important;
  min-height: auto !important;
  box-sizing: border-box !important;
}

/* Modern Simple Login Card */
.auth.pro {
  width: 100% !important;
  max-width: 430px !important;
  padding: 36px 30px 26px !important;
  border-radius: 24px !important;
  background: var(--card) !important;
  border: 1px solid var(--bd) !important;
  box-shadow: 0 20px 45px -15px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(15, 23, 42, 0.04) !important;
  position: relative !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
  margin: 0 auto !important;
}
:root[data-theme="dark"] .auth.pro {
  background: #111827 !important;
  border: 1px solid #1e293b !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6) !important;
}
.auth.pro::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--ac), #2563eb);
}
.ap-head {
  text-align: center;
  margin-bottom: 24px;
}
.auth.pro .logo.auth-logo-box {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 32px;
  background: var(--acl, #e8f5e9);
  color: var(--act, #107c41);
  box-shadow: 0 8px 20px -6px rgba(16, 124, 65, 0.25);
  overflow: hidden;
  padding: 0;
}
.auth.pro .logo.auth-logo-box img {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  background: #fff;
  border-radius: 0;
  margin: 0;
  padding: 6px;
}
.auth.pro h1 {
  margin: 0;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--tx-h, #0f172a);
  text-align: center;
}
:root[data-theme="dark"] .auth.pro h1 {
  color: #f8fafc !important;
}
.ap-head p {
  margin: 5px 0 0;
  color: var(--mu, #64748b);
  font-size: 13.5px;
  font-weight: 500;
}
.ap-f {
  margin-bottom: 16px;
}
.ap-f label {
  display: block;
  margin: 0 0 6px 2px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .01em;
  color: var(--tx, #0f172a);
}
:root[data-theme="dark"] .ap-f label {
  color: #e2e8f0 !important;
}
.ap-in {
  position: relative;
  display: flex;
  align-items: center;
}
.ap-in > i {
  position: absolute;
  left: 14px;
  width: 20px;
  height: 20px;
  color: var(--mu, #64748b);
  pointer-events: none;
  display: grid;
  place-items: center;
  transition: color .15s;
}
.ap-in > i svg {
  width: 20px;
  height: 20px;
}
.ap-in input {
  width: 100% !important;
  height: 50px !important;
  padding: 0 46px 0 46px !important;
  font-size: 15.5px !important;
  font-weight: 600 !important;
  border-radius: 12px !important;
  border: 1.5px solid var(--bd) !important;
  background: var(--bg) !important;
  color: var(--tx) !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
#a_pw {
  letter-spacing: .18em;
}
#a_pw::placeholder, #a_sid::placeholder {
  letter-spacing: 0;
  font-weight: 500;
  color: var(--mu);
}
.ap-in input:focus {
  background: var(--card) !important;
  border-color: var(--ac) !important;
  box-shadow: 0 0 0 3px rgba(16, 124, 65, 0.15) !important;
  outline: 0;
}
.ap-in:focus-within > i {
  color: var(--ac);
}
.ap-eye {
  position: absolute;
  right: 6px;
  width: 40px;
  height: 40px;
  border: 0;
  background: none;
  color: var(--mu);
  border-radius: 12px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.ap-eye svg {
  width: 20px;
  height: 20px;
}
.ap-eye:hover {
  background: var(--acl);
  color: var(--act);
}
.ap-eye.on {
  color: var(--ac);
}
.ap-caps {
  display: block;
  min-height: 16px;
  margin: 5px 2px 0;
  color: var(--warn);
  font-size: 12px;
  font-weight: 700;
}
.big.ap-go {
  width: 100% !important;
  height: 50px !important;
  margin-top: 10px !important;
  border-radius: 12px !important;
  font-size: 15.5px !important;
  font-weight: 700 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  background: var(--ac) !important;
  color: #ffffff !important;
  box-shadow: 0 6px 18px -4px rgba(16, 124, 65, 0.4) !important;
  cursor: pointer !important;
  transition: transform .15s, box-shadow .15s, filter .15s;
}
.ap-go svg {
  width: 20px;
  height: 20px;
  transition: transform .2s;
}
@media (hover: hover) {
  .ap-go:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
  }
  .ap-go:hover svg {
    transform: translateX(4px);
  }
}
.ap-go:active {
  transform: scale(.98);
}
.ap-go.busy {
  pointer-events: none;
  opacity: .85;
}
.ap-go.busy svg {
  display: none;
}
.ap-go.busy::after {
  content: "";
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: rpspin .7s linear infinite;
}
.ap-dev-by {
  margin-top: 18px;
  text-align: center;
  font-size: 12.5px;
  color: var(--mu, #64748b);
  letter-spacing: 0.2px;
  font-weight: 500;
  user-select: none;
}
.ap-dev-by b {
  color: #107c41;
  font-weight: 800;
  letter-spacing: 0.3px;
}
:root[data-theme="dark"] .ap-dev-by {
  color: #94a3b8;
}
:root[data-theme="dark"] .ap-dev-by b {
  color: #4ade80;
}
.ap-foot {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px dashed var(--bd);
  text-align: center;
  color: var(--mu);
  font-size: 12px;
  font-weight: 600;
}
.ap-sec-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.ap-dev-credit {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--bd, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: #1e293b;
}
.ap-dev-credit .app-footer-badge {
  display: inline-block !important;
  background: var(--acl, #e8f5e9) !important;
  color: var(--act, #107c41) !important;
  font-weight: 800 !important;
  font-size: 11px !important;
  padding: 2px 8px !important;
  border-radius: 6px !important;
  border: 1px solid rgba(16, 124, 65, 0.2) !important;
}
.ap-dev-credit .app-footer-sep {
  color: var(--bd, #cbd5e1);
  font-weight: bold;
}
.ap-dev-credit .app-footer-author {
  color: #107c41 !important;
  font-weight: 800 !important;
  letter-spacing: 0.3px !important;
  display: inline-block !important;
}
:root[data-theme="dark"] .ap-dev-credit {
  color: #f1f5f9;
  border-top-color: #262626;
}
:root[data-theme="dark"] .ap-dev-credit .app-footer-author {
  color: #4ade80 !important;
  font-weight: 800 !important;
}
@media (max-width: 480px) {
  .auth.pro {
    padding: 26px 20px 20px !important;
    border-radius: 20px !important;
  }
  .auth.pro h1 {
    font-size: 19px !important;
  }
}

@media (max-width: 480px) { .card .item:has(> .ib ~ .ib) { flex-wrap: wrap; } .card .item:has(> .ib ~ .ib) .nm { flex: 1 1 100%; } }

/* ---------- doctor's diagnosis drop-down ---------- */
.dxp-in { position: relative; display: flex; } .dxp-in input { flex: 1; padding-right: 52px !important; height: 48px; font-weight: 600; }
.dxp-b { position: absolute; right: 5px; top: 5px; width: 38px; height: 38px; border: 0; border-radius: 10px; background: var(--acl); color: var(--act); font-size: 17px; font-weight: 800; cursor: pointer; }
.dxp-sel { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; } .dxp-sel:empty { display: none; }
.dxp-chip { display: inline-flex; align-items: center; gap: 8px; background: var(--grad); color: #fff; border-radius: 999px; padding: 6px 8px 6px 13px; font-size: 13.5px; font-weight: 700; }
.dxp-chip b { width: 20px; height: 20px; border-radius: 50%; background: rgba(255, 255, 255, .25); display: grid; place-items: center; font-size: 10px; cursor: pointer; }
.dxp-panel { position: fixed; z-index: 10005 !important; background: var(--card); border: 1.5px solid var(--ac); border-radius: 16px; box-shadow: 0 24px 60px -16px rgba(6, 26, 61, .55); display: flex; flex-direction: column; overflow: hidden; }
.dxp-list { overflow-y: auto; overscroll-behavior: contain; flex: 1; -webkit-overflow-scrolling: touch; }
.dxp-h { position: sticky; top: 0; background: var(--xhd); color: var(--mu); font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 7px 14px; border-bottom: 1px solid var(--bd); z-index: 1; }
.dxp-i { display: flex; align-items: center; gap: 10px; padding: 11px 14px; cursor: pointer; border-bottom: 1px solid var(--xgrid); min-height: 46px; }
.dxp-i .nm { flex: 1; font-weight: 600; font-size: 14.5px; min-width: 0; } .dxp-i em { font-style: normal; font-size: 11px; color: var(--mu); font-weight: 700; flex: none; }
.dxp-i .ck { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--bd); display: grid; place-items: center; font-size: 13px; font-weight: 800; color: #fff; flex: none; }
.dxp-i.on .ck { background: var(--ac); border-color: var(--ac); } .dxp-i.on { background: var(--acl); }
.dxp-i:hover, .dxp-i.hi { background: var(--acl); } .dxp-i.cu { color: var(--act); }
.dxp-done { border: 0; border-top: 1px solid var(--bd); background: var(--grad); color: #fff; font-weight: 800; font-size: 14.5px; height: 46px; cursor: pointer; flex: none; }
/* DB picker in Settings */
.dbp-l { max-height: 52vh; overflow-y: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--bd); border-radius: 12px; }
.dbp-cat { position: sticky; top: 0; background: var(--xhd); font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--mu); padding: 7px 12px; border-bottom: 1px solid var(--bd); } .dbp-cat span { float: right; }
.dbp-row { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-bottom: 1px solid var(--xgrid); cursor: pointer; font-weight: 600; font-size: 14px; } .dbp-row input { width: 20px; height: 20px; flex: none; } .dbp-row span { flex: 1; } .dbp-row em { font-style: normal; color: var(--ok); font-size: 11.5px; font-weight: 800; } .dbp-row.in { opacity: .6; }

/* ---- phone: lists must always scroll with the page (old rules turned the list box into a scroll trap) ---- */
@media (max-width: 640px) {
  .xlw, .tw, #lst, #lst > .xlw, .sheet .xlw { overflow: visible !important; max-height: none !important; height: auto !important; touch-action: auto !important; overscroll-behavior: auto !important; -webkit-overflow-scrolling: auto !important; }
  .xpg { position: static; flex-direction: column; gap: 8px; text-align: center; }
  .xpg > div { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
  .xpg button { min-width: 42px; height: 42px; font-size: 15px; }
  .xpg-b { margin: 4px 0 18px; }
  #app { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)) !important; }
}

/* lab result drop-down */
.lab-sel { flex: 1; min-width: 0; width: 100%; height: 38px; border: 1.5px solid var(--ac) !important; border-radius: 8px !important; font-weight: 700; font-size: 14.5px; padding: 0 8px; background: var(--card) !important; color: var(--tx) !important; }
.lab-sel + input.lab-f { margin-top: 6px; }
.xs-fl:empty { display: none; }
@media (max-width: 640px) {
  .lab-row { grid-template-columns: 1fr !important; gap: 10px !important; }
  .lab-row > div { padding: 0 !important; }
  .lab-row .lab-sel, .lab-row input.lab-f { height: 46px !important; font-size: 16px !important; }
  .lab-row .seg.lfl button { padding: 10px 2px !important; font-size: 12.5px !important; }
  .lab-row input[id^="u_"], .lab-row input[id^="n_"] { height: 38px !important; font-size: 14px !important; }
  .lab-panel-box td .lab-sel, .lab-panel-box td input.lab-f { min-width: 130px; }
}

/* lab editor: full-screen parameter table */
.ct-pbox.ct-full { position: fixed !important; inset: 0; z-index: 99; background: var(--card); padding: 14px 18px calc(14px + env(safe-area-inset-bottom, 0px)); display: flex !important; flex-direction: column; margin: 0 !important; overflow: hidden; }
.ct-pbox.ct-full .ct-ptable { flex: 1; min-height: 0; max-height: none !important; overflow: auto; }
.ct-pbox.ct-full .ct-presets { display: none; }
.ct-pbox.ct-full .set-test-table thead th { position: sticky; top: 0; z-index: 2; background: var(--xhd); }
.ct-ptable table { min-width: 1080px; }
@media (max-width: 640px) { .ct-ptable table.tbl-pro { min-width: 0; } }

.tpl-act { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; min-width: 270px; }
.ct-ptable td:nth-child(2) input.sp-name { min-width: 270px; } .ct-ptable td:nth-child(4) input.sp-rf { min-width: 150px; }
@media (max-width: 640px) { .tpl-act { min-width: 0; justify-content: flex-start; } .ct-ptable td:nth-child(2) input.sp-name { min-width: 0; } }

/* ---------- lab test editor (panel only) ---------- */
.ct-wrap { max-width: 1240px; margin: 0 auto; }
.ct-head { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1.5px solid var(--bd); }
.ct-head h3 { margin: 0; font-size: 17px; font-weight: 800; } .ct-head small { color: var(--mu); font-size: 12.5px; display: block; }
.ct-ic { width: 42px; height: 42px; border-radius: 12px; background: var(--acl); display: grid; place-items: center; font-size: 22px; flex: none; }
.ct-x { border: 0; background: var(--xrn); color: var(--mu); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; flex: none; }
.ct-top { display: grid; grid-template-columns: 2fr 1.4fr 1fr; gap: 12px; margin-bottom: 16px; }
.ct-top label { display: block; font-size: 12.5px; font-weight: 700; margin-bottom: 5px; color: var(--tx-m); }
.ct-top input { width: 100%; height: 46px; box-sizing: border-box; font-weight: 600; }
.ct-lnk { display: inline-block; margin-top: 5px; font-size: 12px; font-weight: 700; color: var(--act); text-decoration: none; }
.ct-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.ct-btns { display: flex; gap: 6px; flex-wrap: wrap; } .ct-btns .xb { height: 36px; padding: 0 12px; font-weight: 700; font-size: 12.5px; }
.ct-ptable { overflow: auto; border: 1px solid var(--bd); border-radius: 10px; background: var(--card); max-height: 52vh; -webkit-overflow-scrolling: touch; }
.ct-ptable table { min-width: 1180px; }
.ct-ptable td { padding: 4px 5px !important; }
.ct-ptable input[type="text"] { width: 100%; height: 34px; border: 1px solid var(--bd) !important; border-radius: 6px !important; padding: 0 8px !important; box-sizing: border-box; font-size: 13px !important; background: var(--bg) !important; }
.ct-ch { display: flex; gap: 4px; } .ct-ch .sp-opts { flex: 1; min-width: 0; } .ct-ch .sp-pre { width: 38px; height: 34px; border: 1px solid var(--bd) !important; border-radius: 6px !important; background: var(--bg) !important; color: var(--tx); padding: 0 !important; }
.ct-fl { display: flex; gap: 6px; } .ct-fl label { display: flex; flex-direction: column; align-items: center; font-size: 10.5px; font-weight: 700; color: var(--mu); cursor: pointer; } .ct-fl input { width: 16px; height: 16px; margin: 0; }
.ct-acts { display: flex; gap: 4px; justify-content: flex-end; } .ct-acts button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--bd); background: var(--card); color: var(--tx); cursor: pointer; font-weight: 800; padding: 0; }
.ct-acts button.d { color: var(--rdt); background: var(--rdl); border-color: transparent; }
.ct-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--bd); flex-wrap: wrap; }
.ct-bulk { background: var(--bg); border: 1px solid var(--bd); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; display: grid; gap: 8px; }
.ct-bulk textarea { width: 100%; box-sizing: border-box; font-family: ui-monospace, Menlo, Consolas, monospace !important; font-size: 13px; padding: 8px; border-radius: 8px; }
.dp-add { display: flex; gap: 8px; margin-bottom: 12px; } .dp-add input { flex: 1; height: 46px; }
.tpl-act button:disabled { opacity: .35; }
@media (max-width: 760px) { .ct-top { grid-template-columns: 1fr; } .ct-ptable { max-height: none; overflow: visible; border: 0; background: transparent; } .ct-ptable table.tbl-pro { min-width: 0; } .ct-acts button { width: 40px; height: 40px; } .ct-btns .xb { flex: 1 1 auto; } }

/* Doctor Examination Step-by-Step Navigation & High-Contrast Visuals */
.doc-exam-steps-nav {
  display: flex;
  gap: 8px;
  max-width: 1100px;
  margin: 0 auto 14px auto;
  overflow-x: auto;
  padding: 4px 2px;
  -webkit-overflow-scrolling: touch;
}
.exam-step-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 20px;
  background: var(--card, #fff);
  border: 1.5px solid var(--bd, #cbd5e1);
  color: var(--tx, #1e293b);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  cursor: pointer;
  transition: all .15s ease;
}
.exam-step-pill .step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ac, #0f8a5f);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: inline-grid;
  place-content: center;
}
.exam-step-pill .pill-cnt {
  background: var(--acl, rgba(15,138,95,0.15));
  color: var(--act, #0f8a5f);
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 10px;
}
.exam-step-pill:hover {
  border-color: var(--ac, #0f8a5f);
  color: var(--ac, #0f8a5f);
  transform: translateY(-1px);
}
.doc-step-badge {
  display: inline-grid;
  place-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--ac, #0f8a5f);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  flex: none;
}
:root[data-theme="dark"] .doc-step-badge {
  background: #ffffff !important;
  color: #000000 !important;
}
:root[data-theme="dark"] .exam-step-pill {
  background: #0a0a0a !important;
  border-color: #262626 !important;
  color: #ededed !important;
}
:root[data-theme="dark"] .exam-step-pill:hover {
  border-color: #525252 !important;
  color: #ffffff !important;
}
:root[data-theme="dark"] .exam-step-pill .step-num {
  background: #ffffff !important;
  color: #000000 !important;
}
:root[data-theme="dark"] .exam-step-pill .pill-cnt {
  background: #171717 !important;
  color: #ffffff !important;
  border: 1px solid #333333 !important;
}

/* Lab test card checkboxes & selection visibility in Light and Dark themes */
.lab-row.on {
  background: var(--acl, rgba(15, 138, 95, 0.12)) !important;
  box-shadow: inset 4px 0 0 var(--ac, #0f8a5f) !important;
}
.lab-check-box {
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
:root[data-theme="dark"] .lab-row {
  background: #0a0a0a !important;
  border-color: #262626 !important;
}
:root[data-theme="dark"] .lab-row:hover {
  background: #121212 !important;
  border-color: #383838 !important;
}
:root[data-theme="dark"] .lab-check-box {
  border-color: #333333 !important;
  background: #000000 !important;
}
:root[data-theme="dark"] .lab-row.on {
  background: #141414 !important;
  border-color: #525252 !important;
  box-shadow: inset 4px 0 0 #ffffff !important;
}
:root[data-theme="dark"] .lab-row.on .lab-check-box {
  background: #ffffff !important;
  border-color: #ffffff !important;
}
:root[data-theme="dark"] .lab-row.on .lab-check-box svg path {
  stroke: #000000 !important;
}

/* =====================================================================
   NEXT.JS / VERCEL INSPIRED MONOCHROME BLACK & WHITE THEME SUITE
   - Pitch black (#000000) canvas with elevated dark (#0a0a0a/#121212) cards
   - Subtle dark borders (#262626/#333333) with zero muddy navy blue tones
   - Crisp white primary call-to-actions with solid high contrast
   - Neutral monochrome typography & state accents
   ===================================================================== */
:root[data-theme="dark"] #topbar {
  background: rgba(0, 0, 0, 0.88) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  backdrop-filter: blur(14px) !important;
  border-bottom: 1px solid #262626 !important;
  box-shadow: none !important;
}
:root[data-theme="dark"] #side {
  background: #000000 !important;
  border-right: 1px solid #262626 !important;
  box-shadow: none !important;
}
:root[data-theme="dark"] #side .brand {
  border-bottom: 1px solid #262626 !important;
  color: #ffffff !important;
}
:root[data-theme="dark"] nav {
  background: #000000 !important;
  border-top: 1px solid #262626 !important;
  box-shadow: none !important;
}
:root[data-theme="dark"] #side nav button,
:root[data-theme="dark"] nav button {
  color: #94a3b8 !important;
}
:root[data-theme="dark"] #side nav button span svg,
:root[data-theme="dark"] nav button span svg {
  stroke: #94a3b8 !important;
}
:root[data-theme="dark"] #side nav button:hover,
:root[data-theme="dark"] nav button:hover {
  background: #141414 !important;
  color: #ffffff !important;
}
:root[data-theme="dark"] #side nav button:hover span svg,
:root[data-theme="dark"] nav button:hover span svg {
  stroke: #ffffff !important;
}
:root[data-theme="dark"] #side nav button.on,
:root[data-theme="dark"] nav button.on {
  background: #1a1a1a !important;
  color: #ffffff !important;
  border: 1px solid #333333 !important;
  box-shadow: none !important;
}
:root[data-theme="dark"] #side nav button.on span svg,
:root[data-theme="dark"] nav button.on span svg {
  stroke: #ffffff !important;
}
:root[data-theme="dark"] .logo-m,
:root[data-theme="dark"] #side .brand .logo-m {
  background: #ffffff !important;
  color: #000000 !important;
  box-shadow: 0 1px 8px rgba(255, 255, 255, .15) !important;
}
:root[data-theme="dark"] .logo-m svg,
:root[data-theme="dark"] #side .brand .logo-m svg {
  stroke: #000000 !important;
}
:root[data-theme="dark"] #usr {
  border-top-color: #262626 !important;
}
:root[data-theme="dark"] #usr .ua {
  background: #171717 !important;
  color: #ffffff !important;
  border: 1px solid #333333 !important;
}
:root[data-theme="dark"] #usr .ui b {
  color: #ffffff !important;
}
:root[data-theme="dark"] #usr .ui small,
:root[data-theme="dark"] #usr .lo {
  color: #71717a !important;
}
:root[data-theme="dark"] #usr .lo:hover {
  background: #171717 !important;
  color: #ffffff !important;
}

/* Next.js High-Contrast Buttons */
:root[data-theme="dark"] .big,
:root[data-theme="dark"] body.clinic .big,
:root[data-theme="dark"] body.clinic .pbtn,
:root[data-theme="dark"] .pbtn,
:root[data-theme="dark"] .ib.pr,
:root[data-theme="dark"] .xb.pr,
:root[data-theme="dark"] .xrb .xb.pr,
:root[data-theme="dark"] table.xl td .xb.pr,
:root[data-theme="dark"] .ex-tools .xb.pr,
:root[data-theme="dark"] .ord-block-card .xb.pr,
:root[data-theme="dark"] .lab-go .p,
:root[data-theme="dark"] .ex-finish-btn,
:root[data-theme="dark"] .doc-top-btn.primary,
:root[data-theme="dark"] .dlr-btn-rx {
  background: #ffffff !important;
  color: #000000 !important;
  border: 1px solid #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 3px rgba(255, 255, 255, .12) !important;
}
:root[data-theme="dark"] .big *,
:root[data-theme="dark"] .pbtn *,
:root[data-theme="dark"] .ib.pr *,
:root[data-theme="dark"] .xb.pr *,
:root[data-theme="dark"] .lab-go .p *,
:root[data-theme="dark"] .ex-finish-btn *,
:root[data-theme="dark"] .doc-top-btn.primary * {
  color: #000000 !important;
}
:root[data-theme="dark"] .big:hover,
:root[data-theme="dark"] body.clinic .big:hover,
:root[data-theme="dark"] body.clinic .pbtn:hover,
:root[data-theme="dark"] .pbtn:hover,
:root[data-theme="dark"] .ib.pr:hover,
:root[data-theme="dark"] .xb.pr:hover,
:root[data-theme="dark"] .xrb .xb.pr:hover,
:root[data-theme="dark"] table.xl td .xb.pr:hover,
:root[data-theme="dark"] .ex-tools .xb.pr:hover,
:root[data-theme="dark"] .ord-block-card .xb.pr:hover,
:root[data-theme="dark"] .lab-go .p:hover,
:root[data-theme="dark"] .ex-finish-btn:hover,
:root[data-theme="dark"] .doc-top-btn.primary:hover,
:root[data-theme="dark"] .dlr-btn-rx:hover {
  background: #e5e5e5 !important;
  color: #000000 !important;
  border-color: #e5e5e5 !important;
}
:root[data-theme="dark"] .big.o,
:root[data-theme="dark"] body.clinic .big.o,
:root[data-theme="dark"] .ib:not(.pr),
:root[data-theme="dark"] .xb:not(.pr),
:root[data-theme="dark"] .xrb .xb:not(.pr),
:root[data-theme="dark"] table.xl td .xb:not(.pr),
:root[data-theme="dark"] .ex-xl-table .xb,
:root[data-theme="dark"] .lab-go button:not(.p),
:root[data-theme="dark"] .doc-top-btn:not(.primary),
:root[data-theme="dark"] .doc-catalog-btn,
:root[data-theme="dark"] .ex-chip,
:root[data-theme="dark"] .sheet .cancel,
:root[data-theme="dark"] .dlr-btn:not(.dlr-btn-rx) {
  background: #141414 !important;
  color: #ffffff !important;
  border: 1px solid #333333 !important;
  font-weight: 700 !important;
}
:root[data-theme="dark"] .xb:not(.pr) *,
:root[data-theme="dark"] .doc-top-btn:not(.primary) *,
:root[data-theme="dark"] .doc-catalog-btn *,
:root[data-theme="dark"] .ex-chip * {
  color: #ffffff !important;
}
:root[data-theme="dark"] .big.o:hover,
:root[data-theme="dark"] body.clinic .big.o:hover,
:root[data-theme="dark"] .ib:not(.pr):hover,
:root[data-theme="dark"] .xb:not(.pr):hover,
:root[data-theme="dark"] .xrb .xb:not(.pr):hover,
:root[data-theme="dark"] table.xl td .xb:not(.pr):hover,
:root[data-theme="dark"] .ex-xl-table .xb:hover,
:root[data-theme="dark"] .lab-go button:not(.p):hover,
:root[data-theme="dark"] .doc-top-btn:not(.primary):hover,
:root[data-theme="dark"] .doc-catalog-btn:hover,
:root[data-theme="dark"] .ex-chip:hover,
:root[data-theme="dark"] .sheet .cancel:hover,
:root[data-theme="dark"] .dlr-btn:not(.dlr-btn-rx):hover {
  background: #242424 !important;
  border-color: #555555 !important;
  color: #ffffff !important;
}
:root[data-theme="dark"] .doc-top-bar {
  background: #0a0a0a !important;
  border: 1px solid #262626 !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6) !important;
  color: #ffffff !important;
}
:root[data-theme="dark"] .doc-top-bar h1,
:root[data-theme="dark"] .doc-top-bar span,
:root[data-theme="dark"] .doc-top-bar b {
  color: #ffffff !important;
}
:root[data-theme="dark"] .doc-top-bar .doc-top-sub {
  color: #a1a1aa !important;
}
:root[data-theme="dark"] .doc-catalog-btn .dcb-badge {
  background: #262626 !important;
  color: #ffffff !important;
  border: 1px solid #404040 !important;
}
:root[data-theme="dark"] .doc-catalog-btn.is-active {
  background: #ffffff !important;
  color: #000000 !important;
  border-color: #ffffff !important;
}
:root[data-theme="dark"] .doc-catalog-btn.is-active * {
  color: #000000 !important;
}
:root[data-theme="dark"] .doc-catalog-btn.is-active .dcb-badge {
  background: #000000 !important;
  color: #ffffff !important;
}
:root[data-theme="dark"] table.ex-xl-table td.x button,
:root[data-theme="dark"] .ord-item-row button[title*="Remove"],
:root[data-theme="dark"] .ord-item-row button[onclick*="cOrdDel"] {
  background: #1f1212 !important;
  color: #ef4444 !important;
  border: 1px solid #3b1818 !important;
}
:root[data-theme="dark"] table.ex-xl-table td.x button:hover,
:root[data-theme="dark"] .ord-item-row button[title*="Remove"]:hover,
:root[data-theme="dark"] .ord-item-row button[onclick*="cOrdDel"]:hover {
  background: #2d1818 !important;
  border-color: #ef4444 !important;
  color: #ffffff !important;
}

/* Tabs & Segment Control */
:root[data-theme="dark"] .seg button.on,
:root[data-theme="dark"] .xtabs button.on,
:root[data-theme="dark"] .rp-tabs button.on,
:root[data-theme="dark"] .rp-per button.on {
  background: #ffffff !important;
  color: #000000 !important;
  border-color: #ffffff !important;
  box-shadow: 0 1px 4px rgba(255, 255, 255, .1) !important;
}
:root[data-theme="dark"] .xtabs button.on i {
  background: #000000 !important;
  color: #ffffff !important;
}
:root[data-theme="dark"] .seg button,
:root[data-theme="dark"] .xtabs button,
:root[data-theme="dark"] .rp-tabs button {
  background: #0a0a0a !important;
  border-color: #262626 !important;
  color: #a1a1aa !important;
}
:root[data-theme="dark"] .xtabs button:hover {
  background: #141414 !important;
  color: #ffffff !important;
}

/* =====================================================================
   ALL TABLE FOOTERS, PAGERS & FOOTER BUTTONS (.xpg, .xpg-b, tfoot, .ct-foot)
   Guaranteed visible high-contrast labels across all tables in Dark Theme
   ===================================================================== */
:root[data-theme="dark"] .xpg,
:root[data-theme="dark"] .xpg-b,
[data-theme="dark"] .xpg,
[data-theme="dark"] .xpg-b,
:root[data-theme="dark"] body.clinic .xpg,
:root[data-theme="dark"] body.clinic .xpg-b {
  background: #0a0a0a !important;
  border: 1px solid #262626 !important;
  color: #ededed !important;
}
:root[data-theme="dark"] .xpg span,
:root[data-theme="dark"] .xpg-b span,
[data-theme="dark"] .xpg span,
[data-theme="dark"] .xpg-b span {
  color: #ededed !important;
  -webkit-text-fill-color: #ededed !important;
  font-weight: 700 !important;
}
:root[data-theme="dark"] .xpg button,
:root[data-theme="dark"] .xpg-b button,
[data-theme="dark"] .xpg button,
[data-theme="dark"] .xpg-b button,
:root[data-theme="dark"] body.clinic .xpg button,
:root[data-theme="dark"] body.clinic .xpg-b button {
  background: #141414 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border: 1px solid #333333 !important;
  border-radius: 8px !important;
  font-weight: 800 !important;
  font-size: 13.5px !important;
  line-height: 1 !important;
  min-width: 36px !important;
  height: 34px !important;
  opacity: 1 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}
:root[data-theme="dark"] .xpg button:hover:not(:disabled),
:root[data-theme="dark"] .xpg-b button:hover:not(:disabled),
[data-theme="dark"] .xpg button:hover:not(:disabled),
[data-theme="dark"] .xpg-b button:hover:not(:disabled) {
  background: #242424 !important;
  border-color: #555555 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}
:root[data-theme="dark"] .xpg button.on,
:root[data-theme="dark"] .xpg-b button.on,
[data-theme="dark"] .xpg button.on,
[data-theme="dark"] .xpg-b button.on,
:root[data-theme="dark"] body.clinic .xpg button.on,
:root[data-theme="dark"] body.clinic .xpg-b button.on {
  background: #ffffff !important;
  color: #000000 !important;
  -webkit-text-fill-color: #000000 !important;
  border-color: #ffffff !important;
  font-weight: 900 !important;
  box-shadow: 0 1px 4px rgba(255, 255, 255, 0.2) !important;
  opacity: 1 !important;
}
:root[data-theme="dark"] .xpg button.on *,
:root[data-theme="dark"] .xpg-b button.on *,
[data-theme="dark"] .xpg button.on *,
[data-theme="dark"] .xpg-b button.on * {
  color: #000000 !important;
  -webkit-text-fill-color: #000000 !important;
}
:root[data-theme="dark"] .xpg button:disabled,
:root[data-theme="dark"] .xpg-b button:disabled,
[data-theme="dark"] .xpg button:disabled,
[data-theme="dark"] .xpg-b button:disabled {
  background: #0e0e0e !important;
  color: #71717a !important;
  -webkit-text-fill-color: #71717a !important;
  border-color: #222222 !important;
  opacity: 0.65 !important;
  cursor: not-allowed !important;
}
:root[data-theme="dark"] .xpg select,
:root[data-theme="dark"] .xpg-b select,
[data-theme="dark"] .xpg select,
[data-theme="dark"] .xpg-b select {
  background: #141414 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border: 1px solid #333333 !important;
  border-radius: 8px !important;
  font-weight: 700 !important;
  height: 34px !important;
}
:root[data-theme="dark"] .xpg select option,
:root[data-theme="dark"] .xpg-b select option,
[data-theme="dark"] .xpg select option,
[data-theme="dark"] .xpg-b select option {
  background: #0a0a0a !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

/* Generic Table Footer Buttons (tfoot button, .ct-foot button) */
[data-theme="dark"] table tfoot button,
[data-theme="dark"] table.xl tfoot button,
[data-theme="dark"] table.tbl-pro tfoot button,
[data-theme="dark"] .xlw tfoot button,
[data-theme="dark"] .tw tfoot button,
:root[data-theme="dark"] table tfoot button,
:root[data-theme="dark"] table.xl tfoot button,
:root[data-theme="dark"] table.tbl-pro tfoot button,
:root[data-theme="dark"] .xlw tfoot button,
:root[data-theme="dark"] .tw tfoot button {
  background: #ffffff !important;
  color: #000000 !important;
  -webkit-text-fill-color: #000000 !important;
  border: 1px solid #ffffff !important;
  font-weight: 800 !important;
}
[data-theme="dark"] table tfoot button *,
:root[data-theme="dark"] table tfoot button * {
  color: #000000 !important;
  -webkit-text-fill-color: #000000 !important;
}
[data-theme="dark"] .ct-foot,
:root[data-theme="dark"] .ct-foot {
  background: #0a0a0a !important;
  border-top: 1px solid #262626 !important;
}
:root[data-theme="dark"] .ct-foot .cancel,
:root[data-theme="dark"] .c-perm-footer-cancel {
  background: #141414 !important;
  color: #ffffff !important;
  border: 1px solid #333333 !important;
  border-radius: 8px !important;
  padding: 10px 18px !important;
  font-weight: 700 !important;
}
:root[data-theme="dark"] .ct-foot .cancel:hover,
:root[data-theme="dark"] .c-perm-footer-cancel:hover {
  background: #242424 !important;
  color: #ffffff !important;
}
:root[data-theme="dark"] .ct-foot .big.primary,
:root[data-theme="dark"] .c-perm-footer-save {
  background: #ffffff !important;
  color: #000000 !important;
  border: 1px solid #ffffff !important;
  font-weight: 750 !important;
}
:root[data-theme="dark"] .ct-foot .big.primary:hover,
:root[data-theme="dark"] .c-perm-footer-save:hover {
  background: #e5e5e5 !important;
  color: #000000 !important;
}
:root[data-theme="dark"] .mr-b {
  background: #1f1f1f !important;
  color: #ffffff !important;
  border: 1px solid #333333 !important;
}
:root[data-theme="dark"] .mr-b:hover {
  background: #2a2a2a !important;
  color: #ffffff !important;
}

/* Cards & Modals */
:root[data-theme="dark"] .card,
:root[data-theme="dark"] .xkc,
:root[data-theme="dark"] .kc,
:root[data-theme="dark"] .rp-card,
:root[data-theme="dark"] .sheet,
:root[data-theme="dark"] #m .sheet {
  background: #0a0a0a !important;
  border: 1px solid #262626 !important;
  color: #ededed !important;
}
:root[data-theme="dark"] .hero,
:root[data-theme="dark"] .balance-card,
:root[data-theme="dark"] .kc.hi,
:root[data-theme="dark"] .rp-head {
  background: #0d0d0d !important;
  border: 1px solid #262626 !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .8) !important;
  color: #ffffff !important;
}
:root[data-theme="dark"] .xrb {
  background: #0d0d0d !important;
  border: 1px solid #262626 !important;
  border-bottom: 0 !important;
  box-shadow: none !important;
}
:root[data-theme="dark"] .xrb .xb {
  background: #171717 !important;
  border: 1px solid #262626 !important;
  color: #ededed !important;
}
:root[data-theme="dark"] .xrb .xb:hover {
  background: #262626 !important;
  color: #ffffff !important;
}
:root[data-theme="dark"] .xfx {
  background: #0a0a0a !important;
  border-color: #262626 !important;
}

/* Next.js Inputs */
:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea {
  background: #000000 !important;
  border: 1px solid #262626 !important;
  color: #ededed !important;
}
:root[data-theme="dark"] input::placeholder,
:root[data-theme="dark"] textarea::placeholder {
  color: #71717a !important;
}
:root[data-theme="dark"] input:focus,
:root[data-theme="dark"] select:focus,
:root[data-theme="dark"] textarea:focus {
  border-color: #ffffff !important;
  box-shadow: 0 0 0 1px #ffffff !important;
  outline: 0 !important;
}

/* Next.js Tables */
:root[data-theme="dark"] .xlw,
:root[data-theme="dark"] .tw {
  background: #0a0a0a !important;
  border-color: #262626 !important;
}
:root[data-theme="dark"] table.xl th,
:root[data-theme="dark"] table.xl td,
:root[data-theme="dark"] table.set-test-table th,
:root[data-theme="dark"] table.set-test-table td {
  border-color: #1a1a1a !important;
  color: #ededed !important;
}
:root[data-theme="dark"] table.xl thead th,
:root[data-theme="dark"] table.set-test-table th {
  background: #121212 !important;
  color: #a1a1aa !important;
  border-bottom: 1px solid #262626 !important;
}
:root[data-theme="dark"] table.xl .rn,
:root[data-theme="dark"] table.xl thead .rn {
  background: #0a0a0a !important;
  color: #71717a !important;
}
:root[data-theme="dark"] table.xl tbody tr:nth-child(even) td:not(.rn) {
  background: #050505 !important;
}
:root[data-theme="dark"] table.xl tbody tr:hover td:not(.rn),
:root[data-theme="dark"] table.set-test-table tbody tr:hover td {
  background: #141414 !important;
}
:root[data-theme="dark"] table.xl tfoot td {
  background: #121212 !important;
  color: #ffffff !important;
  border-top: 2px solid #ffffff !important;
}
:root[data-theme="dark"] table.xl td .xb,
:root[data-theme="dark"] table.xl td .ib {
  background: #121212 !important;
  border-color: #262626 !important;
  color: #ededed !important;
}
:root[data-theme="dark"] table.tbl-pro tr {
  background: #0a0a0a !important;
  border-color: #262626 !important;
}
:root[data-theme="dark"] table.tbl-pro td {
  border-bottom-color: #1a1a1a !important;
}

/* Badges & FAB */
:root[data-theme="dark"] .chip,
:root[data-theme="dark"] .chip.pr,
:root[data-theme="dark"] .rp-pill,
:root[data-theme="dark"] .app-footer-badge {
  background: #141414 !important;
  color: #ffffff !important;
  border: 1px solid #262626 !important;
}
:root[data-theme="dark"] .kc-i {
  background: #171717 !important;
  color: #ffffff !important;
  border: 1px solid #262626 !important;
}
:root[data-theme="dark"] #help-fab {
  background: #ffffff !important;
  color: #000000 !important;
  box-shadow: 0 4px 16px rgba(255, 255, 255, .15) !important;
}

/* =====================================================================
   NEXT.JS MONOCHROME SYSTEM-WIDE DARK THEME SPECIFICATION
   Eliminates all remaining navy blue / teal leaks; delivers pure black (#000000),
   dark elevated surfaces (#0a0a0a, #121212), crisp borders (#262626), 
   and high-contrast monochrome white accents across every screen.
   ===================================================================== */

/* 1. Doctor Examination Workspace (c_exam) */
:root[data-theme="dark"] .doc-sheet,
[data-theme="dark"] .doc-sheet {
  background: #0a0a0a !important;
  border: 1px solid #262626 !important;
  border-radius: 14px !important;
  color: #ededed !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
}
:root[data-theme="dark"] .doc-sheet-head,
[data-theme="dark"] .doc-sheet-head {
  background: #171717 !important;
  border-bottom: 1px solid #262626 !important;
  color: #ffffff !important;
}
:root[data-theme="dark"] .doc-sheet-head *,
[data-theme="dark"] .doc-sheet-head * {
  color: #ffffff !important;
}
:root[data-theme="dark"] .doc-step-badge,
[data-theme="dark"] .doc-step-badge {
  background: #ffffff !important;
  color: #000000 !important;
  border-color: #ffffff !important;
  font-weight: 850 !important;
}
:root[data-theme="dark"] .doc-sheet-sub,
[data-theme="dark"] .doc-sheet-sub {
  color: #a1a1aa !important;
  opacity: 1 !important;
}
:root[data-theme="dark"] .doc-vitals-row,
[data-theme="dark"] .doc-vitals-row {
  background: #0a0a0a !important;
  border-bottom: 1px solid #262626 !important;
}
:root[data-theme="dark"] .doc-v-box,
[data-theme="dark"] .doc-v-box {
  background: transparent !important;
  border-right: 1px solid #262626 !important;
  border-bottom: 1px solid #262626 !important;
}
:root[data-theme="dark"] .doc-v-box label,
[data-theme="dark"] .doc-v-box label {
  color: #a1a1aa !important;
}
:root[data-theme="dark"] .doc-v-box input,
[data-theme="dark"] .doc-v-box input {
  color: #ffffff !important;
  background: transparent !important;
}
:root[data-theme="dark"] .doc-v-box u,
[data-theme="dark"] .doc-v-box u {
  color: #71717a !important;
}
:root[data-theme="dark"] .doc-f,
[data-theme="dark"] .doc-f {
  background: #0a0a0a !important;
  border-color: #262626 !important;
  color: #ededed !important;
}
:root[data-theme="dark"] .doc-f label,
[data-theme="dark"] .doc-f label {
  color: #ffffff !important;
}
:root[data-theme="dark"] .doc-f textarea,
:root[data-theme="dark"] .doc-f input[type="text"],
:root[data-theme="dark"] .doc-f input[type="date"],
[data-theme="dark"] .doc-f textarea,
[data-theme="dark"] .doc-f input[type="text"],
[data-theme="dark"] .doc-f input[type="date"] {
  background: #000000 !important;
  border: 1px solid #262626 !important;
  color: #ededed !important;
}
:root[data-theme="dark"] .doc-f textarea:focus,
:root[data-theme="dark"] .doc-f input:focus,
[data-theme="dark"] .doc-f textarea:focus,
[data-theme="dark"] .doc-f input:focus {
  border-color: #ffffff !important;
  box-shadow: 0 0 0 1px #ffffff !important;
  outline: none !important;
}
:root[data-theme="dark"] .ex-tw,
:root[data-theme="dark"] table.ex-xl-table,
[data-theme="dark"] .ex-tw,
[data-theme="dark"] table.ex-xl-table {
  background: #0a0a0a !important;
  border-color: #262626 !important;
}
:root[data-theme="dark"] table.ex-xl-table th,
[data-theme="dark"] table.ex-xl-table th {
  background: #121212 !important;
  color: #a1a1aa !important;
  border-bottom: 1px solid #262626 !important;
}
:root[data-theme="dark"] table.ex-xl-table td,
[data-theme="dark"] table.ex-xl-table td {
  border-bottom: 1px solid #1a1a1a !important;
  color: #ededed !important;
}
:root[data-theme="dark"] table.ex-xl-table td.empty,
[data-theme="dark"] table.ex-xl-table td.empty {
  color: #71717a !important;
  background: #0a0a0a !important;
}
:root[data-theme="dark"] .ex-tools,
[data-theme="dark"] .ex-tools {
  background: #0d0d0d !important;
  border-top: 1px solid #262626 !important;
}
:root[data-theme="dark"] #c_lab_cat_drawer,
[data-theme="dark"] #c_lab_cat_drawer {
  background: #0a0a0a !important;
  border-top: 1px solid #262626 !important;
}
:root[data-theme="dark"] .lab-side,
[data-theme="dark"] .lab-side {
  background: #0d0d0d !important;
  border: 1px solid #262626 !important;
  box-shadow: none !important;
}
:root[data-theme="dark"] .lab-side h3,
[data-theme="dark"] .lab-side h3 {
  background: #141414 !important;
  border-bottom: 1px solid #262626 !important;
  color: #ffffff !important;
}
:root[data-theme="dark"] .lab-side h3 *,
[data-theme="dark"] .lab-side h3 * {
  color: #ffffff !important;
}
:root[data-theme="dark"] .lab-count,
[data-theme="dark"] .lab-count {
  background: #ffffff !important;
  color: #000000 !important;
  font-weight: 800 !important;
}
:root[data-theme="dark"] .lab-go,
[data-theme="dark"] .lab-go {
  background: #111111 !important;
  border-top: 1px solid #262626 !important;
}
:root[data-theme="dark"] .lab-go button,
[data-theme="dark"] .lab-go button {
  background: #171717 !important;
  border: 1px solid #333333 !important;
  color: #ffffff !important;
}
:root[data-theme="dark"] .lab-go button.p,
[data-theme="dark"] .lab-go button.p {
  background: #ffffff !important;
  color: #000000 !important;
  border-color: #ffffff !important;
  font-weight: 800 !important;
}
:root[data-theme="dark"] .ord-block-card,
[data-theme="dark"] .ord-block-card {
  background: #0a0a0a !important;
  border: 1px solid #262626 !important;
}
:root[data-theme="dark"] .ord-block-card > div:first-child,
[data-theme="dark"] .ord-block-card > div:first-child {
  background: #141414 !important;
  border-bottom: 1px solid #262626 !important;
}
:root[data-theme="dark"] .ord-item-row,
[data-theme="dark"] .ord-item-row {
  border-bottom: 1px solid #1a1a1a !important;
}
:root[data-theme="dark"] .ord-item-row select,
:root[data-theme="dark"] .ord-item-row input,
[data-theme="dark"] .ord-item-row select,
[data-theme="dark"] .ord-item-row input {
  background: #000000 !important;
  border: 1px solid #262626 !important;
  color: #ededed !important;
}
:root[data-theme="dark"] .ord-summary-bar,
[data-theme="dark"] .ord-summary-bar {
  background: #0f0f0f !important;
  border: 1px solid #262626 !important;
  color: #ededed !important;
}
:root[data-theme="dark"] .ord-summary-bar span,
[data-theme="dark"] .ord-summary-bar span {
  background: #171717 !important;
  border: 1px solid #333333 !important;
  color: #ffffff !important;
}
:root[data-theme="dark"] .ord-summary-bar > div:last-child,
[data-theme="dark"] .ord-summary-bar > div:last-child {
  background: #ffffff !important;
  color: #000000 !important;
  border: 1px solid #ffffff !important;
  box-shadow: none !important;
}
:root[data-theme="dark"] .ord-summary-bar > div:last-child b,
[data-theme="dark"] .ord-summary-bar > div:last-child b {
  color: #000000 !important;
}
:root[data-theme="dark"] button[onclick*="cSendToCashier"],
[data-theme="dark"] button[onclick*="cSendToCashier"] {
  background: #ffffff !important;
  color: #000000 !important;
  border: 1px solid #ffffff !important;
  font-weight: 800 !important;
}
:root[data-theme="dark"] .doc-exam-footer,
[data-theme="dark"] .doc-exam-footer {
  background: #000000 !important;
  border-top: 1px solid #262626 !important;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.9) !important;
}
:root[data-theme="dark"] .doc-exam-footer-info .doc-exam-patient,
[data-theme="dark"] .doc-exam-footer-info .doc-exam-patient {
  color: #ffffff !important;
}

/* 2. Diagnosis Picker (dxp) */
:root[data-theme="dark"] .dxp-panel,
[data-theme="dark"] .dxp-panel {
  background: #0a0a0a !important;
  border: 1px solid #333333 !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.9) !important;
}
:root[data-theme="dark"] .dxp-h,
[data-theme="dark"] .dxp-h {
  background: #141414 !important;
  color: #a1a1aa !important;
  border-bottom: 1px solid #262626 !important;
}
:root[data-theme="dark"] .dxp-i,
[data-theme="dark"] .dxp-i {
  border-bottom: 1px solid #1a1a1a !important;
  color: #ededed !important;
}
:root[data-theme="dark"] .dxp-i .nm,
[data-theme="dark"] .dxp-i .nm {
  color: #ffffff !important;
}
:root[data-theme="dark"] .dxp-i em,
[data-theme="dark"] .dxp-i em {
  color: #71717a !important;
}
:root[data-theme="dark"] .dxp-i .ck,
[data-theme="dark"] .dxp-i .ck {
  border: 1px solid #404040 !important;
  background: #171717 !important;
}
:root[data-theme="dark"] .dxp-i.on,
[data-theme="dark"] .dxp-i.on {
  background: #1a1a1a !important;
}
:root[data-theme="dark"] .dxp-i.on .ck,
[data-theme="dark"] .dxp-i.on .ck {
  background: #ffffff !important;
  border-color: #ffffff !important;
  color: #000000 !important;
}
:root[data-theme="dark"] .dxp-i:hover,
:root[data-theme="dark"] .dxp-i.hi,
[data-theme="dark"] .dxp-i:hover,
[data-theme="dark"] .dxp-i.hi {
  background: #141414 !important;
}
:root[data-theme="dark"] .dxp-done,
[data-theme="dark"] .dxp-done {
  background: #ffffff !important;
  color: #000000 !important;
  border-top: 1px solid #ffffff !important;
  font-weight: 800 !important;
}
:root[data-theme="dark"] .dxp-chip,
[data-theme="dark"] .dxp-chip {
  background: #1a1a1a !important;
  color: #ffffff !important;
  border: 1px solid #333333 !important;
}
:root[data-theme="dark"] .dxp-chip b,
[data-theme="dark"] .dxp-chip b {
  background: #333333 !important;
  color: #ffffff !important;
}
:root[data-theme="dark"] .dxp-b,
[data-theme="dark"] .dxp-b {
  background: #171717 !important;
  color: #ffffff !important;
  border: 1px solid #333333 !important;
}

/* 3. Clinical Profile & Patient Timeline (c_search, .cpf-) */
:root[data-theme="dark"] .cpf-wrapper,
[data-theme="dark"] .cpf-wrapper {
  color: #ededed !important;
}
:root[data-theme="dark"] .cpf-header,
[data-theme="dark"] .cpf-header {
  background: #0a0a0a !important;
  border: 1px solid #262626 !important;
}
:root[data-theme="dark"] .cpf-avatar,
[data-theme="dark"] .cpf-avatar {
  background: #171717 !important;
  border: 1px solid #333333 !important;
  color: #ffffff !important;
  box-shadow: none !important;
}
:root[data-theme="dark"] .cpf-btn,
[data-theme="dark"] .cpf-btn {
  background: #141414 !important;
  border: 1px solid #333333 !important;
  color: #ffffff !important;
}
:root[data-theme="dark"] .cpf-btn:hover,
[data-theme="dark"] .cpf-btn:hover {
  background: #242424 !important;
  border-color: #555555 !important;
}
:root[data-theme="dark"] .cpf-btn-pri,
[data-theme="dark"] .cpf-btn-pri {
  background: #ffffff !important;
  border: 1px solid #ffffff !important;
  color: #000000 !important;
  font-weight: 800 !important;
}
:root[data-theme="dark"] .cpf-btn-pri:hover,
[data-theme="dark"] .cpf-btn-pri:hover {
  background: #e5e5e5 !important;
  color: #000000 !important;
}
:root[data-theme="dark"] .cpf-btn-danger,
[data-theme="dark"] .cpf-btn-danger {
  background: #1f1212 !important;
  border: 1px solid #3b1818 !important;
  color: #ef4444 !important;
}
:root[data-theme="dark"] .cpf-box,
[data-theme="dark"] .cpf-box {
  background: #0d0d0d !important;
  border: 1px solid #262626 !important;
}
:root[data-theme="dark"] .cpf-box-label,
[data-theme="dark"] .cpf-box-label {
  color: #a1a1aa !important;
}
:root[data-theme="dark"] .cpf-box-val,
[data-theme="dark"] .cpf-box-val {
  color: #ffffff !important;
}
:root[data-theme="dark"] .cpf-visit-card,
[data-theme="dark"] .cpf-visit-card {
  background: #0a0a0a !important;
  border: 1px solid #262626 !important;
  color: #ededed !important;
  box-shadow: none !important;
}
:root[data-theme="dark"] .cpf-visit-card.is-today,
[data-theme="dark"] .cpf-visit-card.is-today {
  border-color: #ffffff !important;
  box-shadow: 0 0 0 1px #ffffff !important;
}
:root[data-theme="dark"] .cpf-vc-header,
[data-theme="dark"] .cpf-vc-header {
  border-bottom: 1px solid #262626 !important;
}
:root[data-theme="dark"] .cpf-vc-date,
[data-theme="dark"] .cpf-vc-date {
  color: #ffffff !important;
}
:root[data-theme="dark"] .cpf-vc-badge,
[data-theme="dark"] .cpf-vc-badge {
  background: #171717 !important;
  border: 1px solid #333333 !important;
  color: #ffffff !important;
}
:root[data-theme="dark"] .cpf-vc-actions .xb,
[data-theme="dark"] .cpf-vc-actions .xb {
  background: #141414 !important;
  border: 1px solid #333333 !important;
  color: #ffffff !important;
}
:root[data-theme="dark"] .cpf-vc-actions .xb.pr,
[data-theme="dark"] .cpf-vc-actions .xb.pr {
  background: #ffffff !important;
  border: 1px solid #ffffff !important;
  color: #000000 !important;
  font-weight: 800 !important;
}
:root[data-theme="dark"] .cpf-vc-dx,
[data-theme="dark"] .cpf-vc-dx {
  background: #141414 !important;
  border-left: 4px solid #ffffff !important;
}
:root[data-theme="dark"] .cpf-dx-tag,
[data-theme="dark"] .cpf-dx-tag {
  color: #ffffff !important;
  font-weight: 800 !important;
}
:root[data-theme="dark"] .cpf-vc-vits,
[data-theme="dark"] .cpf-vc-vits {
  background: #121212 !important;
  border: 1px solid #262626 !important;
  color: #ededed !important;
}
:root[data-theme="dark"] .cpf-rx-box,
:root[data-theme="dark"] .cpf-inj-card,
[data-theme="dark"] .cpf-rx-box,
[data-theme="dark"] .cpf-inj-card {
  background: #0d0d0d !important;
  border: 1px solid #262626 !important;
}
:root[data-theme="dark"] .cpf-lab-table,
[data-theme="dark"] .cpf-lab-table {
  background: #0a0a0a !important;
}
:root[data-theme="dark"] .cpf-lab-table thead th,
[data-theme="dark"] .cpf-lab-table thead th {
  background: #121212 !important;
  border-bottom: 1px solid #262626 !important;
  color: #a1a1aa !important;
}
:root[data-theme="dark"] .cpf-lab-table td,
[data-theme="dark"] .cpf-lab-table td {
  border-bottom: 1px solid #1a1a1a !important;
  color: #ededed !important;
}

/* 4. Laboratory Desk & Result Review Modal (c_lab, cLabOpen, .dlr-) */
:root[data-theme="dark"] .lab-panel-box,
[data-theme="dark"] .lab-panel-box {
  background: #0a0a0a !important;
  border: 1px solid #262626 !important;
}
:root[data-theme="dark"] .lab-panel-box > div:first-child,
[data-theme="dark"] .lab-panel-box > div:first-child {
  background: #141414 !important;
  border-bottom: 1px solid #262626 !important;
}
:root[data-theme="dark"] .lab-panel-box table thead tr,
[data-theme="dark"] .lab-panel-box table thead tr {
  background: #121212 !important;
  border-bottom: 1px solid #262626 !important;
}
:root[data-theme="dark"] .lab-panel-box table th,
[data-theme="dark"] .lab-panel-box table th {
  color: #a1a1aa !important;
}
:root[data-theme="dark"] .lab-panel-box table td,
[data-theme="dark"] .lab-panel-box table td {
  border-bottom: 1px solid #1a1a1a !important;
  color: #ededed !important;
}
:root[data-theme="dark"] .lab-panel-inp,
[data-theme="dark"] .lab-panel-inp {
  background: #000000 !important;
  border: 1px solid #262626 !important;
  color: #ededed !important;
}
:root[data-theme="dark"] .lab-panel-inp:focus,
[data-theme="dark"] .lab-panel-inp:focus {
  border-color: #ffffff !important;
  box-shadow: 0 0 0 1px #ffffff !important;
}
:root[data-theme="dark"] .lab-row,
[data-theme="dark"] .lab-row {
  background: #0a0a0a !important;
  border-color: #262626 !important;
  color: #ededed !important;
}
:root[data-theme="dark"] .lab-row.sub,
[data-theme="dark"] .lab-row.sub {
  background: #080808 !important;
  border-left: 3px solid #333333 !important;
}
:root[data-theme="dark"] .lab-cols,
[data-theme="dark"] .lab-cols {
  background: #121212 !important;
  border-color: #262626 !important;
  color: #a1a1aa !important;
}
:root[data-theme="dark"] .lab-card,
[data-theme="dark"] .lab-card {
  background: #0a0a0a !important;
  border: 1px solid #262626 !important;
}
:root[data-theme="dark"] .lab-card h2,
[data-theme="dark"] .lab-card h2 {
  background: #141414 !important;
  color: #ffffff !important;
  border-bottom: 1px solid #262626 !important;
}
:root[data-theme="dark"] .lab-tools,
[data-theme="dark"] .lab-tools {
  background: #0a0a0a !important;
  border: 1px solid #262626 !important;
}
:root[data-theme="dark"] .lab-tab,
[data-theme="dark"] .lab-tab {
  background: #141414 !important;
  border: 1px solid #262626 !important;
  color: #a1a1aa !important;
}
:root[data-theme="dark"] .lab-tab.on,
[data-theme="dark"] .lab-tab.on {
  background: #ffffff !important;
  border-color: #ffffff !important;
  color: #000000 !important;
}
:root[data-theme="dark"] .lab-check,
[data-theme="dark"] .lab-check {
  background: #000000 !important;
  border: 1.5px solid #404040 !important;
}
:root[data-theme="dark"] .lab-check:checked,
[data-theme="dark"] .lab-check:checked {
  background: #ffffff !important;
  border-color: #ffffff !important;
}
:root[data-theme="dark"] .lab-check:checked::after,
[data-theme="dark"] .lab-check:checked::after {
  border-color: #000000 !important;
}
:root[data-theme="dark"] .dlr-container,
[data-theme="dark"] .dlr-container {
  background: #0a0a0a !important;
  border: 1px solid #262626 !important;
}
:root[data-theme="dark"] .dlr-header,
[data-theme="dark"] .dlr-header {
  background: #0a0a0a !important;
  border-bottom: 1px solid #262626 !important;
}
:root[data-theme="dark"] .dlr-avatar,
[data-theme="dark"] .dlr-avatar {
  background: #171717 !important;
  border: 1px solid #333333 !important;
  color: #ffffff !important;
}
:root[data-theme="dark"] .dlr-id-chip,
[data-theme="dark"] .dlr-id-chip {
  background: #171717 !important;
  border: 1px solid #333333 !important;
  color: #ffffff !important;
}
:root[data-theme="dark"] .dlr-reviewed-chip,
[data-theme="dark"] .dlr-reviewed-chip {
  background: #141414 !important;
  border: 1px solid #333333 !important;
  color: #ffffff !important;
}
:root[data-theme="dark"] .dlr-status-badge.status-normal,
[data-theme="dark"] .dlr-status-badge.status-normal {
  background: #111e15 !important;
  border: 1px solid #22543d !important;
  color: #86efac !important;
}
:root[data-theme="dark"] .dlr-status-badge.status-abnormal,
[data-theme="dark"] .dlr-status-badge.status-abnormal {
  background: #251214 !important;
  border: 1px solid #742a2a !important;
  color: #fca5a5 !important;
}
:root[data-theme="dark"] .dlr-remarks-card,
[data-theme="dark"] .dlr-remarks-card {
  background: #121212 !important;
  border: 1px solid #262626 !important;
  color: #ededed !important;
}
:root[data-theme="dark"] .dlr-footer,
[data-theme="dark"] .dlr-footer {
  background: #0a0a0a !important;
  border-top: 1px solid #262626 !important;
}
:root[data-theme="dark"] .dlr-btn,
[data-theme="dark"] .dlr-btn {
  background: #141414 !important;
  border: 1px solid #333333 !important;
  color: #ffffff !important;
}
:root[data-theme="dark"] .dlr-btn-rx,
[data-theme="dark"] .dlr-btn-rx {
  background: #ffffff !important;
  color: #000000 !important;
  border-color: #ffffff !important;
  font-weight: 800 !important;
}

/* 5. Point of Sale (sell) & Inventory */
:root[data-theme="dark"] .prod,
[data-theme="dark"] .prod {
  background: #0a0a0a !important;
  border: 1px solid #262626 !important;
  color: #ededed !important;
  box-shadow: none !important;
}
:root[data-theme="dark"] .prod:hover,
[data-theme="dark"] .prod:hover {
  border-color: #555555 !important;
}
:root[data-theme="dark"] .prod.in,
[data-theme="dark"] .prod.in {
  background: #141414 !important;
  border: 1.5px solid #ffffff !important;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.08) !important;
}
:root[data-theme="dark"] .prod .pr,
[data-theme="dark"] .prod .pr {
  color: #ffffff !important;
}
:root[data-theme="dark"] .prod .add,
[data-theme="dark"] .prod .add {
  background: #171717 !important;
  color: #ffffff !important;
  border: 1px solid #333333 !important;
}
:root[data-theme="dark"] .qc,
[data-theme="dark"] .qc {
  background: #000000 !important;
  border: 1px solid #262626 !important;
}
:root[data-theme="dark"] .qc button,
[data-theme="dark"] .qc button {
  background: #ffffff !important;
  color: #000000 !important;
  font-weight: 800 !important;
}
:root[data-theme="dark"] .qc span,
[data-theme="dark"] .qc span {
  color: #ffffff !important;
}
:root[data-theme="dark"] .cb,
[data-theme="dark"] .cb {
  background: #0d0d0d !important;
  border: 1px solid #333333 !important;
  color: #ffffff !important;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.85) !important;
}
:root[data-theme="dark"] .cb button,
[data-theme="dark"] .cb button {
  background: #ffffff !important;
  color: #000000 !important;
  border: 1px solid #ffffff !important;
  font-weight: 800 !important;
}
:root[data-theme="dark"] .cb small,
[data-theme="dark"] .cb small {
  color: #a1a1aa !important;
}
:root[data-theme="dark"] .cb b,
[data-theme="dark"] .cb b {
  color: #ffffff !important;
}
:root[data-theme="dark"] .qa-btn,
[data-theme="dark"] .qa-btn {
  background: #0a0a0a !important;
  border: 1px solid #262626 !important;
  color: #ededed !important;
}
:root[data-theme="dark"] .qa-btn .icon,
[data-theme="dark"] .qa-btn .icon {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7) !important;
}

/* 6. Toasts, Notifications, Modals & Floating Overlays */
:root[data-theme="dark"] #t,
:root[data-theme="dark"] #t.top-toast,
:root[data-theme="dark"] body.in-exam #t,
[data-theme="dark"] #t,
[data-theme="dark"] #t.top-toast,
[data-theme="dark"] body.in-exam #t {
  background: #121212 !important;
  color: #ffffff !important;
  border: 1px solid #333333 !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.85) !important;
}
:root[data-theme="dark"] #cbp,
[data-theme="dark"] #cbp {
  background: #0a0a0a !important;
  border: 1px solid #262626 !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85) !important;
  color: #ededed !important;
}
:root[data-theme="dark"] .cbh,
[data-theme="dark"] .cbh {
  background: #0d0d0d !important;
  border-bottom: 1px solid #262626 !important;
  color: #ffffff !important;
}
:root[data-theme="dark"] .cbh b,
[data-theme="dark"] .cbh b {
  color: #ffffff !important;
}
:root[data-theme="dark"] .cnc,
[data-theme="dark"] .cnc {
  background: #0d0d0d !important;
  border: 1px solid #262626 !important;
  border-left: 4px solid #ffffff !important;
  color: #ededed !important;
}
:root[data-theme="dark"] .cnc .cno,
[data-theme="dark"] .cnc .cno {
  background: #ffffff !important;
  color: #000000 !important;
  font-weight: 800 !important;
}
:root[data-theme="dark"] #m,
[data-theme="dark"] #m {
  background: rgba(0, 0, 0, 0.8) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  backdrop-filter: blur(8px) !important;
}
:root[data-theme="dark"] .sheet,
:root[data-theme="dark"] .sheet.fs,
[data-theme="dark"] .sheet,
[data-theme="dark"] .sheet.fs {
  background: #0a0a0a !important;
  border: 1px solid #262626 !important;
  color: #ededed !important;
}
:root[data-theme="dark"] .sheet::before,
[data-theme="dark"] .sheet::before {
  background: #333333 !important;
}
:root[data-theme="dark"] .sheet h3,
:root[data-theme="dark"] .sheet h2,
[data-theme="dark"] .sheet h3,
[data-theme="dark"] .sheet h2 {
  color: #ffffff !important;
}
:root[data-theme="dark"] .fcard,
:root[data-theme="dark"] .pcx,
:root[data-theme="dark"] .sbx,
[data-theme="dark"] .fcard,
[data-theme="dark"] .pcx,
[data-theme="dark"] .sbx {
  background: #0a0a0a !important;
  border: 1px solid #262626 !important;
  color: #ededed !important;
}
:root[data-theme="dark"] .ex-reopen-banner,
[data-theme="dark"] .ex-reopen-banner {
  background: #121212 !important;
  border: 1px solid #333333 !important;
  color: #ffffff !important;
}

/* 7. Action Column Sticky Table Fixes */
:root[data-theme="dark"] table.xl thead th.act,
:root[data-theme="dark"] table.xl thead th:last-child,
[data-theme="dark"] table.xl thead th.act,
[data-theme="dark"] table.xl thead th:last-child {
  background: #121212 !important;
  border-bottom: 1px solid #262626 !important;
  color: #a1a1aa !important;
}
:root[data-theme="dark"] table.xl td.act,
[data-theme="dark"] table.xl td.act {
  background: #0a0a0a !important;
  border-bottom: 1px solid #1a1a1a !important;
}
:root[data-theme="dark"] table.xl tbody tr:nth-child(even) td.act,
[data-theme="dark"] table.xl tbody tr:nth-child(even) td.act {
  background: #050505 !important;
}
:root[data-theme="dark"] table.xl tbody tr:nth-child(odd) td.act,
[data-theme="dark"] table.xl tbody tr:nth-child(odd) td.act {
  background: #0a0a0a !important;
}
:root[data-theme="dark"] table.xl tbody tr:hover td.act,
[data-theme="dark"] table.xl tbody tr:hover td.act {
  background: #141414 !important;
}

/* 8. Search, Settings & Navigation */
:root[data-theme="dark"] #topsearch input,
:root[data-theme="dark"] .c-dash-search-box input,
:root[data-theme="dark"] .c-sh-input-box input,
[data-theme="dark"] #topsearch input,
[data-theme="dark"] .c-dash-search-box input,
[data-theme="dark"] .c-sh-input-box input {
  background: #000000 !important;
  border: 1px solid #262626 !important;
  color: #ffffff !important;
}
:root[data-theme="dark"] #topsearch input:focus,
:root[data-theme="dark"] .c-dash-search-box input:focus,
:root[data-theme="dark"] .c-sh-input-box input:focus,
[data-theme="dark"] #topsearch input:focus,
[data-theme="dark"] .c-dash-search-box input:focus,
[data-theme="dark"] .c-sh-input-box input:focus {
  border-color: #ffffff !important;
  box-shadow: 0 0 0 1px #ffffff !important;
}
:root[data-theme="dark"] .topbar-search-dropdown,
[data-theme="dark"] .topbar-search-dropdown {
  background: #0a0a0a !important;
  border: 1px solid #262626 !important;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.85) !important;
}
:root[data-theme="dark"] .set-subpage-header,
[data-theme="dark"] .set-subpage-header {
  border-bottom: 1px solid #262626 !important;
  color: #ffffff !important;
}
:root[data-theme="dark"] .set-back-btn,
[data-theme="dark"] .set-back-btn {
  background: #141414 !important;
  border: 1px solid #333333 !important;
  color: #ffffff !important;
}
:root[data-theme="dark"] .tab-chip,
[data-theme="dark"] .tab-chip {
  background: #0a0a0a !important;
  border: 1px solid #262626 !important;
  color: #a1a1aa !important;
}
:root[data-theme="dark"] .tab-chip.active,
[data-theme="dark"] .tab-chip.active {
  background: #ffffff !important;
  border-color: #ffffff !important;
  color: #000000 !important;
  font-weight: 800 !important;
}
:root[data-theme="dark"] .app-footer,
[data-theme="dark"] .app-footer {
  background: #000000 !important;
  border-top: 1px solid #262626 !important;
  color: #71717a !important;
}
:root[data-theme="dark"] .app-footer-copy b,
:root[data-theme="dark"] .app-footer-author,
[data-theme="dark"] .app-footer-copy b,
[data-theme="dark"] .app-footer-author {
  color: #ffffff !important;
}
:root[data-theme="dark"] .app-footer-badge,
[data-theme="dark"] .app-footer-badge {
  background: #141414 !important;
  border: 1px solid #262626 !important;
  color: #ffffff !important;
}

/* =====================================================================
   UNIVERSAL TOGGLE SWITCH (input.sw) - CRITICAL VISIBILITY OVERRIDE
   Prevents general input { background: var(--card) } from masking switches
   ===================================================================== */
input.sw,
input[type="checkbox"].sw {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  position: relative !important;
  display: inline-block !important;
  width: 50px !important;
  min-width: 50px !important;
  max-width: 50px !important;
  height: 28px !important;
  min-height: 28px !important;
  max-height: 28px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 2px solid #cbd5e1 !important;
  border-radius: 9999px !important;
  background: #cbd5e1 !important;
  background-color: #cbd5e1 !important;
  cursor: pointer !important;
  flex: none !important;
  flex-shrink: 0 !important;
  outline: none !important;
  box-sizing: border-box !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.12) !important;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1) !important;
  vertical-align: middle !important;
}

input.sw::after,
input[type="checkbox"].sw::after {
  content: "" !important;
  position: absolute !important;
  display: block !important;
  top: 2px !important;
  left: 2px !important;
  width: 20px !important;
  height: 20px !important;
  border-radius: 50% !important;
  background: #ffffff !important;
  background-color: #ffffff !important;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.28), 0 1px 2px rgba(0, 0, 0, 0.15) !important;
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s !important;
}

input.sw:checked,
input[type="checkbox"].sw:checked {
  background: #0284c7 !important;
  background-color: #0284c7 !important;
  border-color: #0284c7 !important;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.2) !important;
}

input.sw:checked::after,
input[type="checkbox"].sw:checked::after {
  transform: translateX(22px) !important;
  background: #ffffff !important;
  background-color: #ffffff !important;
}

:root[data-theme="dark"] input.sw,
:root[data-theme="dark"] input[type="checkbox"].sw,
[data-theme="dark"] input.sw,
[data-theme="dark"] input[type="checkbox"].sw {
  background: #27272a !important;
  background-color: #27272a !important;
  border-color: #3f3f46 !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5) !important;
}

:root[data-theme="dark"] input.sw::after,
:root[data-theme="dark"] input[type="checkbox"].sw::after,
[data-theme="dark"] input.sw::after,
[data-theme="dark"] input[type="checkbox"].sw::after {
  background: #a1a1aa !important;
  background-color: #a1a1aa !important;
}

:root[data-theme="dark"] input.sw:checked,
:root[data-theme="dark"] input[type="checkbox"].sw:checked,
[data-theme="dark"] input.sw:checked,
[data-theme="dark"] input[type="checkbox"].sw:checked {
  background: #ffffff !important;
  background-color: #ffffff !important;
  border-color: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18) !important;
}

:root[data-theme="dark"] input.sw:checked::after,
:root[data-theme="dark"] input[type="checkbox"].sw:checked::after,
[data-theme="dark"] input.sw:checked::after,
[data-theme="dark"] input[type="checkbox"].sw:checked::after {
  background: #000000 !important;
  background-color: #000000 !important;
  transform: translateX(22px) !important;
}

/* =====================================================================
   DOCTOR EXAMINATION: FULL-SCREEN POPUP WORKSPACE FOR SECTIONS 2-5
   ===================================================================== */
.doc-exam-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  width: 100%;
  margin-top: 2px;
}
@media (max-width: 768px) {
  .doc-exam-cards-grid {
    grid-template-columns: 1fr;
  }
}
.doc-exam-hub-card {
  background: var(--card, #ffffff);
  border: 1.5px solid var(--bd, #cbd5e1);
  border-radius: 12px;
  padding: 16px 18px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.03);
  position: relative;
  text-align: left;
}
.doc-exam-hub-card:hover {
  border-color: var(--ac, #0f8a5f);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.07);
}
.doc-exam-hub-card:active {
  transform: translateY(0);
}
.doc-hub-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.doc-hub-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 15px;
  color: var(--tx, #0f172a);
}
.doc-hub-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 12px;
}
.doc-hub-status.is-saved {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.doc-hub-status.is-req {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.3);
  animation: pulseReq 2s infinite;
}
@keyframes pulseReq {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}
.doc-hub-status.is-ordered {
  background: rgba(14, 165, 233, 0.12);
  color: #0284c7;
  border: 1px solid rgba(14, 165, 233, 0.3);
}
.doc-hub-status.is-empty {
  background: rgba(148, 163, 184, 0.14);
  color: var(--tx-m, #64748b);
  border: 1px solid rgba(148, 163, 184, 0.25);
}
.doc-hub-body {
  background: var(--ex-cell, #f8fafc);
  border: 1px solid var(--bd, #e2e8f0);
  border-radius: 8px;
  padding: 10px 12px;
  min-height: 52px;
  display: flex;
  align-items: center;
  font-size: 13px;
  color: var(--tx, #334155);
  overflow: hidden;
}
.doc-hub-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.doc-hub-btn {
  background: var(--card, #ffffff);
  border: 1.5px solid var(--bd, #cbd5e1);
  border-radius: 8px;
  padding: 6px 14px;
  font-weight: 700;
  font-size: 12.5px;
  color: var(--ac, #0f8a5f);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}
.doc-exam-hub-card:hover .doc-hub-btn {
  background: var(--ac, #0f8a5f);
  color: #ffffff;
  border-color: var(--ac, #0f8a5f);
}
.doc-hub-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(0,0,0,0.06);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  margin-right: 6px;
}

/* Modal Overlay & Full-Screen Container */
.doc-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: docModalFadeIn 0.2s ease-out;
}
@keyframes docModalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.doc-modal-fullscreen {
  width: 100vw;
  height: 100vh;
  max-width: 100%;
  max-height: 100%;
  background: var(--bg, #f8fafc);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.doc-modal-header {
  background: #134e4a;
  color: #ffffff;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
  z-index: 10;
  flex: none;
}
.doc-modal-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.doc-modal-step-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ffffff;
  color: #134e4a;
  display: inline-grid;
  place-content: center;
  font-weight: 900;
  font-size: 16px;
  flex: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.doc-modal-title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
}
.doc-modal-subtitle {
  font-size: 12px;
  color: rgba(255,255,255,0.85);
  margin-top: 2px;
}
.doc-modal-nav-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.28);
  padding: 4px;
  border-radius: 12px;
  overflow-x: auto;
}
.doc-modal-tab {
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.82);
  padding: 6px 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.doc-modal-tab:hover {
  background: rgba(255,255,255,0.12);
  color: #ffffff;
}
.doc-modal-tab.active {
  background: #ffffff;
  color: #134e4a;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  font-weight: 800;
}
.doc-modal-tab .tab-num {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0,0,0,0.15);
  color: inherit;
  font-size: 11px;
  font-weight: 800;
  display: inline-grid;
  place-content: center;
}
.doc-modal-tab.active .tab-num {
  background: #134e4a;
  color: #ffffff;
}
.doc-modal-tab .pill-cnt {
  background: rgba(0,0,0,0.15);
  color: inherit;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 800;
}
.doc-modal-close-btn {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 700;
  padding: 7px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.doc-modal-close-btn:hover {
  background: #ef4444;
  border-color: #ef4444;
  color: #ffffff;
}
.doc-modal-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 24px;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}
.doc-modal-panel {
  display: none;
  animation: docPanelFade 0.15s ease-out;
}
.doc-modal-panel.active {
  display: block;
}
@keyframes docPanelFade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.doc-modal-footer {
  background: var(--card, #ffffff);
  border-top: 1.5px solid var(--bd, #e2e8f0);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  z-index: 10;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.04);
  flex: none;
}
.doc-modal-footer-hint {
  font-size: 12px;
  color: var(--tx-m, #64748b);
  display: flex;
  align-items: center;
  gap: 6px;
}
.doc-modal-footer-hint kbd {
  background: var(--ex-cell, #f1f5f9);
  border: 1px solid var(--bd, #cbd5e1);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: inherit;
  font-weight: 700;
}
.doc-modal-footer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
body.doc-modal-open {
  overflow: hidden !important;
}

/* Dark mode adjustments */
:root[data-theme="dark"] .doc-exam-hub-card {
  background: #0d0d0d !important;
  border-color: #262626 !important;
  color: #ededed !important;
}
:root[data-theme="dark"] .doc-exam-hub-card:hover {
  border-color: #525252 !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4) !important;
}
:root[data-theme="dark"] .doc-hub-title {
  color: #ffffff !important;
}
:root[data-theme="dark"] .doc-hub-body {
  background: #141414 !important;
  border-color: #262626 !important;
  color: #d4d4d8 !important;
}
:root[data-theme="dark"] .doc-hub-btn {
  background: #171717 !important;
  border-color: #333333 !important;
  color: #ffffff !important;
}
:root[data-theme="dark"] .doc-modal-fullscreen {
  background: #000000 !important;
}
:root[data-theme="dark"] .doc-modal-header {
  background: #0a0a0a !important;
  border-bottom: 1px solid #262626 !important;
}
:root[data-theme="dark"] .doc-modal-tab.active {
  background: #ffffff !important;
  color: #000000 !important;
}
:root[data-theme="dark"] .doc-modal-footer {
  background: #0a0a0a !important;
  border-color: #262626 !important;
}
