/* ════════════════════════════════════════════════════════
   GÖKER CRM — Shared Design System v2
   Semantic tokens · Light + Dark themes · Premium polish
   ════════════════════════════════════════════════════════ */

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

/* ════════════════════ DESIGN TOKENS (Light — default) ════════════════════
   v3 — OKLCH-derived. Neutrals are warmed toward the brand hue (OKLCH h≈65,
   C 0.004–0.014) instead of default cool slate; every text/background pair
   verified ≥ 4.5:1 (small) / 3:1 (large+UI) in both themes. Legacy --slate-*
   names are kept (page CSS references them) but now carry the warm ramp. */
:root {
  /* GÖKER brand orange — signature, unchanged */
  --orange-50:  #fff7ed;  --orange-100: #ffedd5;  --orange-200: #fed7aa;
  --orange-300: #fdba74;  --orange-400: #fb923c;  --orange-500: #f97316;
  --orange-600: #ea580c;  --orange-700: #c2410c;  --orange-800: #9a3412;
  --orange-900: #7c2d12;

  /* Neutral scale — warm stone (legacy --slate-* names, new values) */
  --slate-50:   #fbf9f8;  --slate-100:  #f4f2f0;  --slate-200:  #e6e2df;
  --slate-300:  #d0cbc7;  --slate-400:  #948e88;  --slate-500:  #78716a;
  --slate-600:  #635c55;  --slate-700:  #4c4641;  --slate-800:  #332e2a;
  --slate-900:  #1e1b18;

  /* Status palette — -700 inks added so badge text passes AA on -100 tints */
  --green-50:  #f0fdf4;  --green-100: #dcfce7;  --green-500: #22c55e;  --green-600: #16a34a;  --green-700: #15803d;
  --red-50:    #fef2f2;  --red-100:   #fee2e2;  --red-200:   #fecaca;  --red-500:   #ef4444;  --red-600:   #dc2626;  --red-700: #b91c1c;
  --blue-50:   #eff6ff;  --blue-100:  #dbeafe;  --blue-500:  #3b82f6;  --blue-600:  #2563eb;  --blue-700:  #1d4ed8;
  --amber-50:  #fffbeb;  --amber-100: #fef3c7;  --amber-500: #f59e0b;  --amber-600: #d97706;  --amber-700: #92400e;
  --purple-50: #faf5ff;  --purple-100:#f3e8ff;  --purple-500:#a855f7;  --purple-700:#7e22ce;

  --white: #ffffff;
  --sidebar-w: 260px;
  --topbar-h:  64px;

  /* ─── Type scale (product register: fixed rem, ~1.125 ratio, dense) ───── */
  --fs-3xs: 0.7rem;    /* micro labels, kbd, nav badges        */
  --fs-2xs: 0.75rem;   /* table headers, badges, timestamps    */
  --fs-xs:  0.8rem;    /* secondary cell text, form labels     */
  --fs-sm:  0.85rem;   /* body/table default, buttons, nav     */
  --fs-md:  0.9rem;    /* inputs, card titles                  */
  --fs-lg:  1.0rem;    /* section heads                        */
  --fs-xl:  1.125rem;  /* modal titles                         */
  --fs-2xl: 1.25rem;   /* page titles, hero names              */
  --fs-3xl: 1.8rem;    /* stat values                          */
  --lh-tight: 1.25;    /* headings, stat values                */
  --lh-data:  1.4;     /* Turkish table cells — diacritics need air */
  --lh-prose: 1.55;    /* notes, empty-state copy               */

  /* ─── Spacing scale (4px base) ────────────────────────── */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-7: 28px; --sp-8: 32px;

  /* ─── Radius — one language: controls 8, surfaces 12, overlays 14 ─────── */
  --r-sm: 6px;   /* chips, kbd            */
  --r-md: 8px;   /* buttons, inputs, rows */
  --r-lg: 12px;  /* cards, panels, kanban */
  --r-xl: 14px;  /* modals, palette       */
  --r-full: 999px;

  /* ─── Semantic tokens (light) ─────────────────────────── */
  --surface:          var(--white);           /* main card background */
  --surface-2:        var(--slate-50);        /* page background */
  --surface-raised:   var(--white);           /* topbar, modals */
  --surface-inset:    var(--slate-50);        /* inputs, subtle wells */
  --surface-hover:    var(--slate-50);
  --border:           var(--slate-200);
  --border-strong:    var(--slate-300);
  --border-subtle:    var(--slate-100);
  --text:             var(--slate-800);   /* 13.4:1 on white */
  --text-strong:      var(--slate-900);
  --text-muted:       var(--slate-600);   /* 6.6:1 — secondary copy */
  --text-soft:        var(--slate-500);   /* 4.8:1 — the AA floor for de-emphasis */
  --accent:           var(--orange-500);  /* brand: icons, highlights, non-text */
  --accent-hover:     var(--orange-600);
  --accent-soft:      var(--orange-50);
  --accent-ink:       var(--orange-700);  /* 5.2:1 on white — text-bearing accent */
  --accent-strong:    #bc4d1a;            /* brand-hue fill that carries white text at 5:1 */
  --accent-strong-hover: #ae4104;
  --sidebar-bg:       var(--slate-900);
  --sidebar-text:     var(--slate-300);
  --sidebar-hover:    rgba(255,255,255,0.06);
  --sidebar-divider:  rgba(255,255,255,0.06);
  --shadow-sm:        0 1px 2px rgba(30,27,24,0.05);
  --shadow-md:        0 4px 12px rgba(30,27,24,0.07);
  --shadow-lg:        0 8px 24px rgba(30,27,24,0.09);
  --shadow-xl:        0 20px 48px rgba(30,27,24,0.13);
  --ring:             0 0 0 3px rgba(234,88,12,0.32);  /* visible focus, AA-perceptible */

  /* Semantic status INKS — text-bearing colors that flip per theme
     (-700 on light surfaces, bright pastels on dark). Fills stay on -500/-700. */
  --ink-red:   var(--red-700);
  --ink-amber: var(--amber-700);
  --ink-green: var(--green-700);
  --ink-blue:  var(--blue-700);

  /* Motion */
  --ease-out:  cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 0.12s;
  --dur-base: 0.2s;
  --dur-slow: 0.36s;

  /* Typography — monospace for technical data (IDs, amounts, codes) */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  color-scheme: light;
}

/* ════════════════════ DESIGN TOKENS (Dark) ════════════════════
   Derived from the same warm OKLCH ramp (h≈65) at low lightness — not an
   ad-hoc blue-gray. Text pairs: text 14:1, muted 7.5:1, soft 5.4:1. */
[data-theme="dark"] {
  --surface:          #1e1b19;
  --surface-2:        #151210;
  --surface-raised:   #262321;
  --surface-inset:    #0e0c0a;
  --surface-hover:    #2c2a27;
  --border:           #383532;
  --border-strong:    #4d4a47;
  --border-subtle:    #2a2725;
  --text:             #ece8e4;
  --text-strong:      #faf8f6;
  --text-muted:       #b0aaa4;
  --text-soft:        #969089;
  --accent:           #fb923c;           /* brighter orange for dark */
  --accent-hover:     #f97316;
  --accent-soft:      rgba(251,146,60,0.14);
  --accent-ink:       #fdba74;
  --accent-strong:    #bc4d1a;           /* same fill both themes: white text 5:1 */
  --accent-strong-hover: #c95a26;
  --sidebar-bg:       #0e0c0a;
  --sidebar-text:     #c4beb8;
  --sidebar-hover:    rgba(255,255,255,0.05);
  --sidebar-divider:  rgba(255,255,255,0.05);
  --shadow-sm:        0 1px 2px rgba(0,0,0,0.4);
  --shadow-md:        0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg:        0 8px 24px rgba(0,0,0,0.5);
  --shadow-xl:        0 20px 48px rgba(0,0,0,0.6);
  --ring:             0 0 0 3px rgba(251,146,60,0.4);
  --ink-red:   #f87171;
  --ink-amber: #fcd34d;
  --ink-green: #4ade80;
  --ink-blue:  #93c5fd;
  color-scheme: dark;

  /* Status bg/text pairs re-tuned for dark */
  --green-100: rgba(34,197,94,0.16);
  --red-100:   rgba(239,68,68,0.16);
  --blue-100:  rgba(59,130,246,0.16);
  --amber-100: rgba(245,158,11,0.16);
  --purple-100:rgba(168,85,247,0.16);
  --orange-100:rgba(251,146,60,0.16);
  --slate-100: rgba(148,142,136,0.16);
  --slate-50:  var(--surface-2);
}

html, body { transition: background-color var(--dur-slow) var(--ease-out), color var(--dur-slow) var(--ease-out); }

body {
  font-family: var(--font-sans);
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  background: var(--surface-2);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Mono utility — apply to offer numbers, IDs, SKUs, currency in tables */
.mono { font-family: var(--font-mono); font-feature-settings: 'tnum', 'zero'; letter-spacing: -0.01em; }

/* Keyboard shortcut key styling */
kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; padding: 2px 6px;
  background: var(--surface-inset); border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px; font-family: var(--font-mono);
  font-size: 0.7rem; font-weight: 600; color: var(--text-muted);
  line-height: 1;
}

/* Role-gated nav items: hidden until ui-kit reveals them for a matching
   session role (prevents a flash of admin-only links for reps). */
.nav-item[data-roles] { display: none; }

/* ════════════════════ SIDEBAR ════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  color: var(--white);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform var(--dur-slow) var(--ease-out),
              background-color var(--dur-slow) var(--ease-out);
}

.sidebar-brand {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--sidebar-divider);
}

/* Brand logo images. The wordmark (expanded) and the S-mark (collapsed rail)
   swap on the SAME html[data-sidebar] attribute the JS toggles — so the logo
   and the collapse state can never desync. Both are white-on-transparent PNGs,
   legible on the dark sidebar in BOTH themes (the sidebar is dark in light- and
   dark-theme alike: --sidebar-bg = --slate-900 in both). */
.sidebar-brand .brand-logo-full {
  height: 30px; width: auto; max-width: 150px; display: block;
}
.sidebar-brand .brand-logo-mark {
  height: 30px; width: auto; display: none;   /* shown only in the collapsed rail */
}

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

.nav-section { margin-bottom: 20px; }
.nav-section-title {
  font-size: 0.65rem; font-weight: 600; color: var(--slate-400);
  text-transform: uppercase; letter-spacing: 1.2px;
  padding: 0 12px; margin-bottom: 6px;
}

.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 8px;
  color: var(--sidebar-text); text-decoration: none;
  font-size: 0.85rem; font-weight: 450;
  transition: background-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              padding-left var(--dur-fast) var(--ease-out);
  cursor: pointer;
  position: relative;
}

.nav-item:hover { background: var(--sidebar-hover); color: var(--white); padding-left: 14px; }

.nav-item.active {
  background: var(--accent-strong);
  color: var(--white); font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.nav-item.active::before {
  content: ''; position: absolute; left: -12px; top: 50%;
  width: 3px; height: 60%; background: var(--orange-300);
  border-radius: 0 3px 3px 0; transform: translateY(-50%);
}

.nav-item i { width: 20px; text-align: center; font-size: 14px; }

.nav-badge {
  margin-left: auto;
  background: var(--orange-500); color: var(--white);
  font-size: 0.68rem; font-weight: 700;
  padding: 2px 7px; border-radius: 10px;
  line-height: 1.3;
}

.nav-item.active .nav-badge { background: rgba(255,255,255,0.25); }

.sidebar-footer { padding: 14px; border-top: 1px solid var(--sidebar-divider); }

.user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: 10px;
  background: rgba(255,255,255,0.04);
  cursor: pointer; transition: background-color var(--dur-fast) var(--ease-out);
}
.user-card:hover { background: rgba(255,255,255,0.08); }

.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--orange-400), var(--orange-600));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.78rem; flex-shrink: 0;
  color: var(--white);
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 0.83rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--white); }
.user-role { font-size: 0.7rem; color: var(--slate-400); }

/* Theme toggle pill in sidebar footer */
.theme-toggle {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; margin-top: 8px;
  border-radius: 8px; background: rgba(255,255,255,0.04);
  color: var(--slate-300); font-size: 0.78rem; font-weight: 500;
  cursor: pointer; transition: background-color var(--dur-fast) var(--ease-out);
  width: 100%; border: none; font-family: inherit;
}
.theme-toggle:hover { background: rgba(255,255,255,0.08); color: var(--white); }
.theme-toggle i { width: 14px; text-align: center; }
.theme-toggle .tt-label { flex: 1; text-align: left; }

/* ════════════════════ MAIN AREA ════════════════════ */
.main {
  margin-left: var(--sidebar-w);
  flex: 1; display: flex; flex-direction: column;
  min-height: 100vh;
  background: var(--surface-2);
}

/* ════════════════════ TOPBAR ════════════════════ */
.topbar {
  background: var(--surface-raised);
  border-bottom: 1px solid var(--border);
  padding: 0 28px; height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px);
}

.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-left h1 { font-size: 1.2rem; font-weight: 700; color: var(--text-strong); }
.topbar-left .breadcrumb { font-size: 0.8rem; color: var(--text-soft); }

/* Cmd+K hint button in topbar — looks like a search bar, opens palette */
.cmdk-trigger {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-inset);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 7px 10px 7px 14px;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  min-width: 300px;
  transition: border-color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
  font-family: inherit;
}
.cmdk-trigger:hover { border-color: var(--accent); background: var(--surface); }
.cmdk-trigger .cmdk-label { flex: 1; text-align: left; color: var(--text-muted); }
.cmdk-trigger kbd { margin-left: auto; }

.topbar-search { position: relative; width: 320px; }
.topbar-search input {
  width: 100%; padding: 9px 14px 9px 38px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 0.86rem; font-family: inherit;
  background: var(--surface-inset); color: var(--text);
  outline: none; transition: all var(--dur-base);
}
.topbar-search input:focus {
  border-color: var(--accent);
  box-shadow: var(--ring);
  background: var(--surface);
}
.topbar-search input::placeholder { color: var(--text-soft); }
.topbar-search > i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-soft); font-size: 14px; }

.topbar-actions { display: flex; align-items: center; gap: 8px; }

.topbar-btn {
  width: 38px; height: 38px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface-raised); color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all var(--dur-fast); position: relative; font-size: 15px;
}
.topbar-btn:hover { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent); }
.topbar-btn:active { transform: scale(0.96); }

.topbar-btn .notif-dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px; background: var(--red-500);
  border-radius: 50%; border: 2px solid var(--surface-raised);
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.6); }
  50%      { box-shadow: 0 0 0 5px rgba(239,68,68,0); }
}

/* Notification bell panel */
.notif-panel {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 360px; max-height: 480px;
  background: var(--surface-raised); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-xl);
  z-index: 200; display: none; overflow: hidden;
  animation: slideDown var(--dur-base) var(--ease-out);
}
.notif-panel.open { display: flex; flex-direction: column; }
.notif-panel-head {
  padding: 14px 16px; border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: space-between;
}
.notif-panel-head h4 { font-size: 0.9rem; font-weight: 700; color: var(--text); }
.notif-panel-list { flex: 1; overflow-y: auto; }
.notif-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--border-subtle);
  cursor: pointer; transition: background-color var(--dur-fast);
}
.notif-item:hover { background: var(--surface-hover); }
.notif-item:last-child { border-bottom: none; }
.notif-item i { color: var(--accent); margin-top: 2px; }
.notif-item-title { font-size: 0.84rem; font-weight: 600; color: var(--text); }
.notif-item-sub { font-size: 0.76rem; color: var(--text-muted); margin-top: 2px; }

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ════════════════════ BUTTONS ════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border: none; border-radius: 8px;
  font-size: 0.85rem; font-weight: 600; font-family: inherit;
  cursor: pointer; text-decoration: none;
  transition: background-color var(--dur-base), border-color var(--dur-base), color var(--dur-base), box-shadow var(--dur-base), transform var(--dur-base);
  line-height: 1.2;
  user-select: none;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }

.btn-primary {
  background: var(--accent-strong);   /* white text passes AA at 5:1 */
  color: var(--white);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background: var(--accent-strong-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0) scale(0.98); }
.btn-primary:focus-visible { box-shadow: var(--ring), var(--shadow-sm); }

.btn-secondary {
  background: var(--surface-raised); color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--surface-hover); border-color: var(--border-strong); }

.btn-success { background: var(--green-700); color: var(--white); }
.btn-success:hover { background: var(--green-600); }

.btn-danger { background: var(--red-700); color: var(--white); }
.btn-danger:hover { background: var(--red-600); }

.btn-outline-orange {
  background: transparent; color: var(--accent-ink);
  border: 1.5px solid var(--orange-300);
}
.btn-outline-orange:hover { background: var(--accent-soft); border-color: var(--orange-500); }

.btn-ghost {
  background: transparent; color: var(--text-muted);
  border: 1px solid transparent;
}
.btn-ghost:hover { background: var(--surface-hover); color: var(--text); }

.btn-sm { padding: 6px 12px; font-size: 0.78rem; }
.btn-lg { padding: 12px 24px; font-size: 0.95rem; }
.btn-icon { width: 34px; height: 34px; padding: 0; justify-content: center; }

/* Focus-visible: every interactive element gets a perceptible ring.
   (Inputs already ring on :focus; these cover keyboard-only paths.) */
.nav-item:focus-visible, .tab:focus-visible, .topbar-btn:focus-visible,
.theme-toggle:focus-visible, .theme-picker .tp-seg:focus-visible,
.modal-close:focus-visible, .view-toggle button:focus-visible,
.cmdk-trigger:focus-visible, .sb-collapse:focus-visible,
.bottom-nav .bn-item:focus-visible, .user-card:focus-visible {
  outline: none; box-shadow: var(--ring);
}
.data-table tbody tr:focus-visible td { background: var(--accent-soft); }

/* ════════════════════ CARDS ════════════════════ */
.content { padding: 28px; flex: 1; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: transform var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out);
}

.card.interactive:hover,
.card[data-interactive]:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}

.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-subtle);
}

.card-header h3 {
  font-size: 0.93rem; font-weight: 700; color: var(--text-strong);
  display: flex; align-items: center; gap: 8px;
}

.card-header h3 i { color: var(--accent); font-size: 15px; }

.card-header .card-actions { display: flex; align-items: center; gap: 6px; }

.card-link {
  font-size: 0.78rem; color: var(--accent-ink);
  text-decoration: none; font-weight: 600; transition: color var(--dur-fast);
}
.card-link:hover { color: var(--orange-700); }

.card-body { padding: 18px 22px; }

/* ════════════════════ STAT CARDS ════════════════════ */
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 16px; margin-bottom: 24px;
}

.stat-card {
  background: var(--surface); border-radius: var(--r-lg);
  padding: 20px; border: 1px solid var(--border);
  transition: transform var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
  position: relative; overflow: hidden;
}

.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0;
  width: 4px; height: 100%; border-radius: var(--r-lg) 0 0 var(--r-lg);
}

.stat-card.orange::before  { background: var(--orange-500); }
.stat-card.green::before   { background: var(--green-500); }
.stat-card.blue::before    { background: var(--blue-500); }
.stat-card.amber::before   { background: var(--amber-500); }
.stat-card.purple::before  { background: var(--purple-500); }
.stat-card.red::before     { background: var(--red-500); }

.stat-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }

.stat-icon {
  width: 42px; height: 42px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 17px;
}

.stat-card.orange .stat-icon  { background: var(--orange-100); color: var(--orange-600); }
.stat-card.green .stat-icon   { background: var(--green-100); color: var(--green-500); }
.stat-card.blue .stat-icon    { background: var(--blue-100); color: var(--blue-500); }
.stat-card.amber .stat-icon   { background: var(--amber-100); color: var(--amber-500); }
.stat-card.purple .stat-icon  { background: var(--purple-100); color: var(--purple-500); }
.stat-card.red .stat-icon     { background: var(--red-100); color: var(--red-500); }

.stat-change { font-size: 0.73rem; font-weight: 600; padding: 3px 8px; border-radius: 6px; font-family: var(--font-mono); }
.stat-change.up   { color: var(--green-600); background: var(--green-100); }
.stat-change.down { color: var(--red-600); background: var(--red-100); }

.stat-value {
  font-size: 1.8rem; font-weight: 800; color: var(--text-strong);
  line-height: 1; margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.stat-label { font-size: 0.8rem; color: var(--text-soft); font-weight: 500; }

/* ════════════════════ TABLES ════════════════════ */
.data-table { width: 100%; border-collapse: collapse; }

.data-table th {
  text-align: left; font-size: 0.73rem; font-weight: 600;
  color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.5px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  background: var(--surface-inset);
}

.data-table td {
  padding: 13px 16px; font-size: 0.85rem;
  border-bottom: 1px solid var(--border-subtle); vertical-align: middle;
  color: var(--text);
}

.data-table tbody tr { transition: background-color var(--dur-fast); cursor: pointer; }
.data-table tbody tr:hover td { background: var(--surface-hover); }

/* ════════════════════ BADGES ════════════════════ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.76rem; font-weight: 600;
  padding: 4px 10px; border-radius: 6px;
  white-space: nowrap;
}

/* Badge inks use the -700 step: every pair ≥4.5:1 on its -100 tint.
   Hue semantics (red/amber/green/blue meanings) unchanged — only tuned. */
.badge-orange  { background: var(--orange-100); color: var(--orange-800); }
.badge-green   { background: var(--green-100); color: var(--green-700); }
.badge-red     { background: var(--red-100); color: var(--red-700); }
.badge-blue    { background: var(--blue-100); color: var(--blue-700); }
.badge-amber   { background: var(--amber-100); color: var(--amber-700); }
.badge-purple  { background: var(--purple-100); color: var(--purple-700); }
.badge-slate   { background: var(--slate-100); color: var(--text-muted); }

[data-theme="dark"] .badge-orange  { color: var(--orange-300); }
[data-theme="dark"] .badge-green   { color: #4ade80; }
[data-theme="dark"] .badge-red     { color: #f87171; }
[data-theme="dark"] .badge-blue    { color: #60a5fa; }
[data-theme="dark"] .badge-amber   { color: #fbbf24; }
[data-theme="dark"] .badge-purple  { color: #c084fc; }

/* ════════════════════ TABS ════════════════════ */
.tabs {
  display: flex; gap: 0; border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}

.tab {
  padding: 10px 20px; font-size: 0.88rem; font-weight: 500;
  color: var(--text-soft); cursor: pointer; border: none;
  background: none; font-family: inherit;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: all var(--dur-fast);
  display: flex; align-items: center; gap: 8px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent-ink); border-bottom-color: var(--accent); font-weight: 600; }
.tab .tab-count { font-size: 0.72rem; background: var(--slate-100); color: var(--text-muted); padding: 2px 7px; border-radius: 10px; font-family: var(--font-mono); }
.tab.active .tab-count { background: var(--accent-soft); color: var(--accent-ink); }

/* ════════════════════ MODALS ════════════════════ */
.modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(15,23,42,0.55); backdrop-filter: blur(6px);
  z-index: 1000; display: none; align-items: center; justify-content: center;
  opacity: 0; transition: opacity var(--dur-base) var(--ease-out);
}
.modal-overlay.active { display: flex; opacity: 1; }

.modal {
  background: var(--surface-raised); border-radius: var(--r-xl);
  border: 1px solid var(--border);
  width: 90%; max-width: 600px; max-height: 85vh;
  overflow-y: auto; box-shadow: var(--shadow-xl);
  transform: translateY(18px) scale(0.98);
  opacity: 0;
  transition: transform var(--dur-slow) var(--ease-out), opacity var(--dur-slow) var(--ease-out);
}
.modal-overlay.active .modal { transform: translateY(0) scale(1); opacity: 1; }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border-subtle);
}
.modal-header h2 { font-size: 1.1rem; font-weight: 700; color: var(--text-strong); }

.modal-close {
  width: 32px; height: 32px; border: none; border-radius: 8px;
  background: var(--surface-inset); color: var(--text-soft);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 16px; transition: all var(--dur-fast);
}
.modal-close:hover { background: var(--red-100); color: var(--red-500); }

.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border-subtle); display: flex; gap: 8px; justify-content: flex-end; }

/* ════════════════════ FORMS ════════════════════ */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: 0.8rem; font-weight: 600; color: var(--text);
  margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.4px;
}

.form-input, .form-select, .form-textarea {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--border); border-radius: 8px;
  font-size: 0.9rem; font-family: inherit; color: var(--text);
  background: var(--surface); outline: none; transition: all var(--dur-base);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent);
  box-shadow: var(--ring);
}
.form-input:disabled, .form-select:disabled, .form-textarea:disabled {
  background: var(--surface-inset); color: var(--text-muted);
  cursor: not-allowed;
}

.form-input::placeholder, .form-textarea::placeholder { color: var(--text-soft); }

.form-textarea { resize: vertical; min-height: 80px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ════════════════════ SEARCH BAR ════════════════════ */
.search-bar {
  position: relative; margin-bottom: 16px;
}
.search-bar input {
  width: 100%; padding: 11px 14px 11px 42px;
  border: 1.5px solid var(--border); border-radius: 10px;
  font-size: 0.9rem; font-family: inherit; background: var(--surface);
  color: var(--text);
  outline: none; transition: all var(--dur-base);
}
.search-bar input:focus { border-color: var(--accent); box-shadow: var(--ring); }
.search-bar input::placeholder { color: var(--text-soft); }
.search-bar > i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-soft); font-size: 15px; }

/* ════════════════════ GRID LAYOUTS ════════════════════ */
.grid-2    { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 24px; }
.grid-3    { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; margin-bottom: 24px; }
.grid-3-1  { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; margin-bottom: 24px; }
.grid-1-3  { display: grid; grid-template-columns: 1fr 2fr; gap: 18px; margin-bottom: 24px; }

/* ════════════════════ TOAST ════════════════════ */
.toast {
  position: fixed; top: 24px; right: 24px;
  padding: 14px 22px; border-radius: 10px;
  font-size: 0.88rem; font-weight: 500; color: var(--white);
  box-shadow: var(--shadow-xl);
  z-index: 9999; transform: translateX(120%);
  transition: transform var(--dur-slow) var(--ease-out);
  font-family: inherit; display: flex; align-items: center; gap: 10px;
  border: 1px solid rgba(255,255,255,0.15);
}
.toast.show { transform: translateX(0); }
.toast.success { background: var(--green-700); }
.toast.error   { background: var(--red-700); }
.toast.warning { background: var(--amber-700); }
.toast.info    { background: var(--blue-700); }

/* ════════════════════ EMPTY STATES ════════════════════ */
.empty-state {
  text-align: center; padding: 40px 20px;
}
.empty-state i { font-size: 40px; color: var(--border-strong); margin-bottom: 12px; }
.empty-state h4 { font-size: 1rem; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.empty-state p { font-size: 0.85rem; color: var(--text-soft); }

/* ════════════════════ TIMELINE ════════════════════ */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: ''; position: absolute; left: 10px; top: 0; bottom: 0;
  width: 2px; background: var(--border);
}

.timeline-item { position: relative; padding-bottom: 20px; }
.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
  position: absolute; left: -24px; top: 4px;
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--surface); z-index: 1;
}
.timeline-dot.orange { background: var(--orange-500); }
.timeline-dot.green  { background: var(--green-500); }
.timeline-dot.blue   { background: var(--blue-500); }
.timeline-dot.red    { background: var(--red-500); }
.timeline-dot.slate  { background: var(--slate-400); }

.timeline-content { font-size: 0.85rem; color: var(--text); }
.timeline-content strong { color: var(--text-strong); }
.timeline-time { font-size: 0.73rem; color: var(--text-soft); margin-top: 3px; }

/* ════════════════════ SKELETON LOADERS ════════════════════ */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--surface-inset) 0%,
    var(--surface-hover) 50%,
    var(--surface-inset) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: 6px;
  display: inline-block;
  color: transparent !important;
  user-select: none;
}
.skeleton.skeleton-text { height: 0.9em; width: 100%; }
.skeleton.skeleton-title { height: 1.4em; width: 60%; }
.skeleton.skeleton-circle { border-radius: 50%; }
.skeleton.skeleton-box { height: 60px; width: 100%; border-radius: 10px; }

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ════════════════════ COMMAND PALETTE (⌘K) ════════════════════ */
#cmdk-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,0.55); backdrop-filter: blur(6px);
  z-index: 10000;
  display: none; align-items: flex-start; justify-content: center;
  padding-top: 14vh;
  opacity: 0; transition: opacity var(--dur-base) var(--ease-out);
}
#cmdk-overlay.active { display: flex; opacity: 1; }
.cmdk-modal {
  width: min(620px, 92vw);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  transform: translateY(-12px) scale(0.98);
  transition: transform var(--dur-slow) var(--ease-out);
}
#cmdk-overlay.active .cmdk-modal { transform: translateY(0) scale(1); }
.cmdk-input-wrap {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--border-subtle);
}
.cmdk-input-wrap > i { color: var(--text-soft); font-size: 15px; }
.cmdk-input-wrap input {
  flex: 1; border: none; outline: none; background: transparent;
  color: var(--text); font-size: 0.95rem; font-family: inherit;
}
.cmdk-input-wrap input::placeholder { color: var(--text-soft); }
.cmdk-list {
  max-height: 50vh; overflow-y: auto;
  padding: 8px 0;
}
.cmdk-group-title {
  font-size: 0.66rem; font-weight: 600; color: var(--text-soft);
  text-transform: uppercase; letter-spacing: 0.8px;
  padding: 8px 16px 4px;
}
.cmdk-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 14px;
  cursor: pointer;
  transition: background-color var(--dur-fast);
  border-left: 3px solid transparent;
}
.cmdk-item:hover, .cmdk-item.active {
  background: var(--accent-soft);
  border-left-color: var(--accent);
}
.cmdk-item > i {
  width: 20px; color: var(--accent-ink); font-size: 13px; text-align: center;
}
.cmdk-item-text { flex: 1; min-width: 0; }
.cmdk-item-text > div:first-child {
  font-size: 0.88rem; font-weight: 500; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cmdk-item-sub {
  font-size: 0.76rem; color: var(--text-muted); margin-top: 1px;
  font-family: var(--font-mono);
}
.cmdk-footer {
  padding: 8px 16px;
  border-top: 1px solid var(--border-subtle);
  background: var(--surface-inset);
  display: flex; align-items: center; gap: 18px;
  font-size: 0.72rem; color: var(--text-soft);
}
.cmdk-footer span { display: flex; align-items: center; gap: 5px; }
.cmdk-empty {
  padding: 30px 20px; text-align: center;
  color: var(--text-muted); font-size: 0.88rem;
}

/* ════════════════════ RESPONSIVE ════════════════════ */
@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-3, .grid-3-1, .grid-1-3 { grid-template-columns: 1fr; }
  .cmdk-trigger { min-width: 180px; }
}

/* ── Mobile drawer chrome (shared; JS in ui-kit.js + drawer-core.js) ── */
#menuToggle { display: none; }                 /* desktop: sidebar always visible */
#sbBackdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.5); z-index: 95;
  opacity: 0; transition: opacity var(--dur-fast);
}
#sbBackdrop.show { opacity: 1; }
body.drawer-locked { overflow: hidden; }       /* scroll lock behind the open drawer */
button, .btn, .nav-item, .topbar-btn { touch-action: manipulation; }  /* no double-tap zoom */

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); z-index: 100; transition: transform var(--dur-base) var(--ease-out); }
  .sidebar.open { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,0.4); }
  .main { margin-left: 0; }
  #menuToggle { display: inline-flex; }        /* hamburger visible on phones */
  #sbBackdrop { display: block; pointer-events: none; }
  #sbBackdrop.show { pointer-events: auto; }
  /* The desktop icon-rail collapse must not interfere on phones: its
     html[data-sidebar=collapsed] width/margin rules out-specificity the plain
     mobile rules, so neutralize them explicitly (root cause of the shifted
     layout / stuck states reported from the field). */
  .sb-collapse { display: none !important; }
  html[data-sidebar="collapsed"] .sidebar { width: var(--sidebar-w); }
  html[data-sidebar="collapsed"] .main { margin-left: 0; }
  html[data-sidebar="collapsed"] .nav-section-title,
  html[data-sidebar="collapsed"] .nav-item span,
  html[data-sidebar="collapsed"] .user-info { display: revert; }
  /* Drawer is full-width on phones: always show the wordmark, never the
     collapsed-rail S-mark, even if a collapsed state persisted from desktop. */
  html[data-sidebar="collapsed"] .sidebar-brand { flex-direction: row; padding: 18px 20px; }
  html[data-sidebar="collapsed"] .sidebar-brand .brand-logo-full { display: block !important; }
  html[data-sidebar="collapsed"] .sidebar-brand .brand-logo-mark { display: none !important; }

  .stats-grid { grid-template-columns: 1fr; }
  .topbar-search, .cmdk-trigger { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .topbar { padding: 0 16px; }

  /* iOS: 16px+ inputs prevent zoom-on-focus */
  input, select, textarea { font-size: 16px !important; }

  /* Data-dense tables: horizontal scroll + sticky first column.
     Pages opt in by wrapping the table in .table-scroll. */
  .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-scroll table { min-width: 640px; }
  .table-scroll th:first-child, .table-scroll td:first-child {
    position: sticky; left: 0; background: var(--surface); z-index: 1;
    box-shadow: 2px 0 4px -2px rgba(30,27,24,0.18);
  }
  .table-scroll thead th:first-child { background: var(--surface-2); z-index: 2; }

  /* Offers kanban: columns stack vertically (a 5-column drag board is not a
     phone UI; the table view is the primary mobile mode). */
  .kanban-board { display: flex !important; flex-direction: column; gap: 14px; }

  /* Dashboard action queue rows: let content wrap, full-width action button */
  #actionQueueBody > div { flex-wrap: wrap; }
  #actionQueueBody > div > a.btn { flex-basis: 100%; justify-content: center; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Small utility classes */
.text-mono { font-family: var(--font-mono); }
.text-muted { color: var(--text-muted); }
.text-soft { color: var(--text-soft); }
.fade-in { animation: fadeIn var(--dur-base) var(--ease-out); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* ════════════════════════════════════════════════════════════════════
   THREE-WAY THEME PICKER (Light / Dark / System)
   ════════════════════════════════════════════════════════════════════ */
.theme-picker {
  display: flex; gap: 2px;
  background: rgba(255,255,255,0.04);
  border-radius: 10px; padding: 3px;
  margin-top: 8px;
}
.theme-picker .tp-seg {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 4px; border: none; background: transparent;
  border-radius: 7px; cursor: pointer;
  color: rgba(255,255,255,0.55); font-family: inherit;
  font-size: 0.72rem; font-weight: 600;
  transition: background-color var(--dur-fast), color var(--dur-fast);
}
.theme-picker .tp-seg i { font-size: 11px; }
.theme-picker .tp-seg:hover { color: rgba(255,255,255,0.85); }
.theme-picker .tp-seg.active {
  background: rgba(255,255,255,0.10); color: var(--white);
  box-shadow: 0 1px 2px rgba(0,0,0,0.25);
}
@media (max-width: 1100px) {
  .theme-picker .tp-seg span { display: none; }
}

/* ════════════════════════════════════════════════════════════════════
   SIDEBAR COLLAPSE (icon-only rail)
   ════════════════════════════════════════════════════════════════════ */
:root { --sidebar-w-collapsed: 66px; }

.sb-collapse {
  position: absolute; top: 50%; right: 10px; transform: translateY(-50%);
  width: 22px; height: 22px; border-radius: 6px;
  background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.6);
  border: none; cursor: pointer; display: flex;
  align-items: center; justify-content: center; font-size: 9px;
  transition: all var(--dur-fast);
}
.sb-collapse:hover { background: rgba(255,255,255,0.18); color: var(--white); }
.sidebar-brand { position: relative; }

html[data-sidebar="collapsed"] .sidebar { width: var(--sidebar-w-collapsed); }
html[data-sidebar="collapsed"] .main { margin-left: var(--sidebar-w-collapsed); }
/* Labels/badges are HIDDEN (display:none) in the rail — never width-clipped, so
   they cannot overlap. The collapse toggle is intentionally NOT in this list:
   it must stay visible+clickable so the rail can be re-expanded. */
html[data-sidebar="collapsed"] .nav-section-title,
html[data-sidebar="collapsed"] .nav-item span,
html[data-sidebar="collapsed"] .nav-badge,
html[data-sidebar="collapsed"] .user-info,
html[data-sidebar="collapsed"] .theme-picker .tp-seg span { display: none !important; }
html[data-sidebar="collapsed"] .nav-item {
  justify-content: center; padding: 9px 0;
}
html[data-sidebar="collapsed"] .nav-item i { margin: 0; font-size: 16px; }
html[data-sidebar="collapsed"] .user-card { justify-content: center; padding: 8px; }
html[data-sidebar="collapsed"] .theme-picker { flex-direction: column; padding: 3px; gap: 1px; }
html[data-sidebar="collapsed"] .theme-picker .tp-seg { padding: 7px 2px; }

/* Collapsed rail brand: hide the wordmark, show the centered S-mark, and stack
   the collapse toggle below it (chevron rotated to point "expand"). The toggle
   stays a static, centered, clickable control — no hover dependency. */
html[data-sidebar="collapsed"] .sidebar-brand {
  flex-direction: column; gap: 8px; justify-content: center; padding: 14px 0;
}
html[data-sidebar="collapsed"] .sidebar-brand .brand-logo-full { display: none; }
html[data-sidebar="collapsed"] .sidebar-brand .brand-logo-mark { display: block; }
html[data-sidebar="collapsed"] .sb-collapse {
  position: static; transform: none; margin: 2px auto 0;
}
html[data-sidebar="collapsed"] .sb-collapse i { transform: rotate(180deg); }

/* NOTE: the previous expand-on-hover block (the collapsed rail re-expanding
   while the pointer was over it) was REMOVED. It was the root cause of the
   reported collapse bug: the collapse toggle lives inside the sidebar, so the
   pointer hovers it at click time — the hover rule instantly re-expanded the
   rail ("first click does nothing"), and its inline-flex label overrides
   mis-laid the rows ("text gets mixed up"). The explicit toggle is now the only
   control of the visible state. */

/* ════════════════════════════════════════════════════════════════════
   PROGRESS BAR (NProgress-style)
   ════════════════════════════════════════════════════════════════════ */
.gk-progress {
  position: fixed; top: 0; left: 0; right: 0;
  height: 3px; z-index: 99999; pointer-events: none;
  opacity: 0; transition: opacity var(--dur-base);
}
.gk-progress.active { opacity: 1; }
.gk-progress-bar {
  height: 100%; width: 100%;
  transform: scaleX(0); transform-origin: left;
  background: var(--orange-500);
  transition: transform var(--dur-slow) var(--ease-out);
}
.gk-progress.failed .gk-progress-bar {
  background: linear-gradient(90deg, var(--red-500), var(--red-600));
}

/* ════════════════════════════════════════════════════════════════════
   KEYBOARD SHORTCUTS OVERLAY
   ════════════════════════════════════════════════════════════════════ */
.sc-grid { display: flex; flex-direction: column; gap: 4px; }
.sc-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-radius: 8px;
  transition: background-color var(--dur-fast);
}
.sc-row:hover { background: var(--surface-hover); }
.sc-keys { display: flex; align-items: center; gap: 4px; }
.sc-plus { font-size: 0.68rem; color: var(--text-soft); }
.sc-desc { font-size: 0.86rem; color: var(--text); }

/* ════════════════════════════════════════════════════════════════════
   BREADCRUMBS (interactive)
   ════════════════════════════════════════════════════════════════════ */
.bc-interactive { display: inline-flex; align-items: center; gap: 6px; }
.bc-interactive a {
  color: var(--text-muted); text-decoration: none;
  font-size: 0.8rem; transition: color var(--dur-fast);
}
.bc-interactive a:hover { color: var(--accent-ink); }
.bc-interactive span { color: var(--text); font-weight: 500; font-size: 0.8rem; }
.bc-interactive .bc-sep { color: var(--text-soft); font-size: 9px; }

/* ════════════════════════════════════════════════════════════════════
   EMPTY STATE v2 (with illustrations)
   ════════════════════════════════════════════════════════════════════ */
.es-v2 {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 24px; text-align: center;
  color: var(--text-soft);
}
.es-v2 .es-art {
  width: 180px; max-width: 50%; color: var(--text-soft);
  margin-bottom: 18px; opacity: 0.9;
}
.es-v2 .es-art svg { width: 100%; height: auto; }
.es-v2 h4 {
  font-size: 1.02rem; font-weight: 700; color: var(--text);
  margin-bottom: 6px;
}
.es-v2 p {
  font-size: 0.86rem; color: var(--text-muted); max-width: 360px;
  line-height: 1.5; margin-bottom: 18px;
}

/* ════════════════════════════════════════════════════════════════════
   DENSITY TOGGLE (compact / comfortable)
   ════════════════════════════════════════════════════════════════════ */
html[data-density="compact"] .data-table th { padding: 8px 12px; }
html[data-density="compact"] .data-table td { padding: 7px 12px; font-size: 0.82rem; }
html[data-density="compact"] .user-table th { padding: 8px 12px; }
html[data-density="compact"] .user-table td { padding: 8px 12px; font-size: 0.82rem; }
html[data-density="compact"] .offers-table thead th { padding: 8px 10px; font-size: 0.7rem; }
html[data-density="compact"] .offers-table tbody td { padding: 7px 10px; font-size: 0.8rem; }
html[data-density="compact"] .card-header { padding: 10px 16px; }
html[data-density="compact"] .card-body { padding: 12px 16px; }
html[data-density="compact"] .stat-card { padding: 14px 16px; }
html[data-density="compact"] .stat-value { font-size: 1.4rem; }
html[data-density="compact"] .form-group { margin-bottom: 10px; }
html[data-density="compact"] .form-input,
html[data-density="compact"] .form-select,
html[data-density="compact"] .form-textarea { padding: 7px 11px; font-size: 0.84rem; }

/* ════════════════════════════════════════════════════════════════════
   COLOR-CODED FINANCIAL AMOUNTS
   ════════════════════════════════════════════════════════════════════ */
.amt            { font-family: var(--font-mono); font-weight: 700; font-variant-numeric: tabular-nums; }
.amt-received   { color: var(--green-600); }
.amt-pending    { color: var(--amber-600); }
.amt-overdue    { color: var(--red-600); }
.amt-lost       { color: var(--text-soft); text-decoration: line-through; }
.amt-neutral    { color: var(--text); }
[data-theme="dark"] .amt-received { color: #4ade80; }
[data-theme="dark"] .amt-pending  { color: #fbbf24; }
[data-theme="dark"] .amt-overdue  { color: #f87171; }

/* Inline status dot next to amounts */
.amt-dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  margin-right: 5px; vertical-align: middle;
}
.amt-received .amt-dot { background: currentColor; }
.amt-pending  .amt-dot { background: currentColor; }
.amt-overdue  .amt-dot { background: currentColor; animation: pulse-dot 2s infinite; }

/* ════════════════════════════════════════════════════════════════════
   SPARKLINE
   ════════════════════════════════════════════════════════════════════ */
.spark {
  width: 100%; height: 36px; display: block;
  margin-top: 10px; overflow: visible;
}
.spark-path {
  fill: none; stroke: var(--accent);
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.spark-fill { fill: var(--accent); opacity: 0.12; }
.spark-dot {
  fill: var(--accent); stroke: var(--surface); stroke-width: 2;
}
.stat-card.green .spark-path { stroke: var(--green-500); } .stat-card.green .spark-fill { fill: var(--green-500); }
.stat-card.blue  .spark-path { stroke: var(--blue-500); }  .stat-card.blue  .spark-fill { fill: var(--blue-500); }
.stat-card.amber .spark-path { stroke: var(--amber-500); } .stat-card.amber .spark-fill { fill: var(--amber-500); }
.stat-card.red   .spark-path { stroke: var(--red-500); }   .stat-card.red   .spark-fill { fill: var(--red-500); }

/* ════════════════════════════════════════════════════════════════════
   KANBAN (pipeline view)
   ════════════════════════════════════════════════════════════════════ */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(260px, 1fr));
  gap: 14px; overflow-x: auto;
  padding-bottom: 16px;
  min-height: 520px;
}
.kanban-col {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex; flex-direction: column;
  max-height: calc(100vh - 220px);
}
.kanban-col-head {
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
  font-size: 0.82rem; font-weight: 700; color: var(--text);
  position: sticky; top: 0; z-index: 2;
  background: var(--surface-2); border-radius: 12px 12px 0 0;
}
.kanban-col-head .kc-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.kc-dot.st-hazırlanıyor { background: var(--slate-400); }
.kc-dot.st-gönderildi   { background: var(--blue-500); }
.kc-dot.st-beklemede    { background: var(--amber-500); }
.kc-dot.st-onaylandı    { background: var(--green-500); }
.kc-dot.st-reddedildi   { background: var(--red-500); }
.kanban-col-head .kc-count {
  margin-left: auto; font-family: var(--font-mono);
  font-size: 0.74rem; font-weight: 600; color: var(--text-muted);
  background: var(--surface); padding: 2px 7px; border-radius: 10px;
  border: 1px solid var(--border);
}
.kanban-col-body {
  padding: 10px; flex: 1; overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px;
  min-height: 120px;
}
.kanban-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: grab;
  transition: transform var(--dur-fast), box-shadow var(--dur-fast), border-color var(--dur-fast);
  font-size: 0.82rem;
}
.kanban-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.kanban-card:active { cursor: grabbing; }
.kanban-card.temp-hot  { border-left-color: var(--red-500); }
.kanban-card.temp-warm { border-left-color: var(--amber-500); }
.kanban-card.temp-cold { border-left-color: var(--blue-500); }
.kanban-card.temp-lost { border-left-color: var(--slate-400); }
.kanban-card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 6px; margin-bottom: 4px;
}
.kanban-card-no {
  font-family: var(--font-mono); font-size: 0.74rem;
  font-weight: 600; color: var(--text-muted);
}
.kanban-card-amt {
  font-family: var(--font-mono); font-weight: 700;
  font-size: 0.88rem; color: var(--accent-ink);
}
.kanban-card-customer {
  font-weight: 600; color: var(--text); font-size: 0.88rem;
  margin-bottom: 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kanban-card-meta {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 0.7rem;
}
.kanban-card-meta .kc-temp {
  font-size: 11px;
}
.kanban-card-days {
  color: var(--text-soft); font-family: var(--font-mono);
}
.kanban-card-days.over { color: var(--red-600); font-weight: 700; }
.kanban-card-lang { font-size: 13px; }
.kanban-card.sortable-ghost { opacity: 0.4; transform: scale(0.97); }
.kanban-card.sortable-drag { box-shadow: var(--shadow-xl); transform: rotate(2deg); }

.kanban-col-body:empty::before {
  content: 'Bu aşamada henüz teklif yok'; display: block;
  text-align: center; color: var(--text-soft); font-size: 0.78rem;
  padding: 20px 10px; border: 2px dashed var(--border); border-radius: 8px;
}

/* Kanban view toggle */
.view-toggle {
  display: inline-flex; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 8px; padding: 3px; gap: 2px;
}
.view-toggle button {
  padding: 6px 12px; border: none; background: transparent;
  border-radius: 6px; font-size: 0.8rem; font-weight: 600; font-family: inherit;
  color: var(--text-muted); cursor: pointer; display: flex; align-items: center; gap: 6px;
  transition: all var(--dur-fast);
}
.view-toggle button:hover { color: var(--text); }
.view-toggle button.active { background: var(--surface); color: var(--accent-ink); box-shadow: var(--shadow-sm); }

/* ════════════════════════════════════════════════════════════════════
   CUSTOMER DETAIL HERO BAND
   ════════════════════════════════════════════════════════════════════ */
.cust-hero {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border); border-radius: 16px;
  padding: 22px 24px; margin-bottom: 20px; position: relative;
  overflow: hidden;
}
.cust-hero::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--orange-500), var(--orange-400), var(--orange-500));
}
.cust-hero-grid {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto auto;
  gap: 22px; align-items: center;
}
.cust-hero-logo {
  width: 68px; height: 68px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  color: var(--white); font-weight: 800; font-size: 1.4rem;
  box-shadow: var(--shadow-md); flex-shrink: 0;
}
.cust-hero-main .ch-name {
  font-size: 1.25rem; font-weight: 800; color: var(--text-strong);
  margin-bottom: 4px; letter-spacing: -0.01em;
}
.cust-hero-main .ch-meta {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-size: 0.82rem; color: var(--text-muted);
}
.cust-hero-main .ch-meta .ch-taxid { font-family: var(--font-mono); }
.cust-hero-main .ch-meta .ch-sep::before { content: '·'; margin: 0 2px; color: var(--text-soft); }
.cust-hero-kpi {
  display: flex; flex-direction: column; align-items: flex-end; text-align: right;
  padding: 0 14px; border-left: 1px solid var(--border); min-width: 110px;
}
.cust-hero-kpi .chk-label {
  font-size: 0.66rem; font-weight: 700; color: var(--text-soft);
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px;
}
.cust-hero-kpi .chk-value {
  font-size: 1.05rem; font-weight: 800; color: var(--text-strong);
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
}
.cust-hero-kpi .chk-sub { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }

.ch-temp {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 14px;
  font-size: 0.72rem; font-weight: 700;
}
.ch-temp.hot  { background: var(--red-100); color: var(--red-700); }
.ch-temp.warm { background: var(--amber-100); color: var(--amber-700); }
.ch-temp.cold { background: var(--blue-100); color: var(--blue-700); }
.ch-temp.lost { background: #e5e7eb; color: #4b5563; }
[data-theme="dark"] .ch-temp.hot  { background: rgba(239,68,68,0.18); color: #f87171; }
[data-theme="dark"] .ch-temp.warm { background: rgba(245,158,11,0.18); color: #fbbf24; }
[data-theme="dark"] .ch-temp.cold { background: rgba(59,130,246,0.18); color: #60a5fa; }
[data-theme="dark"] .ch-temp.lost { background: rgba(148,163,184,0.18); color: #a8b3cc; }

@media (max-width: 1100px) {
  .cust-hero-grid { grid-template-columns: auto 1fr; }
  .cust-hero-kpi { grid-column: span 2; border-left: none; border-top: 1px solid var(--border); padding: 12px 0 0 0; align-items: flex-start; text-align: left; }
}

/* ════════════════════════════════════════════════════════════════════
   OFFER WIZARD STEP INDICATOR
   ════════════════════════════════════════════════════════════════════ */
.wizard-steps {
  display: flex; align-items: center; justify-content: center;
  gap: 0; padding: 14px 20px; margin-bottom: 18px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px;
}
.wizard-step {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 10px; position: relative;
  color: var(--text-soft); font-size: 0.82rem; font-weight: 500;
  cursor: pointer; transition: color var(--dur-fast);
}
.wizard-step:not(:last-child)::after {
  content: ''; flex-shrink: 0;
  width: 32px; height: 2px; background: var(--border);
  margin-left: 16px; position: relative; top: 0;
}
.wizard-step .ws-circle {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--surface-inset); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 0.75rem; font-weight: 700;
  color: var(--text-soft);
  transition: all var(--dur-base) var(--ease-out);
}
.wizard-step.done .ws-circle {
  background: var(--green-500); border-color: var(--green-500); color: var(--white);
}
.wizard-step.done::after { background: var(--green-500); }
.wizard-step.done { color: var(--text-muted); }
.wizard-step.done .ws-circle::after {
  content: '\f00c'; font-family: 'Font Awesome 6 Free'; font-weight: 900;
  color: var(--white); font-size: 0.7rem;
}
.wizard-step.done .ws-circle > span { display: none; }
.wizard-step.active .ws-circle {
  background: var(--accent); border-color: var(--accent); color: var(--white);
  box-shadow: 0 0 0 4px rgba(249,115,22,0.18);
}
.wizard-step.active { color: var(--text); font-weight: 700; }
.wizard-step:hover { color: var(--text); }

@media (max-width: 900px) {
  .wizard-step .ws-label { display: none; }
  .wizard-step:not(:last-child)::after { width: 20px; margin-left: 8px; }
}

/* ════════════════════════════════════════════════════════════════════
   PHOTOGRAPHY-FORWARD ITEM CARD (item-library.html)
   ════════════════════════════════════════════════════════════════════ */
.item-card-v2 {
  background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden;
  display: flex; flex-direction: column;
  cursor: pointer;
  transition: transform var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out);
}
.item-card-v2:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg); border-color: var(--border-strong);
}
.item-card-v2 .ic-hero {
  position: relative; aspect-ratio: 4/3; background: var(--surface-inset);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.item-card-v2 .ic-hero img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-out);
}
.item-card-v2:hover .ic-hero img { transform: scale(1.04); }
.item-card-v2 .ic-hero-fallback {
  font-size: 48px; color: var(--border-strong);
}
.item-card-v2 .ic-chip {
  position: absolute; top: 10px; left: 10px;
  background: rgba(15,23,42,0.78); backdrop-filter: blur(6px);
  color: var(--white); font-family: var(--font-mono);
  font-size: 0.7rem; font-weight: 600; padding: 4px 8px; border-radius: 5px;
}
.item-card-v2 .ic-chip-cat {
  position: absolute; top: 10px; right: 10px;
  background: rgba(249,115,22,0.95); color: var(--white);
  font-size: 0.7rem; font-weight: 700; padding: 4px 9px; border-radius: 5px;
}
.item-card-v2 .ic-body { padding: 14px 16px; }
.item-card-v2 .ic-title {
  font-size: 0.92rem; font-weight: 700; color: var(--text-strong);
  margin-bottom: 4px; line-height: 1.25;
}
.item-card-v2 .ic-sub {
  font-size: 0.76rem; color: var(--text-muted);
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
}
.item-card-v2 .ic-footer {
  padding: 10px 16px; border-top: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.8rem;
}
.item-card-v2 .ic-price {
  font-family: var(--font-mono); font-weight: 700; color: var(--accent-ink);
}
.item-card-v2 .ic-stock {
  font-size: 0.72rem; color: var(--text-muted); font-family: var(--font-mono);
}
.item-card-v2 .ic-stock.low { color: var(--red-500); }

/* ════════════════════════════════════════════════════════════════════
   TABLE ROW HOVER — CONTEXTUAL ACTION REVEAL
   ════════════════════════════════════════════════════════════════════ */
.data-table tbody tr .row-actions-hover,
.user-table tbody tr .actions,
.offers-table tbody tr .row-actions {
  opacity: 0.25;
  transition: opacity var(--dur-fast);
}
.data-table tbody tr:hover .row-actions-hover,
.user-table tbody tr:hover .actions,
.offers-table tbody tr:hover .row-actions {
  opacity: 1;
}

/* ════════════════════════════════════════════════════════════════════
   MOBILE — bottom nav + full-screen modals + 44px touch targets
   ════════════════════════════════════════════════════════════════════ */
.bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--surface-raised);
  border-top: 1px solid var(--border);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom)) 4px;
  z-index: 200;
  justify-content: space-around; align-items: center;
  box-shadow: 0 -4px 18px rgba(0,0,0,0.08);
}
.bottom-nav .bn-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; padding: 6px 10px; min-width: 56px; min-height: 52px;
  background: transparent; border: none; font-family: inherit;
  color: var(--text-muted); text-decoration: none; cursor: pointer;
  font-size: 0.62rem; font-weight: 600;
  border-radius: 8px;
  transition: color var(--dur-fast);
}
.bottom-nav .bn-item:hover, .bottom-nav .bn-item.active { color: var(--accent-ink); }
.bottom-nav .bn-item i { font-size: 17px; }
.bottom-nav .bn-center .bn-plus {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--orange-500), var(--orange-600));
  color: var(--white); font-size: 18px;
  box-shadow: var(--shadow-lg);
  margin-top: -18px;
}

@media (max-width: 768px) {
  .bottom-nav { display: flex; }
  body { padding-bottom: 66px; }
  .cmdk-trigger { display: none; }

  /* Full-screen modals on mobile */
  .modal-overlay { padding: 0; }
  .modal {
    width: 100% !important; max-width: 100% !important;
    height: 100vh; max-height: 100vh; border-radius: 0;
    display: flex; flex-direction: column;
  }
  .modal-body { flex: 1; overflow-y: auto; }

  /* 44px touch targets */
  .btn, .btn-sm, .btn-icon, .topbar-btn, .modal-close,
  .nav-item, .action-btn, .tab, .kpi-card,
  .data-table tbody tr, .offers-table tbody tr, .user-table tbody tr {
    min-height: 44px;
  }
  .btn-sm { min-height: 40px; padding: 10px 14px; }
  .action-btn { width: 40px; height: 40px; }
}

/* Force 44px touch targets in pointer:coarse environments regardless of breakpoint */
@media (pointer: coarse) {
  .btn, .topbar-btn, .modal-close, .action-btn { min-height: 44px; }
}

/* ════════════════════════════════════════════════════════════════════
   NOTIFICATION PANEL (live data)
   ════════════════════════════════════════════════════════════════════ */
.notif-panel { padding: 0; }
.notif-item { cursor: pointer; }

/* ════════════════════════════════════════════════════════════════════
   DARK MODE — fill remaining color-coded badge classes
   ════════════════════════════════════════════════════════════════════ */
[data-theme="dark"] .role-admin   { background: rgba(168,85,247,0.18); color: #c084fc; }
[data-theme="dark"] .role-manager { background: rgba(59,130,246,0.18); color: #60a5fa; }
[data-theme="dark"] .role-rep     { background: rgba(249,115,22,0.18); color: #fb923c; }
[data-theme="dark"] .st-hazırlanıyor { background: rgba(100,116,139,0.2); color: #cbd5e1; }
[data-theme="dark"] .st-gönderildi   { background: rgba(59,130,246,0.2); color: #93c5fd; }
[data-theme="dark"] .st-beklemede    { background: rgba(245,158,11,0.2); color: #fcd34d; }
[data-theme="dark"] .st-onaylandı    { background: rgba(34,197,94,0.2); color: #86efac; }
[data-theme="dark"] .st-reddedildi   { background: rgba(239,68,68,0.2); color: #fca5a5; }
[data-theme="dark"] .temp-hot  { background: rgba(239,68,68,0.2); color: #fca5a5; }
[data-theme="dark"] .temp-warm { background: rgba(245,158,11,0.2); color: #fcd34d; }
[data-theme="dark"] .temp-cold { background: rgba(59,130,246,0.2); color: #93c5fd; }
[data-theme="dark"] .temp-lost { background: rgba(148,163,184,0.2); color: #cbd5e1; }
