/* Trans Nzoia County ICT HelpDesk — county brand tokens (aligned with VMHS / PMTS) */
/* Primary brand: #B7670F · Public Sans · official coat of arms */

:root {
  --ict-brand: #b7670f;
  --ict-brand-hover: #92400e;
  --ict-brand-soft: #fef3e8;
  --ict-brand-fg: #ffffff;
  --ict-brand-rgb: 183, 103, 15;

  --ict-gold: #d97706;
  --ict-gold-soft: #fef3c7;

  --ict-sidebar: #faf8f5;
  --ict-sidebar-fg: #1c1410;
  --ict-sidebar-muted: #78716c;
  --ict-sidebar-hover: #f5efe6;
  --ict-sidebar-border: #e7e0d6;
  --ict-sidebar-active: #fdebd7;

  --ict-paper: #f3eee7;
  --ict-paper-glow: rgba(183, 103, 15, 0.06);
  --ict-paper-glow-2: rgba(13, 148, 136, 0.05);
  --ict-paper-glow-3: rgba(37, 99, 235, 0.045);
  --ict-panel: #fffcf8;
  --ict-panel-wash: linear-gradient(165deg, #fffdfb 0%, #fff8f1 52%, #faf3ea 100%);
  --ict-ink: #1c1410;
  --ict-muted: #6b625a;
  --ict-border: #e7e0d6;

  --ict-danger: #dc2626;
  --ict-warning: #d97706;
  --ict-info: #2563eb;
  --ict-success: #16a34a;

  /* Multi-accent palette — icons & UI accents beyond brand orange */
  --ict-accent-blue: #2563eb;
  --ict-accent-sky: #0284c7;
  --ict-accent-teal: #0d9488;
  --ict-accent-green: #16a34a;
  --ict-accent-lime: #65a30d;
  --ict-accent-amber: #d97706;
  --ict-accent-rose: #e11d48;
  --ict-accent-indigo: #4f46e5;
  --ict-accent-slate: #64748b;
  --ict-accent-cyan: #0891b2;

  --font-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-body: "Public Sans", "Segoe UI", system-ui, sans-serif;

  --sidebar-w: 260px;
  --sidebar-w-collapsed: 4.75rem;
  --r-md: 12px;
  --mobile-nav-h: 58px;
  /* Soft brand wash — used sparingly; heroes no longer shout full orange */
  --county-gradient: linear-gradient(160deg, #fbf7f2 0%, #f4f6f3 45%, #f0f4f6 100%);
  --county-hero-ink: #1c1410;
  --county-hero-muted: #6b625a;
  --county-hero-border: #e8dfd4;
  --county-hero-accent: var(--ict-brand);
  --ict-table-hover: #fef3e8;
  --ict-kanban-col: #f5efe6;
  --ict-input-bg: #ffffff;
  --ict-topbar-bg: rgba(255, 255, 255, 0.9);
  --ict-brand-ring: rgba(183, 103, 15, 0.18);
}

/* Warm charcoal dark mode — complements county orange (VMHS guest shell family) */
html.dark {
  color-scheme: dark;
  --ict-brand: #e8a04a;
  --ict-brand-hover: #fbbf24;
  --ict-brand-soft: rgba(232, 160, 74, 0.14);
  --ict-brand-fg: #1c1005;
  --ict-brand-rgb: 232, 160, 74;

  --ict-gold: #fbbf24;
  --ict-gold-soft: rgba(251, 191, 36, 0.16);

  --ict-sidebar: #1a1612;
  --ict-sidebar-fg: #f5efe6;
  --ict-sidebar-muted: #a8a29e;
  --ict-sidebar-hover: #29231d;
  --ict-sidebar-border: rgba(255, 255, 255, 0.1);
  --ict-sidebar-active: rgba(232, 160, 74, 0.18);

  --ict-paper: #12100e;
  --ict-paper-glow: rgba(232, 160, 74, 0.08);
  --ict-paper-glow-2: rgba(45, 212, 191, 0.06);
  --ict-paper-glow-3: rgba(96, 165, 250, 0.06);
  --ict-panel: #1e1a16;
  --ict-panel-wash: linear-gradient(165deg, #221e19 0%, #1e1a16 55%, #1a1612 100%);
  --ict-ink: #f5f0e8;
  --ict-muted: #a8a29e;
  --ict-border: rgba(255, 255, 255, 0.1);

  --ict-danger: #f87171;
  --ict-warning: #fbbf24;
  --ict-info: #60a5fa;
  --ict-success: #4ade80;

  --ict-accent-blue: #60a5fa;
  --ict-accent-sky: #38bdf8;
  --ict-accent-teal: #2dd4bf;
  --ict-accent-green: #4ade80;
  --ict-accent-lime: #a3e635;
  --ict-accent-amber: #fbbf24;
  --ict-accent-rose: #fb7185;
  --ict-accent-indigo: #a5b4fc;
  --ict-accent-slate: #94a3b8;
  --ict-accent-cyan: #22d3ee;

  --county-gradient: linear-gradient(160deg, #1c1814 0%, #191511 55%, #171310 100%);
  --county-hero-ink: #f5f0e8;
  --county-hero-muted: #a8a29e;
  --county-hero-border: rgba(255, 255, 255, 0.1);
  --county-hero-accent: var(--ict-brand);
  --ict-table-hover: rgba(232, 160, 74, 0.1);
  --ict-kanban-col: #171310;
  --ict-input-bg: #29231d;
  --ict-topbar-bg: rgba(28, 24, 20, 0.92);
  --ict-brand-ring: rgba(232, 160, 74, 0.22);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  background-color: var(--ict-paper);
  background-image:
    radial-gradient(ellipse 80% 50% at 0% -10%, var(--ict-paper-glow), transparent 55%),
    radial-gradient(ellipse 55% 40% at 100% 0%, var(--ict-paper-glow-2), transparent 50%),
    radial-gradient(ellipse 45% 35% at 85% 100%, var(--ict-paper-glow-3), transparent 55%),
    linear-gradient(180deg, rgba(255,255,255,0.35) 0%, transparent 28%);
  background-attachment: fixed;
  color: var(--ict-ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
html.dark body {
  background-image:
    radial-gradient(ellipse 70% 45% at 10% -5%, var(--ict-paper-glow), transparent 55%),
    radial-gradient(ellipse 55% 40% at 95% 10%, var(--ict-paper-glow-2), transparent 50%),
    radial-gradient(ellipse 45% 30% at 70% 100%, var(--ict-paper-glow-3), transparent 55%);
}

h1, h2, h3, h4, .display-font {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  color: var(--ict-ink);
}

a { color: var(--ict-brand); text-decoration: none; }
a:hover { color: var(--ict-brand-hover); }

:focus-visible {
  outline: 2.5px solid var(--ict-brand);
  outline-offset: 2px;
}

.bg-grid {
  background-image:
    linear-gradient(to right, rgba(var(--ict-brand-rgb), 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(var(--ict-brand-rgb), 0.04) 1px, transparent 1px),
    radial-gradient(ellipse 70% 50% at 20% 0%, var(--ict-paper-glow), transparent 55%);
  background-size: 28px 28px, 28px 28px, auto;
}

.bg-county-gradient {
  background-image: var(--county-gradient);
  color: var(--county-hero-ink);
}

.btn-ict {
  background: linear-gradient(180deg, #d97706 0%, #b7670f 100%);
  border-color: var(--ict-brand);
  color: #fff;
}
.btn-ict:hover {
  background: var(--ict-brand-hover);
  border-color: var(--ict-brand-hover);
  color: #fff;
}
.btn-gold {
  background: var(--ict-gold);
  border-color: var(--ict-gold);
  color: #422006;
  font-weight: 600;
}
.btn-gold:hover {
  background: #a16207;
  border-color: #a16207;
  color: #fff;
}

/* ── Auth (two-column login) ── */
.auth-shell {
  min-height: 100vh;
  background: var(--ict-paper);
}
.auth-split {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
}
@media (min-width: 992px) {
  .auth-split { grid-template-columns: 1fr 1fr; }
}
.auth-hero {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  padding: 2.5rem 2.75rem;
  color: var(--county-hero-ink);
  background:
    radial-gradient(ellipse 80% 60% at 0% 0%, rgba(183, 103, 15, 0.1), transparent 50%),
    radial-gradient(ellipse 60% 50% at 100% 100%, rgba(217, 119, 6, 0.07), transparent 55%),
    var(--county-gradient);
  border-right: 1px solid var(--county-hero-border);
  position: relative;
  overflow: hidden;
}
.auth-hero::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #d97706, #b7670f 55%, #92400e);
}
@media (min-width: 992px) {
  .auth-hero { display: flex; }
}
.auth-hero .text-white-50,
.auth-hero .text-on-brand { color: var(--county-hero-muted) !important; }
.auth-hero .badge-live {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--ict-brand-soft);
  border: 1px solid rgba(var(--ict-brand-rgb), 0.22);
  color: var(--ict-brand-hover);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
}
.auth-hero .pulse-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ict-brand);
  animation: county-pulse 2s ease-in-out infinite;
}
.auth-hero-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-top: 1.5rem;
}
.auth-hero-features div {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--ict-panel);
  border: 1px solid var(--county-hero-border);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--county-hero-ink);
}
.auth-hero-features i { color: var(--ict-brand); }
.auth-hero-features div:nth-child(1) i { color: var(--ict-accent-blue); }
.auth-hero-features div:nth-child(2) i { color: var(--ict-accent-teal); }
.auth-hero-features div:nth-child(3) i { color: var(--ict-accent-amber); }
.auth-hero-features div:nth-child(4) i { color: var(--ict-accent-green); }
.auth-hero .border-white { border-color: var(--county-hero-border) !important; }
.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.auth-card {
  width: min(440px, 100%);
  background: var(--ict-panel-wash);
  border: 1px solid var(--ict-border);
  border-radius: var(--r-md);
  padding: 2rem;
  box-shadow: 0 12px 40px rgba(28, 20, 16, 0.06);
}
.auth-card-sm { width: min(26rem, 100%); }
.panel-narrow { max-width: 40rem; }
.panel-narrow-lg { max-width: 45rem; }
.ink-link { color: var(--ict-ink); }
.ink-link:hover { color: var(--ict-brand); }
.border-ict { border-color: var(--ict-border) !important; }
.sla-mini { min-width: 7rem; }
.kanban-empty {
  border-style: dashed !important;
  opacity: 0.75;
  text-align: center;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}
.sla-preview-box {
  border: 1px solid var(--ict-border);
  border-radius: 0.75rem;
  padding: 1rem;
  background: var(--ict-brand-soft);
}
.auth-shell-center {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}
.theme-toggle-float { z-index: 30; }
.badge-count { font-size: 0.6rem; }
.text-on-brand { color: var(--county-hero-muted); }
.hr-ict {
  border: 0;
  border-top: 1px solid var(--ict-border);
  margin: 1rem 0;
}
.page-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.auth-brand {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
}
.auth-sub {
  color: var(--ict-muted);
  font-size: 0.9rem;
  margin: 0 0 1.5rem;
}

@keyframes county-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* ── Dashboard shell ── */
.dash-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.dash-body {
  display: flex;
  flex: 1;
  min-height: 0;
}
.dash-sidebar {
  width: var(--sidebar-w);
  background:
    linear-gradient(180deg, rgba(255, 252, 248, 0.92) 0%, rgba(250, 245, 238, 0.96) 100%);
  color: var(--ict-sidebar-fg);
  border-right: 1px solid var(--ict-sidebar-border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  box-shadow: 4px 0 24px rgba(28, 20, 16, 0.03);
  transition: width 0.22s ease;
  will-change: width;
}
html.dark .dash-sidebar {
  background: linear-gradient(180deg, #1c1814 0%, #171310 100%);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25);
}
.dash-sidebar .brand-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: 4rem;
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--ict-sidebar-border);
}
.county-crest {
  display: block;
  object-fit: contain;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 6px rgba(28, 20, 16, 0.12));
}
.county-crest-sm { width: 2.35rem; height: 2.35rem; }
.county-crest-md { width: 2.85rem; height: 2.85rem; }
.county-crest-lg { width: 4.5rem; height: 4.5rem; }
.county-crest-frame {
  display: inline-grid;
  place-items: center;
  padding: 0.35rem;
  border-radius: 16px;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.95), transparent 55%),
    linear-gradient(160deg, #fffaf3 0%, #f6ecdf 100%);
  border: 1px solid rgba(var(--ict-brand-rgb), 0.18);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.8) inset,
    0 6px 16px rgba(28, 20, 16, 0.07);
  flex-shrink: 0;
}
.county-crest-frame:has(.county-crest-sm) {
  padding: 0.2rem;
  border-radius: 11px;
}
html.dark .county-crest-frame {
  background: linear-gradient(160deg, #2a241e 0%, #1c1814 100%);
  border-color: rgba(232, 160, 74, 0.22);
}
html.dark .county-crest {
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.35));
}
.county-logo-lockup {
  max-width: min(100%, 280px);
  height: auto;
  display: block;
}
.dash-sidebar .brand { font-family: var(--font-display); font-weight: 700; font-size: 0.95rem; line-height: 1.2; }
.dash-sidebar .brand-sub { font-size: 0.68rem; color: var(--ict-sidebar-muted); text-transform: uppercase; letter-spacing: 0.18em; }

.user-card {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--ict-sidebar-border);
}
.user-card .name { font-weight: 600; font-size: 0.9rem; }
.user-card .meta { font-size: 0.75rem; color: var(--ict-sidebar-muted); }
.user-avatar {
  width: 2.5rem; height: 2.5rem;
  border-radius: 50%;
  background: var(--ict-brand-soft);
  color: var(--ict-brand);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}
.role-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--ict-brand-soft);
  color: var(--ict-brand);
}

.dash-nav {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
}
.dash-nav .sidebar-help { margin-top: auto; }
.dash-nav .nav-group-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ict-sidebar-muted);
  padding: 0.5rem 0.65rem 0.35rem;
}
.dash-nav a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ict-sidebar-fg);
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  margin-bottom: 2px;
  font-size: 0.9rem;
  font-weight: 500;
}
.dash-nav a i {
  opacity: 1;
  width: 1.35rem;
  height: 1.35rem;
  display: inline-grid;
  place-items: center;
  text-align: center;
  font-size: 0.95rem;
  border-radius: 8px;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
}
.dash-nav a:hover { background: var(--ict-sidebar-hover); color: var(--ict-ink); }
.dash-nav a.active {
  background: var(--ict-brand);
  color: var(--ict-brand-fg);
  font-weight: 600;
  box-shadow: 0 4px 12px var(--ict-brand-ring);
}
.dash-nav a.active i {
  color: var(--ict-brand-fg) !important;
  background: rgba(0, 0, 0, 0.12) !important;
}
.dash-nav a.active .nav-badge {
  background: rgba(0, 0, 0, 0.18);
  color: inherit;
}
.dash-nav a .nav-badge {
  margin-left: auto;
  font-size: 0.7rem;
  background: var(--ict-brand-soft);
  color: var(--ict-brand);
  border-radius: 999px;
  padding: 0.05rem 0.45rem;
  min-width: 1.25rem;
  text-align: center;
}

/* Per-item sidebar / mobile icon colors */
.nav-ico-dash i { color: var(--ict-accent-blue); background: rgba(37, 99, 235, 0.1); }
.nav-ico-create i { color: var(--ict-accent-green); background: rgba(22, 163, 74, 0.1); }
.nav-ico-tickets i { color: var(--ict-accent-amber); background: rgba(217, 119, 6, 0.12); }
.nav-ico-kanban i { color: var(--ict-accent-indigo); background: rgba(79, 70, 229, 0.1); }
.nav-ico-sla i { color: var(--ict-accent-rose); background: rgba(225, 29, 72, 0.1); }
.nav-ico-kb i { color: var(--ict-accent-teal); background: rgba(13, 148, 136, 0.1); }
.nav-ico-alerts i { color: var(--ict-accent-sky); background: rgba(2, 132, 199, 0.1); }
.nav-ico-reports i { color: var(--ict-accent-cyan); background: rgba(8, 145, 178, 0.1); }
.nav-ico-users i { color: var(--ict-accent-lime); background: rgba(101, 163, 13, 0.12); }
.nav-ico-audit i { color: var(--ict-accent-slate); background: rgba(100, 116, 139, 0.12); }
.nav-ico-settings i { color: #7c3aed; background: rgba(124, 58, 237, 0.1); }
.nav-ico-profile i { color: var(--ict-accent-blue); }
.nav-ico-logout i { color: var(--ict-accent-rose); }
html.dark .nav-ico-dash i { background: rgba(96, 165, 250, 0.14); }
html.dark .nav-ico-create i { background: rgba(74, 222, 128, 0.12); }
html.dark .nav-ico-tickets i { background: rgba(251, 191, 36, 0.12); }
html.dark .nav-ico-kanban i { background: rgba(165, 180, 252, 0.14); }
html.dark .nav-ico-sla i { background: rgba(251, 113, 133, 0.14); }
html.dark .nav-ico-kb i { background: rgba(45, 212, 191, 0.12); }
html.dark .nav-ico-alerts i { background: rgba(56, 189, 248, 0.12); }
html.dark .nav-ico-reports i { background: rgba(34, 211, 238, 0.12); }
html.dark .nav-ico-users i { background: rgba(163, 230, 53, 0.12); }
html.dark .nav-ico-audit i { background: rgba(148, 163, 184, 0.12); }
html.dark .nav-ico-settings i { color: #c4b5fd; background: rgba(167, 139, 250, 0.14); }
.sidebar-help {
  margin: 0.75rem 0.25rem 0.5rem;
  padding: 0.9rem 1rem;
  border-radius: 10px;
  background: var(--ict-brand-soft);
  border: 1px solid rgba(var(--ict-brand-rgb), 0.18);
  color: var(--county-hero-ink);
}
.sidebar-help .title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--ict-brand-hover);
}
.sidebar-help .title i { color: var(--ict-accent-teal); }
.sidebar-help p {
  margin: 0;
  font-size: 0.75rem;
  color: var(--county-hero-muted);
  line-height: 1.45;
}
.sidebar-help strong { color: var(--county-hero-ink); font-weight: 600; }
.sidebar-footer {
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--ict-sidebar-border);
}
.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ict-sidebar-muted);
  font-size: 0.85rem;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
}
.sidebar-footer a:hover { background: var(--ict-sidebar-hover); color: var(--ict-ink); }
.sidebar-footer a i {
  width: 1.2rem;
  text-align: center;
  opacity: 1;
}
.nav-label { min-width: 0; }
.brand-text { min-width: 0; }
.sidebar-collapse-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--ict-border);
  background: var(--ict-panel);
  color: var(--ict-muted);
  flex-shrink: 0;
}
.sidebar-collapse-btn:hover {
  border-color: var(--ict-brand);
  color: var(--ict-brand);
  background: var(--ict-brand-soft);
}
.sidebar-collapse-btn[aria-pressed="true"] {
  background: var(--ict-brand-soft);
  border-color: rgba(var(--ict-brand-rgb), 0.35);
  color: var(--ict-brand);
}

/* Desktop collapsed rail — main column grows with available width */
@media (min-width: 992px) {
  .sidebar-collapse-btn { display: inline-grid; place-items: center; }

  html.sidebar-collapsed .dash-sidebar {
    width: var(--sidebar-w-collapsed);
  }
  html.sidebar-collapsed .dash-sidebar .brand-wrap {
    justify-content: center;
    padding: 0 0.5rem;
    gap: 0;
  }
  html.sidebar-collapsed .dash-sidebar .brand-text,
  html.sidebar-collapsed .dash-sidebar .nav-label,
  html.sidebar-collapsed .dash-sidebar .nav-group-label,
  html.sidebar-collapsed .dash-sidebar .user-card .user-meta,
  html.sidebar-collapsed .dash-sidebar .user-card .user-status,
  html.sidebar-collapsed .dash-sidebar .sidebar-help {
    display: none !important;
  }
  html.sidebar-collapsed .dash-sidebar .user-card {
    display: flex;
    justify-content: center;
    padding: 0.85rem 0.5rem;
  }
  html.sidebar-collapsed .dash-sidebar .user-card .d-flex {
    justify-content: center;
  }
  html.sidebar-collapsed .dash-nav {
    padding: 0.75rem 0.45rem;
    align-items: stretch;
  }
  html.sidebar-collapsed .dash-nav a {
    justify-content: center;
    padding: 0.55rem;
    position: relative;
    gap: 0;
  }
  html.sidebar-collapsed .dash-nav a .nav-badge {
    position: absolute;
    top: 0.2rem;
    right: 0.15rem;
    margin: 0;
    min-width: 0.95rem;
    padding: 0.05rem 0.25rem;
    font-size: 0.6rem;
  }
  html.sidebar-collapsed .dash-sidebar .sidebar-footer {
    padding: 0.55rem 0.4rem 0.85rem;
  }
  html.sidebar-collapsed .dash-sidebar .sidebar-footer a {
    justify-content: center;
    padding: 0.55rem;
    gap: 0;
  }
  html.sidebar-collapsed .dash-content {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
  html.sidebar-collapsed .topbar-search {
    max-width: 36rem;
  }
}

.dash-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
}
.dash-topbar {
  background:
    linear-gradient(180deg, rgba(255, 252, 248, 0.96) 0%, rgba(255, 248, 241, 0.9) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--ict-border);
  padding: 0.85rem 1.5rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.85rem 1rem;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 1px 0 rgba(183, 103, 15, 0.04);
}
html.dark .dash-topbar {
  background: linear-gradient(180deg, rgba(34, 30, 25, 0.96) 0%, rgba(28, 24, 20, 0.92) 100%);
  box-shadow: 0 1px 0 rgba(232, 160, 74, 0.06);
}
.dash-topbar .page-sub { font-size: 0.8rem; color: var(--ict-muted); }
.topbar-leading {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  justify-content: flex-end;
}
.topbar-search {
  max-width: 28rem;
  width: 100%;
  justify-self: center;
  font-size: 0.875rem;
}
.topbar-user {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.5rem 0.25rem 0.25rem;
  border-radius: 999px;
  border: 1px solid var(--ict-border);
  background: var(--ict-panel);
  text-decoration: none;
  color: var(--ict-ink);
}
.topbar-user:hover { border-color: var(--ict-brand); color: var(--ict-ink); }
.topbar-user .user-avatar { width: 1.85rem; height: 1.85rem; font-size: 0.68rem; }
.topbar-user .name { font-size: 0.8rem; font-weight: 600; max-width: 8rem; }
@media (min-width: 992px) {
  .topbar-user { display: inline-flex; }
}
.dash-content {
  padding: 1.5rem 1.5rem 2rem;
  flex: 1;
  background-image:
    radial-gradient(ellipse 50% 38% at 0% 0%, rgba(183, 103, 15, 0.05), transparent 60%),
    radial-gradient(ellipse 42% 32% at 100% 0%, rgba(13, 148, 136, 0.045), transparent 55%),
    radial-gradient(ellipse 40% 30% at 70% 100%, rgba(37, 99, 235, 0.04), transparent 55%);
  background-repeat: no-repeat;
}
html.dark .dash-content {
  background-image:
    radial-gradient(ellipse 50% 38% at 0% 0%, rgba(232, 160, 74, 0.07), transparent 60%),
    radial-gradient(ellipse 42% 32% at 100% 0%, rgba(45, 212, 191, 0.06), transparent 55%),
    radial-gradient(ellipse 40% 30% at 70% 100%, rgba(96, 165, 250, 0.05), transparent 55%);
}
@media (min-width: 992px) {
  .dash-content { padding-left: 2rem; padding-right: 2rem; }
}

/* Page enter — subtle presence without noise */
.page-enter {
  animation: page-enter 0.38s ease-out both;
}
@keyframes page-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.dash-footer {
  border-top: 1px solid var(--ict-border);
  background: var(--ict-panel-wash);
  padding: 1.25rem 1.75rem;
  margin-top: auto;
}
.dash-footer .footer-title { font-weight: 600; font-size: 0.9rem; }
.dash-footer .footer-meta { font-size: 0.75rem; color: var(--ict-muted); }
.dash-footer .footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--ict-muted);
}
.dash-footer .footer-ico-geo i { color: var(--ict-accent-rose); }
.dash-footer .footer-ico-phone i { color: var(--ict-accent-green); }
.dash-footer .footer-ico-mail i { color: var(--ict-accent-blue); }

/* ── Cards / panels ── */
.stat-card {
  position: relative;
  overflow: hidden;
  background: var(--ict-panel-wash);
  border: 1px solid var(--ict-border);
  border-radius: var(--r-md);
  padding: 1.25rem;
  height: 100%;
  box-shadow: 0 1px 2px rgba(28, 20, 16, 0.03), 0 6px 18px rgba(28, 20, 16, 0.03);
  transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}
.stat-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--ict-brand), rgba(var(--ict-brand-rgb), 0.35));
  border-radius: 3px 0 0 3px;
}
.stat-card.info::before { background: linear-gradient(180deg, var(--ict-accent-blue), rgba(37, 99, 235, 0.35)); }
.stat-card.warn::before,
.stat-card.gold::before { background: linear-gradient(180deg, var(--ict-accent-amber), rgba(217, 119, 6, 0.35)); }
.stat-card.danger::before { background: linear-gradient(180deg, var(--ict-accent-rose), rgba(225, 29, 72, 0.35)); }
.stat-card.success::before { background: linear-gradient(180deg, var(--ict-accent-green), rgba(22, 163, 74, 0.35)); }
.stat-card.teal::before { background: linear-gradient(180deg, var(--ict-accent-teal), rgba(13, 148, 136, 0.35)); }
.stat-card.success .stat-icon { background: rgba(22, 163, 74, 0.12); color: var(--ict-accent-green); }
.stat-card.teal .stat-icon { background: rgba(13, 148, 136, 0.12); color: var(--ict-accent-teal); }
.stat-card.success .stat-card-glow { background: radial-gradient(circle, rgba(22, 163, 74, 0.16), transparent 70%); }
.stat-card.teal .stat-card-glow { background: radial-gradient(circle, rgba(13, 148, 136, 0.16), transparent 70%); }
.stat-card:hover {
  box-shadow: 0 10px 28px rgba(28, 20, 16, 0.07);
  border-color: rgba(var(--ict-brand-rgb), 0.28);
  transform: translateY(-1px);
}
.stat-card-glow {
  pointer-events: none;
  position: absolute;
  right: -1.5rem; top: -1.5rem;
  width: 6rem; height: 6rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--ict-brand-rgb), 0.16), transparent 70%);
  filter: blur(8px);
}
.stat-card.warn .stat-card-glow { background: radial-gradient(circle, rgba(202,138,4,0.18), transparent 70%); }
.stat-card.danger .stat-card-glow { background: radial-gradient(circle, rgba(220,38,38,0.14), transparent 70%); }
.stat-card.gold .stat-card-glow { background: radial-gradient(circle, rgba(202,138,4,0.18), transparent 70%); }
.stat-card.info .stat-card-glow { background: radial-gradient(circle, rgba(37,99,235,0.12), transparent 70%); }
.stat-card-body {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
.stat-card .stat-value {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--ict-ink);
  letter-spacing: -0.02em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.stat-card .stat-label {
  color: var(--ict-muted);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.25rem;
}
.stat-card .stat-hint { color: var(--ict-muted); font-size: 0.75rem; margin-top: 0.25rem; }
.stat-icon {
  width: 2.75rem; height: 2.75rem;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--ict-brand-soft);
  color: var(--ict-brand);
  font-size: 1.15rem;
  flex-shrink: 0;
}
.stat-card.warn .stat-icon { background: var(--ict-gold-soft); color: var(--ict-gold); }
.stat-card.danger .stat-icon { background: #fee2e2; color: var(--ict-danger); }
.stat-card.gold .stat-icon { background: var(--ict-gold-soft); color: #a16207; }
.stat-card.info .stat-icon { background: #dbeafe; color: var(--ict-info); }
.stat-card.danger .stat-value { color: var(--ict-danger); }
.stat-card.warn .stat-value { color: var(--ict-warning); }

.panel {
  position: relative;
  background: var(--ict-panel-wash);
  border: 1px solid var(--ict-border);
  border-radius: var(--r-md);
  padding: 1.25rem;
  box-shadow: 0 1px 2px rgba(28, 20, 16, 0.03), 0 8px 24px rgba(28, 20, 16, 0.035);
  overflow: hidden;
}
.panel::after {
  content: "";
  position: absolute;
  right: -2.5rem;
  top: -2.5rem;
  width: 7rem;
  height: 7rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--ict-brand-rgb), 0.08), transparent 70%);
  pointer-events: none;
}
html.dark .panel {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 10px 28px rgba(0, 0, 0, 0.18);
}
html.dark .panel::after {
  background: radial-gradient(circle, rgba(232, 160, 74, 0.1), transparent 70%);
}
.panel > * { position: relative; z-index: 1; }
.panel-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}
.panel-title .settings-tile-icon,
.panel-title i[class*="bi-"] {
  margin-right: 0.35rem;
}
.settings-tile-icon { color: var(--ict-accent-teal); }
.panel:nth-child(1) .settings-tile-icon,
.col-lg-4 .settings-tile-icon { color: var(--ict-accent-blue); }
.panel .bi-stopwatch.settings-tile-icon { color: var(--ict-accent-rose); }
.panel .bi-tags.settings-tile-icon { color: var(--ict-accent-amber); }
.panel-sub { font-size: 0.8rem; color: var(--ict-muted); margin: 0.15rem 0 0; }

.welcome-banner {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-md);
  padding: 1.4rem 1.55rem;
  color: var(--county-hero-ink);
  background:
    radial-gradient(ellipse 90% 120% at 100% 0%, rgba(183, 103, 15, 0.12), transparent 55%),
    radial-gradient(ellipse 60% 80% at 0% 100%, rgba(217, 119, 6, 0.06), transparent 50%),
    linear-gradient(135deg, #fffaf4 0%, #f7f0e8 48%, #f3ebe3 100%);
  border: 1px solid var(--county-hero-border);
  border-left: 3px solid var(--county-hero-accent);
  margin-bottom: 1.5rem;
  box-shadow: 0 8px 28px rgba(28, 20, 16, 0.04);
}
.welcome-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(183, 103, 15, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(183, 103, 15, 0.035) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.7;
  pointer-events: none;
}
.welcome-banner::after {
  content: "";
  position: absolute;
  right: -3rem;
  top: -3rem;
  width: 11rem;
  height: 11rem;
  border-radius: 50%;
  background: rgba(183, 103, 15, 0.08);
  filter: blur(32px);
  pointer-events: none;
}
html.dark .welcome-banner {
  background:
    radial-gradient(ellipse 90% 120% at 100% 0%, rgba(232, 160, 74, 0.12), transparent 55%),
    linear-gradient(135deg, #221c17 0%, #1c1814 55%, #171310 100%);
}
.welcome-banner > * { position: relative; z-index: 1; }
.welcome-banner .date {
  font-size: 0.8rem;
  color: var(--county-hero-muted);
  margin: 0;
  font-weight: 500;
}
.welcome-banner h1 {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2vw, 1.65rem);
  font-weight: 700;
  color: var(--county-hero-ink);
  margin: 0.3rem 0 0.4rem;
}
.welcome-banner .lead {
  color: var(--county-hero-muted);
  font-size: 0.9rem;
  max-width: 36rem;
  margin: 0;
}
.welcome-banner .btn-ghost {
  background: transparent;
  border: 1px solid var(--ict-border);
  color: var(--county-hero-ink);
}
.welcome-banner .btn-ghost:hover {
  background: var(--ict-brand-soft);
  border-color: rgba(var(--ict-brand-rgb), 0.35);
  color: var(--ict-brand-hover);
}

/* Badges — bordered pills with dots */
.status-pill, .priority-pill, .sla-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--ict-panel);
  border: 1px solid var(--ict-border);
  color: var(--ict-muted);
  white-space: nowrap;
}
.pill-dot {
  width: 0.375rem; height: 0.375rem;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
/* Semantic pills — county-warm “healthy” uses brand, not emerald */
.status-pill.new { background: rgba(37, 99, 235, 0.1); border-color: rgba(37, 99, 235, 0.28); color: #1d4ed8; }
.status-pill.assigned { background: rgba(79, 70, 229, 0.1); border-color: rgba(79, 70, 229, 0.28); color: #4338ca; }
.status-pill.in_progress { background: var(--ict-brand-soft); border-color: rgba(var(--ict-brand-rgb), 0.35); color: var(--ict-brand-hover); }
.status-pill.pending_user { background: var(--ict-gold-soft); border-color: rgba(217, 119, 6, 0.35); color: #92400e; }
.status-pill.escalated { background: rgba(220, 38, 38, 0.1); border-color: rgba(220, 38, 38, 0.3); color: #b91c1c; }
.status-pill.resolved, .status-pill.closed { background: rgba(22, 163, 74, 0.1); border-color: rgba(22, 163, 74, 0.3); color: #15803d; }
.status-pill.cancelled { background: rgba(100, 116, 139, 0.1); border-color: rgba(100, 116, 139, 0.28); color: #64748b; }

.priority-pill.urgent, .priority-pill.critical { background: rgba(220, 38, 38, 0.1); border-color: rgba(220, 38, 38, 0.3); color: #b91c1c; }
.priority-pill.high { background: rgba(234, 88, 12, 0.1); border-color: rgba(234, 88, 12, 0.3); color: #c2410c; }
.priority-pill.medium { background: var(--ict-gold-soft); border-color: rgba(217, 119, 6, 0.35); color: #92400e; }
.priority-pill.low { background: rgba(100, 116, 139, 0.1); border-color: rgba(100, 116, 139, 0.28); color: #475569; }

.sla-pill.on_track { background: var(--ict-brand-soft); border-color: rgba(var(--ict-brand-rgb), 0.35); color: var(--ict-brand-hover); }
.sla-pill.at_risk { background: var(--ict-gold-soft); border-color: rgba(217, 119, 6, 0.35); color: #92400e; }
.sla-pill.at_risk .pill-dot { animation: county-pulse 2s ease-in-out infinite; }
.sla-pill.breached { background: rgba(220, 38, 38, 0.1); border-color: rgba(220, 38, 38, 0.3); color: #b91c1c; }
.sla-pill.paused { background: rgba(79, 70, 229, 0.1); border-color: rgba(79, 70, 229, 0.28); color: #4338ca; }

.sla-progress-wrap { display: grid; gap: 0.35rem; }
.sla-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.75rem;
}
.sla-progress-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--ict-muted);
  font-weight: 600;
}
.sla-progress-remaining { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ict-muted); }
.sla-progress-wrap.at_risk .sla-progress-remaining,
.sla-progress-wrap.at_risk .sla-progress-label i { color: var(--ict-warning); }
.sla-progress-wrap.breached .sla-progress-remaining,
.sla-progress-wrap.breached .sla-progress-label i { color: var(--ict-danger); }
.sla-progress {
  height: 6px;
  background: rgba(var(--ict-brand-rgb), 0.12);
  border-radius: 999px;
  overflow: hidden;
}
.sla-progress > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--ict-brand);
  transition: width 0.35s ease;
}
.sla-progress.at_risk > span { background: var(--ict-warning); }
.sla-progress.breached > span { background: var(--ict-danger); }
.sla-progress.paused > span { background: #94a3b8; }
.sla-progress.on_track > span { background: var(--ict-brand); }

.priority-urgent { color: var(--ict-danger); font-weight: 700; }
.priority-high { color: #c2410c; font-weight: 600; }

/* Ticket list chrome */
.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.filter-pills a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--ict-border);
  background: var(--ict-panel-wash);
  color: var(--ict-muted);
  font-size: 0.8rem;
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(28, 20, 16, 0.03);
}
.filter-pills a:hover { border-color: var(--ict-brand); color: var(--ict-brand); }
.filter-pills a.active {
  background: var(--ict-brand-soft);
  border-color: #f0c48a;
  color: var(--ict-brand-hover);
  font-weight: 600;
}
.filter-pills a .count {
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(var(--ict-brand-rgb), 0.1);
  border-radius: 999px;
  padding: 0.05rem 0.4rem;
  font-variant-numeric: tabular-nums;
  color: var(--ict-brand-hover);
}
.filter-pills a.active .count { background: rgba(var(--ict-brand-rgb), 0.18); }
.ticket-table thead th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ict-muted);
  font-weight: 600;
  border-bottom-width: 1px;
}
.ticket-table tbody tr { transition: background 0.12s ease; }
.ticket-table tbody tr:hover { background: var(--ict-table-hover); }
.ticket-table .ref-link {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ict-brand);
}
.ticket-subject { font-weight: 600; color: var(--ict-ink); }
.ticket-meta { font-size: 0.75rem; color: var(--ict-muted); }

/* Priority tiles (create) */
.priority-tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
}
@media (min-width: 576px) {
  .priority-tiles { grid-template-columns: repeat(4, 1fr); }
}
.priority-tile {
  border: 1px solid var(--ict-border);
  background: var(--ict-panel);
  border-radius: 10px;
  padding: 0.75rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.priority-tile:hover { border-color: var(--ict-brand); }
.priority-tile.active {
  border-color: var(--ict-brand);
  box-shadow: 0 0 0 3px var(--ict-brand-ring);
  background: var(--ict-brand-soft);
}
.priority-tile .name { font-weight: 600; font-size: 0.85rem; display: block; }
.priority-tile .hint { font-size: 0.7rem; color: var(--ict-muted); margin-top: 0.15rem; display: block; }

.create-hero {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.15rem 1.25rem;
  border-radius: var(--r-md);
  background:
    radial-gradient(ellipse 80% 100% at 100% 50%, rgba(183, 103, 15, 0.08), transparent 55%),
    linear-gradient(135deg, #fffaf4 0%, #f5eee6 100%);
  color: var(--county-hero-ink);
  border: 1px solid var(--county-hero-border);
  border-left: 3px solid var(--county-hero-accent);
  margin-bottom: 1.25rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(28, 20, 16, 0.04);
}
.create-hero::after { display: none; }
html.dark .create-hero {
  background:
    radial-gradient(ellipse 80% 100% at 100% 50%, rgba(232, 160, 74, 0.1), transparent 55%),
    linear-gradient(135deg, #221c17 0%, #1c1814 100%);
}
.create-hero > * { position: relative; z-index: 1; }
.create-hero h1 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--county-hero-ink);
  margin: 0;
}
.create-hero p {
  margin: 0.25rem 0 0;
  color: var(--county-hero-muted);
  font-size: 0.875rem;
}
.tips-list { list-style: none; padding: 0; margin: 0; }
.tips-list li {
  display: flex;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--ict-muted);
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--ict-border);
}
.tips-list li:last-child { border-bottom: 0; }
.tips-list i { color: var(--ict-brand); margin-top: 0.15rem; }

/* Conversation */
.thread-item {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--ict-border);
}
.thread-item:last-child { border-bottom: 0; }
.thread-item .avatar {
  width: 2.25rem; height: 2.25rem;
  border-radius: 50%;
  background: var(--ict-brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}
.thread-item .avatar.requester { background: #2563eb; }
.thread-item .body { white-space: pre-wrap; margin-top: 0.35rem; }
.detail-badge-row { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.detail-badge-row .ref-link {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ict-brand);
}
.detail-subject {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.2vw, 1.45rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  line-height: 1.25;
}
.note-item {
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  background: var(--ict-brand-soft);
  border: 1px solid rgba(var(--ict-brand-rgb), 0.18);
  margin-bottom: 0.65rem;
}
.note-item .meta { font-size: 0.75rem; color: var(--ict-muted); margin-bottom: 0.25rem; }
.note-item .body { white-space: pre-wrap; font-size: 0.9rem; }
.history-list { list-style: none; padding: 0; margin: 0; }
.history-list li {
  position: relative;
  padding: 0 0 1rem 1.1rem;
  border-left: 2px solid var(--ict-border);
}
.history-list li:last-child { padding-bottom: 0; }
.history-list li::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 0.35rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ict-brand);
  box-shadow: 0 0 0 3px var(--ict-panel);
}
.thread-composer {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--ict-border);
}
.detail-meta-list dt {
  color: var(--ict-muted);
  font-weight: 500;
  margin-bottom: 0.35rem;
}
.detail-meta-list dd { margin-bottom: 0.65rem; font-weight: 500; }
.attach-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.attach-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--ict-border);
  border-radius: 8px;
  margin-bottom: 0.45rem;
  font-size: 0.875rem;
  background: var(--ict-input-bg);
}
.settings-tile-icon { color: var(--ict-brand) !important; }
.kb-hero {
  position: relative;
  overflow: hidden;
  border-left: 3px solid var(--county-hero-accent);
  background:
    radial-gradient(ellipse 70% 120% at 100% 0%, rgba(183, 103, 15, 0.09), transparent 50%),
    linear-gradient(135deg, #fffaf4 0%, #f5eee6 100%);
}
.kb-hero h1 { color: var(--county-hero-ink); }
.kb-hero .form-control {
  background: var(--ict-input-bg);
  border-color: var(--ict-border);
}
html.dark .kb-hero {
  background:
    radial-gradient(ellipse 70% 120% at 100% 0%, rgba(232, 160, 74, 0.1), transparent 50%),
    linear-gradient(135deg, #221c17 0%, #1c1814 100%);
}

/* Auth atmosphere */
.auth-panel { position: relative; }
.auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(48px);
  pointer-events: none;
}
.auth-orb-brand {
  width: 14rem; height: 14rem;
  background: rgba(183, 103, 15, 0.08);
  top: 10%; right: 8%;
}
.auth-orb-gold {
  width: 10rem; height: 10rem;
  background: rgba(217, 119, 6, 0.06);
  bottom: 12%; left: 12%;
}
html.dark .auth-orb-brand { background: rgba(232, 160, 74, 0.08); }
html.dark .auth-orb-gold { background: rgba(251, 191, 36, 0.05); }
.auth-input-wrap { position: relative; }
.auth-input-wrap i {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ict-muted);
  z-index: 2;
}
.auth-input-wrap .form-control { padding-left: 2.35rem; }
.demo-role-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.demo-role-card {
  border: 1px solid var(--ict-border);
  background: var(--ict-panel);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ict-ink);
  transition: border-color 0.12s, background 0.12s;
}
.demo-role-card:hover, .demo-role-card:focus {
  border-color: var(--ict-brand);
  background: var(--ict-brand-soft);
  color: var(--ict-brand-hover);
}
.demo-role-card small { display: block; font-weight: 400; color: var(--ict-muted); font-size: 0.68rem; margin-top: 0.1rem; }

/* Kanban */
.kanban-board {
  display: flex;
  gap: 1rem;
  align-items: stretch;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.kanban-col {
  background: var(--ict-kanban-col);
  border: 1px solid var(--ict-border);
  border-radius: var(--r-md);
  padding: 0.85rem;
  min-height: 320px;
  width: 288px;
  flex: 0 0 288px;
  scroll-snap-align: start;
}
.kanban-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}
.kanban-col-head h3 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ict-ink);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  text-transform: none;
  letter-spacing: 0;
}
.kanban-dot {
  width: 0.5rem; height: 0.5rem;
  border-radius: 50%;
  background: var(--ict-brand);
  flex-shrink: 0;
}
.kanban-col[data-status="new"] .kanban-dot { background: #2563eb; }
.kanban-col[data-status="assigned"] .kanban-dot { background: #4f46e5; }
.kanban-col[data-status="in_progress"] .kanban-dot { background: var(--ict-brand); }
.kanban-col[data-status="resolved"] .kanban-dot,
.kanban-col[data-status="closed"] .kanban-dot { background: var(--ict-success); }
.kanban-col[data-status="pending_user"] .kanban-dot { background: #ca8a04; }
.kanban-col[data-status="escalated"] .kanban-dot { background: #dc2626; }
.kanban-count {
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--ict-panel);
  border: 1px solid var(--ict-border);
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  color: var(--ict-muted);
}
.kanban-card {
  background: var(--ict-panel);
  border: 1px solid var(--ict-border);
  border-radius: 10px;
  padding: 0.85rem;
  margin-bottom: 0.65rem;
  box-shadow: 0 1px 2px rgba(20,36,28,0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.kanban-card:hover {
  border-color: var(--ict-brand);
  box-shadow: 0 6px 16px rgba(20,36,28,0.06);
  transform: translateY(-1px);
}
.kanban-card .ref { font-family: ui-monospace, monospace; font-size: 0.7rem; color: var(--ict-muted); font-weight: 600; }
.kanban-moves .btn { font-size: 0.65rem !important; }

.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--mobile-nav-h);
  background: var(--ict-panel);
  border-top: 1px solid var(--ict-border);
  z-index: 40;
  justify-content: space-around;
  align-items: center;
}
.mobile-nav a {
  color: var(--ict-muted);
  font-size: 0.65rem;
  text-align: center;
  padding: 0.3rem 0.2rem;
  flex: 1;
  min-width: 0;
  border-radius: 10px;
}
.mobile-nav a.active { color: var(--ict-brand); font-weight: 600; }
.mobile-nav a i {
  display: block;
  font-size: 1.15rem;
  margin: 0 auto 0.1rem;
  width: auto;
  height: auto;
  background: transparent !important;
  border-radius: 0;
}
.mobile-nav a.mobile-nav-primary {
  color: var(--ict-brand-fg);
  background: var(--ict-brand);
  font-weight: 600;
  margin: 0 0.15rem;
  max-width: 4.5rem;
}
.mobile-nav a.mobile-nav-primary.active {
  color: var(--ict-brand-fg);
  box-shadow: 0 0 0 2px var(--ict-panel), 0 0 0 4px var(--ict-brand);
}
.mobile-nav a.mobile-nav-primary i {
  margin-bottom: 0;
  color: var(--ict-brand-fg) !important;
  background: transparent !important;
}
.mobile-nav a.mobile-nav-primary span { display: none; }
@media (min-width: 400px) {
  .mobile-nav a.mobile-nav-primary span { display: inline; }
  .mobile-nav a.mobile-nav-primary i { margin-bottom: 0.1rem; }
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20, 36, 28, 0.35);
  z-index: 45;
}
.sidebar-backdrop.show { display: block; }
body.sidebar-open { overflow: hidden; }

@media (max-width: 991px) {
  .dash-sidebar {
    position: fixed;
    left: 0; top: 0;
    width: min(var(--sidebar-w), 86vw);
    transform: translateX(-100%);
    z-index: 50;
    transition: transform 0.22s ease;
    box-shadow: 0 0 40px rgba(0,0,0,0.18);
  }
  .dash-sidebar.open { transform: translateX(0); }
  .mobile-nav { display: flex; }
  .dash-topbar {
    padding: 0.65rem 0.85rem;
    grid-template-columns: 1fr auto;
    gap: 0.55rem 0.65rem;
  }
  .dash-topbar .page-sub { display: none; }
  .topbar-search {
    grid-column: 1 / -1;
    max-width: none;
    justify-self: stretch;
    order: 3;
  }
  .topbar-user { display: none !important; }
  .dash-content {
    padding: 0.85rem;
    padding-bottom: calc(1rem + var(--mobile-nav-h) + env(safe-area-inset-bottom, 0px));
  }
  .dash-footer { display: none; }
  .welcome-banner { padding: 1.15rem; margin-bottom: 1rem; }
  .welcome-banner h1 { font-size: 1.25rem; }
  .create-hero { padding: 1rem; flex-direction: column; align-items: flex-start; }
  .panel { padding: 1rem; }
  .stat-card { padding: 1rem; }
  .stat-card .stat-value { font-size: 1.4rem; }
  .kanban-col { width: 72vw; flex-basis: 72vw; max-width: 280px; }
  .row.g-4 { --bs-gutter-y: 1rem; }
  .detail-sticky-sla { position: static; }
  .mobile-nav {
    height: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
}

@media (max-width: 575px) {
  .filter-pills {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .filter-pills::-webkit-scrollbar { display: none; }
  .filter-pills a { flex: 0 0 auto; }
  .ticket-table thead { display: none; }
  .ticket-table,
  .ticket-table tbody,
  .ticket-table tr,
  .ticket-table td { display: block; width: 100%; }
  .ticket-table tr {
    border: 1px solid var(--ict-border);
    border-radius: 10px;
    padding: 0.85rem;
    margin-bottom: 0.65rem;
    background: var(--ict-panel);
  }
  .ticket-table td {
    border: 0 !important;
    padding: 0.15rem 0;
  }
  .ticket-table td:first-child { margin-bottom: 0.4rem; }
  .ticket-table td[data-label] {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
  }
  .ticket-table td[data-label]::before {
    content: attr(data-label);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ict-muted);
    flex-shrink: 0;
  }
  .ticket-table td:first-child[data-label] {
    display: block;
  }
  .ticket-table td:first-child[data-label]::before { display: none; }
  .auth-card { padding: 1.35rem; }
  .auth-hero-features { grid-template-columns: 1fr; }
}

@media (min-width: 992px) {
  .detail-sticky-sla {
    position: sticky;
    top: 5.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ── Theme toggle ── */
.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 2.15rem;
  height: 2.15rem;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--ict-border);
  background: var(--ict-panel);
  color: var(--ict-muted);
}
.theme-toggle:hover {
  color: var(--ict-brand);
  border-color: var(--ict-brand);
}
.theme-toggle .icon-sun { display: none; }
html.dark .theme-toggle .icon-moon { display: none; }
html.dark .theme-toggle .icon-sun { display: inline; }

/* Bootstrap surfaces in app chrome */
.form-control, .form-select {
  background-color: var(--ict-input-bg);
  border-color: var(--ict-border);
  color: var(--ict-ink);
}
.form-control:focus, .form-select:focus {
  background-color: var(--ict-input-bg);
  border-color: var(--ict-brand);
  color: var(--ict-ink);
  box-shadow: 0 0 0 0.2rem var(--ict-brand-ring);
}
.form-control::placeholder { color: var(--ict-muted); opacity: 0.8; }
.table { --bs-table-bg: transparent; --bs-table-color: var(--ict-ink); color: var(--ict-ink); }
.table > :not(caption) > * > * { background-color: transparent; border-bottom-color: var(--ict-border); color: inherit; }
.table thead th {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ict-muted);
  background: linear-gradient(180deg, rgba(183, 103, 15, 0.06), rgba(183, 103, 15, 0.02));
  border-bottom-color: var(--ict-border) !important;
}
html.dark .table thead th {
  background: linear-gradient(180deg, rgba(232, 160, 74, 0.1), rgba(232, 160, 74, 0.03));
}
.table tbody tr:hover > * {
  background-color: var(--ict-table-hover) !important;
}
.text-muted, .ticket-meta, .panel-sub, .page-sub { color: var(--ict-muted) !important; }
.text-dark { color: var(--ict-ink) !important; }
.btn-outline-secondary {
  --bs-btn-color: var(--ict-muted);
  --bs-btn-border-color: var(--ict-border);
  --bs-btn-hover-bg: var(--ict-sidebar-hover);
  --bs-btn-hover-border-color: var(--ict-brand);
  --bs-btn-hover-color: var(--ict-ink);
}
html.dark .bg-grid {
  background-image:
    linear-gradient(to right, rgba(232, 160, 74, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(232, 160, 74, 0.06) 1px, transparent 1px);
}
html.dark .status-pill.new { background: rgba(37,99,235,0.18); border-color: rgba(96,165,250,0.35); color: #93c5fd; }
html.dark .status-pill.assigned { background: rgba(79,70,229,0.18); border-color: rgba(165,180,252,0.35); color: #c7d2fe; }
html.dark .status-pill.in_progress { background: var(--ict-brand-soft); border-color: rgba(232,160,74,0.4); color: #fbbf24; }
html.dark .status-pill.pending_user { background: rgba(202,138,4,0.18); border-color: rgba(250,204,21,0.35); color: #fde68a; }
html.dark .status-pill.escalated { background: rgba(220,38,38,0.18); border-color: rgba(248,113,113,0.35); color: #fca5a5; }
html.dark .status-pill.resolved,
html.dark .status-pill.closed { background: rgba(74,222,128,0.14); border-color: rgba(74,222,128,0.35); color: #86efac; }
html.dark .status-pill.cancelled { background: rgba(148,163,184,0.12); border-color: rgba(148,163,184,0.3); color: #94a3b8; }
html.dark .priority-pill.urgent,
html.dark .priority-pill.critical { background: rgba(220,38,38,0.18); border-color: rgba(248,113,113,0.35); color: #fca5a5; }
html.dark .priority-pill.high { background: rgba(234,88,12,0.18); border-color: rgba(251,146,60,0.35); color: #fdba74; }
html.dark .priority-pill.medium { background: rgba(202,138,4,0.18); border-color: rgba(250,204,21,0.35); color: #fde68a; }
html.dark .priority-pill.low { background: rgba(148,163,184,0.12); border-color: rgba(148,163,184,0.3); color: #cbd5e1; }
html.dark .sla-pill.on_track { background: var(--ict-brand-soft); border-color: rgba(232,160,74,0.4); color: #fbbf24; }
html.dark .sla-pill.at_risk { background: rgba(202,138,4,0.18); border-color: rgba(250,204,21,0.35); color: #fde68a; }
html.dark .sla-pill.breached { background: rgba(220,38,38,0.18); border-color: rgba(248,113,113,0.35); color: #fca5a5; }
html.dark .sla-pill.paused { background: rgba(79,70,229,0.18); border-color: rgba(165,180,252,0.35); color: #c7d2fe; }
html.dark .sla-progress { background: rgba(255,255,255,0.08); }
html.dark .alert { border-color: var(--ict-border); }
html.dark .alert-info { background: rgba(37,99,235,0.15); color: #bfdbfe; }
html.dark .alert-success { background: rgba(22,163,74,0.15); color: #bbf7d0; }
html.dark .alert-warning { background: rgba(202,138,4,0.15); color: #fde68a; }
html.dark .alert-danger { background: rgba(220,38,38,0.15); color: #fecaca; }
html.dark .btn-close { filter: invert(1) grayscale(1); opacity: 0.7; }
html.dark .auth-card { background: var(--ict-panel); border-color: var(--ict-border); }
html.dark .demo-role-card { background: var(--ict-input-bg); }
html.dark .filter-pills a { background: var(--ict-panel); }
html.dark .filter-pills a.active { background: var(--ict-brand-soft); border-color: rgba(232,160,74,0.45); color: var(--ict-brand); }
html.dark .priority-tile { background: var(--ict-input-bg); }
html.dark .priority-tile.active { background: var(--ict-brand-soft); }
html.dark .stat-card.danger .stat-icon { background: rgba(248,113,113,0.15); }
html.dark .stat-card.info .stat-icon { background: rgba(96,165,250,0.15); }
html.dark h1, html.dark h2, html.dark h3, html.dark h4, html.dark .display-font { color: var(--ict-ink); }
html.dark .ticket-subject { color: var(--ict-ink); }
html.dark .btn-ict {
  background: linear-gradient(180deg, #e8a04a 0%, #b7670f 100%);
  border-color: #b7670f;
  color: #fff;
}
html.dark .btn-ict:hover {
  background: var(--ict-brand-hover);
  border-color: var(--ict-brand-hover);
  color: #1c1005;
}

/* Empty states */
.empty-state {
  text-align: center;
  padding: 2rem 1.25rem;
  max-width: 22rem;
  margin: 0 auto;
}
.empty-state-icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 0.85rem;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--ict-brand-soft);
  color: var(--ict-brand);
  font-size: 1.35rem;
}
.empty-state-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  margin: 0 0 0.35rem;
  color: var(--ict-ink);
}
.empty-state-body {
  margin: 0;
  font-size: 0.875rem;
  color: var(--ict-muted);
  line-height: 1.5;
}

.text-brand-success { color: var(--ict-success) !important; }
.online-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ict-success);
  display: inline-block;
}

.auth-input-wrap.has-toggle .form-control { padding-right: 2.75rem; }
.auth-password-toggle {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  border: 0;
  background: transparent;
  color: var(--ict-muted);
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 6px;
  display: grid;
  place-items: center;
}
.auth-password-toggle:hover { color: var(--ict-brand); background: var(--ict-brand-soft); }

.secret-box {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  user-select: all;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--ict-border);
  border-radius: 8px;
  background: var(--ict-input-bg);
  color: var(--ict-ink);
  word-break: break-all;
}

.notif-item {
  display: block;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--ict-border);
  text-decoration: none;
  color: inherit;
}
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { color: inherit; }
.notif-item.unread { background: linear-gradient(90deg, var(--ict-brand-soft), transparent); padding-left: 0.65rem; margin-left: -0.65rem; border-radius: 8px; }
.notif-item .title { font-weight: 500; color: var(--ict-ink); }
.notif-item.unread .title { font-weight: 650; }
.notif-meta { font-size: 0.78rem; color: var(--ict-muted); margin-top: 0.15rem; }

.profile-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.profile-header .user-avatar {
  width: 3.25rem;
  height: 3.25rem;
  font-size: 1rem;
}

.error-code {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--ict-brand);
  line-height: 1;
  margin: 0 0 0.5rem;
}

.detail-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

@media print {
  .dash-sidebar,
  .dash-topbar,
  .dash-footer,
  .mobile-nav,
  .sidebar-backdrop,
  .theme-toggle,
  .detail-toolbar,
  .thread-composer,
  .no-print,
  .dash-content form,
  .dash-content .btn {
    display: none !important;
  }
  .dash-layout,
  .dash-body,
  .dash-main,
  .dash-content {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #fff !important;
    color: #000 !important;
  }
  .panel {
    break-inside: avoid;
    box-shadow: none !important;
    border: 1px solid #ccc !important;
  }
  .detail-sticky-sla { position: static !important; }
  a { color: #000 !important; text-decoration: none !important; }
  .empty-state { display: none !important; }
}
