/* ============================================================
   Yonlada ERP — Luxury SaaS Theme
   Dark sidebar (burnt sienna) + cream content + refined typography
   ============================================================ */

:root {
  /* === Brand: Yonlada burnt-orange palette === */
  --brand-50:  #FCF4EB;
  --brand-100: #F8E5CC;
  --brand-200: #F2C797;
  --brand-300: #E9A560;
  --brand-400: #DC8536;
  --brand-500: #C66A1F;   /* Primary — Yonlada burnt orange */
  --brand-600: #A85416;
  --brand-700: #864011;
  --brand-800: #6B3210;
  --brand-900: #4A220A;
  --brand-950: #2B130A;   /* darkest — sidebar */

  /* === Cream / warm neutrals === */
  --cream-50:  #FCFAF5;
  --cream-100: #F8F4EB;
  --cream-200: #F0E9DA;
  --cream-300: #E6DCC4;
  --cream-400: #C8B79A;
  --cream-500: #A89572;

  /* === Surfaces === */
  --bg-app:       #FAF7F0;       /* warm cream */
  --bg-surface:   #FFFFFF;
  --bg-elevated:  #FFFFFF;
  --bg-hover:     #F5EFE3;
  --bg-active:    var(--brand-50);
  --bg-muted:     #FBF8F1;

  /* === Sidebar dark === */
  --sidebar-bg:        #2B130A;  /* deep brown */
  --sidebar-bg-2:      #38180D;  /* slightly lighter */
  --sidebar-border:    #4A220A;
  --sidebar-text:      #E6DCC4;
  --sidebar-text-soft: #9C8466;
  --sidebar-text-strong: #FCFAF5;
  --sidebar-hover:     rgba(255,255,255,0.06);
  --sidebar-active:    var(--brand-500);

  /* === Text === */
  --text-primary:   #2D1810;  /* warm dark brown */
  --text-secondary: #6B5841;
  --text-muted:     #9C8466;
  --text-inverse:   #FFFFFF;

  /* === Borders === */
  --border:        #E8DDC9;
  --border-soft:   #F0E9D8;
  --border-strong: #D4C5A5;

  /* === Brand application === */
  --primary:        var(--brand-500);
  --primary-hover:  var(--brand-600);
  --primary-active: var(--brand-700);
  --primary-soft:   var(--brand-50);
  --primary-text:   var(--brand-700);

  /* === Semantic === */
  --success:        #2E7D32;
  --success-soft:   #E8F5E9;
  --warning:        #C77700;
  --warning-soft:   #FFF4E0;
  --danger:         #C0392B;
  --danger-soft:    #FBEAE8;
  --info:           #0F6FB0;
  --info-soft:      #E5F0F8;

  /* === Tone variants (refreshed warm palette) === */
  --tone-brand:    var(--brand-500); --tone-brand-soft:   var(--brand-50);
  --tone-emerald:  #2E7D32;          --tone-emerald-soft: #E8F5E9;
  --tone-amber:    #C77700;          --tone-amber-soft:   #FFF4E0;
  --tone-rose:     #C0392B;          --tone-rose-soft:    #FBEAE8;
  --tone-violet:   #6E3B96;          --tone-violet-soft:  #F1E8F7;
  --tone-blue:     #0F6FB0;          --tone-blue-soft:    #E5F0F8;
  --tone-teal:     #0F766E;          --tone-teal-soft:    #E0F2F0;

  /* === Layout === */
  --sidebar-w:  264px;
  --topbar-h:   68px;
  --radius-sm:  6px;
  --radius:     10px;
  --radius-lg:  14px;
  --radius-xl:  18px;

  /* === Shadows (warmer/softer) === */
  --shadow-xs: 0 1px 2px rgba(75, 50, 30, 0.04);
  --shadow-sm: 0 1px 3px rgba(75, 50, 30, 0.06), 0 1px 2px rgba(75, 50, 30, 0.04);
  --shadow-md: 0 4px 14px rgba(75, 50, 30, 0.08), 0 2px 6px rgba(75, 50, 30, 0.04);
  --shadow-lg: 0 16px 32px rgba(75, 50, 30, 0.12), 0 4px 12px rgba(75, 50, 30, 0.06);
  --shadow-brand: 0 6px 18px rgba(198, 106, 31, 0.25);

  /* === Type === */
  --font-sans: 'Inter', 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Playfair Display', 'Inter', 'Sarabun', serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;
}

/* ====== Reset / base ====== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-primary);
  background:
    radial-gradient(ellipse 1200px 600px at 80% -10%, rgba(220, 133, 54, 0.07) 0%, transparent 60%),
    radial-gradient(ellipse 800px 500px at -10% 110%, rgba(198, 106, 31, 0.05) 0%, transparent 55%),
    var(--bg-app);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11', 'ss01', 'ss03';
  letter-spacing: -0.003em;
}

/* Custom scrollbars (warm) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--cream-300); border-radius: 5px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--cream-400); background-clip: padding-box; border: 2px solid transparent; }

/* Selection */
::selection { background: var(--brand-200); color: var(--brand-900); }

/* Subtle page fade-in */
.content > * { animation: pageFadeIn 0.32s ease-out both; }
.content > *:nth-child(2) { animation-delay: 0.04s; }
.content > *:nth-child(3) { animation-delay: 0.08s; }
.content > *:nth-child(4) { animation-delay: 0.12s; }
@keyframes pageFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
button { font-family: inherit; cursor: pointer; }
img, svg { display: block; max-width: 100%; }
h1,h2,h3,h4,h5,h6 { margin: 0; font-weight: 600; color: var(--text-primary); letter-spacing: -0.012em; }
h1 { font-size: 24px; line-height: 1.25; }
h2 { font-size: 20px; line-height: 1.3; }
h3 { font-size: 17px; line-height: 1.35; }
p { margin: 0; }
small { font-size: 12px; color: var(--text-muted); }
code { font-family: var(--font-mono); font-size: 0.92em; }

/* ====== Layout shell ====== */
.app-shell { display: flex; min-height: 100vh; background: var(--bg-app); }

/* ============================================================
   SIDEBAR — DARK LUXURY
   ============================================================ */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
  color: var(--sidebar-text);
  border-right: 1px solid var(--sidebar-border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  flex-shrink: 0;
}

.sidebar__brand {
  display: flex; align-items: center; gap: 12px;
  padding: 22px 22px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar__brand-mark {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  color: var(--brand-400);
  background: linear-gradient(135deg, rgba(220,133,54,0.18), rgba(198,106,31,0.08));
  border-radius: 10px;
  border: 1px solid rgba(220,133,54,0.22);
}
.sidebar__brand-mark svg { width: 24px; height: 24px; }
.sidebar__brand-text { line-height: 1.2; }
.sidebar__brand-name {
  font-weight: 700; font-size: 15px;
  color: var(--sidebar-text-strong);
  letter-spacing: 0.06em;
}
.sidebar__brand-tag {
  font-size: 10.5px;
  color: var(--sidebar-text-soft);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-top: 2px;
}

.sidebar__search { padding: 14px 16px 6px; position: relative; }
.sidebar__search input {
  width: 100%;
  padding: 9px 12px 9px 36px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.04);
  font-size: 13px;
  color: var(--sidebar-text);
  transition: border-color 0.15s, background 0.15s;
}
.sidebar__search input::placeholder { color: var(--sidebar-text-soft); }
.sidebar__search input:focus {
  outline: none;
  border-color: rgba(220,133,54,0.45);
  background: rgba(255,255,255,0.06);
  box-shadow: 0 0 0 3px rgba(198,106,31,0.18);
}
.sidebar__search-icon { position: absolute; left: 27px; top: 50%; transform: translateY(-30%); color: var(--sidebar-text-soft); pointer-events: none; }

.sidebar__nav { flex: 1; overflow-y: auto; padding: 8px 12px 14px; }
.sidebar__nav::-webkit-scrollbar { width: 4px; }
.sidebar__nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 2px; }

.nav-group { margin-top: 16px; }
.nav-group__label {
  font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--sidebar-text-soft);
  padding: 4px 12px 8px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 8.5px 12px; margin: 1px 0;
  border-radius: var(--radius);
  color: var(--sidebar-text);
  font-size: 13.5px; font-weight: 500;
  transition: background 0.12s, color 0.12s;
  cursor: pointer;
  position: relative;
}
.nav-item:hover { background: var(--sidebar-hover); color: var(--sidebar-text-strong); }
.nav-item--active {
  background: linear-gradient(90deg, rgba(220,133,54,0.16), rgba(220,133,54,0.04));
  color: var(--sidebar-text-strong);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--brand-400);
}
.nav-item--active .nav-item__icon { color: var(--brand-300); }
.nav-item__icon { color: var(--sidebar-text-soft); flex-shrink: 0; }
.nav-item:hover .nav-item__icon { color: var(--sidebar-text-strong); }
.nav-item__label { flex: 1; }
.nav-item__badge {
  font-size: 10px; font-weight: 600;
  padding: 1px 7px; border-radius: 999px;
  background: rgba(255,255,255,0.08); color: var(--sidebar-text);
}

.sidebar__footer {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 11px;
  background: rgba(0,0,0,0.15);
}
.sidebar__avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-400), var(--brand-600));
  color: white; display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.sidebar__user { flex: 1; min-width: 0; }
.sidebar__user-name {
  font-size: 13px; font-weight: 600;
  color: var(--sidebar-text-strong);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar__user-role { font-size: 11px; color: var(--sidebar-text-soft); }
.sidebar__logout {
  color: var(--sidebar-text-soft);
  background: none; border: none; padding: 7px;
  border-radius: 8px;
  transition: background 0.12s, color 0.12s;
}
.sidebar__logout:hover { background: rgba(255,255,255,0.08); color: #FF6B6B; }

/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg-app); }

.topbar {
  height: var(--topbar-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-soft);
  display: flex; align-items: center; gap: 16px;
  padding: 0 32px;
  position: sticky; top: 0; z-index: 10;
}
.topbar__title { flex: 1; }
.topbar__title h1 { font-size: 19px; font-weight: 600; }
.topbar__crumbs { font-size: 12px; color: var(--text-muted); margin-bottom: 3px; letter-spacing: 0.02em; }
.topbar__crumbs span + span::before { content: '/'; margin: 0 6px; color: var(--border-strong); }
.topbar__actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-soft);
  background: var(--bg-surface);
  border-radius: var(--radius);
  color: var(--text-secondary);
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.08s ease;
  cursor: pointer;
}
.icon-btn:hover {
  background: var(--brand-50); color: var(--primary); border-color: var(--brand-200);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(198, 106, 31, 0.12);
}
.icon-btn:active { transform: translateY(0); }
.icon-btn--badge { position: relative; }
.icon-btn--badge::after {
  content: ''; position: absolute; top: 8px; right: 9px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--danger); border: 2px solid var(--bg-surface);
}

.content { padding: 32px 36px 56px; max-width: 1600px; margin: 0 auto; width: 100%; }

/* Page hero header */
.page-hero {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 18px; margin-bottom: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border-soft);
  position: relative;
}
.page-hero::after {
  content: ''; position: absolute; bottom: -1px; left: 0; width: 80px; height: 2px;
  background: linear-gradient(90deg, var(--brand-500), transparent);
}
.page-hero__title { font-size: 28px; font-weight: 700; letter-spacing: -0.025em; color: var(--text-primary); margin-bottom: 4px; }
.page-hero__sub { font-size: 14px; color: var(--text-secondary); }
.page-hero__actions { display: flex; gap: 8px; }

/* ====== FLASH MESSAGES ====== */
.flash {
  margin-bottom: 18px;
  padding: 14px 18px;
  border-radius: var(--radius);
  border-left: 4px solid;
  display: flex; gap: 12px; align-items: flex-start;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
  animation: flash-in 0.3s ease-out;
}
@keyframes flash-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.flash--success { background: var(--success-soft); border-color: var(--success); color: var(--success); }
.flash--danger  { background: var(--danger-soft);  border-color: var(--danger);  color: var(--danger); }
.flash--warning { background: var(--warning-soft); border-color: var(--warning); color: var(--warning); }
.flash--info    { background: var(--info-soft);    border-color: var(--info);    color: var(--info); }
.flash__close { margin-left: auto; background: none; border: none; cursor: pointer; color: inherit; opacity: 0.6; padding: 4px; }
.flash__close:hover { opacity: 1; }

/* ====== Cards — Premium luxurious feel ====== */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  box-shadow:
    0 1px 2px rgba(75, 50, 30, 0.04),
    0 1px 1px rgba(75, 50, 30, 0.02);
  transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
  position: relative;
}
.card:hover {
  box-shadow:
    0 4px 16px rgba(75, 50, 30, 0.08),
    0 1px 3px rgba(75, 50, 30, 0.04),
    0 0 0 1px rgba(198, 106, 31, 0.04);
  border-color: var(--border);
}
.card__header {
  padding: 22px 26px;
  border-bottom: 1px solid var(--border-soft);
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px;
}
.card__title {
  font-size: 16px; font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}
.card__body { padding: 26px; }
.card__footer { padding: 18px 26px; border-top: 1px solid var(--border-soft); display: flex; gap: 10px; justify-content: flex-end; }

/* Premium card variant with subtle gradient border */
.card--premium {
  background:
    linear-gradient(var(--bg-surface), var(--bg-surface)) padding-box,
    linear-gradient(135deg, var(--brand-200), var(--cream-200)) border-box;
  border: 1px solid transparent;
}

/* ====== Grid ====== */
.grid { display: grid; gap: 18px; }
.grid--kpi { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--12-7-5 { grid-template-columns: 7fr 5fr; }
@media (max-width: 1024px) { .grid--3, .grid--2, .grid--12-7-5 { grid-template-columns: 1fr; } }

/* ====== KPI tiles — Premium wow factor ====== */
.kpi {
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  padding: 24px 26px;
  display: flex; flex-direction: column; gap: 14px;
  transition: box-shadow 0.28s ease, transform 0.28s ease, border-color 0.28s ease;
  position: relative; overflow: hidden;
  box-shadow:
    0 1px 2px rgba(75, 50, 30, 0.04),
    0 1px 1px rgba(75, 50, 30, 0.02);
}
.kpi::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--brand-400), transparent);
  opacity: 0; transition: opacity 0.28s ease;
}
.kpi::after {
  content: ''; position: absolute; top: 0; right: 0; bottom: 0; width: 50%;
  background: radial-gradient(ellipse at top right, rgba(220, 133, 54, 0.04), transparent 70%);
  pointer-events: none;
  opacity: 0; transition: opacity 0.28s ease;
}
.kpi:hover {
  box-shadow:
    0 12px 28px rgba(75, 50, 30, 0.10),
    0 4px 8px rgba(75, 50, 30, 0.04),
    0 0 0 1px rgba(198, 106, 31, 0.06);
  transform: translateY(-2px);
  border-color: var(--border);
}
.kpi:hover::before { opacity: 1; }
.kpi:hover::after { opacity: 1; }
.kpi__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.kpi__label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.kpi__icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(75, 50, 30, 0.06);
}
.kpi__icon [data-lucide] { width: 20px; height: 20px; stroke-width: 2; }
.kpi__value {
  font-size: 32px; font-weight: 700;
  letter-spacing: -0.028em;
  color: var(--text-primary);
  display: flex; align-items: baseline; gap: 8px;
  font-family: var(--font-sans);
  font-feature-settings: 'tnum';
  line-height: 1.1;
}
.kpi__unit  { font-size: 14px; font-weight: 500; color: var(--text-muted); }
.kpi__delta { font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.kpi__delta--up   { color: var(--success); }
.kpi__delta--down { color: var(--danger); }
.kpi__sub { font-size: 12px; color: var(--text-muted); letter-spacing: 0.01em; }

/* KPI hero variant (extra large for executive dashboard) */
.kpi--hero { padding: 28px 30px; }
.kpi--hero .kpi__value { font-size: 38px; }
.kpi--hero .kpi__icon { width: 52px; height: 52px; border-radius: 14px; }

.tone-brand   .kpi__icon { background: var(--tone-brand-soft);   color: var(--tone-brand); }
.tone-blue    .kpi__icon { background: var(--tone-blue-soft);    color: var(--tone-blue); }
.tone-emerald .kpi__icon { background: var(--tone-emerald-soft); color: var(--tone-emerald); }
.tone-amber   .kpi__icon { background: var(--tone-amber-soft);   color: var(--tone-amber); }
.tone-rose    .kpi__icon { background: var(--tone-rose-soft);    color: var(--tone-rose); }
.tone-violet  .kpi__icon { background: var(--tone-violet-soft);  color: var(--tone-violet); }
.tone-teal    .kpi__icon { background: var(--tone-teal-soft);    color: var(--tone-teal); }

/* ====== Buttons — Premium with shine effect ====== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 13.5px; font-weight: 500;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.08s ease;
  font-family: inherit;
  position: relative; overflow: hidden;
  letter-spacing: 0.005em;
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: linear-gradient(135deg, var(--brand-500) 0%, var(--brand-600) 100%);
  color: white;
  box-shadow:
    var(--shadow-brand),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.btn--primary::before {
  content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.18) 50%, transparent 70%);
  transition: left 0.55s ease;
}
.btn--primary:hover {
  background: linear-gradient(135deg, var(--brand-600) 0%, var(--brand-700) 100%);
  color: white;
  box-shadow:
    0 8px 22px rgba(198, 106, 31, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}
.btn--primary:hover::before { left: 100%; }
.btn--secondary {
  background: var(--bg-surface); color: var(--text-primary); border-color: var(--border);
}
.btn--secondary:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.btn--ghost     { background: transparent; color: var(--text-secondary); }
.btn--ghost:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn--danger    { background: var(--danger); color: white; border-color: var(--danger); }
.btn--danger:hover { background: #A02B1F; border-color: #A02B1F; color: white; }
.btn--success    { background: var(--success); color: white; }
.btn--success:hover { background: #1E5A21; color: white; }
.btn--block     { width: 100%; justify-content: center; padding: 11px 16px; }
.btn--sm        { padding: 6px 11px; font-size: 12px; }
.btn--lg        { padding: 12px 22px; font-size: 14.5px; }

/* ====== Forms ====== */
.form-group { margin-bottom: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-row--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 720px) { .form-row, .form-row--3 { grid-template-columns: 1fr; } }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--text-primary); margin-bottom: 6px; }
.form-label .required { color: var(--danger); margin-left: 3px; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px; font-family: inherit;
  background: var(--bg-surface);
  color: var(--text-primary);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  font-feature-settings: 'tnum';
}
.form-input:hover, .form-select:hover, .form-textarea:hover {
  border-color: var(--border-strong);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(198, 106, 31, 0.12);
  background: var(--bg-surface);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--cream-500); }
.form-input--error, .form-select--error, .form-textarea--error { border-color: var(--danger); }
.form-input--error:focus { box-shadow: 0 0 0 3px var(--danger-soft); }
.form-textarea { min-height: 80px; resize: vertical; }
.form-help { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 5px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; padding-top: 12px; border-top: 1px solid var(--border-soft); margin-top: 8px; }

/* File upload */
.form-file {
  display: flex; align-items: center; gap: 10px;
  padding: 16px;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-muted);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.form-file:hover { border-color: var(--primary); background: var(--brand-50); }
.form-file input[type="file"] { display: none; }

/* ====== Tables — Premium refined ====== */
.table-wrap { overflow-x: auto; border-radius: 0 0 18px 18px; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.table th {
  font-weight: 600; color: var(--text-secondary);
  background: linear-gradient(180deg, var(--bg-muted), var(--cream-100));
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky; top: 0; z-index: 1;
}
.table tbody tr { transition: background 0.15s ease, box-shadow 0.15s ease; }
.table tbody tr:hover {
  background: linear-gradient(90deg, var(--brand-50) 0%, var(--bg-muted) 100%);
  box-shadow: inset 3px 0 0 var(--brand-400);
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody td { color: var(--text-primary); }
.table tbody code {
  background: var(--cream-100); padding: 2px 7px; border-radius: 5px;
  color: var(--brand-700); font-weight: 500; font-size: 11.5px;
}
.table-actions { display: flex; gap: 4px; justify-content: flex-end; }
.table-actions .icon-btn { width: 32px; height: 32px; }
.table-actions .icon-btn--danger:hover { background: var(--danger-soft); border-color: #F5C2BD; color: var(--danger); }
/* Workflow handoff button — burnt-orange brand accent (one-click create downstream record) */
.icon-btn--brand { color: var(--brand-600); border-color: var(--brand-200, #F0D9C8); background: var(--brand-50, #FBF3EC); }
.icon-btn--brand:hover { background: var(--brand-100, #F5E6D8); border-color: var(--brand-300, #E6C2A3); color: var(--brand-700); }

/* ====== Badges ====== */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.badge--success { background: var(--success-soft); color: var(--success); }
.badge--warning { background: var(--warning-soft); color: var(--warning); }
.badge--danger  { background: var(--danger-soft);  color: var(--danger); }
.badge--info    { background: var(--info-soft);    color: var(--info); }
.badge--brand   { background: var(--brand-50);     color: var(--brand-700); }
.badge--neutral { background: var(--cream-200);    color: var(--text-secondary); }

/* ====== Alerts ====== */
.alert { padding: 12px 16px; border-radius: var(--radius); border: 1px solid; font-size: 13px; display: flex; gap: 10px; align-items: flex-start; }
.alert--danger  { background: var(--danger-soft);  border-color: #F0B5AE; color: var(--danger); }
.alert--success { background: var(--success-soft); border-color: #B5DAB8; color: var(--success); }
.alert--warning { background: var(--warning-soft); border-color: #FAD7A0; color: var(--warning); }
.alert--info    { background: var(--info-soft);    border-color: #B5D5EB; color: var(--info); }

/* ====== Modal ====== */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(43, 19, 10, 0.45);
  backdrop-filter: blur(2px);
  z-index: 100; display: none; align-items: center; justify-content: center;
  animation: fade-in 0.18s ease-out;
}
.modal-backdrop.is-open { display: flex; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 480px;
  margin: 20px;
  animation: modal-in 0.22s ease-out;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(-8px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal__header { padding: 22px 24px; border-bottom: 1px solid var(--border-soft); }
.modal__body { padding: 24px; }
.modal__footer { padding: 16px 24px; border-top: 1px solid var(--border-soft); display: flex; gap: 10px; justify-content: flex-end; }

/* ====== Auth page — luxury ====== */
.auth-shell {
  min-height: 100vh;
  display: grid; grid-template-columns: 1.1fr 1fr;
  background: var(--bg-app);
}
@media (max-width: 900px) { .auth-shell { grid-template-columns: 1fr; } .auth-art { display: none; } }
.auth-art {
  background: linear-gradient(135deg, var(--brand-700) 0%, var(--brand-900) 60%, var(--brand-950) 100%);
  color: var(--cream-100);
  display: flex; align-items: center; justify-content: center;
  padding: 60px;
  position: relative; overflow: hidden;
}
.auth-art::before, .auth-art::after {
  content: ''; position: absolute; border-radius: 50%;
  background: radial-gradient(circle, rgba(220,133,54,0.18) 0%, transparent 70%);
}
.auth-art::before { width: 520px; height: 520px; top: -160px; right: -120px; }
.auth-art::after  { width: 360px; height: 360px; bottom: -100px; left: -100px; background: radial-gradient(circle, rgba(220,133,54,0.12) 0%, transparent 70%); }
.auth-art__content { position: relative; max-width: 460px; z-index: 1; }
.auth-art__brand { display: flex; align-items: center; gap: 14px; margin-bottom: 64px; }
.auth-art__mark {
  width: 56px; height: 56px; border-radius: 14px;
  background: rgba(252,250,245,0.08); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  color: var(--cream-100);
  border: 1px solid rgba(252,250,245,0.14);
}
.auth-art__mark svg { width: 34px; height: 34px; }
.auth-art h2 {
  color: var(--cream-50); font-size: 36px; line-height: 1.18; font-weight: 700;
  margin-bottom: 18px; letter-spacing: -0.025em;
}
.auth-art p  { color: rgba(252,250,245,0.85); font-size: 15px; line-height: 1.65; }
.auth-art__features { margin-top: 38px; display: flex; flex-direction: column; gap: 14px; }
.auth-art__feature { display: flex; align-items: center; gap: 12px; font-size: 14px; color: rgba(252,250,245,0.92); }
.auth-art__feature-dot {
  width: 24px; height: 24px; border-radius: 7px;
  background: rgba(220,133,54,0.22);
  display: flex; align-items: center; justify-content: center;
  color: var(--brand-300);
}

.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card__brand-mobile { display: none; }
@media (max-width: 900px) { .auth-card__brand-mobile { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; color: var(--brand-600); } }
.auth-card__title { font-size: 26px; font-weight: 700; margin-bottom: 6px; letter-spacing: -0.02em; }
.auth-card__sub   { color: var(--text-secondary); font-size: 14px; margin-bottom: 30px; }
.auth-card__footer { text-align: center; font-size: 12.5px; color: var(--text-muted); margin-top: 30px; letter-spacing: 0.04em; }
.auth-card__hint   { background: var(--brand-50); border: 1px solid var(--brand-100); color: var(--brand-700); border-radius: var(--radius); padding: 11px 13px; font-size: 12px; margin-top: 20px; }

/* ====== Misc / utility ====== */
.row     { display: flex; align-items: center; gap: 8px; }
.row--between { justify-content: space-between; }
.mt-2 { margin-top: 8px; }   .mt-3 { margin-top: 12px; }   .mt-4 { margin-top: 16px; }   .mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-sm { font-size: 12.5px; }
.text-xs { font-size: 11.5px; }
.text-right { text-align: right; }
.text-center { text-align: center; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state__icon { width: 56px; height: 56px; border-radius: 14px; background: var(--bg-hover); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 14px; color: var(--text-secondary); }

[data-lucide] { width: 18px; height: 18px; stroke-width: 1.75; }
.icon-sm [data-lucide] { width: 14px; height: 14px; }
.icon-lg [data-lucide] { width: 22px; height: 22px; }

/* ====== Sub-navigation — Luxury dark command bar (matches sidebar) ====== */
/* Wrapper added by JS when subnav overflows; carries the left/right arrows. */
.subnav-wrap {
  position: relative;
  margin-bottom: 24px;
}
.subnav-wrap > .subnav { margin-bottom: 0; }
.subnav {
  position: relative;
  display: flex; gap: 6px; align-items: center;
  background:
    radial-gradient(ellipse 420px 90px at 8% 0%, rgba(220, 133, 54, 0.20) 0%, transparent 60%),
    radial-gradient(ellipse 360px 80px at 96% 100%, rgba(198, 106, 31, 0.14) 0%, transparent 55%),
    linear-gradient(135deg, #3A1A0E 0%, var(--brand-950) 55%, #1E0C05 100%);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 0;                       /* SQUARE corners */
  padding: 7px 7px 9px;                   /* extra bottom for scrollbar */
  margin-bottom: 24px;
  overflow-x: auto;
  overflow-y: hidden;
  /* Visible thin scrollbar — Firefox */
  scrollbar-width: thin;
  scrollbar-color: rgba(220, 133, 54, 0.55) rgba(255, 255, 255, 0.04);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 10px 26px rgba(43, 19, 10, 0.26),
    0 3px 8px rgba(43, 19, 10, 0.16);
}
/* Visible thin scrollbar — WebKit/Blink */
.subnav::-webkit-scrollbar { height: 7px; background: transparent; }
.subnav::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  margin: 0 4px;
}
.subnav::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, rgba(220, 133, 54, 0.55), rgba(198, 106, 31, 0.6));
  border-radius: 0;
}
.subnav::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(90deg, rgba(220, 133, 54, 0.85), rgba(198, 106, 31, 0.9));
}
.subnav::before {
  /* gold hairline along the top edge */
  content: '';
  position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(242, 199, 151, 0.55) 16%, rgba(242, 199, 151, 0.18) 55%, transparent 92%);
  pointer-events: none;
}
/* Left/right scroll arrows — only shown when JS detects overflow */
.subnav-arrow {
  position: absolute; top: 0; bottom: 0; width: 38px;
  display: none; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--brand-500) 0%, var(--brand-600) 100%);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 0;
  cursor: pointer;
  font-size: 22px; font-weight: 700; line-height: 1;
  font-family: var(--font-display);
  z-index: 3;
  transition: opacity 0.15s, background 0.15s, transform 0.12s;
  user-select: none;
}
.subnav-wrap.is-scrollable .subnav-arrow { display: flex; }
.subnav-arrow--left  { left: 0;  box-shadow: 6px 0 14px rgba(43, 19, 10, 0.50); }
.subnav-arrow--right { right: 0; box-shadow: -6px 0 14px rgba(43, 19, 10, 0.50); }
.subnav-arrow:hover { background: linear-gradient(135deg, var(--brand-400) 0%, var(--brand-500) 100%); }
.subnav-arrow:active { transform: scale(0.96); }
.subnav-arrow.is-disabled { opacity: 0.25; pointer-events: none; }
/* When arrows are present, leave room so they don't overlap edge items */
.subnav-wrap.is-scrollable > .subnav {
  padding-left: 46px;
  padding-right: 46px;
}
.subnav__item {
  position: relative;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 15px;
  font-size: 13px; font-weight: 500;
  letter-spacing: 0.1px;
  color: var(--sidebar-text);
  border-radius: 0;                       /* SQUARE corners */
  white-space: nowrap;
  flex: 0 0 auto;
  transition: background 0.16s, color 0.16s, transform 0.16s, box-shadow 0.16s;
  animation: subnavItemIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.subnav__item:nth-child(1)  { animation-delay: 0.02s; }
.subnav__item:nth-child(2)  { animation-delay: 0.05s; }
.subnav__item:nth-child(3)  { animation-delay: 0.08s; }
.subnav__item:nth-child(4)  { animation-delay: 0.11s; }
.subnav__item:nth-child(5)  { animation-delay: 0.14s; }
.subnav__item:nth-child(6)  { animation-delay: 0.17s; }
.subnav__item:nth-child(7)  { animation-delay: 0.20s; }
.subnav__item:nth-child(8)  { animation-delay: 0.23s; }
.subnav__item:nth-child(9)  { animation-delay: 0.26s; }
.subnav__item:nth-child(10) { animation-delay: 0.28s; }
.subnav__item:nth-child(n+11) { animation-delay: 0.30s; }
.subnav__item [data-lucide] {
  width: 15px; height: 15px;
  color: var(--brand-300);
  transition: color 0.16s, transform 0.16s;
}
.subnav__item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--sidebar-text-strong);
  transform: translateY(-1px);
}
.subnav__item:hover [data-lucide] { color: var(--brand-200); transform: scale(1.12); }
.subnav__item--active {
  background: linear-gradient(135deg, var(--brand-400) 0%, var(--brand-500) 55%, var(--brand-600) 100%);
  color: #fff;
  font-weight: 600;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 4px 14px rgba(198, 106, 31, 0.45),
    0 1px 4px rgba(43, 19, 10, 0.30);
}
.subnav__item--active [data-lucide] { color: #fff; }
.subnav__item--active::after {
  /* lit cream indicator inside the active pill */
  content: '';
  position: absolute; left: 14px; right: 14px; bottom: 4px; height: 2px;
  border-radius: 0;                       /* SQUARE — matches container */
  background: linear-gradient(90deg, rgba(252, 244, 235, 0), rgba(252, 244, 235, 0.85), rgba(252, 244, 235, 0));
}
.subnav__item--active:hover { transform: none; color: #fff; }
@keyframes subnavItemIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .subnav__item { animation: none; }
}

/* Org-link card hover */
.org-link { transition: transform 0.18s, box-shadow 0.18s; }
.org-link:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }

/* Progress bars */
.progress-track { background: var(--cream-200); height: 8px; border-radius: 4px; overflow: hidden; }
.progress-track--sm { height: 6px; border-radius: 3px; }
.progress-bar { height: 100%; border-radius: inherit; transition: width 0.4s; }
.progress-bar--primary  { background: linear-gradient(90deg, var(--brand-500), var(--brand-700)); }
.progress-bar--emerald  { background: linear-gradient(90deg, #2E7D32, #1E5A21); }
.progress-bar--amber    { background: linear-gradient(90deg, #C77700, #8C5500); }
.progress-bar--rose     { background: linear-gradient(90deg, #C0392B, #8B281D); }
.progress-bar--blue     { background: linear-gradient(90deg, #0F6FB0, #0B5485); }
.progress-bar--danger   { background: var(--danger); }

/* Gradient backgrounds */
.bg-gradient-primary { background: linear-gradient(135deg, var(--brand-500), var(--brand-700)); color: white; }
.bg-gradient-rose-dark { background: linear-gradient(135deg, var(--danger), #8B281D); color: white; }

/* Summary card */
.summary-card {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 14px;
  background: var(--bg-surface);
  transition: box-shadow 0.18s, transform 0.18s;
}
.summary-card:hover { box-shadow: var(--shadow-md); }

/* ============================================================
   V2 PREMIUM SAAS LAYER
   Modular components on top of the base theme. Used across all
   hub pages, list views, and forms after the June 2026 polish.
   Conventions:
     .v2-*   wrapper / layout classes
     .stat-* premium KPI/metric tiles
     .hero-* hub-level hero band with brand gradient
     .seg-*  segmented control (sub-tabs without page reload)
     .pulse  status dot with breathing animation
     .sk-*   skeleton placeholder shimmer
   ============================================================ */

/* ---------- Hub hero band ---------- */
.hero {
  position: relative;
  border-radius: 22px;
  padding: 30px 34px 28px;
  margin-bottom: 26px;
  overflow: hidden;
  background:
    radial-gradient(circle at 90% 10%, rgba(220,133,54,0.18) 0%, transparent 55%),
    radial-gradient(circle at 5% 110%, rgba(110,59,150,0.10) 0%, transparent 55%),
    linear-gradient(135deg, #2B130A 0%, #4A220A 50%, #864011 100%);
  color: var(--cream-50);
  box-shadow:
    0 14px 36px rgba(75, 50, 30, 0.18),
    0 4px 12px rgba(75, 50, 30, 0.08),
    inset 0 1px 0 rgba(255,255,255,0.06);
  border: 1px solid rgba(220,133,54,0.16);
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(45deg, transparent 0 18px, rgba(255,255,255,0.012) 18px 36px),
    radial-gradient(circle at 50% 0%, rgba(220,133,54,0.20) 0%, transparent 60%);
  pointer-events: none;
}
.hero__row { position: relative; display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.hero__main { flex: 1 1 360px; min-width: 0; }
.hero__crumbs {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase;
  font-weight: 600;
  color: rgba(252, 244, 235, 0.62);
  margin-bottom: 12px;
}
.hero__crumbs [data-lucide] { width: 12px; height: 12px; opacity: 0.5; }
.hero__title {
  font-family: var(--font-display);
  font-size: 32px; font-weight: 700;
  letter-spacing: -0.02em; line-height: 1.15;
  color: var(--cream-50);
  margin-bottom: 8px;
}
.hero__lede { font-size: 14.5px; line-height: 1.6; color: rgba(252, 244, 235, 0.78); max-width: 56ch; }
.hero__chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.hero__chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(252, 244, 235, 0.92);
  backdrop-filter: blur(6px);
}
.hero__chip [data-lucide] { width: 12px; height: 12px; }
.hero__chip--accent { background: linear-gradient(135deg, var(--brand-500), var(--brand-700)); border-color: transparent; color: white; box-shadow: var(--shadow-brand); }
.hero__cta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; position: relative; }
.hero__cta .btn--ghost { color: rgba(252,244,235,0.9); background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); }
.hero__cta .btn--ghost:hover { color: white; background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.20); }

/* Subtle module mark in the hero (the lucide module icon) */
.hero__mark {
  position: absolute; right: -10px; bottom: -30px;
  width: 200px; height: 200px;
  opacity: 0.06;
  display: flex; align-items: center; justify-content: center;
  color: var(--cream-50);
  pointer-events: none;
}
.hero__mark [data-lucide] { width: 200px; height: 200px; stroke-width: 1.5; }

/* ---------- Premium stat tiles (replaces ad-hoc count cards in hubs) ---------- */
.stat-grid { display: grid; gap: 16px; margin-bottom: 26px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.stat-card {
  position: relative;
  display: flex; flex-direction: column; gap: 14px;
  padding: 22px 24px;
  background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-muted) 130%);
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, currentColor 0%, transparent 80%);
  opacity: 0; transition: opacity 0.22s ease;
}
.stat-card::after {
  content: ''; position: absolute; top: -40px; right: -40px;
  width: 140px; height: 140px; border-radius: 50%;
  background: radial-gradient(circle, currentColor 0%, transparent 70%);
  opacity: 0.04; pointer-events: none;
}
.stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--border);
  box-shadow:
    0 16px 28px rgba(75, 50, 30, 0.10),
    0 4px 10px rgba(75, 50, 30, 0.05),
    inset 0 1px 0 rgba(255,255,255,0.5);
  color: inherit;
}
.stat-card:hover::before { opacity: 1; }
.stat-card__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stat-card__icon {
  width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: currentColor;
  position: relative;
  box-shadow: 0 4px 10px rgba(75,50,30,0.06), inset 0 1px 0 rgba(255,255,255,0.20);
}
.stat-card__icon::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,0.16), transparent 60%);
}
.stat-card__icon [data-lucide] { width: 20px; height: 20px; color: white; position: relative; stroke-width: 2.2; }
.stat-card__arrow {
  width: 28px; height: 28px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-hover); color: var(--text-secondary);
  transition: background 0.18s, color 0.18s, transform 0.18s;
}
.stat-card:hover .stat-card__arrow { background: currentColor; color: white; transform: translate(2px, -2px); }
.stat-card:hover .stat-card__arrow [data-lucide] { color: white; }
.stat-card__label {
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-secondary);
}
.stat-card__value {
  font-size: 30px; font-weight: 700;
  letter-spacing: -0.025em; line-height: 1.05;
  color: var(--text-primary);
  font-feature-settings: 'tnum';
  display: flex; align-items: baseline; gap: 6px;
}
.stat-card__unit { font-size: 12.5px; font-weight: 500; color: var(--text-muted); letter-spacing: 0; }
.stat-card__foot { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-muted); }
.stat-card__bar { flex: 1; height: 4px; background: var(--cream-200); border-radius: 2px; overflow: hidden; }
.stat-card__bar-fill { height: 100%; background: currentColor; border-radius: inherit; transition: width 0.4s ease; }

/* Stat-card color binding (the `currentColor` controls icon/bar/glow per tone) */
.stat-card.t-brand   { color: var(--brand-500); }
.stat-card.t-blue    { color: var(--tone-blue); }
.stat-card.t-emerald { color: var(--tone-emerald); }
.stat-card.t-amber   { color: var(--tone-amber); }
.stat-card.t-rose    { color: var(--tone-rose); }
.stat-card.t-violet  { color: var(--tone-violet); }
.stat-card.t-teal    { color: var(--tone-teal); }

/* ---------- Section heading (with accent bar) ---------- */
.section-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin: 32px 0 16px;
}
.section-head__title {
  display: flex; align-items: center; gap: 12px;
  font-size: 18px; font-weight: 700; letter-spacing: -0.012em;
  color: var(--text-primary);
}
.section-head__accent {
  width: 4px; height: 22px; border-radius: 2px;
  background: linear-gradient(180deg, var(--brand-500), var(--brand-700));
}
.section-head__count {
  background: var(--cream-200); color: var(--text-secondary);
  font-size: 12px; font-weight: 600;
  padding: 2px 9px; border-radius: 999px;
  font-feature-settings: 'tnum';
}
.section-head__actions { display: flex; gap: 8px; align-items: center; }

/* ---------- Premium project mini cards (hub recent panel) ---------- */
.proj-card {
  position: relative;
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 18px 20px;
  background: var(--bg-surface);
  overflow: hidden;
  transition: transform 0.22s, box-shadow 0.22s, border-color 0.22s;
}
.proj-card:hover {
  transform: translateY(-2px);
  border-color: var(--border);
  box-shadow: 0 10px 22px rgba(75,50,30,0.10), 0 2px 6px rgba(75,50,30,0.04);
}
.proj-card__accent {
  position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, var(--brand-400), var(--brand-700));
}
.proj-card__row { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.proj-card__avatar {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 15px; letter-spacing: 0.02em;
  background: linear-gradient(135deg, var(--brand-400), var(--brand-700));
  box-shadow: var(--shadow-brand);
}
.proj-card__title { font-weight: 600; font-size: 15px; line-height: 1.25; }
.proj-card__sub   { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.proj-card__grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
  padding-top: 14px; border-top: 1px dashed var(--border-soft);
}
.proj-card__metric-label { font-size: 11px; color: var(--text-muted); }
.proj-card__metric-value { font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }

/* ---------- Segmented control (sub-tabs/filters) ---------- */
.seg {
  display: inline-flex; gap: 2px;
  background: var(--bg-muted); border: 1px solid var(--border-soft);
  border-radius: 10px; padding: 3px;
}
.seg__item {
  padding: 6px 12px; border-radius: 7px;
  font-size: 12.5px; font-weight: 500; color: var(--text-secondary);
  cursor: pointer; transition: background 0.16s, color 0.16s;
  background: transparent; border: none; font-family: inherit;
}
.seg__item:hover { color: var(--text-primary); }
.seg__item--active { background: var(--bg-surface); color: var(--text-primary); box-shadow: 0 1px 3px rgba(75,50,30,0.08); }

/* ---------- Status dots with pulse ---------- */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; vertical-align: middle; }
.dot--success { background: var(--success); box-shadow: 0 0 0 0 rgba(46,125,50,0.45); animation: pulse-success 2.2s infinite; }
.dot--warning { background: var(--warning); }
.dot--danger  { background: var(--danger); }
.dot--info    { background: var(--info); }
.dot--neutral { background: var(--cream-400); }
@keyframes pulse-success {
  0%   { box-shadow: 0 0 0 0 rgba(46,125,50,0.4); }
  70%  { box-shadow: 0 0 0 8px rgba(46,125,50,0); }
  100% { box-shadow: 0 0 0 0 rgba(46,125,50,0); }
}

/* ---------- Glass card ---------- */
.glass {
  background: rgba(255,255,255,0.72);
  backdrop-filter: saturate(120%) blur(8px);
  -webkit-backdrop-filter: saturate(120%) blur(8px);
  border: 1px solid rgba(255,255,255,0.55);
  box-shadow:
    0 18px 36px rgba(75, 50, 30, 0.10),
    inset 0 1px 0 rgba(255,255,255,0.5);
}

/* ---------- Tag pill (lightweight chips inside content) ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 8px;
  font-size: 11.5px; font-weight: 500;
  background: var(--cream-200); color: var(--text-secondary);
  border: 1px solid transparent;
}
.tag--brand { background: var(--brand-50); color: var(--brand-700); border-color: var(--brand-100); }
.tag--info  { background: var(--info-soft); color: var(--info); }
.tag--success { background: var(--success-soft); color: var(--success); }
.tag--warning { background: var(--warning-soft); color: var(--warning); }
.tag--danger  { background: var(--danger-soft); color: var(--danger); }
.tag [data-lucide] { width: 11px; height: 11px; }

/* ---------- Refined form section (used by _crud_form upgrade) ---------- */
.fs {
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 22px 24px;
  background: var(--bg-surface);
  margin-bottom: 18px;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.fs:hover { border-color: var(--border); box-shadow: 0 4px 10px rgba(75,50,30,0.04); }
.fs__head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px dashed var(--border-soft); }
.fs__num {
  width: 28px; height: 28px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--brand-50), var(--brand-100));
  color: var(--brand-700); font-weight: 700; font-size: 13px;
  border: 1px solid var(--brand-100);
}
.fs__title { font-size: 15px; font-weight: 600; color: var(--text-primary); letter-spacing: -0.01em; }
.fs__sub   { font-size: 12px; color: var(--text-muted); }

/* ---------- Topbar v2 ---------- */
.tb-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-muted);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 7px 12px;
  width: 280px; max-width: 32vw;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s, width 0.22s;
}
.tb-search:focus-within {
  border-color: var(--brand-300); background: var(--bg-surface);
  box-shadow: 0 0 0 4px rgba(198,106,31,0.10);
  width: 360px;
}
.tb-search [data-lucide] { width: 15px; height: 15px; color: var(--text-muted); }
.tb-search input { background: transparent; border: none; outline: none; font-family: inherit; font-size: 13px; color: var(--text-primary); width: 100%; }
.tb-search input::placeholder { color: var(--text-muted); }
.tb-kbd {
  font-family: var(--font-mono); font-size: 10.5px;
  padding: 2px 6px; border-radius: 5px;
  background: var(--cream-200); color: var(--text-muted);
  border: 1px solid var(--border-soft); border-bottom-width: 2px;
}

.tb-crumbs { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--text-muted); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 2px; }
.tb-crumbs [data-lucide] { width: 11px; height: 11px; opacity: 0.6; }
.tb-crumbs .tb-crumbs__current { color: var(--brand-600); }

/* ---------- Skeleton loader ---------- */
.sk { background: linear-gradient(90deg, var(--cream-100) 0%, var(--cream-200) 50%, var(--cream-100) 100%); background-size: 200% 100%; border-radius: 8px; animation: sk-shimmer 1.4s infinite; }
@keyframes sk-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.sk--text { height: 12px; }
.sk--tile { height: 110px; border-radius: 18px; }

/* ---------- Premium card variant (subtle gradient border, used in hubs) ---------- */
.card--lift {
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.card--lift:hover { transform: translateY(-2px); box-shadow: 0 16px 30px rgba(75,50,30,0.10); }

/* ---------- Search bar inside list cards (filter chip toggles) ---------- */
.filterbar {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border-soft);
  background: linear-gradient(180deg, var(--bg-muted), transparent);
}
.filterbar .form-input,
.filterbar .form-select { padding: 8px 12px; font-size: 13px; }
.filterbar__chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 500;
  background: var(--bg-surface); color: var(--text-secondary);
  border: 1px solid var(--border-soft);
  cursor: pointer; transition: background 0.16s, color 0.16s, border-color 0.16s;
}
.filterbar__chip:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border); }
.filterbar__chip--active { background: var(--brand-50); color: var(--brand-700); border-color: var(--brand-200); }
.filterbar__chip [data-lucide] { width: 12px; height: 12px; }

/* ---------- Empty state polish ---------- */
.empty-state { padding: 80px 20px; }
.empty-state__icon {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, var(--cream-100), var(--cream-200));
  border: 1px solid var(--border-soft);
  margin-bottom: 18px;
}
.empty-state__icon [data-lucide] { width: 30px; height: 30px; color: var(--brand-500); }
.empty-state__title { font-size: 15px; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
.empty-state__sub { font-size: 13px; color: var(--text-muted); max-width: 36ch; margin: 0 auto; }

/* ---------- Page hero v2 (used in list views without hub band) ---------- */
.page-hero--v2 {
  border: none; padding: 0;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 22px;
}
.page-hero--v2::after { display: none; }

/* ---------- Reduce table action width to keep rows balanced ---------- */
.table-actions .icon-btn { width: 30px; height: 30px; }
.table-actions .icon-btn [data-lucide] { width: 13px; height: 13px; }

/* Make the very first row inside .card animate in (page-load drama) */
.stat-grid > * { animation: pageFadeIn 0.4s ease-out both; }
.stat-grid > *:nth-child(2) { animation-delay: 0.04s; }
.stat-grid > *:nth-child(3) { animation-delay: 0.08s; }
.stat-grid > *:nth-child(4) { animation-delay: 0.12s; }
.stat-grid > *:nth-child(5) { animation-delay: 0.16s; }
.stat-grid > *:nth-child(6) { animation-delay: 0.20s; }
.stat-grid > *:nth-child(7) { animation-delay: 0.24s; }
.stat-grid > *:nth-child(8) { animation-delay: 0.28s; }

/* Subtle "live" indicator for hero chips */
.hero__chip--live::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--success);
  margin-right: 4px;
  animation: pulse-success 1.8s infinite;
}

/* Responsive tweaks for the hero band */
@media (max-width: 720px) {
  .hero { padding: 24px 22px 22px; border-radius: 18px; }
  .hero__title { font-size: 24px; }
  .hero__mark { display: none; }
}

/* ============================================================
   EXECUTIVE DASHBOARD — god-tier widgets
   Used only by modules/dashboard/views/dashboard/index.php.
   ============================================================ */

/* Executive hero band — wider gradient with multiple radial spots */
.exec-hero {
  position: relative; overflow: hidden;
  border-radius: 24px;
  padding: 34px 38px 30px;
  margin-bottom: 26px;
  background:
    radial-gradient(ellipse at 80% -10%, rgba(220,133,54,0.32) 0%, transparent 50%),
    radial-gradient(ellipse at 0% 110%, rgba(110,59,150,0.18) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 100%, rgba(15,111,176,0.15) 0%, transparent 60%),
    linear-gradient(135deg, #1A0B05 0%, #2B130A 40%, #4A220A 75%, #6B3210 100%);
  color: var(--cream-50);
  border: 1px solid rgba(220,133,54,0.20);
  box-shadow:
    0 24px 50px rgba(43, 19, 10, 0.25),
    0 8px 18px rgba(75, 50, 30, 0.10),
    inset 0 1px 0 rgba(255,255,255,0.08);
}
.exec-hero::before {
  content: ''; position: absolute; inset: 0;
  background:
    repeating-linear-gradient(45deg, transparent 0 24px, rgba(255,255,255,0.014) 24px 48px);
  pointer-events: none;
}
.exec-hero__inner { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap; }
.exec-hero__left { flex: 1 1 360px; min-width: 0; }
.exec-hero__crumbs {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase;
  font-weight: 600; color: rgba(252, 244, 235, 0.58);
  margin-bottom: 14px;
}
.exec-hero__crumbs .dot { background: var(--brand-400); width: 6px; height: 6px; }
.exec-hero__title {
  font-family: var(--font-display);
  font-size: 38px; font-weight: 700;
  letter-spacing: -0.025em; line-height: 1.1;
  color: var(--cream-50);
  margin-bottom: 10px;
}
.exec-hero__title em {
  font-style: normal; font-weight: 700;
  background: linear-gradient(135deg, #F2C797 0%, #DC8536 50%, #C66A1F 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.exec-hero__sub { font-size: 15px; line-height: 1.6; color: rgba(252, 244, 235, 0.74); max-width: 60ch; margin-bottom: 18px; }
.exec-hero__meta { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.exec-hero__chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 600;
  padding: 7px 13px; border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  color: rgba(252, 244, 235, 0.92);
  backdrop-filter: blur(8px);
}
.exec-hero__chip [data-lucide] { width: 13px; height: 13px; }
.exec-hero__chip--live::before {
  content: ''; display: inline-block;
  width: 7px; height: 7px; border-radius: 50%;
  background: #2ECC71;
  box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.6);
  animation: pulse-success 1.8s infinite;
}
.exec-hero__right { display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }

/* Period selector tabs */
.period-tabs {
  display: inline-flex; gap: 2px;
  padding: 4px;
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  backdrop-filter: blur(8px);
}
.period-tabs__btn {
  padding: 8px 14px;
  font-size: 12.5px; font-weight: 600;
  color: rgba(252,244,235,0.7);
  background: transparent; border: none;
  border-radius: 8px; cursor: pointer;
  font-family: inherit; transition: background 0.16s, color 0.16s;
}
.period-tabs__btn:hover { color: rgba(252,244,235,0.95); background: rgba(255,255,255,0.06); }
.period-tabs__btn--active {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: white;
  box-shadow: 0 4px 12px rgba(198, 106, 31, 0.4);
}

/* === Mega KPI tiles with sparkline area === */
.kpi-mega-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-bottom: 26px;
}
.kpi-mega {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  padding: 22px 24px;
  display: flex; flex-direction: column; gap: 12px;
  transition: transform 0.22s, box-shadow 0.22s, border-color 0.22s;
  overflow: hidden;
  box-shadow:
    0 1px 2px rgba(75, 50, 30, 0.04),
    inset 0 1px 0 rgba(255,255,255,0.5);
}
.kpi-mega::after {
  content: ''; position: absolute; right: -30px; bottom: -30px;
  width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, currentColor 0%, transparent 70%);
  opacity: 0.06; pointer-events: none;
}
.kpi-mega:hover {
  transform: translateY(-3px);
  border-color: var(--border);
  box-shadow:
    0 18px 32px rgba(75, 50, 30, 0.12),
    0 4px 10px rgba(75, 50, 30, 0.05);
}
.kpi-mega__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kpi-mega__icon {
  width: 38px; height: 38px; border-radius: 11px;
  background: currentColor;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 10px currentColor;
  position: relative;
}
.kpi-mega__icon::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,0.20), transparent 60%);
}
.kpi-mega__icon [data-lucide] { color: white; width: 18px; height: 18px; stroke-width: 2.2; position: relative; }
.kpi-mega__delta {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11.5px; font-weight: 700;
  padding: 3px 8px; border-radius: 999px;
}
.kpi-mega__delta [data-lucide] { width: 11px; height: 11px; }
.kpi-mega__delta--up   { background: var(--success-soft); color: var(--success); }
.kpi-mega__delta--down { background: var(--danger-soft);  color: var(--danger); }
.kpi-mega__delta--flat { background: var(--cream-200);    color: var(--text-secondary); }
.kpi-mega__label {
  font-size: 11.5px; font-weight: 600;
  letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--text-secondary);
}
.kpi-mega__value {
  font-size: 30px; font-weight: 700;
  letter-spacing: -0.025em; line-height: 1.05;
  color: var(--text-primary);
  font-feature-settings: 'tnum';
  display: flex; align-items: baseline; gap: 6px;
}
.kpi-mega__unit { font-size: 12.5px; font-weight: 500; color: var(--text-muted); }
.kpi-mega__sub  { font-size: 11.5px; color: var(--text-muted); }
.kpi-mega__spark { height: 36px; margin: 4px -4px -4px; position: relative; }
.kpi-mega__spark canvas { width: 100%; height: 100%; }

/* tone bindings (uses currentColor) */
.kpi-mega.t-brand   { color: var(--brand-500); }
.kpi-mega.t-blue    { color: var(--tone-blue); }
.kpi-mega.t-emerald { color: var(--tone-emerald); }
.kpi-mega.t-amber   { color: var(--tone-amber); }
.kpi-mega.t-rose    { color: var(--tone-rose); }
.kpi-mega.t-violet  { color: var(--tone-violet); }
.kpi-mega.t-teal    { color: var(--tone-teal); }

/* === Sales funnel widget === */
.funnel {
  display: grid; gap: 0;
  grid-template-columns: repeat(5, 1fr);
  padding: 4px;
  background: var(--bg-muted);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
}
@media (max-width: 900px) { .funnel { grid-template-columns: repeat(2, 1fr); } }
.funnel__stage {
  position: relative;
  padding: 18px 16px 18px 22px;
  background: var(--bg-surface);
  border-radius: 12px;
  transition: transform 0.22s, box-shadow 0.22s;
}
.funnel__stage + .funnel__stage { margin-left: -10px; }
.funnel__stage:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(75,50,30,0.08); z-index: 2; }
.funnel__stage::after {
  content: ''; position: absolute; right: -1px; top: 50%; transform: translateY(-50%);
  width: 0; height: 0;
  border-top: 22px solid transparent;
  border-bottom: 22px solid transparent;
  border-left: 14px solid var(--bg-surface);
  z-index: 1;
}
.funnel__stage:last-child::after { display: none; }
.funnel__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px;
  margin-bottom: 8px;
}
.funnel__stage.s-blue    .funnel__icon { background: var(--tone-blue-soft);    color: var(--tone-blue); }
.funnel__stage.s-violet  .funnel__icon { background: var(--tone-violet-soft);  color: var(--tone-violet); }
.funnel__stage.s-brand   .funnel__icon { background: var(--brand-50);          color: var(--brand-700); }
.funnel__stage.s-emerald .funnel__icon { background: var(--tone-emerald-soft); color: var(--tone-emerald); }
.funnel__stage.s-amber   .funnel__icon { background: var(--tone-amber-soft);   color: var(--tone-amber); }
.funnel__icon [data-lucide] { width: 16px; height: 16px; stroke-width: 2.2; }
.funnel__stage-label { font-size: 11.5px; font-weight: 600; color: var(--text-secondary); letter-spacing: 0.04em; }
.funnel__count {
  font-size: 22px; font-weight: 700; letter-spacing: -0.02em;
  color: var(--text-primary);
  font-feature-settings: 'tnum';
  margin-top: 2px;
}
.funnel__rate { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* === Dashboard exec grid (12-col responsive) === */
.exec-grid { display: grid; gap: 18px; margin-bottom: 22px; grid-template-columns: 1fr; }
.exec-grid--2 { grid-template-columns: 1fr 1fr; }
.exec-grid--7-5 { grid-template-columns: 7fr 5fr; }
.exec-grid--8-4 { grid-template-columns: 8fr 4fr; }
@media (max-width: 1100px) { .exec-grid--2, .exec-grid--7-5, .exec-grid--8-4 { grid-template-columns: 1fr; } }

/* === Activity feed === */
.feed { padding: 4px 0; }
.feed__item {
  display: flex; gap: 14px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border-soft);
  transition: background 0.16s;
  position: relative;
}
.feed__item:last-child { border-bottom: none; }
.feed__item:hover { background: var(--bg-muted); }
.feed__icon {
  flex-shrink: 0;
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.feed__icon [data-lucide] { width: 16px; height: 16px; stroke-width: 2; }
.feed__icon.t-blue    { background: var(--tone-blue-soft);    color: var(--tone-blue); }
.feed__icon.t-emerald { background: var(--tone-emerald-soft); color: var(--tone-emerald); }
.feed__icon.t-amber   { background: var(--tone-amber-soft);   color: var(--tone-amber); }
.feed__icon.t-rose    { background: var(--tone-rose-soft);    color: var(--tone-rose); }
.feed__icon.t-violet  { background: var(--tone-violet-soft);  color: var(--tone-violet); }
.feed__icon.t-brand   { background: var(--brand-50);          color: var(--brand-700); }
.feed__body { flex: 1; min-width: 0; }
.feed__title { font-size: 13.5px; font-weight: 500; color: var(--text-primary); }
.feed__title strong { font-weight: 600; color: var(--brand-700); }
.feed__meta { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.feed__time { font-variant-numeric: tabular-nums; }

/* === Risk alerts === */
.risk-list { display: flex; flex-direction: column; gap: 10px; padding: 18px 22px; }
.risk-card {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px;
  border-radius: 12px;
  border-left: 3px solid;
  background: var(--bg-muted);
  transition: background 0.18s, transform 0.18s;
}
.risk-card:hover { background: var(--bg-surface); transform: translateX(2px); box-shadow: 0 4px 12px rgba(75,50,30,0.05); }
.risk-card.r-danger  { border-color: var(--danger);  background: var(--danger-soft); }
.risk-card.r-warning { border-color: var(--warning); background: var(--warning-soft); }
.risk-card.r-info    { border-color: var(--info);    background: var(--info-soft); }
.risk-card.r-success { border-color: var(--success); background: var(--success-soft); }
.risk-card__icon { flex-shrink: 0; width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.6); }
.risk-card__icon [data-lucide] { width: 14px; height: 14px; }
.risk-card.r-danger  .risk-card__icon { color: var(--danger); }
.risk-card.r-warning .risk-card__icon { color: var(--warning); }
.risk-card.r-info    .risk-card__icon { color: var(--info); }
.risk-card.r-success .risk-card__icon { color: var(--success); }
.risk-card__title { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.risk-card__sub   { font-size: 11.5px; color: var(--text-secondary); margin-top: 2px; }
.risk-card__count {
  margin-left: auto; flex-shrink: 0;
  font-size: 18px; font-weight: 700; letter-spacing: -0.02em;
  font-feature-settings: 'tnum';
}
.risk-card.r-danger  .risk-card__count { color: var(--danger); }
.risk-card.r-warning .risk-card__count { color: var(--warning); }
.risk-card.r-info    .risk-card__count { color: var(--info); }
.risk-card.r-success .risk-card__count { color: var(--success); }

/* === Compact system stats strip (bottom) === */
.sysstats {
  display: grid; gap: 1px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  background: var(--border-soft);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  overflow: hidden;
}
.sysstats__item {
  padding: 16px 18px; background: var(--bg-surface);
  display: flex; flex-direction: column; gap: 4px;
  transition: background 0.18s;
}
.sysstats__item:hover { background: var(--bg-muted); }
.sysstats__label { font-size: 10.5px; font-weight: 600; letter-spacing: 0.10em; text-transform: uppercase; color: var(--text-muted); }
.sysstats__value { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; color: var(--text-primary); font-feature-settings: 'tnum'; display: flex; align-items: baseline; gap: 5px; }
.sysstats__unit  { font-size: 11px; font-weight: 500; color: var(--text-muted); }

/* === Top projects mini-table === */
.top-projects { padding: 4px 22px 14px; }
.top-projects__row {
  display: grid; grid-template-columns: 28px 1fr 90px 90px 60px;
  align-items: center; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-soft);
}
.top-projects__row:last-child { border-bottom: none; }
.top-projects__rank {
  width: 28px; height: 28px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12.5px;
  background: var(--cream-200); color: var(--text-secondary);
}
.top-projects__row:nth-child(1) .top-projects__rank { background: linear-gradient(135deg,#F2C797,#DC8536); color: #4A220A; }
.top-projects__row:nth-child(2) .top-projects__rank { background: linear-gradient(135deg,#E0E0E0,#A8A8A8); color: #424242; }
.top-projects__row:nth-child(3) .top-projects__rank { background: linear-gradient(135deg,#D4A574,#A0723E); color: #FFF; }
.top-projects__name { font-weight: 600; font-size: 14px; }
.top-projects__sub  { font-size: 11.5px; color: var(--text-muted); }
.top-projects__bar { height: 6px; background: var(--cream-200); border-radius: 3px; overflow: hidden; }
.top-projects__bar > div { height: 100%; background: linear-gradient(90deg, var(--brand-500), var(--brand-700)); border-radius: inherit; }
.top-projects__metric { font-weight: 700; text-align: right; font-feature-settings: 'tnum'; }

/* Chart card — internal padding for canvas */
.chart-card { padding: 18px 22px 22px; }
.chart-card__title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.chart-card__title { font-size: 14.5px; font-weight: 600; color: var(--text-primary); display: flex; align-items: center; gap: 10px; }
.chart-card__title .section-head__accent { width: 3px; height: 16px; }
.chart-card__legend { font-size: 11.5px; color: var(--text-muted); }
.chart-card__canvas { height: 240px; position: relative; }
.chart-card__canvas--tall { height: 300px; }

/* Responsive exec hero */
@media (max-width: 720px) {
  .exec-hero { padding: 24px 22px 22px; border-radius: 18px; }
  .exec-hero__title { font-size: 28px; }
  .period-tabs__btn { padding: 7px 10px; font-size: 11.5px; }
}

/* ============================================================
   REPAIR WORKFLOW — timeline + step indicator + action panel
   ============================================================ */

/* Horizontal stepper (compact, in list view rows) */
.wf-stepper {
  display: inline-flex; gap: 4px; align-items: center;
}
.wf-stepper__dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--cream-200);
  transition: background 0.18s, transform 0.18s;
  position: relative;
}
.wf-stepper__dot--done    { background: var(--success); }
.wf-stepper__dot--current { background: var(--brand-500); transform: scale(1.5); box-shadow: 0 0 0 4px var(--brand-50); animation: pulse-success 2s infinite; }
.wf-stepper__dot--future  { background: var(--cream-200); }

/* Full vertical timeline (detail view) */
.wf-timeline {
  display: flex; flex-direction: column; gap: 0;
  padding: 8px 0;
}
.wf-timeline__step {
  display: grid; grid-template-columns: 56px 1fr;
  gap: 14px; padding: 14px 0;
  position: relative;
}
.wf-timeline__step::before {
  content: ''; position: absolute;
  left: 27px; top: 50px; bottom: -14px; width: 2px;
  background: var(--border-soft);
}
.wf-timeline__step:last-child::before { display: none; }
.wf-timeline__icon {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--bg-muted);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--border-soft);
  position: relative;
  z-index: 1;
  transition: all 0.2s ease;
}
.wf-timeline__icon [data-lucide] { width: 18px; height: 18px; }
.wf-timeline__step--done .wf-timeline__icon {
  background: linear-gradient(135deg, var(--success), #1E5A21);
  color: white;
  border-color: var(--success);
  box-shadow: 0 4px 10px rgba(46, 125, 50, 0.18);
}
.wf-timeline__step--done::before { background: var(--success); }
.wf-timeline__step--current .wf-timeline__icon {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: white;
  border-color: var(--brand-500);
  box-shadow: 0 4px 14px rgba(198, 106, 31, 0.30), 0 0 0 5px var(--brand-50);
  animation: pulse-current 2.4s infinite;
}
@keyframes pulse-current {
  0%   { box-shadow: 0 4px 14px rgba(198,106,31,0.30), 0 0 0 0   rgba(198,106,31,0.40); }
  70%  { box-shadow: 0 4px 14px rgba(198,106,31,0.30), 0 0 0 14px rgba(198,106,31,0); }
  100% { box-shadow: 0 4px 14px rgba(198,106,31,0.30), 0 0 0 0   rgba(198,106,31,0); }
}
.wf-timeline__step--current::before { background: linear-gradient(180deg, var(--brand-500), var(--border-soft)); }
.wf-timeline__num {
  position: absolute; top: -4px; right: -4px;
  width: 18px; height: 18px;
  background: var(--bg-surface); color: var(--text-secondary);
  border-radius: 50%;
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--border);
  font-feature-settings: 'tnum';
}
.wf-timeline__step--done .wf-timeline__num { background: var(--success); color: white; border-color: var(--success); }
.wf-timeline__step--current .wf-timeline__num { background: var(--brand-500); color: white; border-color: var(--brand-500); }
.wf-timeline__body { padding-top: 6px; }
.wf-timeline__title { font-size: 14.5px; font-weight: 600; color: var(--text-primary); }
.wf-timeline__step--future .wf-timeline__title { color: var(--text-muted); font-weight: 500; }
.wf-timeline__actor {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; padding: 2px 8px;
  background: var(--bg-muted); color: var(--text-secondary);
  border-radius: 999px;
  margin-left: 10px;
}
.wf-timeline__meta { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; }

/* Horizontal stepper with labels (top of detail page) */
.wf-strip {
  display: flex; align-items: center; gap: 0;
  padding: 18px 24px;
  background: linear-gradient(180deg, var(--bg-muted), transparent);
  border-radius: 14px;
  border: 1px solid var(--border-soft);
  margin-bottom: 20px;
  overflow-x: auto;
}
.wf-strip__step {
  flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  position: relative;
  min-width: 70px;
  padding: 0 6px;
}
.wf-strip__step + .wf-strip__step::before {
  content: ''; position: absolute; left: -50%; top: 16px;
  width: 100%; height: 2px;
  background: var(--cream-200);
  z-index: 0;
}
.wf-strip__step.s-done + .wf-strip__step::before,
.wf-strip__step.s-done + .wf-strip__step.s-done::before { background: var(--success); }
.wf-strip__step.s-current + .wf-strip__step::before { background: linear-gradient(90deg, var(--brand-400), var(--cream-200)); }
.wf-strip__bubble {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 2px solid var(--cream-300);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  position: relative; z-index: 1;
  font-feature-settings: 'tnum';
}
.wf-strip__step.s-done .wf-strip__bubble {
  background: linear-gradient(135deg, var(--success), #1E5A21);
  color: white; border-color: var(--success);
}
.wf-strip__step.s-current .wf-strip__bubble {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: white; border-color: var(--brand-500);
  box-shadow: 0 0 0 4px var(--brand-50);
}
.wf-strip__label {
  font-size: 10.5px; line-height: 1.2;
  text-align: center; max-width: 80px;
  color: var(--text-secondary);
  white-space: normal;
}
.wf-strip__step.s-current .wf-strip__label { color: var(--brand-700); font-weight: 600; }
.wf-strip__step.s-done .wf-strip__label { color: var(--success); }

/* Action panel */
.wf-action-bar {
  display: flex; gap: 10px; flex-wrap: wrap;
  padding: 18px 22px;
  background: linear-gradient(135deg, var(--brand-50), var(--cream-100));
  border: 1px solid var(--brand-100);
  border-radius: 14px;
  margin-bottom: 20px;
  align-items: center;
}
.wf-action-bar__label {
  font-size: 12px; font-weight: 600;
  color: var(--brand-700); letter-spacing: 0.06em; text-transform: uppercase;
  margin-right: 8px;
}

/* History log */
.wf-history { padding: 14px 0; }
.wf-history__row {
  display: grid; grid-template-columns: 16px 1fr auto;
  gap: 12px; padding: 12px 22px;
  align-items: center;
  border-bottom: 1px solid var(--border-soft);
}
.wf-history__row:last-child { border-bottom: none; }
.wf-history__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand-400); }
.wf-history__body { font-size: 13px; }
.wf-history__body strong { color: var(--brand-700); }
.wf-history__when { font-size: 11.5px; color: var(--text-muted); font-feature-settings: 'tnum'; white-space: nowrap; }

/* Detail-view header */
.detail-hero {
  display: grid; grid-template-columns: 1fr auto; gap: 24px;
  padding: 22px 24px;
  background: linear-gradient(135deg, var(--bg-surface), var(--bg-muted));
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  margin-bottom: 18px;
}
.detail-hero__code {
  font-family: var(--font-mono);
  font-size: 22px; font-weight: 700; letter-spacing: -0.01em;
  color: var(--brand-700);
}
.detail-hero__title { font-size: 17px; font-weight: 600; color: var(--text-primary); margin-top: 6px; }
.detail-hero__meta  { font-size: 12.5px; color: var(--text-muted); margin-top: 8px; }
.detail-hero__tags  { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.detail-hero__right { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }

/* ============================================================
   NOTIFICATION dropdown + count badge + search results
   ============================================================ */
.notif-count {
  position: absolute; top: 3px; right: 3px;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 16px;
  border-radius: 999px; text-align: center;
  border: 2px solid var(--bg-surface);
  box-shadow: 0 1px 3px rgba(192,57,43,0.4);
}
.notif-drop {
  position: absolute; top: calc(100% + 10px); right: 0;
  width: 380px; max-width: 90vw;
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(75,50,30,0.16), 0 4px 12px rgba(75,50,30,0.08);
  z-index: 200; overflow: hidden; display: none;
  animation: notifIn 0.18s ease-out;
}
.notif-drop.is-open { display: block; }
@keyframes notifIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.notif-drop__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border-soft);
  font-size: 14px; font-weight: 600; color: var(--text-primary);
}
.notif-drop__readall { background: none; border: none; cursor: pointer; font-size: 12px; color: var(--primary); font-weight: 500; padding: 0; }
.notif-drop__readall:hover { text-decoration: underline; }
.notif-drop__body { max-height: 420px; overflow-y: auto; }
.notif-item {
  display: flex; gap: 12px; padding: 13px 18px; position: relative;
  border-bottom: 1px solid var(--border-soft);
  text-decoration: none; color: inherit; transition: background 0.15s;
}
.notif-item:hover { background: var(--bg-muted); }
.notif-item--unread { background: linear-gradient(90deg, var(--brand-50), transparent 60%); }
.notif-item__icon { flex-shrink: 0; width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.notif-item__icon [data-lucide] { width: 16px; height: 16px; }
.notif-item__icon.t-rose    { background: var(--tone-rose-soft);    color: var(--tone-rose); }
.notif-item__icon.t-amber   { background: var(--tone-amber-soft);   color: var(--tone-amber); }
.notif-item__icon.t-emerald { background: var(--tone-emerald-soft); color: var(--tone-emerald); }
.notif-item__icon.t-blue    { background: var(--tone-blue-soft);    color: var(--tone-blue); }
.notif-item__body { flex: 1; min-width: 0; }
.notif-item__title { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.notif-item__text  { font-size: 12px; color: var(--text-secondary); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-item__time  { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.notif-drop__foot {
  display: block; text-align: center; padding: 12px;
  font-size: 12.5px; font-weight: 500; color: var(--primary);
  text-decoration: none; border-top: 1px solid var(--border-soft); background: var(--bg-muted);
}
.notif-drop__foot:hover { background: var(--bg-hover); }

.search-group { margin-bottom: 26px; }
.search-group__head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 14px; font-weight: 600; color: var(--brand-700); }
.search-group__count { background: var(--cream-200); color: var(--text-secondary); font-size: 11.5px; padding: 1px 8px; border-radius: 999px; font-weight: 600; }
.search-hit {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border: 1px solid var(--border-soft); border-radius: 12px; margin-bottom: 8px;
  background: var(--bg-surface); text-decoration: none; color: inherit;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.search-hit:hover { border-color: var(--brand-200); transform: translateX(2px); box-shadow: 0 4px 12px rgba(75,50,30,0.06); }
.search-hit__icon { width: 36px; height: 36px; border-radius: 10px; background: var(--brand-50); color: var(--brand-700); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.search-hit__title { font-weight: 600; font-size: 14px; }
.search-hit__sub { font-size: 12px; color: var(--text-muted); }

/* 2-col layout used in detail pages */
.detail-grid { display: grid; grid-template-columns: 5fr 7fr; gap: 18px; }
@media (max-width: 1100px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-box {
  padding: 16px 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
}
.detail-box__title { font-size: 12.5px; font-weight: 700; color: var(--brand-700); letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 10px; }
.detail-box__row   { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; border-bottom: 1px dashed var(--border-soft); }
.detail-box__row:last-child { border-bottom: none; }
.detail-box__row span:first-child { color: var(--text-secondary); }
.detail-box__row span:last-child  { color: var(--text-primary); font-weight: 500; text-align: right; }

/* ============================================================
   RESPONSIVE / MOBILE LAYER  (≤ 1024px tablet, ≤ 720px phone)
   Off-canvas sidebar drawer + fluid layout. Desktop unaffected.
   ============================================================ */

/* Hamburger button — hidden on desktop, shown on mobile */
.tb-hamburger { display: none; }

/* Sidebar backdrop (mobile drawer overlay) */
.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(43, 19, 10, 0.45);
  backdrop-filter: blur(2px);
  z-index: 90;
}

@media (max-width: 1024px) {
  .content { padding: 22px 22px 48px; }
  /* collapse 2-up content grids */
  .exec-grid--2, .exec-grid--7-5, .exec-grid--8-4,
  .grid--12-7-5, .grid--2, .grid--3, .detail-grid { grid-template-columns: 1fr; }
  .tb-search { width: 200px; }
  .tb-search:focus-within { width: 240px; }
}

@media (max-width: 900px) {
  /* --- Off-canvas sidebar --- */
  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    box-shadow: 0 0 40px rgba(0,0,0,0.3);
    width: 280px;
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .sidebar-backdrop { display: block; }
  .main { width: 100%; }

  /* Hamburger appears, sits before the title */
  .tb-hamburger {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
    background: var(--bg-surface); border: 1px solid var(--border-soft);
    color: var(--text-primary); cursor: pointer; margin-right: 10px;
  }
  .tb-hamburger [data-lucide] { width: 20px; height: 20px; }

  /* Topbar: stack, hide the wide search (search still reachable via its own page) */
  .topbar { flex-wrap: wrap; gap: 10px; padding: 12px 16px; height: auto; position: relative; }
  .topbar__title { display: flex; align-items: center; min-width: 0; flex: 1; }
  .topbar__title h1 { font-size: 18px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tb-crumbs { display: none; }
  .tb-search { order: 3; width: 100%; max-width: none; }
  .tb-search:focus-within { width: 100%; }
  .topbar__actions { order: 2; }

  /* Notification dropdown becomes near-full-width */
  .notif-drop { width: calc(100vw - 24px); right: -8px; }

  /* Subnav scrolls horizontally */
  .subnav { flex-wrap: nowrap; }

  /* Hero bands tighten */
  .hero, .exec-hero { padding: 22px 20px; border-radius: 16px; }
  .hero__title { font-size: 24px; }
  .exec-hero__title { font-size: 26px; }
  .hero__row, .exec-hero__inner { flex-direction: column; align-items: flex-start; gap: 16px; }
  .hero__cta, .exec-hero__right { width: 100%; }

  /* KPI / stat grids: 1-2 per row */
  .kpi-mega-grid, .stat-grid, .grid--kpi { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

  /* Forms full width */
  .form-row, .form-row--3 { grid-template-columns: 1fr; }

  /* Tables already scroll via .table-wrap; make rows comfortable */
  .table th, .table td { padding: 11px 12px; }

  /* Detail hero stacks */
  .detail-hero { grid-template-columns: 1fr; }
  .detail-hero__right { align-items: flex-start; }

  /* Workflow strip + funnel scroll */
  .wf-strip { overflow-x: auto; }
  .funnel { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .content { padding: 16px 14px 40px; }
  .card__header { flex-direction: column; align-items: stretch; gap: 12px; }
  .card__header .card__title { font-size: 15px; }
  .kpi-mega-grid, .stat-grid, .grid--kpi { grid-template-columns: 1fr 1fr; gap: 12px; }
  .kpi-mega__value, .stat-card__value { font-size: 24px; }
  .funnel { grid-template-columns: 1fr; }
  .funnel__stage::after { display: none; }
  .funnel__stage + .funnel__stage { margin-left: 0; }
  .period-tabs { flex-wrap: wrap; }
  .sysstats { grid-template-columns: repeat(2, 1fr); }
  .btn { padding: 9px 14px; font-size: 13px; }
  .hero__title { font-size: 21px; }
  .exec-hero__title { font-size: 22px; }
}

/* Tap targets: ensure icon buttons are finger-friendly on touch */
@media (hover: none) and (pointer: coarse) {
  .icon-btn { width: 40px; height: 40px; }
  .table-actions .icon-btn { width: 36px; height: 36px; }
  .subnav__item { padding: 10px 14px; }
}

/* ============================================================
   SQUARE CARDS — customer request: body cards have NO rounded
   corners. Surfaces/panels/tiles → square (radius 0). Sidebar
   and small controls (buttons/inputs/badges) keep their style.
   Appended last so it overrides earlier radius rules.
   ============================================================ */
.card,
.card__header,
.card__body,
.card__footer,
.table-wrap,
.kpi,
.kpi--hero,
.kpi-mega,
.stat-card,
.hero,
.exec-hero,
.detail-hero,
.detail-box,
.proj-card,
.fs,
.funnel,
.funnel__stage,
.sysstats,
.sysstats__item,
.chart-card,
.risk-card,
.summary-card,
.notif-drop,
.search-hit,
.modal,
.wf-action-bar,
.wf-strip,
.filterbar,
.glass,
.seg,
.period-tabs,
.top-projects,
.feed,
.hero__mark,
.empty-state__icon,
.kpi__icon,
.kpi-mega__icon,
.stat-card__icon,
.feed__icon,
.notif-item__icon,
.search-hit__icon,
.risk-card__icon,
.detail-hero__code,
.wf-strip__bubble,
.wf-timeline__icon,
.proj-card__avatar {
  border-radius: 0 !important;
}

/* Keep the page from looking too harsh: re-square nested corners that
   relied on the parent radius (table inside card already 0 above). */
.card > .table-wrap:last-child,
.card__header { border-radius: 0 !important; }

/* ============================================================
   SIDEBAR ACCORDION NAV (v2) — collapsible groups
   ============================================================ */
.sidebar__nav { display: flex; flex-direction: column; gap: 2px; }

/* Standalone top-level link (e.g. Dashboard) */
.nav-item--solo { margin-bottom: 4px; }

/* Collapsible group */
.nav-acc { display: flex; flex-direction: column; }
.nav-acc__header {
  display: flex; align-items: center; gap: 11px;
  width: 100%;
  padding: 9px 12px;
  background: transparent; border: none;
  color: var(--sidebar-text);
  font-size: 13.5px; font-weight: 600; font-family: inherit;
  border-radius: var(--radius);
  cursor: pointer; text-align: left;
  transition: background 0.14s ease, color 0.14s ease;
}
.nav-acc__header:hover { background: var(--sidebar-hover); color: var(--sidebar-text-strong); }
.nav-acc__icon { color: var(--sidebar-text-soft); flex-shrink: 0; width: 18px; height: 18px; }
.nav-acc__header:hover .nav-acc__icon { color: var(--brand-300); }
.nav-acc__label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-acc__chevron {
  width: 15px; height: 15px; flex-shrink: 0;
  color: var(--sidebar-text-soft);
  transition: transform 0.22s ease, color 0.14s ease;
}
.nav-acc.is-open > .nav-acc__header { color: var(--sidebar-text-strong); }
.nav-acc.is-open > .nav-acc__header .nav-acc__icon { color: var(--brand-300); }
.nav-acc.is-open > .nav-acc__header .nav-acc__chevron { transform: rotate(90deg); color: var(--brand-300); }

/* Collapsible items container */
.nav-acc__items {
  overflow: hidden;
  max-height: 0;
  opacity: 0.4;
  transition: max-height 0.30s ease, opacity 0.24s ease;
  padding-left: 8px;
}
.nav-acc.is-open > .nav-acc__items,
.nav-acc.is-search > .nav-acc__items { max-height: 1600px; opacity: 1; }

/* Sub-page link */
.nav-subitem {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 12px 7px 14px; margin: 1px 0;
  border-radius: var(--radius);
  color: var(--sidebar-text);
  font-size: 12.75px; font-weight: 500;
  opacity: 0.82;
  transition: background 0.12s ease, color 0.12s ease, opacity 0.12s ease;
  position: relative;
}
.nav-subitem [data-lucide] { width: 15px; height: 15px; flex-shrink: 0; color: var(--sidebar-text-soft); }
.nav-subitem span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-subitem:hover { background: var(--sidebar-hover); color: var(--sidebar-text-strong); opacity: 1; }
.nav-subitem:hover [data-lucide] { color: var(--sidebar-text-strong); }
.nav-subitem--active {
  background: linear-gradient(90deg, rgba(220,133,54,0.18), rgba(220,133,54,0.05));
  color: var(--sidebar-text-strong); opacity: 1; font-weight: 600;
  box-shadow: inset 3px 0 0 var(--brand-400);
}
.nav-subitem--active [data-lucide] { color: var(--brand-300); }

/* Vertical guide line for grouped items */
.nav-acc__items { border-left: 1px solid rgba(255,255,255,0.06); margin-left: 20px; }
.nav-acc__items .nav-subitem { padding-left: 12px; }

/* Search empty state */
.nav-empty { padding: 20px 14px; text-align: center; font-size: 12.5px; color: var(--sidebar-text-soft); }

/* Hidden nav elements during search */
.nav-subitem[hidden], .nav-item--solo[hidden] { display: none; }
