/* ================================================================
   AggM8 — "Quarry Command" Premium Theme
   Construction-grade precision meets luxury SaaS
   Inter (all weights) + IBM Plex Mono (data)
   ================================================================ */

/* ── DESIGN TOKENS ──────────────────────────────────────── */
:root {
  /* Typography — Inter everywhere, per the CoreM8 design system */
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', ui-monospace, monospace;

  /* Spacing scale */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;

  /* Radii — CoreM8 scale */
  --r-sm: 8px; --r-md: 11px; --r-lg: 16px; --r-xl: 20px;

  /* Motion */
  --ease: cubic-bezier(.4,0,.2,1);
  --ease-out: cubic-bezier(0,.55,.45,1);
  --ease-spring: cubic-bezier(.34,1.56,.64,1);
  --dur: 0.18s;
  --dur-md: 0.3s;
  --dur-lg: 0.5s;

  /* ── Light palette — CoreM8 surfaces, hairline borders ── */
  --bg: #f6f6f9;
  --bg-grad: radial-gradient(1100px 600px at 80% -10%, rgba(251,194,1,.07), transparent 60%);
  --bg-elevated: #fbfbfd;
  --surface: #ffffff;
  --surface-hover: #f8f8fb;
  --t: #15151f;
  --t2: #33333f;
  --tm: #51515f;
  --td: #8a8a99;
  --bd: rgba(12,12,40,0.09);
  --bd-strong: rgba(12,12,40,0.16);
  --link: #8F6900;

  /* Brand — the logo's gold. On light surfaces the gold is darkened so it
     still carries as an ink; --accent-ink is what sits ON an accent fill. */
  --accent: #B98900;
  --accent-hover: #A87C00;
  --accent-strong: #8F6900;
  --accent-ink: #23272B;
  --accent-muted: rgba(251,194,1,0.14);
  --accent-glow: rgba(251,194,1,0.24);

  /* Semantic */
  --ok: #16a34a;
  --ok-muted: rgba(22,163,74,0.10);
  --warn: #C2410C;
  --warn-muted: rgba(194,65,12,0.10);
  --err: #dc2626;
  --err-muted: rgba(220,38,38,0.10);
  --info: #2563eb;
  --info-muted: rgba(37,99,235,0.10);

  /* Legacy mappings */
  --primary: var(--accent);
  --primary-hover: var(--accent-hover);
  --primary-light: var(--accent-muted);
  --ok-light: var(--ok-muted);
  --warning: var(--warn);
  --warning-light: var(--warn-muted);
  --rd: var(--err);
  --rd-light: var(--err-muted);
  --ac: var(--info);
  --ac-light: var(--info-muted);
  --amber: var(--warn);

  /* Elevation — CoreM8 soft long shadows */
  --shadow-xs: 0 1px 2px rgba(20,20,50,0.05);
  --shadow-sm: 0 1px 2px rgba(20,20,50,0.06), 0 8px 24px -12px rgba(30,30,70,0.16);
  --shadow: 0 1px 2px rgba(20,20,50,0.06), 0 14px 34px -16px rgba(30,30,70,0.22);
  --shadow-md: 0 2px 4px rgba(20,20,50,0.06), 0 18px 44px -18px rgba(30,30,70,0.25);
  --shadow-lg: 0 24px 60px -22px rgba(30,30,70,0.28);
  --shadow-xl: 0 32px 80px -24px rgba(30,30,70,0.34);
  --shadow-glow: 0 0 20px var(--accent-glow);
  --shadow-inset: inset 0 1px 0 rgba(255,255,255,0.08);

  /* Sidebar — near-black, CoreM8 depth */
  --sidebar-bg: #0b0b12;
  --sidebar-surface: rgba(255,255,255,0.05);
  --sidebar-surface-hover: rgba(255,255,255,0.09);
  --sidebar-text: rgba(255,255,255,0.45);
  --sidebar-text-hover: rgba(255,255,255,0.90);
  --sidebar-w: 240px;
  --sidebar-w-collapsed: 64px;
}

[data-theme="dark"] {
  --bg: #08080c;
  --bg-grad: radial-gradient(1200px 700px at 78% -8%, rgba(251,194,1,.10), transparent 60%),
             radial-gradient(900px 600px at 5% 0%, rgba(56,189,248,.04), transparent 55%);
  --bg-elevated: #1b1b26;
  --surface: #101018;
  --surface-hover: #16161f;
  --t: #f3f3f7;
  --t2: #d0d0da;
  --tm: #a6a6b8;
  --td: #6c6c80;
  --bd: rgba(255,255,255,0.07);
  --bd-strong: rgba(255,255,255,0.12);
  --link: #FFD84D;
  --ok: #34d399;
  --warn: #FB923C;
  --err: #fb7185;
  --info: #38bdf8;
  --accent: #FBC201;
  --accent-hover: #FFD84D;
  --accent-strong: #C89A00;
  --accent-ink: #23272B;
  --accent-muted: rgba(251,194,1,0.16);
  --accent-glow: rgba(251,194,1,0.30);
  --ok-muted: rgba(52,211,153,0.13);
  --warn-muted: rgba(251,146,60,0.13);
  --err-muted: rgba(251,113,133,0.13);
  --info-muted: rgba(56,189,248,0.13);
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4), 0 8px 24px -12px rgba(0,0,0,0.6);
  --shadow: 0 1px 2px rgba(0,0,0,0.4), 0 12px 32px -12px rgba(0,0,0,0.7);
  --shadow-md: 0 2px 4px rgba(0,0,0,0.4), 0 16px 40px -14px rgba(0,0,0,0.7);
  --shadow-lg: 0 24px 60px -20px rgba(0,0,0,0.8);
  --shadow-xl: 0 32px 80px -22px rgba(0,0,0,0.85);
  --sidebar-bg: #0a0a10;
}

/* ── RESET ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { overscroll-behavior: none; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-weight: 400;
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  color: var(--t);
  line-height: 1.55;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
a { color: var(--link); text-decoration: none; transition: color var(--dur) var(--ease); }
a:hover { color: var(--accent-hover); }
h1,h2,h3,h4,h5,h6 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--t);
  margin: 0 0 var(--sp-2);
  line-height: 1.25;
  letter-spacing: -0.035em;
}
img { max-width: 100%; }

/* ── UTILITY ────────────────────────────────────────────── */
.text-muted { color: var(--tm) !important; }
.text-danger { color: var(--err) !important; }
.text-success { color: var(--ok) !important; }
.fw-bold { font-weight: 700; }
.fw-600 { font-weight: 600; }
.me-1 { margin-right: 4px; }
.me-2 { margin-right: 8px; }
.ms-1 { margin-left: 4px; }
.ms-2 { margin-left: 8px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.p-0 { padding: 0 !important; }
.p-2 { padding: 8px; }
.p-3 { padding: 16px; }
.px-3 { padding-left: 16px; padding-right: 16px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.w-100 { width: 100%; }
.text-center { text-align: center; }
.text-end { text-align: right; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 16px; }
.d-none { display: none !important; }
.d-flex { display: flex !important; }
.d-inline { display: inline !important; }
.d-block { display: block !important; }
@media (min-width: 769px) {
  .d-md-flex { display: flex !important; }
  .d-md-none { display: none !important; }
  .d-md-block { display: block !important; }
  .d-md-table-cell { display: table-cell !important; }
  .d-none.d-md-flex { display: flex !important; }
}
@media (max-width: 768px) {
  .d-md-flex { display: none !important; }
  .d-md-none { display: initial !important; }
  .d-md-block { display: none !important; }
  .d-md-table-cell { display: none !important; }
  .d-none.d-md-flex { display: none !important; }
}

/* ── SIDEBAR ────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow: hidden;
  transition: width 0.28s cubic-bezier(.4,0,.2,1);
}
.sidebar::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 0%, rgba(251,194,1,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 50% 80% at 80% 100%, rgba(251,194,1,0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}
.sidebar::after {
  content: '';
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.03) 50%, rgba(255,255,255,0.06) 100%);
  z-index: 1;
}
.sidebar-inner {
  display: flex; flex-direction: column; height: 100%;
  padding: 20px 10px 16px;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative; z-index: 1;
  scrollbar-width: none;
}
.sidebar-inner::-webkit-scrollbar { display: none; }
.sidebar-brand {
  display: flex; align-items: center; gap: 14px;
  padding: 4px 6px 0;
  margin-bottom: 24px;
}
.brand-icon {
  width: 40px; height: 40px; min-width: 40px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  transition: transform 0.2s var(--ease-spring);
}
.brand-icon img { width: 100%; height: 100%; object-fit: contain; display: block; }
.sidebar-brand:hover .brand-icon { transform: scale(1.05); }
/* Wordmark replaces the typed "AggM8" — height-driven so it scales with the rail. */
.brand-wordmark { height: 17px; width: auto; display: block; margin-bottom: 1px; }
.brand-text {
  overflow: hidden; white-space: nowrap;
  transition: opacity 0.2s ease, width 0.28s ease;
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 800; color: #fff; font-size: 1.15rem;
  display: block; letter-spacing: -0.03em;
}
.brand-sub {
  font-size: 0.64rem; color: rgba(255,255,255,0.6);
  display: block; letter-spacing: 0.14em; text-transform: uppercase;
  font-weight: 600; margin-top: 1px;
}
.division-switch {
  background: none; border: none; cursor: pointer;
  font: inherit; color: rgba(255,255,255,0.45);
  font-size: 0.58rem; letter-spacing: 0.14em; text-transform: uppercase;
  font-weight: 600; padding: 0; display: inline-flex; align-items: center;
  transition: color 0.15s;
}
.division-switch:hover { color: rgba(255,255,255,0.85); }
.sidebar-section-label {
  display: flex;
  align-items: center;

  padding: 10px 12px;
  margin: 20px 0 6px;

  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;

  color: rgba(255,255,255,0.75);
  font-family: var(--font-display);

  background: rgba(255,255,255,0.04);
  border-radius: 10px;

  white-space: nowrap;
}
.sidebar-section-label::before {
  content: '';
  display: inline-block;

  width: 4px;
  height: 14px;

  background: linear-gradient(to bottom, #FFD84D, #FBC201);
  border-radius: 3px;

  margin-right: 10px;
}
.sidebar-section-label:first-of-type { margin-top: 0; }

/* ── Sidebar dropdowns ── */
.sidebar-dropdown { margin-top: 4px; }
.sidebar-dropdown-btn {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 9px 12px; border-radius: 8px;
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,0.55);
  font-size: 0.82rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  font-family: var(--font-display);
  transition: all 0.2s ease;
  white-space: nowrap;
}
.sidebar-dropdown-btn:hover { color: rgba(255,255,255,0.85); background: rgba(255,255,255,0.04); }
.sidebar-dropdown-btn i:first-child { font-size: 0.9rem; width: 20px; text-align: center; }
.sidebar-dd-arrow {
  margin-left: auto; font-size: 0.65rem;
  transition: transform 0.25s ease; opacity: 0.5;
}
.sidebar-dropdown.open .sidebar-dd-arrow { transform: rotate(180deg); opacity: 0.8; }
.sidebar-dropdown-menu {
  display: flex; flex-direction: column; gap: 2px;
  max-height: 0; overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 0 0 8px;
}
.sidebar-dropdown.open .sidebar-dropdown-menu {
  max-height: 300px;
  padding: 4px 0 4px 8px;
}
.sidebar-dropdown-menu .sidebar-link { font-size: 0.85rem; padding: 7px 12px; }
/* Collapsed sidebar: hide dropdown text/arrow, show icon only */
.sidebar.collapsed .sidebar-dropdown-btn span,
.sidebar.collapsed .sidebar-dd-arrow { opacity: 0; width: 0; overflow: hidden; }
.sidebar.collapsed .sidebar-dropdown-btn { justify-content: center; padding: 10px 0; }
.sidebar.collapsed .sidebar-dropdown-menu { padding-left: 0; }
.sidebar.collapsed .sidebar-dropdown-menu .sidebar-link { justify-content: center; padding: 8px 0; }

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar-link {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 8px;
  color: rgba(255,255,255,0.65);
  font-size: 0.88rem; font-weight: 500;
  transition: all 0.2s cubic-bezier(.4,0,.2,1);
  text-decoration: none;
  position: relative;
  white-space: nowrap; overflow: hidden;
  letter-spacing: -0.01em;
}
.sidebar-link { backdrop-filter: blur(4px); }
.sidebar-link i {
  font-size: 1.05rem; min-width: 20px; width: 20px; text-align: center;
  transition: transform 0.2s var(--ease-spring), color 0.2s, opacity 0.2s;
  flex-shrink: 0;
  opacity: 0.65;
}
.sidebar-link span {
  overflow: hidden; text-overflow: ellipsis;
  transition: opacity 0.2s ease, color 0.2s;
}
.sidebar-link:hover {
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.95);
}
.sidebar-link:hover i { transform: translateX(1px); opacity: 1; }
.sidebar-link.active {
  background: rgba(251,194,1,0.10);
  color: #FBC201;
  font-weight: 600;
}
.sidebar-link.active i { opacity: 1; color: #FBC201; }
.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 3px;
  background: linear-gradient(to bottom, #FFD84D, #FBC201);
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 8px rgba(251,194,1,0.3);
}
.sidebar-badge {
  margin-left: auto;
  background: #ef4444;
  color: #fff; font-size: 0.58rem; font-weight: 700;
  font-family: var(--font-mono);
  padding: 2px 7px; border-radius: 10px;
  line-height: 1.3;
  flex-shrink: 0;
  transition: opacity 0.2s ease;
  box-shadow: 0 2px 6px rgba(239,68,68,0.3);
}

/* ── Collapse toggle ── */
.sidebar-collapse-btn {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 8px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.3); cursor: pointer;
  position: absolute; top: 22px; right: 10px; z-index: 5;
  font-size: 0.72rem; transition: all 0.2s;
  backdrop-filter: blur(4px);
}
.sidebar-collapse-btn:hover {
  background: rgba(255,255,255,0.10); color: rgba(255,255,255,0.75);
  border-color: rgba(255,255,255,0.12);
}

/* ── Collapsed state ── */
.sidebar.collapsed { width: var(--sidebar-w-collapsed); }
.sidebar.collapsed .brand-text { opacity: 0; width: 0; }
.sidebar.collapsed .sidebar-section-label { opacity: 0; height: 0; padding: 0; margin: 4px 0; overflow: hidden; }
.sidebar.collapsed .sidebar-link span { opacity: 0; width: 0; }
.sidebar.collapsed .sidebar-link { justify-content: center; padding: 10px 0; }
.sidebar.collapsed .sidebar-link i { margin: 0; }
.sidebar.collapsed .sidebar-link.active::before { display: none; }
.sidebar.collapsed .sidebar-badge { opacity: 0; width: 0; padding: 0; overflow: hidden; }
.sidebar.collapsed .sidebar-footer-links { opacity: 0; height: 0; overflow: hidden; padding: 0; margin: 0; }
.sidebar.collapsed .sidebar-user { justify-content: center; }
.sidebar.collapsed .user-info { opacity: 0; width: 0; overflow: hidden; }
.sidebar.collapsed .sidebar-collapse-btn { right: 50%; transform: translateX(50%); }
.sidebar.collapsed .sidebar-collapse-btn i { transform: rotate(180deg); }
.sidebar.collapsed + .main-content { margin-left: var(--sidebar-w-collapsed); }

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.04);
}
.sidebar-footer-links {
  padding: 0 12px 8px;
  display: flex; gap: 8px; flex-wrap: wrap;
  font-size: 0.64rem;
}
.sidebar-footer-links a {
  color: rgba(255,255,255,0.42);
  text-decoration: none;
  transition: color 0.2s;
}
.sidebar-footer-links a:hover { color: rgba(255,255,255,0.8); }
.sidebar-user {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 10px; margin-bottom: 4px;
  border-radius: 10px;
  transition: background 0.2s;
}
.sidebar-user:hover { background: rgba(255,255,255,0.04); }
.user-avatar {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, #FBC201 0%, #FFD84D 100%);
  color: #23272B;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem; font-weight: 800; flex-shrink: 0;
  font-family: var(--font-display);
  box-shadow: 0 2px 8px rgba(251,194,1,0.2);
}
.user-info { display: flex; flex-direction: column; min-width: 0; }
.user-name { color: rgba(255,255,255,0.82); font-size: 0.78rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -0.01em; }
.user-role { color: rgba(255,255,255,0.5); font-size: 0.65rem; font-weight: 500; }
.sidebar-logout { color: rgba(255,255,255,0.45) !important; border-radius: 10px; }
.sidebar-logout:hover { color: rgba(255,255,255,0.85) !important; background: rgba(239,68,68,0.10) !important; }

/* ── MAIN LAYOUT ────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.28s cubic-bezier(.4,0,.2,1);
  overflow-x: hidden;
  min-width: 0;
}

/* ── TOPBAR ─────────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--sp-8);
  background: var(--topbar-bg, var(--surface));
  border-bottom: 1px solid var(--bd);
  gap: var(--sp-4);
  position: sticky; top: 0; z-index: 50;
  height: 60px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
:root {
  --topbar-bg: rgba(255,255,255,0.85);
}
[data-theme="dark"] {
  --topbar-bg: rgba(16,16,24,0.82);
}
.topbar-left { display: flex; align-items: center; gap: var(--sp-3); }
.topbar-title {
  font-family: var(--font-display);
  font-size: 1.2rem; font-weight: 700; color: var(--t);
  white-space: nowrap; letter-spacing: -0.03em;
  margin: 0;
}
.topbar-right { display: flex; align-items: center; gap: 6px; }
.topbar-divider {
  width: 1px; height: 20px;
  background: var(--bd);
  margin: 0 6px;
  opacity: 0.6;
}
.topbar-btn {
  width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid transparent; background: transparent; color: var(--tm);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; position: relative;
  font-size: 1rem;
  transition: all 0.2s var(--ease);
}
.topbar-btn:hover {
  background: var(--bg-elevated); color: var(--t);
  border-color: var(--bd);
}
.topbar-btn:active { transform: scale(0.95); }
.notif-dot {
  position: absolute; top: 7px; right: 7px;
  width: 7px; height: 7px; border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 2px var(--surface);
  animation: notif-pulse 2s ease-in-out infinite;
}
@keyframes notif-pulse { 0%,100% { box-shadow: 0 0 0 2px var(--surface); } 50% { box-shadow: 0 0 0 2px var(--surface), 0 0 8px rgba(239,68,68,0.5); } }

/* ── SEARCH ─────────────────────────────────────────────── */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--bd);
  border-radius: 10px;
  padding: 0 12px;
  height: 36px;
  min-width: 200px;
  transition: all 0.25s var(--ease);
}

.search-box:hover {
  border-color: var(--bd-strong);
}

.search-box:focus-within {
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
  min-width: 280px;
}

.search-box i {
  color: var(--td);
  font-size: 0.8rem;
  margin-right: 8px;
  flex-shrink: 0;
  transition: color 0.2s;
}

.search-box:focus-within i {
  color: var(--accent);
}

.search-box input {
  border: none !important;
  background: transparent !important;
  outline: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--t);
  width: 100%;
  min-width: 0;
  padding: 0;
  font-weight: 400;
}
.search-box input::placeholder { color: var(--td); font-weight: 400; }
.search-shortcut {
  font-family: var(--font-mono);
  font-size: 0.6rem; font-weight: 600;
  padding: 2px 6px; border-radius: 5px;
  background: var(--bd); color: var(--td);
  border: 1px solid var(--bd-strong);
  line-height: 1; flex-shrink: 0;
}
.search-results {
  display: none; position: absolute; top: calc(100% + 6px); left: -1px; right: -1px;
  background: var(--surface); border: 1px solid var(--bd);
  border-radius: 12px; box-shadow: var(--shadow-lg);
  max-height: 380px; overflow-y: auto; z-index: 200;
  animation: dropdown-in 0.15s var(--ease-out);
}
@keyframes dropdown-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.search-item {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 10px 14px; text-decoration: none; color: var(--t);
  transition: background 0.15s;
  border-bottom: 1px solid var(--bd);
}
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: var(--bg-elevated); }
.search-item-icon {
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--accent-muted); display: flex; align-items: center; justify-content: center;
  color: var(--accent); flex-shrink: 0; font-size: 0.9rem;
}
.search-item-body { flex: 1; min-width: 0; }
.search-item-title { font-weight: 600; font-size: 0.84rem; color: var(--t); display: block; font-family: var(--font-display); }
.search-item-sub { font-size: 0.72rem; color: var(--tm); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-type { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--tm); background: var(--bg-elevated); padding: 2px 8px; border-radius: 10px; flex-shrink: 0; font-family: var(--font-mono); }
.search-empty { padding: var(--sp-8); text-align: center; color: var(--tm); font-size: 0.85rem; }
.search-inline { min-width: 180px; }
.search-inline form { display: contents; }
.search-inline input { border: none; background: none; outline: none; font-family: var(--font-body); font-size: 0.85rem; color: var(--t); width: 100%; }

/* ── PAGE CONTENT ───────────────────────────────────────── */
.page-content {
  padding: var(--sp-8) var(--sp-8) 100px;
  flex: 1;
  width: 100%;
  overflow-x: hidden;
  min-width: 0;
}

/* ── ALERTS ─────────────────────────────────────────────── */
.alert {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  font-size: 0.84rem; font-weight: 500;
  margin-bottom: var(--sp-4);
  border-left: 4px solid var(--bd);
  background: var(--surface);
  position: relative;
  animation: alert-in var(--dur-md) var(--ease-out);
  box-shadow: var(--shadow-sm);
}
@keyframes alert-in { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: translateX(0); } }
.alert-success { border-left-color: var(--ok); background: var(--ok-muted); color: var(--ok); }
.alert-error, .alert-danger { border-left-color: var(--err); background: var(--err-muted); color: var(--err); }
.alert-warning { border-left-color: var(--warn); background: var(--warn-muted); color: var(--warn); }
.alert-info { border-left-color: var(--info); background: var(--info-muted); color: var(--info); }
.alert-dismissible { padding-right: 44px; }
.alert-close, .btn-close {
  position: absolute; right: var(--sp-3); top: 50%; transform: translateY(-50%);
  background: none; border: none; color: inherit; cursor: pointer;
  font-size: 0.82rem; opacity: 0.5; padding: var(--sp-1);
  transition: opacity var(--dur) var(--ease);
  width: auto; height: auto;
}
.alert-close:hover, .btn-close:hover { opacity: 1; }
.btn-close { font-size: 0; }
.btn-close::before { content: '\2715'; font-size: 14px; color: inherit; }

/* ── CARDS ──────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--bd);
  margin-bottom: var(--sp-4);
  overflow: hidden;
  transition: box-shadow var(--dur-md) var(--ease), transform var(--dur) var(--ease);
  box-shadow: 0 1px 4px rgba(26,24,22,0.05);
}
.card:hover {
  box-shadow: 0 8px 28px rgba(26,24,22,0.09), 0 2px 6px rgba(26,24,22,0.04);
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-4) var(--sp-5);
  font-family: var(--font-display);
  font-weight: 700; font-size: 0.92rem; color: var(--t);
  border-bottom: 1px solid var(--bd);
  background: var(--bg-elevated);
  letter-spacing: -0.02em;
}
.card-header i { color: var(--accent); opacity: 0.7; }
.card-body { padding: var(--sp-5); }

/* ── KPI CARDS ──────────────────────────────────────────── */
.dash-kpis {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--sp-4); margin-bottom: var(--sp-6);
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--bd);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  display: flex; align-items: center; gap: var(--sp-4);
  position: relative;
  overflow: hidden;
  transition: all var(--dur-md) var(--ease);
  box-shadow: var(--shadow-xs);
}
.kpi-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--bd);
  transition: width var(--dur-md) var(--ease);
}
.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.kpi-card:hover::before { width: 5px; }
.kpi-icon {
  width: 50px; height: 50px; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0;
}
.kpi-green  { background: var(--ok-muted); color: var(--ok); }
.kpi-amber  { background: var(--warn-muted); color: var(--warn); }
.kpi-blue   { background: var(--accent-muted); color: var(--accent); }
.kpi-purple { background: var(--info-muted); color: var(--info); }
.kpi-red    { background: var(--err-muted); color: var(--err); }
.kpi-body { display: flex; flex-direction: column; }
.kpi-value {
  font-family: var(--font-display);
  font-size: 1.75rem; font-weight: 900; color: var(--t);
  line-height: 1.1; letter-spacing: -0.04em;
}
.kpi-label { font-size: 0.72rem; color: var(--tm); font-weight: 500; margin-top: 2px; }

.kpi-card:has(.kpi-green)::before { background: var(--ok); }
.kpi-card:has(.kpi-amber)::before { background: var(--warn); }
.kpi-card:has(.kpi-blue)::before { background: var(--accent); }
.kpi-card:has(.kpi-purple)::before { background: var(--info); }
.kpi-card:has(.kpi-red)::before { background: var(--err); }

/* ── BUTTONS ────────────────────────────────────────────── */
.bt {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 22px; border-radius: var(--r-sm);
  font-size: 0.84rem; font-weight: 600;
  font-family: var(--font-body);
  border: 1px solid transparent; cursor: pointer;
  transition: all var(--dur) var(--ease);
  text-decoration: none; line-height: 1.4; white-space: nowrap;
  position: relative;
}
.bt:hover { text-decoration: none; }
.bt:active { transform: scale(0.97); }
.bt-p {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 1px 2px rgba(251,194,1,0.2);
}
.bt-p:hover {
  background: var(--accent-hover);
  color: var(--accent-ink);
  box-shadow: 0 4px 12px rgba(251,194,1,0.25);
  transform: translateY(-1px);
}
.bt-s {
  background: var(--surface); color: var(--t2); border-color: var(--bd);
  box-shadow: var(--shadow-xs);
}
.bt-s:hover { background: var(--bg-elevated); border-color: var(--bd-strong); box-shadow: var(--shadow-sm); }
.bt-g { background: transparent; color: var(--tm); border-color: var(--bd); }
.bt-g:hover { background: var(--bg-elevated); color: var(--t); }
.bt-d { background: var(--err-muted); color: var(--err); border-color: rgba(201,60,55,0.15); }
.bt-d:hover { background: var(--err); color: #fff; box-shadow: 0 4px 12px rgba(201,60,55,0.3); }
.bt-ok { background: var(--ok-muted); color: var(--ok); border-color: rgba(26,127,55,0.15); }
.bt-ok:hover { background: var(--ok); color: #fff; box-shadow: 0 4px 12px rgba(26,127,55,0.3); }
.bt-sm { padding: 7px 16px; font-size: 0.78rem; }
.bt-xs { padding: 4px 10px; font-size: 0.72rem; border-radius: var(--r-sm); }

/* ── BADGES ─────────────────────────────────────────────── */
.bd {
  display: inline-flex; align-items: center;
  padding: 3px 10px; height: 22px;
  border-radius: 11px; font-size: 0.66rem; font-weight: 600;
  font-family: var(--font-mono);
  text-transform: capitalize; letter-spacing: 0.3px;
  background: var(--bg-elevated); color: var(--tm);
}
.bd-active, .bd-completed, .bd-paid, .bd-accepted { background: var(--ok-muted); color: var(--ok); }
.bd-overdue, .bd-declined { background: var(--err-muted); color: var(--err); }
.bd-paused, .bd-pending { background: var(--warn-muted); color: var(--warn); }
.bd-in-progress { background: var(--accent-muted); color: var(--accent); }
.bd-sent, .bd-info, .bd-scheduled { background: var(--info-muted); color: var(--info); }

/* ── FORMS ──────────────────────────────────────────────── */
.fg { margin-bottom: var(--sp-4); }
.fl {
  display: block; font-size: 0.72rem; font-weight: 700; color: var(--tm);
  margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.08em;
  font-family: var(--font-display);
}
.fi, .fs, .form-control, .form-select,
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="tel"], input[type="date"], input[type="time"],
input[type="url"], input[type="search"], select, textarea {
  width: 100%; padding: 10px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--bd); font-size: 0.9rem;
  font-family: var(--font-body); background: var(--surface); color: var(--t);
  transition: border var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.fi:focus, .fs:focus, .form-control:focus, .form-select:focus,
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}
.fi::placeholder, input::placeholder, textarea::placeholder { color: var(--td); }
textarea.fi, textarea { min-height: 80px; resize: vertical; }
.fi-sm { padding: 6px 10px; font-size: 0.78rem; }
.fr { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.form-label { display: block; font-size: 0.72rem; font-weight: 700; color: var(--tm); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.08em; font-family: var(--font-display); }

select, .fs, select.fi, .form-select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%237c7872'%3E%3Cpath d='M6 8.5L1 3.5h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px; cursor: pointer;
}
select option { background: var(--surface); color: var(--t); }
[data-theme="dark"] select, [data-theme="dark"] .fs, [data-theme="dark"] select.fi {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238a8680'%3E%3Cpath d='M6 8.5L1 3.5h10z'/%3E%3C/svg%3E");
}
[data-theme="dark"] select option { background: var(--surface); color: var(--t); }

.phone-wrap { display: flex; gap: 0; }
.phone-wrap .phone-code {
  width: 90px; flex-shrink: 0;
  border-radius: var(--r-sm) 0 0 var(--r-sm); border-right: none;
  padding: 10px 8px; font-size: 0.84rem;
  background: var(--bg-elevated); color: var(--t); border: 1px solid var(--bd);
  appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='%237c7872'%3E%3Cpath d='M5 7L1 3h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 6px center; padding-right: 20px;
}
.phone-wrap .phone-code option { background: var(--surface); color: var(--t); }
.phone-wrap .fi { border-radius: 0 var(--r-sm) var(--r-sm) 0; flex: 1; min-width: 0; }
input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; }

/* ── MODALS ─────────────────────────────────────────────── */
.mo {
  display: none; position: fixed; inset: 0;
  background: rgba(17,17,16,0.6);
  z-index: 1050;
  align-items: center; justify-content: center;
  padding: var(--sp-4);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
}
.mo.show { display: flex; }
.ml {
  background: var(--surface);
  border: 1px solid var(--bd);
  border-radius: var(--r-xl);
  width: 100%; max-width: 540px; max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: modal-in var(--dur-md) var(--ease-spring);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(24px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
.ml-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-5) var(--sp-6); border-bottom: 1px solid var(--bd);
}
.ml-hd h3 { margin: 0; font-size: 1.1rem; font-family: var(--font-display); font-weight: 800; letter-spacing: -0.03em; }
.ml-bd { padding: var(--sp-6); }
.ml-ft {
  display: flex; justify-content: flex-end; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--bd); background: var(--bg);
  border-radius: 0 0 var(--r-xl) var(--r-xl);
}

/* ── TABLES ─────────────────────────────────────────────── */
.tw { overflow-x: auto; border-radius: var(--r-md); border: 1px solid var(--bd); box-shadow: var(--shadow-xs); }
.tw table { width: 100%; border-collapse: collapse; }
.tw th, .tw td { padding: var(--sp-3) var(--sp-4); text-align: left; font-size: 0.82rem; }
.tw th {
  font-family: var(--font-display); font-weight: 700; color: var(--tm);
  text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.66rem;
  border-bottom: 2px solid var(--bd); background: var(--bg);
  position: sticky; top: 0;
}
.tw td { border-top: 1px solid var(--bd); transition: background var(--dur) var(--ease); }
.tw tr:hover td { background: var(--accent-muted); }

.table-responsive { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: var(--sp-3) var(--sp-4); text-align: left; font-size: 0.84rem; border-bottom: 1px solid var(--bd); }
.table th {
  font-family: var(--font-display); font-weight: 700; color: var(--tm);
  font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.08em;
  background: transparent;
}
.table tr { transition: background var(--dur) var(--ease); }
.table tr:hover td { background: var(--accent-muted); }
.table-actions { display: flex; gap: var(--sp-1); align-items: center; }
.table td a, .overdue-row a, .job-row a, a.week-job-name { transition: color var(--dur) var(--ease); }
.table td a:hover, .overdue-row a:hover, .job-row a:hover, a.week-job-name:hover { color: var(--accent) !important; }
.customer-name { font-weight: 600; font-size: 0.88rem; color: var(--t); font-family: var(--font-display); }
.customer-address { font-size: 0.74rem; color: var(--tm); }
.invoice-number { font-weight: 600; color: var(--info); font-family: var(--font-mono); font-size: 0.82rem; }
.date { color: var(--tm); font-size: 0.82rem; font-family: var(--font-mono); }

/* ── PAGE TOOLBAR ───────────────────────────────────────── */
.page-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-5); flex-wrap: wrap; gap: var(--sp-3); }
.toolbar-left { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.toolbar-right { display: flex; align-items: center; gap: var(--sp-2); }

.filter-pills, .filter-tabs {
  display: flex; gap: 2px; background: var(--bg-elevated);
  padding: 3px; border-radius: var(--r-md); border: 1px solid var(--bd);
}
.filter-pill, .filter-tab {
  padding: 5px 13px; border-radius: calc(var(--r-sm) - 1px);
  font-size: 0.75rem; font-weight: 600; color: var(--tm);
  transition: all var(--dur) var(--ease); text-decoration: none;
  font-family: var(--font-display); white-space: nowrap; line-height: 1.4;
}
.filter-pill:hover, .filter-tab:hover { background: var(--surface); color: var(--t); }
.filter-pill.active, .filter-tab.active {
  background: var(--surface); color: var(--accent); font-weight: 700;
  box-shadow: var(--shadow-sm);
}
/* legacy .filter-bar used standalone — keep it flat */
.filter-bar { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-5); }

.view-toggle { display: flex; gap: 0; border: 1px solid var(--bd); border-radius: var(--r-md); overflow: hidden; }
.view-btn {
  padding: 7px 16px; font-size: 0.82rem; font-weight: 600;
  color: var(--tm); background: var(--bg-elevated); text-decoration: none;
  transition: all var(--dur) var(--ease); display: flex; align-items: center; gap: 6px;
  font-family: var(--font-display);
}
.view-btn:hover { background: var(--surface); color: var(--t); }
.view-btn.active { background: var(--accent); color: #fff; }

/* ── GRIDS ──────────────────────────────────────────────── */
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-5); }
.g3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); }
.dash-grid { display: flex; flex-direction: column; gap: var(--sp-4); }
.dash-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-6); }

/* ── QUICK ACTIONS ──────────────────────────────────────── */
.quick-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.quick-action {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4); border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--bd);
  font-size: 0.82rem; font-weight: 600; color: var(--t2);
  text-decoration: none; cursor: pointer;
  font-family: var(--font-body);
  transition: all var(--dur) var(--ease);
  box-shadow: var(--shadow-xs);
}
.quick-action i { color: var(--accent); font-size: 1rem; }
.quick-action:hover {
  border-color: var(--accent); color: var(--accent);
  box-shadow: var(--shadow-sm), 0 0 0 3px var(--accent-muted);
  transform: translateY(-2px);
}

/* ── WEATHER ────────────────────────────────────────────── */
.weather-days { display: flex; gap: var(--sp-2); overflow-x: auto; }
.weather-day {
  flex: 1; min-width: 90px; text-align: center;
  padding: var(--sp-3) var(--sp-2); border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--bd);
  transition: all var(--dur) var(--ease);
}
.weather-day:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.weather-day-name { font-size: 0.72rem; font-weight: 700; color: var(--tm); margin-bottom: 6px; display: block; font-family: var(--font-display); }
.weather-icon { font-size: 1.4rem; color: var(--accent); display: block; margin-bottom: var(--sp-1); }
.weather-temp { font-size: 1.1rem; font-weight: 800; color: var(--t); font-family: var(--font-display); }
.weather-detail { font-size: 0.68rem; color: var(--tm); }
.weather-warning { border-color: var(--warn); background: var(--warn-muted); }
.weather-alert { font-size: 0.65rem; font-weight: 600; color: var(--warn); margin-top: var(--sp-1); }
.weather-loading { text-align: center; color: var(--tm); padding: var(--sp-4); font-size: 0.85rem; }
.spin { animation: spin 1s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── DASHBOARD COMPONENTS ───────────────────────────────── */
.job-row {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) 0; border-bottom: 1px solid var(--bd);
  font-size: 0.85rem;
}
.job-row:last-child { border-bottom: none; }
.job-time { font-weight: 700; color: var(--info); min-width: 48px; font-size: 0.82rem; font-family: var(--font-mono); }
.team-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.job-info { flex: 1; min-width: 0; }
.job-name { font-weight: 600; color: var(--t); display: block; font-family: var(--font-display); }
.job-detail { font-size: 0.74rem; color: var(--tm); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job-price { font-weight: 700; color: var(--ok); white-space: nowrap; font-family: var(--font-mono); }

.week-day-row { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-3) 0; border-bottom: 1px solid var(--bd); }
.week-day-row:last-child { border-bottom: none; }
.week-day-today { background: var(--accent-muted); margin: 0 calc(-1 * var(--sp-5)); padding: var(--sp-3) var(--sp-5); border-radius: var(--r-sm); }
.week-day-name { font-weight: 700; font-size: 0.88rem; display: block; font-family: var(--font-display); }
.week-day-date { font-size: 0.74rem; color: var(--tm); }
.week-day-stats { text-align: right; }
.week-day-count { font-size: 0.82rem; color: var(--tm); display: block; }
.week-day-total { font-weight: 700; color: var(--ok); font-size: 0.88rem; font-family: var(--font-mono); }

.overdue-row { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-3) 0; border-bottom: 1px solid var(--bd); }
.overdue-row:last-child { border-bottom: none; }
.overdue-num { font-weight: 600; color: var(--info); display: block; font-size: 0.85rem; font-family: var(--font-mono); }
.overdue-cust { font-size: 0.78rem; color: var(--tm); }
.overdue-date { font-size: 0.74rem; color: var(--tm); display: block; }
.overdue-amt { font-weight: 700; color: var(--err); font-size: 0.88rem; font-family: var(--font-mono); }

.bar-chart { display: flex; align-items: flex-end; gap: var(--sp-2); height: 130px; padding-bottom: 28px; position: relative; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.bar {
  width: 100%; border-radius: 6px 6px 0 0;
  background: var(--accent);
  min-height: 3px;
  transition: height var(--dur-lg) var(--ease-spring);
}
.bar-green { background: var(--ok); }
.bar-label { font-size: 0.66rem; color: var(--tm); font-weight: 600; margin-top: 8px; font-family: var(--font-display); }

.activity-row { display: flex; gap: var(--sp-3); padding: var(--sp-2) 0; border-bottom: 1px solid var(--bd); }
.activity-row:last-child { border-bottom: none; }
.activity-icon { width: 30px; height: 30px; border-radius: var(--r-sm); background: var(--accent-muted); display: flex; align-items: center; justify-content: center; color: var(--accent); font-size: 0.82rem; flex-shrink: 0; }
.activity-body { flex: 1; }
.activity-text { font-size: 0.82rem; color: var(--t); display: block; }
.activity-time { font-size: 0.68rem; color: var(--td); font-family: var(--font-mono); }

.empty-state { text-align: center; padding: var(--sp-10) var(--sp-4); color: var(--tm); }
.empty-state i { font-size: 2.5rem; display: block; margin-bottom: var(--sp-3); color: var(--td); opacity: 0.5; }
.empty-state p { margin: 0 0 var(--sp-3); font-size: 0.88rem; }

/* ── WEEK VIEW ──────────────────────────────────────────── */
.week-grid { margin-top: var(--sp-2); }
.week-nav { display: flex; justify-content: space-between; margin-bottom: var(--sp-3); }
.week-cols { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--sp-2); }
.week-col {
  background: var(--surface); border: 1px solid var(--bd);
  border-radius: var(--r-md); min-height: 200px;
  transition: all var(--dur) var(--ease);
  box-shadow: var(--shadow-xs);
}
.week-col-today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-glow); }
.week-col-header {
  padding: var(--sp-3); border-bottom: 1px solid var(--bd);
  background: var(--bg); border-radius: var(--r-md) var(--r-md) 0 0;
  text-align: center;
}
.week-col-name { font-family: var(--font-display); font-weight: 700; font-size: 0.82rem; display: block; color: var(--t); }
.week-col-date { font-size: 0.7rem; color: var(--tm); font-family: var(--font-mono); }
.week-col-total { font-size: 0.7rem; color: var(--ok); font-weight: 700; display: block; font-family: var(--font-mono); }
.week-col-body { padding: var(--sp-2); }
.week-job {
  padding: var(--sp-2); border-radius: var(--r-sm);
  background: var(--bg-elevated); margin-bottom: var(--sp-1);
  border-left: 3px solid var(--bd);
  transition: all var(--dur) var(--ease);
}
.week-job:hover { background: var(--accent-muted); transform: translateX(2px); }
.bd-left-pending { border-left-color: var(--warn); }
.bd-left-in-progress { border-left-color: var(--accent); }
.bd-left-completed { border-left-color: var(--ok); }
.week-job-time { font-size: 0.66rem; font-weight: 700; color: var(--info); font-family: var(--font-mono); }
.week-job-name { font-size: 0.76rem; font-weight: 600; color: var(--t); font-family: var(--font-display); }
.week-job-detail { font-size: 0.66rem; color: var(--tm); }
.week-col-empty { text-align: center; color: var(--td); font-size: 0.74rem; padding: var(--sp-5) var(--sp-1); }
.week-job-recurring { border-left: 3px solid var(--info); opacity: 0.85; }
.team-chips { display: flex; gap: 6px; margin-bottom: var(--sp-4); flex-wrap: wrap; }
.team-chip { display: flex; align-items: center; gap: 5px; padding: 4px 10px; background: var(--bg-elevated); border-radius: 16px; border: 1px solid var(--bd); font-size: 0.72rem; font-weight: 600; }

/* ── DAY VIEW ───────────────────────────────────────────── */
.jr {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4); background: var(--surface);
  border: 1px solid var(--bd); border-radius: var(--r-md);
  margin-bottom: var(--sp-2);
  transition: all var(--dur) var(--ease);
  box-shadow: var(--shadow-xs);
}
.jr:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); border-color: var(--accent); }
.jr-time { font-weight: 700; color: var(--info); min-width: 48px; font-size: 0.85rem; font-family: var(--font-mono); }
.jr-info { flex: 1; min-width: 0; }
.jr-name { font-weight: 600; color: var(--t); display: block; text-decoration: none; font-size: 0.88rem; font-family: var(--font-display); }
.jr-name:hover { color: var(--accent); }
.jr-detail { font-size: 0.74rem; color: var(--tm); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jr-price { font-weight: 700; color: var(--ok); white-space: nowrap; font-family: var(--font-mono); }
.jr-actions { display: flex; gap: var(--sp-1); }
.jr-recurring { border-left: 3px solid var(--info); opacity: 0.85; }
.jr-recurring:hover { opacity: 1; }
.schedule-summary {
  display: flex; justify-content: space-between; padding: var(--sp-3) var(--sp-4);
  background: var(--surface); border: 1px solid var(--bd);
  border-radius: var(--r-md); margin-top: var(--sp-2);
  font-size: 0.82rem; color: var(--tm);
}
.schedule-total { font-weight: 700; color: var(--ok); font-family: var(--font-mono); }

/* ── DETAIL PAGES ───────────────────────────────────────── */
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.84rem; font-weight: 600; color: var(--tm);
  margin-bottom: var(--sp-4); text-decoration: none;
  font-family: var(--font-display);
  transition: all var(--dur) var(--ease);
}
.back-link:hover { color: var(--accent); transform: translateX(-3px); }
.detail-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: var(--sp-5); flex-wrap: wrap; gap: var(--sp-3); }
.detail-name { font-family: var(--font-display); font-size: 1.5rem; font-weight: 900; margin: 0; letter-spacing: -0.04em; }
.detail-address { font-size: 0.84rem; color: var(--tm); display: flex; align-items: center; gap: var(--sp-1); }
.detail-header-actions { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-5); }
.detail-row { display: flex; justify-content: space-between; padding: var(--sp-2) 0; border-bottom: 1px solid var(--bd); }
.detail-row:last-child { border-bottom: none; }

.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--sp-3); margin-bottom: var(--sp-5); }
.stat-card {
  background: var(--surface); border: 1px solid var(--bd);
  border-radius: var(--r-md); padding: var(--sp-4) var(--sp-5);
  transition: all var(--dur) var(--ease);
  box-shadow: var(--shadow-xs);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card-label { font-family: var(--font-display); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--tm); margin-bottom: var(--sp-1); font-weight: 700; }
.stat-card-value { font-family: var(--font-display); font-size: 1.4rem; font-weight: 900; color: var(--t); letter-spacing: -0.03em; }
.stat-green { color: var(--ok) !important; }
.stat-blue { color: var(--accent) !important; }
.stat-purple { color: var(--info) !important; }
.stat-red { color: var(--err) !important; }

.detail-fields { display: flex; flex-direction: column; gap: var(--sp-3); }
.detail-field-label { font-family: var(--font-display); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--tm); margin-bottom: 2px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.detail-field-value { font-size: 0.88rem; font-weight: 500; color: var(--t); }

.payment-alert { padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); font-weight: 600; font-size: 0.88rem; display: flex; align-items: center; gap: var(--sp-2); }
.payment-danger { background: var(--err-muted); color: var(--err); }
.payment-ok { background: var(--ok-muted); color: var(--ok); }

.round-tag { font-size: 0.74rem; font-weight: 600; padding: var(--sp-1) var(--sp-3); border-radius: var(--r-sm); background: var(--accent-muted); border-left: 3px solid var(--accent); color: var(--accent); }

/* ── ROUNDS ─────────────────────────────────────────────── */
.round-card .card-body { padding: var(--sp-5); }
.round-header { display: flex; align-items: flex-start; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.round-color { width: 12px; height: 40px; border-radius: var(--r-sm); flex-shrink: 0; margin-top: 2px; }
.round-title { flex: 1; }
.round-name { font-family: var(--font-display); font-size: 1rem; font-weight: 800; margin: 0; color: var(--t); }
.round-day { font-size: 0.74rem; color: var(--tm); font-weight: 500; }
.round-area { font-size: 0.74rem; color: var(--tm); display: flex; align-items: center; gap: var(--sp-1); }
.round-actions { display: flex; gap: var(--sp-1); }
.round-stats { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); }
.round-stat { background: var(--bg-elevated); border-radius: var(--r-md); padding: var(--sp-3); text-align: center; border: 1px solid var(--bd); }
.round-stat-value { font-family: var(--font-display); font-size: 1.15rem; font-weight: 800; display: block; color: var(--t); }
.round-stat-label { font-family: var(--font-display); font-size: 0.62rem; color: var(--tm); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.round-cust-row { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-3) 0; border-bottom: 1px solid var(--bd); }
.round-cust-row:last-child { border-bottom: none; }
.round-cust-name { font-weight: 600; font-size: 0.88rem; color: var(--t); text-decoration: none; display: block; font-family: var(--font-display); }
.round-cust-name:hover { color: var(--accent); }
.round-cust-addr { font-size: 0.74rem; color: var(--tm); }
.round-cust-total { display: flex; justify-content: space-between; padding: var(--sp-3) 0 0; border-top: 2px solid var(--bd); margin-top: var(--sp-2); font-weight: 700; font-size: 0.88rem; color: var(--t); }
.round-assign-row { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) 0; border-bottom: 1px solid var(--bd); cursor: pointer; }
.round-assign-row:hover { background: var(--bg-elevated); margin: 0 calc(-1 * var(--sp-5)); padding: var(--sp-3) var(--sp-5); border-radius: var(--r-sm); }

/* ── TEAM ───────────────────────────────────────────────── */
.team-header { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.team-avatar { width: 44px; height: 44px; border-radius: var(--r-md); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; color: #fff; flex-shrink: 0; font-family: var(--font-display); font-weight: 800; }
.team-info { flex: 1; }
.team-name { font-family: var(--font-display); font-weight: 800; font-size: 0.92rem; display: block; color: var(--t); }
.team-role { font-size: 0.74rem; font-weight: 600; }
.team-stats { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.team-stat { background: var(--bg-elevated); border-radius: var(--r-md); padding: var(--sp-3); border: 1px solid var(--bd); }
.team-stat-label { font-family: var(--font-display); font-size: 0.6rem; color: var(--tm); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; display: block; }
.team-stat-value { font-family: var(--font-display); font-size: 1.1rem; font-weight: 800; margin-top: 2px; display: block; color: var(--t); }
.team-contact { font-size: 0.78rem; color: var(--tm); display: flex; align-items: center; gap: 6px; margin-top: var(--sp-1); }

/* ── REPORTS ────────────────────────────────────────────── */
.metric-row { display: flex; justify-content: space-between; align-items: center; padding: var(--sp-3) 0; border-bottom: 1px solid var(--bd); }
.metric-row:last-child { border-bottom: none; }
.metric-label { font-size: 0.85rem; color: var(--tm); }
.metric-value { font-family: var(--font-display); font-weight: 800; font-size: 0.88rem; color: var(--t); }
.metric-total { padding-top: var(--sp-3); margin-top: var(--sp-1); border-top: 2px solid var(--bd); border-bottom: none; }

/* ── SETTINGS ───────────────────────────────────────────── */
.toggle-group { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-3) 0; border-bottom: 1px solid var(--bd); cursor: pointer; }
.toggle-group:last-of-type { border-bottom: none; }
.toggle-label { font-size: 0.88rem; font-weight: 500; color: var(--t); }
.toggle-switch { position: relative; width: 44px; height: 26px; background: var(--bd-strong); border-radius: 13px; transition: background var(--dur) var(--ease); flex-shrink: 0; }
.toggle-switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; background: #fff; border-radius: 50%; transition: transform var(--dur) var(--ease-spring); box-shadow: 0 1px 3px rgba(0,0,0,0.15); }
.toggle-group input { display: none; }
.toggle-group input:checked + .toggle-switch { background: var(--accent); }
.toggle-group input:checked + .toggle-switch::after { transform: translateX(18px); }
.hours-row { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-2); }
.hours-day { min-width: 90px; font-size: 0.85rem; font-weight: 600; color: var(--t); font-family: var(--font-display); }
.hours-controls { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.hours-closed-label { display: flex; align-items: center; gap: var(--sp-1); font-size: 0.78rem; color: var(--tm); cursor: pointer; margin-left: var(--sp-1); }
.hours-time:disabled { opacity: 0.4; }

/* ── BULK BAR ───────────────────────────────────────────── */
.bulk-bar {
  position: sticky; bottom: 0;
  background: var(--surface); border-top: 2px solid var(--accent);
  padding: var(--sp-3) var(--sp-5); display: flex; align-items: center;
  justify-content: space-between;
  box-shadow: 0 -4px 20px rgba(26,24,22,0.08);
  border-radius: var(--r-md) var(--r-md) 0 0;
}

/* ── AUTH ────────────────────────────────────────────────── */
.auth-container { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 2rem; }
.auth-card {
  width: 100%; max-width: 440px; background: var(--surface);
  border-radius: var(--r-xl); box-shadow: var(--shadow-xl); padding: 44px 40px;
  position: relative; overflow: hidden;
  border: 1px solid var(--bd);
}
.auth-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--accent);
}
.auth-logo { font-size: 2.5rem; text-align: center; margin-bottom: var(--sp-1); color: var(--accent); }
.auth-title { text-align: center; font-family: var(--font-display); font-size: 1.6rem; font-weight: 900; color: var(--t); margin-bottom: var(--sp-1); letter-spacing: -0.04em; }
.auth-sub { text-align: center; font-size: 0.85rem; color: var(--tm); margin-bottom: var(--sp-6); }
.auth-form .fg { margin-bottom: var(--sp-4); }
.auth-form .bt { width: 100%; justify-content: center; padding: var(--sp-3); font-size: 0.95rem; margin-top: var(--sp-2); }
.auth-alt { text-align: center; margin-top: var(--sp-5); font-size: 0.85rem; color: var(--tm); }
.auth-alt a { color: var(--accent); font-weight: 600; }
.flash { padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); margin-bottom: var(--sp-3); font-weight: 500; font-size: 0.85rem; }
.flash-error { background: var(--err-muted); color: var(--err); }
.flash-success { background: var(--ok-muted); color: var(--ok); }
.flash-warning { background: var(--warn-muted); color: var(--warn); }

/* ── EXPORTS ────────────────────────────────────────────── */
.export-list { display: flex; flex-direction: column; gap: 2px; }
.export-item {
  display: flex; align-items: center; gap: var(--sp-4);
  padding: var(--sp-4); border-radius: var(--r-md);
  text-decoration: none; color: var(--t);
  transition: all var(--dur) var(--ease);
}
.export-item:hover { background: var(--accent-muted); color: var(--t); }
.export-icon {
  width: 42px; height: 42px; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}
.export-body { flex: 1; min-width: 0; }
.export-title { font-weight: 600; font-size: 0.88rem; display: block; color: var(--t); font-family: var(--font-display); }
.export-desc { font-size: 0.74rem; color: var(--tm); display: block; }
.export-dl { color: var(--tm); font-size: 1rem; }
.export-item:hover .export-dl { color: var(--accent); }

.quarter-block { padding: var(--sp-4) 0; border-bottom: 1px solid var(--bd); }
.quarter-block:last-child { border-bottom: none; }
.quarter-header { font-family: var(--font-display); font-weight: 700; font-size: 0.82rem; color: var(--tm); margin-bottom: var(--sp-2); }
.quarter-stats { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); }
.quarter-stat { background: var(--bg-elevated); border-radius: var(--r-md); padding: var(--sp-3); border: 1px solid var(--bd); }
.quarter-stat-label { font-family: var(--font-display); font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--tm); font-weight: 700; display: block; }
.quarter-stat-value { font-family: var(--font-display); font-size: 1rem; font-weight: 800; display: block; margin-top: 2px; color: var(--t); }

/* ── DROPDOWNS ──────────────────────────────────────────── */
.cc-dropdown { position: relative; display: inline-block; }
.cc-dropdown-menu {
  display: none; position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--surface); border: 1px solid var(--bd);
  border-radius: var(--r-md); box-shadow: var(--shadow-lg);
  min-width: 220px; z-index: 200; padding: 6px 0;
  animation: dropdown-in var(--dur) var(--ease-out);
}
.cc-dropdown.open .cc-dropdown-menu { display: block; }
.cc-dropdown-item {
  display: flex; align-items: center; padding: var(--sp-2) var(--sp-4);
  font-size: 0.82rem; font-weight: 500; color: var(--t2);
  text-decoration: none; cursor: pointer;
  transition: background var(--dur) var(--ease);
}
.cc-dropdown-item:hover { background: var(--accent-muted); color: var(--t); }
.cc-dropdown-item i { color: var(--tm); }
.cc-dropdown-divider { height: 1px; background: var(--bd); margin: var(--sp-1) 0; }

/* ── CALENDAR ───────────────────────────────────────────── */
.cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-4); }
.cal-nav { display: flex; align-items: center; gap: var(--sp-2); }
.cal-title { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; }

/* ── MOBILE NAV ─────────────────────────────────────────── */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--surface);
  border-top: 1px solid var(--bd);
  padding: 6px 8px max(8px, env(safe-area-inset-bottom));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
[data-theme="light"] .mobile-nav { background: rgba(255,255,255,0.88); }
[data-theme="dark"] .mobile-nav { background: rgba(16,16,24,0.88); }

@media (max-width: 768px) {
  .mobile-nav { display: flex !important; justify-content: space-around; }
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 2px 2px;
  color: var(--tm);
  text-decoration: none;
  font-size: 0.54rem;
  font-weight: 600;
  transition: color 0.15s;
  letter-spacing: 0.3px;
  cursor: pointer;
  border: none;
  background: none;
  -webkit-tap-highlight-color: transparent;
}

.mobile-nav-item.active { color: var(--accent); }
.mobile-nav-item:hover { color: var(--t); }

.mobile-nav-item .mnav-icon {
  width: 44px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 1.2rem;
  transition: background 0.2s, transform 0.15s;
}

.mobile-nav-item.active .mnav-icon {
  background: var(--accent-muted);
  transform: translateY(-1px);
}
.mobile-nav-item:active .mnav-icon { transform: scale(0.92); }

/* ── Mobile More Sheet ─────────────────────────────────── */
.mobile-more-menu {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1100;
  align-items: flex-end;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.mobile-more-menu.show { display: flex; }

.mobile-more-inner {
  background: var(--surface);
  width: 100%;
  border-radius: 20px 20px 0 0;
  padding: 0 0 max(24px, env(safe-area-inset-bottom));
  animation: slideUp 0.28s cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 88vh;
  overflow-y: auto;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.mobile-more-handle {
  width: 32px;
  height: 4px;
  background: var(--bd);
  border-radius: 99px;
  margin: 10px auto 4px;
}

.mobile-more-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px 14px;
  font-weight: 700;
  font-size: 1rem;
  color: var(--t);
  font-family: var(--font-display);
}

.mobile-more-header button {
  background: var(--bg-elevated);
  border: 1px solid var(--bd);
  color: var(--tm);
  cursor: pointer;
  border-radius: 10px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.mobile-more-header button:hover { background: var(--bd); }

.mobile-more-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 0 16px 16px;
}

.mobile-grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 6px 10px;
  border-radius: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--bd);
  color: var(--t2);
  text-decoration: none;
  font-size: 0.64rem;
  font-weight: 600;
  text-align: center;
  transition: background 0.15s, transform 0.12s;
  letter-spacing: 0.1px;
  -webkit-tap-highlight-color: transparent;
}

.mobile-grid-item:active { transform: scale(0.94); background: var(--bd); }

.mobile-grid-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--bd);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  color: var(--accent);
  transition: background 0.15s;
}

.mobile-grid-item:active .mobile-grid-icon { background: var(--accent-muted); }

.mobile-more-section {
  padding: 4px 16px 8px;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--td);
  font-family: var(--font-mono);
}

.mobile-more-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  color: var(--t);
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.12s;
  -webkit-tap-highlight-color: transparent;
}

.mobile-more-link:active { background: var(--bg-elevated); }
.mobile-more-link i { color: var(--accent); width: 24px; font-size: 1.1rem; text-align: center; }
.mobile-more-logout { color: #dc2626 !important; border-top: 1px solid var(--bd); margin-top: 4px; }
.mobile-more-logout i { color: #dc2626 !important; }

/* ── COOKIE BANNER ──────────────────────────────────────── */
.cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 9999;
  padding: var(--sp-3) var(--sp-5);
  background: var(--surface);
  border-top: 1px solid var(--bd);
  box-shadow: 0 -4px 20px rgba(26,24,22,0.08);
}
.cookie-banner-inner {
  display: flex; align-items: center; justify-content: center;
  gap: var(--sp-3); flex-wrap: wrap; font-size: 0.84rem; color: var(--tm);
}
.cookie-banner-inner i { color: var(--accent); font-size: 1.1rem; }
.cookie-policy-link { color: var(--accent); font-size: 0.78rem; font-weight: 600; }

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { display: none !important; }
  .main-content { margin-left: 0; }
  .topbar { padding: var(--sp-3) var(--sp-4); min-height: 56px; }
  .topbar-title { font-size: 1.15rem; }
  .topbar-divider { display: none; }
  .page-content { padding: var(--sp-4) var(--sp-3) 90px; overflow-x: hidden; }
  .card { overflow: hidden; }
  .card-body { overflow-x: auto; word-break: break-word; }
  .dash-kpis { grid-template-columns: 1fr 1fr; }
  .g2, .g3, .dash-two-col, .settings-grid, .detail-grid { grid-template-columns: 1fr; }
  .week-cols { grid-template-columns: repeat(3, 1fr); }
  .fr { grid-template-columns: 1fr; }
  .page-toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-left { flex-direction: column; align-items: stretch; }
  .toolbar-right { justify-content: flex-end; }
  .filter-pills, .filter-tabs { overflow-x: auto; flex-wrap: nowrap; }
  .detail-header { flex-direction: column; }
  .search-box { min-width: 0; flex: 1; }
  .search-shortcut { display: none; }
  .jr { flex-wrap: wrap; gap: var(--sp-2); }
  .jr-actions { width: 100%; justify-content: flex-end; padding-top: var(--sp-1); border-top: 1px solid var(--bd); }
  .quick-actions { overflow-x: auto; flex-wrap: nowrap; }
  .quick-action { flex-shrink: 0; }
}
@media (max-width: 480px) {
  .dash-kpis { grid-template-columns: 1fr; }
  .stat-cards { grid-template-columns: 1fr 1fr; }
  .week-cols { grid-template-columns: 1fr 1fr; }
}

/* ── SCROLLBAR ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bd); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--tm); }

/* ── DARK MODE ENHANCEMENTS ─────────────────────────────── */
[data-theme="dark"] body {
  background-attachment: fixed;
}

[data-theme="dark"] .topbar {
  background: rgba(12,12,18,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: rgba(46,45,42,0.8);
  box-shadow: 0 1px 0 rgba(255,255,255,0.03), 0 4px 20px rgba(0,0,0,0.3);
}

[data-theme="dark"] .card-header {
  background: rgba(26,25,24,0.6);
}

/* ── PRINT ──────────────────────────────────────────────── */
@media print {
  .sidebar, .topbar, .mobile-nav, .mobile-more-menu, .cookie-banner { display: none !important; }
  .main-content { margin-left: 0; }
  .page-content { padding: 0; }
  .card { break-inside: avoid; box-shadow: none; border: 1px solid #ccc; }
  body { background: #fff; color: #000; }
}

/* ── Table row state highlights ─────────────────────────── */
tr.row-warn   { background: rgba(245,158,11,0.07) !important; }
tr.row-danger { background: rgba(220,38,38,0.07) !important; }

/* ── STATUS PIPELINE ────────────────────────────────────── */
.status-pipeline {
  display: flex; align-items: center; gap: 0; flex-wrap: nowrap;
  overflow-x: auto; padding-bottom: 4px;
}
.pipeline-step {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  background: none; border: 2px solid var(--bd); border-radius: var(--r-lg);
  padding: 10px 14px; cursor: pointer; transition: all var(--dur) var(--ease);
  font-family: var(--font-display); min-width: 72px; color: var(--tm);
  flex-shrink: 0;
}
.pipeline-step:hover:not(:disabled) {
  border-color: var(--accent); color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  transform: translateY(-2px);
}
.pipeline-step--done {
  border-color: var(--ok); color: var(--ok);
  background: color-mix(in srgb, var(--ok) 8%, transparent);
}
.pipeline-step--active {
  border-color: var(--accent); color: #fff;
  background: var(--accent); box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 35%, transparent);
  cursor: default;
}
.pipeline-step--cancel {
  border-color: var(--rd); color: var(--rd);
  margin-left: 12px;
}
.pipeline-step--cancel:hover:not(:disabled) {
  background: color-mix(in srgb, var(--rd) 8%, transparent);
  border-color: var(--rd); color: var(--rd); transform: translateY(-2px);
}
.pipeline-step-icon { font-size: 1.1rem; line-height: 1; }
.pipeline-step-label { font-size: 0.67rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; white-space: nowrap; }
.pipeline-connector {
  flex: 1; height: 2px; background: var(--bd); min-width: 12px; max-width: 28px;
  flex-shrink: 1; transition: background var(--dur) var(--ease);
}
.pipeline-connector--done { background: var(--ok); }

/* ── Dark mode search box ── */
[data-theme="dark"] .search-box { background: rgba(255,255,255,0.10); border-color: rgba(255,255,255,0.12); }
[data-theme="dark"] .search-box:hover { background: rgba(255,255,255,0.14); border-color: rgba(255,255,255,0.18); }
[data-theme="dark"] .search-box:focus-within { background: var(--surface); border-color: var(--amber); }
[data-theme="dark"] .search-box input { color: var(--t) !important; }
