/* =========================================================
   Nursing Staff Control & Management System
   Professional Healthcare Soft-UI Theme (ui-ux-pro-max)
   Design system: design-system/nursing-staff-care/MASTER.md
   Palette (project-locked): white, soft gray, deep purple,
   lavender, soft blue, soft gold, green, orange, red
   Typography: Figtree + Noto Sans (Khmer-capable)
   Fonts are preloaded in index.html (Google Fonts CDN).
   ========================================================= */

:root {
  /* Palette */
  --purple-900: #3a2a5b;
  --purple-800: #4b3583;
  --purple-700: #5b3e9e;
  --purple-600: #6f4fc0;
  --purple-500: #7c5cbf;
  --purple-400: #9a7fd0;
  --purple-300: #b7a3de;
  --purple-200: #ded4f2;
  --purple-50: #f4f0fc;
  --lavender-200: #e8e3f7;
  --lavender-100: #f3f0fb;
  --lavender-50: #faf9fe;

  --blue-600: #3f7fc0;
  --blue-500: #5d9ad4;
  --blue-200: #dbe9ff;
  --blue-100: #eff5ff;

  --gold-500: #d8a53f;
  --gold-200: #f6e5c3;
  --gold-100: #faf0dd;

  --green-600: #3e9a63;
  --green-500: #5bbd86;
  --green-200: #cdeedi;
  --green-100: #e9f8f0;

  --orange-600: #d97b2b;
  --orange-500: #eea04a;
  --orange-200: #ffd9b0;
  --orange-100: #fff2e3;

  --red-600: #cf4a45;
  --red-500: #e0786a;
  --red-200: #ffc4c4;
  --red-100: #ffecec;

  --gray-900: #2a2d3a;
  --gray-800: #3a3e4f;
  --gray-700: #4b4f63;
  --gray-600: #767c8b;
  --gray-500: #9aa3b5;
  --gray-400: #b9c0cd;
  --gray-300: #d9dde6;
  --gray-200: #eef0f4;
  --gray-100: #f5f6f9;
  --white: #ffffff;

  /* Spacing tokens (density 8/10 — dashboard) */
  --space-xs: 2px;
  --space-sm: 4px;
  --space-md: 8px;
  --space-lg: 12px;
  --space-xl: 16px;
  --space-2xl: 24px;
  --space-3xl: 32px;

  /* Radius */
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --radius-xs: 8px;

  /* Soft-UI depth: dual-tone light/dark shadows + inner highlight */
  --shadow-1: 0 2px 6px rgba(58, 42, 91, 0.05), 0 8px 18px rgba(58, 42, 91, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.85);
  --shadow-2: 6px 6px 16px rgba(58, 42, 91, 0.09), -5px -5px 15px rgba(255, 255, 255, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --shadow-3: 10px 10px 28px rgba(58, 42, 91, 0.14), -6px -6px 20px rgba(255, 255, 255, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --shadow-inset: inset 3px 3px 9px rgba(58, 42, 91, 0.09), inset -3px -3px 9px rgba(255, 255, 255, 0.9);
  --shadow-press: inset 2px 2px 6px rgba(58, 42, 91, 0.14), inset -2px -2px 6px rgba(255, 255, 255, 0.9);

  /* Interactivity */
  --ring: rgba(124, 92, 191, 0.45);
  --t-fast: 150ms;
  --t: 200ms;

  --muted-text: #67718a;
  --muted: #67718a;
  --border: #e4e7ee;
  --card-bg: #ffffff;

  --sidebar-w: 264px;
  --topbar-h: 68px;

  --font-main: 'Figtree', 'Noto Sans', system-ui, -apple-system, sans-serif;
  --font-kh: 'Noto Sans', 'Noto Sans Khmer', 'Figtree', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: var(--font-main);
  color: var(--gray-800);
  background:
    radial-gradient(1100px 600px at 8% -5%, rgba(124, 92, 191, 0.07), transparent 55%),
    radial-gradient(900px 520px at 105% 8%, rgba(93, 154, 212, 0.08), transparent 50%),
    var(--gray-100);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  letter-spacing: 0.005em;
}
html[lang="km"] body, html[lang="km"] .login-title, html[lang="km"] .brand-name { font-family: var(--font-kh); }
img { max-width: 100%; }
a { color: var(--purple-600); text-decoration: none; }
.hidden { display: none !important; }
.muted { color: var(--muted-text); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
b { color: var(--gray-900); }

/* Visible, consistent keyboard focus */
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 2px; }
button:focus-visible, .btn:focus-visible, .tab:focus-visible, a:focus-visible,
.nav-link:focus-visible, .seg-btn:focus-visible, .lang-btn:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }

/* ---------------- Login ---------------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(900px 500px at 12% 10%, rgba(124, 92, 191, 0.16), transparent 60%),
    radial-gradient(800px 480px at 90% 85%, rgba(93, 154, 212, 0.18), transparent 55%),
    linear-gradient(160deg, #f5f2fc 0%, #eff5fb 55%, #fbf7ef 100%);
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 28px;
  padding: 40px 36px 30px;
  box-shadow: var(--shadow-3);
  text-align: center;
  animation: riseIn .35s ease;
}
.login-logo {
  width: 84px; height: 84px;
  margin: 0 auto 18px;
  border-radius: 26px;
  background: linear-gradient(150deg, var(--purple-600), var(--purple-800));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 14px 26px rgba(91, 62, 158, 0.32), inset 0 2px 0 rgba(255,255,255,0.35), inset 0 -6px 12px rgba(58,42,91,0.28);
}
.login-cross { color: #fff; font-size: 44px; font-weight: 300; line-height: 1; }
.login-appname { color: var(--purple-700); font-weight: 700; font-size: 1.28rem; margin-bottom: 6px; letter-spacing: -0.01em; }
.login-org { color: var(--gray-600); font-size: 0.9rem; margin-bottom: 24px; }
.login-title { color: var(--gray-900); font-size: 1.05rem; font-weight: 700; margin-bottom: 10px; }
.login-error { color: var(--red-600); background: var(--red-100); border: 1px solid var(--red-200); border-radius: var(--radius-xs); padding: 10px 12px; font-size: 0.9rem; margin-bottom: 14px; }
.login-form { text-align: left; }
.field-label { font-size: 0.85rem; font-weight: 650; color: var(--gray-700); display: block; margin-bottom: 8px; }
.code-group { display: flex; gap: 8px; margin-bottom: 16px; }
.code-input {
  flex: 1;
  font-size: 1.15rem;
  letter-spacing: 0.2em;
  padding: 13px 14px;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-md);
  background: var(--white);
  box-shadow: var(--shadow-inset);
  transition: border-color var(--t), box-shadow var(--t);
  font-family: inherit;
}
.code-input:focus { outline: none; border-color: var(--purple-500); box-shadow: var(--shadow-inset), 0 0 0 4px rgba(124,92,191,0.15); }
.btn-block { width: 100%; margin-top: 4px; }
.login-btn { padding: 13px; font-size: 1rem; }
.login-secure {
  margin-top: 18px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  color: var(--gray-500); font-size: 0.82rem;
}
.login-secure i { color: var(--green-500); }
.login-lang { margin-top: 22px; display: flex; justify-content: center; align-items: center; gap: 12px; }
.login-lang .lang-btn { background: none; border: none; color: var(--gray-500); font-weight: 650; cursor: pointer; font-size: 0.9rem; padding: 4px 6px; border-radius: 8px; }
.login-lang .lang-btn.active { color: var(--purple-700); }
.login-lang .lang-btn:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
.login-lang .lang-divider { color: var(--gray-300); }

/* ---------------- App layout ---------------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #ffffff, #f6f3fc);
  border-right: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 40;
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  box-shadow: 8px 0 24px rgba(58, 42, 91, 0.06);
}
.sidebar-head { display: flex; align-items: center; gap: 12px; padding: 20px 18px 14px; }
.logo-badge {
  width: 44px; height: 44px; border-radius: 15px;
  background: linear-gradient(150deg, var(--purple-600), var(--purple-800));
  display: flex; align-items: center; justify-content: center;
  flex: none;
  box-shadow: 0 8px 18px rgba(91, 62, 158, 0.32), inset 0 1px 0 rgba(255,255,255,0.35);
}
.cross { color: #fff; font-size: 24px; font-weight: 300; line-height: 1; }
.brand { min-width: 0; }
.brand-name { font-weight: 800; color: var(--purple-800); font-size: 0.98rem; line-height: 1.2; }
.brand-org { color: var(--gray-500); font-size: 0.72rem; }
.sidebar-close { display: none; margin-left: auto; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 6px 14px 20px; }
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 8px; }
.nav-section {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--gray-500); margin: 16px 10px 6px;
}
/* Collapsible sidebar sections (accordion) */
.nav-group { margin-bottom: 2px; }
.nav-section.nav-section-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; margin: 10px 0 2px; padding: 9px 10px;
  background: transparent; border: none; cursor: pointer; font: inherit;
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--gray-500); border-radius: var(--radius-sm); text-align: left;
  transition: background var(--t), color var(--t);
}
.nav-section.nav-section-toggle:hover { background: var(--lavender-100); color: var(--purple-700); }
.nav-section-label { flex: 1; }
.nav-section-chev { font-size: 0.66rem; color: var(--gray-400); transition: transform var(--t); }
.nav-group.open .nav-section-toggle { color: var(--purple-700); }
.nav-group.open .nav-section-toggle .nav-section-chev { transform: rotate(180deg); }
.nav-group-items { display: none; }
.nav-group.open > .nav-group-items { display: block; padding-left: 6px; border-left: 2px solid var(--lavender-100); margin-left: 8px; }
.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--gray-700);
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 2px;
  transition: background var(--t), color var(--t), box-shadow var(--t), transform var(--t-fast);
  position: relative;
}
.nav-link i { width: 20px; text-align: center; color: var(--gray-500); transition: color var(--t); }
.nav-link .nav-label { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nav-link .nav-text { line-height: 1.15; }
.nav-link .nav-sub { font-size: 0.72rem; font-weight: 600; color: var(--gray-600); line-height: 1.2; letter-spacing: 0.01em; margin-top: 1px; }
.nav-link.active .nav-sub { color: rgba(255, 255, 255, 0.85); }
.nav-link:hover { background: var(--lavender-100); color: var(--purple-700); }
.nav-link:hover i { color: var(--purple-600); }
.nav-link.active {
  background: linear-gradient(120deg, var(--purple-700), var(--purple-600));
  color: #fff;
  box-shadow: 0 8px 18px rgba(91, 62, 158, 0.32), inset 0 1px 0 rgba(255,255,255,0.25);
}
.nav-link.active::before {
  content: ''; position: absolute; left: -14px; top: 20%; bottom: 20%;
  width: 5px; border-radius: 0 6px 6px 0;
  background: var(--purple-500);
}
.nav-link.active i { color: #fff; }
.nav-section-row { display: flex; align-items: center; gap: 2px; position: relative; }
.nav-section-row .nav-section-toggle { flex: 1; min-width: 0; }
.nav-section-ctrl {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; padding: 0; margin-top: 8px;
  border: none; background: transparent; border-radius: 7px;
  color: var(--gray-400); cursor: pointer; opacity: 0.7;
}
.nav-section-row:hover .nav-section-ctrl, .nav-section-ctrl:focus-visible { opacity: 1; }
.nav-section-ctrl:hover { background: var(--lavender-100); color: var(--purple-700); }
.nav-link .nav-ctrl {
  margin-left: auto; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; padding: 0;
  border: none; background: transparent; border-radius: 7px;
  color: var(--gray-400); cursor: pointer;
}
.nav-link .nav-ctrl:hover { background: var(--gray-100); color: var(--purple-700); }
.nav-link.active .nav-ctrl { color: rgba(255, 255, 255, 0.8); }
.nav-link.active .nav-ctrl:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }
.sidebar-foot { padding: 14px 18px; border-top: 1px solid var(--gray-200); }
.user-chip { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(150deg, var(--gold-500), #e2b45a);
  color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex: none;
  box-shadow: 0 4px 10px rgba(216, 165, 63, 0.3), inset 0 1px 0 rgba(255,255,255,0.4);
}
.user-name { font-weight: 600; color: var(--gray-800); font-size: 0.9rem; }
.user-role { color: var(--gray-500); font-size: 0.75rem; }

.main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; }

/* Topbar */
.topbar {
  height: var(--topbar-h);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--gray-200);
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px;
  gap: 12px;
}
.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.menu-btn { display: none; }
.page-title { font-size: 1.22rem; font-weight: 800; color: var(--gray-900); letter-spacing: -0.02em; }
.page-sub { font-size: 0.82rem; color: var(--gray-500); }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.top-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--gray-100);
  border: 1.5px solid var(--gray-200);
  border-radius: 999px;
  padding: 8px 14px;
  min-width: 220px;
  box-shadow: var(--shadow-inset);
  transition: border-color var(--t), box-shadow var(--t), background var(--t);
}
.top-search:focus-within { border-color: var(--purple-500); box-shadow: var(--shadow-inset), 0 0 0 3px rgba(124,92,191,0.12); background: #fff; }
.top-search i { color: var(--gray-500); font-size: 0.85rem; }
.top-search input { border: none; background: none; outline: none; font-family: inherit; font-size: 0.9rem; color: var(--gray-800); width: 100%; }
.lang-switch { display: flex; align-items: center; gap: 2px; background: var(--gray-100); padding: 4px 8px; border-radius: 999px; border: 1.5px solid var(--gray-200); box-shadow: var(--shadow-inset); }
.lang-btn { background: none; border: none; cursor: pointer; font-weight: 700; font-size: 0.8rem; color: var(--gray-500); padding: 3px 6px; border-radius: 999px; transition: all var(--t); font-family: var(--font-main); }
.lang-btn.active { color: var(--purple-700); }
.lang-switch .lang-btn.active { background: var(--white); box-shadow: 0 2px 6px rgba(91, 62, 158, 0.18); }
.lang-divider { color: var(--gray-300); }
.icon-btn {
  width: 44px; height: 44px; border-radius: 14px;
  border: none; cursor: pointer;
  background: var(--gray-100);
  color: var(--gray-700);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background var(--t), color var(--t), transform var(--t-fast), box-shadow var(--t);
  font-size: 0.95rem;
}
.icon-btn:hover { background: var(--lavender-100); color: var(--purple-700); transform: translateY(-1px); }
.icon-btn:active { transform: scale(0.94); box-shadow: var(--shadow-press); }
.bell { position: relative; }
.bell-dot {
  position: absolute; top: 4px; right: 4px;
  background: var(--red-500); color: #fff;
  font-size: 0.6rem; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 999px;
  display: none; align-items: center; justify-content: center;
  padding: 0 4px;
}
.bell-dot.show { display: flex; }

/* Notif panel */
.notif-panel {
  position: absolute; top: calc(var(--topbar-h) - 8px); right: 18px;
  width: 340px;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-3);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  max-height: 480px;
  overflow-y: auto;
  z-index: 60;
}
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--gray-200); }
.notif-title { font-weight: 700; color: var(--gray-900); }
.notif-item { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--gray-100); align-items: flex-start; transition: background var(--t); }
.notif-item:hover { background: var(--lavender-100); }
.notif-ico { width: 34px; height: 34px; border-radius: 10px; background: var(--lavender-100); color: var(--purple-600); display: flex; align-items: center; justify-content: center; flex: none; }
.notif-ico.unread { background: var(--purple-100, #efe9fb); }
.notif-body { flex: 1; min-width: 0; }
.notif-msg { font-size: 0.85rem; color: var(--gray-800); font-weight: 500; }
.notif-time { font-size: 0.72rem; color: var(--gray-500); margin-top: 2px; }
.notif-unread { width: 8px; height: 8px; border-radius: 50%; background: var(--purple-500); flex: none; margin-top: 6px; }

/* Content */
.content { padding: 24px; flex: 1; animation: fadeUp .25s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes riseIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------------- Cards / soft-UI ---------------- */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-2);
  padding: 20px;
  margin-bottom: 20px;
  transition: box-shadow var(--t);
}
.card:hover { box-shadow: var(--shadow-3); }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 12px; flex-wrap: wrap; }
.card-title { font-weight: 700; color: var(--gray-900); font-size: 1rem; }
.card-body { color: var(--gray-700); }
.date-chip {
  background: var(--lavender-100); color: var(--purple-600);
  font-size: 0.8rem; font-weight: 600;
  padding: 6px 12px; border-radius: 999px;
  box-shadow: var(--shadow-inset);
}

/* KPI grid */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.kpi-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  padding: 18px;
  display: flex; gap: 14px; align-items: center;
  transition: transform var(--t-fast), box-shadow var(--t);
  border: 1px solid rgba(255, 255, 255, 0.9);
  position: relative; overflow: hidden;
  cursor: default;
}
.kpi-card::after {
  content: ''; position: absolute; right: -24px; top: -24px;
  width: 90px; height: 90px; border-radius: 50%;
  background: var(--soft, var(--lavender-100));
  opacity: 0.6;
}
.kpi-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-3); }
.kpi-icon {
  width: 50px; height: 50px; border-radius: 16px;
  background: var(--soft, var(--lavender-100));
  color: var(--ink, var(--purple-600));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  flex: none;
  box-shadow: var(--shadow-inset);
}
.kpi-value { font-size: 1.7rem; font-weight: 800; color: var(--gray-900); line-height: 1.1; letter-spacing: -0.02em; }
.kpi-label { color: var(--gray-600); font-size: 0.82rem; }
.kpi-purple { --soft: #ede7fb; --ink: var(--purple-600); }
.kpi-green { --soft: var(--green-100); --ink: var(--green-600); }
.kpi-blue { --soft: var(--blue-100); --ink: var(--blue-600); }
.kpi-gold { --soft: var(--gold-100); --ink: var(--gold-500); }
.kpi-orange { --soft: var(--orange-100); --ink: var(--orange-600); }
.kpi-red { --soft: var(--red-100); --ink: var(--red-600); }
.kpi-teal { --soft: #e3f4f1; --ink: #2d9d8c; }
.kpi-indigo { --soft: #e8e7fb; --ink: #5a5bc7; }

.mini-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 18px; }
.mini-kpi {
  background: var(--white); border-radius: var(--radius-md);
  box-shadow: var(--shadow-1); padding: 14px;
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.9);
  transition: transform var(--t-fast), box-shadow var(--t);
}
.mini-kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.mini-kpi-icon { width: 40px; height: 40px; border-radius: 13px; background: var(--lavender-100); color: var(--purple-600); display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-inset); }
.mini-kpi-val { font-weight: 800; font-size: 1.35rem; color: var(--gray-900); }
.mini-kpi-label { font-size: 0.78rem; color: var(--gray-500); font-weight: 600; }
.mini-kpi.kpi-green .mini-kpi-icon { background: var(--green-100); color: var(--green-600); }
.mini-kpi.kpi-purple .mini-kpi-icon { background: var(--lavender-100); color: var(--purple-600); }
.mini-kpi.kpi-blue .mini-kpi-icon { background: var(--blue-100); color: var(--blue-600); }
.mini-kpi.kpi-gold .mini-kpi-icon { background: var(--gold-100); color: var(--gold-500); }
.mini-kpi.kpi-red .mini-kpi-icon { background: var(--red-100); color: var(--red-600); }
.mini-kpi.kpi-teal .mini-kpi-icon { background: #e3f4f1; color: #2d9d8c; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* ---------------- Tables ---------------- */
.table-wrap { overflow-x: auto; }
.table-wrap.scrollable { max-height: calc(100vh - 290px); overflow-y: auto; }
.table-wrap.scrollable thead th { position: sticky; top: 0; z-index: 2; background: var(--gray-100); box-shadow: 0 1px 0 var(--gray-200); }
.data-table.staff-wide { min-width: 1900px; }
.data-table.staff-wide th, .data-table.staff-wide td { white-space: nowrap; }
.staff-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; padding: 8px 10px; background: var(--purple-50); border: 1px solid var(--purple-200); border-radius: var(--radius-md); }
.staff-links .btn { color: var(--purple-700); border-color: var(--purple-300); }
.staff-links .btn:hover { background: var(--purple-100); }
a.dept-link { color: var(--purple-700); text-decoration: none; border-bottom: 1px dashed var(--purple-300); }
a.dept-link:hover { color: var(--purple-900); border-bottom-style: solid; text-decoration: none; }
.checklist-box { margin-top: 14px; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px; background: var(--card-bg); }
.checklist-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.checklist-title { font-weight: 600; color: var(--text); }
.checklist-title i { color: var(--purple-600); margin-right: 6px; }
.checklist-box .progress { flex: 1; min-width: 140px; height: 8px; background: var(--bg-2); border-radius: 99px; overflow: hidden; }
.checklist-box .progress-bar { height: 100%; background: linear-gradient(90deg, var(--purple-500), var(--green-500)); transition: width .3s ease; }
.checklist-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--radius-sm); }
.checklist-item:nth-child(odd) { background: var(--bg-1); }
.checklist-item.done .check-title { text-decoration: line-through; opacity: .72; }
.check-toggle { display: flex; align-items: center; gap: 8px; flex: 1; cursor: pointer; }
.check-toggle input[type='checkbox'] { width: 16px; height: 16px; accent-color: var(--green-500); cursor: pointer; }
.check-actions { display: flex; align-items: center; gap: 6px; }
.check-fname { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; }
.check-full { color: var(--green-600); font-weight: 600; }
.check-part { color: var(--warn-600); font-weight: 600; }
.dept-stats { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.dept-stat { display: flex; align-items: baseline; gap: 8px; padding: 12px 18px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--card-bg); }
.dept-stat-ic { color: var(--purple-500); font-size: 15px; }
.dept-stat-name { color: var(--muted); font-weight: 600; }
.dept-stat-num { font-size: 26px; font-weight: 800; color: var(--purple-700); }
.dept-stat.total { border-color: var(--purple-300); background: var(--purple-50); }
.dept-stat.total .dept-stat-name { color: var(--purple-700); }
.dept-stat.total .dept-stat-num { color: var(--purple-800); }
.dept-total-note { margin-top: 4px; color: var(--muted); font-size: 13px; }

/* --- Staffing structure flowchart --- */
.dept-flow { margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--gray-300); }
.dept-flow-head { display: flex; align-items: center; gap: 8px; }
.dept-flow-ic { color: var(--purple-500); font-size: 15px; }
.dept-flow-title { margin: 0; font-size: 15px; font-weight: 700; color: var(--purple-800); }
.dept-flow-summary { margin: 4px 0 6px; color: var(--muted); font-size: 12.5px; }
.org-scroll { overflow-x: auto; overflow-y: hidden; padding: 4px 2px 8px; }
.org-chart { display: flex; flex-direction: column; align-items: center; min-width: max-content; margin: 0 auto; }
.org-level { position: relative; display: flex; justify-content: center; gap: 16px; padding-top: 34px; }
.org-split::before {
  content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 2px; height: 17px; background: var(--purple-300);
}
.org-bar { position: absolute; top: 17px; height: 2px; background: var(--purple-300); }
.org-node {
  position: relative; width: 156px; box-sizing: border-box;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 11px 8px; text-align: center;
  border: 1px solid var(--purple-300); border-radius: var(--radius-md);
  background: var(--white); box-shadow: var(--shadow-1);
}
.org-level:not(.org-split) > .org-node::before {
  content: ''; position: absolute; top: -34px; left: 50%; transform: translateX(-50%);
  width: 2px; height: 34px; background: var(--purple-300);
}
.org-split > .org-node::before {
  content: ''; position: absolute; top: -17px; left: 50%; transform: translateX(-50%);
  width: 2px; height: 17px; background: var(--purple-300);
}
.org-ico { font-size: 17px; color: var(--purple-600); }
.org-role { font-size: 12.5px; font-weight: 700; color: var(--gray-800); line-height: 1.25; }
.org-idx {
  min-width: 20px; padding: 1px 6px; border-radius: 999px;
  background: var(--lavender-100); color: var(--purple-700);
  font-size: 11px; font-weight: 800;
}
.org-node.t1 { border-color: var(--purple-500); background: var(--lavender-100); }
.org-node.t1 .org-ico { color: var(--purple-700); }
.org-node.t2 { border-color: var(--blue-500); background: var(--blue-100); }
.org-node.t2 .org-ico { color: var(--blue-600); }
.org-node.t3 { border-color: var(--gold-500); background: var(--gold-100); }
.org-node.t3 .org-ico { color: var(--gold-500); }
.org-node.t4 { border-color: var(--green-500); background: var(--green-100); }
.org-node.t4 .org-ico { color: var(--green-600); }
.org-leaf { gap: 16px; }
.org-leaf-node {
  cursor: pointer; border-style: dashed; background: var(--white);
  color: var(--purple-700); transition: transform var(--t-fast), background var(--t-fast);
}
.org-leaf-node .org-plus { font-size: 15px; color: var(--purple-600); }
.org-leaf-node .org-role { color: var(--purple-700); }
.org-leaf-node:hover { background: var(--lavender-100); transform: translateY(-2px); }
.org-leaf-node:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
/* name assigned to a flowchart box */
.org-role-row { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-width: 0; }
.org-name { display: flex; align-items: center; gap: 3px; width: 100%; min-width: 0; min-height: 22px; margin-top: 4px; }
.org-name-btn {
  flex: 1 1 auto; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 5px;
  padding: 3px 7px; border: 1px dashed var(--gray-300); border-radius: 999px;
  background: var(--gray-100); color: var(--gray-700);
  font-size: 11px; font-weight: 700; font-family: inherit; cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.org-name-btn.is-empty { color: var(--muted-text); font-weight: 600; }
.org-name-btn:hover { background: var(--lavender-100); border-color: var(--purple-300); color: var(--purple-700); }
.org-name-btn:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
.org-name-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-name-ic { font-size: 9px; opacity: 0.7; flex: none; }
.org-names { display: flex; flex-direction: column; gap: 4px; width: 100%; min-width: 0; min-height: 22px; margin-top: 4px; }
.org-name-row { display: flex; align-items: center; gap: 3px; width: 100%; min-width: 0; }
.org-name-row .org-name-txt { flex: 1 1 auto; text-align: center; font-size: 11px; font-weight: 700; color: var(--gray-800); }
.org-name-row .org-name-del { opacity: 0.75; }
.org-name-row:hover .org-name-del { opacity: 1; }
.org-name-add {
  display: flex; align-items: center; justify-content: center; gap: 4px; width: 100%;
  padding: 3px 6px; border: 1px dashed var(--purple-300); border-radius: 999px;
  background: var(--white); color: var(--purple-700);
  font-size: 10.5px; font-weight: 700; font-family: inherit; cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.org-name-add:hover { background: var(--lavender-100); border-color: var(--purple-500); }
.org-name-add:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }

/* staff boxes stacked under each Leader - one staff per box */
.org-under { align-items: flex-start; }
.org-staff-col { position: relative; width: 156px; display: flex; flex-direction: column; gap: 6px; }
.org-under > .org-staff-col::before {
  content: ''; position: absolute; top: -34px; left: 50%; transform: translateX(-50%);
  width: 2px; height: 34px; background: var(--purple-300);
}
.org-staff-node {
  display: flex; align-items: center; gap: 4px; width: 100%; min-width: 0;
  padding: 5px 7px; border: 1px solid var(--gray-300); border-radius: var(--radius-sm);
  background: var(--white); box-shadow: var(--shadow-1);
}
.org-staff-node .org-name-txt {
  flex: 1 1 auto; min-width: 0; text-align: center;
  font-size: 11px; font-weight: 700; color: var(--gray-800);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.org-staff-node .org-name-del { opacity: 0.75; }
.org-staff-node:hover .org-name-del { opacity: 1; }
.org-under-add {
  display: flex; align-items: center; justify-content: center; gap: 5px; width: 100%;
  padding: 6px 4px; border: 1px dashed var(--purple-300); border-radius: var(--radius-sm);
  background: var(--white); color: var(--purple-700);
  font-size: 11px; font-weight: 700; font-family: inherit; cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.org-under-add:hover { background: var(--lavender-100); border-color: var(--purple-500); }
.org-under-add:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
.org-name-del {
  flex: none; width: 20px; height: 20px; padding: 0; display: grid; place-items: center;
  border: 1px solid var(--red-200); border-radius: 50%; background: var(--red-100);
  color: var(--red-600); font-size: 10px; cursor: pointer; transition: background var(--t-fast), color var(--t-fast);
}
.org-name-del:hover { background: var(--red-500); border-color: var(--red-500); color: #fff; }
.org-name-del:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }

@media (max-width: 640px) {
  .org-node { width: 132px; }
  .org-staff-col { width: 132px; }
  .dept-flow-title { font-size: 14px; }
}
@media (max-width: 640px) { .staff-links { margin-top: 8px; } }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.87rem; }
.data-table th {
  text-align: left; padding: 11px 12px;
  color: var(--gray-600); font-weight: 700; font-size: 0.75rem;
  text-transform: uppercase; letter-spacing: 0.04em;
  border-bottom: 2px solid var(--gray-200);
  white-space: nowrap;
}
.data-table td { padding: 12px; border-bottom: 1px solid var(--gray-100); color: var(--gray-700); vertical-align: middle; }
.data-table tbody tr { transition: background var(--t-fast); }
.data-table tbody tr:hover { background: var(--lavender-100); }
.data-table .no-data-row:hover { background: none; }
.table-link { color: var(--purple-600); font-weight: 600; }
.table-link:hover { text-decoration: underline; }
.row-actions { display: flex; gap: 6px; }
.act-ok { color: var(--green-600); }
.act-danger { color: var(--red-600); }

.avatar-cell { width: 38px; height: 38px; border-radius: 50%; overflow: hidden; background: var(--lavender-100); display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-inset); }
.avatar-cell img { width: 100%; height: 100%; object-fit: cover; }
.avatar-text { font-weight: 700; color: var(--purple-600); }
.avatar-cell-empty { background: var(--gray-200); }

/* Badges */
.badge {
  display: inline-flex; align-items: center;
  padding: 4px 11px; border-radius: 999px;
  font-size: 0.74rem; font-weight: 700;
  white-space: nowrap;
}
.badge-ok { background: var(--green-100); color: var(--green-600); }
.badge-warn { background: var(--orange-100); color: var(--orange-600); }
.badge-danger { background: var(--red-100); color: var(--red-600); }
.badge-info { background: var(--blue-100); color: var(--blue-600); }
.badge-purple { background: var(--lavender-100); color: var(--purple-600); }
.badge-muted { background: var(--gray-200); color: var(--gray-600); }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: none; cursor: pointer;
  padding: 10px 18px;
  min-height: 40px;
  border-radius: var(--radius-md);
  font-weight: 600; font-size: 0.88rem;
  font-family: inherit;
  transition: all var(--t);
  line-height: 1.2;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px) scale(0.98); box-shadow: var(--shadow-press); }
.btn-primary {
  background: linear-gradient(120deg, var(--purple-700), var(--purple-600));
  color: #fff;
  box-shadow: 0 8px 18px rgba(91, 62, 158, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.btn-primary:hover { box-shadow: 0 10px 24px rgba(91, 62, 158, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.22); transform: translateY(-1px); }
.btn-ghost { background: var(--gray-100); color: var(--gray-700); box-shadow: var(--shadow-inset); }
.btn-ghost:hover { background: var(--gray-200); color: var(--gray-800); }
.btn-outline { background: #fff; color: var(--purple-600); border: 1.5px solid var(--purple-300); }
.btn-outline:hover { background: var(--lavender-100); }
.btn-danger { background: var(--red-100); color: var(--red-600); }
.btn-danger:hover { background: var(--red-200); }
.btn-sm { padding: 7px 13px; min-height: 34px; font-size: 0.8rem; border-radius: 10px; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; transform: none; }

/* ---------------- Toolbar / filters ---------------- */
.toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar-left { display: flex; gap: 10px; flex-wrap: wrap; flex: 1; }
.toolbar-right { display: flex; gap: 8px; flex-wrap: wrap; }
.icon-only { padding-left: 11px; padding-right: 11px; }
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--white); border: 1.5px solid var(--gray-200);
  border-radius: 12px; padding: 9px 13px;
  min-width: 210px;
  box-shadow: var(--shadow-1);
  transition: border-color var(--t), box-shadow var(--t);
}
.search-box:focus-within { border-color: var(--purple-500); box-shadow: var(--shadow-inset), 0 0 0 3px rgba(124,92,191,0.12); }
.search-box i { color: var(--gray-500); }
.inp-search { border: none; outline: none; background: none; font-family: inherit; font-size: 0.9rem; width: 100%; color: var(--gray-800); }
.inp-select, .inp-input {
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  border-radius: 12px;
  padding: 9px 12px;
  font-family: inherit; font-size: 0.88rem;
  color: var(--gray-800);
  max-width: 220px;
  min-width: 140px;
  box-shadow: var(--shadow-1);
  transition: border-color var(--t), box-shadow var(--t);
}
.inp-select:focus, .inp-input:focus { outline: none; border-color: var(--purple-500); box-shadow: var(--shadow-inset), 0 0 0 3px rgba(124,92,191,0.12); }
.filter-bar { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; background: var(--white); border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow-1); align-items: flex-end; }
.f-label { display: flex; flex-direction: column; gap: 5px; }
.f-label label { font-size: 0.76rem; font-weight: 600; color: var(--gray-600); }
.filter-row { margin-bottom: 14px; }

/* ---------------- Forms ---------------- */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 18px; }
.form-grid .field { display: flex; flex-direction: column; gap: 6px; }
.form-grid .field.full { grid-column: 1 / -1; }
.form-section { grid-column: 1 / -1; font-size: 0.82rem; font-weight: 750; letter-spacing: 0.02em; color: var(--purple-600); text-transform: uppercase; margin-top: 6px; }
.form-section:first-child { margin-top: 0; }
.field-hint { font-size: 0.72rem; color: var(--gray-500); }
.doc-number-field { font-weight: 700; color: var(--purple-700); background: var(--lavender-100) !important; letter-spacing: 0.02em; }
.doc-number { font-weight: 700; color: var(--purple-700); white-space: nowrap; }
.doc-preview { margin-top: 14px; border: 1px solid var(--gray-200); border-radius: 12px; overflow: hidden; }
.doc-img { display: block; width: 100%; max-height: 60vh; object-fit: contain; background: var(--gray-100); }
.doc-text { margin: 0; max-height: 60vh; overflow: auto; padding: 16px; background: var(--gray-100); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.82rem; line-height: 1.5; color: var(--gray-800); white-space: pre-wrap; word-break: break-word; }
.doc-unavailable { padding: 32px 20px; text-align: center; color: var(--gray-500); background: var(--gray-100); font-size: 0.86rem; }
.file-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.file-item { display: flex; align-items: center; gap: 8px; }
.file-item .file-chip { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-no { flex: 0 0 auto; font-size: 0.76rem; font-weight: 700; color: var(--purple-700); background: var(--purple-100); padding: 3px 9px; border-radius: 6px; white-space: nowrap; }
.doc-files-title { margin-top: 16px; font-size: 0.82rem; font-weight: 700; color: var(--gray-700); }
.doc-file-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--gray-100); border-bottom: 1px solid var(--gray-200); }
.doc-file-name { flex: 1 1 auto; font-weight: 650; font-size: 0.84rem; color: var(--gray-800); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-file-size { font-size: 0.76rem; color: var(--gray-500); }
.doc-link { color: var(--blue-600); word-break: break-all; }
.crumb { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; }
.crumb-link { color: var(--blue-600); cursor: pointer; font-weight: 600; }
.crumb-link:hover { text-decoration: underline; }
.crumb-sep { color: var(--gray-400); }
.crumb-current { font-weight: 700; color: var(--gray-800); }
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.folder-grid.list { grid-template-columns: 1fr; gap: 8px; }
.folder-grid.list .folder-card { padding: 10px 14px; }
.folder-card { display: flex; align-items: center; gap: 12px; padding: 16px; border: 1px solid var(--gray-200); border-radius: 12px; background: #fff; cursor: pointer; transition: box-shadow .15s, transform .15s, border-color .15s; }
.folder-card:hover { box-shadow: 0 6px 18px rgba(15, 23, 42, .08); border-color: var(--blue-200); transform: translateY(-1px); }
.folder-icon { width: 44px; height: 44px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; background: var(--blue-100); color: var(--blue-600); font-size: 1.15rem; }
.folder-body { flex: 1 1 auto; min-width: 0; }
.folder-code { font-weight: 700; color: var(--gray-800); font-size: 0.92rem; }
.folder-name { font-size: 0.78rem; color: var(--gray-500); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-count { font-size: 0.74rem; color: var(--blue-600); font-weight: 600; margin-top: 4px; }
.folder-actions { display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.folder-card:hover .folder-actions { opacity: 1; }
.folder-title { font-size: 1rem; font-weight: 700; color: var(--gray-800); margin-bottom: 12px; }
.folder-section { font-size: 0.76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--gray-500); margin: 16px 0 10px; }
.empty-state { padding: 40px 20px; text-align: center; color: var(--gray-500); background: var(--gray-100); border-radius: 12px; font-size: 0.9rem; }
.field label { font-size: 0.8rem; font-weight: 650; color: var(--gray-700); }
.field input, .field select, .field textarea {
  border: 1.5px solid var(--gray-200);
  border-radius: 12px;
  padding: 10px 13px;
  font-family: inherit; font-size: 0.88rem;
  background: var(--white);
  color: var(--gray-800);
  transition: border-color var(--t), box-shadow var(--t);
  width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--purple-500);
  box-shadow: var(--shadow-inset), 0 0 0 3px rgba(124,92,191,0.12);
}

/* ---------------- Modal ---------------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(58, 42, 91, 0.4);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  padding: 20px;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-3);
  animation: popIn .22s cubic-bezier(.2,.9,.3,1.2);
  overflow: hidden;
}
.modal-wide { max-width: 860px; }
.modal-sm { max-width: 420px; }
@keyframes popIn { from { opacity: 0; transform: scale(.95) translateY(10px); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--gray-200); }
.modal-head h3 { font-size: 1.05rem; color: var(--gray-900); }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--gray-200); background: var(--gray-100); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

/* ---------------- Info grid (profile) ---------------- */
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.info-item { background: var(--gray-100); border-radius: var(--radius-md); padding: 12px 14px; border: 1px solid var(--gray-200); box-shadow: var(--shadow-inset); }
.info-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--gray-500); margin-bottom: 3px; }
.info-value { font-size: 0.94rem; color: var(--gray-800); font-weight: 600; word-break: break-word; }

/* Profile header */
.profile-header {
  display: flex; align-items: center; gap: 20px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  padding: 24px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.profile-avatar-lg {
  width: 84px; height: 84px; border-radius: 50%;
  background: linear-gradient(150deg, var(--purple-600), var(--purple-800));
  color: #fff; font-weight: 800; font-size: 1.8rem;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex: none;
  box-shadow: 0 10px 22px rgba(91, 62, 158, 0.3), inset 0 2px 0 rgba(255,255,255,0.3);
}
.profile-avatar-lg img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar-lg.clickable { cursor: pointer; position: relative; }
.profile-avatar-lg .avatar-cam { position: absolute; left: 0; right: 0; bottom: 0; height: 26px; display: flex; align-items: center; justify-content: center; background: rgba(15, 23, 42, .55); color: #fff; font-size: .8rem; opacity: 0; transition: opacity var(--t); }
.profile-avatar-lg.clickable:hover .avatar-cam { opacity: 1; }
.photo-field { display: flex; gap: 14px; align-items: center; }
.photo-preview { width: 72px; height: 72px; border-radius: 50%; overflow: hidden; background: var(--lavender-100); display: flex; align-items: center; justify-content: center; color: var(--purple-600); font-size: 1.5rem; flex: none; box-shadow: var(--shadow-inset); }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-field-side { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.photo-remove { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--gray-600); }
.img-lightbox { position: fixed; inset: 0; z-index: 3000; background: rgba(8, 10, 20, .82); display: flex; align-items: center; justify-content: center; padding: 30px; cursor: zoom-out; animation: fadeIn .15s ease; }
.img-lightbox-img { max-width: 90vw; max-height: 88vh; border-radius: 10px; box-shadow: 0 24px 60px rgba(0, 0, 0, .5); cursor: zoom-in; transition: transform .18s ease; }
.img-lightbox.zoomed .img-lightbox-img { transform: scale(1.6); cursor: zoom-out; }
.img-lightbox-close { position: absolute; top: 16px; right: 20px; width: 40px; height: 40px; border-radius: 50%; border: none; background: rgba(255, 255, 255, .15); color: #fff; font-size: 1.1rem; cursor: pointer; transition: background var(--t); }
.img-lightbox-close:hover { background: rgba(255, 255, 255, .3); }
.img-lightbox-download { position: absolute; top: 16px; right: 70px; width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, .15); color: #fff; font-size: 1rem; display: flex; align-items: center; justify-content: center; text-decoration: none; transition: background var(--t); }
.img-lightbox-download:hover { background: rgba(255, 255, 255, .3); }
.bulk-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; margin-bottom: 10px; background: var(--lavender-100); border: 1px solid var(--lavender-200); border-radius: var(--radius-md); }
.bulk-count { font-weight: 600; font-size: .85rem; color: var(--purple-700); margin-right: auto; }
.row-check { width: 16px; height: 16px; cursor: pointer; accent-color: var(--purple-600); }
.attach-bar { display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--gray-200); }
.attach-hint { color: var(--gray-600); font-size: .85rem; }
.attach-hint i { margin-right: 8px; color: var(--purple-600); }
.attach-list { display: flex; flex-direction: column; margin-top: 12px; }
.attach-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--gray-200); border-radius: var(--radius-md); margin-bottom: 8px; background: var(--white); }
.attach-item .file-ic { color: var(--purple-600); font-size: 1.15rem; }
.attach-info { flex: 1; min-width: 0; }
.attach-name { font-weight: 600; font-size: .88rem; color: var(--gray-800); word-break: break-all; }
.attach-meta { font-size: .75rem; color: var(--gray-500); margin-top: 2px; }
.attach-actions { display: flex; gap: 8px; }
.profile-head-info { flex: 1; min-width: 200px; }
.profile-name { font-size: 1.35rem; font-weight: 800; color: var(--gray-900); }
.profile-id { color: var(--gray-500); font-size: 0.85rem; font-weight: 600; margin: 2px 0 8px; }
.profile-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chip { background: var(--gray-100); border-radius: 999px; padding: 4px 12px; font-size: 0.78rem; font-weight: 600; color: var(--gray-700); box-shadow: var(--shadow-inset); }
.profile-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.profile-card { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--white); border: 1px solid var(--gray-200); border-radius: 12px; cursor: pointer; box-shadow: var(--shadow-1); transition: box-shadow var(--t), transform var(--t), border-color var(--t); }
.profile-card:hover { box-shadow: 0 6px 18px rgba(15, 23, 42, .08); border-color: var(--purple-300, var(--purple-500)); transform: translateY(-1px); }
.profile-avatar { width: 46px; height: 46px; border-radius: 50%; flex: none; overflow: hidden; background: linear-gradient(150deg, var(--purple-600), var(--purple-800)); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-card-body { min-width: 0; }
.profile-card-name { font-weight: 700; color: var(--gray-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-card-id { font-size: 0.76rem; color: var(--gray-500); font-weight: 600; }
.profile-card-meta { font-size: 0.8rem; color: var(--gray-600); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-back { margin-bottom: 14px; }

/* Tabs */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; background: var(--white); padding: 8px; border-radius: var(--radius-md); box-shadow: var(--shadow-1); }
.tab {
  border: none; background: none; cursor: pointer;
  padding: 10px 16px; border-radius: 10px;
  font-weight: 600; font-size: 0.85rem;
  color: var(--gray-600);
  font-family: inherit;
  transition: all var(--t);
}
.tab:hover { color: var(--purple-600); background: var(--lavender-100); }
.tab.active { background: linear-gradient(120deg, var(--purple-700), var(--purple-600)); color: #fff; box-shadow: 0 6px 14px rgba(91, 62, 158, 0.28), inset 0 1px 0 rgba(255,255,255,0.2); }
.tab-body { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-2); padding: 22px; }
.tab-h3 { font-size: 1rem; color: var(--gray-900); margin: 20px 0 10px; }
.tab-h3:first-child { margin-top: 0; }

/* ---------------- Charts ---------------- */
.charts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-bottom: 20px; }
.chart-card { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-1); padding: 16px; }
.chart-title { font-weight: 700; color: var(--gray-800); font-size: 0.9rem; margin-bottom: 10px; }
.chart-canvas { width: 100%; height: 210px; }

/* ---------------- Attention list ---------------- */
.attention-list { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; }
.attention-item { display: flex; gap: 12px; align-items: center; background: var(--gray-100); border-radius: var(--radius-md); padding: 10px 12px; border: 1px solid var(--gray-200); transition: all var(--t); color: var(--gray-800); box-shadow: var(--shadow-inset); }
.attention-item:hover { background: var(--lavender-100); border-color: var(--purple-300); transform: translateX(2px); }
.attention-ico { width: 38px; height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex: none; }
.attn-license { background: var(--gold-100); color: var(--gold-500); }
.attn-contract { background: var(--orange-100); color: var(--orange-600); }
.attn-probation { background: var(--blue-100); color: var(--blue-600); }
.attn-training { background: var(--purple-100, var(--lavender-100)); color: var(--purple-600); }
.attn-competency { background: var(--blue-100); color: var(--blue-600); }
.attn-document { background: var(--gray-200); color: var(--gray-600); }
.attn-staffing { background: var(--red-100); color: var(--red-600); }
.attention-body { flex: 1; min-width: 0; }
.attention-text { font-size: 0.87rem; font-weight: 600; }
.attention-meta { font-size: 0.75rem; color: var(--gray-500); }

/* Movement list (dashboard) */
.movement-list { display: flex; flex-direction: column; }
.movement-row { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-bottom: 1px solid var(--gray-100); color: var(--gray-800); border-radius: 8px; transition: background var(--t-fast); }
.movement-row:hover { background: var(--lavender-100); }
.movement-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--lavender-100); color: var(--purple-600); font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none; }
.movement-main { flex: 1; min-width: 0; }
.movement-name { font-weight: 600; font-size: 0.9rem; }
.movement-type { font-size: 0.76rem; color: var(--gray-500); }
.movement-date { font-size: 0.78rem; color: var(--gray-500); white-space: nowrap; }

/* Empty state */
.empty-state { text-align: center; padding: 44px 20px; color: var(--gray-500); font-weight: 600; }
.empty-state.small { padding: 22px; font-size: 0.85rem; }
.empty-state .muted { margin-top: 6px; font-weight: 400; font-size: 0.85rem; }

/* Pagination */
.pagination-host { display: flex; align-items: center; gap: 12px; justify-content: flex-end; margin-top: 14px; }
.pagination { display: flex; align-items: center; gap: 6px; }
.pagination .btn { width: 38px; padding: 8px 0; justify-content: center; min-height: 38px; }
.page-info { font-weight: 700; color: var(--gray-700); font-size: 0.9rem; }
.page-count { color: var(--gray-500); font-size: 0.82rem; font-weight: 600; }

/* Toasts */
.toast-wrap { position: fixed; top: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: #fff; border-radius: 14px;
  box-shadow: var(--shadow-3);
  padding: 13px 18px;
  border-left: 4px solid var(--green-500);
  font-size: 0.9rem; font-weight: 600; color: var(--gray-800);
  opacity: 0; transform: translateX(20px);
  transition: all .3s;
  max-width: 340px;
}
.toast.show { opacity: 1; transform: none; }
.toast-error { border-left-color: var(--red-500); }
.toast-warn { border-left-color: var(--gold-500); }

/* Global loading */
.global-loading {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(2px);
  display: none; align-items: center; justify-content: center;
}
.global-loading.show { display: flex; }
.spinner {
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 4px solid var(--lavender-100);
  border-top-color: var(--purple-600);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Segment control */
.seg { display: inline-flex; background: var(--gray-100); padding: 4px; border-radius: 12px; border: 1.5px solid var(--gray-200); box-shadow: var(--shadow-inset); }
.seg-btn { border: none; background: none; cursor: pointer; padding: 8px 16px; min-height: 36px; border-radius: 9px; font-weight: 600; font-size: 0.82rem; color: var(--gray-600); font-family: inherit; transition: all var(--t); }
.seg-btn.active { background: #fff; color: var(--purple-700); box-shadow: 0 2px 8px rgba(91, 62, 158, 0.18); }

/* File chip / code chip */
.file-chip { background: var(--blue-100); color: var(--blue-600); font-size: 0.76rem; padding: 3px 10px; border-radius: 999px; font-weight: 600; }
.code-chip { background: var(--gray-100); border: 1px solid var(--gray-200); border-radius: 6px; padding: 2px 8px; font-family: ui-monospace, monospace; font-size: 0.78rem; color: var(--purple-700); }

/* Notifications full list */
.notif-card { display: flex; gap: 14px; align-items: flex-start; background: #fff; border-radius: var(--radius-md); box-shadow: var(--shadow-1); padding: 16px; margin-bottom: 10px; border: 1px solid var(--gray-200); transition: box-shadow var(--t); }
.notif-card:hover { box-shadow: var(--shadow-2); }
.notif-card.unread { border-left: 4px solid var(--purple-500); }
.notif-content { flex: 1; }
.notif-detail { color: var(--gray-600); font-size: 0.86rem; margin-top: 2px; }
.notif-time { color: var(--gray-400); font-size: 0.76rem; margin-top: 4px; }

/* Print table */
.print-table { border-collapse: collapse; width: 100%; }
.print-table th, .print-table td { border: 1px solid #ddd; padding: 6px; font-size: 12px; text-align: left; }
.print-table th { background: #5b3e9e; color: #fff; }

/* Workforce gap */
.gap-val { font-weight: 800; }
.stat-safe { color: var(--green-600); }
.stat-attn { color: var(--orange-600); }
.stat-crit { color: var(--red-600); }

/* Doc preview */
.doc-frame { width: 100%; height: 480px; border: 1px solid var(--gray-200); border-radius: var(--radius-md); background: var(--gray-100); box-shadow: var(--shadow-inset); }

/* sidebar overlay (mobile) */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(58, 42, 91, 0.35); z-index: 35; }
.sidebar-overlay.show { display: block; }

/* ---------------- Responsive ---------------- */
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-3); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: flex; }
  .menu-btn { display: inline-flex; }
  .main { margin-left: 0; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .top-search { min-width: 0; width: 160px; }
  .page-sub { display: none; }
}
@media (max-width: 600px) {
  html { font-size: 14px; }
  .content { padding: 14px; }
  .topbar { padding: 0 12px; height: auto; min-height: 58px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; gap: 8px; }
  .top-search { display: none; }
  .lang-divider { display: none; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi-card { padding: 14px; }
  .kpi-value { font-size: 1.4rem; }
  .kpi-icon { width: 42px; height: 42px; }
  .form-grid { grid-template-columns: 1fr; }
  .charts-grid { grid-template-columns: 1fr; }
  .notif-panel { width: calc(100vw - 24px); right: 12px; }

  /* Tables become cards */
  .table-wrap { overflow: visible; }
  .table-wrap.scrollable { max-height: none; overflow: visible; }
  .data-table.staff-wide { min-width: 0; }
  .data-table.staff-wide th, .data-table.staff-wide td { white-space: normal; }
  .data-table thead { display: none; }
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
  .data-table tr {
    background: #fff; border: 1px solid var(--gray-200);
    border-radius: var(--radius-md); box-shadow: var(--shadow-1);
    margin-bottom: 12px; padding: 8px 12px;
  }
  .data-table td {
    border: none; padding: 7px 6px;
    display: flex; justify-content: space-between; align-items: center;
    text-align: right;
    border-bottom: 1px dashed var(--gray-200);
  }
  .data-table td:last-child { border-bottom: none; }
  .data-table td::before {
    content: attr(data-label);
    font-weight: 700; color: var(--gray-500);
    font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.03em;
    margin-right: 12px;
    text-align: left;
  }
  .data-table td[data-label=""]::before { display: none; }
  .data-table td.no-mobile { display: none; }
  .data-table .no-data-row { display: block; }
  .data-table .no-data-row td { display: block; border: none; text-align: center; }
  .profile-header { padding: 18px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-right { justify-content: flex-start; }
  .search-box { min-width: 0; flex: 1; }
  .mini-kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 400px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .profile-actions { flex-direction: column; width: 100%; }
  .profile-actions .btn { width: 100%; justify-content: center; }
}
@media print {
  .sidebar, .topbar, .toolbar, .pagination-host, .row-actions, .icon-btn { display: none !important; }
  .main { margin: 0; }
  body { background: #fff; }
  .card, .data-host, .data-table { box-shadow: none; border: none; }
}

/* ---------------- Nursing KPI Scorecard ---------------- */
.seg { display: inline-flex; background: var(--gray-200); border-radius: 10px; padding: 3px; gap: 2px; }
.seg-btn { border: none; background: transparent; padding: 7px 14px; border-radius: 8px; font-size: 0.8rem; font-weight: 700; color: var(--gray-600); cursor: pointer; white-space: nowrap; }
.seg-btn:hover { color: var(--purple-700); }
.seg-btn.active { background: #fff; color: var(--purple-800); box-shadow: 0 1px 4px rgba(0,0,0,0.12); }
.card.kpi-head { padding: 18px 20px; margin-bottom: 16px; }
.kpi-period-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-bottom: 16px; padding: 14px 18px;
  border: 1px solid var(--purple-200, #ded4f2);
  background: linear-gradient(135deg, #fbfaff 0%, #f5f1fc 100%);
  border-radius: var(--radius-lg, 16px); box-shadow: var(--shadow-1, 0 2px 8px rgba(42,45,58,.06));
}
.kpi-period-head { display: flex; align-items: center; gap: 12px; }
.kpi-period-head > i {
  width: 38px; height: 38px; min-width: 38px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: var(--purple-700, #5b3e9e); background: #fff; border: 1px solid var(--purple-200, #ded4f2);
}
.kpi-period-title { font-size: 10.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--gray-500, #8b91a3); }
.kpi-period-current { display: block; margin-top: 1px; font-size: 15px; font-weight: 800; color: var(--gray-900, #2a2d3a); }
.kpi-period-controls { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.kpi-period-field { display: flex; flex-direction: column; gap: 4px; }
.kpi-period-field label { font-size: 10px; font-weight: 700; color: var(--gray-500, #8b91a3); text-transform: uppercase; letter-spacing: .05em; }
.kpi-period-field .inp-select { min-width: 128px; }
.kpi-saved { margin-top: 16px; padding: 18px 20px; }
.kpi-saved-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.kpi-saved-header .card-title { margin: 0; }
.kpi-saved-sub { margin: 3px 0 0; font-size: 12px; color: var(--gray-500, #8b91a3); }
.kpi-saved-heading { min-width: 220px; }
.kpi-saved-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kpi-saved-search { min-width: 260px; max-width: 360px; }
.kpi-saved-list { display: flex; flex-direction: column; gap: 10px; }
.kpi-saved-row { padding: 13px 14px; border: 1px solid var(--gray-200, #e6e8ef); border-radius: 12px; background: #fff; display: flex; flex-direction: column; gap: 9px; }
.kpi-saved-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.kpi-saved-id { display: flex; flex-direction: column; gap: 2px; }
.kpi-saved-id strong { font-size: 13.5px; color: var(--gray-900, #2a2d3a); }
.kpi-saved-code { font-size: 11px; color: var(--gray-500, #8b91a3); }
.kpi-saved-meta { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.kpi-saved-sums { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 11.5px; color: var(--gray-600, #6a6f80); }
.kpi-saved-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 8px; border-top: 1px dashed var(--gray-200, #e6e8ef); }
.kpi-saved-total { font-size: 12.5px; font-weight: 800; color: var(--gray-900, #2a2d3a); }
.kpi-saved-actions { display: flex; gap: 6px; margin-left: auto; }
.kpi-saved-empty { display: flex; align-items: center; gap: 8px; padding: 16px; border: 1px dashed var(--gray-200, #e6e8ef); border-radius: 12px; color: var(--gray-500, #8b91a3); font-size: 12px; }
.kpi-head-line { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.kpi-title .kpi-h1 { font-size: 1.15rem; font-weight: 800; color: var(--purple-800); }
.kpi-title .kpi-sub { font-size: 0.82rem; color: var(--gray-500); margin-top: 2px; }
.kpi-total { text-align: right; }
.kpi-total-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--gray-500); }
.kpi-total-value { font-size: 1.9rem; font-weight: 900; color: var(--green-600); font-variant-numeric: tabular-nums; }
.kpi-total-value.warn { color: var(--orange-600); }
.kpi-gate-row { display: flex; align-items: center; gap: 10px; margin: 14px 0; flex-wrap: wrap; }
.kpi-gate-label { font-size: 0.82rem; font-weight: 700; color: var(--gray-700); }
.kpi-rating { font-size: 0.95rem; font-weight: 800; color: var(--purple-800); margin-left: 6px; }
.kpi-kpi { min-width: 220px; }
.kpi-kpi > div:first-child { font-weight: 650; }
.kpi-def { font-size: 0.72rem; color: var(--gray-500); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; }
.kpi-dir { width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; background: var(--lavender-100); color: var(--purple-700); font-weight: 800; }
.inp-actual { width: 86px; padding: 6px 8px; border: 1px solid var(--gray-300); border-radius: 8px; font-size: 0.85rem; text-align: right; font-variant-numeric: tabular-nums; }
.inp-actual:focus { outline: none; border-color: var(--purple-400); box-shadow: 0 0 0 3px var(--lavender-100); }
.card.kpi-summary { margin-top: 16px; }
.kpi-summary-title { font-size: 0.95rem; font-weight: 800; color: var(--gray-800); margin-bottom: 10px; }
.kpi-total-row { font-weight: 800; background: var(--lavender-50); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

@media print {
  .no-print { display: none !important; }
  .card.kpi-head, .card.kpi-summary, .data-table { page-break-inside: avoid; }
}

/* E-Document filter panel */
.filter-panel { background: var(--white, #fff); border: 1px solid var(--gray-200, #e5e7eb); border-radius: 10px; padding: 14px 16px; margin: 12px 0; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.filter-grid .field { display: flex; flex-direction: column; gap: 4px; }
.filter-grid .field label { font-size: 12px; font-weight: 600; color: var(--gray-600, #6b7280); }
.filter-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
#edoc-filter-toggle.active { background: var(--gray-200, #e5e7eb); color: var(--gray-800, #111827); }
@media (max-width: 720px) { .filter-grid { grid-template-columns: 1fr; } }


.login-hint {
  margin-top: 14px;
  font-size: 12.5px;
  color: #5b4b7a;
  background: rgba(124, 92, 191, 0.08);
  border: 1px solid rgba(124, 92, 191, 0.18);
  border-radius: 10px;
  padding: 8px 12px;
  line-height: 1.45;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .spinner { animation-duration: 1.2s !important; animation-iteration-count: infinite !important; }
  .kpi-card:hover, .mini-kpi:hover, .kpi-card, .mini-kpi, .card, .btn:active, .icon-btn:active { transform: none !important; }
}

/* ---------------- Complaint workflow wizard ---------------- */
.step-label { font-size: 11.5px; font-weight: 600; color: var(--purple-700, #5b3e9e); background: var(--lavender-100, #f3f0fb); border: 1px solid var(--lavender-200, #e8e3f7); padding: 2px 8px; border-radius: 20px; white-space: nowrap; }
.wizard { display: flex; flex-direction: column; gap: 12px; }
.wizard-step { border: 1px solid var(--gray-300, #d9dde6); border-radius: var(--radius-sm, 12px); background: var(--white, #fff); overflow: hidden; }
.wizard-step.done { border-color: var(--green-200, #cdeedi); background: var(--green-100, #e9f8f0); }
.wizard-step.active { border-color: var(--purple-400, #9a7fd0); box-shadow: 0 0 0 3px var(--purple-200, #ded4f2); }
.wizard-step-head { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border-bottom: 1px dashed var(--gray-200, #eef0f4); }
.wizard-step.done .wizard-step-head { border-bottom-color: var(--green-200, #cdeedi); }
.wizard-step.active .wizard-step-head { border-bottom-color: var(--purple-200, #ded4f2); }
.wizard-num { width: 22px; height: 22px; min-width: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; color: #fff; background: var(--gray-400, #b9c0cd); }
.wizard-num i { font-size: 11px; }
.wizard-step.done .wizard-num { background: var(--green-600, #3e9a63); }
.wizard-step.active .wizard-num { background: var(--purple-600, #6f4fc0); }
.wizard-step-title { font-size: 13.5px; font-weight: 800; color: var(--gray-900, #2a2d3a); }
.wizard-state { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--muted, #67718a); white-space: nowrap; }
.wizard-step.active .wizard-state { color: var(--purple-700, #5b3e9e); }
.wizard-step.done .wizard-state { color: var(--green-600, #3e9a63); }
.wizard-edit { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; font-size: 11px; font-weight: 700; color: var(--purple-700, #5b3e9e); background: var(--white, #fff); border: 1px solid var(--purple-300, #b7a3de); border-radius: 20px; cursor: pointer; font-family: inherit; }
.wizard-edit:hover { background: var(--lavender-100, #f3f0fb); }
.wizard-step-body { padding: 12px 14px; }
.wizard-fields { display: flex; flex-direction: column; gap: 8px; }
.wizard-row { display: flex; gap: 10px; font-size: 12.5px; }
.wizard-lbl { min-width: 140px; font-weight: 700; color: var(--gray-600, #767c8b); }
.wizard-val { color: var(--gray-900, #2a2d3a); }
.wizard-waiting { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted, #67718a); }
.wizard-waiting i { color: var(--gray-400, #b9c0cd); }
.wizard-submit { display: flex; justify-content: flex-end; }
.wizard-submit .btn { min-width: 170px; }
.step-label.locked { color: var(--gold-500, #d8a53f); background: var(--gold-100, #faf0dd); border-color: var(--gold-200, #f6e5c3); }
.step-label.locked i { margin-right: 3px; }
.btn-finalize { background: #fff; color: var(--gold-500, #d8a53f); border: 1.5px solid var(--gold-500, #d8a53f); }
.btn-finalize:hover { background: var(--gold-100, #faf0dd); }
.btn-unlock { background: #fff; color: var(--gray-800, #3c4050); border: 1.5px solid var(--gray-400, #c3c9d6); }
.btn-unlock:hover { background: var(--gray-100, #f5f6f9); }
.finalize-bar { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1.5px dashed var(--gold-200, #f6e5c3); border-radius: var(--radius-sm, 12px); background: var(--gold-100, #faf0dd); }
.finalize-bar.done { border-style: solid; border-color: var(--gray-300, #d9dde6); background: var(--gray-100, #f5f6f9); }
.finalize-hint { flex: 1 1 auto; font-size: 12.5px; color: var(--gray-700, #4b4f63); }
.finalize-ico { width: 30px; height: 30px; min-width: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--gold-500, #d8a53f); background: #fff; border: 1px solid var(--gold-200, #f6e5c3); }
.finalize-bar.done .finalize-ico { color: var(--gray-500, #9aa3b5); border-color: var(--gray-300, #d9dde6); }
.finalize-txt { font-size: 12.5px; color: var(--gray-700, #4b4f63); display: flex; flex-direction: column; gap: 2px; }
.finalize-title { font-weight: 800; color: var(--gray-900, #2a2d3a); }
.nav-item { position: relative; }
.nav-item .nav-ctrl {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  opacity: 0; transition: opacity .12s ease;
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 8px;
  background: transparent; border: 1px solid transparent;
  color: var(--gray-500, #9aa3b5); cursor: pointer; z-index: 2;
}
.nav-item:hover .nav-ctrl, .nav-item:focus-within .nav-ctrl, .nav-item.active .nav-ctrl { opacity: 1; }
.nav-item .nav-ctrl:hover { background: var(--gray-100, #f5f6f9); color: var(--gray-800, #3c4050); }
.nav-ctrl-menu {
  position: absolute; right: 6px; top: calc(100% - 4px); min-width: 220px;
  background: #fff; border: 1px solid var(--gray-200, #e6e8ef); border-radius: var(--radius-sm, 12px);
  box-shadow: var(--shadow, 0 10px 40px -20px rgba(42,45,58,.4)); padding: 6px;
  display: flex; flex-direction: column; gap: 4px; z-index: 5;
}
.nav-ctrl-menu.hidden { display: none; }
.nav-ctrl-item {
  padding: 6px 8px; border-radius: 8px; font-size: 12.5px; color: var(--gray-800, #3c4050);
  cursor: pointer; display: flex; align-items: center; gap: 6px;
}
.nav-ctrl-item:hover { background: var(--gray-100, #f5f6f9); }

/* ---------------- CNE Record / RN Level Assessment ---------------- */
.cne-toolbar .search-box { min-width: 300px; max-width: 560px; flex: 1 1 360px; }
.cne-ref-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.cne-ref-card {
  text-align: left; cursor: pointer; padding: 12px 14px; border-radius: 12px;
  border: 1.5px solid var(--border, #e6e8ef); background: var(--card-bg, #fff);
  transition: all var(--t, .18s); font-family: inherit;
}
.cne-ref-card:hover { border-color: var(--purple-300, #c9b8ea); transform: translateY(-1px); box-shadow: var(--shadow-2, 0 4px 14px rgba(91,62,158,.12)); }
.cne-ref-card.active { border-color: var(--purple-600, #7c5cbf); background: var(--lavender-100, #f2ecfb); box-shadow: 0 6px 18px rgba(91,62,158,.18); }
.cne-ref-code { font-weight: 800; color: var(--purple-700, #5b3e9e); font-size: 1rem; }
.cne-ref-name { font-weight: 650; color: var(--gray-800, #3c4050); margin: 2px 0 6px; font-size: .9rem; }
.cne-ref-meta { font-size: .76rem; color: var(--gray-600, #6a6f80); }
.cne-ref-score { font-size: .76rem; color: var(--purple-600, #7c5cbf); font-weight: 700; margin-top: 4px; }

.cne-check-list { display: flex; flex-direction: column; gap: 4px; }
.cne-check {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px;
  border: 1px solid var(--border, #e6e8ef); background: var(--card-bg, #fff); cursor: pointer;
}
.cne-check:hover { background: var(--gray-100, #f5f6f9); }
.cne-check input { width: 16px; height: 16px; }
.cne-check-label { flex: 1 1 auto; font-size: .86rem; color: var(--gray-800, #3c4050); }
.cne-add { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.cne-add input[type="text"] { flex: 1 1 auto; }
.cne-add select { max-width: 110px; }

.cne-approval-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.cne-approval-card {
  border: 1px solid var(--border, #e6e8ef); border-radius: 12px; padding: 12px 14px;
  background: var(--card-bg, #fff); display: flex; flex-direction: column; gap: 10px;
}
.cne-approval-title { font-weight: 700; color: var(--purple-700, #5b3e9e); font-size: .86rem; }
.cne-approval-card .field { display: flex; flex-direction: column; gap: 5px; }
.cne-approval-card .field label { font-size: .74rem; font-weight: 600; color: var(--gray-600, #6a6f80); }

.cne-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

@media (max-width: 900px) {
  .cne-toolbar .search-box { min-width: 0; max-width: none; flex: 1 1 auto; }
  .cne-ref-grid { grid-template-columns: repeat(2, 1fr); }
  .cne-approval-grid { grid-template-columns: 1fr; }
}

/* ---------------- CNE Record report ---------------- */
.cne-report { padding: 28px 32px; }
.cne-report-org { text-align: center; font-size: 20px; font-weight: 800; color: var(--gray-900, #1b1e29); }
.cne-report-title { text-align: center; font-size: 16px; font-weight: 700; color: var(--purple-700, #5b3e9e); margin-top: 2px; }
.cne-report-sub { text-align: center; font-size: 11px; color: var(--gray-500, #8a90a2); text-transform: uppercase; letter-spacing: .06em; margin: 2px 0 20px; }
.cne-report h4 { margin: 20px 0 8px; font-size: .82rem; font-weight: 750; color: var(--purple-600, #7c5cbf); text-transform: uppercase; letter-spacing: .03em; }
.cne-report-count { color: var(--gray-500, #8a90a2); font-weight: 600; }
.cne-report-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 4px; }
.cne-report-table th, .cne-report-table td { border: 1px solid var(--gray-200, #e6e8ef); padding: 7px 10px; text-align: left; vertical-align: top; }
.cne-report-table th { background: var(--gray-100, #f5f6f9); font-weight: 600; color: var(--gray-700, #4a4f60); }
.cne-report-empty { color: var(--gray-500, #8a90a2); text-align: center; }
.cne-report-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.cne-report-approval { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.cne-report-sign { border: 1px solid var(--gray-200, #e6e8ef); border-radius: 10px; padding: 10px 12px; font-size: 12px; }
.cne-report-sign .lbl { font-weight: 700; color: var(--purple-700, #5b3e9e); margin-bottom: 6px; font-size: .78rem; }
.cne-report-sign .row { margin: 3px 0; color: var(--gray-700, #4a4f60); }
.cne-report-foot { display: flex; justify-content: space-between; margin-top: 24px; padding-top: 10px; border-top: 1px solid var(--gray-200, #e6e8ef); font-size: 11px; color: var(--gray-500, #8a90a2); }

@media print {
  body * { visibility: hidden !important; }
  .cne-report, .cne-report * { visibility: visible !important; }
  .cne-report { position: absolute; left: 0; top: 0; width: 100%; padding: 0 12px !important; box-shadow: none !important; border: none !important; }
  .cne-no-print { display: none !important; }
  .cne-report-table { font-size: 11px; }
  .cne-report-approval { break-inside: avoid; }
}

.risk-note { display:flex; align-items:flex-start; gap:8px; background:#fff7ed; border:1px solid #fed7aa; color:#9a3412; padding:10px 12px; border-radius:10px; font-size:0.9rem; margin-bottom:12px; }
.risk-note i { margin-top:2px; }
@media (prefers-color-scheme: dark) {
  .risk-note { background:rgba(251,146,60,0.12); border-color:rgba(251,146,60,0.5); color:#fdba74; }
}

/* Level definition preview under Level select */
.level-preview { display:flex; flex-direction:column; gap:2px; font-size:0.86rem; padding:8px 12px; border:1px dashed var(--border,#e2e5eb); border-radius:10px; background:var(--bg-soft,#f7f8fb); }
.level-preview b { font-size:0.9rem; color:var(--text,#1b1e29); }
.level-preview span { color:var(--muted,#7a8096); line-height:1.4; }
.level-preview .muted { color:var(--muted,#7a8096); font-style:italic; }
.level-preview.lp-L1 { border-color:#16a34a; background:rgba(22,163,74,.07); }
.level-preview.lp-L1 b { color:#15803d; }
.level-preview.lp-L2 { border-color:#2563eb; background:rgba(37,99,235,.07); }
.level-preview.lp-L2 b { color:#1d4ed8; }
.level-preview.lp-L3 { border-color:#f59e0b; background:rgba(245,158,11,.08); }
.level-preview.lp-L3 b { color:#b45309; }
.level-preview.lp-L4 { border-color:#fb923c; background:rgba(251,146,60,.09); }
.level-preview.lp-L4 b { color:#ea580c; }
.level-preview.lp-L5 { border-color:#dc2626; background:rgba(220,38,38,.08); }
.level-preview.lp-L5 b { color:#b91c1c; }

.level-badge.L1 { background:#dcfce7 !important; color:#15803d !important; }
.level-badge.L2 { background:#dbeafe !important; color:#1d4ed8 !important; }
.level-badge.L3 { background:#fef3c7 !important; color:#b45309 !important; }
.level-badge.L4 { background:#ffedd5 !important; color:#ea580c !important; }
.level-badge.L5 { background:#fee2e2 !important; color:#b91c1c !important; }

/* ---- Complaint attachments ---- */
.wizard-row.full { flex-direction: column; align-items: stretch; gap: 6px; }
.wizard-row.full .wizard-lbl { min-width: 0; }
.attach-panel { width: 100%; }
.attach-panel .attach-bar { border-bottom: 1px dashed var(--gray-200, #e4e7ee); padding: 8px 0 10px; }
.attach-empty { font-size: .84rem; color: var(--gray-500, #8b90a0); padding: 14px 4px 4px; font-style: italic; }
.attach-thumb { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 8px; background: var(--lavender-100, #f1eefb); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.attach-thumb.is-image { cursor: pointer; }
.attach-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.attach-thumb .file-ic { font-size: 1.1rem; }
.attach-panel .attach-item { align-items: center; }
.attach-panel .attach-meta { word-break: break-word; }
.btn-outline.kind-danger, .btn-outline.btn-danger { color: #dc2626; border-color: #fca5a5; }
.btn-outline.kind-danger:hover, .btn-outline.btn-danger:hover { background: #fee2e2; }
@media (prefers-color-scheme: dark) {
  .attach-panel .attach-bar { border-bottom-color: var(--gray-700, #2b3040); }
  .attach-panel .attach-item { background: var(--gray-800, #1b1f2b); border-color: var(--gray-700, #2b3040); }
  .attach-panel .attach-name { color: var(--gray-200, #dfe3ee); }
  .attach-thumb { background: var(--gray-700, #2b3040); }
  .attach-empty { color: var(--gray-500, #7a8096); }
  .btn-outline.kind-danger:hover { background: rgba(220, 38, 38, .18); }
}

/* ---- Complaints dashboard tab ---- */
.seg { display: inline-flex; gap: 2px; background: var(--gray-100, #f0f1f5); border-radius: 10px; padding: 3px; }
.seg-btn { display: inline-flex; align-items: center; gap: 7px; border: none; background: transparent; color: var(--gray-600, #6b7185); font-weight: 600; font-size: .82rem; padding: 7px 14px; border-radius: 8px; cursor: pointer; transition: background var(--t, .15s), color var(--t, .15s); }
.seg-btn:hover { color: var(--purple-600, #7c5cbf); }
.seg-btn.active { background: var(--white, #fff); color: var(--purple-600, #7c5cbf); box-shadow: var(--shadow-1, 0 1px 3px rgba(0,0,0,.08)); }
.chart-legend { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--gray-700, #4b4f63); }
.legend-dot { width: 11px; height: 11px; border-radius: 3px; flex: 0 0 11px; }
.legend-label { flex: 1; min-width: 0; }
.legend-val { font-weight: 700; color: var(--gray-900, #2a2d3a); }
.report-host .chart-card { display: flex; flex-direction: column; }
.report-host .chart-title { margin-bottom: 10px; }
@media (prefers-color-scheme: dark) {
  .seg { background: var(--gray-800, #1b1f2b); }
  .seg-btn.active { background: var(--gray-700, #2b3040); }
  .legend-item { color: var(--gray-300, #c3c8d6); }
  .legend-val { color: var(--gray-100, #eef1f7); }
  .report-host .chart-card { background: var(--gray-800, #1b1f2b); }
}

/* Staff "Submit a complaint" page */
.submit-host { max-width: 760px; }
.btn-lg { padding: 12px 22px; font-size: 0.95rem; font-weight: 700; }
.submit-success { text-align: center; padding: 30px 20px; }
.submit-success > .fa-circle-check { font-size: 3rem; color: #16a34a; }
.submit-success h3 { margin: 14px 0 6px; }
.submit-success p { margin: 0 0 18px; }
.submit-ref { display: inline-flex; flex-direction: column; gap: 4px; padding: 12px 22px; margin-bottom: 20px; border-radius: 12px; background: var(--gray-100, #f2f3f7); }
.submit-ref span { font-size: 0.75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--gray-500, #888); }
.submit-ref b { font-size: 1.15rem; color: var(--purple-600, #7c5cbf); }
@media (prefers-color-scheme: dark) {
  .submit-ref { background: var(--gray-800, #1b1f2b); }
}

/* Multi-select department picker */
.dept-picker { position: relative; }
.dept-toggle { width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid transparent; border-radius: 8px; background: linear-gradient(120deg, var(--purple-700, #5b3e9e), var(--purple-600, #7c5cbf)); color: #fff; cursor: pointer; text-align: left; font: inherit; transition: box-shadow .15s ease; }
.dept-toggle:hover { box-shadow: 0 8px 18px rgba(91, 62, 158, 0.3); }
.dept-toggle:focus-visible { outline: 2px solid var(--purple-300, #c4b3e5); outline-offset: 2px; border-radius: 8px; }
.dept-toggle .dept-chips { display: flex; flex-wrap: nowrap; overflow: hidden; gap: 6px; flex: 1; min-width: 0; }
.dept-placeholder { color: var(--gray-400, #9aa3b5); font-size: 0.9rem; }
.dept-chip { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--gray-100, #f2f3f7); color: var(--gray-700, #3a4152); font-size: .78rem; font-weight: 600; white-space: nowrap; }
.dept-more { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--gray-500, #6b7280); color: #fff; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.dept-chips-inline { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.dept-chev { color: var(--gray-400, #9aa3b5); transition: transform .15s ease; flex: 0 0 auto; }
.dept-toggle.open .dept-chev { transform: rotate(180deg); }
/* On the filled purple toggle, chips/labels are white for contrast. */
.dept-toggle .dept-placeholder { color: rgba(255, 255, 255, .8); }
.dept-toggle .dept-chip { background: rgba(255, 255, 255, .22); color: #fff; }
.dept-toggle .dept-more { background: #fff; color: var(--purple-700, #5b3e9e); }
.dept-toggle .dept-chev { color: rgba(255, 255, 255, .85); }
.dept-menu { position: absolute; z-index: 60; top: calc(100% + 4px); left: 0; right: 0; min-width: 240px; max-height: 280px; overflow: auto; background: linear-gradient(160deg, var(--purple-700, #5b3e9e), var(--purple-600, #7c5cbf)); border: 1px solid transparent; border-radius: 12px; box-shadow: 0 12px 30px rgba(20, 24, 40, .28); padding: 6px; color: #fff; }
.dept-opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: .88rem; color: #fff; }
.dept-opt:hover { background: rgba(255, 255, 255, .16); }
.dept-opt.selected { background: rgba(255, 255, 255, .28); font-weight: 600; }
.dept-opt .dept-check { opacity: 0; color: #fff; font-size: .8rem; flex: 0 0 auto; }
.dept-opt.selected .dept-check { opacity: 1; }
.dept-other { padding: 8px 10px 6px; margin-top: 4px; border-top: 1px solid rgba(255, 255, 255, .2); }
.dept-other-lbl { font-size: .76rem; color: rgba(255, 255, 255, .78); margin-bottom: 6px; }
.dept-other-input { width: 100%; padding: 8px 10px; border: 1px solid var(--gray-300, #d3d7e0); border-radius: 8px; font: inherit; }
@media (prefers-color-scheme: dark) {
  .dept-other-input { background: var(--gray-800, #1b1f2b); color: var(--gray-100, #eef1f7); border-color: var(--gray-700, #2b3040); }
}

/* Complaint list step-progress filter (Pending / Verify / Solve / Finalize) */
.stage-progress { margin: 2px 0 14px; }
.stage-bar { display: flex; flex-wrap: wrap; gap: 8px; }
.stage-tab { display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--gray-200, #e6e8ef); background: var(--white, #fff); color: var(--gray-700, #3a4152); font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; transition: background .15s ease, color .15s ease, border-color .15s ease; }
.stage-tab:hover { border-color: currentColor; }
.stage-tab .stage-count { min-width: 22px; text-align: center; padding: 1px 7px; border-radius: 999px; background: var(--gray-100, #f2f3f7); font-size: .78rem; font-weight: 700; }
.stage-tab.st-pending { color: #b45309; }
.stage-tab.st-verify { color: #1d4ed8; }
.stage-tab.st-solve { color: #15803d; }
.stage-tab.st-finalize { color: #6d28d9; }
.stage-tab.active { color: #fff; border-color: transparent; }
.stage-tab.active.st-all { background: var(--gray-700, #3a4152); }
.stage-tab.active.st-pending { background: #f59e0b; color: #4a3300; }
.stage-tab.active.st-verify { background: #2563eb; }
.stage-tab.active.st-solve { background: #16a34a; }
.stage-tab.active.st-finalize { background: #7c3aed; }
.stage-tab.active .stage-count { background: rgba(255, 255, 255, .28); color: inherit; }
.stage-track { display: flex; height: 6px; border-radius: 999px; overflow: hidden; background: var(--gray-100, #f2f3f7); margin-top: 8px; }
.stage-seg { display: block; height: 100%; min-width: 0; }
.stage-seg.st-pending { background: #f59e0b; }
.stage-seg.st-verify { background: #2563eb; }
.stage-seg.st-solve { background: #16a34a; }
.stage-seg.st-finalize { background: #7c3aed; }
@media (prefers-color-scheme: dark) {
  .stage-tab { background: var(--gray-800, #1b1f2b); border-color: var(--gray-700, #2b3040); }
  .stage-tab .stage-count { background: var(--gray-700, #2b3040); }
  .stage-track { background: var(--gray-700, #2b3040); }
}

/* Public "Submit a Complaint" page (no login) */
.public-page { min-height: 100vh; background: var(--gray-50, #f6f7fb); }
.pub-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 20px; background: var(--white, #fff); border-bottom: 1px solid var(--gray-200, #e6e8ef); position: sticky; top: 0; z-index: 10; }
.pub-brand { display: flex; align-items: center; gap: 10px; }
.pub-cross { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; background: var(--purple-600, #7c5cbf); color: #fff; font-size: 22px; font-weight: 700; line-height: 1; }
.pub-name { font-weight: 700; font-size: 1rem; color: var(--gray-800, #1b1f2b); }
.pub-org { font-size: .78rem; color: var(--gray-500, #888); }
.pub-content { max-width: 780px; margin: 0 auto; padding: 22px 16px 64px; }
.pub-lang .lang-btn { font-size: .85rem; }
@media (max-width: 560px) { .pub-org { display: none; } .pub-content { padding: 16px 12px 48px; } }
@media (prefers-color-scheme: dark) {
  .public-page { background: var(--gray-900, #14171f); }
  .pub-head { background: var(--gray-800, #1b1f2b); border-color: var(--gray-700, #2b3040); }
  .pub-name { color: var(--gray-100, #eef1f7); }
}

/* ============ Project Timeline ============ */
.pt-toolbar { flex-wrap: wrap; gap: 8px; }
.pt-toolbar .toolbar-left { flex-wrap: wrap; gap: 8px; }
.pt-toolbar .inp-select { max-width: 170px; }
.pt-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 12px; }
.pt-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--gray-200, #e6e8ef); background: var(--white, #fff); color: var(--gray-700, #444); cursor: pointer; font-size: .82rem; }
.pt-chip:hover { border-color: var(--purple-400, #a389d6); }
.pt-chip.active { background: var(--purple-600, #7c5cbf); border-color: var(--purple-600, #7c5cbf); color: #fff; }
.pt-chip-count { background: rgba(0,0,0,.08); border-radius: 999px; padding: 0 7px; font-weight: 700; font-size: .75rem; }
.pt-chip.active .pt-chip-count { background: rgba(255,255,255,.25); }
.pt-tabs { margin-bottom: 14px; flex-wrap: wrap; }
.pt-dashboard { display: flex; flex-direction: column; gap: 14px; }
.pt-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.pt-card { display: flex; align-items: center; gap: 12px; padding: 14px; }
.pt-card-ico { width: 40px; height: 40px; border-radius: 11px; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1rem; flex: 0 0 auto; }
.pt-card-val { font-size: 1.4rem; font-weight: 800; line-height: 1.1; }
.pt-card-lbl { font-size: .78rem; }
.pt-card-title { font-weight: 700; margin-bottom: 10px; }
.pt-progress { padding: 16px; }
.pt-progress-head { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 8px; }
.pt-progress-pct { color: var(--purple-600, #7c5cbf); }
.pt-progress-bar { height: 10px; border-radius: 999px; background: var(--gray-100, #eef0f5); overflow: hidden; }
.pt-progress-fill { height: 100%; background: linear-gradient(90deg, var(--purple-600, #7c5cbf), #6aa8e1); border-radius: 999px; }
.pt-progress-sub { font-size: .8rem; margin-top: 6px; }
.pt-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.pt-chart-card { padding: 16px; }
.pt-chart-wide { grid-column: 1 / -1; }
.pt-chart-flex { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.pt-chart { width: 170px; height: 160px; flex: 0 0 auto; }
.pt-legend { flex: 1 1 150px; }
.pt-lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.pt-deadline { padding: 16px; }
.pt-deadline-item, .pt-daily-item { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--gray-100, #eef0f5); }
.pt-deadline-item.overdue, .pt-daily-item.overdue { border-left: 3px solid #dc2626; padding-left: 8px; }
.pt-dl-main { flex: 1 1 auto; min-width: 0; }
.pt-dl-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-dl-meta { font-size: .76rem; }
.pt-overdue-title { color: #dc2626; margin-top: 12px; }
.pt-gantt-card { padding: 16px; }
.pt-gantt-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.pt-g-scroll { overflow-x: auto; border: 1px solid var(--gray-100, #eef0f5); border-radius: 10px; }
.pt-g-inner { min-width: 100%; }
.pt-g-head { display: flex; background: var(--gray-50, #f6f7fb); border-bottom: 1px solid var(--gray-200, #e6e8ef); position: sticky; top: 0; z-index: 2; }
.pt-g-namecol { flex: 0 0 190px; padding: 8px 12px; font-weight: 700; font-size: .82rem; border-right: 1px solid var(--gray-200, #e6e8ef); background: var(--white, #fff); }
.pt-g-cols { display: flex; }
.pt-g-col { flex: 0 0 auto; padding: 8px 6px; font-size: .72rem; color: var(--gray-500, #888); text-align: center; border-right: 1px solid var(--gray-100, #eef0f5); }
.pt-g-body { position: relative; }
.pt-g-row { display: flex; border-bottom: 1px solid var(--gray-100, #eef0f5); }
.pt-g-row .pt-g-namecol { font-weight: 500; font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-g-track { position: relative; height: 38px; flex: 0 0 auto; }
.pt-g-cells { display: flex; height: 100%; position: absolute; inset: 0; }
.pt-g-cell { flex: 0 0 auto; height: 100%; border-right: 1px solid var(--gray-100, #eef0f5); }
.pt-g-today { position: absolute; top: 0; bottom: 0; width: 2px; background: #dc2626; opacity: .6; z-index: 3; }
.pt-g-bar { position: absolute; top: 8px; height: 22px; border-radius: 6px; color: #fff; font-size: .72rem; display: flex; align-items: center; padding: 0 8px; cursor: pointer; overflow: hidden; z-index: 2; box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.pt-g-bar:hover { filter: brightness(1.05); }
.pt-g-bar.overdue { outline: 2px solid #dc2626; }
.pt-g-bar-label { position: relative; z-index: 2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-g-bar-fill { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(255,255,255,.35); }
.pt-daily-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.pt-cal-title { font-weight: 700; font-size: 1.05rem; min-width: 150px; text-align: center; }
.pt-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 16px; }
.pt-cal-dow { text-align: center; font-size: .72rem; color: var(--gray-500, #888); font-weight: 700; padding: 4px 0; }
.pt-cal-cell { min-height: 72px; border: 1px solid var(--gray-200, #e6e8ef); border-radius: 8px; padding: 4px 6px; cursor: pointer; background: var(--white, #fff); }
.pt-cal-cell.empty { background: transparent; border: none; cursor: default; }
.pt-cal-cell.today { border-color: var(--purple-500, #7c5cbf); background: #f5f1fc; }
.pt-cal-cell.sel { outline: 2px solid var(--purple-600, #7c5cbf); }
.pt-cal-daynum { font-size: .78rem; font-weight: 700; color: var(--gray-600, #555); }
.pt-cal-dots { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; }
.pt-cal-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.pt-cal-more, .pt-cal-cnt { font-size: .68rem; color: var(--gray-500, #888); margin-top: 2px; }
.pt-day-panel { padding: 16px; }
.pt-dl-item { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--gray-100, #eef0f5); }
.pt-dl-item.clickable { cursor: pointer; }
.pt-dl-item .pt-dl-title { flex: 1 1 auto; }
.pt-year-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.pt-year-card { padding: 14px; cursor: pointer; }
.pt-year-card.current { border-color: var(--purple-500, #7c5cbf); }
.pt-year-name { font-weight: 700; margin-bottom: 8px; }
.pt-year-stats { display: flex; gap: 20px; margin-bottom: 8px; }
.pt-year-val { font-size: 1.2rem; font-weight: 800; }
.pt-year-lbl { font-size: .72rem; }
.pt-pager { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.pt-mini-bar { position: relative; width: 70px; height: 16px; background: var(--gray-100, #eef0f5); border-radius: 999px; overflow: hidden; }
.pt-mini-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--purple-500, #7c5cbf); }
.pt-mini-bar span { position: relative; z-index: 1; font-size: .68rem; display: block; text-align: center; line-height: 16px; color: var(--gray-700, #444); }
.pt-prog-field { display: flex; align-items: center; gap: 10px; }
.pt-prog-field input[type="number"] { width: 72px; }
.pt-subtask-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.pt-subtask-row .inp-search { flex: 1 1 auto; }
.modal-foot-spacer { flex: 1 1 auto; }
.pt-del-btn { margin-right: auto; }
.pt-details .info-grid { margin-bottom: 8px; }
.pt-detail-section { padding: 14px; margin-top: 12px; }
.pt-preserve { white-space: pre-wrap; word-break: break-word; }
.pt-check-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.pt-done { text-decoration: line-through; color: var(--gray-500, #888); }
.pt-comment-input { display: flex; gap: 8px; margin-top: 10px; }
.pt-comment-input .inp-search { flex: 1 1 auto; }
.pt-comment { padding: 8px 0; border-bottom: 1px solid var(--gray-100, #eef0f5); }
.pt-comment-head { display: flex; gap: 10px; align-items: baseline; font-size: .82rem; }
.pt-act-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: .82rem; }
.pt-act-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--purple-500, #7c5cbf); flex: 0 0 auto; }
.text-danger { color: #dc2626; }
.row-overdue { background: rgba(220,38,38,.04); }
@media (max-width: 720px) {
  .pt-g-namecol { flex-basis: 130px; }
  .pt-chart { width: 130px; height: 130px; }
}

/* ==========================================================================
   Daily Task Manager — blue/teal hospital theme
   ========================================================================== */
:root {
  --dt-blue: #0ea5e9;
  --dt-blue-dark: #0369a1;
  --dt-teal: #0d9488;
  --dt-teal-dark: #0f766e;
  --dt-ink: #0f172a;
  --dt-muted: #64748b;
  --dt-line: #e2e8f0;
  --dt-bg: #f8fafc;
}
.dt-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; margin-bottom: 14px; background: linear-gradient(120deg, #eff6ff 0%, #ecfeff 100%); border-left: 5px solid var(--dt-teal); flex-wrap: wrap; }
.dt-header-left { display: flex; align-items: center; gap: 14px; }
.dt-header-ico { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-size: 1.3rem; background: linear-gradient(135deg, var(--dt-blue) 0%, var(--dt-teal) 100%); }
.dt-title { margin: 0; font-size: 1.25rem; color: var(--dt-ink); }
.dt-sub { font-size: 0.82rem; }
.dt-today { display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--dt-line); border-radius: 999px; padding: 7px 15px; font-weight: 600; color: var(--dt-teal-dark); font-size: 0.85rem; }
.dt-toolbar { flex-wrap: wrap; }
.dt-quickrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 12px 0; }
.dt-quick { display: flex; align-items: center; gap: 10px; flex: 1 1 340px; background: #fff; border: 1px solid var(--dt-line); border-radius: 12px; padding: 6px 6px 6px 14px; }
.dt-quick:focus-within { border-color: var(--dt-blue); box-shadow: 0 0 0 3px rgba(14,165,233,.12); }
.dt-quick-ico { color: var(--dt-blue); }
.dt-quick-input { flex: 1; border: none; outline: none; font-size: 0.92rem; background: transparent; color: var(--dt-ink); }
.dt-quick-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dt-tabs { flex-wrap: wrap; margin-bottom: 14px; }
.dt-host { display: block; }
.dt-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.dt-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.dt-card-ico { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; color: #fff; font-size: 1.05rem; flex: 0 0 auto; }
.dt-card-val { font-size: 1.4rem; font-weight: 700; color: var(--dt-ink); line-height: 1.1; }
.dt-card-lbl { font-size: 0.76rem; }
.dt-progress { padding: 16px 18px; margin-bottom: 16px; }
.dt-progress-head { display: flex; justify-content: space-between; font-weight: 600; color: var(--dt-ink); margin-bottom: 8px; }
.dt-progress-pct { color: var(--dt-teal-dark); }
.dt-progress-bar { height: 10px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.dt-progress-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--dt-blue), var(--dt-teal)); transition: width .3s ease; }
.dt-progress-sub { font-size: 0.78rem; margin-top: 8px; }
.dt-card-title { font-weight: 700; color: var(--dt-ink); margin-bottom: 10px; font-size: 1rem; }
.dt-today-card { padding: 16px 18px; margin-bottom: 16px; }
.dt-tpl-card { padding: 16px 18px; margin-bottom: 16px; }
.dt-tpl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-top: 10px; }
.dt-tpl { display: flex; align-items: center; gap: 8px; text-align: left; padding: 11px 14px; border: 1px dashed var(--dt-blue); border-radius: 10px; background: #f0f9ff; color: var(--dt-blue-dark); font-weight: 600; font-size: 0.85rem; cursor: pointer; transition: all .15s; }
.dt-tpl:hover { background: var(--dt-blue); color: #fff; border-style: solid; }
.dt-listwrap { display: block; }
.dt-listhead { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; font-weight: 700; color: var(--dt-ink); }
.dt-tasklist { display: flex; flex-direction: column; gap: 8px; }
.dt-task { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 12px 14px; border-left: 4px solid var(--dt-blue); transition: box-shadow .15s; }
.dt-task:hover { box-shadow: 0 4px 14px rgba(2,132,199,.1); }
.dt-task.is-done { border-left-color: var(--dt-teal); opacity: .78; }
.dt-task.is-done .dt-task-title { text-decoration: line-through; color: var(--dt-muted); }
.dt-task.is-overdue { border-left-color: #dc2626; background: #fff5f5; }
.dt-task-main { display: flex; align-items: flex-start; gap: 12px; flex: 1; min-width: 0; }
.dt-task-body { min-width: 0; flex: 1; }
.dt-task-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dt-task-title { font-weight: 600; color: var(--dt-ink); }
.dt-task-title.sm { font-size: 0.9rem; }
.dt-task-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.dt-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 0.72rem; color: var(--dt-muted); background: var(--dt-bg); border: 1px solid var(--dt-line); border-radius: 999px; padding: 2px 9px; }
.dt-tag.danger { color: #dc2626; border-color: #fecaca; background: #fef2f2; }
.dt-check { background: none; border: none; padding: 0; cursor: pointer; font-size: 1.35rem; color: #94a3b8; line-height: 1; }
.dt-check.done { color: var(--dt-teal); }
.dt-check:hover { color: var(--dt-teal-dark); }
.dt-actions { display: flex; gap: 2px; flex-wrap: wrap; }
.dt-sub-prog { display: flex; align-items: center; gap: 8px; font-size: 0.74rem; color: var(--dt-muted); margin-top: 6px; }
.dt-sub-bar { width: 90px; height: 5px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.dt-sub-fill { height: 100%; background: var(--dt-teal); }
/* Board */
.dt-boardwrap { overflow-x: auto; padding-bottom: 8px; }
.dt-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 12px; min-width: 100%; }
.dt-board-col { background: var(--dt-bg); border: 1px solid var(--dt-line); border-radius: 12px; display: flex; flex-direction: column; }
.dt-board-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; font-weight: 700; color: var(--dt-ink); border-bottom: 3px solid var(--dt-blue); }
.dt-board-dot { width: 9px; height: 9px; border-radius: 50%; }
.dt-board-count { margin-left: auto; background: #fff; border: 1px solid var(--dt-line); border-radius: 999px; font-size: 0.72rem; padding: 1px 9px; color: var(--dt-muted); }
.dt-board-body { padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.dt-board-card { background: #fff; border: 1px solid var(--dt-line); border-radius: 10px; padding: 10px 12px; cursor: pointer; transition: box-shadow .15s, transform .15s; }
.dt-board-card:hover { box-shadow: 0 5px 14px rgba(2,132,199,.12); transform: translateY(-1px); }
.dt-board-card.is-overdue { border-color: #fecaca; background: #fff5f5; }
.dt-board-meta { font-size: 0.74rem; margin-top: 5px; }
.dt-board-foot { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.dt-board-move { margin-top: 8px; }
/* Calendar */
.dt-cal-card { padding: 14px 16px; }
.dt-cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.dt-cal-title { font-weight: 700; color: var(--dt-ink); font-size: 1.05rem; min-width: 150px; }
.dt-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.dt-cal-dow { text-align: center; font-size: 0.72rem; font-weight: 700; color: var(--dt-muted); padding: 4px 0; text-transform: uppercase; }
.dt-cal-cell { min-height: 92px; border: 1px solid var(--dt-line); border-radius: 9px; padding: 5px; background: #fff; cursor: pointer; transition: border-color .15s; }
.dt-cal-cell:hover { border-color: var(--dt-blue); }
.dt-cal-cell.empty { background: transparent; border: 1px dashed #eef2f7; cursor: default; }
.dt-cal-cell.today { border-color: var(--dt-teal); box-shadow: 0 0 0 2px rgba(13,148,136,.15); }
.dt-cal-day { font-size: 0.8rem; font-weight: 700; color: var(--dt-ink); margin-bottom: 4px; }
.dt-cal-cell.today .dt-cal-day { color: var(--dt-teal-dark); }
.dt-cal-items { display: flex; flex-direction: column; gap: 3px; }
.dt-cal-item { font-size: 0.68rem; padding: 2px 6px; border-left: 3px solid var(--dt-blue); background: #f0f9ff; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--dt-blue-dark); }
.dt-cal-item.done { text-decoration: line-through; opacity: .6; }
.dt-cal-more { font-size: 0.68rem; padding-left: 4px; }
.dt-cal-hint { font-size: 0.76rem; margin-top: 10px; }
/* Reports */
.dt-reports { display: block; }
.dt-rep-controls { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 14px; }
.dt-rep-cards { margin-bottom: 14px; }
.dt-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.dt-chart-card { padding: 16px; }
.dt-chart-flex { display: flex; align-items: center; justify-content: center; }
.dt-chart { width: 180px; height: 180px; }
/* Subtasks & comments in modal */
.dt-subtasks { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.dt-subtask-row { display: flex; gap: 8px; align-items: center; }
.dt-subtask-row .inp-search { flex: 1; }
.dt-details { display: flex; flex-direction: column; gap: 14px; max-height: 62vh; overflow-y: auto; }
.dt-detail-title { font-size: 1.1rem; font-weight: 700; color: var(--dt-ink); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dt-detail-info { display: flex; flex-direction: column; gap: 6px; }
.dt-detail-row { display: flex; gap: 12px; font-size: 0.86rem; }
.dt-detail-row .muted { min-width: 140px; }
.dt-detail-label { font-weight: 700; color: var(--dt-ink); margin-bottom: 8px; }
.dt-check-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; cursor: pointer; font-size: 0.88rem; }
.struck { text-decoration: line-through; color: var(--dt-muted); }
.dt-comments { border-top: 1px solid var(--dt-line); padding-top: 14px; }
.dt-comment-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; max-height: 200px; overflow-y: auto; }
.dt-comment { background: var(--dt-bg); border-radius: 8px; padding: 8px 12px; }
.dt-comment-head { display: flex; justify-content: space-between; font-size: 0.78rem; margin-bottom: 3px; }
.dt-comment-add { display: flex; gap: 8px; }
.dt-comment-add .inp-search { flex: 1; }
.dt-foot-spacer { flex: 1 1 auto; }
.empty-state.tiny { padding: 12px; font-size: 0.78rem; }
.inp-select.sm { padding: 4px 8px; font-size: 0.78rem; }
.badge.badge-ok { background: #ccfbf1; color: var(--dt-teal-dark); }
@media (max-width: 720px) {
  .dt-header { flex-direction: column; align-items: flex-start; }
  .dt-cards { grid-template-columns: repeat(2, 1fr); }
  .dt-cal-cell { min-height: 62px; }
  .dt-cal-item { font-size: 0.6rem; }
  .dt-chart { width: 150px; height: 150px; }
}

/* ---------------------------------------------------------------------------
   Daily Report form (Data Report -> Daily Report)
--------------------------------------------------------------------------- */
.dr-section {
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 16px;
  margin: 0 0 16px;
  background: #fff;
}
.dr-section legend {
  font-weight: 700;
  color: var(--gray-900);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0 8px;
}
.dr-stats {
  grid-template-columns: repeat(2, 1fr);
  grid-auto-flow: column;
  grid-template-rows: repeat(4, auto);
}
.dr-beds { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.dr-readonly {
  background: var(--gray-100) !important;
  font-weight: 700;
  color: var(--gray-900);
}
.dr-remarks {
  min-height: 180px;
  resize: vertical;
  line-height: 1.5;
}
.dr-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.dr-editing { font-size: 0.78rem; color: var(--purple-600); font-weight: 650; }
.dr-card { margin-bottom: 18px; }

@media (max-width: 640px) {
  .dr-section { padding: 12px; }
  .dr-stats { grid-auto-flow: row; grid-template-columns: repeat(2, 1fr); grid-template-rows: none; }
  .dr-beds { grid-template-columns: repeat(2, 1fr); }
  .dr-actions { flex-direction: column-reverse; }
  .dr-actions .btn { width: 100%; justify-content: center; }
}

/* ---------------------------------------------------------------------------
   Dashboard Report (Data Report -> Dashboard Report)
--------------------------------------------------------------------------- */
.drp-compare {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
.drp-cmp-body { display: flex; flex-direction: column; }
.drp-cmp-head, .drp-cmp-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
}
.drp-cmp-head {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--gray-600);
  border-bottom: 1px solid var(--gray-200);
}
.drp-cmp-row { border-bottom: 1px solid var(--gray-100); font-size: 0.85rem; }
.drp-cmp-row:last-child { border-bottom: none; }
.drp-metric { color: var(--gray-700); font-weight: 600; }
.drp-cur { font-weight: 700; color: var(--gray-900); }
.drp-prev { color: var(--gray-600); }
.drp-delta { font-weight: 700; font-size: 0.8rem; }
.drp-delta.up { color: var(--green-600); }
.drp-delta.down { color: var(--red-600); }
.drp-delta.flat { color: var(--gray-500); }

@media (max-width: 720px) {
  .drp-compare { grid-template-columns: 1fr; }
  .drp-cmp-head, .drp-cmp-row { grid-template-columns: 1.2fr 1fr 1fr 1fr; font-size: 0.78rem; padding: 7px 6px; }
}

/* Dashboard Report - line comparison */
.drp-line-card { margin-bottom: 16px; }
.drp-line-card .card-sub { font-size: .78rem; color: var(--gray-500); margin-top: 2px; }
.drp-line-controls { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin: 2px 0 14px; }
.drp-line-controls .field { display: flex; flex-direction: column; gap: 5px; min-width: 148px; }
.drp-line-controls .field label { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--gray-600); }
.drp-line-summary { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.drp-line-sum { display: inline-flex; align-items: center; gap: 7px; background: var(--gray-100); border: 1px solid var(--gray-200); border-radius: 999px; padding: 5px 11px; font-size: .76rem; color: var(--gray-700); white-space: nowrap; }
.drp-line-sum i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.drp-line-sum b { color: var(--gray-900); }
.drp-line-delta.up b { color: var(--green-600); }
.drp-line-delta.down b { color: var(--red-600); }
.drp-line-chart { position: relative; }
.drp-line-canvas { width: 100%; height: 300px; display: block; }
.lc-tip { position: absolute; display: none; min-width: 140px; background: #fff; border: 1px solid var(--gray-200); border-radius: 10px; box-shadow: 0 10px 26px rgba(20,20,40,.14); padding: 9px 11px; font-size: .76rem; color: var(--gray-700); pointer-events: none; z-index: 5; white-space: nowrap; }
.lc-tip-date { font-weight: 800; color: var(--gray-900); margin-bottom: 4px; }
.lc-tip b { color: var(--gray-900); }
.lc-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
@media (max-width: 640px) {
  .drp-line-summary { justify-content: flex-start; }
  .drp-line-canvas { height: 240px; }
}


.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.mch-sync-label { font-size: 0.78rem; color: var(--gray-500); font-weight: 600; }
.mch-sync-label.warn { color: var(--red-600); }

/* ---- Total Patients - Yearly Comparison ---- */
.ps-card { background: #fff; border: 1px solid #e2e8f0; border-radius: var(--radius-lg); box-shadow: var(--shadow-1); padding: 20px; margin: 0 0 20px; }
.ps-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; border-bottom: 2px solid #0f2742; padding-bottom: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.ps-brand { display: flex; gap: 12px; align-items: center; min-width: 0; }
.ps-logo { width: 46px; height: 46px; border-radius: 12px; background: #0f2742; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.25rem; flex: 0 0 auto; }
.ps-hospital { font-size: .7rem; font-weight: 800; letter-spacing: .12em; color: #2563eb; text-transform: uppercase; }
.ps-title { margin: 2px 0 0; font-size: 1.35rem; color: #0f2742; font-weight: 800; }
.ps-sub { font-size: .8rem; color: var(--gray-500); }
.ps-source { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; font-size: .72rem; color: var(--gray-500); margin-top: 3px; overflow-wrap: anywhere; }
.ps-source i { color: #0f766e; font-size: .72rem; }
.ps-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.ps-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 10px; }
.ps-kpi { border: 1px solid var(--gray-200); border-left: 4px solid var(--gray-300); border-radius: 12px; padding: 12px 14px; background: #fff; }
.ps-kpi-blue { border-left-color: #2563eb; }
.ps-kpi-orange { border-left-color: #f97316; }
.ps-kpi-green { border-left-color: #16a34a; }
.ps-kpi-red { border-left-color: #dc2626; }
.ps-kpi-purple { border-left-color: #7c3aed; }
.ps-kpi-label { font-size: .72rem; font-weight: 700; color: var(--gray-500); text-transform: uppercase; letter-spacing: .03em; }
.ps-kpi-value { font-size: 1.6rem; font-weight: 800; color: #0f2742; margin: 2px 0; font-variant-numeric: tabular-nums; }
.ps-kpi-sub { font-size: .72rem; color: var(--gray-500); }
.ps-note { display: flex; gap: 8px; align-items: center; font-size: .78rem; color: #475569; background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 10px; padding: 8px 12px; margin-bottom: 14px; }
.ps-note-warn { color: #b45309; font-weight: 600; }
.ps-note-info { color: #1d4ed8; font-weight: 600; }
.ps-chart-card { position: relative; border: 1px solid var(--gray-200); border-radius: 14px; padding: 14px; margin-bottom: 16px; }
.ps-chart-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.ps-chart-title { font-weight: 700; color: #0f2742; }
.ps-chart-head-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ps-chart-mode { padding: 3px; border-radius: 9px; }
.ps-chart-mode .seg-btn { padding: 5px 9px; font-size: .72rem; gap: 5px; min-height: 28px; }
.ps-legend { display: flex; gap: 6px; flex-wrap: wrap; }
.ps-legend-item { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--gray-200); background: #fff; border-radius: 999px; padding: 4px 10px; font-size: .74rem; color: #334155; cursor: pointer; }
.ps-legend-item:hover { border-color: #94a3b8; }
.ps-legend-item.off { opacity: .45; }
.ps-legend-swatch { width: 10px; height: 10px; border-radius: 2px; background: var(--c); display: inline-block; }
.ps-legend-swatch.line { height: 3px; border-radius: 2px; width: 14px; }
.ps-chart-wrap { position: relative; }
.ps-canvas { width: 100%; height: 340px; display: block; }
.ps-tip { position: absolute; display: none; background: #fff; border: 1px solid #cbd5e1; border-radius: 10px; box-shadow: 0 10px 26px rgba(15, 39, 66, .16); padding: 9px 11px; font-size: .75rem; color: #334155; pointer-events: none; z-index: 6; min-width: 172px; }
.ps-tip-title { font-weight: 800; color: #0f2742; margin-bottom: 5px; }
.ps-tip-row { display: flex; align-items: center; gap: 7px; margin: 2px 0; }
.ps-tip-row i { width: 8px; height: 8px; border-radius: 50%; }
.ps-tip-row span { flex: 1; }
.ps-tip-row b { color: #0f2742; font-variant-numeric: tabular-nums; }
.ps-scroll { overflow-x: auto; }
.ps-table { width: 100%; border-collapse: collapse; font-size: .82rem; min-width: 880px; }
.ps-table th, .ps-table td { border-bottom: 1px solid var(--gray-200); padding: 7px 9px; white-space: nowrap; }
.ps-table thead th { background: #0f2742; color: #fff; font-weight: 600; font-size: .7rem; text-transform: uppercase; letter-spacing: .03em; }
.ps-table tbody th { text-align: left; background: #f1f5f9; font-weight: 700; color: #0f2742; position: sticky; left: 0; z-index: 1; }
.ps-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.ps-table .ps-total-col { font-weight: 700; background: #f8fafc; border-left: 2px solid #cbd5e1; }
.ps-table tbody tr:hover td { background: #f8fafc; }
.ps-row-comp th { background: #fff7ed !important; }
.ps-row-growth th { background: #f5f3ff !important; }
.ps-row-all th, .ps-row-all td { font-weight: 700; }
.ps-row-all th { background: #f0fdf4 !important; border-top: 2px solid #86efac; }
.ps-period { margin-top: 16px; }
.ps-period .ps-head { align-items: center; }
.ps-period-mode { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.ps-period-mode label { font-size: .68rem; font-weight: 700; color: var(--gray-500); text-transform: uppercase; letter-spacing: .03em; }
.ps-period-fields { display: flex; gap: 12px; flex-wrap: wrap; margin: 4px 0 14px; }
.ps-period-fields[hidden] { display: none; }
.ps-period-values { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.ps-period-values.single { grid-template-columns: minmax(0, 1fr); }
.ps-period-values.single .ps-kpi { max-width: 420px; }
.ps-period-note { font-size: .75rem; color: var(--gray-500); margin-top: 8px; min-height: 1em; }
.ps-period-note .ps-note-info, .ps-period-note .ps-note-warn { display: inline-block; margin-right: 12px; }
.ps-period-chart { margin-top: 14px; margin-bottom: 0; }
.ps-period-canvas { height: 250px; }
.ps-period-legend { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ps-period-legend .ps-legend-item { cursor: default; }
.ps-period-badge { display: inline-flex; align-items: center; font-size: .74rem; font-weight: 800; padding: 4px 9px; border-radius: 999px; background: #f1f5f9; color: #475569; font-variant-numeric: tabular-nums; }
.ps-period-badge.up { background: #dcfce7; color: #15803d; }
.ps-period-badge.down { background: #fee2e2; color: #b91c1c; }
@media (max-width: 640px) {
  .ps-period-values { grid-template-columns: 1fr; }
  .ps-period-mode { align-items: flex-start; }
  .ps-chart-card .ps-period-canvas { height: 220px; }
}

.ps-daily { margin-top: 16px; }
.ps-daily .ps-chart-card { margin-top: 14px; margin-bottom: 0; }
.ps-daily-canvas { height: 260px; }
.ps-daily-growth { height: 220px; }
.ps-daily-hint { font-size: .72rem; color: var(--gray-500); }
@media (max-width: 760px) {
  .ps-daily .ps-daily-canvas { height: 220px; }
  .ps-daily .ps-daily-growth { height: 200px; }
}
.ps-muted { color: var(--gray-400); }
.ps-growth { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ps-growth.up { color: #15803d; }
.ps-growth.down { color: #b91c1c; }
.ps-growth.flat { color: #475569; }
.ps-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 34px 20px; color: var(--gray-500); font-size: .86rem; background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 12px; }
.ps-empty[hidden] { display: none; }
.ps-empty i { font-size: 1.6rem; color: #94a3b8; }
.ps-card.is-empty .ps-summary, .ps-card.is-empty .ps-note, .ps-card.is-empty .ps-chart-card, .ps-card.is-empty .ps-table-card { display: none; }
.ps-card:fullscreen { background: #fff; padding: 24px; overflow: auto; }
.ps-card:fullscreen .ps-canvas { height: 52vh; }
.ps-manage-form { margin-bottom: 14px; }
.ps-manage-title { font-weight: 800; color: #0f2742; margin-bottom: 10px; }
.ps-manage-fields { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.ps-manage-fields label { display: flex; flex-direction: column; gap: 4px; font-size: .72rem; font-weight: 700; color: var(--gray-600); }
.ps-manage-actions { display: flex; gap: 8px; margin-top: 10px; }
.ps-hint { font-size: .74rem; color: var(--gray-500); margin-top: 6px; }
.ps-hint-warn { color: #b45309; }
.ps-manage-tools { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.ps-manage-scroll { max-height: 300px; overflow: auto; }
.ps-row-actions { display: flex; gap: 4px; }
.ps-import-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ps-import-row .inp-input { max-width: 260px; }
.ps-import-preview { margin-top: 10px; }
.ps-import-summary { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.ps-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .7rem; font-weight: 700; background: var(--gray-100); color: var(--gray-600); }
.ps-badge.ok { background: #dcfce7; color: #15803d; }
.ps-badge.bad { background: #fee2e2; color: #b91c1c; }
.ps-badge.ins { background: #dbeafe; color: #1d4ed8; }
.ps-badge.upd { background: #ffedd5; color: #c2410c; }
.ps-badge.skip { background: #f1f5f9; color: #475569; }
.ps-import-errors { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; border-radius: 8px; padding: 8px 10px; font-size: .74rem; margin-bottom: 8px; }
.ps-import-scroll { max-height: 240px; overflow: auto; }
.ps-admin-table { min-width: 640px; font-size: .78rem; }
@media (max-width: 960px) {
  .ps-summary { grid-template-columns: repeat(2, 1fr); }
  .ps-manage-fields { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .ps-summary { grid-template-columns: 1fr; }
  .ps-canvas { height: 260px; }
  .ps-title { font-size: 1.1rem; }
  .ps-manage-fields { grid-template-columns: 1fr; }
  .ps-card { padding: 14px; }
}

/* Total Patients - all doctors breakdown */
.ps-doctor-card { margin-top: 14px; }
.ps-doctor-card[hidden] { display: none; }
.ps-doctor-legend { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: .72rem; color: var(--gray-600); }
.ps-doctor-key { display: inline-flex; align-items: center; gap: 5px; }
.ps-doctor-list { display: flex; flex-direction: column; gap: 8px; padding: 4px 0 6px; }
.ps-doctor-row { display: grid; grid-template-columns: minmax(150px, 215px) minmax(0, 1fr); gap: 14px; align-items: start; padding: 6px 4px; border-radius: 8px; cursor: pointer; }
.ps-doctor-row:hover { background: var(--gray-100); }
.ps-doctor-name { font-size: .82rem; font-weight: 600; color: var(--gray-800); padding-top: 2px; overflow-wrap: anywhere; }
.ps-doctor-bars { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ps-doctor-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ps-doctor-year { flex: 0 0 auto; width: 38px; text-align: right; font-size: .7rem; color: var(--gray-500); }
.ps-doctor-track { flex: 1 1 auto; min-width: 24px; height: 12px; border-radius: 999px; background: var(--gray-100); overflow: hidden; }
.ps-doctor-fill { height: 100%; border-radius: 999px; }
.ps-doctor-fill.base { background: #2563eb; }
.ps-doctor-fill.comp { background: #f97316; }
.ps-doctor-value { flex: 0 0 auto; width: 64px; text-align: right; font-size: .72rem; font-weight: 600; color: var(--gray-700); font-variant-numeric: tabular-nums; }
.ps-doctor-empty { padding: 12px 4px; font-size: .8rem; color: var(--gray-500); }
@media (max-width: 640px) {
  .ps-doctor-row { grid-template-columns: 1fr; gap: 5px; }
  .ps-doctor-name { padding-top: 0; }
  .ps-doctor-value { width: 54px; }
}

/* Patient Report analytics (diagnosis/address/LOS) */
.ps-report-card { margin-top: 16px; }
.ps-report-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.ps-report-kpi-text { font-size: 1rem !important; line-height: 1.25; }
.ps-report-status { min-height: 1.1em; margin-top: 8px; font-size: .78rem; color: var(--gray-500); }
.ps-report-status.error { color: #b91c1c; }
.ps-report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.ps-report-item { margin: 0; min-width: 0; }
.ps-report-canvas, .ps-report-loc { height: 250px; }
.ps-report-pie { height: 270px; }
.ps-report-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; font-size: .72rem; color: var(--gray-600); }
.ps-report-pie-detail { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; margin-top: 2px; font-size: .68rem; color: var(--gray-600); }
.ps-report-pie-detail-title { width: 100%; font-size: .66rem; font-weight: 700; color: var(--gray-500); }
.ps-report-pie-detail-item { display: inline-flex; align-items: center; gap: 4px; }
.ps-report-controls { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: .72rem; color: var(--gray-600); }
.ps-report-controls .inp-select { width: auto; min-width: 140px; padding-top: 4px; padding-bottom: 4px; }
.ps-report-diagnosis-list.all { max-height: 430px; overflow-y: auto; padding-right: 4px; }
.ps-report-key { display: inline-flex; align-items: center; gap: 5px; }
.ps-report-grid .ps-doctor-row { cursor: default; }
.ps-report-grid .ps-doctor-row:hover { background: transparent; }
.ps-report-grid .ps-doctor-name { font-size: .78rem; }
.ps-report-grid .ps-report-row .ps-doctor-value { width: 92px; }
@media (max-width: 1000px) {
  .ps-report-grid { grid-template-columns: 1fr; }
  .ps-report-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .ps-report-kpis { grid-template-columns: 1fr; }
  .ps-report-canvas, .ps-report-loc { height: 220px; }
  .ps-report-pie { height: 260px; }
  .ps-report-grid .ps-report-row .ps-doctor-value { width: 84px; }
}

/* Patient Report analytics filters */
.ps-report-card .ps-report-filters { margin-top: 12px; }
.ps-report-filters .field { min-width: 150px; }
.ps-report-filters .btn { margin-top: 2px; }

/* Staff Time Control */
.st-card { margin: 0; }
.st-filters { margin-top: 12px; }
.st-chart-filters { margin: 0 0 2px; padding: 10px 0 2px; background: transparent; box-shadow: none; border-top: 1px solid var(--gray-100); border-radius: 0; }
.st-chart-filters .field { min-width: 120px; }
.st-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.st-kpis .ps-kpi { min-width: 0; }
.st-status { min-height: 1.1em; margin-top: 8px; font-size: .78rem; color: var(--gray-500); }
.st-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.st-chart { margin: 0; min-width: 0; }
.st-span2 { grid-column: 1 / -1; }
.st-canvas { height: 260px; }
.st-legend { display: flex; flex-wrap: wrap; gap: 5px 12px; margin-top: 6px; font-size: .7rem; color: var(--gray-600); }
.st-legend-item { display: inline-flex; align-items: center; gap: 4px; }
.st-table-card { margin-top: 14px; }
.st-table-scroll { max-height: 520px; overflow: auto; margin-top: 8px; }
.st-table { width: 100%; border-collapse: collapse; font-size: .78rem; }
.st-table th { position: sticky; top: 0; background: #0f2742; color: #fff; text-align: left; padding: 8px 10px; font-weight: 700; white-space: nowrap; }
.st-table td { padding: 8px 10px; border-bottom: 1px solid var(--gray-100); white-space: nowrap; }
.st-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.st-staff-name { font-weight: 600; color: var(--gray-800); }
.st-staff-code { font-size: .66rem; color: var(--gray-500); }
.st-neg { color: #b91c1c; font-weight: 600; }
.st-pos { color: #15803d; font-weight: 600; }
@media (max-width: 1000px) {
  .st-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .st-grid { grid-template-columns: 1fr; }
  .st-span2 { grid-column: auto; }
}
@media (max-width: 640px) {
  .st-kpis { grid-template-columns: 1fr; }
  .st-canvas { height: 220px; }
}

.nav-link-standalone { margin-top: 10px; margin-bottom: 6px; }

/* Staff Time late clock-in bar chart */
.st-late-hint { font-size: .7rem; color: var(--gray-500); margin-bottom: 8px; }
.st-late-list { display: flex; flex-direction: column; gap: 7px; max-height: 480px; overflow-y: auto; padding-right: 4px; }
.st-late-row { display: grid; grid-template-columns: minmax(180px, 240px) minmax(0, 1fr) 150px; gap: 12px; align-items: center; padding: 5px 2px; }
.st-late-name { min-width: 0; }
.st-late-track { min-width: 20px; height: 14px; border-radius: 999px; background: var(--gray-100); overflow: hidden; }
.st-late-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #d97706, #fbbf24); }
.st-late-value { text-align: right; font-size: .74rem; font-weight: 600; color: var(--gray-700); font-variant-numeric: tabular-nums; white-space: nowrap; }
.st-late-empty { padding: 10px 2px; font-size: .8rem; color: var(--gray-500); }
@media (max-width: 700px) {
  .st-late-row { grid-template-columns: 1fr; gap: 4px; }
  .st-late-value { text-align: left; }
}

/* Staff Time remark and daily chart controls */
.st-daily-mode { flex-shrink: 0; }
.st-chart-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.st-scan-filter { width: auto; min-width: 150px; font-size: 12px; padding: 5px 8px; }
.st-staff-filter { width: auto; min-width: 190px; max-width: 260px; font-size: 12px; padding: 5px 8px; }
.st-control-inline { display: flex; align-items: center; gap: 6px; min-width: 0; }
.st-control-label { flex-shrink: 0; font-size: 11px; font-weight: 600; color: #64748b; white-space: nowrap; }
.st-status-filter { width: auto; min-width: 150px; max-width: 200px; font-size: 12px; padding: 5px 8px; }
.st-staff-bars { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 14px 6px; align-items: end; padding: 14px 4px 4px; }
.st-staff-bar { min-width: 0; display: flex; flex-direction: column; align-items: center; }
.st-staff-bar-value { font-size: 11px; font-weight: 700; color: #0f172a; line-height: 1; margin-bottom: 4px; }
.st-staff-bar-track { width: 100%; height: 84px; display: flex; align-items: flex-end; justify-content: center; }
.st-staff-bar-fill { width: min(16px, 70%); border-radius: 4px 4px 0 0; }
.st-staff-bar-name { width: 100%; margin-top: 5px; font-size: 9px; line-height: 1.15; color: #64748b; text-align: center; word-break: break-word; max-height: 30px; overflow: hidden; }
.st-staff-bars-empty { grid-column: 1 / -1; padding: 24px; text-align: center; color: #94a3b8; font-size: 12px; }
@media (max-width: 640px) {
  .st-staff-bars { grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 12px 4px; padding: 10px 0 2px; }
  .st-staff-bar-track { height: 70px; }
  .st-staff-bar-name { font-size: 8.5px; max-height: 26px; }
  .st-chart-actions { width: 100%; justify-content: flex-start; }
  .st-scan-filter { min-width: 0; flex: 1 1 150px; }
  .st-control-inline { width: 100%; flex-direction: column; align-items: flex-start; gap: 3px; }
  .st-control-label { font-size: 10px; }
  .st-status-filter { width: 100%; min-width: 0; max-width: none; flex: none; }
  .st-staff-filter { min-width: 0; max-width: none; flex: 1 1 180px; }
}
.st-daily-mode .seg-btn { padding: 4px 8px; font-size: .68rem; }
.st-remark-controls { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: .72rem; color: var(--gray-600); }
.st-remark-controls .inp-select { width: auto; min-width: 190px; padding-top: 4px; padding-bottom: 4px; }
@media (max-width: 640px) {
  .st-remark-controls { flex-wrap: wrap; }
  .st-remark-controls .inp-select { min-width: 0; flex: 1; }
}

@media (max-width: 640px) {
  .kpi-period-bar { align-items: flex-start; flex-direction: column; }
  .kpi-period-controls { width: 100%; }
  .kpi-period-field { flex: 1 1 120px; }
  .kpi-period-field .inp-select { width: 100%; min-width: 0; }
  .kpi-saved-header { flex-direction: column; }
  .kpi-saved-tools { width: 100%; }
  .kpi-saved-search { min-width: 0; max-width: none; flex: 1 1 180px; }
  .kpi-saved-actions { margin-left: 0; }
}

.se-hero {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 18px 20px; margin-bottom: 16px;
  background: linear-gradient(135deg, #fbfaff 0%, #f2ecfb 100%);
  border: 1px solid var(--purple-200, #ded4f2);
}
.se-hero-icon {
  width: 44px; height: 44px; min-width: 44px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  background: #fff; color: var(--purple-700, #5b3e9e);
  border: 1px solid var(--purple-200, #ded4f2); font-size: 18px;
}
.se-hero-copy { flex: 1 1 260px; }
.se-title { margin: 0; font-size: 1.15rem; color: var(--gray-900, #2a2d3a); }
.se-sub { margin: 3px 0 0; font-size: 12.5px; color: var(--gray-500, #8b91a3); }
.se-tabs { margin-left: auto; }
.se-card { padding: 18px 20px; margin-bottom: 16px; }
.se-intro h3 { margin: 0; font-size: 1rem; color: var(--gray-900, #2a2d3a); }
.se-intro p { margin: 5px 0 16px; color: var(--gray-600, #6a6f80); font-size: 13px; line-height: 1.55; }
.se-form { margin-bottom: 10px; }
.se-note { display: flex; align-items: flex-start; gap: 6px; margin: 10px 0 4px; font-size: 11.5px; line-height: 1.45; color: var(--gray-500, #8b91a3); }
.se-note i { margin-top: 2px; color: var(--purple-500, #7c5cbf); }
.se-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.se-progress-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 11.5px; color: var(--gray-500, #8b91a3); }
.se-progress-label { font-weight: 700; color: var(--gray-700, #4b4f63); }
.se-progress { height: 7px; margin: 8px 0 16px; background: var(--gray-100, #f5f6f9); border-radius: 20px; overflow: hidden; }
.se-progress-fill { height: 100%; border-radius: 20px; background: linear-gradient(90deg, var(--purple-500, #7c5cbf), var(--purple-700, #5b3e9e)); transition: width .18s ease; }
.se-question-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.se-question-number { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--purple-600, #7c5cbf); }
.se-question { margin: 6px 0 16px; font-size: 1.05rem; line-height: 1.55; color: var(--gray-900, #2a2d3a); }
.se-options { display: flex; flex-direction: column; gap: 8px; }
.se-option {
  display: flex; align-items: flex-start; gap: 10px; cursor: pointer;
  padding: 11px 13px; border: 1.5px solid var(--gray-200, #e6e8ef);
  border-radius: 12px; background: #fff; transition: border-color .12s, background .12s, box-shadow .12s;
}
.se-option:hover { border-color: var(--purple-300, #c9b8ea); background: #fcfbff; }
.se-option.selected { border-color: var(--purple-500, #7c5cbf); background: var(--lavender-100, #f3f0fb); box-shadow: 0 0 0 3px rgba(124,92,191,.09); }
.se-option input { margin-top: 3px; accent-color: var(--purple-600, #6f4fc0); flex: 0 0 auto; }
.se-option-key { width: 24px; height: 24px; min-width: 24px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: #fff; border: 1px solid var(--gray-200, #e6e8ef); font-size: 11px; font-weight: 800; color: var(--purple-700, #5b3e9e); }
.se-option.selected .se-option-key { background: var(--purple-600, #6f4fc0); border-color: var(--purple-600, #6f4fc0); color: #fff; }
.se-option-text { font-size: 13px; line-height: 1.45; color: var(--gray-800, #3c4050); }
.se-result-card { padding: 30px 22px; text-align: center; margin-bottom: 16px; }
.se-result-icon { font-size: 42px; color: var(--green-600, #3e9a63); }
.se-result-card h3 { margin: 10px 0 4px; color: var(--gray-900, #2a2d3a); }
.se-result-thanks { margin: 0 0 18px; color: var(--gray-500, #8b91a3); font-size: 13px; }
.se-result-score { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 150px; padding: 16px 24px; border-radius: 18px; background: linear-gradient(135deg, #f6f1fc, #fff); border: 1px solid var(--purple-200, #ded4f2); }
.se-score-value { font-size: 2.2rem; font-weight: 850; color: var(--purple-700, #5b3e9e); line-height: 1; }
.se-score-label { margin-top: 4px; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--gray-500, #8b91a3); }
.se-result-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 20px auto; max-width: 760px; text-align: left; }
.se-result-meta > div { padding: 10px 12px; border: 1px solid var(--gray-200, #e6e8ef); border-radius: 10px; font-size: 12.5px; color: var(--gray-700, #4b4f63); }
.se-result-meta small { display: block; margin-top: 2px; font-size: 11px; color: var(--gray-500, #8b91a3); }
.se-results-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.se-results-filters .inp-select { min-width: 150px; }
.se-result-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.se-result-table th { text-align: left; padding: 9px 8px; background: var(--gray-100, #f5f6f9); color: var(--gray-600, #6a6f80); border-bottom: 1px solid var(--gray-200, #e6e8ef); }
.se-result-table td { padding: 9px 8px; border-bottom: 1px solid var(--gray-100, #f5f6f9); color: var(--gray-700, #4b4f63); }
.se-result-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.se-empty { padding: 20px; text-align: center; color: var(--gray-500, #8b91a3); font-size: 12.5px; }
.se-error { padding: 10px 12px; border-radius: 10px; background: #fef2f2; color: var(--red-600, #c0392b); font-size: 12.5px; }
@media (max-width: 640px) {
  .se-hero { align-items: flex-start; padding: 16px; }
  .se-tabs { width: 100%; margin-left: 0; }
  .se-tabs .seg-btn { flex: 1; }
  .se-card { padding: 16px; }
  .se-question { font-size: 1rem; }
  .se-actions .btn { flex: 1 1 auto; justify-content: center; }
  .se-result-meta { grid-template-columns: 1fr; }
  .se-result-table { display: block; overflow-x: auto; white-space: nowrap; }
  .se-results-filters .inp-select { flex: 1 1 130px; min-width: 0; }
}

.se-staff-search-field { margin-bottom: 8px; }
.se-staff-search { width: 100%; max-width: 520px; }
.se-staff-matches { display: flex; flex-direction: column; gap: 4px; margin: 4px 0 10px; max-width: 640px; }
.se-staff-hit {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 9px 11px; border: 1px solid var(--gray-200, #e6e8ef); border-radius: 10px;
  background: #fff; cursor: pointer; font-family: inherit; color: var(--gray-700, #4b4f63);
}
.se-staff-hit:hover { border-color: var(--purple-300, #c9b8ea); background: #fcfbff; }
.se-staff-hit-id { min-width: 82px; font-size: 11px; font-weight: 800; color: var(--purple-700, #5b3e9e); }
.se-staff-hit-name { flex: 1 1 auto; font-size: 12.5px; color: var(--gray-800, #3c4050); }
.se-selected-empty { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border: 1px dashed var(--gray-200, #e6e8ef); border-radius: 12px; color: var(--gray-500, #8b91a3); font-size: 12px; }
.se-selected-card { padding: 13px 14px; border: 1px solid var(--purple-200, #ded4f2); border-radius: 13px; background: #fcfbff; }
.se-selected-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.se-selected-label { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--gray-500, #8b91a3); }
.se-selected-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.se-selected-grid > div { padding: 8px 10px; background: #fff; border: 1px solid var(--gray-200, #e6e8ef); border-radius: 9px; min-width: 0; }
.se-selected-grid small { display: block; font-size: 9.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--gray-500, #8b91a3); }
.se-selected-grid strong { display: block; margin-top: 2px; font-size: 12.5px; color: var(--gray-900, #2a2d3a); overflow-wrap: anywhere; }
.se-exam-ready { display: flex; align-items: center; gap: 7px; margin-top: 10px; font-size: 12px; font-weight: 700; color: var(--green-600, #3e9a63); }
@media (max-width: 640px) {
  .se-staff-search { max-width: none; }
  .se-staff-hit { flex-wrap: wrap; }
  .se-staff-hit-name { flex-basis: calc(100% - 100px); }
  .se-selected-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.se-hero-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; margin-left: auto; }
.se-hero-side .se-tabs { margin-left: 0; }
.se-time-limit { display: flex; align-items: center; gap: 6px; padding: 5px 7px; background: #fff; border: 1px solid var(--gray-200, #e6e8ef); border-radius: 10px; }
.se-time-limit-label { font-size: 10.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--gray-500, #8b91a3); }
.se-time-limit-input { width: 64px; padding: 4px 6px; border: 1px solid var(--gray-200, #e6e8ef); border-radius: 7px; font-family: inherit; font-size: 12px; color: var(--gray-800, #3c4050); }
.se-time-limit-unit { font-size: 11px; color: var(--gray-500, #8b91a3); }
.se-timer { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; font-variant-numeric: tabular-nums; }
.se-timer.warn { background: #ffedd5; color: #c2410c; border-color: #fed7aa; }
.se-timer.danger { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
@media (max-width: 640px) {
  .se-hero-side { width: 100%; align-items: stretch; }
  .se-time-limit { justify-content: space-between; }
  .se-hero-side .se-tabs { width: 100%; }
  .se-hero-side .se-tabs .seg-btn { flex: 1; }
}

.se-admin-settings { display: flex; align-items: flex-end; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.se-setting { display: flex; flex-direction: column; gap: 2px; padding: 5px 7px; background: #fff; border: 1px solid var(--gray-200, #e6e8ef); border-radius: 9px; min-width: 0; }
.se-setting-label { font-size: 9px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--gray-500, #8b91a3); white-space: nowrap; }
.se-setting-control { display: flex; align-items: center; gap: 4px; }
.se-setting-input { width: 56px; padding: 3px 5px; border: 1px solid var(--gray-200, #e6e8ef); border-radius: 6px; font-family: inherit; font-size: 11.5px; color: var(--gray-800, #3c4050); }
.se-setting-unit { font-size: 10px; color: var(--gray-500, #8b91a3); white-space: nowrap; }
.se-setting-select { min-width: 116px; padding: 3px 6px; border-radius: 6px; font-size: 11px; }
@media (max-width: 640px) {
  .se-admin-settings { width: 100%; justify-content: stretch; }
  .se-setting { flex: 1 1 125px; }
  .se-setting-select { width: 100%; min-width: 0; }
}

.sf-start-fields { margin-top: 12px; }
.sf-summary-card { padding: 16px 18px; margin-bottom: 12px; position: sticky; top: 8px; z-index: 2; }
.sf-summary-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.sf-summary-head h3 { margin: 0; font-size: 1rem; color: var(--gray-900, #2a2d3a); }
.sf-summary-head p { margin: 3px 0 0; font-size: 11.5px; color: var(--gray-500, #8b91a3); }
.sf-calc { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.sf-calc strong { font-size: 1.15rem; color: var(--purple-700, #5b3e9e); }
.sf-calc span { font-size: 12px; font-weight: 700; color: var(--green-600, #3e9a63); }
.sf-progress-row { display: flex; align-items: center; gap: 10px; margin: 10px 0; font-size: 11px; color: var(--gray-500, #8b91a3); }
.sf-progress-track { flex: 1 1 auto; height: 7px; border-radius: 20px; overflow: hidden; background: var(--gray-100, #f5f6f9); }
.sf-progress-fill { height: 100%; border-radius: 20px; background: linear-gradient(90deg, var(--purple-500, #7c5cbf), var(--purple-700, #5b3e9e)); transition: width .18s; }
.sf-domain-scores, .sf-result-domains { display: flex; gap: 8px; flex-wrap: wrap; }
.sf-domain-score { display: flex; align-items: center; gap: 8px; padding: 6px 9px; border: 1px solid var(--gray-200, #e6e8ef); border-radius: 9px; background: #fff; font-size: 11px; color: var(--gray-600, #6a6f80); }
.sf-domain-score strong { color: var(--gray-900, #2a2d3a); font-variant-numeric: tabular-nums; }
.sf-pass-note { margin: 8px 0 0; font-size: 11px; color: var(--gold-500, #d8a53f); }
.sf-form-card { padding: 16px 18px 20px; }
.sf-domain { margin-top: 16px; }
.sf-domain-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--gray-200, #e6e8ef); padding-bottom: 7px; }
.sf-domain-head h3 { margin: 0; font-size: .98rem; color: var(--purple-700, #5b3e9e); }
.sf-subsection h4 { margin: 13px 0 7px; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--gray-500, #8b91a3); }
.sf-item { padding: 11px 12px; margin-bottom: 8px; border: 1px solid var(--gray-200, #e6e8ef); border-radius: 11px; background: #fff; }
.sf-item-head { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; }
.sf-item-id { font-size: 10px; font-weight: 800; color: var(--purple-700, #5b3e9e); letter-spacing: .04em; }
.sf-item-text { white-space: pre-line; font-size: 12.5px; line-height: 1.5; color: var(--gray-800, #3c4050); }
.sf-ratings { display: flex; gap: 5px; flex-wrap: wrap; margin: 9px 0 7px; }
.sf-rating { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border: 1px solid var(--gray-200, #e6e8ef); border-radius: 8px; font-size: 10.5px; color: var(--gray-600, #6a6f80); cursor: pointer; background: #fff; }
.sf-rating:hover { border-color: var(--purple-300, #c9b8ea); }
.sf-rating.selected { border-color: var(--purple-500, #7c5cbf); background: var(--lavender-100, #f3f0fb); color: var(--purple-700, #5b3e9e); font-weight: 700; }
.sf-rating input { accent-color: var(--purple-600, #6f4fc0); }
.sf-rating-na.selected { border-color: var(--gray-500, #8b91a3); background: var(--gray-100, #f5f6f9); color: var(--gray-700, #4b4f63); }
.sf-evidence { width: 100%; border: 1px solid var(--gray-200, #e6e8ef); border-radius: 9px; padding: 7px 9px; font-family: inherit; font-size: 12px; color: var(--gray-800, #3c4050); resize: vertical; }
.sf-review { margin-top: 18px; padding-top: 14px; border-top: 2px solid var(--gray-100, #f5f6f9); }
.sf-review h3 { margin: 0 0 10px; font-size: .98rem; color: var(--gray-900, #2a2d3a); }
.sf-declaration { display: flex; align-items: flex-start; gap: 8px; margin-top: 12px; font-size: 12px; color: var(--gray-600, #6a6f80); }
.sf-declaration input { margin-top: 2px; accent-color: var(--purple-600, #6f4fc0); }
.sf-result-card { padding: 28px 22px; text-align: center; }
.sf-result-domains { justify-content: center; margin: 18px 0; }
.sf-result-meta { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; color: var(--gray-500, #8b91a3); font-size: 12px; }
.sf-results-host { overflow-x: auto; }
@media (max-width: 640px) {
  .sf-summary-card { position: static; }
  .sf-ratings { gap: 4px; }
  .sf-rating { font-size: 10px; padding: 4px 6px; }
  .sf-domain-score { font-size: 10.5px; }
}

.sf-final-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sf-final-head .se-intro { flex: 1 1 320px; }

.ps-summary-card { padding: 16px 18px; margin-bottom: 12px; position: sticky; top: 8px; z-index: 2; }
.ps-form-card { padding: 16px 18px 20px; }
.ps-section { margin-top: 16px; }
.ps-results { display: flex; gap: 5px; flex-wrap: wrap; margin: 9px 0 7px; }
.ps-result { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border: 1px solid var(--gray-200, #e6e8ef); border-radius: 8px; background: #fff; color: var(--gray-600, #6a6f80); font-size: 10.5px; cursor: pointer; }
.ps-result:hover { border-color: var(--purple-300, #c9b8ea); }
.ps-result.selected { border-color: var(--purple-500, #7c5cbf); background: var(--lavender-100, #f3f0fb); color: var(--purple-700, #5b3e9e); font-weight: 700; }
.ps-result.disabled { opacity: .45; cursor: not-allowed; background: var(--gray-100, #f5f6f9); }
.ps-result input { accent-color: var(--purple-600, #6f4fc0); }
.ps-item-tools { display: flex; align-items: flex-start; gap: 8px; margin-top: 6px; }
.ps-method { min-width: 160px; max-width: 220px; font-size: 11px; padding: 6px 8px; }
.ps-comment { flex: 1 1 auto; min-height: 38px; border: 1px solid var(--gray-200, #e6e8ef); border-radius: 9px; padding: 7px 9px; font-family: inherit; font-size: 12px; color: var(--gray-800, #3c4050); resize: vertical; }
.ps-result-card { padding: 28px 22px; text-align: center; }
@media (max-width: 640px) {
  .ps-summary-card { position: static; }
  .ps-item-tools { flex-direction: column; }
  .ps-method { width: 100%; max-width: none; }
  .ps-comment { width: 100%; }
}

.pa-summary-card { padding: 16px 18px; margin-bottom: 12px; position: sticky; top: 8px; z-index: 2; }
.pa-summary-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pa-summary-head h3 { margin: 0; font-size: 1rem; color: var(--gray-900, #2a2d3a); }
.pa-summary-head p { margin: 3px 0 0; font-size: 11.5px; color: var(--gray-500, #8b91a3); }
.pa-total { text-align: right; }
.pa-total strong { display: block; font-size: 1.3rem; color: var(--purple-700, #5b3e9e); }
.pa-total span { font-size: 11px; color: var(--gray-500, #8b91a3); }
.pa-summary-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 9px; font-size: 11px; color: var(--gray-600, #6a6f80); }
.pa-summary-meta span { padding: 4px 8px; border: 1px solid var(--gray-200, #e6e8ef); border-radius: 8px; background: #fff; }
.pa-form-card { padding: 16px 18px 20px; }
.pa-category-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.pa-category { padding: 11px 12px; border: 1px solid var(--gray-200, #e6e8ef); border-radius: 11px; background: #fff; }
.pa-cat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pa-category label { display: flex; flex-direction: column; gap: 3px; margin-top: 7px; font-size: 10.5px; color: var(--gray-500, #8b91a3); }
.pa-result-input { width: 100%; }
.pa-weight-input { display: flex; align-items: center; gap: 8px; }
.pa-weight-input .inp-input { flex: 1; min-width: 0; }
.pa-weight-input span { font-size: 12px; color: var(--gray-500, #8b91a3); }
.pa-weighted { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; font-size: 10.5px; color: var(--gray-500, #8b91a3); }
.pa-weighted strong { font-size: 13px; color: var(--purple-700, #5b3e9e); }
.pa-result-card { padding: 28px 22px; text-align: center; }
.pa-table-scroll { overflow: auto; max-height: 70vh; border: 1px solid var(--gray-200, #e6e8ef); border-radius: 10px; }
.pa-table { border-collapse: separate; border-spacing: 0; min-width: 1500px; width: max-content; font-size: 11px; }
.pa-table th, .pa-table td { padding: 7px 8px; border-bottom: 1px solid var(--gray-100, #f5f6f9); border-right: 1px solid var(--gray-100, #f5f6f9); white-space: nowrap; }
.pa-table thead th { position: sticky; top: 0; z-index: 3; background: var(--gray-100, #f5f6f9); color: var(--gray-600, #6a6f80); font-weight: 700; text-align: center; }
.pa-table thead tr:nth-child(2) th { top: 31px; }
.pa-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) {
  .pa-category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .pa-summary-card { position: static; }
  .pa-category-grid { grid-template-columns: 1fr; }
}

/* =========================================================
   Package Report dashboard
   ========================================================= */
.pk-page { --pk-blue: #3B5BEE; --pk-green: #2EB67D; --pk-purple: #8056D9; --pk-orange: #F59E0B; --pk-teal: #28A9B8; --pk-pink: #EC4899; display: flex; flex-direction: column; gap: 14px; }
.pk-hero { position: relative; overflow: hidden; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; background: linear-gradient(120deg, #ffffff 0%, #f2f5ff 48%, #eefbf7 100%); border: 1px solid #dfe5f5; border-radius: 18px; padding: 18px 20px; box-shadow: 0 10px 30px rgba(49, 66, 145, .08); flex-wrap: wrap; }
.pk-hero::before { content: ''; position: absolute; width: 210px; height: 210px; right: -70px; top: -100px; border-radius: 50%; background: radial-gradient(circle, rgba(59, 91, 238, .16), rgba(59, 91, 238, 0) 68%); pointer-events: none; }
.pk-hero::after { content: ''; position: absolute; width: 180px; height: 180px; left: 34%; bottom: -130px; border-radius: 50%; background: radial-gradient(circle, rgba(46, 182, 125, .13), rgba(46, 182, 125, 0) 68%); pointer-events: none; }
.pk-hero > * { position: relative; z-index: 1; }
.pk-hero-main { display: flex; gap: 14px; align-items: flex-start; }
.pk-hero-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: #e8ecff; color: var(--pk-blue); font-size: 20px; flex: none; }
.pk-eyebrow { font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--pk-blue); margin-bottom: 2px; }
.pk-hero h2 { margin: 0; font-size: 1.35rem; color: #111827; }
.pk-hero p { margin: 3px 0 0; color: #6B7280; font-size: 12px; }
.pk-hero-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pk-btn { display: inline-flex; align-items: center; gap: 6px; border-radius: 9px; border: 1px solid transparent; padding: 8px 12px; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; transition: all var(--t-fast); }
.pk-btn:disabled { opacity: .55; cursor: wait; }
.pk-btn-primary { background: var(--pk-blue); color: #fff; }
.pk-btn-primary:hover { background: #2f4bd6; }
.pk-btn-outline { background: #fff; border-color: #d9deef; color: #3d4a6b; }
.pk-btn-outline:hover { background: #f6f8ff; border-color: #b9c4e8; }
.pk-btn-ghost { background: transparent; color: #6B7280; border-color: #e3e6ef; }
.pk-btn-ghost:hover { background: #fff; color: #111827; }
.pk-btn-sm { padding: 6px 9px; font-size: 11px; }
.pk-source-link { color: var(--pk-blue); font-size: 11px; font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }
.pk-source-link:hover { text-decoration: underline; }
.pk-data-badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 999px; background: #e8f7f0; color: #15803d; font-size: 10.5px; font-weight: 800; }
.pk-data-badge i { font-size: 6px; }
.pk-data-badge.warn { background: #fff4df; color: #a16207; }
.pk-meta-row { display: flex; justify-content: flex-end; margin-top: -6px; }
.pk-last-refresh { color: #8a92a6; font-size: 10.5px; }
.pk-filter-card { padding: 14px 16px 16px; border-left: 3px solid #3B5BEE; }
.pk-filter-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.pk-filter-head h3 { margin: 0; font-size: 13px; color: #111827; }
.pk-filter-head span { color: #8a92a6; font-size: 10.5px; }
.pk-filters { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 10px; align-items: end; }
.pk-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pk-field label { font-size: 10px; font-weight: 700; color: #6B7280; text-transform: uppercase; letter-spacing: .04em; }
.pk-field .inp-select, .pk-field .inp-input { width: 100%; min-width: 0; }
.pk-custom-dates { display: flex; gap: 8px; align-items: end; }
.pk-custom-dates .pk-field { flex: 1; }
.pk-filter-actions { display: flex; align-items: end; justify-content: flex-end; }
.pk-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 22px; }
.pk-chip { display: inline-flex; align-items: center; gap: 4px; background: #eef2ff; color: #3346c9; border: 1px solid #dce3ff; border-radius: 999px; padding: 4px 8px; font-size: 10.5px; font-weight: 700; }
.pk-chip-x { border: 0; background: transparent; color: #6070d8; cursor: pointer; font-size: 14px; line-height: 1; padding: 0 2px; }
.pk-clear-all { border: 0; background: transparent; color: #8a92a6; font-size: 10.5px; font-weight: 700; cursor: pointer; text-decoration: underline; }
.pk-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.pk-kpi { background: #fff; border: 1px solid #e7eaf2; border-top: 3px solid var(--pk-kpi-accent, #3B5BEE); border-radius: 14px; padding: 13px 14px; min-height: 120px; box-shadow: 0 5px 16px rgba(54, 66, 120, .055); position: relative; overflow: hidden; }
.pk-kpi::after { content: ''; position: absolute; right: -28px; bottom: -36px; width: 92px; height: 92px; border-radius: 50%; background: #f5f7ff; }
.pk-kpi-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-size: 14px; margin-bottom: 9px; position: relative; z-index: 1; }
.pk-kpi-label { color: #6B7280; font-size: 10.5px; font-weight: 700; position: relative; z-index: 1; }
.pk-kpi-value { color: #111827; font-size: 1.25rem; font-weight: 800; margin-top: 2px; line-height: 1.2; position: relative; z-index: 1; }
.pk-kpi-change { margin-top: 7px; font-size: 10.5px; font-weight: 800; position: relative; z-index: 1; }
.pk-kpi-change.up { color: #15803d; }
.pk-kpi-change.down { color: #b91c1c; }
.pk-kpi-change.muted { color: #8a92a6; }
.pk-kpi-note { color: #8a92a6; font-size: 9.5px; margin-top: 3px; position: relative; z-index: 1; }
.pk-kpi-missing .pk-kpi-value { font-size: .95rem; color: #6B7280; }
.pk-compare-note { margin: -4px 2px 0; color: #8a92a6; font-size: 10.5px; }
.pk-chart-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.pk-chart-card { min-height: 286px; display: flex; flex-direction: column; border-top: 3px solid var(--pk-card-accent, #3B5BEE); }
.pk-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 13px 14px 0; }
.pk-card-head h3 { margin: 0; color: #111827; font-size: 12px; }
.pk-card-head p { margin: 3px 0 0; color: #8a92a6; font-size: 10px; line-height: 1.35; }
.pk-card-body { padding: 9px 12px 12px; flex: 1; min-width: 0; }
.pk-canvas-wrap { width: 100%; height: 220px; position: relative; }
.pk-canvas { width: 100%; height: 220px; display: block; }
.pk-donut { width: 100%; height: 190px; display: block; }
.pk-gender-body { display: flex; flex-direction: column; gap: 4px; }
.pk-legend { display: flex; flex-direction: column; gap: 4px; padding: 0 3px; }
.pk-legend-row { display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 6px; font-size: 9.5px; color: #5f6b83; }
.pk-legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.pk-legend-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-legend-row strong { font-size: 9.5px; color: #344054; }
.pk-seg { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; justify-content: flex-end; }
.pk-seg-btn { border: 1px solid #e2e6f0; background: #fff; color: #6B7280; border-radius: 7px; font-size: 9px; font-weight: 700; padding: 4px 6px; cursor: pointer; }
.pk-seg-btn.active { background: #eef2ff; color: #3346c9; border-color: #cdd7ff; }
.pk-icon-btn { border: 1px solid #e2e6f0; background: #fff; color: #6B7280; width: 27px; height: 27px; border-radius: 7px; display: inline-grid; place-items: center; cursor: pointer; font-size: 11px; }
.pk-icon-btn:hover { color: #3346c9; border-color: #cdd7ff; }
.pk-unavailable { min-height: 220px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; color: #8a92a6; padding: 18px; border: 1px dashed #e1e5ef; border-radius: 10px; background: #fbfcff; }
.pk-unavailable-icon { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #eef2ff; color: #4960d8; font-size: 13px; }
.pk-unavailable p { margin: 0; font-size: 10.5px; line-height: 1.5; max-width: 260px; }
.pk-bars { display: flex; flex-direction: column; gap: 8px; max-height: 232px; overflow: auto; padding-right: 2px; }
.pk-bar-row { display: grid; grid-template-columns: 8px minmax(90px, 1.25fr) 1.3fr auto; align-items: center; gap: 7px; border: 0; background: transparent; padding: 3px 0; text-align: left; cursor: pointer; font: inherit; color: #344054; }
.pk-bar-dot { width: 8px; height: 8px; border-radius: 50%; }
.pk-bar-row:hover { background: #f7f9ff; }
.pk-bar-row.active { background: #eef2ff; border-radius: 5px; padding: 3px 4px; }
.pk-bar-label { font-size: 9.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pk-bar-track { height: 7px; background: #edf0f8; border-radius: 99px; overflow: hidden; }
.pk-bar-track span { display: block; height: 100%; background: var(--pk-purple); border-radius: 99px; }
.pk-bar-row strong { font-size: 9.5px; white-space: nowrap; color: #4d5a78; }
.pk-table-card { padding: 0; overflow: hidden; }
.pk-table-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 16px 12px; flex-wrap: wrap; }
.pk-table-head h3 { margin: 0; font-size: 13px; color: #111827; }
.pk-table-head p { margin: 3px 0 0; color: #8a92a6; font-size: 10.5px; }
.pk-table-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pk-search { min-width: 250px; max-width: 380px; }
.pk-table-wrap { overflow: auto; max-height: 540px; border-top: 1px solid #eef0f5; }
.pk-table { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; font-size: 10.5px; }
.pk-table th { position: sticky; top: 0; z-index: 2; background: #f1f4ff; color: #46558a; text-align: left; padding: 9px 10px; border-bottom: 1px solid #dfe5f7; white-space: nowrap; font-size: 9.5px; }
.pk-table td { padding: 8px 10px; border-bottom: 1px solid #f0f2f7; color: #344054; white-space: nowrap; }
.pk-table tbody tr:hover { background: #f8faff; }
.pk-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.pk-sort { border: 0; background: transparent; padding: 0; font: inherit; color: inherit; font-weight: 800; cursor: pointer; }
.pk-sort:hover { color: #3346c9; }
.pk-pagination-host { display: flex; justify-content: flex-end; padding: 10px 14px; }
.pk-pagination-host .pagination { margin: 0; }
.pk-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 160px; color: #8a92a6; gap: 8px; font-size: 11px; }
.pk-empty i { font-size: 22px; color: #c3c9d9; }
.pk-source-card { padding: 14px 16px; border-left: 3px solid #2EB67D; }
.pk-source-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.pk-source-head h3 { margin: 0; font-size: 13px; color: #111827; }
.pk-source-head p { margin: 3px 0 0; color: #8a92a6; font-size: 10.5px; }
.pk-source-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 10px 0; border-top: 1px solid #f0f2f7; border-bottom: 1px solid #f0f2f7; }
.pk-source-grid small { display: block; color: #8a92a6; font-size: 9.5px; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 3px; }
.pk-source-grid strong, .pk-source-grid a { color: #344054; font-size: 11px; font-weight: 700; text-decoration: none; }
.pk-source-grid a { color: #3346c9; }
.pk-source-missing { display: flex; gap: 7px; align-items: flex-start; color: #8a92a6; font-size: 10.5px; padding-top: 10px; }
.pk-source-missing i { color: #d97706; margin-top: 2px; }
.pk-auto-refresh { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 9px; }
.pk-auto-refresh label { color: #6B7280; font-size: 10.5px; font-weight: 700; }
.pk-auto-refresh .inp-select { max-width: 110px; }
.pk-source-warning { color: #b45309; font-size: 10px; }
.pk-warnings { margin-top: 9px; color: #8a92a6; font-size: 10px; }
.pk-warnings summary { cursor: pointer; color: #b45309; font-weight: 700; }
.pk-warnings ul { margin: 6px 0 0 18px; }
.pk-source-loading { display: flex; gap: 8px; align-items: center; color: #8a92a6; font-size: 11px; }
.pk-error-card { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 42px 18px; text-align: center; color: #6B7280; }
.pk-error-card > i { font-size: 28px; color: #d97706; }
.pk-error-card h3 { margin: 0; color: #111827; font-size: 14px; }
.pk-error-card p { margin: 0; font-size: 11px; max-width: 500px; }
.pk-export-menu { display: flex; flex-direction: column; gap: 8px; min-width: 280px; }
.pk-export-menu p { margin: 0 0 4px; color: #8a92a6; font-size: 11px; }
.pk-export-option { display: flex; align-items: center; gap: 10px; border: 1px solid #e5e8f1; background: #fff; border-radius: 9px; padding: 10px 12px; color: #344054; font: inherit; font-size: 11.5px; text-align: left; cursor: pointer; }
.pk-export-option:hover { background: #f7f9ff; border-color: #cdd7ff; color: #3346c9; }
.pk-export-option i { width: 18px; color: #4960d8; text-align: center; }
.pk-column-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 16px; max-height: 55vh; overflow: auto; }
.pk-column-item { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: #344054; }
.pk-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; }
.pk-detail-grid small { display: block; color: #8a92a6; font-size: 9.5px; text-transform: uppercase; letter-spacing: .04em; }
.pk-detail-grid strong { display: block; margin-top: 2px; color: #111827; font-size: 12px; font-weight: 600; overflow-wrap: anywhere; }
.pk-skeleton-card { background: linear-gradient(100deg, #f5f6fa 30%, #eceff7 50%, #f5f6fa 70%); background-size: 300% 100%; animation: pk-shimmer 1.4s infinite; border-color: #eef0f5; }
.pk-skeleton-chart { min-height: 286px; }
.pk-skeleton-lines { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.pk-skeleton-lines div { height: 14px; border-radius: 5px; background: linear-gradient(100deg, #f5f6fa 30%, #eceff7 50%, #f5f6fa 70%); background-size: 300% 100%; animation: pk-shimmer 1.4s infinite; }
@keyframes pk-shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@media (max-width: 1200px) {
  .pk-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pk-chart-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pk-filters { grid-template-columns: repeat(3, minmax(140px, 1fr)); }
}
@media (max-width: 820px) {
  .pk-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pk-chart-grid { grid-template-columns: 1fr; }
  .pk-filters { grid-template-columns: repeat(2, minmax(130px, 1fr)); }
  .pk-source-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pk-search { min-width: 180px; flex: 1; }
}
@media (max-width: 560px) {
  .pk-hero { padding: 14px; }
  .pk-hero-main { gap: 10px; }
  .pk-hero h2 { font-size: 1.1rem; }
  .pk-hero-actions { width: 100%; }
  .pk-kpis { grid-template-columns: 1fr; }
  .pk-kpi { min-height: 100px; }
  .pk-filters { grid-template-columns: 1fr; }
  .pk-custom-dates { flex-direction: column; align-items: stretch; }
  .pk-source-grid { grid-template-columns: 1fr; }
  .pk-table-head { flex-direction: column; }
  .pk-table-tools { width: 100%; }
  .pk-search { width: 100%; max-width: none; }
  .pk-column-list, .pk-detail-grid { grid-template-columns: 1fr; }
}
.pk-package-list { display: flex; flex-direction: column; gap: 4px; max-height: 232px; overflow: auto; padding-right: 2px; }
.pk-package-row { display: grid; grid-template-columns: 23px minmax(0, 1fr) auto; align-items: center; gap: 7px; width: 100%; border: 1px solid transparent; background: transparent; border-radius: 7px; padding: 5px 5px; text-align: left; color: #344054; font: inherit; cursor: pointer; }
.pk-package-row:hover { background: #f7f9ff; border-color: #e6eaff; }
.pk-package-row.active { background: #eef2ff; border-color: #cdd7ff; }
.pk-package-rank { width: 21px; height: 21px; border-radius: 6px; display: grid; place-items: center; background: #f0f2f8; color: #6B7280; font-size: 9px; font-weight: 800; }
.pk-package-row.top .pk-package-rank { background: #fff4df; color: #a16207; }
.pk-package-row:nth-child(1) .pk-package-rank { background: #e8ecff; color: #3346c9; }
.pk-package-main { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pk-package-name { font-size: 9.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pk-package-meta { font-size: 8.5px; color: #8a92a6; white-space: nowrap; }
.pk-package-value { font-size: 9px; color: #4d5a78; white-space: nowrap; }
.pk-compare-body { display: flex; flex-direction: column; gap: 5px; }
.pk-compare-controls { display: flex; flex-direction: column; gap: 5px; }
.pk-compare-tools { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.pk-mini { border: 1px solid #e2e6f0; background: #fff; color: #6B7280; border-radius: 6px; padding: 4px 7px; font: inherit; font-size: 9px; font-weight: 800; cursor: pointer; }
.pk-mini.active { background: #e8f7f0; border-color: #b7e8d3; color: #15803d; }
.pk-mini:hover { border-color: #cdd7ff; color: #3346c9; }
.pk-compare-wrap { height: 170px; }
.pk-compare-canvas { height: 170px; }
.pk-compare-legend { display: flex; flex-wrap: wrap; gap: 4px 9px; max-height: 42px; overflow: auto; padding: 0 2px; }
.pk-compare-legend-item { display: inline-flex; align-items: center; gap: 4px; min-width: 0; max-width: 48%; font-size: 8.5px; color: #6B7280; }
.pk-compare-legend-item > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-legend-dash { width: 16px; height: 0; border-top: 2px dashed #0f766e; flex: none; }
.pk-compare-amount { margin-left: 1px; color: #3346c9; font-size: 8px; white-space: nowrap; }
.pk-chart-card.pk-wide { grid-column: span 2; }
.pk-chart-card.pk-wide .pk-gender-body { flex-direction: row; align-items: center; gap: 16px; }
.pk-chart-card.pk-wide .pk-canvas-wrap { flex: 0 0 240px; width: 240px; }
.pk-chart-card.pk-wide .pk-legend { flex: 1; min-width: 0; }
.pk-performance { display: flex; flex-direction: column; }
.pk-compare-full { min-height: 0; }
.pk-compare-full .pk-card-body { padding-bottom: 12px; }
.pk-compare-full .pk-compare-wrap, .pk-compare-full .pk-compare-canvas { height: 300px; }
.pk-compare-full .pk-compare-controls { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin: 4px 0 2px; }
.pk-compare-full .pk-compare-tools { justify-content: flex-end; }
.pk-compare-full .pk-compare-legend { max-height: none; margin: 4px 0 8px; }
.pk-compare-table-wrap { width: 100%; overflow: auto; max-height: 250px; border: 1px solid #e7eaf2; border-radius: 8px; background: #fff; }
.pk-compare-table { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; font-size: 9.5px; }
.pk-compare-table th { position: sticky; top: 0; z-index: 2; background: #f1f4ff; color: #46558a; padding: 6px 8px; text-align: left; border-bottom: 1px solid #dfe5f7; white-space: nowrap; font-size: 9px; }
.pk-compare-table th.num, .pk-compare-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.pk-compare-table td { padding: 5px 8px; border-bottom: 1px solid #f0f2f7; color: #344054; white-space: nowrap; }
.pk-compare-table tbody tr:hover { background: #f8faff; }
.pk-compare-table-name { position: sticky; left: 0; z-index: 1; background: #fff; max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-compare-table tbody tr:hover .pk-compare-table-name { background: #f8faff; }
.pk-compare-total { font-weight: 800; color: #3346c9; }
@media (max-width: 820px) {
  .pk-chart-card.pk-wide { grid-column: span 1; }
  .pk-chart-card.pk-wide .pk-gender-body { flex-direction: column; align-items: stretch; }
  .pk-chart-card.pk-wide .pk-canvas-wrap { flex-basis: auto; width: 100%; }
  .pk-compare-full .pk-compare-wrap, .pk-compare-full .pk-compare-canvas { height: 230px; }
}
.pk-compare-selection { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin: 3px 0 4px; }
.pk-compare-select { max-width: 290px; min-width: 190px; font-size: 10px; padding: 5px 8px; }
.pk-count-badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px; border-radius: 999px; background: #eef2ff; border: 1px solid #dce3ff; color: #3346c9; font-size: 9.5px; font-weight: 800; white-space: nowrap; }
.pk-selected-packages { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; flex: 1; min-width: 0; }
.pk-selected-packages .pk-chip { max-width: 230px; }
.pk-chip-name { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 820px) {
  .pk-compare-select { max-width: none; width: 100%; min-width: 0; }
  .pk-selected-packages { flex-basis: 100%; }
  .pk-selected-packages .pk-chip { max-width: 100%; }
  .pk-chip-name { max-width: 140px; }
}
.pk-compare-dates { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.pk-compare-dates-label { font-size: 9px; font-weight: 800; color: #6B7280; text-transform: uppercase; letter-spacing: .04em; }
.pk-compare-date { width: 128px; min-width: 0; font-size: 9.5px; padding: 5px 6px; }
.pk-compare-dates-sep { color: #9aa3b5; font-size: 10px; }
.pk-compare-range { color: #8a92a6; font-size: 9px; white-space: nowrap; }
.pk-legend-dash.previous { border-color: #0f766e; border-top-style: dashed; }
.pk-compare-count-row th, .pk-compare-count-row td { background: #f8fafc; font-weight: 700; color: #3346c9; }
.pk-compare-prev-row th, .pk-compare-prev-row td { background: #fffdf6; color: #8a5a00; }
@media (max-width: 820px) {
  .pk-compare-date { width: 118px; }
  .pk-compare-range { flex-basis: 100%; }
}
.nav-section-label { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 0; }
.nav-section-sub { font-size: 0.56rem; font-weight: 500; letter-spacing: 0.01em; text-transform: none; color: var(--gray-400); line-height: 1.15; }
.nav-group.open .nav-section-sub { color: var(--purple-400); }
.st-perfect-row td { background: #f0fdf4; }
.st-perfect-row:hover td { background: #e8fbef; }
.st-perfect-row td:first-child { box-shadow: inset 3px 0 0 #16a34a; }
.st-perfect-badge { display: inline-flex; align-items: center; gap: 4px; color: #15803d; background: #dcfce7; border: 1px solid #bbf7d0; border-radius: 999px; padding: 3px 8px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.st-perfect-hint { color: #6b7280; font-size: 10.5px; margin: -2px 0 9px; display: flex; align-items: center; gap: 5px; }
.st-perfect-hint i { color: #16a34a; }
.st-problem { color: #b91c1c; font-weight: 800; }
.st-muted { color: #9aa3b5; }
.st-metric { display: flex; align-items: baseline; justify-content: flex-end; gap: 4px; white-space: nowrap; }
.st-metric strong { font-size: 12px; }
.st-metric small { font-size: 9px; color: #8a92a6; font-weight: 600; }
.st-metric.st-problem strong { color: #b91c1c; }
.st-clocked-total { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
.st-clocked-total strong { font-size: 11px; color: #344054; }
.st-clocked-total small { font-size: 8.5px; color: #8a92a6; font-weight: 600; }

/* X-ray Report */
.xr-page { --pk-blue:#1d4ed8; --pk-green:#0d9488; --pk-purple:#7c3aed; --pk-orange:#f59e0b; --pk-teal:#0891b2; --pk-pink:#ec4899; }
.xr-hero { background: linear-gradient(120deg,#ffffff 0%,#eef6ff 50%,#eefbf9 100%); border-color:#dbe7fb; }
.xr-hero-icon { background:#e0f2fe; color:#0369a1; }
.xr-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.xr-main-card .xr-main-chart, .xr-main-card .xr-main-canvas { height: 300px; }
.xr-main-card .pk-compare-controls { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin: 2px 0 3px; }
.xr-main-card .pk-compare-tools { justify-content: flex-end; }
.xr-main-card .pk-compare-legend { max-height: none; margin: 3px 0 8px; }
.xr-main-table { max-height: 270px; }
.xr-breakdowns .pk-chart-card { min-height: 300px; }
.xr-modality-badge { display: inline-flex; align-items: center; padding: 3px 7px; border-radius: 999px; background: color-mix(in srgb, var(--c) 12%, white); color: var(--c); border: 1px solid color-mix(in srgb, var(--c) 25%, white); font-size: 9px; font-weight: 800; }
.xr-table { min-width: 1500px; }
.xr-filters { grid-template-columns: repeat(3, minmax(145px, 1fr)); }
@media (max-width: 1200px) {
  .xr-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .xr-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .xr-filters { grid-template-columns: repeat(2, minmax(130px, 1fr)); }
  .xr-main-card .xr-main-chart, .xr-main-card .xr-main-canvas { height: 230px; }
}
@media (max-width: 560px) {
  .xr-kpis { grid-template-columns: 1fr; }
  .xr-filters { grid-template-columns: 1fr; }
}
.xr-modality-tabs { display: flex; justify-content: flex-start; flex-wrap: wrap; gap: 5px; margin: 4px 0 5px; }
.xr-modality-tab { font-size: 10px; padding: 5px 9px; border-radius: 8px; }
.xr-modality-tab.active { font-weight: 800; }
.xr-year-compare { display: flex; flex-direction: column; }
.xr-year-card .xr-year-controls { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 2px 0 8px; }
.xr-year-fields { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.xr-year-fields label { display: flex; flex-direction: column; gap: 4px; font-size: 9px; font-weight: 800; color: #6B7280; text-transform: uppercase; letter-spacing: .04em; }
.xr-year-fields .inp-select { min-width: 120px; font-size: 10px; padding: 6px 8px; }
.xr-year-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; margin-bottom: 8px; }
.xr-year-stat { border: 1px solid #e7eaf2; border-radius: 8px; padding: 7px 9px; background: #fbfcff; }
.xr-year-stat small { display: block; color: #8a92a6; font-size: 8.5px; text-transform: uppercase; letter-spacing: .04em; }
.xr-year-stat strong { display: block; margin-top: 2px; font-size: 14px; color: #1f2937; }
.xr-year-stat.up strong { color: #0d9488; }
.xr-year-stat.down strong { color: #dc2626; }
.xr-year-canvas-wrap, .xr-year-canvas { height: 280px; }
.xr-year-table-wrap { max-height: 300px; }
.xr-year-table { min-width: 480px; }
.xr-growth.up { color: #0d9488 !important; font-weight: 800; }
.xr-growth.down { color: #dc2626 !important; font-weight: 800; }
.xr-growth.muted { color: #9aa3b5 !important; }
@media (max-width: 820px) {
  .xr-year-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .xr-year-controls { align-items: stretch; }
  .xr-year-fields { flex: 1; }
  .xr-year-fields label { flex: 1; }
  .xr-year-fields .inp-select { width: 100%; min-width: 0; }
  .xr-year-canvas-wrap, .xr-year-canvas { height: 230px; }
}
.xr-year-table { min-width: 980px; }
.xr-year-row-base th, .xr-year-row-comp th { color: #1f2937; }
.xr-year-row-growth th { color: #0d9488; }
.xr-year-row-growth td { background: #fbfefd; }
.pk-compare-tools .xr-modality-tabs { margin: 0; gap: 3px; }
.pk-compare-tools .xr-modality-tab { padding: 4px 7px; font-size: 9.5px; }
.xr-year-mode-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.xr-year-mode-tools .xr-modality-tabs { margin: 0; gap: 3px; }
.xr-year-mode-tools .xr-modality-tab { padding: 4px 7px; font-size: 9.5px; }
@media (max-width: 820px) {
  .xr-year-mode-tools { width: 100%; }
}

/* =========================================================
   Maxicare Referral & EMS Coordination
   ========================================================= */
.mr-page { --mr-navy:#10243A; --mr-teal:#0F766E; --mr-gold:#F59E0B; --mr-blue:#2563eb; --mr-red:#dc2626; --mr-line:#e3e9ef; display:flex; flex-direction:column; gap:12px; }
.mr-hero { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; flex-wrap:wrap; padding:18px 20px; border-radius:18px; color:#fff; background:linear-gradient(125deg,#10243A 0%,#153b56 58%,#0F766E 130%); box-shadow:0 14px 34px rgba(16,36,58,.22); position:relative; overflow:hidden; }
.mr-hero::after { content:''; position:absolute; right:-52px; top:-80px; width:240px; height:240px; border-radius:50%; background:radial-gradient(circle,rgba(245,158,11,.22),rgba(245,158,11,0) 68%); }
.mr-hero-main { display:flex; gap:14px; align-items:flex-start; position:relative; z-index:1; }
.mr-hero-icon { width:48px; height:48px; border-radius:14px; background:rgba(255,255,255,.12); border:1px solid rgba(255,255,255,.2); display:grid; place-items:center; font-size:20px; color:#fbbf24; flex:none; }
.mr-eyebrow { font-size:9.5px; text-transform:uppercase; letter-spacing:.13em; font-weight:800; color:#93c5fd; margin-bottom:3px; }
.mr-hero h2 { margin:0; font-size:1.4rem; color:#fff; }
.mr-hero p { margin:4px 0 0; color:#cbd5e1; font-size:11.5px; max-width:650px; }
.mr-hero-actions { display:flex; gap:7px; align-items:center; position:relative; z-index:1; }
.mr-btn { display:inline-flex; align-items:center; gap:6px; border:1px solid transparent; border-radius:8px; padding:8px 12px; font:inherit; font-size:11.5px; font-weight:800; cursor:pointer; white-space:nowrap; text-decoration:none; transition:all 150ms; }
.mr-btn:disabled { opacity:.55; cursor:wait; }
.mr-btn-primary { background:var(--mr-teal); color:#fff; }
.mr-btn-primary:hover { background:#0b5f59; }
.mr-btn-outline { background:#fff; border-color:#d8e1e9; color:#334155; }
.mr-hero .mr-btn-outline { background:rgba(255,255,255,.1); border-color:rgba(255,255,255,.22); color:#fff; }
.mr-btn-outline:hover { border-color:#a7c9c6; color:var(--mr-teal); }
.mr-hero .mr-btn-outline:hover { background:rgba(255,255,255,.18); color:#fff; }
.mr-btn-sm { padding:6px 9px; font-size:10.5px; }
.mr-link { border:0; background:transparent; color:var(--mr-teal); font:inherit; font-size:10.5px; font-weight:800; cursor:pointer; text-decoration:none; }
.mr-tabs { display:flex; gap:3px; overflow-x:auto; background:#fff; border:1px solid var(--mr-line); border-radius:12px; padding:4px; box-shadow:0 3px 12px rgba(16,36,58,.04); }
.mr-tab { border:0; background:transparent; color:#64748b; font:inherit; font-size:10.5px; font-weight:800; padding:8px 11px; border-radius:8px; white-space:nowrap; cursor:pointer; }
.mr-tab:hover { background:#f1f5f9; color:#334155; }
.mr-tab.active { background:var(--mr-navy); color:#fff; }
.mr-quick-actions { display:flex; gap:7px; flex-wrap:wrap; }
.mr-quick { border:1px solid #dfe7ee; background:#fff; color:#334155; border-radius:8px; padding:7px 10px; font:inherit; font-size:10.5px; font-weight:700; display:inline-flex; align-items:center; gap:6px; cursor:pointer; }
.mr-quick i { color:var(--mr-teal); }
.mr-quick:hover { border-color:#9fd0cb; background:#f0fdfa; }
.mr-content { display:flex; flex-direction:column; gap:12px; }
.mr-kpis { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:9px; }
.mr-kpi { display:flex; align-items:flex-start; gap:9px; text-align:left; border:1px solid #e4eaf0; border-top:3px solid var(--mr-accent); background:#fff; border-radius:12px; padding:12px 13px; min-height:88px; font:inherit; cursor:pointer; box-shadow:0 4px 14px rgba(16,36,58,.04); }
.mr-kpi:hover { box-shadow:0 8px 20px rgba(16,36,58,.08); transform:translateY(-1px); }
.mr-kpi-icon { width:30px; height:30px; border-radius:9px; display:grid; place-items:center; font-size:12px; flex:none; }
.mr-kpi span { display:block; color:#64748b; font-size:9.5px; font-weight:700; }
.mr-kpi strong { display:block; color:var(--mr-navy); font-size:1.2rem; line-height:1.15; margin-top:2px; }
.mr-kpi small { display:block; color:#94a3b8; font-size:8.5px; margin-top:2px; }
.mr-overview-grid { display:grid; grid-template-columns:1.25fr .75fr; gap:12px; align-items:stretch; }
.mr-card { background:#fff; border:1px solid #e4eaf0; border-radius:13px; padding:13px 14px; box-shadow:0 4px 16px rgba(16,36,58,.04); min-width:0; }
.mr-card-head { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; flex-wrap:wrap; margin-bottom:8px; }
.mr-card-head h3 { margin:0; color:var(--mr-navy); font-size:12px; }
.mr-card-head p { margin:3px 0 0; color:#94a3b8; font-size:9.5px; }
.mr-map-card { display:flex; flex-direction:column; }
.mr-map { width:100%; height:320px; border-radius:10px; overflow:hidden; background:#eef4f7; border:1px solid #e2e8f0; }
.mr-map-page-card { padding:9px; }
.mr-map-page-card .mr-map { height:62vh; min-height:420px; }
.mr-map-fallback { height:100%; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:7px; color:#64748b; font-size:11px; text-align:center; }
.mr-map-fallback i { font-size:25px; color:#94a3b8; }
.mr-map-fallback a { color:var(--mr-teal); font-weight:800; }
.mr-destination-row { display:flex; align-items:center; gap:10px; flex-wrap:wrap; padding:10px; border:1px solid #e7edf2; border-radius:10px; background:#f8fbfb; }
.mr-destination-icon { width:34px; height:34px; border-radius:9px; background:#e6f4f1; color:var(--mr-teal); display:grid; place-items:center; }
.mr-destination-row strong { display:block; color:var(--mr-navy); font-size:11.5px; }
.mr-destination-row small { display:block; color:#94a3b8; font-size:9px; margin-top:1px; }
.mr-destination-actions { margin-left:auto; display:flex; gap:6px; flex-wrap:wrap; }
.mr-section-head { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; flex-wrap:wrap; }
.mr-section-head h3 { margin:0; color:var(--mr-navy); font-size:14px; }
.mr-section-head p { margin:3px 0 0; color:#94a3b8; font-size:10px; }
.mr-filterbar { display:flex; align-items:center; gap:7px; flex-wrap:wrap; background:#fff; border:1px solid #e4eaf0; border-radius:10px; padding:9px 10px; }
.mr-input, .mr-select { border:1px solid #d9e2ea; border-radius:7px; padding:7px 9px; background:#fff; color:#334155; font:inherit; font-size:10.5px; outline:none; }
.mr-input:focus, .mr-select:focus { border-color:var(--mr-teal); box-shadow:0 0 0 3px rgba(15,118,110,.1); }
.mr-filterbar .mr-input { min-width:230px; }
.mr-case-host { display:flex; flex-direction:column; gap:8px; }
.mr-table-wrap { width:100%; overflow:auto; max-height:520px; border:1px solid #e7edf2; border-radius:9px; }
.mr-table { width:100%; min-width:850px; border-collapse:separate; border-spacing:0; font-size:10px; }
.mr-table th { position:sticky; top:0; z-index:1; background:#f5f8fa; color:#64748b; text-align:left; padding:8px; font-size:9px; border-bottom:1px solid #e4eaf0; white-space:nowrap; }
.mr-table td { padding:8px; border-bottom:1px solid #f0f3f6; color:#334155; vertical-align:middle; }
.mr-table tbody tr:hover { background:#f8fcfb; }
.mr-case-link { border:0; background:transparent; padding:0; color:var(--mr-teal); font:inherit; font-size:10px; font-weight:800; cursor:pointer; }
.mr-table-name { font-weight:700; color:var(--mr-navy); }
.mr-status { display:inline-flex; padding:3px 7px; border-radius:999px; font-size:8.5px; font-weight:800; white-space:nowrap; background:#eef2f6; color:#64748b; }
.mr-status.ok { background:#dcfce7; color:#15803d; }
.mr-status.warn { background:#fef3c7; color:#a16207; }
.mr-status.blue { background:#dbeafe; color:#1d4ed8; }
.mr-status.muted { background:#f1f5f9; color:#64748b; }
.mr-status.info { background:#e0f2fe; color:#0369a1; }
.mr-priority { display:inline-flex; padding:3px 7px; border-radius:999px; font-size:8.5px; font-weight:800; background:#f1f5f9; color:#64748b; }
.mr-priority.high { background:#ffedd5; color:#c2410c; }
.mr-priority.critical { background:#fee2e2; color:#b91c1c; }
.mr-icon-btn { border:1px solid #e2e8f0; background:#fff; color:#64748b; border-radius:6px; width:25px; height:25px; display:inline-grid; place-items:center; cursor:pointer; font-size:9px; }
.mr-icon-btn:hover { color:var(--mr-teal); border-color:#a7d5d0; }
.mr-empty { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; padding:35px 15px; color:#94a3b8; text-align:center; font-size:10.5px; }
.mr-empty i { font-size:24px; }
.mr-loading { display:flex; align-items:center; justify-content:center; gap:7px; padding:35px; color:#64748b; font-size:11px; }
.mr-error { padding:20px; color:#b91c1c; background:#fef2f2; border:1px solid #fecaca; border-radius:8px; font-size:11px; }
.mr-pagination { display:flex; align-items:center; justify-content:flex-end; gap:7px; color:#64748b; font-size:10px; }
.mr-detail { display:flex; flex-direction:column; gap:12px; }
.mr-detail-head { display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap; padding-bottom:9px; border-bottom:1px solid #eef2f6; }
.mr-case-no { color:var(--mr-teal); font-size:10px; font-weight:800; letter-spacing:.06em; }
.mr-detail-head h3 { margin:3px 0; color:var(--mr-navy); font-size:1.2rem; }
.mr-detail-head p { margin:0; color:#94a3b8; font-size:10px; }
.mr-detail-badges { display:flex; gap:5px; align-items:flex-start; }
.mr-detail-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:9px 14px; }
.mr-detail-grid small { display:block; color:#94a3b8; font-size:8.5px; text-transform:uppercase; letter-spacing:.04em; }
.mr-detail-grid strong { display:block; color:#334155; font-size:10.5px; margin-top:2px; overflow-wrap:anywhere; }
.mr-detail-note { padding:9px 10px; background:#f8fafc; border:1px solid #eef2f6; border-radius:8px; }
.mr-detail-note h4 { margin:0 0 4px; color:var(--mr-navy); font-size:10px; }
.mr-detail-note p { margin:0; color:#475569; font-size:10.5px; white-space:pre-wrap; }
.mr-timeline { border-top:1px solid #eef2f6; padding-top:10px; }
.mr-timeline h4 { margin:0 0 7px; color:var(--mr-navy); font-size:10.5px; }
.mr-event { display:flex; gap:7px; padding:5px 0; }
.mr-event-dot { width:7px; height:7px; border-radius:50%; background:var(--mr-teal); margin-top:5px; flex:none; }
.mr-event strong { display:block; color:#334155; font-size:10px; }
.mr-event small { display:block; color:#94a3b8; font-size:8.5px; }
.mr-event p { margin:2px 0 0; color:#64748b; font-size:9.5px; }
.mr-form { display:flex; flex-direction:column; gap:13px; }
.mr-form-section { border:1px solid #e9eef3; border-radius:9px; padding:10px; }
.mr-form-section h4 { margin:0 0 8px; color:var(--mr-navy); font-size:10.5px; }
.mr-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.mr-field { display:flex; flex-direction:column; gap:4px; min-width:0; }
.mr-field.full { grid-column:1/-1; }
.mr-field label { font-size:8.5px; font-weight:800; color:#64748b; text-transform:uppercase; letter-spacing:.04em; }
.mr-field .mr-input, .mr-field .mr-select { width:100%; }
.mr-form-section > .mr-field { margin-top:8px; }
.mr-field textarea.mr-input { min-height:62px; resize:vertical; }
.mr-check { display:flex; align-items:center; gap:6px; font-size:10px; color:#475569; }
.mr-report-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.mr-report-card h3 { margin:0 0 7px; color:var(--mr-navy); font-size:11px; }
.mr-report-bar { display:flex; justify-content:space-between; gap:10px; padding:5px 0; border-bottom:1px solid #f0f3f6; color:#64748b; font-size:10px; }
.mr-report-bar strong { color:var(--mr-navy); }
.mr-report-host { display:flex; flex-direction:column; gap:9px; }
.leaflet-container { font-family:inherit; }
@media (max-width: 1100px) { .mr-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); } .mr-overview-grid { grid-template-columns:1fr; } }
@media (max-width: 700px) {
  .mr-hero { padding:14px; }
  .mr-hero h2 { font-size:1.15rem; }
  .mr-kpis { grid-template-columns:1fr; }
  .mr-detail-grid, .mr-form-grid, .mr-report-grid { grid-template-columns:1fr; }
  .mr-tabs { border-radius:10px; }
  .mr-filterbar .mr-input { min-width:0; flex:1; }
  .mr-map { height:260px; }
}
.mr-tracking { border:1px solid #e4eaf0; background:#f8fbfc; border-radius:10px; padding:10px 11px; }
.mr-tracking-head { display:flex; justify-content:space-between; gap:8px; align-items:flex-start; }
.mr-tracking-head h4 { margin:0; color:var(--mr-navy); font-size:10.5px; }
.mr-tracking-head p { margin:3px 0 0; color:#94a3b8; font-size:9px; }
.mr-tracking-meta { display:flex; gap:8px; flex-wrap:wrap; margin:7px 0; color:#64748b; font-size:8.5px; }
.mr-tracking-meta span { background:#fff; border:1px solid #e7edf2; padding:3px 6px; border-radius:999px; }
.mr-tracking-last { display:flex; align-items:center; justify-content:space-between; gap:8px; flex-wrap:wrap; background:#fff; border:1px solid #e7edf2; border-radius:8px; padding:8px; margin-top:5px; }
.mr-tracking-last small { display:block; color:#94a3b8; font-size:8.5px; text-transform:uppercase; letter-spacing:.04em; }
.mr-tracking-last strong { display:block; color:var(--mr-navy); font-size:11px; margin-top:2px; }
.mr-tracking-last span { display:block; color:#94a3b8; font-size:8.5px; margin-top:2px; }
.mr-tracking-actions { margin-top:7px; }
.mr-note { color:#94a3b8; font-size:9px; line-height:1.5; }
.mr-share-modal { display:flex; flex-direction:column; gap:9px; }
.mr-share-icon { width:40px; height:40px; border-radius:11px; display:grid; place-items:center; background:#e6f4f1; color:var(--mr-teal); font-size:17px; }
.mr-share-modal p { margin:0; color:#64748b; font-size:11px; line-height:1.5; }
.mr-share-link { display:flex; gap:6px; }
.mr-share-link .mr-input { flex:1; min-width:0; font-size:9px; }
.mr-share-actions { display:flex; gap:6px; flex-wrap:wrap; }
.mr-map-layout { display:grid; grid-template-columns:1.55fr .75fr; gap:11px; align-items:stretch; }
.mr-map-share-list { display:flex; flex-direction:column; min-width:0; }
.mr-map-case-list { display:flex; flex-direction:column; gap:6px; overflow:auto; max-height:58vh; }
.mr-map-case { display:flex; align-items:center; justify-content:space-between; gap:8px; border:1px solid #e9eef3; border-radius:8px; padding:8px 9px; background:#fbfdfd; }
.mr-map-case strong { display:block; color:var(--mr-navy); font-size:10px; }
.mr-map-case small { display:block; color:#94a3b8; font-size:8.5px; margin-top:2px; }
@media (max-width: 900px) { .mr-map-layout { grid-template-columns:1fr; } .mr-map-case-list { max-height:none; } .mr-map-page-card .mr-map { min-height:320px; height:320px; } }
.mr-map-page-card:fullscreen { padding:0; border:0; border-radius:0; background:#0f172a; }
.mr-map-page-card:fullscreen .mr-map { height:100vh; border:0; border-radius:0; }
.mr-map-page-card.mr-map-expanded { position:fixed; inset:0; z-index:9999; padding:0; border:0; border-radius:0; background:#0f172a; }
.mr-map-page-card.mr-map-expanded .mr-map { height:100vh; border:0; border-radius:0; }
body.mr-map-lock { overflow:hidden; }
:root {
  --mr-navy: #10243A;
  --mr-teal: #0F766E;
  --mr-gold: #F59E0B;
  --mr-blue: #2563eb;
  --mr-red: #dc2626;
  --mr-line: #e3ebef;
}
/* Keep all dialogs above Leaflet map panes, markers and controls. */
.modal-overlay { z-index: 1200; }
.mr-flow { display:flex; align-items:stretch; gap:3px; flex-wrap:wrap; background:#fff; border:1px solid #e4eaf0; border-radius:12px; padding:9px; }
.mr-flow-stage { display:grid; grid-template-columns:24px auto; grid-template-rows:auto auto; gap:1px 7px; align-items:center; border:1px solid #e7edf2; border-left:3px solid var(--stage); background:#fbfdfd; border-radius:8px; padding:7px 9px; font:inherit; text-align:left; cursor:pointer; min-width:112px; }
.mr-flow-stage:hover, .mr-flow-stage.active { background:#f0fdfa; border-color:color-mix(in srgb, var(--stage) 35%, white); }
.mr-flow-stage .mr-flow-icon { grid-row:1 / 3; width:24px; height:24px; display:grid; place-items:center; border-radius:7px; background:color-mix(in srgb, var(--stage) 12%, white); color:var(--stage); font-size:10px; }
.mr-flow-stage strong { color:var(--mr-navy); font-size:14px; line-height:1; }
.mr-flow-stage small { color:#64748b; font-size:8.5px; font-weight:700; white-space:nowrap; }
.mr-flow-stage.cancelled { border-style:dashed; }
.mr-flow-arrow { display:flex; align-items:center; color:#b6c2cc; font-size:9px; padding:0 1px; }
.mr-flow-arrow.cancelled-arrow { color:#f87171; }
.mr-pro-kpis { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:7px; }
.mr-pro-kpi { border:1px solid #e7edf2; border-radius:9px; padding:8px 10px; background:#fff; }
.mr-pro-kpi small { display:block; color:#94a3b8; font-size:8.5px; text-transform:uppercase; letter-spacing:.04em; }
.mr-pro-kpi strong { display:block; color:var(--mr-navy); font-size:15px; margin-top:2px; }
.mr-pro-kpi.danger strong { color:#b91c1c; }
.mr-pro-card { padding:11px 13px; }
.mr-stage-chip { display:inline-flex; padding:3px 7px; border-radius:999px; color:var(--stage); background:color-mix(in srgb, var(--stage) 11%, white); border:1px solid color-mix(in srgb, var(--stage) 24%, white); font-size:8.5px; font-weight:800; white-space:nowrap; }
@media (max-width: 900px) { .mr-flow-stage { min-width:96px; } .mr-pro-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width: 560px) { .mr-flow { display:grid; grid-template-columns:1fr 1fr; } .mr-flow-arrow { display:none; } .mr-flow-stage { min-width:0; } }
.mr-stage-filters { display:flex; align-items:stretch; gap:4px; flex-wrap:wrap; }
.mr-stage-filter { display:flex; flex-direction:column; align-items:center; gap:1px; border:1px solid #e3e9ef; background:#fbfdfd; border-radius:7px; min-width:58px; padding:4px 5px; cursor:pointer; font:inherit; color:#64748b; }
.mr-stage-filter:hover { border-color:#a9d5cf; background:#f2fbf9; }
.mr-stage-filter.active { border-color:var(--stage); background:color-mix(in srgb,var(--stage) 9%,white); color:var(--stage); box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--stage) 30%,white); }
.mr-stage-count { font-size:10px; font-weight:800; color:var(--stage); line-height:1; }
.mr-stage-icon { width:19px; height:19px; display:grid; place-items:center; border-radius:5px; background:color-mix(in srgb,var(--stage) 12%,white); color:var(--stage); font-size:8.5px; }
.mr-stage-label { font-size:7.5px; font-weight:700; white-space:nowrap; }
.mr-stage-filter.cancelled { border-color:#fecaca; color:#b91c1c; background:#fff7f7; }
.mr-stage-filter.cancelled .mr-stage-icon { background:#fee2e2; color:#b91c1c; }
.mr-mini-progress { display:flex; align-items:center; gap:2px; }
.mr-mini-step { width:17px; height:17px; border-radius:50%; display:grid; place-items:center; background:#f1f5f9; color:#b0bac6; font-size:7px; border:1px solid #e2e8f0; }
.mr-mini-step.done { background:color-mix(in srgb,var(--stage) 18%,white); color:var(--stage); border-color:color-mix(in srgb,var(--stage) 30%,white); }
.mr-mini-step.active { background:var(--stage); color:#fff; border-color:var(--stage); box-shadow:0 0 0 2px color-mix(in srgb,var(--stage) 18%,white); }
.mr-stage-cancelled { display:inline-flex; align-items:center; gap:4px; color:#b91c1c; background:#fff1f1; border:1px solid #fecaca; border-radius:999px; padding:3px 6px; font-size:8px; font-weight:800; }
.mr-case-progress { display:flex; align-items:center; gap:3px; flex-wrap:wrap; padding:8px 9px; background:#f8fbfb; border:1px solid #e7edf2; border-radius:9px; }
.mr-progress-step { display:flex; align-items:center; gap:4px; padding:4px 6px; border-radius:6px; color:#94a3b8; }
.mr-progress-step .mr-progress-icon { width:21px; height:21px; display:grid; place-items:center; border-radius:6px; background:#eef3f6; color:#9aa7b3; font-size:8px; }
.mr-progress-step small { font-size:8px; font-weight:700; white-space:nowrap; }
.mr-progress-step.done { color:var(--stage); background:color-mix(in srgb,var(--stage) 7%,white); }
.mr-progress-step.done .mr-progress-icon { background:color-mix(in srgb,var(--stage) 15%,white); color:var(--stage); }
.mr-progress-step.active { color:var(--stage); background:color-mix(in srgb,var(--stage) 11%,white); box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--stage) 30%,white); }
.mr-progress-step.active .mr-progress-icon { background:var(--stage); color:#fff; }
.mr-progress-step.cancelled { border:1px dashed #fca5a5; }
.mr-progress-step.cancelled.active { background:#fff1f1; color:#b91c1c; }
.mr-progress-step.cancelled.active .mr-progress-icon { background:#b91c1c; color:#fff; }
.mr-progress-arrow { color:#cbd5e1; font-size:8px; }
.mr-progress-arrow.cancelled-arrow { color:#f87171; }
@media (max-width:700px) { .mr-stage-filter { min-width:50px; } .mr-stage-label { font-size:7px; } .mr-case-progress small { display:none; } }
.mr-patient-line { display:flex; align-items:center; justify-content:space-between; gap:7px; min-width:220px; }
.mr-next-step { display:inline-flex; align-items:center; gap:4px; border:1px solid color-mix(in srgb,var(--stage) 28%,white); background:color-mix(in srgb,var(--stage) 10%,white); color:var(--stage); border-radius:6px; padding:4px 6px; font:inherit; font-size:7.5px; font-weight:800; cursor:pointer; white-space:nowrap; }
.mr-next-step:hover { background:var(--stage); color:#fff; }
.mr-next-special { display:inline-flex; align-items:center; gap:4px; border-radius:999px; padding:3px 7px; font-size:8px; font-weight:800; white-space:nowrap; }
.mr-next-special.cancelled { color:#b91c1c; background:#fff1f1; border:1px solid #fecaca; }
.mr-next-special.done { color:#15803d; background:#f0fdf4; border:1px solid #bbf7d0; }
@media (max-width:700px) { .mr-patient-line { min-width:0; } }
.mr-btn-danger { background:#b91c1c; color:#fff; border-color:#b91c1c; }
.mr-btn-danger:hover { background:#991b1b; }
.mr-cancel-btn { display:inline-flex; align-items:center; gap:4px; border:1px solid #fecaca; background:#fff7f7; color:#b91c1c; border-radius:6px; padding:4px 6px; font:inherit; font-size:8px; font-weight:800; cursor:pointer; white-space:nowrap; }
.mr-cancel-btn:hover { background:#fee2e2; border-color:#fca5a5; }
.mr-muted { color:#9aa3b5; }
.mr-btn-back { background:#fff7ed; color:#b45309; border-color:#fed7aa; }
.mr-btn-back:hover { background:#ffedd5; border-color:#fdba74; }
.mr-back-btn { display:inline-flex; align-items:center; gap:3px; border:1px solid #fed7aa; background:#fff7ed; color:#b45309; border-radius:6px; padding:4px 6px; font:inherit; font-size:8px; font-weight:800; cursor:pointer; white-space:nowrap; }
.mr-back-btn:hover { background:#ffedd5; }
.mr-row-actions { display:flex; align-items:center; gap:4px; }
.mr-table-action { display:inline-flex; align-items:center; gap:3px; border:1px solid #e2e8f0; background:#fff; color:#475569; border-radius:6px; padding:4px 6px; font:inherit; font-size:8px; font-weight:800; cursor:pointer; white-space:nowrap; }
.mr-table-action.edit:hover { color:#1d4ed8; border-color:#bfdbfe; background:#eff6ff; }
.mr-table-action.delete { color:#b91c1c; border-color:#fecaca; background:#fff7f7; }
.mr-table-action.delete:hover { background:#fee2e2; border-color:#fca5a5; }
.mr-page:fullscreen { width:100vw; height:100vh; overflow:auto; padding:16px; background:#f4f8f9; }
.mr-page.mr-page-full { position:fixed; inset:0; z-index:9998; overflow:auto; padding:16px; background:#f4f8f9; }
body.mr-page-lock { overflow:hidden; }
@media (max-width:700px) { .mr-page:fullscreen, .mr-page.mr-page-full { padding:10px; } }
.mr-map-page-card { position:relative; }
.mr-map-exit { display:none; position:absolute; top:12px; right:12px; z-index:1200; align-items:center; gap:6px; border:1px solid rgba(255,255,255,.6); border-radius:8px; background:#10243A; color:#fff; box-shadow:0 6px 18px rgba(16,36,58,.3); padding:8px 10px; font:inherit; font-size:10px; font-weight:800; cursor:pointer; }
.mr-map-exit:hover { background:#173650; }
.mr-map-page-card:fullscreen .mr-map-exit, .mr-map-page-card.mr-map-expanded .mr-map-exit { display:inline-flex; }
.mr-map-case-actions { display:flex; gap:4px; flex-wrap:wrap; justify-content:flex-end; }
.mr-connect-btn.active { color:#0F766E; border-color:#9fd8ce; background:#effbf8; }
.mr-map-live-info { display:none; position:absolute; top:12px; left:12px; z-index:1150; width:min(340px,calc(100% - 150px)); background:rgba(255,255,255,.97); border:1px solid #dbe7ed; border-radius:10px; box-shadow:0 10px 25px rgba(16,36,58,.18); padding:9px 10px; }
.mr-map-live-info.active { display:block; }
.mr-map-live-head { display:flex; align-items:center; justify-content:space-between; gap:7px; }
.mr-map-live-head > div { display:flex; align-items:center; gap:6px; min-width:0; }
.mr-map-live-head strong { color:var(--mr-navy); font-size:10px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.mr-map-live-metrics { display:flex; gap:7px; flex-wrap:wrap; margin-top:6px; }
.mr-map-live-metrics span { display:flex; flex-direction:column; gap:1px; background:#f5faf9; border:1px solid #e5efed; border-radius:6px; padding:4px 6px; color:#8a92a6; font-size:7.5px; text-transform:uppercase; letter-spacing:.03em; }
.mr-map-live-metrics b { color:var(--mr-navy); font-size:9.5px; text-transform:none; letter-spacing:0; }
.mr-map-live-info > small { display:block; margin-top:5px; color:#8a92a6; font-size:8px; line-height:1.4; }
@media (max-width:700px) { .mr-map-live-info { width:calc(100% - 100px); } }

/* Laboratory Report */
.lab-page { --pk-blue:#7c3aed; --pk-green:#0f766e; --pk-purple:#7c3aed; --pk-orange:#d97706; --pk-teal:#0891b2; --pk-pink:#ec4899; }
.lab-page .xr-hero { background: linear-gradient(120deg,#ffffff 0%,#f5f0ff 48%,#eefbf9 100%); border-color:#e8ddf8; }
.lab-page .xr-hero-icon, .lab-page .lab-hero-icon { background:#f1e8ff; color:#6d28d9; }
.lab-page .pk-hero-icon.lab-hero-icon i { filter: saturate(1.05); }
.lab-page .pk-kpi { border-top-color:#a78bfa; }
.lab-page .pk-chart-card, .lab-page .pk-table-card { border-color:#e9e2f5; }
.lab-page .pk-filter-head h3, .lab-page .pk-table-head h3, .lab-page .pk-source-head h3 { color:#4c1d95; }
.lab-page .pk-btn-primary { background:#6d28d9; border-color:#6d28d9; }
.lab-page .pk-btn-primary:hover { background:#5b21b6; border-color:#5b21b6; }
.lab-page .pk-data-badge { background:#f3e8ff; color:#6d28d9; border-color:#ddd0f5; }
.lab-page .pk-compare-table th { background:#6d28d9; }
.lab-page .pk-compare-count-row td, .lab-page .pk-compare-count-row th { background:#f5f0ff; color:#4c1d95; }
.lab-page .lab-category-badge { display:inline-block; padding:3px 8px; border-radius:999px; background:#f3e8ff; color:#6d28d9; font-size:11px; font-weight:700; }
.lab-page .lab-table th { background:#faf7ff; color:#4c1d95; }
.lab-page .lab-table tbody tr:hover { background:#fbf8ff; }
.lab-page .pk-export-option i { color:#6d28d9; }
.lab-page .pk-source-card a { color:#6d28d9; }
.lab-page .xr-main-card .xr-main-chart, .lab-page .xr-main-card .xr-main-canvas { height: 310px; }
.lab-page .lab-breakdowns .pk-chart-card { min-height: 310px; }
@media (max-width: 700px) {
  .lab-page .xr-main-card .xr-main-chart, .lab-page .xr-main-card .xr-main-canvas { height: 240px; }
}

/* Laboratory year-over-year patients */
.lab-yoy-card { margin: 12px 0 16px; padding: 18px 20px 14px; border-color:#e8ddf8; background:linear-gradient(180deg,#fff 0%,#fcfaff 100%); }
.lab-yoy-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:10px; }
.lab-yoy-head h3 { margin:0; color:#4c1d95; font-size:16px; }
.lab-yoy-head p { margin:3px 0 0; color:#64748b; font-size:12px; }
.lab-yoy-controls { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; margin:8px 0 10px; }
.lab-yoy-years { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.lab-yoy-year { width:auto; min-width:142px; height:34px; font-size:12px; font-weight:600; }
.lab-yoy-vs { color:#94a3b8; font-size:11px; font-weight:700; text-transform:uppercase; }
.lab-yoy-summary-row { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; margin:8px 0 10px; }
.lab-yoy-summary { border:1px solid #ede9f6; border-left:3px solid var(--yoy-color); border-radius:9px; padding:8px 10px; background:#fff; }
.lab-yoy-summary small { display:block; color:#64748b; font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.03em; }
.lab-yoy-summary strong { display:block; color:var(--yoy-color); font-size:20px; line-height:1.25; margin-top:2px; }
.lab-yoy-summary span { display:block; color:#94a3b8; font-size:10px; margin-top:1px; }
.lab-yoy-notice { display:flex; align-items:flex-start; gap:7px; margin:7px 0 9px; padding:7px 10px; border-radius:8px; background:#fffbeb; border:1px solid #fde68a; color:#92400e; font-size:11px; line-height:1.4; }
.lab-yoy-notice i { margin-top:1px; color:#d97706; }
.lab-yoy-chart-wrap { position:relative; width:100%; height:310px; min-height:230px; }
.lab-yoy-canvas { display:block; width:100%; height:100%; }
.lab-yoy-legend { display:flex; align-items:center; gap:14px; flex-wrap:wrap; margin:6px 0 2px; padding-top:6px; border-top:1px solid #f1eef8; }
.lab-yoy-toggle { display:inline-flex; align-items:center; gap:6px; border:0; background:transparent; color:#64748b; font:inherit; font-size:11px; font-weight:600; cursor:pointer; padding:3px 2px; opacity:.45; }
.lab-yoy-toggle.active { opacity:1; color:#334155; }
.lab-yoy-toggle .pk-legend-dash { border-top-color:var(--dash,#0f766e); }
.lab-yoy-toggle:hover { color:#4c1d95; }
@media (max-width: 720px) {
  .lab-yoy-summary-row { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .lab-yoy-chart-wrap { height:260px; }
  .lab-yoy-card { padding:14px 12px 10px; }
  .lab-yoy-controls { align-items:stretch; }
  .lab-yoy-years { width:100%; }
  .lab-yoy-year { flex:1; min-width:0; }
}

.lab-yoy-field-label { color:#64748b; font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.03em; }
.lab-yoy-divider { width:1px; height:24px; background:#e9e2f5; margin:0 2px; }
.lab-yoy-category { min-width:176px; font-weight:600; }
@media (max-width: 720px) {
  .lab-yoy-field-label { width:100%; }
  .lab-yoy-divider { display:none; }
  .lab-yoy-category { width:100%; flex-basis:100%; }
}

.lab-yoy-summary-row.lab-yoy-summary-single { grid-template-columns:repeat(3,minmax(0,1fr)); }
@media (max-width: 720px) {
  .lab-yoy-summary-row.lab-yoy-summary-single { grid-template-columns:repeat(2,minmax(0,1fr)); }
}

/* Laboratory item searchable dropdown */
.lab-yoy-item { position:relative; min-width:190px; max-width:260px; }
.lab-yoy-item-trigger { display:flex; align-items:center; justify-content:space-between; gap:8px; width:100%; height:34px; padding:0 10px; border:1px solid #dbe1ea; border-radius:8px; background:#fff; color:#334155; font:inherit; font-size:12px; font-weight:600; cursor:pointer; text-align:left; }
.lab-yoy-item-trigger:hover, .lab-yoy-item-trigger.open { border-color:#a78bfa; box-shadow:0 0 0 3px #7c3aed14; }
.lab-yoy-item-trigger i { color:#94a3b8; font-size:10px; flex:none; }
.lab-yoy-item-value { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.lab-yoy-item-menu { position:absolute; top:calc(100% + 5px); left:0; z-index:80; width:300px; max-width:min(340px,92vw); padding:8px; border:1px solid #e3ddf1; border-radius:10px; background:#fff; box-shadow:0 14px 34px #1e1b4b24; }
.lab-yoy-item-menu[hidden] { display:none !important; }
.lab-yoy-item-search { width:100%; height:34px; margin-bottom:6px; font-size:12px; }
.lab-yoy-item-list { max-height:236px; overflow:auto; overscroll-behavior:contain; }
.lab-yoy-item-option { display:flex; align-items:center; justify-content:space-between; gap:10px; width:100%; border:0; border-radius:7px; background:transparent; color:#334155; padding:7px 8px; font:inherit; font-size:11.5px; text-align:left; cursor:pointer; }
.lab-yoy-item-option span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.lab-yoy-item-option small { color:#94a3b8; font-size:10px; font-weight:700; flex:none; }
.lab-yoy-item-option:hover { background:#f7f3ff; color:#4c1d95; }
.lab-yoy-item-option.active { background:#f3e8ff; color:#6d28d9; font-weight:700; }
.lab-yoy-item-empty { padding:12px 8px; color:#94a3b8; font-size:11px; text-align:center; }
@media (max-width: 720px) {
  .lab-yoy-item { width:100%; max-width:none; flex-basis:100%; }
  .lab-yoy-item-menu { width:100%; max-width:none; }
}

.lab-bars-scroll { max-height: 430px; overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; }
.lab-bars-scroll::-webkit-scrollbar { width: 7px; }
.lab-bars-scroll::-webkit-scrollbar-thumb { background: #ddd0f5; border-radius: 999px; }

/* Laboratory year-over-year monthly table */
.lab-yoy-table-wrap { margin-top: 10px; border: 1px solid #eee8f8; border-radius: 10px; overflow-x: auto; background: #fff; }
.lab-yoy-table { width: 100%; min-width: 1080px; border-collapse: separate; border-spacing: 0; font-size: 11px; color: #334155; }
.lab-yoy-table th, .lab-yoy-table td { padding: 8px 9px; border-bottom: 1px solid #f1edf8; white-space: nowrap; }
.lab-yoy-table thead th { background: #f8f5ff; color: #5b21b6; font-size: 10px; font-weight: 800; letter-spacing: .02em; text-align: left; text-transform: uppercase; }
.lab-yoy-table thead th.num, .lab-yoy-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.lab-yoy-table tbody tr:last-child td, .lab-yoy-table tbody tr:last-child th { border-bottom: 0; }
.lab-yoy-table .lab-yoy-table-month { position: sticky; left: 0; z-index: 1; min-width: 112px; background: #fff; text-align: left; font-weight: 700; }
.lab-yoy-table thead .lab-yoy-table-month { background: #f8f5ff; z-index: 2; }
.lab-yoy-table-base .lab-yoy-table-month { color: #2563eb; }
.lab-yoy-table-current .lab-yoy-table-month { color: #c2410c; }
.lab-yoy-table-base td { background: #fbfdff; }
.lab-yoy-table-current td { background: #fffcf8; }
.lab-yoy-table-growth-row .lab-yoy-table-month { color: #6d28d9; background: #fcfaff; }
.lab-yoy-table-growth-row td { background: #fcfaff; }
.lab-yoy-table-total { border-left: 1px solid #e9e2f5; background: #faf8ff !important; font-weight: 800; color: #4c1d95; }
.lab-yoy-table-growth { font-weight: 800; font-variant-numeric: tabular-nums; }
.lab-yoy-table-growth.positive { color: #15803d; }
.lab-yoy-table-growth.negative { color: #dc2626; }
.lab-yoy-table-growth.neutral { color: #64748b; }
.lab-yoy-table tbody tr:hover td { background: #fdfbff !important; }

.lab-page .pk-kpi { min-height: 142px; }
.pk-kpi-growth-context { display: inline-block; color: #8a92a6; font-size: 9.5px; font-weight: 600; margin-left: 2px; }
.pk-kpi-change i { font-size: 9px; margin-right: 2px; }

.lab-kpi-caption { margin: 2px 0 7px; color: #7c6f9a; font-size: 10.5px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }

/* Patient Report — Dashboard Compare report picture */
.pd-page { display: flex; flex-direction: column; gap: 14px; }
.pd-hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 18px 20px; border: 1px solid #dbe5f8; border-radius: 16px; background: linear-gradient(120deg, #ffffff 0%, #eff5ff 55%, #f5f2ff 100%); box-shadow: 0 8px 24px #1e3a8a0f; }
.pd-eyebrow { color: #64748b; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.pd-hero h2 { margin: 4px 0 3px; color: #10244d; font-size: 24px; line-height: 1.15; }
.pd-hero p { margin: 0; color: #64748b; font-size: 12px; }
.pd-hero-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pd-badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border: 1px solid #dbeafe; border-radius: 999px; background: #eff6ff; color: #1d4ed8; font-size: 10px; font-weight: 800; }
.pd-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 0 11px; border-radius: 8px; font-size: 11.5px; font-weight: 700; text-decoration: none; cursor: pointer; transition: .15s ease; }
.pd-btn-primary { border: 1px solid #1d4ed8; background: #1d4ed8; color: #fff; }
.pd-btn-primary:hover { background: #1e40af; border-color: #1e40af; }
.pd-btn-outline { border: 1px solid #cfdbf2; background: #fff; color: #1e3a8a; }
.pd-btn-outline:hover { border-color: #93b4ef; background: #f8fbff; }
.pd-btn-ghost { border: 1px solid transparent; background: transparent; color: #4b5f7f; }
.pd-btn-ghost:hover { background: #eef4ff; color: #1d4ed8; }
.pd-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pd-toolbar-note { display: inline-flex; align-items: flex-start; gap: 7px; color: #64748b; font-size: 11px; line-height: 1.4; }
.pd-toolbar-note i { color: #2563eb; margin-top: 1px; }
.pd-frame { overflow: hidden; border: 1px solid #dbe5f5; border-radius: 16px; background: #fff; box-shadow: 0 12px 32px #1e3a8a18; }
.pd-frame-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid #eaf0fa; background: #fbfdff; }
.pd-frame-title { display: flex; align-items: center; gap: 7px; color: #1e3a8a; font-size: 11.5px; font-weight: 800; }
.pd-frame-title i { color: #2563eb; }
.pd-frame-actions { display: flex; gap: 3px; }
.pd-icon-btn { display: inline-grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 7px; background: transparent; color: #64748b; cursor: pointer; text-decoration: none; font-size: 11px; }
.pd-icon-btn:hover { background: #eaf2ff; color: #1d4ed8; }
.pd-image-button { display: block; width: 100%; padding: 0; border: 0; background: #f8fafc; cursor: zoom-in; text-align: center; }
.pd-report-image { display: block; width: 100%; height: auto; }
.pd-frame-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 9px 14px; border-top: 1px solid #eaf0fa; color: #94a3b8; font-size: 10px; background: #fbfdff; }
.pd-frame-footer a { color: #2563eb; font-weight: 700; text-decoration: none; }
.pd-frame-footer a:hover { text-decoration: underline; }
.pd-lightbox { overflow: auto; max-height: 78vh; border-radius: 8px; background: #0f172a; }
.pd-lightbox img { display: block; width: 100%; height: auto; }
@media (max-width: 760px) {
  .pd-hero { padding: 15px; }
  .pd-hero h2 { font-size: 20px; }
  .pd-hero-actions { width: 100%; }
  .pd-btn { flex: 1; }
  .pd-toolbar { align-items: flex-start; }
  .pd-toolbar-note { font-size: 10.5px; }
}

/* Patient Report — live Dashboard Compare */
.pdc-page { width: 100%; max-width: 1450px; margin: 0 auto; }
.pdc-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; padding: 10px 12px; border: 1px solid #dfe7f5; border-radius: 12px; background: #fff; box-shadow: 0 4px 14px #16337a0a; }
.pdc-toolbar-left, .pdc-toolbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pdc-toolbar-label { color: #64748b; font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.pdc-period-select { width: auto; min-width: 120px; height: 34px; font-size: 12px; font-weight: 700; }
.pdc-day-note { color: #94a3b8; font-size: 10.5px; font-weight: 600; white-space: nowrap; }
.pdc-source-badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border: 1px solid #dbeafe; border-radius: 999px; background: #eff6ff; color: #1d4ed8; font-size: 10px; font-weight: 800; }
.pdc-action { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 11px; border-radius: 8px; font: inherit; font-size: 11.5px; font-weight: 700; cursor: pointer; }
.pdc-action-primary { border: 1px solid #1629a8; background: #1629a8; color: #fff; }
.pdc-action-primary:hover { background: #0e1f8c; }
.pdc-action-outline { border: 1px solid #d4deef; background: #fff; color: #41546f; }
.pdc-action-outline:hover { border-color: #9db4dd; color: #1629a8; }
.pdc-loading-note { display: flex; align-items: center; gap: 6px; min-height: 18px; margin: 0 2px 6px; color: #7c6f9a; font-size: 11px; font-weight: 600; }
.pdc-dashboard { overflow: hidden; border-radius: 18px; background: #fff; box-shadow: 0 18px 42px #0d1b5c1a; border: 1px solid #d9e2f2; }
.pdc-dash-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 112px; padding: 14px 26px; color: #fff; background: linear-gradient(105deg, #07164f 0%, #0b20a5 42%, #122fd2 72%, #07164f 100%); position: relative; overflow: hidden; }
.pdc-dash-head::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 76% 20%, #6d8cff55, transparent 28%), repeating-linear-gradient(115deg, transparent 0 20px, #ffffff08 20px 21px); pointer-events: none; }
.pdc-brand { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.pdc-logo { width: 80px; height: 80px; object-fit: contain; flex: none; }
.pdc-brand-kh { font-size: 17px; font-weight: 800; line-height: 1.35; text-shadow: 0 1px 2px #0003; }
.pdc-brand-en { margin-top: 2px; font-size: 10px; font-weight: 700; letter-spacing: .08em; color: #dbe7ff; }
.pdc-dash-title { position: relative; z-index: 1; text-align: right; line-height: 1; }
.pdc-dash-title span { display: block; font-size: clamp(20px, 2.1vw, 31px); font-weight: 900; letter-spacing: -.02em; text-shadow: 0 2px 3px #0004; }
.pdc-dash-title strong { display: block; margin-top: 7px; font-size: clamp(15px, 1.35vw, 21px); font-weight: 800; color: #f4f7ff; letter-spacing: .02em; }
.pdc-dash-panel { margin: 16px 18px 18px; padding: 18px 20px 14px; border: 4px solid #1325ad; border-radius: 16px; background: #fff; box-shadow: inset 0 0 0 1px #eef2ff; }
.pdc-top-row { display: grid; grid-template-columns: 1.05fr 1.35fr .85fr; align-items: center; gap: 14px; min-height: 174px; }
.pdc-kicker { color: #71809a; font-size: 12px; font-weight: 900; letter-spacing: .015em; text-transform: uppercase; }
.pdc-total-block { text-align: left; }
.pdc-total-value { margin-top: 2px; color: #0a2bb8; font-size: clamp(38px, 4.2vw, 56px); line-height: 1; font-weight: 900; letter-spacing: -.03em; }
.pdc-total-prev { margin-top: 8px; color: #8b98ae; font-size: 11px; font-weight: 800; }
.pdc-growth { display: inline-flex; align-items: center; gap: 4px; font-size: 15px; font-weight: 900; margin-top: 4px; }
.pdc-growth-big { font-size: clamp(19px, 1.8vw, 28px); }
.pdc-growth i { font-size: .78em; }
.pdc-growth.up { color: #18a957; }
.pdc-growth.down { color: #e01b1b; }
.pdc-growth.flat, .pdc-growth.missing { color: #8b98ae; }
.pdc-current-block { text-align: center; }
.pdc-current-value { margin-top: 2px; color: #e01b1b; font-size: clamp(30px, 3.1vw, 45px); line-height: 1.06; font-weight: 900; letter-spacing: -.02em; }
.pdc-current-value span { color: #e01b1b; font-size: .6em; letter-spacing: 0; }
.pdc-target-message { margin-top: 8px; font-size: 12px; font-weight: 700; }
.pdc-target-message.good { color: #168a4b; }
.pdc-target-message.bad { color: #c51b1b; }
.pdc-target-message.missing { color: #94a3b8; }
.pdc-target-block { text-align: right; }
.pdc-target-percent { color: #2cb95c; font-size: clamp(52px, 5.4vw, 78px); line-height: .9; font-weight: 900; letter-spacing: -.05em; }
.pdc-target-caption { margin-top: 8px; color: #8b98ae; font-size: 10.5px; font-weight: 900; text-transform: uppercase; }
.pdc-target-value { margin-top: 4px; color: #2cb95c; font-size: 14px; font-weight: 900; }
.pdc-band { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin-top: 4px; padding: 14px 18px 13px; border-radius: 24px; background: linear-gradient(180deg, #09257f, #061b63); color: #fff; box-shadow: 0 10px 22px #061b6340; }
.pdc-metric { padding: 0 18px; text-align: center; border-left: 1px solid #ffffff24; }
.pdc-metric:first-child { border-left: 0; }
.pdc-metric-label { color: #f4f7ff; font-size: clamp(15px, 1.3vw, 20px); font-weight: 900; letter-spacing: .01em; }
.pdc-metric-count { margin-top: 2px; color: #f6a51a; font-size: 13px; font-weight: 900; }
.pdc-metric .pdc-growth { display: flex; justify-content: center; margin-top: 2px; font-size: clamp(20px, 2.3vw, 33px); }
.pdc-metric-prev { margin-top: 2px; color: #aab9d8; font-size: 9.5px; font-weight: 700; }
.pdc-average-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 14px 8px 4px; }
.pdc-avg-block { text-align: center; }
.pdc-avg-label { color: #1b2b73; font-size: 12px; font-weight: 900; text-transform: uppercase; }
.pdc-avg-value { margin-top: 2px; font-size: clamp(24px, 2.3vw, 34px); line-height: 1.05; font-weight: 900; }
.pdc-avg-value span { font-size: .55em; }
.pdc-avg-block.good .pdc-avg-value { color: #2cb95c; }
.pdc-avg-block.bad .pdc-avg-value { color: #e01b1b; }
.pdc-avg-block.missing .pdc-avg-value { color: #94a3b8; }
.pdc-avg-target { margin-top: 5px; color: #38466d; font-size: 9.5px; font-weight: 800; text-transform: uppercase; }
.pdc-dash-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 22px; background: linear-gradient(90deg, #07164f, #0b20a5, #07164f); color: #ecf2ff; font-size: 10px; font-style: italic; }
.pdc-dash-footer span:last-child { font-style: normal; font-weight: 700; color: #bfd0f5; }
.pdc-form-section { margin-bottom: 16px; }
.pdc-form-section h4 { margin: 0 0 9px; color: #1e2a54; font-size: 13px; }
.pdc-form-help { margin: 7px 0 0; color: #8a92a6; font-size: 10.5px; }
.pdc-form-table { overflow: hidden; border: 1px solid #e2e8f4; border-radius: 10px; }
.pdc-form-head, .pdc-form-row { display: grid; grid-template-columns: 1.35fr 1fr 1fr; align-items: center; gap: 10px; padding: 7px 10px; }
.pdc-form-head { background: #f4f7fd; color: #53627f; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.pdc-form-head span:not(:first-child) { text-align: right; }
.pdc-form-row { border-top: 1px solid #eef2f8; }
.pdc-form-row:nth-child(even) { background: #fcfdff; }
.pdc-form-metric { color: #293755; font-size: 11.5px; font-weight: 700; }
.pdc-form-row .inp-input { height: 32px; text-align: right; font-size: 12px; }
.pdc-form .form-grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 10px; }
.pdc-form .field.full { grid-column: 1 / -1; }
.pdc-form .field label { font-size: 10.5px; font-weight: 800; color: #596987; }
@media (max-width: 980px) {
  .pdc-top-row { grid-template-columns: 1fr 1fr; }
  .pdc-total-block { grid-column: 1 / -1; text-align: center; }
  .pdc-current-block { text-align: center; }
  .pdc-target-block { text-align: center; }
  .pdc-dash-head { min-height: 96px; padding: 12px 18px; }
  .pdc-logo { width: 64px; height: 64px; }
  .pdc-brand-kh { font-size: 14px; }
  .pdc-dash-panel { margin: 12px; padding: 14px; }
}
@media (max-width: 720px) {
  .pdc-toolbar { align-items: stretch; }
  .pdc-toolbar-left, .pdc-toolbar-right { width: 100%; }
  .pdc-period-select { flex: 1; min-width: 0; }
  .pdc-source-badge { display: none; }
  .pdc-dash-head { align-items: flex-start; flex-direction: column; }
  .pdc-dash-title { text-align: left; }
  .pdc-top-row { grid-template-columns: 1fr; }
  .pdc-total-block, .pdc-target-block { text-align: center; }
  .pdc-band { grid-template-columns: 1fr; padding: 10px 14px; }
  .pdc-metric { padding: 10px 0; border-left: 0; border-top: 1px solid #ffffff24; }
  .pdc-metric:first-child { border-top: 0; padding-top: 3px; }
  .pdc-average-row { grid-template-columns: 1fr; gap: 12px; }
  .pdc-avg-block { padding: 5px 0; }
  .pdc-dash-footer { flex-direction: column; align-items: flex-start; gap: 3px; }
  .pdc-form .form-grid { grid-template-columns: 1fr; }
  .pdc-form .field.full { grid-column: auto; }
  .pdc-form-head, .pdc-form-row { grid-template-columns: 1.2fr 1fr 1fr; gap: 6px; padding: 7px; }
  .pdc-form-metric { font-size: 10.5px; }
}
@media print {
  body * { visibility: hidden; }
  .pdc-dashboard, .pdc-dashboard * { visibility: visible; }
  .pdc-dashboard { position: absolute; left: 0; top: 0; width: 100%; box-shadow: none; }
  .pdc-toolbar, .pdc-loading-note { display: none !important; }
}

.pdc-source-badge.empty { border-color:#fed7aa; background:#fff7ed; color:#b45309; }

.pdc-total-value.is-missing { color: #c3ccda; font-size: 38px; letter-spacing: 0; }
.pdc-current-value.is-missing, .pdc-target-value.is-missing { color: #c3ccda !important; font-size: 22px; }
.pdc-current-value.is-missing span, .pdc-target-value.is-missing span { color: #c3ccda; }
.pdc-avg-value.is-missing { color: #b7c0ce !important; font-size: 22px; }

.pdc-target-edit { display: inline-flex; align-items: center; gap: 4px; margin-left: 2px; padding-left: 8px; border-left: 1px solid #e5eaf3; }
.pdc-target-input { width: 62px !important; min-width: 0 !important; height: 32px !important; padding: 0 6px !important; text-align: right; font-size: 12px; font-weight: 800; color: #1629a8; }
.pdc-target-suffix { color: #64748b; font-size: 11px; font-weight: 800; }
.pdc-clickable { cursor: pointer; transition: transform .15s ease, filter .15s ease; }
.pdc-clickable:hover { transform: translateY(-1px); filter: brightness(.94); }
@media (max-width: 720px) {
  .pdc-target-edit { margin-left: auto; padding-left: 0; border-left: 0; }
  .pdc-target-input { width: 56px !important; }
}

/* Patient Dashboard comparison + sync controls */
.pdc-compare-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: -4px 0 10px; padding: 8px 12px; border: 1px solid #e3e9f5; border-radius: 10px; background: #fbfdff; }
.pdc-compare-mode { min-width: 146px; }
.pdc-compare-custom { display: flex; align-items: center; gap: 6px; }
.pdc-compare-custom[hidden] { display: none !important; }
.pdc-compare-summary { margin-left: auto; color: #5b6b8a; font-size: 10.5px; font-weight: 800; white-space: nowrap; }
.pdc-compare-summary::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: #2563eb; vertical-align: 1px; }
.pdc-action-sync { border: 1px solid #0f766e; background: #0f766e; color: #fff; }
.pdc-action-sync:hover { background: #115e59; border-color: #115e59; }
.pdc-action-sync:disabled { opacity: .65; cursor: wait; }
.pdc-form-lock-note { margin: 7px 0 0; padding: 7px 9px; border-radius: 7px; background: #eff6ff; color: #1d4ed8; font-size: 10.5px; font-weight: 700; }
.pdc-form-row .inp-input[readonly] { background: #f3f6fb; color: #5b6b8a; cursor: default; }
@media (max-width: 720px) {
  .pdc-compare-summary { margin-left: 0; width: 100%; white-space: normal; }
  .pdc-compare-custom { width: 100%; }
  .pdc-compare-custom .inp-select { flex: 1; min-width: 0; }
}

a.pdc-source-badge { text-decoration: none; cursor: pointer; }
a.pdc-source-badge:hover { border-color: #93b4ef; background: #e8f1ff; }

@media (min-width: 981px) {
  .pdc-total-value { margin-left: 16px; }
}

/* Center the total-patient summary above the New Cases column */
.pdc-total-block { text-align: center; }
.pdc-total-value { margin-left: 0; }

/* Desktop sidebar show/hide toggle */
.menu-btn { display: inline-flex; }
.main { transition: margin-left .28s cubic-bezier(.4,0,.2,1); }
@media (min-width: 901px) {
  .app.sidebar-collapsed .sidebar { transform: translateX(-100%); }
  .app.sidebar-collapsed .main { margin-left: 0; }
  .sidebar-overlay { display: none !important; }
}
@media (max-width: 900px) {
  .sidebar-overlay {
    display: block; opacity: 0; visibility: hidden; pointer-events: none;
    background: rgba(20, 16, 40, .48);
    transition: opacity .25s ease, visibility .25s ease;
  }
  .sidebar-overlay.show { opacity: 1; visibility: visible; pointer-events: auto; }
}

.se-result-actions { display:flex; align-items:center; gap:6px; white-space:nowrap; }
.se-result-actions .btn { min-height:30px; padding:5px 8px; font-size:11px; }
@media (max-width: 600px) { .se-result-actions { flex-direction:column; align-items:flex-start; } }

/* Center Share duplicate warning */
.mr-duplicate-warning { padding: 4px 0; }
.mr-duplicate-head { display:flex; align-items:center; gap:8px; color:#b91c1c; font-size:14px; font-weight:800; }
.mr-duplicate-head i { font-size:16px; }
.mr-duplicate-text { margin:9px 0 12px; color:#b91c1c; font-size:12px; font-weight:700; line-height:1.55; }
.mr-duplicate-list { display:flex; flex-direction:column; gap:6px; }
.mr-duplicate-item { display:grid; grid-template-columns:1fr 1.3fr 1fr auto; gap:10px; align-items:center; padding:8px 10px; border:1px solid #fecaca; border-radius:8px; background:#fff7f7; color:#7f1d1d; font-size:11px; }
.mr-duplicate-item strong { font-weight:800; }
.mr-duplicate-item span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.mr-duplicate-status { padding:3px 7px; border-radius:999px; background:#fee2e2; color:#b91c1c; font-size:9px; font-weight:800; white-space:nowrap; }
@media (max-width: 640px) {
  .mr-duplicate-item { grid-template-columns:1fr 1fr; }
}

.mr-map-case-info { min-width:0; flex:1; }
.mr-map-case-name { display:block; margin-top:1px; color:#0F766E; font-size:10px; font-weight:800; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

.mr-map-case-info { min-width:0; flex:1; }
.mr-map-case-name { display:block; margin-top:1px; color:#0F766E; font-size:10px; font-weight:800; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

.mr-map-client-tooltip { padding: 4px 8px; border: 0; border-radius: 999px; background: #0f766e; color: #fff; font-size: 10px; font-weight: 800; line-height: 1.25; white-space: nowrap; box-shadow: 0 4px 12px #0f172a33; }
.mr-map-client-tooltip::before { border-top-color: #0f766e; }
.mr-map-client-tooltip .leaflet-tooltip-content { margin: 0; }

/* Operations Map: multiple live clients */
.mr-map-live-info { width:min(400px,calc(100% - 150px)); }
.mr-map-live-list { display:flex; flex-direction:column; gap:5px; max-height:270px; overflow-y:auto; margin-top:6px; padding-right:2px; }
.mr-map-live-case { border:1px solid #e5efed; border-radius:7px; padding:5px 6px; background:#fbfdfd; }
.mr-map-live-case-head { display:flex; align-items:center; gap:5px; }
.mr-map-live-case-head strong { flex:1; min-width:0; color:var(--mr-navy); font-size:9px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.mr-map-live-case-head .mr-icon-btn { margin-left:auto; width:20px; height:20px; font-size:8px; flex:none; }
.mr-map-live-case .mr-map-live-metrics { margin-top:4px; gap:4px; }
.mr-map-live-case .mr-map-live-metrics span { font-size:7px; padding:3px 5px; }
.mr-map-live-case .mr-map-live-metrics b { font-size:8.5px; }
@media (max-width:700px) { .mr-map-live-info { width:calc(100% - 100px); } .mr-map-live-list { max-height:210px; } }

/* Daily Task Telegram reminder */
.dt-header-right { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.dt-telegram-btn { white-space:nowrap; }
.dt-telegram-settings { display:flex; flex-direction:column; gap:12px; }
.dt-telegram-head { display:flex; align-items:center; gap:10px; }
.dt-telegram-icon { width:40px; height:40px; border-radius:11px; display:grid; place-items:center; background:#e0f2fe; color:#0284c7; font-size:20px; flex:none; }
.dt-telegram-head h4 { margin:0; color:#10244d; font-size:14px; }
.dt-telegram-head p { margin:2px 0 0; color:#64748b; font-size:10.5px; }
.dt-telegram-row { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:9px 11px; border:1px solid #e2e8f4; border-radius:9px; background:#f8fbff; }
.dt-telegram-check { display:flex; align-items:center; gap:7px; color:#334155; font-size:11.5px; font-weight:700; }
.dt-telegram-status { color:#0f766e; font-size:10.5px; font-weight:700; }
.dt-telegram-grid { display:grid; grid-template-columns:1fr 1.4fr; gap:10px; }
.dt-telegram-grid .field { display:flex; flex-direction:column; gap:5px; color:#596987; font-size:10.5px; font-weight:800; }
.dt-telegram-actions { display:flex; align-items:center; gap:7px; flex-wrap:wrap; }
.dt-telegram-help { margin:0; color:#64748b; font-size:10.5px; line-height:1.5; }
.dt-telegram-error { margin:0; padding:7px 9px; border-radius:7px; background:#fef2f2; color:#b91c1c; font-size:10.5px; font-weight:700; }
@media (max-width:600px) { .dt-telegram-grid { grid-template-columns:1fr; } .dt-header-right { width:100%; justify-content:space-between; } }

/* Training Record */
.tr-page { display:flex; flex-direction:column; gap:12px; }
.tr-hero { display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; padding:18px 20px; border:1px solid #d9e7ef; border-radius:16px; background:linear-gradient(120deg,#fff,#f0f8fb 58%,#f5f1ff); box-shadow:0 8px 24px #10243a0d; }
.tr-eyebrow { color:#0f766e; font-size:10px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
.tr-hero h2 { margin:4px 0 3px; color:#10243a; font-size:24px; }
.tr-hero p { margin:0; color:#64748b; font-size:12px; }
.tr-hero-actions { display:flex; gap:7px; flex-wrap:wrap; }
.tr-btn { display:inline-flex; align-items:center; justify-content:center; gap:6px; min-height:34px; padding:0 11px; border-radius:8px; font:inherit; font-size:11px; font-weight:800; text-decoration:none; cursor:pointer; border:1px solid transparent; }
.tr-btn-primary { background:#0f766e; border-color:#0f766e; color:#fff; }
.tr-btn-primary:hover { background:#115e59; }
.tr-btn-outline { background:#fff; border-color:#cfdbe7; color:#24425f; }
.tr-btn-outline:hover { border-color:#9db9cd; background:#f8fbfd; }
.tr-btn-sm { min-height:30px; font-size:10.5px; }
.tr-tabs { display:flex; gap:4px; flex-wrap:wrap; padding:5px; border:1px solid #dfe8f0; border-radius:10px; background:#fff; }
.tr-tab { border:0; background:transparent; color:#64748b; padding:7px 10px; border-radius:7px; font:inherit; font-size:10.5px; font-weight:800; cursor:pointer; }
.tr-tab:hover { background:#f1f7fa; color:#0f766e; }
.tr-tab.active { background:#0f766e; color:#fff; }
.tr-host { min-height:260px; }
.tr-card { background:#fff; border:1px solid #dfe8f0; border-radius:13px; padding:14px; box-shadow:0 6px 18px #10243a0a; }
.tr-card-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:10px; }
.tr-card-head h3 { margin:0; color:#10243a; font-size:14px; }
.tr-kpis { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:8px; }
.tr-kpi { border:1px solid #e1e9f1; border-left:3px solid var(--tr-color); border-radius:10px; padding:10px 11px; background:#fff; }
.tr-kpi i { color:var(--tr-color); font-size:14px; }
.tr-kpi strong { display:block; margin-top:3px; color:#10243a; font-size:22px; line-height:1; }
.tr-kpi span { display:block; margin-top:3px; color:#64748b; font-size:9px; font-weight:800; text-transform:uppercase; letter-spacing:.03em; }
.tr-grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.tr-list { display:flex; flex-direction:column; gap:5px; }
.tr-list-row { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:7px 8px; border:1px solid #edf2f6; border-radius:8px; background:#fbfdfe; }
.tr-list-row strong { display:block; color:#18314a; font-size:11px; }
.tr-list-row small { display:block; color:#8a98a8; font-size:9px; margin-top:1px; }
.tr-code { color:#0f766e; font-family:monospace; font-size:9px; }
.tr-badge { display:inline-flex; padding:3px 7px; border-radius:999px; font-size:8.5px; font-weight:800; white-space:nowrap; }
.tr-badge.ok { background:#e8f7f1; color:#0f766e; }
.tr-badge.warn { background:#fff7e6; color:#b45309; }
.tr-badge.muted { background:#f1f5f9; color:#64748b; }
.tr-badge.danger { background:#fef2f2; color:#b91c1c; }
.tr-badge.info { background:#eff6ff; color:#1d4ed8; }
.tr-empty { padding:26px; text-align:center; color:#94a3b8; }
.tr-empty i { font-size:22px; margin-bottom:5px; display:block; }
.tr-loading { padding:40px; text-align:center; color:#64748b; font-size:11px; }
.tr-spinner { display:inline-block; width:15px; height:15px; border:2px solid #cbd5e1; border-top-color:#0f766e; border-radius:50%; animation:trspin .8s linear infinite; vertical-align:-3px; margin-right:6px; }
@keyframes trspin { to { transform:rotate(360deg); } }
.tr-error { padding:18px; border:1px solid #fecaca; border-radius:9px; background:#fef2f2; color:#b91c1c; font-size:11px; }
.tr-table-wrap { overflow-x:auto; }
.tr-table { width:100%; border-collapse:collapse; font-size:10.5px; }
.tr-table th { background:#f5f9fb; color:#51667a; text-align:left; padding:8px; border-bottom:1px solid #dfe8f0; font-size:8.5px; text-transform:uppercase; letter-spacing:.03em; white-space:nowrap; }
.tr-table td { padding:8px; border-bottom:1px solid #edf2f6; color:#334155; vertical-align:middle; }
.tr-table td.num { text-align:right; font-variant-numeric:tabular-nums; }
.tr-table small.tr-block { display:block; color:#94a3b8; font-size:8.5px; margin-top:1px; }
.tr-actions { display:flex; gap:3px; flex-wrap:wrap; }
.tr-icon { width:25px; height:25px; border:1px solid #e2e8f0; border-radius:6px; background:#fff; color:#64748b; cursor:pointer; font-size:9px; display:inline-grid; place-items:center; }
.tr-icon:hover { color:#0f766e; border-color:#a7d5d0; }
.tr-icon.good { color:#0f766e; }
.tr-icon.danger { color:#b91c1c; }
.tr-icon.active { color:#b45309; border-color:#fde68a; background:#fffbeb; }
.tr-toolbar-inline { display:flex; align-items:center; gap:7px; flex-wrap:wrap; margin-bottom:9px; }
.tr-toolbar-inline .inp-input, .tr-toolbar-inline .inp-select { min-height:34px; font-size:11px; }
.tr-search { max-width:300px; }
.tr-form { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.tr-field { display:flex; flex-direction:column; gap:5px; color:#596987; font-size:10.5px; font-weight:800; }
.tr-field.full { grid-column:1/-1; }
.tr-field .inp-input { min-height:35px; font-size:12px; }
.tr-check { display:flex; align-items:center; gap:7px; font-size:11px; color:#334155; font-weight:700; }
.tr-check-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; margin:7px 0; }
.tr-note { color:#64748b; font-size:10.5px; line-height:1.5; }
.tr-import { display:flex; flex-direction:column; gap:9px; }
.tr-settings { display:flex; flex-direction:column; gap:8px; }
.tr-setting { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:9px 10px; border:1px solid #e7eef4; border-radius:9px; background:#fbfdfe; }
.tr-setting strong { display:block; color:#10243a; font-size:11.5px; }
.tr-setting p { margin:2px 0 0; color:#64748b; font-size:10px; }
.tr-report-head { border-bottom:1px solid #e9eff4; padding-bottom:9px; margin-bottom:9px; }
.tr-report-head h3 { margin:0; color:#10243a; font-size:16px; }
.tr-report-head p { margin:3px 0 0; color:#64748b; font-size:10.5px; }
@media (max-width:900px) { .tr-kpis { grid-template-columns:repeat(3,minmax(0,1fr)); } .tr-grid-2 { grid-template-columns:1fr; } }
@media (max-width:600px) { .tr-hero { padding:14px; } .tr-hero h2 { font-size:20px; } .tr-kpis { grid-template-columns:1fr 1fr; } .tr-form { grid-template-columns:1fr; } .tr-field.full { grid-column:auto; } .tr-check-grid { grid-template-columns:1fr 1fr; } .tr-setting { align-items:flex-start; flex-direction:column; } }

/* Training face registration */
.tr-face-register { display:flex; flex-direction:column; gap:9px; }
.tr-face-progress { display:flex; gap:4px; flex-wrap:wrap; }
.tr-face-pose { padding:4px 7px; border-radius:999px; background:#f1f5f9; color:#94a3b8; font-size:9px; font-weight:800; text-transform:capitalize; }
.tr-face-pose.done { background:#e8f7f1; color:#0f766e; }
.tr-face-pose.current { background:#0f766e; color:#fff; }
.tr-face-camera-wrap { position:relative; overflow:hidden; border-radius:12px; background:#0f172a; min-height:280px; display:grid; place-items:center; }
.tr-face-video { width:100%; max-height:360px; object-fit:cover; display:block; }
.tr-face-guide { position:absolute; width:180px; height:220px; border:2px dashed #ffffffa6; border-radius:50%; display:grid; place-items:center; color:#ffffff66; font-size:60px; pointer-events:none; }
.tr-face-status { margin:0; color:#64748b; font-size:11px; font-weight:700; }

/* HIS Report */
.his-page { display:flex; flex-direction:column; gap:12px; }
.his-hero { display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; padding:18px 20px; border:1px solid #d9e7ef; border-radius:16px; background:linear-gradient(120deg,#fff,#eef8fb 58%,#f8f5ff); box-shadow:0 8px 24px #10243a0d; }
.his-eyebrow { color:#0f766e; font-size:10px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
.his-hero h2 { margin:4px 0 3px; color:#10243a; font-size:24px; }
.his-hero p { margin:0; color:#64748b; font-size:12px; }
.his-hero-side { display:flex; flex-direction:column; gap:7px; align-items:flex-end; }
.his-period-row { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.his-period { min-width:110px; height:34px; font-size:11px; font-weight:700; }
.his-save-state { color:#64748b; font-size:10px; font-weight:700; }
.his-status-badge { padding:4px 8px; border-radius:999px; background:#f1f5f9; color:#64748b; font-size:9px; font-weight:800; text-transform:uppercase; }
.his-status-badge.submitted { background:#fff7e6; color:#b45309; }
.his-status-badge.approved { background:#e8f7f1; color:#0f766e; }
.his-actions { display:flex; gap:5px; flex-wrap:wrap; justify-content:flex-end; }
.his-btn { min-height:32px; border:1px solid transparent; border-radius:7px; padding:0 10px; font:inherit; font-size:10.5px; font-weight:800; cursor:pointer; display:inline-flex; align-items:center; gap:5px; }
.his-btn-primary { background:#0f766e; border-color:#0f766e; color:#fff; }
.his-btn-primary:disabled { opacity:.45; cursor:not-allowed; }
.his-btn-outline { background:#fff; border-color:#cfdbe7; color:#24425f; }
.his-btn-outline:hover { border-color:#9db9cd; background:#f8fbfd; }
.his-tabs { display:flex; gap:3px; flex-wrap:wrap; padding:5px; border:1px solid #dfe8f0; border-radius:10px; background:#fff; }
.his-tab { border:0; background:transparent; color:#64748b; padding:7px 10px; border-radius:7px; font:inherit; font-size:10.5px; font-weight:800; cursor:pointer; }
.his-tab:hover { background:#f1f7fa; color:#0f766e; }
.his-tab.active { background:#10243a; color:#fff; }
.his-card { background:#fff; border:1px solid #dfe8f0; border-radius:12px; padding:13px; box-shadow:0 6px 18px #10243a0a; }
.his-card-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:9px; }
.his-card-head h3 { margin:0; color:#10243a; font-size:13px; }
.his-kpis { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:7px; }
.his-kpi { border:1px solid #e1e9f1; border-left:3px solid var(--his-color); border-radius:9px; padding:9px 10px; background:#fff; }
.his-kpi i { color:var(--his-color); font-size:12px; }
.his-kpi strong { display:block; margin-top:2px; color:#10243a; font-size:19px; line-height:1; }
.his-kpi span { display:block; margin-top:2px; color:#64748b; font-size:8px; font-weight:800; text-transform:uppercase; letter-spacing:.03em; }
.his-grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:9px; }
.his-overview-list { display:flex; flex-direction:column; gap:2px; }
.his-overview-row { display:flex; justify-content:space-between; gap:8px; padding:5px 0; border-bottom:1px solid #f1f5f9; font-size:10.5px; color:#64748b; }
.his-overview-row strong { color:#10243a; text-align:right; }
.his-source-links { display:flex; flex-direction:column; gap:5px; }
.his-source-link { display:flex; align-items:center; gap:7px; padding:8px 9px; border:1px solid #e7eef4; border-radius:8px; color:#24425f; font-size:10.5px; font-weight:700; text-decoration:none; background:#fbfdfe; }
.his-source-link:hover { border-color:#9fd8ce; color:#0f766e; }
.his-source-link i:last-child { margin-left:auto; color:#94a3b8; font-size:8px; }
.his-reference-note { padding:7px 9px; border-radius:7px; background:#eff6ff; color:#1d4ed8; font-size:9.5px; }
.his-completeness { display:flex; flex-direction:column; gap:4px; }
.his-complete-row { display:flex; align-items:center; gap:7px; padding:6px 0; border-bottom:1px solid #f1f5f9; }
.his-complete-row strong { display:block; color:#10243a; font-size:10.5px; }
.his-complete-row small { display:block; color:#94a3b8; font-size:9px; }
.his-complete-row > div { flex:1; }
.his-dot { width:7px; height:7px; border-radius:50%; background:#cbd5e1; }
.his-dot.ok { background:#0f766e; }
.his-badge { padding:3px 7px; border-radius:999px; font-size:8px; font-weight:800; }
.his-badge.ok { background:#e8f7f1; color:#0f766e; }
.his-badge.muted { background:#f1f5f9; color:#94a3b8; }
.his-table-wrap { overflow-x:auto; }
.his-table { width:100%; border-collapse:collapse; font-size:10px; }
.his-table th, .his-table td { border-bottom:1px solid #edf2f6; padding:5px 6px; text-align:left; }
.his-table thead th { background:#f5f9fb; color:#51667a; font-size:8px; text-transform:uppercase; letter-spacing:.03em; text-align:center; position:sticky; top:0; z-index:1; }
.his-table thead th:first-child, .his-table tbody th { text-align:left; }
.his-table .his-row-label { min-width:230px; color:#334155; font-weight:600; font-size:9.5px; }
.his-table .num { text-align:right; font-variant-numeric:tabular-nums; }
.his-table tbody tr:nth-child(even) { background:#fbfdfe; }
.his-table tbody tr:hover { background:#f4fcfb; }
.his-table .his-activity-row { background:#f0fdfa !important; font-weight:800; }
.his-num { width:100%; min-width:54px; height:28px; border:1px solid #dbe5ee; border-radius:5px; padding:0 4px; text-align:right; font:inherit; font-size:10px; color:#10243a; background:#fff; }
.his-num:focus { outline:none; border-color:#0f766e; box-shadow:0 0 0 2px #0f766e1a; }
.his-total-note { margin-top:7px; color:#64748b; font-size:9.5px; }
.his-summary-grid { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:7px; margin-bottom:9px; }
.his-summary-field, .his-vacc-field, .his-setting-field { display:flex; flex-direction:column; gap:4px; color:#596987; font-size:9px; font-weight:800; }
.his-summary-field .his-num { height:33px; font-size:11px; }
.his-calc-strip { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:7px; margin:8px 0; }
.his-calc-strip > div { border:1px solid #e1e9f1; border-radius:8px; padding:7px 9px; background:#fbfdfe; }
.his-calc-strip span { display:block; color:#64748b; font-size:8px; font-weight:800; text-transform:uppercase; }
.his-calc-strip strong { display:block; color:#10243a; font-size:15px; margin-top:2px; }
.his-vacc-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; }
.his-vacc-field { border:1px solid #e7eef4; border-radius:8px; padding:8px; background:#fbfdfe; }
.his-vacc-field .his-num { height:32px; }
.his-tetanus { margin-top:12px; }
.his-tetanus h4 { margin:0 0 6px; color:#10243a; font-size:12px; }
.his-tetanus-row { display:grid; grid-template-columns:1.4fr repeat(5,minmax(0,1fr)); gap:5px; align-items:end; padding:7px; border:1px solid #e7eef4; border-radius:8px; margin-bottom:5px; background:#fbfdfe; }
.his-tetanus-row strong { color:#334155; font-size:10px; }
.his-tetanus-row label { display:flex; flex-direction:column; gap:3px; color:#94a3b8; font-size:8px; font-weight:700; }
.his-note { margin:7px 0 0; color:#64748b; font-size:9.5px; }
.his-minor-field { display:flex; align-items:center; gap:8px; margin-top:8px; color:#334155; font-size:10px; font-weight:700; }
.his-minor-field .his-num { max-width:100px; }
.his-settings-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.his-workflow-actions { display:flex; gap:6px; flex-wrap:wrap; }
.his-empty { padding:34px; text-align:center; color:#94a3b8; font-size:11px; }
.his-error { padding:18px; border:1px solid #fecaca; border-radius:9px; background:#fef2f2; color:#b91c1c; font-size:11px; }
@media (max-width:1100px) { .his-kpis { grid-template-columns:repeat(3,minmax(0,1fr)); } .his-summary-grid { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media (max-width:760px) { .his-hero { padding:14px; } .his-hero-side { align-items:flex-start; width:100%; } .his-actions { justify-content:flex-start; } .his-kpis { grid-template-columns:1fr 1fr; } .his-grid-2 { grid-template-columns:1fr; } .his-calc-strip { grid-template-columns:1fr 1fr; } .his-vacc-grid { grid-template-columns:1fr; } .his-settings-grid { grid-template-columns:1fr; } .his-tetanus-row { grid-template-columns:1fr 1fr; } .his-tetanus-row strong { grid-column:1/-1; } }

.his-source-preview { margin-top:2px; }
.his-mapped-badge { display:inline-block; padding:3px 7px; border-radius:999px; background:#e8f7f1; color:#0f766e; font-size:9px; font-weight:800; }
.his-loading-note { color:#64748b; font-size:10px; padding:12px; }

.his-bed-manual { display:flex; align-items:center; gap:9px; margin-bottom:9px; padding:9px 11px; border:1px solid #cfe8e3; border-radius:10px; background:linear-gradient(110deg,#f3fcfb,#f8fbff); }
.his-bed-manual-icon { width:32px; height:32px; border-radius:9px; display:grid; place-items:center; background:#e8f7f1; color:#0f766e; flex:none; }
.his-bed-manual-copy { flex:1; min-width:0; }
.his-bed-manual-copy strong { display:block; color:#10243a; font-size:11.5px; }
.his-bed-manual-copy small { display:block; margin-top:1px; color:#64748b; font-size:9.5px; }
.his-bed-manual .his-num { width:100px; height:36px; font-size:13px; font-weight:800; color:#0f766e; border-color:#9fd8ce; }
@media (max-width:600px) { .his-bed-manual { flex-wrap:wrap; } .his-bed-manual .his-num { width:100%; } }

/* CPR Record */
.cpr-page { max-width:1450px; margin:0 auto; }
.cpr-start-form { background:#fff; border:1px solid #dbe6ee; border-radius:16px; padding:18px; box-shadow:0 10px 28px #10243a10; }
.cpr-start-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.cpr-eyebrow { color:#0f766e; font-size:10px; font-weight:800; letter-spacing:.09em; text-transform:uppercase; }
.cpr-start-head h2 { margin:3px 0 1px; color:#10243a; font-size:25px; }
.cpr-start-head p { margin:0; color:#64748b; font-size:12px; }
.cpr-sim-badge { display:inline-flex; align-items:center; gap:5px; padding:5px 9px; border-radius:999px; background:#fff7e6; color:#b45309; border:1px solid #fde68a; font-size:9.5px; font-weight:800; }
.cpr-disclaimer { display:flex; align-items:flex-start; gap:7px; margin:12px 0; padding:9px 11px; border-radius:8px; background:#fffbeb; border:1px solid #fde68a; color:#92400e; font-size:10.5px; line-height:1.45; }
.cpr-disclaimer.small { margin-top:8px; font-size:9.5px; }
.cpr-mode-row { display:flex; gap:7px; margin:9px 0; }
.cpr-mode { flex:1; display:flex; align-items:center; justify-content:center; gap:7px; min-height:58px; border:1px solid #dbe6ee; border-radius:11px; background:#fbfdfe; color:#24425f; font:inherit; font-size:13px; font-weight:800; cursor:pointer; }
.cpr-mode.active { border-color:#0f766e; background:#effbf8; color:#0f766e; box-shadow:0 0 0 2px #0f766e18; }
.cpr-check { display:flex; align-items:center; gap:7px; color:#334155; font-size:11px; font-weight:700; margin:7px 0; }
.cpr-start-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; margin:10px 0; }
.cpr-field { display:flex; flex-direction:column; gap:4px; color:#596987; font-size:9.5px; font-weight:800; }
.cpr-field .inp-input, .cpr-field .inp-select { min-height:35px; font-size:11px; }
.cpr-start-btn { width:100%; min-height:52px; border:0; border-radius:10px; background:linear-gradient(110deg,#0f766e,#0b8f83); color:#fff; font:inherit; font-size:15px; font-weight:900; cursor:pointer; box-shadow:0 8px 20px #0f766e30; }
.cpr-recent { margin-top:14px; background:#fff; border:1px solid #dbe6ee; border-radius:12px; padding:13px; }
.cpr-recent h3 { margin:0 0 7px; color:#10243a; font-size:13px; }
.cpr-case-list { display:flex; flex-direction:column; gap:4px; }
.cpr-case-row { display:flex; align-items:center; gap:8px; width:100%; border:1px solid #edf2f6; border-radius:8px; padding:7px 9px; background:#fbfdfe; text-align:left; cursor:pointer; font:inherit; }
.cpr-case-row:hover { border-color:#9fd8ce; background:#f4fcfb; }
.cpr-case-row strong { display:block; color:#10243a; font-size:11px; }
.cpr-case-row small { display:block; color:#94a3b8; font-size:9px; margin-top:1px; }
.cpr-case-row > i { margin-left:auto; color:#94a3b8; font-size:9px; }
.cpr-mode-dot { width:8px; height:8px; border-radius:50%; background:#0f766e; flex:none; }
.cpr-mode-dot.child { background:#2563eb; }
.cpr-topbar { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; padding:12px 15px; border:1px solid #dbe6ee; border-radius:12px; background:#fff; }
.cpr-case-heading { display:flex; align-items:center; gap:9px; }
.cpr-case-heading h2 { margin:0; color:#10243a; font-size:19px; }
.cpr-case-heading p { margin:2px 0 0; color:#64748b; font-size:10px; }
.cpr-mode-badge { padding:4px 7px; border-radius:5px; background:#e8f7f1; color:#0f766e; font-size:9px; font-weight:900; letter-spacing:.05em; }
.cpr-mode-badge.child { background:#eff6ff; color:#1d4ed8; }
.cpr-status-actions { display:flex; gap:5px; flex-wrap:wrap; }
.cpr-small-btn { min-height:30px; border:1px solid #cfdbe7; border-radius:6px; background:#fff; color:#24425f; font:inherit; font-size:9.5px; font-weight:800; padding:0 9px; cursor:pointer; }
.cpr-small-btn.danger { color:#b91c1c; border-color:#fecaca; background:#fef2f2; }
.cpr-small-btn.outline { color:#64748b; }
.cpr-timers { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin:9px 0; }
.cpr-timer { border-radius:11px; padding:10px 12px; border:1px solid #dbe6ee; background:#fff; }
.cpr-timer span { display:block; color:#64748b; font-size:9px; font-weight:800; text-transform:uppercase; letter-spacing:.04em; }
.cpr-timer-value { display:block; margin-top:2px; color:#10243a; font-size:28px; font-variant-numeric:tabular-nums; letter-spacing:.02em; line-height:1; }
.cpr-timer small { display:block; margin-top:3px; color:#94a3b8; font-size:9px; }
.cpr-timer.cycle { border-color:#cfe8e3; background:#f4fcfb; }
.cpr-timer.epi { border-color:#fde68a; background:#fffdf5; }
.cpr-layout { display:grid; grid-template-columns:1.25fr .75fr; gap:9px; }
.cpr-workspace { background:#fff; border:1px solid #dbe6ee; border-radius:12px; padding:11px; }
.cpr-actions { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; }
.cpr-action { min-height:50px; display:flex; align-items:center; gap:7px; border:1px solid #0f766e; border-radius:8px; background:#0f766e; color:#fff; font:inherit; font-size:10.5px; font-weight:800; padding:0 9px; text-align:left; cursor:pointer; }
.cpr-action i { font-size:13px; flex:none; }
.cpr-action.outline { background:#fff; color:#24425f; border-color:#d4deef; }
.cpr-action.danger { background:#b91c1c; border-color:#b91c1c; }
.cpr-action:disabled { opacity:.45; cursor:not-allowed; }
.cpr-side { display:flex; flex-direction:column; gap:9px; }
.cpr-card { background:#fff; border:1px solid #dbe6ee; border-radius:12px; padding:11px; }
.cpr-card-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:6px; }
.cpr-card-head h3 { margin:0; color:#10243a; font-size:12px; }
.cpr-card-head span { color:#94a3b8; font-size:9px; }
.cpr-timeline { display:flex; flex-direction:column; max-height:430px; overflow-y:auto; gap:1px; }
.cpr-event { display:flex; gap:7px; padding:6px 0; border-bottom:1px solid #f1f5f9; }
.cpr-event-dot { width:6px; height:6px; border-radius:50%; background:#0f766e; margin-top:4px; flex:none; }
.cpr-event strong { display:block; color:#10243a; font-size:10px; }
.cpr-event small { display:block; color:#94a3b8; font-size:8.5px; margin-top:1px; }
.cpr-event p { margin:2px 0 0; color:#475569; font-size:9.5px; }
.cpr-ref p { color:#64748b; font-size:10px; line-height:1.45; margin:0 0 7px; }
.cpr-ref-links { display:flex; flex-direction:column; gap:3px; margin-bottom:7px; }
.cpr-ref-links a { color:#0f766e; font-size:9.5px; font-weight:700; text-decoration:none; }
.cpr-ref-links a:hover { text-decoration:underline; }
.cpr-muted { color:#94a3b8; font-size:10px; }
.cpr-modal-form { display:flex; flex-direction:column; gap:8px; }
.cpr-modal-form .cpr-field { font-size:10px; }
.cpr-modal-form .inp-input, .cpr-modal-form .inp-select { min-height:36px; }
@media (max-width:1100px) { .cpr-start-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .cpr-actions { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:760px) { .cpr-layout { grid-template-columns:1fr; } .cpr-timers { grid-template-columns:1fr; } .cpr-start-grid { grid-template-columns:1fr; } .cpr-actions { grid-template-columns:1fr; } .cpr-timer-value { font-size:24px; } }

/* CPR Assistant Panel */
.cpr-assistant-panel { background:#fff; border:1px solid #dbe6ee; border-radius:16px; padding:16px; box-shadow:0 10px 28px #10243a10; }
.cpr-assistant-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.cpr-assistant-head h2 { margin:3px 0 1px; color:#10243a; font-size:25px; }
.cpr-assistant-head p { margin:0; color:#64748b; font-size:12px; }
.cpr-head-actions { display:flex; align-items:center; gap:7px; flex-wrap:wrap; }
.cpr-weight-row { display:flex; align-items:center; gap:9px; flex-wrap:wrap; margin:9px 0; padding:9px 11px; border:1px solid #e2eaf1; border-radius:9px; background:#fbfdfe; }
.cpr-weight-row > label { display:flex; align-items:center; gap:5px; color:#596987; font-size:9.5px; font-weight:800; }
.cpr-weight-input { width:82px; height:33px; border:1px solid #cfdbe7; border-radius:6px; padding:0 7px; font:inherit; font-size:14px; font-weight:800; color:#0f766e; text-align:right; }
.cpr-mode-select { min-width:100px; height:33px; font-size:11px; }
.cpr-case-label { margin-left:auto; color:#94a3b8; font-size:9.5px; font-weight:700; }
.cpr-timer-strip { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin:9px 0; }
.cpr-assistant-timer { border:1px solid #dbe6ee; border-radius:11px; padding:10px 12px; background:#fff; }
.cpr-assistant-timer > span { display:block; color:#64748b; font-size:9px; font-weight:800; text-transform:uppercase; letter-spacing:.05em; }
.cpr-time { display:block; margin-top:2px; color:#10243a; font-size:34px; font-weight:900; font-variant-numeric:tabular-nums; line-height:1; letter-spacing:.02em; }
.cpr-assistant-timer small { display:block; margin-top:3px; color:#94a3b8; font-size:9px; }
.cpr-assistant-timer.cpr-timer { background:#f4fcfb; border-color:#cfe8e3; }
.cpr-assistant-timer.adren-timer { background:#fffdf5; border-color:#fde68a; }
.cpr-interval { display:flex; align-items:center; gap:4px; margin-top:5px; }
.cpr-round { width:20px; height:20px; border:1px solid #e2c98d; border-radius:50%; background:#fff; color:#b45309; font:inherit; font-size:12px; font-weight:800; line-height:1; cursor:pointer; }
.cpr-interval span { color:#b45309; font-size:8.5px; font-weight:800; min-width:42px; text-align:center; }
.cpr-primary-actions { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:6px; margin:9px 0; }
.cpr-primary { min-height:55px; border:1px solid transparent; border-radius:9px; padding:5px 7px; font:inherit; font-size:11px; font-weight:900; cursor:pointer; display:flex; align-items:center; justify-content:center; gap:4px; text-align:center; }
.cpr-primary.start { background:#b91c1c; border-color:#b91c1c; color:#fff; }
.cpr-primary.cpr { background:#0f766e; border-color:#0f766e; color:#fff; }
.cpr-primary.defib { background:#10243a; border-color:#10243a; color:#fff; }
.cpr-primary.rosc { background:#15803d; border-color:#15803d; color:#fff; }
.cpr-primary.dead { background:#475569; border-color:#475569; color:#fff; }
.cpr-primary.reset { background:#fff; border-color:#cfdbe7; color:#475569; }
.cpr-primary:disabled { opacity:.42; cursor:not-allowed; }
.cpr-panel-columns { display:grid; grid-template-columns:1.25fr .75fr; gap:9px; }
.cpr-panel-left { display:flex; flex-direction:column; gap:8px; }
.cpr-panel-right { display:flex; flex-direction:column; gap:8px; }
.cpr-section { border:1px solid #e1e9f1; border-radius:10px; padding:10px; background:#fff; }
.cpr-section h3 { margin:0 0 7px; color:#10243a; font-size:11.5px; }
.cpr-rhythm-buttons { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:5px; }
.cpr-rhythm { min-height:39px; border:1px solid #dbe6ee; border-radius:7px; background:#fbfdfe; color:#10243a; font:inherit; font-size:10px; font-weight:800; cursor:pointer; }
.cpr-rhythm:hover { border-color:#0f766e; background:#effbf8; color:#0f766e; }
.cpr-intervention-buttons { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:5px; }
.cpr-intervention { min-height:38px; border:1px solid #e1e9f1; border-radius:7px; background:#fbfdfe; color:#334155; font:inherit; font-size:9.5px; font-weight:700; cursor:pointer; text-align:left; padding:0 7px; }
.cpr-intervention:hover { border-color:#9fd8ce; background:#f4fcfb; color:#0f766e; }
.cpr-section textarea { width:100%; resize:vertical; min-height:60px; }
.cpr-section > .cpr-small-btn { margin-top:6px; }
.cpr-report .cpr-small-btn { margin-right:5px; margin-top:2px; }
.cpr-report p { margin:0 0 5px; color:#64748b; font-size:9.5px; }
.cpr-ref a { display:block; color:#0f766e; font-size:9.5px; font-weight:700; text-decoration:none; margin-bottom:3px; }
.cpr-ref a:hover { text-decoration:underline; }
@media (max-width:1050px) { .cpr-primary-actions { grid-template-columns:repeat(3,minmax(0,1fr)); } .cpr-panel-columns { grid-template-columns:1fr; } }
@media (max-width:700px) { .cpr-assistant-panel { padding:11px; } .cpr-timer-strip { grid-template-columns:1fr; } .cpr-primary-actions { grid-template-columns:1fr 1fr; } .cpr-rhythm-buttons { grid-template-columns:1fr 1fr; } .cpr-intervention-buttons { grid-template-columns:1fr 1fr; } .cpr-time { font-size:28px; } .cpr-case-label { margin-left:0; width:100%; } }

.cpr-ht-buttons { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:5px; }
.cpr-ht { min-height:36px; border:1px solid #e1e9f1; border-radius:7px; background:#fbfdfe; color:#334155; font:inherit; font-size:9px; font-weight:700; cursor:pointer; text-align:left; padding:0 6px; }
.cpr-ht:hover { border-color:#fca5a5; background:#fff7f7; color:#b91c1c; }
@media (max-width:700px) { .cpr-ht-buttons { grid-template-columns:1fr 1fr; } }

.cpr-med-buttons { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:5px; }
.cpr-med { min-height:38px; border:1px solid #dbe6ee; border-radius:7px; background:#fbfdfe; color:#334155; font:inherit; font-size:9.5px; font-weight:700; cursor:pointer; text-align:left; padding:0 7px; }
.cpr-med:hover { border-color:#9fd8ce; background:#f4fcfb; color:#0f766e; }
.cpr-dose-context { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:7px 9px; border-radius:7px; background:#f1f7fa; color:#64748b; font-size:10px; }
.cpr-dose-context span { font-size:9px; font-weight:900; color:#0f766e; }
.cpr-dose-context strong { color:#10243a; font-size:11px; }
.cpr-dose-result { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:7px; margin:8px 0; }
.cpr-dose-result > div { border:1px solid #e1e9f1; border-radius:8px; padding:8px 9px; background:#fbfdfe; }
.cpr-dose-result small { display:block; color:#94a3b8; font-size:8px; font-weight:800; text-transform:uppercase; }
.cpr-dose-result strong { display:block; margin-top:2px; color:#10243a; font-size:15px; }
.cpr-dose-warning { margin:5px 0; padding:6px 8px; border-radius:6px; background:#fffbeb; border:1px solid #fde68a; color:#92400e; font-size:9px; line-height:1.4; }
.cpr-dose-grid { display:grid; grid-template-columns:1.2fr .8fr .8fr 1.4fr; gap:7px; margin-top:8px; }
@media (max-width:700px) { .cpr-med-buttons { grid-template-columns:1fr 1fr; } .cpr-dose-result { grid-template-columns:1fr; } .cpr-dose-grid { grid-template-columns:1fr; } }

.st-summary-head { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; flex-wrap:wrap; margin-bottom:4px; }
.st-summary-hint { color:#94a3b8; font-size:9.5px; font-weight:600; }
.st-table-card .st-filters { margin-top:4px; }
