/* ==========================================================
   GeroTheme Dashboard Template
   Change the tokens below to re-theme the whole dashboard.
   Dark theme: the same tokens are redefined under [data-theme="dark"]
   (set on <html> by assets/js/theme.js before the page paints).
   ========================================================== */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f7f7f8;      /* outer card shell / hover */
  --surface-3: #f1f1f3;      /* active nav, segmented bg */
  --border: #ebebed;
  --border-strong: #e1e1e4;
  --text: #16181d;
  --text-2: #5d6169;
  --text-3: #9a9da5;
  --primary: #1b1e25;        /* accent: buttons, active states. Flips to light in dark mode */
  --primary-fg: #ffffff;
  --primary-hover: #30343d;
  --ink: #1b1e25;            /* dark panels (tooltips, toasts, bulk/save bars): dark in BOTH themes */
  --ink-fg: #ffffff;
  --bar: #e8e8eb;
  --bar-hover: #d9d9dd;
  --row-hover: #fbfbfc;
  --row-striped: #fafafb;
  --secondary-hover: #e7e7ea;
  --border-hover: #d2d2d7;
  --control-border: #cfd0d5;
  --track: #d9d9de;
  --ring: rgba(27, 30, 37, .08);
  --topbar-bg: rgba(255, 255, 255, .9);
  --overlay: rgba(15, 17, 21, .35);
  --shimmer: rgba(255, 255, 255, .8);
  --skeleton-hi: #f8f8f9;
  --warning-track: #fdefcc;
  --critical-track: #f7d6d6;
  --danger-bg: #fffafa;

  --green: #22a06b;
  --green-soft: #e7f6ee;
  --red: #e5484d;
  --red-soft: #fdecec;
  --orange: #f08c2b;
  --orange-soft: #fdf1e5;
  --blue: #3b82f6;
  --blue-soft: #eaf2fe;
  --violet: #8b5cf6;
  --violet-soft: #f1ebfe;

  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-w: 236px;
  --sidebar-w-collapsed: 62px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 12px 32px -4px rgba(16, 24, 40, .14), 0 2px 6px rgba(16, 24, 40, .06);
  --ease: cubic-bezier(.4, 0, .2, 1);
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --hnav-h: 0px;             /* height of the horizontal menu bar (horizontal layout only) */
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1012;
  --surface: #141519;
  --surface-2: #1b1c21;
  --surface-3: #25272d;
  --border: #25272d;
  --border-strong: #32343b;
  --text: #ededf0;
  --text-2: #a9acb4;
  --text-3: #74777f;
  --primary: #ededf0;
  --primary-fg: #141519;
  --primary-hover: #d3d5da;
  --ink: #26282f;
  --ink-fg: #ffffff;
  --bar: #2a2c33;
  --bar-hover: #363941;
  --row-hover: #18191e;
  --row-striped: #17181c;
  --secondary-hover: #2e3037;
  --border-hover: #3c3f47;
  --control-border: #45474f;
  --track: #3a3c44;
  --ring: rgba(255, 255, 255, .12);
  --topbar-bg: rgba(15, 16, 18, .85);
  --overlay: rgba(0, 0, 0, .6);
  --shimmer: rgba(255, 255, 255, .06);
  --skeleton-hi: #2c2e35;
  --warning-track: #3a2e12;
  --critical-track: #3b1a1b;
  --danger-bg: #1d1415;

  --green: #34c38a;
  --green-soft: #12291f;
  --red: #f0585d;
  --red-soft: #2f1718;
  --orange: #f59b4c;
  --orange-soft: #2e2012;
  --blue: #5d9df6;
  --blue-soft: #14233b;
  --violet: #a78bfa;
  --violet-soft: #231c3a;

  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-lg: 0 12px 32px -4px rgba(0, 0, 0, .55), 0 2px 6px rgba(0, 0, 0, .35);
}

/* ================= DATA-VIZ PALETTE (charts, map, status) =================
   Palette: validated with the dataviz six-checks validator against the
   white card surface (#ffffff):
   - categorical (8, adjacent pairs): PASS · worst CVD ΔE 9.1, normal-vision ΔE 19.6
   - scatter/bubble (first 3, all pairs): PASS · worst CVD ΔE 9.2
   - funnel ordinal ramp (seq 550→250): PASS
   Aqua, yellow and magenta sit below 3:1 on white, so every chart ships a
   legend + table view (the "relief rule").
   ========================================================== */
:root {
  /* Categorical: identity. Assign in this order, never cycle past 8. */
  --series-1: #2a78d6; /* blue */
  --series-2: #eb6834; /* orange */
  --series-3: #1baf7a; /* aqua */
  --series-4: #eda100; /* yellow */
  --series-5: #e87ba4; /* magenta */
  --series-6: #008300; /* green */
  --series-7: #4a3aa7; /* violet */
  --series-8: #e34948; /* red */

  /* Sequential (magnitude): one hue, light → dark */
  --seq-100: #cde2fb; --seq-150: #b7d3f6; --seq-200: #9ec5f4; --seq-250: #86b6ef;
  --seq-300: #6da7ec; --seq-350: #5598e7; --seq-400: #3987e5; --seq-450: #2a78d6;
  --seq-500: #256abf; --seq-550: #1c5cab; --seq-600: #184f95; --seq-650: #104281; --seq-700: #0d366b;

  /* Diverging (polarity): warm ↔ cool poles, neutral gray midpoint */
  --div-neg-2: #c93b3a; --div-neg-1: #f09a99;
  --div-mid: #dcdbd6;
  --div-pos-1: #86b6ef; --div-pos-2: #1c5cab;

  /* Status: reserved for meaning, always paired with icon + label */
  --status-good: #0ca30c; --status-warning: #fab219; --status-serious: #ec835a; --status-critical: #d03b3b;
  --delta-good: #006300;  --delta-bad: #c42b2b;

  /* Chrome */
  --viz-deemph: #c9cad0;  /* "rest" in emphasis charts, "Other" */
  --viz-grid: #efeff1;    /* hairline gridlines, one step off the surface */
  --viz-axis: #d2d3d8;    /* baseline / crosshair */
  --viz-surface: var(--surface);
}

/* Dark theme: the same eight hues stepped for the dark surface (#141519), validated
   separately (not an automatic flip): categorical PASS · worst CVD ΔE 8.4, all 8 >= 3:1;
   scatter first 3 all-pairs PASS; funnel ordinal PASS. Sequential runs dark → bright,
   so low values recede into the surface and high values stand out. */
:root[data-theme="dark"] {
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
  --series-5: #d55181; --series-6: #008300; --series-7: #9085e9; --series-8: #e66767;

  --seq-100: #16243a; --seq-150: #1a2e4b; --seq-200: #1d3a60; --seq-250: #1f4a7c;
  --seq-300: #245a95; --seq-350: #2a6aae; --seq-400: #3a7bd0; --seq-450: #5598e7;
  --seq-500: #6da7ec; --seq-550: #86b6ef; --seq-600: #9ec5f4; --seq-650: #b7d3f6; --seq-700: #cde2fb;

  --div-neg-2: #e66767; --div-neg-1: #8a3a3c;
  --div-mid: #3a3c42;
  --div-pos-1: #2a5a93; --div-pos-2: #86b6ef;

  --delta-good: #3cc45c; --delta-bad: #f07070;
  --viz-deemph: #4a4d55;
  --viz-grid: #212227;
  --viz-axis: #36383f;
}

/* ================= ILLUSTRATIONS (assets/js/illustrations.js) =================
   Every shape in an illustration uses one of these tokens, so the set follows
   light / dark automatically. --ill-primary and --ill-skin can be overridden
   (Illustrations.setPrimary / setSkin), on :root or on any wrapper element. */
:root {
  --ill-primary: #2a78d6;
  --ill-skin: #f1c5a3;
  --ill-hair: #2b2f3a;
  --ill-surface: #ffffff;
  --ill-surface-2: #eef0f4;
  --ill-stroke: #262a35;
  --ill-line: #d6d9e0;
  --ill-accent: #f5b63e;
  --ill-alert: #e5484d;
  --ill-success: #1baf7a;
  --ill-shadow: rgba(16, 24, 40, .08);
  --ill-soft-mix: 24%;
  --ill-bg-mix: 9%;
}
:root[data-theme="dark"] {
  --ill-surface: #262830;
  --ill-surface-2: #30333b;
  --ill-stroke: #a3a7b1;
  --ill-line: #464a54;
  --ill-hair: #15171c;
  --ill-accent: #e8a935;
  --ill-shadow: rgba(0, 0, 0, .35);
  --ill-soft-mix: 38%;
  --ill-bg-mix: 16%;
}
.ill {
  /* derived tokens live on the element so a wrapper can override --ill-primary */
  --ill-primary-soft: color-mix(in srgb, var(--ill-primary) var(--ill-soft-mix), var(--surface));
  --ill-bg: color-mix(in srgb, var(--ill-primary) var(--ill-bg-mix), var(--surface));
  display: block; width: 100%; height: auto; max-width: var(--ill-size, 280px); margin-inline: auto;
  overflow: visible;
}
.ill .bg { fill: var(--ill-bg); }
.ill .sh { fill: var(--ill-shadow); }
.ill .s { fill: var(--ill-surface); }
.ill .s2 { fill: var(--ill-surface-2); }
.ill .p { fill: var(--ill-primary); }
.ill .ps { fill: var(--ill-primary-soft); }
.ill .a { fill: var(--ill-accent); }
.ill .al { fill: var(--ill-alert); }
.ill .g { fill: var(--ill-success); }
.ill .sk { fill: var(--ill-skin); }
.ill .h { fill: var(--ill-hair); }
.ill .k { fill: var(--ill-stroke); }
.ill .w { fill: #fff; }
.ill .n { fill: none; }
.ill :is(.o, .op, .ops, .ow, .oa, .oal, .ol) { stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ill .o { stroke: var(--ill-stroke); }
.ill .op { stroke: var(--ill-primary); }
.ill .ops { stroke: var(--ill-primary-soft); }
.ill .ow { stroke: #fff; }
.ill .oa { stroke: var(--ill-accent); }
.ill .oal { stroke: var(--ill-alert); }
.ill .ol { stroke: var(--ill-line); stroke-width: 3; }
.ill .t2 { stroke-width: 3; }
.ill .t { stroke-width: 5; }
.ill .t7 { stroke-width: 7; }
.ill .d { stroke-dasharray: 3 6; }
.ill .nss { vector-effect: non-scaling-stroke; }
/* subtle motion, off when the viewer prefers reduced motion or [data-ill-static] is set */
.ill .float { animation: ill-float 4s ease-in-out infinite; transform-box: fill-box; }
.ill .twinkle { animation: ill-twinkle 2.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.ill .spin { animation: ill-spin 14s linear infinite; transform-box: fill-box; transform-origin: center; }
.ill .spin-r { animation: ill-spin 9s linear infinite reverse; transform-box: fill-box; transform-origin: center; }
.ill .blink { animation: ill-blink 1.4s steps(2, jump-none) infinite; }
.ill .flicker { animation: ill-flicker .5s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: top center; }
.ill .twinkle:nth-of-type(2n) { animation-delay: -1.3s; }
[data-ill-static] .ill *, .ill[data-ill-static] * { animation: none !important; }
@keyframes ill-float { 50% { transform: translateY(-5px); } }
@keyframes ill-twinkle { 50% { transform: scale(.55); opacity: .5; } }
@keyframes ill-spin { to { transform: rotate(360deg); } }
@keyframes ill-blink { 50% { opacity: .25; } }
@keyframes ill-flicker { to { transform: scaleY(.82); } }

/* ================= HORIZONTAL LAYOUT (data-layout="horizontal", desktop only) ================= */
.hnav { display: none; }
@media (min-width: 1025px) {
  :root[data-layout="horizontal"] { --hnav-h: 56px; }
  [data-layout="horizontal"] .app { flex-direction: column; }
  [data-layout="horizontal"] .sidebar { display: none; }
  [data-layout="horizontal"] .hnav { display: flex; }
}
.hnav {
  position: sticky; top: 0; z-index: 30;
  align-items: center; gap: 20px;
  height: var(--hnav-h); padding: 0 24px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.hnav .brand { flex-shrink: 0; }
.hnav-menu { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; }
.hnav-item, .hnav-sub { position: relative; }
.hnav-link {
  display: inline-flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 12px; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 500; white-space: nowrap;
  transition: background .15s, color .15s;
}
.hnav-link:hover, .hnav-item.open > .hnav-link { background: var(--surface-2); color: var(--text); }
.hnav-link.active, .hnav-item.current > .hnav-link { background: var(--surface-3); color: var(--text); }
.hnav-link .chev { width: 14px; height: 14px; color: var(--text-3); transition: transform .2s var(--ease); }
.hnav-item.open > .hnav-link .chev { transform: rotate(180deg); }

.hnav-drop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 40;
  min-width: 220px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  /* the visibility delay keeps the menu open while the pointer crosses the gap */
  transition: opacity .15s, transform .15s var(--ease), visibility 0s linear .15s;
}
.hnav-drop::before { content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 8px; } /* hover bridge */
.hnav-sub > .hnav-drop { top: -7px; left: calc(100% + 4px); transform: translateX(-4px); }
.hnav-sub > .hnav-drop::before { top: 0; bottom: 0; left: -8px; right: auto; width: 8px; height: auto; }
.hnav-drop.flip { left: auto; right: 0; }
.hnav-sub > .hnav-drop.flip { right: calc(100% + 4px); }
.hnav-sub > .hnav-drop.flip::before { left: auto; right: -8px; }
.hnav-item.open > .hnav-drop, .hnav-sub.open > .hnav-drop { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
@media (hover: hover) {
  .hnav-item:hover > .hnav-drop, .hnav-sub:hover > .hnav-drop { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
  .hnav-item:hover > .hnav-link { background: var(--surface-2); color: var(--text); }
}
.hnav-drop-item {
  width: 100%; display: flex; align-items: center; gap: 10px;
  height: 34px; padding: 0 10px; border-radius: 6px;
  font-size: 13px; color: var(--text-2); text-align: left; white-space: nowrap;
  transition: background .12s, color .12s;
}
.hnav-drop-item > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.hnav-drop-item .lucide { width: 16px; height: 16px; color: var(--text-3); }
.hnav-drop-item .chev { width: 14px; height: 14px; }
.hnav-drop-item:hover, .hnav-sub.open > .hnav-drop-item { background: var(--surface-2); color: var(--text); }
@media (hover: hover) { .hnav-sub:hover > .hnav-drop-item { background: var(--surface-2); color: var(--text); } }
.hnav-drop-item.active, .hnav-sub.current > .hnav-drop-item { color: var(--text); font-weight: 500; }
.hnav-drop-item.active { background: var(--surface-3); }
.hnav-drop-item.active .lucide, .hnav-sub.current > .hnav-drop-item .lucide { color: var(--text); }
.hnav-search { width: 240px; height: 34px; margin-left: auto; }
.hnav-user { flex-shrink: 0; border-radius: 50%; }
.hnav-user:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ================= THEME TOGGLE + CUSTOMIZER ================= */
.theme-toggle .i-sun { display: none; }
[data-theme="dark"] .theme-toggle .i-sun { display: block; }
[data-theme="dark"] .theme-toggle .i-moon { display: none; }

.modal-dialog.customizer { max-width: 360px; }
.option-grid { display: grid; gap: 10px; }
.option-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.option-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.option {
  display: flex; flex-direction: column; gap: 8px; padding: 6px;
  border: 1px solid var(--border); border-radius: 10px;
  font-size: 12.5px; font-weight: 500; color: var(--text-2); text-align: left;
  transition: border-color .15s, box-shadow .15s, color .15s;
}
.option:hover { border-color: var(--border-hover); color: var(--text); }
.option.active { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); color: var(--text); }
.option > span:last-child { display: flex; align-items: center; gap: 6px; padding: 0 2px 2px; }
.option > span:last-child .lucide { width: 14px; height: 14px; }
/* mini schematics: fixed colors on purpose, they depict a theme rather than follow it */
.opt-preview { display: flex; gap: 4px; height: 58px; padding: 5px; border-radius: 6px; overflow: hidden; background: #eeeef1; }
.opt-preview > span { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.opt-preview i { display: block; border-radius: 3px; background: #fff; }
.opt-preview .side { width: 26%; }
.opt-preview .bar { height: 8px; }
.opt-preview .bar.top { height: 10px; background: #1b1e25; opacity: .85; }
.opt-preview .block { flex: 1; }
.opt-preview.theme-dark { background: #1b1c21; }
.opt-preview.theme-dark i { background: #2b2d34; }
.opt-preview.theme-system { background: linear-gradient(135deg, #eeeef1 50%, #1b1c21 50%); }
.opt-preview.theme-system i { background: linear-gradient(135deg, #fff 50%, #2b2d34 50%); }
.opt-preview.layout-vertical .side { background: #1b1e25; opacity: .85; }
[data-theme="dark"] .opt-preview.layout-vertical, [data-theme="dark"] .opt-preview.layout-horizontal { background: #1b1c21; }
[data-theme="dark"] .opt-preview.layout-vertical i, [data-theme="dark"] .opt-preview.layout-horizontal i { background: #2b2d34; }
[data-theme="dark"] :is(.layout-vertical .side, .layout-horizontal .bar.top) { background: #ededf0; }

* { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-padding-top: calc(64px + var(--hnav-h)); } /* keep focused/scrolled-to elements clear of the sticky bars */
body {
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
svg.lucide { width: 16px; height: 16px; stroke-width: 1.8; flex-shrink: 0; }
.muted { color: var(--text-3); }
[hidden] { display: none !important; }

.app { display: flex; min-height: 100vh; }
.no-anim, .no-anim * { transition: none !important; }

/* ================= SIDEBAR ================= */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: sticky; top: 0;
  height: 100vh;
  display: flex; flex-direction: column;
  padding: 14px 12px 12px;
  border-right: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  transition: width .28s var(--ease);
}
.sidebar-top { position: relative; display: flex; align-items: center; justify-content: space-between; padding: 2px 0 14px 7px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; white-space: nowrap; }
.brand-logo {
  width: 24px; height: 24px; border-radius: 6px;
  display: grid; place-items: center; flex-shrink: 0;
  background: var(--primary); color: var(--primary-fg);
  font-size: 13px; font-weight: 700;
  transition: opacity .15s;
}
.sidebar-toggle .ico-expand { display: none; }

.search {
  display: flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-3);
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 12.5px; }
.search input::placeholder { color: var(--text-3); }
.search:focus-within { border-color: var(--border-strong); box-shadow: 0 0 0 3px var(--surface-3); }
.search kbd {
  font-family: inherit; font-size: 11px; color: var(--text-3); white-space: nowrap;
  padding: 1px 5px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface-2);
}
.search.sm { height: 30px; width: 180px; }

.sidebar > * { flex-shrink: 0; } /* header, search & user card never get squashed */
.nav {
  display: flex; flex-direction: column; gap: 1px;
  margin-top: 8px; flex: 1 1 0; min-height: 0;
  overflow: hidden auto; scrollbar-width: none; /* only the menu list scrolls */
}
.nav::-webkit-scrollbar { display: none; }
.nav > * { flex-shrink: 0; }
.nav-label {
  position: relative;
  margin: 16px 8px 6px;
  font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
  color: var(--text-3);
  transition: color .2s;
}
.nav-label::after {
  content: ""; position: absolute; left: 0; right: 0; top: 50%;
  border-top: 1px solid var(--border-strong); opacity: 0; transition: opacity .2s;
}
.nav-item {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  height: 32px; padding: 0 11px;
  border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 500; text-align: left; white-space: nowrap;
  overflow: hidden;
  transition: background .15s, color .15s;
}
/* min-width: 0 lets the label shrink (flex items default to min-width: auto), so long
   text ends in "…" instead of pushing the badge/chevron out of the row */
.nav-item > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; transition: opacity .2s; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--surface-3); color: var(--text); }
.nav-toggle.current { color: var(--text); }
.nav-item .chev { width: 14px; height: 14px; color: var(--text-3); transition: transform .25s var(--ease), opacity .2s; }

/* Multi-level accordion. Child selectors (>) keep every level independent:
   opening a parent never opens (or rotates the chevron of) its nested groups. */
.nav-group.open > .nav-toggle .chev { transform: rotate(180deg); }
.nav-sub { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .28s var(--ease), opacity .15s; }
.nav-group.open > .nav-sub { grid-template-rows: 1fr; }
.nav-sub-inner { min-height: 0; overflow: hidden; }
.nav-sub-list {
  position: relative; margin: 2px 0 4px 18px; padding-left: 12px;
  opacity: 0; transform: translateY(-4px);
  transition: opacity .2s, transform .25s var(--ease);
}
.nav-group.open > .nav-sub > .nav-sub-inner > .nav-sub-list { opacity: 1; transform: none; }
.nav-sub-list::before { content: ""; position: absolute; left: 0; top: 0; bottom: 14px; border-left: 1px solid var(--border-strong); }
.nav-sub-list .nav-sub-list { margin: 1px 0 2px 10px; } /* deeper levels indent less */
.nav-subitem {
  position: relative; width: 100%;
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px; border-radius: 6px;
  color: var(--text-2); font-size: 12.5px; text-align: left; white-space: nowrap;
  transition: background .15s, color .15s;
}
.nav-subitem > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nav-subitem .chev { width: 13px; height: 13px; margin-left: auto; color: var(--text-3); transition: transform .25s var(--ease); }
.nav-subitem::before {
  content: ""; position: absolute; left: -12px; top: 15px; width: 8px;
  border-top: 1px solid var(--border-strong);
}
.nav-subitem:hover { background: var(--surface-2); color: var(--text); }
.nav-subitem.active { background: var(--surface-3); color: var(--text); font-weight: 500; }
.nav-badge {
  flex-shrink: 0; margin-left: auto; min-width: 18px; height: 18px; padding: 0 6px; border-radius: 999px;
  display: inline-grid; place-items: center;
  background: var(--surface-3); color: var(--text-2);
  font-size: 10.5px; font-weight: 600; font-style: normal;
}
.nav-badge.red { background: var(--red); color: #fff; }
.nav-badge.new { background: var(--green-soft); color: var(--green); }

/* Flyout: shows a group's submenus when the sidebar is collapsed to a rail */
.nav-flyout {
  position: fixed; z-index: 110; min-width: 210px; max-width: 280px; max-height: calc(100vh - 16px); overflow-y: auto;
  padding: 6px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateX(-4px);
  transition: opacity .15s, transform .15s var(--ease), visibility .15s;
}
.nav-flyout.show { opacity: 1; visibility: visible; transform: none; }
.flyout-title { padding: 6px 8px 4px; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); }
.flyout-body > .nav-sub-list { margin: 0; padding-left: 0; opacity: 1; transform: none; }
.flyout-body > .nav-sub-list::before,
.flyout-body > .nav-sub-list > .nav-subitem::before,
.flyout-body > .nav-sub-list > .nav-group > .nav-subitem::before { display: none; }

.user-card {
  display: flex; align-items: center; gap: 10px;
  margin-top: 16px; padding: 8px;
  border: 1px solid var(--border); border-radius: 10px;
  text-align: left; overflow: hidden; white-space: nowrap;
  transition: padding .28s var(--ease), border-color .2s, background .15s;
}
.user-card:hover, .user-card.is-open { background: var(--surface-2); }
.user-card .lucide { color: var(--text-3); transition: opacity .2s; }
.user-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; transition: opacity .2s; }
.user-meta strong { font-size: 12.5px; font-weight: 600; }
.user-meta small { font-size: 11px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Collapsed rail (desktop only) */
@media (min-width: 1025px) {
  .sidebar-collapsed { --sidebar-w: var(--sidebar-w-collapsed); }
  .sidebar-collapsed .sidebar :is(.brand-name, .nav-item span, .nav-item .chev, #globalSearch input, #globalSearch kbd, .user-meta, .user-card > .lucide) {
    opacity: 0; pointer-events: none;
  }
  .sidebar-collapsed .nav-label { color: transparent; }
  .sidebar-collapsed .nav-label::after { opacity: 1; }
  .sidebar-collapsed .nav-group.open .nav-sub { grid-template-rows: 0fr; }
  .sidebar-collapsed .nav-sub { opacity: 0; } /* no ghost submenu rows/badges while collapsing */

  /* In the rail a badge becomes a dot on the icon; the tooltip carries the number */
  .sidebar-collapsed .sidebar .nav-item { position: relative; }
  .sidebar-collapsed .sidebar .nav-item .nav-badge {
    position: absolute; left: 23px; top: 5px;
    min-width: 0; width: 8px; height: 8px; padding: 0;
    font-size: 0; background: var(--primary); box-shadow: 0 0 0 2px var(--surface);
  }
  .sidebar-collapsed .sidebar .nav-item .nav-badge.red { background: var(--red); }
  .sidebar-collapsed .sidebar .nav-item .nav-badge.new { background: var(--green); }
  .sidebar-collapsed #globalSearch { cursor: pointer; }
  .sidebar-collapsed .user-card { padding: 3px; border-color: transparent; }

  /* Toggle sits on top of the logo and appears on hover */
  .sidebar-collapsed .sidebar-toggle { position: absolute; left: 4px; top: -1px; opacity: 0; }
  .sidebar-collapsed .sidebar-top:hover .sidebar-toggle { opacity: 1; }
  .sidebar-collapsed .sidebar-top:hover .brand-logo { opacity: 0; }
  .sidebar-collapsed .sidebar-toggle .ico-collapse { display: none; }
  .sidebar-collapsed .sidebar-toggle .ico-expand { display: block; }
}

.side-tip {
  position: fixed; z-index: 120;
  padding: 5px 9px; border-radius: 6px;
  background: var(--ink); color: var(--ink-fg);
  font-size: 12px; font-weight: 500; white-space: pre; pointer-events: none;
  opacity: 0; transform: translate(-4px, -50%);
  transition: opacity .12s, transform .12s;
}
.side-tip.show { opacity: 1; transform: translate(0, -50%); }

.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: inline-grid; place-items: center; flex-shrink: 0;
  background: var(--surface-3); color: var(--text-2);
  font-size: 11px; font-weight: 600;
}
.avatar.xs { width: 22px; height: 22px; font-size: 9.5px; }

/* ================= MAIN ================= */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: var(--hnav-h); z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  height: 52px; padding: 0 24px;
  background: var(--topbar-bg); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 6px; }
.breadcrumb { display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb .sep { color: var(--text-3); }
.breadcrumb .current { color: var(--text); font-weight: 500; animation: fadeIn .25s; }

.icon-btn {
  position: relative;
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  display: inline-grid; place-items: center;
  border: 1px solid var(--border); color: var(--text-2); background: var(--surface);
  transition: background .15s, color .15s, opacity .15s;
}
.icon-btn.sm { width: 30px; height: 30px; border-color: transparent; }
.icon-btn:hover, .icon-btn.is-open { background: var(--surface-2); color: var(--text); }
.icon-btn.menu-btn { display: none; }
.icon-btn .dot {
  position: absolute; top: 6px; right: 7px; width: 6px; height: 6px; border-radius: 50%;
  background: var(--red); border: 1.5px solid var(--surface);
  transition: transform .2s var(--ease);
}
.icon-btn .dot.hide { transform: scale(0); }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-weight: 500; font-size: 12.5px; white-space: nowrap;
  box-shadow: var(--shadow);
  transition: background .15s, border-color .15s;
}
.btn.sm { height: 30px; padding: 0 10px; font-size: 12px; }
.btn:hover, .btn.is-open { background: var(--surface-2); }
.btn.is-active { border-color: var(--primary); }
.btn .lucide { width: 14px; height: 14px; color: var(--text-2); }
.btn .chev { transition: transform .2s var(--ease); }
.btn.is-open .chev { transform: rotate(180deg); }

.content { padding: 22px 24px 32px; display: flex; flex-direction: column; gap: 16px; }
/* Entrance animation */
.content > *, .kpis > .card { animation: fadeUp .5s var(--ease-out) both; }
.content > :nth-child(2) { animation-delay: .05s; }
.content > :nth-child(3) { animation-delay: .15s; }
.kpis > :nth-child(2) { animation-delay: .08s; }
.kpis > :nth-child(3) { animation-delay: .16s; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.page-head p { margin-top: 4px; color: var(--text-2); }
.page-actions { display: flex; gap: 8px; }

.grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: stretch; }
.col-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.col-main > .trend { flex: 1; }
.trend .card-body { display: flex; flex-direction: column; }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }

/* ================= CARD (shell + inner panel) ================= */
.card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
  display: flex; flex-direction: column;
  min-width: 0;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 36px; padding: 4px 8px 6px 10px;
}
.card-head h3 { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.card-body {
  position: relative;
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 3px);
  padding: 16px;
  box-shadow: var(--shadow);
}
.card-body.flush { padding: 0; overflow: hidden; }

/* Loading shimmer (add .loading to any .card-body) */
.card-body > * { transition: opacity .2s; }
.card-body.loading { overflow: hidden; }
.card-body.loading > * { opacity: .35; }
.card-body.loading::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 20%, var(--shimmer) 50%, transparent 80%);
  animation: shimmer 1s infinite;
}

/* KPI */
.kpi { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.kpi-value { font-size: 26px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-value.lg { font-size: 28px; }
.kpi-delta { margin-top: 6px; font-size: 11.5px; color: var(--text-3); }
.up { color: var(--green); font-weight: 600; }
.down { color: var(--red); font-weight: 600; }
.spark { width: 96px; height: 40px; overflow: visible; }
.spark-line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.1s .15s var(--ease) forwards; }
.spark-area { opacity: 0; animation: fadeIn .6s .6s forwards; }

/* ================= BAR CHART ================= */
.trend-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.trend-head .kpi-delta { margin: 0; }

.bar-chart { position: relative; flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 34px; min-height: 280px; }
.bc-plot { position: relative; display: flex; align-items: flex-end; gap: 6%; padding: 0 2% 26px; }
.bc-y { position: relative; margin-bottom: 26px; font-size: 11px; color: var(--text-3); }
.bc-y span { position: absolute; right: 0; transform: translateY(50%); }

.bc-group { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 6px; }
.bc-bar {
  flex: 1; max-width: 34px; height: 0; border-radius: 6px 6px 3px 3px;
  background: var(--bar); cursor: pointer;
  transition: background .15s, height .7s var(--ease-out);
}
.bc-group:nth-child(2) .bc-bar { transition-delay: 0s, .04s; }
.bc-group:nth-child(3) .bc-bar { transition-delay: 0s, .08s; }
.bc-group:nth-child(4) .bc-bar { transition-delay: 0s, .12s; }
.bc-group:nth-child(5) .bc-bar { transition-delay: 0s, .16s; }
.bc-group:nth-child(6) .bc-bar { transition-delay: 0s, .2s; }
.bc-group:nth-child(7) .bc-bar { transition-delay: 0s, .24s; }
.bc-bar:hover { background: var(--bar-hover); }
.bc-bar.active { background: var(--primary); }
.bc-label { position: absolute; bottom: -24px; left: 0; right: 0; text-align: center; font-size: 11px; color: var(--text-3); }

.bc-line, .bc-tip { opacity: 0; transition: top .35s var(--ease), left .35s var(--ease), opacity .3s; }
.bar-chart.ready .bc-line { opacity: .7; }
.bar-chart.ready .bc-tip { opacity: 1; }
.bc-line { position: absolute; border-top: 1.5px dashed var(--text-3); pointer-events: none; }
.bc-tip {
  position: absolute; transform: translate(-100%, -50%);
  margin-left: -8px;
  padding: 3px 7px; border-radius: 6px;
  background: var(--primary); color: var(--primary-fg);
  font-size: 11px; font-weight: 500; white-space: nowrap; pointer-events: none;
}

/* ================= LATEST UPDATES ================= */
.updates .card-body { display: flex; flex-direction: column; gap: 12px; }
.segmented {
  position: relative;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  padding: 3px; background: var(--surface-3); border-radius: var(--radius-sm);
}
.seg-indicator {
  position: absolute; top: 3px; bottom: 3px; left: 3px;
  width: calc((100% - 6px) / var(--n, 3));
  border-radius: 6px; background: var(--primary); box-shadow: var(--shadow);
  transform: translateX(calc(var(--i, 0) * 100%));
  transition: transform .3s var(--ease);
}
.segmented button { position: relative; height: 28px; border-radius: 6px; font-size: 12px; font-weight: 500; color: var(--text-2); transition: color .2s; }
.segmented button:hover { color: var(--text); }
.segmented button.active { color: var(--primary-fg); }
.updates-count { font-size: 12px; color: var(--text-2); }
.updates-count strong { color: var(--text); }

.activity { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.activity li {
  display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border);
  animation: fadeUp .35s var(--ease-out) both; animation-delay: calc(var(--d, 0) * 40ms);
}
.activity li:last-child { border-bottom: 0; }
.act-icon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; }
.act-icon .lucide { width: 14px; height: 14px; }
.act-body { flex: 1; min-width: 0; }
.act-top { display: flex; justify-content: space-between; gap: 8px; }
.act-title { font-size: 12.5px; font-weight: 600; }
.act-time { font-size: 11px; color: var(--text-3); white-space: nowrap; }
.act-desc { margin-top: 2px; font-size: 11.5px; color: var(--text-2); }
.act-desc b { color: var(--text); font-weight: 600; }
.activity .activity-empty { justify-content: center; padding: 20px 0; color: var(--text-3); font-size: 12px; }

.tone-blue   { background: var(--blue-soft);   color: var(--blue); }
.tone-green  { background: var(--green-soft);  color: var(--green); }
.tone-violet { background: var(--violet-soft); color: var(--violet); }
.tone-red    { background: var(--red-soft);    color: var(--red); }
.tone-orange { background: var(--orange-soft); color: var(--orange); }
.tone-gray   { background: var(--surface-3);   color: var(--text-2); }

/* ================= TABLE ================= */
.table-tools { display: flex; align-items: center; gap: 6px; }
.sel-chip {
  padding: 2px 8px; border-radius: 999px;
  background: var(--primary); color: var(--primary-fg);
  font-size: 11px; font-weight: 500;
  opacity: 0; transform: scale(.8); transition: opacity .2s, transform .2s var(--ease);
}
.sel-chip.show { opacity: 1; transform: none; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; white-space: nowrap; }
.table th {
  height: 38px; padding: 0 14px;
  text-align: left; font-size: 11.5px; font-weight: 500; color: var(--text-2);
  background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.table th[data-sort] { cursor: pointer; user-select: none; transition: color .15s; }
.table th[data-sort]:hover, .table th.sorted { color: var(--text); }
.table th .lucide { width: 12px; height: 12px; margin-left: 4px; vertical-align: -2px; color: var(--text-3); }
.table th.sorted .lucide { color: var(--text); }
.table td { height: 46px; padding: 0 14px; border-bottom: 1px solid var(--border); font-size: 12.5px; transition: background .15s; }
.table tbody tr { transition: opacity .25s, transform .25s var(--ease); }
.table tbody.stagger tr { animation: fadeIn .3s both; animation-delay: calc(var(--d, 0) * 30ms); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--row-hover); }
.table tbody tr.selected td { background: var(--surface-2); }
.table tbody tr.flash td { animation: flash 1.2s var(--ease); }
.table tbody tr.removing { opacity: 0; transform: translateX(16px); }
.table .check { width: 36px; padding-right: 0; }
.table input[type="checkbox"] { width: 14px; height: 14px; accent-color: var(--primary); cursor: pointer; vertical-align: middle; }
.table .empty { height: 90px; text-align: center; color: var(--text-3); }
.t-id { font-weight: 600; }

.cell-flex { display: inline-flex; align-items: center; gap: 8px; }
.prio { display: inline-flex; align-items: flex-end; gap: 1.5px; height: 12px; }
.prio i { width: 3px; border-radius: 1px; background: var(--border-strong); }
.prio i:nth-child(1) { height: 5px; } .prio i:nth-child(2) { height: 8px; } .prio i:nth-child(3) { height: 12px; }
.prio.high i { background: var(--red); }
.prio.medium i:nth-child(-n+2) { background: var(--orange); }
.prio.low i:nth-child(1) { background: var(--green); }

.status {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 8px;
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 12px; font-weight: 500;
}
.status .lucide { width: 13px; height: 13px; }
.status.review .lucide   { color: var(--blue); }
.status.open .lucide     { color: var(--text-3); }
.status.progress .lucide { color: var(--orange); }
.status.resolved .lucide { color: var(--green); }
.status.escalated .lucide{ color: var(--red); }

.sla-ok { color: var(--text); }
.sla-warn { color: var(--orange); font-weight: 500; }
.sla-late { color: var(--red); font-weight: 500; }

/* ================= DROPDOWN MENUS ================= */
.menu {
  position: fixed; top: 0; left: 0; z-index: 100;
  min-width: 190px; padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden;
  transform: translateY(-4px) scale(.97);
  transition: opacity .15s, transform .18s var(--ease), visibility .15s;
}
.menu.open { opacity: 1; visibility: visible; transform: none; }
.menu-label { padding: 6px 8px 4px; font-size: 11px; font-weight: 500; color: var(--text-3); }
.menu-item {
  width: 100%;
  display: flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 8px; border-radius: 6px;
  font-size: 12.5px; color: var(--text); text-align: left; white-space: nowrap;
  transition: background .12s;
}
.menu-item:hover { background: var(--surface-2); }
.menu-item > .lucide:first-child { width: 15px; height: 15px; color: var(--text-2); }
.menu-item.danger, .menu-item.danger .lucide { color: var(--red) !important; }
.menu-item.danger:hover { background: var(--red-soft); }
.menu-check { margin-left: auto; width: 14px !important; height: 14px !important; opacity: 0; transform: scale(.6); transition: opacity .15s, transform .15s var(--ease); }
.menu-item.checked .menu-check { opacity: 1; transform: none; }
.menu-item .prio { width: 15px; justify-content: center; }
.menu-sep { height: 1px; margin: 4px -4px; background: var(--border); }
.menu-user { display: flex; align-items: center; gap: 10px; padding: 8px; }
.menu-user span:last-child { display: flex; flex-direction: column; }
.menu-user strong { font-size: 12.5px; }
.menu-user small { font-size: 11px; color: var(--text-3); }

.menu-panel { width: 320px; padding: 0; }
.menu-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.link { font-size: 12px; font-weight: 500; color: var(--blue); }
.link:hover { text-decoration: underline; }
.notif { position: relative; display: flex; gap: 10px; width: 100%; padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); transition: background .15s; }
.notif:last-child { border-bottom: 0; }
.notif:hover { background: var(--surface-2); }
.notif p { font-size: 12.5px; }
.notif small { font-size: 11px; color: var(--text-3); }
.notif.unread::after { content: ""; position: absolute; right: 14px; top: 16px; width: 7px; height: 7px; border-radius: 50%; background: var(--blue); transition: transform .2s var(--ease); }
.notif.read::after { content: ""; position: absolute; right: 14px; top: 16px; width: 7px; height: 7px; transform: scale(0); }

/* ================= TOASTS ================= */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 130; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px 10px 14px; border-radius: 10px;
  background: var(--ink); color: var(--ink-fg);
  font-size: 12.5px; font-weight: 500; box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(12px) scale(.96);
  transition: opacity .25s, transform .3s var(--ease-out);
}
.toast.show { opacity: 1; transform: none; }
.toast .lucide { width: 15px; height: 15px; color: #7ee2b0; }
.toast.is-error .lucide { color: #ff9a9d; }
.toast.is-info .lucide { color: #93bbff; }
.toast.is-warning .lucide { color: #ffc27a; }
.toast button { margin-left: 6px; padding: 3px 8px; border-radius: 6px; background: rgba(255, 255, 255, .12); font-size: 12px; font-weight: 600; }
.toast button:hover { background: rgba(255, 255, 255, .2); }

/* ================= KEYFRAMES ================= */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@keyframes flash { 0%, 40% { background: var(--green-soft); } 100% { background: transparent; } }

/* ================= RESPONSIVE ================= */
.backdrop {
  position: fixed; inset: 0; z-index: 40;
  background: var(--overlay);
  opacity: 0; visibility: hidden;
  transition: opacity .3s, visibility .3s;
}

@media (max-width: 1200px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1024px) {
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 50;
    transform: translateX(-100%);
    transition: transform .32s cubic-bezier(.32, .72, 0, 1), box-shadow .32s;
  }
  .app.sidebar-open .sidebar { transform: none; box-shadow: 0 10px 40px rgba(0, 0, 0, .16); }
  .app.sidebar-open .backdrop { opacity: 1; visibility: visible; }
  .icon-btn.menu-btn { display: inline-grid; }
}
@media (max-width: 760px) {
  .topbar, .content { padding-left: 16px; padding-right: 16px; }
  /* small screens: breadcrumb shows only the current page (the drawer has the rest) */
  .breadcrumb { min-width: 0; }
  .breadcrumb > :not(.current) { display: none; }
  .breadcrumb .current { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-left { min-width: 0; }
  .topbar-right { gap: 2px; }
  .kpis { grid-template-columns: 1fr; }
  .bar-chart { min-height: 220px; }
  .kpi-value { font-size: 24px; }
  .page-head h1 { font-size: 20px; }
  .bc-group { gap: 3px; }
  .card-head { flex-wrap: wrap; }
  .search.sm { width: 130px; }
  .toasts { left: 16px; right: 16px; align-items: stretch; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
}
@media print {
  .sidebar, .topbar, .page-actions, .table-tools, .toasts { display: none !important; }
}
