/* SATRIA theme layer (wave 10, "bolder" option, navy palette). Visual-system upgrade on the Demo v2 structure.

   LOAD ORDER: linked LAST in base.html, after {% block head %}, so it also follows page sheets (case-workspace.css,
   work-state.css, ownership.css, reports.css ...). Same rail, top bar, cards, tables, chips, queue ledger, case tabs
   and conversation thread; the only markup it relies on is the decorative `tile()` icon span (_ui.html).

   Rules of the layer
   - Tokens first: it redefines the existing token names (tokens.css + the :root block in satria.css) so every older
     component inherits the palette, radii, elevation and motion; layer-only names are prefixed --sat-.
   - Brand colour marks WHERE YOU ARE (hero band, rail item, tabs, current queue view: navy to royal blue);
     cobalt marks WHAT YOU CAN DO (buttons, links, input focus). Semantic colours carry state only.
   - Page headers are one hero band (deep navy to royal blue, soft blue glows, radar rings, blue ramp edge) with white text.
     Every text tier on the band is >= 4.5:1 against its darkest-to-lightest stops.
   - Shadows for elevation, borders for structure; dark mode uses lit top edges instead of black shadows.
   - Data-table headers stay position: static (tables.css contract, tests/test_ui_tables.py); rows never move.
   - Local assets only (IBM Plex woff2 in static/fonts); no url() of any kind, no inline styles.
   - Motion answers a person only: colour/shadow/scale, <= 200 ms, explicit transition properties; no entrance
     animation; satria.css' prefers-reduced-motion rule still switches every transition off.

   Sections
    1. Tokens, light            9. Buttons                    17. Overlays: menus, bell, toasts
    2. Tokens, dark            10. Form fields                18. Notices, empty states
    3. Foundations             11. Hero page header           19. Conversation thread
    4. App shell: rail         12. Case workspace header      20. Sign-in
    5. App shell: top bar      13. Data tables, queue ledger  21. Settings
    6. Surfaces                14. Chips and badges           22. Reports
    7. Icon tiles              15. Charts and bars            23. Mobile (<= 760px)
    8. KPI tiles               16. Tabs                       24. Touch screens, 25. Print */

/* ======================================================================= 1. Tokens, light */
:root {
  /* Brand ramp: navy to sky blue (owner choice 21 Oct, "Navy korporat"). Decoration and charts only; text uses
     --plum-text / --accent-text. The --plum* and --brand-* names are kept from the first wave-10 palette so no
     component changes; their values are blue. Colour that means something stays semantic (red, amber, teal). */
  --brand-yellow: #60a5fa;
  --brand-orange: #3b82f6;
  --brand-red: #2563eb;
  --brand-pink: #1d4ed8;
  --brand-crimson: #1e40af;
  --brand-plum: #1e3a8a;
  --brand-gradient: linear-gradient(90deg, #60a5fa 0%, #3b82f6 20%, #2563eb 40%, #1d4ed8 66%, #1e40af 84%, #1e3a8a 100%);
  --brand-gradient-v: linear-gradient(180deg, #60a5fa 0%, #2563eb 45%, #1d4ed8 100%);
  --sat-brand-fade: linear-gradient(90deg, #1d4ed8 0%, #3b82f6 22%, rgb(56 189 248 / 0.35) 48%, rgb(56 189 248 / 0) 78%);
  --ax-gradient: var(--brand-gradient);
  --ax-accent-text: var(--plum-text);
  --ax-accent-soft: var(--plum-soft);
  /* Original Axiata ramp tokens from requests.css (service-request pages), re-pointed at the navy ramp. */
  --ax-yellow: #60a5fa;
  --ax-orange: #3b82f6;
  --ax-red: #2563eb;
  --ax-pink: #1d4ed8;
  --ax-crimson: #1e40af;
  --ax-plum: #1e3a8a;

  /* Canvas and layered surfaces. */
  --bg: #ebeef4;
  --surface: #ffffff;
  --surface-2: #f6f7fa;
  --surface-3: #eceef4;
  --surface-sunken: #e7eaf1;
  --sat-elevated: #ffffff;
  --border: #dfe3ec;
  --border-strong: #c3cad8;
  --sat-input-border: #b9c1d0;
  --text: #0e1525;
  --text-2: #3b4560;
  --text-3: #5a6480;

  /* Action colour (cobalt). */
  --cobalt: #2457d6;
  --cobalt-strong: #1d46b8;
  --cobalt-text: #1f4fcf;
  --cobalt-soft: #eaf1ff;
  --cobalt-soft-2: #d6e4ff;
  --cobalt-line: #9dbaf5;
  --sat-primary-top: #2f66e6;
  --sat-primary-bottom: #2152c9;
  --sat-primary-glow: rgb(36 87 214 / 0.42);

  /* Place colour (navy; token names kept as --plum*). */
  --plum: #1e3a8a;
  --plum-text: #1e3a8a;
  --plum-soft: #eaf0fe;
  --plum-line: #b9cbf7;
  --accent-text: var(--plum-text);
  --accent-bar: linear-gradient(90deg, #1d4ed8, #1e3a8a);

  /* Semantic. Colour carries meaning only: red = risk/P1/breach, amber = warning/P2, teal = healthy. */
  --teal: #0f8b7f;
  --teal-text: #0a6a5f;
  --teal-soft: #ddf4ef;
  --amber-text: #8f4700;
  --amber-soft: #fff1de;
  --amber-line: #f0b469;
  --red: #d32f2f;
  --red-text: #b3261e;
  --red-soft: #fdecea;
  --red-line: #f2b8b5;
  --sat-p1-top: #d32f2f;
  --sat-p1-bottom: #b3261e;

  --focus: #b45309;
  --focus-on-ink: #fcb434;
  /* Wave 20 (WCAG 2.4.7): the ONE focus ring of the app; --focus is >= 3:1 on every surface of both themes. */
  --focus-ring: 2px solid var(--focus);
  --focus-ring-on-ink: 2px solid var(--focus-on-ink);
  --control-off: #7d88a1;

  /* App shell: deep navy rail with a soft blue glow; the rail fill continues under the sticky rail. */
  --rail-bg:
    radial-gradient(150% 34% at 0% 0%, rgb(59 130 246 / 0.24) 0%, rgb(59 130 246 / 0) 62%),
    radial-gradient(120% 26% at 100% 100%, rgb(36 87 214 / 0.2) 0%, rgb(36 87 214 / 0) 64%),
    linear-gradient(180deg, #0f1e45 0%, #0c1938 48%, #09132c 100%);
  --rail-text: #ddd6ee;
  --rail-muted: #a49cc2;
  --rail-hover: rgb(255 255 255 / 0.07);
  --rail-active: rgb(59 130 246 / 0.18);
  --rail-border: rgb(255 255 255 / 0.07);
  --sat-rail-fill: #09132c;

  /* Hero band (page headers). The first stop is the darkest; text sits on the left two thirds. */
  --sat-hero-base: linear-gradient(112deg, #0a1a3f 0%, #0e2556 34%, #143273 64%, #1b3f94 88%, #1f47a8 100%);
  --sat-hero:
    radial-gradient(560px 230px at 100% 0%, rgb(59 130 246 / 0.36), rgb(59 130 246 / 0) 72%),
    radial-gradient(440px 200px at 86% 118%, rgb(56 189 248 / 0.22), rgb(56 189 248 / 0) 72%),
    radial-gradient(560px 260px at -4% -30%, rgb(67 120 242 / 0.26), rgb(67 120 242 / 0) 70%),
    var(--sat-hero-base);
  --sat-hero-rings: repeating-radial-gradient(circle at 100% 0%, rgb(255 255 255 / 0.08) 0, rgb(255 255 255 / 0.08) 1px, rgb(255 255 255 / 0) 1px, rgb(255 255 255 / 0) 28px);
  --sat-hero-shadow: 0 1px 2px rgb(8 20 52 / 0.25), 0 10px 24px -12px rgb(16 46 112 / 0.55), 0 24px 48px -28px rgb(8 20 52 / 0.6);
  --sat-hero-edge: inset 0 1px 0 rgb(255 255 255 / 0.14), inset 0 0 0 1px rgb(255 255 255 / 0.04);
  --sat-hero-text: #ffffff;
  --sat-hero-text-2: rgb(255 255 255 / 0.86);
  --sat-hero-text-3: rgb(255 255 255 / 0.76);
  --sat-hero-glass: rgb(255 255 255 / 0.12);
  --sat-hero-glass-2: rgb(255 255 255 / 0.2);
  --sat-hero-line: rgb(255 255 255 / 0.26);
  --sat-hero-card-shadow: 0 1px 2px rgb(6 14 36 / 0.28), 0 10px 22px -10px rgb(6 14 36 / 0.55);

  /* Elevation: e0 contact, e1 resting card, e2 raised/hover, e3 popover/menu, e4 dialog/login card. */
  --shadow-1: 0 1px 2px rgb(16 24 40 / 0.07), 0 3px 8px -2px rgb(16 24 40 / 0.07), 0 14px 28px -14px rgb(16 24 40 / 0.22);
  --shadow-2: 0 2px 4px rgb(16 24 40 / 0.07), 0 10px 20px -6px rgb(16 24 40 / 0.14), 0 26px 44px -18px rgb(16 24 40 / 0.32);
  --shadow-3: 0 2px 6px rgb(16 24 40 / 0.06), 0 16px 40px -10px rgb(16 24 40 / 0.24), 0 32px 64px -28px rgb(16 24 40 / 0.22);
  --sat-e4: 0 2px 6px rgb(16 24 40 / 0.08), 0 30px 80px -20px rgb(5 10 26 / 0.6), 0 12px 28px -12px rgb(5 10 26 / 0.4);
  --sat-e0: 0 1px 2px rgb(16 24 40 / 0.07);
  --sat-edge: inset 0 1px 0 rgb(255 255 255 / 0.9);
  --sat-highlight: inset 0 1px 0 rgb(255 255 255 / 0.7);
  --elev-1: var(--shadow-1);
  --elev-2: var(--shadow-2);
  --tint: color-mix(in srgb, var(--cobalt-soft) 45%, var(--surface));
  --tint-strong: color-mix(in srgb, var(--cobalt-soft) 80%, var(--surface));
  --overlay: rgb(6 14 36 / 0.46);

  --sat-canvas: linear-gradient(180deg, #e5ebf6 0, rgb(229 235 246 / 0) 420px);
  --sat-panel-head: linear-gradient(180deg, #f9fafc, #ffffff);
  --sat-chat-bg: linear-gradient(180deg, #f5f6fa, #f1f3f8);
  --sat-well: inset 0 0 0 1px var(--border), inset 0 1px 3px rgb(16 24 40 / 0.05);
  --sat-bubble: 0 1px 2px rgb(16 24 40 / 0.06), 0 6px 16px -10px rgb(16 24 40 / 0.22);
  --sat-dock: 0 -12px 24px -16px rgb(16 24 40 / 0.35);
  --sat-wordmark: linear-gradient(90deg, #0a1a3f 0%, #1e3a8a 52%, #2563eb 100%);

  /* Icon tiles: soft gradient squares, colour by meaning. */
  --tile-info-bg: linear-gradient(140deg, #eef4ff 0%, #d4e2ff 100%);
  --tile-info-fg: #1f4fcf;
  --tile-info-ring: rgb(36 87 214 / 0.2);
  --tile-ok-bg: linear-gradient(140deg, #e7f8f4 0%, #bde9dd 100%);
  --tile-ok-fg: #0a6a5f;
  --tile-ok-ring: rgb(15 139 127 / 0.24);
  --tile-warn-bg: linear-gradient(140deg, #fff5e3 0%, #ffd69b 100%);
  --tile-warn-fg: #8f4700;
  --tile-warn-ring: rgb(236 108 36 / 0.26);
  --tile-risk-bg: linear-gradient(140deg, #fdecea 0%, #f8c4c0 100%);
  --tile-risk-fg: #b3261e;
  --tile-risk-ring: rgb(179 38 30 / 0.22);
  --tile-brand-bg: linear-gradient(140deg, #eef4ff 0%, #cfdeff 100%);
  --tile-brand-fg: #1e3a8a;
  --tile-brand-ring: rgb(30 58 138 / 0.22);
  --tile-shine: inset 0 1px 0 rgb(255 255 255 / 0.75);

  /* Shape. Concentric: hero 16 > panel 12 > control 8 > chip 6/pill. */
  --r-xs: 5px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-pill: 999px;

  /* Motion. */
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --dur-1: 140ms;
  --dur-2: 200ms;
  --dur-3: 260ms;
}

/* ======================================================================= 2. Tokens, dark */
:root[data-theme='dark'] {
  /* requests.css sets its own dark accent; keep the service-request pages on the navy ramp. */
  --ax-accent-text: var(--plum-text);
  --ax-accent-soft: var(--plum-soft);
  --ax-pink: #3b82f6;
  --ax-plum: #2563eb;
  --bg: #0a0d18;
  --surface: #121828;
  --surface-2: #0f1422;
  --surface-3: #1a2133;
  --surface-sunken: #080b14;
  --sat-elevated: #171e31;
  --sat-surface-hi: #172036;
  --border: #252e44;
  --border-strong: #343e58;
  --sat-input-border: #3a4562;
  --text: #e9ecf5;
  --text-2: #b5bcd0;
  --text-3: #8b94ac;

  --cobalt: #3b6ff0;
  --cobalt-strong: #5585ff;
  --cobalt-text: #a9c4ff;
  --cobalt-soft: #162650;
  --cobalt-soft-2: #1e3266;
  --cobalt-line: #3f63c4;
  --sat-primary-top: #3a6ae6;  /* white text 4.79:1 (was #4378f2, 4.03:1); bottom stop 5.38:1 */
  --sat-primary-bottom: #2f62dc;
  --sat-primary-glow: rgb(67 120 242 / 0.4);

  --plum: #2563eb;
  --plum-text: #93c5fd;
  --plum-soft: #12223f;
  --plum-line: #2c4a85;
  --accent-bar: linear-gradient(90deg, #60a5fa, #1d4ed8);

  --teal: #2bb9a6;
  --teal-text: #5fd7c6;
  --teal-soft: #0f3330;
  --amber-text: #f8be74;
  --amber-soft: #2e2213;
  --amber-line: #8a6227;
  --red: #f87171;
  --red-text: #fca5a5;
  --red-soft: #3b1719;
  --red-line: #8f3a36;

  --focus: #fcb434;
  --control-off: #5d6a94;

  --rail-bg:
    radial-gradient(150% 34% at 0% 0%, rgb(59 130 246 / 0.2) 0%, rgb(59 130 246 / 0) 62%),
    radial-gradient(120% 26% at 100% 100%, rgb(36 87 214 / 0.16) 0%, rgb(36 87 214 / 0) 64%),
    linear-gradient(180deg, #0b1633 0%, #09132c 50%, #060d20 100%);
  --rail-border: rgb(255 255 255 / 0.06);
  --sat-rail-fill: #060d20;

  --sat-hero-base: linear-gradient(112deg, #071230 0%, #0a1a44 34%, #0f2660 64%, #143178 88%, #173887 100%);
  --sat-hero:
    radial-gradient(560px 230px at 100% 0%, rgb(59 130 246 / 0.3), rgb(59 130 246 / 0) 72%),
    radial-gradient(440px 200px at 86% 118%, rgb(56 189 248 / 0.16), rgb(56 189 248 / 0) 72%),
    radial-gradient(560px 260px at -4% -30%, rgb(67 120 242 / 0.24), rgb(67 120 242 / 0) 70%),
    var(--sat-hero-base);
  --sat-hero-shadow: 0 1px 2px rgb(0 0 0 / 0.5), 0 16px 36px -18px rgb(0 0 0 / 0.85);
  --sat-hero-edge: inset 0 1px 0 rgb(255 255 255 / 0.12), inset 0 0 0 1px rgb(255 160 210 / 0.1);
  --sat-hero-card-shadow: inset 0 1px 0 rgb(255 255 255 / 0.07), 0 1px 2px rgb(0 0 0 / 0.5), 0 12px 24px -12px rgb(0 0 0 / 0.75);

  --shadow-1: inset 0 1px 0 rgb(255 255 255 / 0.06), 0 0 0 1px rgb(255 255 255 / 0.015), 0 1px 2px rgb(0 0 0 / 0.45), 0 12px 26px -14px rgb(0 0 0 / 0.75);
  --shadow-2: inset 0 1px 0 rgb(255 255 255 / 0.08), 0 0 0 1px rgb(255 255 255 / 0.03), 0 2px 4px rgb(0 0 0 / 0.45), 0 20px 40px -14px rgb(0 0 0 / 0.85);
  --shadow-3: inset 0 1px 0 rgb(255 255 255 / 0.06), 0 0 0 1px rgb(0 0 0 / 0.3), 0 24px 56px -12px rgb(0 0 0 / 0.85);
  --sat-e4: inset 0 1px 0 rgb(255 255 255 / 0.07), 0 0 0 1px rgb(255 255 255 / 0.05), 0 30px 80px -20px rgb(0 0 0 / 0.85);
  --sat-e0: 0 1px 2px rgb(0 0 0 / 0.35);
  --sat-edge: inset 0 1px 0 rgb(255 255 255 / 0.06);
  --sat-highlight: inset 0 1px 0 rgb(255 255 255 / 0.05);
  --elev-1: var(--shadow-1);
  --elev-2: var(--shadow-2);
  --overlay: rgb(3 2 10 / 0.66);

  --sat-canvas: linear-gradient(180deg, #0b1120 0, rgb(11 17 32 / 0) 420px);
  --sat-panel-head: linear-gradient(180deg, #172036, #121828);
  --sat-chat-bg: linear-gradient(180deg, #0d1220, #0b0f1c);
  --sat-well: inset 0 0 0 1px var(--border), inset 0 1px 3px rgb(0 0 0 / 0.3);
  --sat-bubble: inset 0 1px 0 rgb(255 255 255 / 0.05), 0 8px 20px -12px rgb(0 0 0 / 0.8);
  --sat-dock: 0 -12px 24px -14px rgb(0 0 0 / 0.75);
  --sat-wordmark: linear-gradient(90deg, #ffffff 0%, #dbeafe 55%, #93c5fd 100%);

  --tile-info-bg: linear-gradient(140deg, rgb(96 140 255 / 0.36), rgb(67 120 242 / 0.14));
  --tile-info-fg: #c7d8ff;
  --tile-info-ring: rgb(170 196 255 / 0.26);
  --tile-ok-bg: linear-gradient(140deg, rgb(43 185 166 / 0.34), rgb(43 185 166 / 0.12));
  --tile-ok-fg: #8ee8db;
  --tile-ok-ring: rgb(95 215 198 / 0.26);
  --tile-warn-bg: linear-gradient(140deg, rgb(244 148 36 / 0.36), rgb(244 148 36 / 0.12));
  --tile-warn-fg: #ffd08f;
  --tile-warn-ring: rgb(248 190 116 / 0.28);
  --tile-risk-bg: linear-gradient(140deg, rgb(239 68 68 / 0.34), rgb(185 28 28 / 0.14));
  --tile-risk-fg: #fca5a5;
  --tile-risk-ring: rgb(252 165 165 / 0.28);
  --tile-brand-bg: linear-gradient(140deg, rgb(59 130 246 / 0.4), rgb(30 58 138 / 0.16));
  --tile-brand-fg: #bfdbfe;
  --tile-brand-ring: rgb(147 197 253 / 0.28);
  --tile-shine: inset 0 1px 0 rgb(255 255 255 / 0.1);
}

/* ======================================================================= 3. Foundations */
body { font-size: 0.875rem; letter-spacing: -0.003em; -webkit-font-smoothing: antialiased; }
h1 { font-weight: 600; letter-spacing: -0.02em; text-wrap: balance; }
h2, h3 { letter-spacing: -0.006em; }
.num, time, .kpi-value, .rp-kpi strong, .panel-count, .home-count { font-variant-numeric: tabular-nums; }
::selection { background: color-mix(in srgb, var(--brand-pink) 22%, transparent); }
:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }

/* ======================================================================= 4. App shell: rail */
@media (min-width: 761px) {
  .satria-shell { --rail-fill: var(--sat-rail-fill); }
  :root[data-theme='dark'] .satria-shell { --rail-fill: var(--sat-rail-fill); }
}
.rail {
  border-right: 1px solid rgb(0 0 0 / 0.35);
  box-shadow: inset -1px 0 0 rgb(255 255 255 / 0.04);
  scrollbar-color: rgb(255 255 255 / 0.16) transparent;
}
.rail-nav { scrollbar-width: thin; }
.rail-brand { border-bottom-color: var(--rail-border); }
.satria-shell .wordmark-text { font-weight: 700; letter-spacing: 0.14em; }
.rail-group-label { color: var(--rail-muted); letter-spacing: 0.02em; }
.rail-link { border-radius: 9px; color: var(--rail-text); }
.rail-link:hover { background: var(--rail-hover); color: #fff; }
/* Current page: unmistakable at a glance. Pink-to-plum fill with a lit edge and an ember glow, a 4 px brand bar
   on the rail edge, pink icon, white semibold label. */
.rail-link::before { left: -10px; top: 7px; bottom: 7px; width: 4px; background: var(--brand-gradient-v); }
.rail-link.is-active {
  background: linear-gradient(90deg, rgb(59 130 246 / 0.5) 0%, rgb(30 64 175 / 0.34) 46%, rgb(30 58 138 / 0.18) 100%);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgb(147 197 253 / 0.24), inset 0 1px 0 rgb(255 255 255 / 0.12), 0 8px 18px -10px rgb(59 130 246 / 0.75);
}
.rail-link.is-active::before { box-shadow: 0 0 10px rgb(59 130 246 / 0.85); }
.rail-link.is-active .ico { color: #bfdbfe; opacity: 1; }
.rail-link:active { background: rgb(255 255 255 / 0.1); }
.rail-footer { border-top-color: var(--rail-border); }
.rail-pilot { background: rgb(255 255 255 / 0.04); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.06); }
.rail-collapse:hover, .rail-close:hover { background: var(--rail-hover); }

/* Main column: a faint plum wash under the hero band, so the band does not sit on a cold grey. */
.main-column { background: var(--sat-canvas); background-repeat: no-repeat; background-size: 100% 420px; }

/* ======================================================================= 5. App shell: top bar */
.topbar, .satria-topbar {
  border-bottom-color: transparent;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  box-shadow: 0 1px 0 var(--border), 0 10px 24px -20px rgb(16 24 40 / 0.5);
}
:root[data-theme='dark'] .satria-topbar { background: color-mix(in srgb, var(--surface) 72%, transparent); box-shadow: 0 1px 0 var(--border), 0 10px 24px -18px rgb(0 0 0 / 0.8); }
.topbar::after { height: 2px; bottom: -1px; background: var(--brand-gradient); opacity: 0.95; }
.satria-breadcrumb { font-weight: 600; letter-spacing: -0.005em; }
.data-mode { border: 0; background: var(--surface-2); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--border); font-weight: 600; }
.user-trigger { border-color: var(--border); background: var(--surface); box-shadow: var(--sat-e0); }
.user-trigger:hover { border-color: var(--border-strong); }
.user-initials { background: linear-gradient(135deg, #3b6ff0 0%, #2563eb 55%, #1e3a8a 100%); color: #fff; box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.25); }
.person-cell .user-initials { background: var(--cobalt-soft); color: var(--cobalt-text); box-shadow: inset 0 0 0 1px var(--cobalt-line); }
.bell-count { background: linear-gradient(180deg, #d32f2f, #b3261e); color: #fff; box-shadow: 0 0 0 2px var(--surface); }

/* ======================================================================= 6. Surfaces */
.panel, .card, .rq-ledger, .rq-group, .email-card, .settings-nav, .case-progress, .rp-filter, .draft-preview {
  border-color: var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-1);
}
.panel, .card, .rq-ledger, .rq-group, .email-card, .settings-nav, .case-progress, .rp-filter { background: var(--surface); }
:root[data-theme='dark'] :is(.panel, .card, .rq-ledger, .rq-group, .email-card, .settings-nav, .case-progress, .rp-filter) {
  background: linear-gradient(180deg, var(--sat-surface-hi) 0, var(--surface) 160px);
}
.panel-header {
  --panel-head-lead: 44px; /* where the title text starts: the 34 px tile, its -2 px margin and the 12 px gap */
  flex-wrap: wrap;
  row-gap: 8px;
  padding: 14px 18px;
  border-bottom-color: var(--border);
  border-radius: var(--r-md) var(--r-md) 0 0;
  background: var(--sat-panel-head);
  box-shadow: var(--sat-edge);
}
.panel-header h2, .panel > h2, .card > h2 { font-size: 0.9375rem; font-weight: 600; letter-spacing: -0.008em; }
.panel-description { color: var(--text-3); }
.panel-body, .panel-pad { padding: 16px 18px; }
.panel-footer { background: var(--surface-2); border-top-color: var(--border); }
.panel-count, .tab-badge { height: 20px; padding: 0 7px; border-radius: var(--r-pill); background: var(--surface-3); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--border); font-weight: 600; }
.table-scroll { border-color: var(--border); border-radius: var(--r-md); }
.panel > .table-scroll, .rq-ledger .table-scroll { border: 0; }
/* Hover lift for cards that ARE links (KPI and report tiles): shadow and edge only, never size or position. */
a.kpi-button, a.rp-kpi { transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-2) var(--ease), background-color var(--dur-1) var(--ease); }

/* ======================================================================= 7. Icon tiles */
/* Decorative (aria-hidden) gradient squares with the sprite icon; tone = what the section is about. */
.icon-tile {
  --tile-bg: var(--tile-info-bg);
  --tile-fg: var(--tile-info-fg);
  --tile-ring: var(--tile-info-ring);
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--tile-bg);
  color: var(--tile-fg);
  box-shadow: inset 0 0 0 1px var(--tile-ring), var(--tile-shine), 0 1px 2px rgb(16 24 40 / 0.08), 0 4px 10px -6px var(--tile-ring);
}
.icon-tile .ico { width: 18px; height: 18px; stroke-width: 1.9; }
.tile-ok { --tile-bg: var(--tile-ok-bg); --tile-fg: var(--tile-ok-fg); --tile-ring: var(--tile-ok-ring); }
.tile-warn { --tile-bg: var(--tile-warn-bg); --tile-fg: var(--tile-warn-fg); --tile-ring: var(--tile-warn-ring); }
.tile-risk { --tile-bg: var(--tile-risk-bg); --tile-fg: var(--tile-risk-fg); --tile-ring: var(--tile-risk-ring); }
.tile-brand { --tile-bg: var(--tile-brand-bg); --tile-fg: var(--tile-brand-fg); --tile-ring: var(--tile-brand-ring); }
/* In a panel header the tile leads the title block; the text block takes the free width. Wave 38b (owner 28 Nov 2026):
   a badge or buttons after the title never squeeze it. The header wraps (above): the title block keeps a 13rem basis
   (a fixed basis, so a long description never pushes the badge down in a wide panel), and a trailing item that no
   longer fits takes its own line, starting under the title text. In the 340 px case side column the Automation panel
   showed its description one word per line beside "Completed by SATRIA: e-mail held". */
.panel-header > .icon-tile { align-self: flex-start; margin: 1px -2px 0 0; }
.panel-header > .icon-tile + div { flex: 1 1 13rem; min-width: 0; }
.panel-header > .icon-tile + div + * { margin-left: var(--panel-head-lead); }
.panel-header > :where(:first-child:not(.icon-tile):not(:only-child)) { flex: 1 1 13rem; min-width: 0; }
.settings-section > .panel-header > .icon-tile + div { flex: 1 1 320px; }

/* ======================================================================= 8. KPI tiles (Home, SLA alerts) */
.kpi-strip { gap: 12px; margin-top: 18px; border: 0; border-radius: 0; background: none; box-shadow: none; overflow: visible; }
.kpi-strip > .kpi, .kpi-strip > .kpi:last-child {
  --kpi-accent: linear-gradient(90deg, #1e3a8a 0%, #1d4ed8 55%, #3b82f6 100%);
  --kpi-glow: rgb(37 99 235 / 0.09);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 16px 18px 15px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}
.kpi-strip > .kpi:has(> .icon-tile) { padding-right: 62px; }
.kpi-strip > .kpi::before { content: ''; position: absolute; inset: 0 0 auto; height: 3px; background: var(--kpi-accent); }
/* Tinted sparkle: a soft glow of the tile's colour behind the icon corner. */
.kpi-strip > .kpi::after {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  background: radial-gradient(200px 120px at 100% 0%, var(--kpi-glow), transparent 72%), linear-gradient(180deg, color-mix(in srgb, var(--kpi-glow) 45%, transparent) 0, transparent 60%);
  pointer-events: none;
}
.kpi-strip > .kpi > .icon-tile { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border-radius: 11px; }
.kpi-strip > .kpi > .icon-tile .ico { width: 19px; height: 19px; }
.kpi-strip > .kpi:has(> .tile-ok), .kpi-strip > .kpi.kpi-teal { --kpi-accent: linear-gradient(90deg, #1e3a8a 0%, #1d4ed8 55%, #3b82f6 100%); --kpi-glow: rgb(37 99 235 / 0.09); }
.kpi-strip > .kpi:has(> .tile-brand) { --kpi-accent: linear-gradient(90deg, #1e3a8a 0%, #1d4ed8 55%, #3b82f6 100%); --kpi-glow: rgb(37 99 235 / 0.09); }
.kpi-strip > .kpi:has(> .tile-warn), .kpi-strip > .kpi.kpi-amber { --kpi-accent: linear-gradient(90deg, #1e3a8a 0%, #1d4ed8 55%, #3b82f6 100%); --kpi-glow: rgb(37 99 235 / 0.09); }
.kpi-strip > .kpi:has(> .tile-risk), .kpi-strip > .kpi.kpi-red { --kpi-accent: linear-gradient(90deg, #b3261e, #e53935); --kpi-glow: rgb(211 47 47 / 0.10); }
:root[data-theme='dark'] .kpi-strip > .kpi { background: linear-gradient(180deg, var(--sat-surface-hi), var(--surface)); }
.kpi-strip .kpi-label { color: var(--text-2); font-size: 0.75rem; font-weight: 600; }
.kpi-strip .kpi-value { margin-top: 4px; font-size: 2rem; font-weight: 600; line-height: 1.05; letter-spacing: -0.03em; }
.kpi-strip .kpi-hint { color: var(--text-3); font-size: 0.72rem; }

/* One colour family for KPI cards: neutral numbers, navy icon tiles; only risk/breach KPIs turn red. */
.kpi-strip .kpi-value, .home-kpis .kpi-value, .rp-kpi strong { color: var(--text); }
.kpi-strip > .kpi:has(> .tile-risk) .kpi-value, .kpi-strip > .kpi.kpi-red .kpi-value, .rp-kpi.rp-kpi-breach strong { color: var(--red-text); }
.kpi-strip > .kpi > .icon-tile:not(.tile-risk), .home-kpis .icon-tile:not(.tile-risk) {
  background: var(--tile-info-bg); color: var(--tile-info-fg); box-shadow: var(--tile-shine), 0 0 0 1px var(--tile-info-ring);
}
.kpi-strip > a.kpi-button:hover, .home-kpis a.kpi-button:hover { background: var(--surface); border-color: var(--border-strong); box-shadow: var(--shadow-2); }
:root[data-theme='dark'] .kpi-strip > a.kpi-button:hover { background: linear-gradient(180deg, var(--sat-elevated), var(--surface)); border-color: #3a4562; }
.kpi-strip > a.kpi-button:active { background: var(--surface-2); }
.home-kpis .kpi-value { font-size: 2rem; }

/* ======================================================================= 9. Buttons */
.btn {
  border-radius: var(--r-sm);
  font-weight: 600;
  letter-spacing: -0.004em;
  box-shadow: var(--sat-e0);
  transition-property: background-color, border-color, color, box-shadow, transform;
  transition-duration: var(--dur-1);
  transition-timing-function: var(--ease);
}
.btn:active:not(:disabled) { transform: scale(0.96); }
.case-ws .btn:active:not(:disabled) { transform: none; } /* case-workspace.css already presses with `scale` */
@media (prefers-reduced-motion: reduce) { .btn:active:not(:disabled) { transform: none; } }
:root[data-theme='dark'] .btn:not(.btn-primary, .btn-ghost, .btn-danger) { --btn-bg: color-mix(in srgb, var(--surface-3) 75%, var(--surface)); --btn-border: var(--border-strong); box-shadow: var(--sat-highlight), var(--sat-e0); }
:root[data-theme='dark'] .btn:not(.btn-primary, .btn-ghost, .btn-danger):hover { --btn-bg: var(--surface-3); --btn-border: #46526f; }
.btn-primary {
  --btn-fg: #fff;
  --btn-border: var(--sat-primary-bottom);
  background: linear-gradient(180deg, var(--sat-primary-top) 0%, var(--sat-primary-bottom) 100%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.2), 0 1px 2px rgb(23 37 128 / 0.3), 0 6px 14px -6px var(--sat-primary-glow);
}
.btn-primary:hover { --btn-border: var(--cobalt-strong); background: linear-gradient(180deg, #4560ea 0%, #2457d6 100%); box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.22), 0 1px 2px rgb(23 37 128 / 0.3), 0 8px 18px -6px var(--sat-primary-glow); }
:root[data-theme='dark'] .btn-primary:hover { background: linear-gradient(180deg, #4b6aec 0%, #3463de 100%); }  /* 4.59 and 5.27:1 with white */
.btn-primary:disabled, .btn-primary[aria-disabled='true'] { box-shadow: none; }
.btn-ghost, .btn-ghost:hover { box-shadow: none; }
.btn-danger { --btn-fg: var(--red-text); --btn-border: color-mix(in srgb, var(--red-line) 80%, transparent); }
.btn-danger:hover { --btn-bg: var(--red-soft); --btn-border: var(--red); }
.btn-sm { border-radius: 7px; }
.link-btn, a { text-underline-offset: 3px; }

/* ======================================================================= 10. Form fields */
.input, .select, .textarea, .search-box,
.field :is(input:not([type='checkbox'], [type='radio'], [type='hidden']), select):not(.input, .select, .textarea),
.auto-field :is(input, select, textarea), .card textarea:not(.textarea), .thread-compose textarea {
  border-color: var(--sat-input-border);
  border-radius: var(--r-sm);
  background-color: var(--surface);
  box-shadow: inset 0 1px 2px rgb(16 24 40 / 0.05);
}
:root[data-theme='dark'] :is(.input, .select, .textarea, .search-box, .auto-field :is(input, select, textarea), .thread-compose textarea) { background-color: var(--surface-2); box-shadow: inset 0 1px 2px rgb(0 0 0 / 0.35); }
.input:hover, .select:hover, .textarea:hover, .search-box:hover { border-color: var(--text-3); }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible, .search-box:focus-within,
.auto-field :is(input, select, textarea):focus-visible, .thread-compose textarea:focus-visible {
  outline: none;
  border-color: var(--cobalt);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cobalt) 24%, transparent), inset 0 1px 2px rgb(16 24 40 / 0.04);
}
.field-label, .auto-field, .thread-compose label { color: var(--text-2); }
.auto-form { border-color: var(--border); border-radius: var(--r-md); background: var(--surface-2); box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.6); }
:root[data-theme='dark'] .auto-form { box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.03); }

/* ======================================================================= 11. Hero page header */
/* One band for every page header: the page_header() macro and Home (.page-header), the Settings, intake and
   Reports headers (.page-head). The band is the element's own background (so text contrast is measured against
   it); ::before draws radar rings from the top-right corner, ::after the Axiata ramp along the bottom edge. */
.page-header, .page-head {
  position: relative;
  isolation: isolate;
  overflow: clip;
  margin-bottom: 18px;
  padding: 22px 26px 24px;
  border-radius: var(--r-lg);
  background: var(--sat-hero);
  color: var(--sat-hero-text);
  box-shadow: var(--sat-hero-edge), var(--sat-hero-shadow);
}
.page-header::before, .page-head::before, .case-ws .case-head::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  background: var(--sat-hero-rings);
  -webkit-mask-image: radial-gradient(circle at 100% 0%, #000 0, rgb(0 0 0 / 0.55) 220px, transparent 470px);
  mask-image: radial-gradient(circle at 100% 0%, #000 0, rgb(0 0 0 / 0.55) 220px, transparent 470px);
  pointer-events: none;
}
.page-header::after, .page-head::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  background: var(--brand-gradient);
  pointer-events: none;
}
.page-header h1, .page-head h1, .case-ws .case-title-row h1 {
  color: var(--sat-hero-text);
  font-size: 1.625rem;
  line-height: 1.18;
  font-weight: 600;
  letter-spacing: -0.024em;
  text-shadow: 0 1px 2px rgb(6 14 36 / 0.3);
}
.page-header .page-description, .page-head p, .case-ws .case-title-row .drawer-meta { color: var(--sat-hero-text-2); }
.page-header .page-description { margin-top: 6px; font-size: 0.84rem; }
.page-header .page-context, .case-ws .case-title-row .page-context { color: var(--sat-hero-text-3); }
.page-header :is(.page-description, .page-context) a:not(.btn, .scope-chip), .page-head p a, .case-ws .case-title-row .page-context a { color: #fff; text-decoration: underline; text-decoration-color: rgb(255 255 255 / 0.5); }
.page-head { gap: 8px; }
.page-head h1 + p { margin-top: 6px; }
.page-head p { max-width: 82ch; font-size: 0.84rem; }
.page-head .auto-id { color: var(--sat-hero-text-3); }
.rq-page > .page-header { margin-bottom: 16px; }
.queue-page .page-header { margin-bottom: 16px; }
/* Scope chip: frosted pill on the band; pink-tinted when the view is narrowed to some organisations. */
.scope-chip { height: 24px; padding: 0 10px 0 8px; border-radius: var(--r-pill); background: var(--surface); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--border), var(--sat-e0); }
.scope-chip.is-scoped { background: var(--plum-soft); color: var(--plum-text); box-shadow: inset 0 0 0 1px var(--plum-line); }
.page-header .scope-chip { background: var(--sat-hero-glass); color: #fff; font-weight: 600; box-shadow: inset 0 0 0 1px var(--sat-hero-line); }
.page-header .scope-chip.is-scoped { background: rgb(59 130 246 / 0.3); box-shadow: inset 0 0 0 1px rgb(191 219 254 / 0.45); }
/* KPI tiles that live inside the band (Home): lifted white cards with a plum-tinted drop; text returns to the
   surface colours (the tiles are links, so they would inherit the band's white). */
.page-header .kpi-strip > .kpi { border-color: transparent; color: var(--text); text-decoration: none; box-shadow: var(--sat-hero-card-shadow); }
.page-header .kpi-strip > a.kpi-button:hover { border-color: transparent; box-shadow: 0 0 0 1px rgb(255 255 255 / 0.5), 0 2px 4px rgb(6 14 36 / 0.3), 0 18px 34px -14px rgb(6 14 36 / 0.7); }
:root[data-theme='dark'] .page-header .kpi-strip > a.kpi-button:hover { box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.1), 0 0 0 1px rgb(191 219 254 / 0.22), 0 18px 34px -14px rgb(0 0 0 / 0.85); }
.page-header .kpi-strip > a.kpi-button:focus-visible { outline: var(--focus-ring-on-ink); outline-offset: 2px; }
/* Controls on the band: secondary = frosted glass, primary = white with plum ink, ghost = white text. */
:is(.page-header, .page-head, .case-ws .case-title-row) .btn:not(.btn-primary, .btn-ghost, .btn-danger) {
  --btn-bg: var(--sat-hero-glass);
  --btn-fg: #fff;
  --btn-border: var(--sat-hero-line);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.14), 0 1px 2px rgb(6 14 36 / 0.2);
}
:is(.page-header, .page-head, .case-ws .case-title-row) .btn:not(.btn-primary, .btn-ghost, .btn-danger):hover { --btn-bg: var(--sat-hero-glass-2); --btn-border: rgb(255 255 255 / 0.42); }
:is(.page-header, .page-head, .case-ws .case-title-row) .btn-primary {
  --btn-fg: #0a1a3f;
  --btn-border: transparent;
  background: linear-gradient(180deg, #ffffff 0%, #f4eef8 100%);
  box-shadow: inset 0 -1px 0 rgb(42 17 69 / 0.1), 0 1px 2px rgb(6 14 36 / 0.3), 0 8px 18px -8px rgb(6 14 36 / 0.65);
}
:is(.page-header, .page-head, .case-ws .case-title-row) .btn-primary:hover { --btn-border: transparent; background: #ffffff; box-shadow: inset 0 -1px 0 rgb(42 17 69 / 0.1), 0 2px 4px rgb(6 14 36 / 0.3), 0 12px 24px -8px rgb(6 14 36 / 0.7); }
:is(.page-header, .page-head, .case-ws .case-title-row) .btn-ghost { --btn-fg: #fff; --btn-border: transparent; }
:is(.page-header, .page-head, .case-ws .case-title-row) .btn-ghost:hover { --btn-bg: var(--sat-hero-glass); --btn-fg: #fff; }
:is(.page-header, .page-head, .case-ws .case-title-row) :focus-visible { outline-color: var(--focus-on-ink); }
:is(.page-header, .page-head, .case-ws .case-title-row) .btn[aria-disabled='true'], :is(.page-header, .page-head, .case-ws .case-title-row) .btn:disabled { opacity: 0.6; }

/* ======================================================================= 12. Case workspace header */
/* The case header is the same band as every page header, as one hero card: identity, title, chips and actions
   on the band; the progress strip is its light footer under a brand ramp line. */
.case-ws .case-head {
  position: relative;
  isolation: isolate;
  gap: 14px;
  padding: 20px 24px 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--r-lg);
  background: var(--sat-hero);
  color: var(--sat-hero-text);
  box-shadow: var(--sat-hero-edge), var(--sat-hero-shadow);
}
.case-ws .case-title-row .back-link { color: var(--sat-hero-text-3); }
.case-ws .case-title-row .back-link:hover { color: #fff; }
.case-ws .case-title-row .page-context > * + *::before { background: rgb(255 255 255 / 0.32); }
/* Chips carry their own edge, so the hairline separator is drawn only between plain text items. */
.case-ws .case-title-row .page-context > :is(.case-id, .ticket-ref)::before { display: none; }
.case-ws .case-title-row .case-id, .case-ws .case-title-row .ticket-ref {
  background: var(--sat-hero-glass);
  color: #fff;
  box-shadow: inset 0 0 0 1px var(--sat-hero-line);
}
.case-ws .case-title-row .ticket-ref { background: rgb(43 185 166 / 0.26); box-shadow: inset 0 0 0 1px rgb(150 240 225 / 0.4); }
.case-ws .case-title-row .drawer-meta :is(.status, .readiness-badge, .prio, .badge) { box-shadow: 0 0 0 1px rgb(255 255 255 / 0.18), 0 1px 2px rgb(6 14 36 / 0.25); }
.case-ws .case-title-row .drawer-meta .prio-p1 { box-shadow: 0 0 0 1px rgb(255 190 210 / 0.5), 0 2px 6px rgb(6 14 36 / 0.35); }
.case-ws .case-head > .case-progress {
  margin: 0 -24px;
  padding: 12px 24px;
  border: 0;
  border-top: 3px solid transparent;
  border-image: var(--brand-gradient) 1;
  border-radius: 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: none;
}
:root[data-theme='dark'] .case-ws .case-head > .case-progress { background: var(--surface-2); }
.case-progress { padding: 12px 16px; }
.mail { border-color: var(--border); border-radius: var(--r-md); background: var(--surface-sunken); box-shadow: inset 0 1px 3px rgb(16 24 40 / 0.06); }
.mail-head { background: var(--surface-2); }
.mail-paper { border-radius: 6px; box-shadow: 0 0 0 1px rgb(16 24 40 / 0.06), 0 2px 4px rgb(16 24 40 / 0.06), 0 16px 32px -16px rgb(16 24 40 / 0.3); }
:root[data-theme='dark'] .mail-paper { box-shadow: 0 0 0 1px rgb(0 0 0 / 0.4), 0 18px 36px -14px rgb(0 0 0 / 0.8); }
.draft-preview { border-left-width: 1px; box-shadow: inset 4px 0 0 var(--cobalt), var(--shadow-1); }
.draft-preview.is-ready { box-shadow: inset 4px 0 0 var(--teal), var(--shadow-1); }
.draft-preview.is-not-ready { box-shadow: inset 4px 0 0 var(--amber-line), var(--shadow-1); }

/* ======================================================================= 13. Data tables, queue ledger */
.data-table th, .rq-table th, .table-wrap th, .satria-table th, .settings-table th {
  position: static;
  background: var(--surface-2);
  color: var(--text-3);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-bottom: 1px solid var(--border);
}
.data-table td, .rq-table td, .table-wrap td { border-bottom-color: var(--border); }
.data-table tbody tr, .rq-row { transition: background-color var(--dur-1) var(--ease); }
.data-table tbody tr:hover, .rq-row:hover, .table-wrap tbody tr:hover { background: color-mix(in srgb, var(--cobalt-soft) 42%, var(--surface)); }
.data-table tbody tr:hover > td:first-child, .rq-row:hover > td:first-child { box-shadow: inset 3px 0 0 var(--cobalt); }
.data-table.is-static tbody tr:hover > td:first-child, .users-table tbody tr:hover > td:first-child,
.activity-table tbody tr:hover > td:first-child, .admin-layout .data-table tbody tr:hover > td:first-child { box-shadow: none; }
.data-table tbody tr.is-selected, .data-table tbody tr:has(.bulk-pick:checked) { background: color-mix(in srgb, var(--cobalt-soft) 75%, var(--surface)); }
.row-title { color: var(--text); font-weight: 600; letter-spacing: -0.004em; }
.row-title:hover { color: var(--cobalt-text); }
.row-sub, .rq-meta { color: var(--text-3); }
.queue-row.is-finished td { color: var(--text-2); }

/* Queue ledger: view chips as a segmented band, current view = raised pill with a plum count. */
.case-ws .queue-views { gap: 2px; padding: 9px 12px; border-bottom: 1px solid var(--border); background: var(--sat-panel-head); border-radius: var(--r-md) var(--r-md) 0 0; }
.case-ws .queue-view {
  height: 30px;
  padding: 0 7px 0 11px;
  gap: 5px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text-2);
  font-weight: 600;
}
.case-ws .queue-view:hover { border-color: transparent; background: var(--surface-3); color: var(--text); }
.case-ws .queue-view .num { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-pill); background: var(--surface-3); color: var(--text-2); font-size: 0.6875rem; }
.case-ws .queue-view[aria-current='page'] { border-color: var(--plum-line); background: var(--surface); color: var(--text); box-shadow: var(--sat-e0), 0 3px 10px -4px rgb(30 58 138 / 0.35); }
:root[data-theme='dark'] .case-ws .queue-view[aria-current='page'] { background: var(--sat-elevated); }
.case-ws .queue-view[aria-current='page'] .num { background: linear-gradient(180deg, #2563eb, #1e3a8a); color: #fff; }
.rq-views a[aria-current='page'] { border-bottom-color: var(--brand-pink); }
.rq-filters { background: var(--surface-2); border-bottom-color: var(--border); }
.rq-control label, .rp-period legend, .rp-field > span { color: var(--text-2); font-size: 0.72rem; font-weight: 600; }

/* ======================================================================= 14. Chips and badges */
/* Priority: one look for the shared priority() macro and the older .priority-chip; P1 is the only solid chip. */
.prio, .priority-chip {
  height: 22px;
  min-width: 30px;
  padding: 0 7px;
  border: 0;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  justify-content: center;
}
.prio-p1, .priority-chip.priority-p1 { background: linear-gradient(180deg, var(--sat-p1-top), var(--sat-p1-bottom)); color: #fff; box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.2), 0 1px 2px rgb(168 31 72 / 0.35), 0 0 0 1px rgb(150 24 62 / 0.35); }
.prio-p2, .priority-chip.priority-p2 { background: var(--amber-soft); color: var(--amber-text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--amber-line) 75%, transparent); }
.prio-p3, .priority-chip.priority-p3 { background: var(--cobalt-soft); color: var(--cobalt-text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cobalt-line) 70%, transparent); }
.prio-p4, .priority-chip.priority-p4 { background: var(--surface-3); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--border); }

/* Work state (primary chip), lifecycle (muted), signals. Ring = currentColor at low alpha; the dot has a halo. */
.readiness-badge { height: 22px; padding: 0 9px 0 8px; border-radius: var(--r-pill); font-weight: 600; box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 22%, transparent); }
.readiness-badge::before { width: 6px; height: 6px; box-shadow: 0 0 0 2.5px color-mix(in srgb, currentColor 20%, transparent); }
.readiness-badge.readiness-shared { background: var(--plum-soft); color: var(--plum-text); }
.status, .gate, .role-badge, .overdue-chip, .ticket-state, .urg-high, .urg-critical { box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 20%, transparent); }
.status { border-color: transparent; }
:where(:root[data-theme='dark']) .status-in_progress { background: #3a6ae6; }  /* white text 4.79:1 (was #3b6ff0, 4.45:1); the base chip's weight, so the muted lifecycle chips keep theirs */
.status.chip-lifecycle, .chip-lifecycle .status, .queue-row td[data-label='Status'] .status, .home-table .col-state .status { box-shadow: inset 0 0 0 1px var(--border); }
.gate::before, .status::before { box-shadow: 0 0 0 2.5px color-mix(in srgb, currentColor 18%, transparent); }
.gate-off { box-shadow: inset 0 0 0 1px var(--border-strong); }
.role-badge, .overdue-chip, .case-ws .ticket-state { border-color: transparent; }
.badge { height: 22px; border-radius: 6px; font-weight: 600; box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 18%, transparent); }
.badge.signal-sla-breached { background: linear-gradient(180deg, var(--sat-p1-top), var(--sat-p1-bottom)); color: #fff; box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.18), 0 1px 2px rgb(168 31 72 / 0.3); }
.tag, .rq-code { border-color: transparent; border-radius: var(--r-xs); background: var(--surface-3); color: var(--text-2); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--border) 70%, transparent); }
.case-id, .case-ws .case-id { border-radius: var(--r-xs); background: var(--cobalt-soft); color: var(--cobalt-text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cobalt-line) 55%, transparent); }
.ticket-ref { border-radius: var(--r-xs); }
.case-ws .reply-dot { background: var(--brand-pink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-pink) 22%, transparent); }
.owner-initials { background: var(--cobalt-soft); color: var(--cobalt-text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cobalt-line) 70%, transparent); }
.filter-chip { border-color: color-mix(in srgb, var(--cobalt-line) 70%, transparent); }

/* ======================================================================= 15. Charts and bars */
/* Home priority bars: the Axiata ramp for the urgent end (P1 plum-crimson-pink, P2 orange-yellow) and the chip's own
   cobalt for P3, so a bar always matches the colour of the priority chip beside it. */
.bar { height: 9px; border-radius: var(--r-pill); background: var(--surface-3); box-shadow: inset 0 1px 1px rgb(16 24 40 / 0.07); }
.bar::-webkit-progress-bar { border-radius: var(--r-pill); background: var(--surface-3); }
.bar::-webkit-progress-value { border-radius: var(--r-pill); background: var(--bar); }
.bar::-moz-progress-bar { border-radius: var(--r-pill); background: var(--bar); }
.bar-p1 { --bar: linear-gradient(90deg, #b3261e, #e53935); }
.bar-p2 { --bar: linear-gradient(90deg, #c2410c, #f59e0b); }
.bar-p3 { --bar: linear-gradient(90deg, #2457d6, #2563eb); }
.bar-p4 { --bar: color-mix(in srgb, var(--text-3) 60%, transparent); }
.home-bars a:hover, .home-row:hover { background: var(--surface-2); }
.home-list .home-row .home-count { background: var(--surface); box-shadow: inset 0 0 0 1px var(--border), var(--sat-e0); }
.home-list .home-row:not(.is-zero) .home-count { background: var(--plum-soft); color: var(--plum-text); box-shadow: inset 0 0 0 1px var(--plum-line); }
/* Section separators on Home: a thin brand ramp under each panel header that fades out to the right. */
.home-grid .panel-header { border-bottom: 1px solid transparent; border-image: var(--sat-brand-fade) 1; }

/* ======================================================================= 16. Tabs */
.tab-list { border-bottom-color: var(--border); }
.tab-trigger { color: var(--text-2); font-weight: 600; }
.tab-trigger:hover { color: var(--text); }
.tab-trigger[data-state='active'], .case-ws .tab-trigger[data-state='active'] { color: var(--text); }
.tab-trigger[data-state='active'] .ico { color: var(--accent-text); }
.tab-indicator { height: 2px; background: var(--accent-bar); }
.case-ws .tab-trigger[data-state='active']::after { left: 6px; right: 6px; height: 3px; border-radius: 3px 3px 0 0; background: var(--accent-bar); box-shadow: 0 -2px 10px -1px color-mix(in srgb, var(--brand-pink) 55%, transparent); }
.tab-trigger[data-state='active'] .tab-badge { background: var(--plum-soft); color: var(--plum-text); box-shadow: inset 0 0 0 1px var(--plum-line); }
.case-tabs .tab-list, .case-ws .tab-list { background: var(--sat-panel-head); border-radius: var(--r-md) var(--r-md) 0 0; }
.email-tab.is-current { border-color: var(--plum-line); background: var(--plum-soft); color: var(--plum-text); box-shadow: inset 0 -2px 0 var(--plum); }
.email-tab.is-current small { color: var(--plum-text); }

/* ======================================================================= 17. Overlays: menus, bell, toasts */
.menu, .user-menu-panel, .bell-popover, .scope-popover {
  border-color: var(--border);
  border-radius: var(--r-md);
  background: var(--sat-elevated);
  box-shadow: var(--shadow-3);
}
.menu-item:hover, .menu-item:focus-visible, .bell-item:hover, .bell-item:focus-visible { background: var(--cobalt-soft); color: var(--cobalt-text); }
.toast { border-color: var(--border); border-radius: var(--r-md); background: var(--sat-elevated); box-shadow: inset 3px 0 0 var(--toast-accent, var(--cobalt)), var(--shadow-3); }
.toast-success { --toast-accent: var(--teal); }
.toast-error { --toast-accent: var(--red); border-color: var(--border); }
.toast-warning { --toast-accent: var(--amber-line); }

/* ======================================================================= 18. Notices, empty states */
.callout, .notice, .inline-error, .draft-issues { border-radius: var(--r-sm); }
.callout { box-shadow: inset 3px 0 0 var(--cobalt-line); }
.callout-warning, .draft-issues { box-shadow: inset 3px 0 0 var(--amber-line); }
.inline-error, .notice-error { box-shadow: inset 3px 0 0 var(--red); }
.inline-info { box-shadow: inset 3px 0 0 var(--cobalt); }
/* Empty states use the brand icon tile, so an empty list still reads as part of the product. */
.empty-icon, .rq-empty > .ico {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: var(--tile-brand-bg);
  color: var(--tile-brand-fg);
  box-shadow: inset 0 0 0 1px var(--tile-brand-ring), var(--tile-shine), 0 6px 14px -8px var(--tile-brand-ring);
}
.empty-icon .ico { width: 21px; height: 21px; stroke-width: 1.9; }
.empty-title, .rq-empty-title { letter-spacing: -0.008em; }

/* ======================================================================= 19. Conversation thread (same bubbles, more depth) */
.thread { padding: 16px; border-radius: var(--r-md); background: var(--sat-chat-bg); box-shadow: var(--sat-well); }
.thread-msg { padding: 11px 15px 12px; border-radius: 16px; box-shadow: var(--sat-bubble); }
.thread-msg[data-side='soc'] { border-color: color-mix(in srgb, var(--cobalt-line) 60%, transparent); background: linear-gradient(180deg, color-mix(in srgb, var(--cobalt-soft) 85%, var(--surface)), color-mix(in srgb, var(--cobalt-soft) 55%, var(--surface))); }
.thread-msg[data-side='client'] { border-color: color-mix(in srgb, var(--teal) 30%, transparent); background: linear-gradient(180deg, color-mix(in srgb, var(--teal-soft) 90%, var(--surface)), color-mix(in srgb, var(--teal-soft) 60%, var(--surface))); }
.thread-msg[data-internal] { border-style: dashed; border-color: var(--amber-line); background: var(--amber-soft); }
.thread-meta strong, .thread-meta .thread-author { letter-spacing: -0.006em; }
.thread-compose { border-top-color: var(--border); }
.panel:has(.thread > .thread-msg:nth-child(4)) .thread-compose { background: var(--sat-elevated); box-shadow: var(--sat-dock); }
.thread-empty { border-color: var(--border-strong); border-radius: var(--r-md); background: var(--surface-2); }

/* ======================================================================= 20. Sign-in */
/* Sign-in canvas: deep navy with layered blue glows; the same radar rings as the hero bands. */
.auth-screen {
  isolation: isolate;
  background:
    radial-gradient(560px 380px at 36% 64%, rgb(59 130 246 / 0.32), rgb(59 130 246 / 0) 70%),
    radial-gradient(520px 360px at 66% 32%, rgb(30 64 175 / 0.3), rgb(30 64 175 / 0) 70%),
    radial-gradient(360px 260px at 76% 20%, rgb(56 189 248 / 0.16), rgb(56 189 248 / 0) 70%),
    radial-gradient(900px 620px at 50% 50%, rgb(37 99 235 / 0.2), rgb(37 99 235 / 0) 72%),
    radial-gradient(720px 480px at 8% 108%, rgb(30 58 138 / 0.4), rgb(30 58 138 / 0) 62%),
    linear-gradient(160deg, #0c1a3d 0%, #091431 58%, #060d22 100%);
}
.auth-screen::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  background: repeating-radial-gradient(circle at 50% 46%, rgb(255 255 255 / 0.055) 0, rgb(255 255 255 / 0.055) 1px, rgb(255 255 255 / 0) 1px, rgb(255 255 255 / 0) 34px);
  -webkit-mask-image: radial-gradient(circle at 50% 46%, transparent 180px, #000 260px, rgb(0 0 0 / 0.5) 480px, transparent 760px);
  mask-image: radial-gradient(circle at 50% 46%, transparent 180px, #000 260px, rgb(0 0 0 / 0.5) 480px, transparent 760px);
  pointer-events: none;
}
.auth-card {
  border: 0;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--sat-e4), 0 0 0 1px rgb(255 255 255 / 0.06), 0 0 90px -12px rgb(59 130 246 / 0.38);
}
:root[data-theme='dark'] .auth-card { background: linear-gradient(180deg, var(--sat-elevated), var(--surface)); }
.auth-card::before { height: 4px; background: var(--brand-gradient); }
/* Wordmark: SATRIA set wide in Plex Sans Bold, filled with the deep end of the brand ramp (all >= 6:1 on the card;
   `color` keeps the solid ink for forced-colours and measurement). */
.auth-card .startup-brand { align-items: baseline; gap: 4px 12px; }
.auth-card .startup-brand .wordmark-text {
  color: #0a1a3f;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.16em;
  background: var(--sat-wordmark);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
:root[data-theme='dark'] .auth-card .startup-brand .wordmark-text { color: #ffffff; }
.auth-card .startup-brand .wordmark-text + span { color: var(--text-3); font-weight: 600; letter-spacing: 0.02em; }
.auth-heading h1 { font-size: 1.375rem; }
.auth-submit { min-height: 44px; font-size: 0.875rem; }
.auth-tools .btn-ghost { --btn-fg: #ddd6ee; }
.auth-tools .btn-ghost:hover { --btn-bg: rgb(255 255 255 / 0.08); --btn-fg: #fff; }

/* ======================================================================= 21. Settings */
.settings-gates { padding: 12px 16px; border-radius: var(--r-md); }
.settings-section > .panel-header { background: linear-gradient(180deg, color-mix(in srgb, var(--cobalt-soft) 40%, var(--surface)), var(--surface)); }
.settings-nav a { border-radius: 7px; }
.settings-nav a:hover { background: var(--surface-3); color: var(--text); }
.setup-guide .sg-progress { border-radius: var(--r-md); background: var(--surface-2); box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.5); }
.sg-step.is-next > .sg-card { background: color-mix(in srgb, var(--cobalt-soft) 55%, var(--surface)); }
.gate-fact { border-radius: var(--r-sm); }
.settings-counts { border-radius: var(--r-sm); }

/* ======================================================================= 22. Reports */
.rp-filter { padding: 14px 18px; }
.rp-kpis { gap: 12px; border: 0; background: none; box-shadow: none; overflow: visible; }
.rp-kpi, .rp-kpi:last-child {
  --kpi-accent: linear-gradient(90deg, #1e3a8a 0%, #1d4ed8 55%, #3b82f6 100%);
  --kpi-glow: rgb(37 99 235 / 0.09);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-right: 62px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: radial-gradient(200px 120px at 100% 0%, var(--kpi-glow), transparent 72%), var(--surface);
  box-shadow: var(--shadow-1);
}
.rp-kpi::before { content: ''; position: absolute; inset: 0 0 auto; height: 3px; background: var(--kpi-accent); }
.rp-kpi > .icon-tile { position: absolute; top: 16px; right: 16px; width: 36px; height: 36px; border-radius: 11px; }
.rp-kpi:has(> .tile-brand) { --kpi-accent: linear-gradient(90deg, #1e3a8a 0%, #1d4ed8 55%, #3b82f6 100%); --kpi-glow: rgb(37 99 235 / 0.09); }
.rp-kpi:has(> .tile-warn) { --kpi-accent: linear-gradient(90deg, #1e3a8a 0%, #1d4ed8 55%, #3b82f6 100%); --kpi-glow: rgb(37 99 235 / 0.09); }
.rp-kpi:has(> .tile-ok) { --kpi-accent: linear-gradient(90deg, #1e3a8a 0%, #1d4ed8 55%, #3b82f6 100%); --kpi-glow: rgb(37 99 235 / 0.09); }
.rp-kpi.rp-kpi-breach { --kpi-accent: linear-gradient(90deg, #b3261e, #e53935); --kpi-glow: rgb(211 47 47 / 0.10); }
.rp-kpi:hover { background: radial-gradient(200px 120px at 100% 0%, var(--kpi-glow), transparent 72%), var(--surface); border-color: var(--border-strong); box-shadow: var(--shadow-2); }
:root[data-theme='dark'] .rp-kpi, :root[data-theme='dark'] .rp-kpi:hover { background: radial-gradient(200px 120px at 100% 0%, var(--kpi-glow), transparent 72%), linear-gradient(180deg, var(--sat-surface-hi), var(--surface)); }
.rp-kpi strong { letter-spacing: -0.03em; }
.rp-segments { background: var(--surface-3); box-shadow: inset 0 1px 2px rgb(16 24 40 / 0.06); }
/* Clock cards: icon tile beside the title, brand ramp separator above the figures. */
.rp-clock-head { align-items: center; justify-content: flex-start; column-gap: 14px; }
.rp-clock-head > .rp-rate { margin-left: auto; }
.rp-clock-head > .icon-tile { align-self: flex-start; width: 38px; height: 38px; border-radius: 11px; }
.rp-clock-head > .icon-tile + div { flex: 1 1 320px; min-width: 0; }
.rp-clock-body { border-top: 1px solid transparent; border-image: var(--sat-brand-fade) 1; }
.rp-strip { height: 14px; border-radius: 7px; }
/* Distribution bars: the Axiata ramp from the fastest bucket (yellow) to the slowest (plum). */
.rp-bars > li:nth-child(1) .rp-bar-fill { fill: #60a5fa; }
.rp-bars > li:nth-child(2) .rp-bar-fill { fill: #3b82f6; }
.rp-bars > li:nth-child(3) .rp-bar-fill { fill: #2563eb; }
.rp-bars > li:nth-child(4) .rp-bar-fill { fill: #1d4ed8; }
.rp-bars > li:nth-child(5) .rp-bar-fill { fill: #1e40af; }
.rp-bars > li:nth-child(n + 6) .rp-bar-fill { fill: #1e3a8a; }
.rp-bar-track { height: 9px; border-radius: 5px; }

/* ======================================================================= 23. Mobile (<= 760px) */
@media (max-width: 760px) {
  .page-header, .page-head { margin-bottom: 14px; padding: 16px 16px 18px; border-radius: 14px; }
  .page-header h1, .page-head h1, .case-ws .case-title-row h1 { font-size: 1.3125rem; }
  .page-header .page-description, .page-head p { font-size: 0.8125rem; }
  .page-header::before, .page-head::before, .case-ws .case-head::before {
    -webkit-mask-image: radial-gradient(circle at 100% 0%, #000 0, rgb(0 0 0 / 0.5) 140px, transparent 300px);
    mask-image: radial-gradient(circle at 100% 0%, #000 0, rgb(0 0 0 / 0.5) 140px, transparent 300px);
  }
  .kpi-strip { gap: 10px; margin-top: 14px; }
  .home-kpis { gap: 10px; }
  .home-kpis > .kpi:nth-child(n), .home-kpis > .kpi:last-child:nth-child(odd) { border: 1px solid var(--border); }
  .page-header .home-kpis > .kpi:nth-child(n) { border-color: transparent; }
  .home-kpis .kpi-value, .kpi-strip .kpi-value { font-size: 1.5rem; }
  .kpi-strip > .kpi, .kpi-strip > .kpi:last-child { padding: 13px 14px 12px; }
  .kpi-strip > .kpi:has(> .icon-tile) { padding-right: 14px; }
  .kpi-strip > .kpi > .icon-tile { top: 11px; right: 11px; width: 28px; height: 28px; border-radius: 9px; }
  .kpi-strip > .kpi > .icon-tile .ico { width: 15px; height: 15px; }
  .kpi-strip > .kpi:has(> .icon-tile) .kpi-label { padding-right: 32px; }
  .rp-kpis { gap: 10px; }
  .rp-kpi:nth-child(n) { border: 1px solid var(--border); }
  .rp-kpi, .rp-kpi:last-child { padding-right: 54px; }
  .rp-kpi > .icon-tile { top: 12px; right: 12px; width: 30px; height: 30px; border-radius: 9px; }
  .data-table tbody tr:hover > td:first-child, .rq-row:hover > td:first-child { box-shadow: none; }
  .case-ws .queue-views { padding: 10px 12px; }
  .thread { padding: 10px; }
  .case-ws .case-head { padding: 16px 16px 0; border-radius: 14px; }
  .case-ws .case-head > .case-progress { margin: 0 -16px; padding: 10px 16px; }
  .panel-header { padding: 14px 16px; --panel-head-lead: 40px; }
  .icon-tile { width: 30px; height: 30px; border-radius: 9px; }
  .icon-tile .ico { width: 16px; height: 16px; }
  .settings-section > .panel-header > .icon-tile + div { flex-basis: 220px; }
}

/* ======================================================================= 24. Touch screens */
@media (hover: none) {
  .data-table tbody tr:hover, .rq-row:hover { background: inherit; }
}

/* ======================================================================= 25. Print */
/* Paper gets the plain header (the monthly report is printed): no band, no rings, black text. */
@media print {
  .page-header, .page-head, .case-ws .case-head {
    --sat-hero-text: #000; --sat-hero-text-2: #222; --sat-hero-text-3: #333;
    --sat-hero-glass: transparent; --sat-hero-glass-2: transparent; --sat-hero-line: #999;
    padding: 0; border-radius: 0; background: none; color: #000; box-shadow: none;
  }
  :is(.page-header, .page-head, .case-ws .case-head) :is(a, .case-id, .ticket-ref, .scope-chip, .back-link, .rp-back, .page-context, .drawer-meta, .drawer-meta *) { color: #000; text-shadow: none; }
  :is(.page-header, .page-head, .case-ws .case-head) .btn { --btn-fg: #000; --btn-bg: transparent; --btn-border: #999; color: #000; }
  .page-header::before, .page-header::after, .page-head::before, .page-head::after, .case-ws .case-head::before { display: none; }
  .page-header h1, .page-head h1, .page-head p, .page-header .page-description, .case-ws .case-title-row h1 { color: #000; text-shadow: none; }
  .icon-tile, .kpi-strip > .kpi, .rp-kpi { box-shadow: none; }
}

/* ======================================================================= Wave 20: reflow (WCAG 1.4.10)
   1280 px at 200 % zoom = 640 CSS px: the rail is already a drawer (satria.css, 760 px and below); the top bar wraps
   onto a second row (the search box takes its own row) instead of pushing the page sideways; page headers wrap their
   actions. Data tables keep their width and scroll inside their named region (the 1.4.10 exception). */
@media (max-width: 640px) {
  .satria-topbar { flex-wrap: wrap; height: auto; min-height: var(--topbar-h); row-gap: 6px; padding-top: 6px; padding-bottom: 6px; }
  .satria-topbar .topbar-search { order: 3; flex: 1 1 100%; max-width: none; }
  .topbar-search { flex: 1 1 100%; }
  .page-header-row { flex-wrap: wrap; }
  .page-actions { flex-wrap: wrap; }
  .satria-main, .main-column { min-width: 0; }
}
