/* GK Foods Inventory System — Shared Design System */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ── CSS Custom Properties — Light Mode (default) ── */
:root {
  --color-base:        #f1f5f9;
  --color-base-2:      #e2e8f0;
  --color-modal-bg:    #ffffff;
  --color-header-bg:   rgba(241, 245, 249, 0.85);
  --color-sidebar:     linear-gradient(180deg, #eef2ff 0%, #e0e7ff 100%);
  --color-surface:     rgba(0, 0, 0, 0.04);
  --color-surface-2:   rgba(0, 0, 0, 0.07);
  --color-surface-3:   rgba(0, 0, 0, 0.10);
  --color-border:      rgba(0, 0, 0, 0.09);
  --color-border-2:    rgba(0, 0, 0, 0.14);
  --color-accent:      #6366f1;
  --color-accent-2:    #4f46e5;
  --color-accent-glow: rgba(99, 102, 241, 0.15);
  --color-text:        #0f172a;
  --color-muted:       #475569;
  --color-muted-2:     #94a3b8;
  --color-success:     #16a34a;
  --color-warning:     #d97706;
  --color-danger:      #dc2626;
  --color-info:        #0284c7;
  --color-toast-bg:    #ffffff;
  --color-select-opt:  #f1f5f9;
  --sidebar-width:     240px;
  --header-height:     64px;
  --radius-card:       16px;
  --radius-sm:         8px;
  --radius-pill:       9999px;
  --blur-glass:        blur(12px);
  --shadow-card:       0 2px 16px rgba(0,0,0,0.08);
  --shadow-glow:       0 0 24px rgba(99,102,241,0.2);
  --transition:        all 0.2s ease;
}

/* ── Dark Mode overrides ── */
html.dark {
  --color-base:        #0a0f1e;
  --color-base-2:      #0f1629;
  --color-modal-bg:    #131929;
  --color-header-bg:   rgba(10, 15, 30, 0.8);
  --color-sidebar:     linear-gradient(180deg, #1e1b4b 0%, #0a0f1e 100%);
  --color-surface:     rgba(255, 255, 255, 0.05);
  --color-surface-2:   rgba(255, 255, 255, 0.08);
  --color-surface-3:   rgba(255, 255, 255, 0.12);
  --color-border:      rgba(255, 255, 255, 0.08);
  --color-border-2:    rgba(255, 255, 255, 0.14);
  --color-accent:      #6366f1;
  --color-accent-2:    #818cf8;
  --color-accent-glow: rgba(99, 102, 241, 0.25);
  --color-text:        #e2e8f0;
  --color-muted:       #94a3b8;
  --color-muted-2:     #64748b;
  --color-success:     #22c55e;
  --color-warning:     #f59e0b;
  --color-danger:      #ef4444;
  --color-info:        #38bdf8;
  --color-toast-bg:    #1e2540;
  --color-select-opt:  #1e2540;
  --shadow-card:       0 4px 24px rgba(0,0,0,0.4);
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: 'Inter', sans-serif;
  background-color: var(--color-base);
  color: var(--color-text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--color-base); }
::-webkit-scrollbar-thumb { background: var(--color-surface-3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-muted-2); }

/* ── App Shell ── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--color-sidebar);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 50;
  transition: width 0.25s ease, transform 0.25s ease;
  overflow: hidden;
}
.sidebar.collapsed { width: 64px; }
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 16px;
  border-bottom: 1px solid var(--color-border);
  min-height: var(--header-height);
  white-space: nowrap;
  overflow: hidden;
}
.sidebar-logo-icon {
  width: 40px; height: 40px; min-width: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.sidebar-logo-icon img {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
}
.sidebar.collapsed .sidebar-logo { padding-left: 12px; padding-right: 12px; }
.sidebar-logo-text { font-size: 14px; font-weight: 700; line-height: 1.2; }
.sidebar-logo-sub  { font-size: 11px; color: var(--color-muted); font-weight: 400; }

.sidebar-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 12px 8px; }
.nav-section-label {
  font-size: 10px; font-weight: 600; letter-spacing: 0.08em;
  color: var(--color-muted-2); text-transform: uppercase;
  padding: 12px 8px 4px;
  white-space: nowrap; overflow: hidden;
  transition: opacity 0.2s;
}
.sidebar.collapsed .nav-section-label { opacity: 0; }

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 10px;
  border-radius: var(--radius-sm);
  color: var(--color-muted);
  text-decoration: none;
  font-size: 14px; font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
  white-space: nowrap; overflow: hidden;
  position: relative;
}
.nav-item:hover { color: var(--color-text); background: var(--color-surface-2); }
.nav-item.active {
  color: var(--color-text);
  background: var(--color-accent-glow);
  border: 1px solid rgba(99,102,241,0.3);
}
.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 4px; bottom: 4px;
  width: 3px; background: var(--color-accent);
  border-radius: 0 3px 3px 0;
}
.nav-icon {
  width: 20px; height: 20px; min-width: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.nav-label { transition: opacity 0.2s; }
.sidebar.collapsed .nav-label { opacity: 0; width: 0; overflow: hidden; }

.nav-submenu { padding-left: 20px; }
.nav-submenu .nav-item { padding: 8px 10px; font-size: 13px; }
.sidebar.collapsed .nav-submenu { display: none; }

.nav-chevron {
  margin-left: auto; font-size: 12px; color: var(--color-muted-2);
  transition: transform 0.2s;
}
.nav-chevron.open { transform: rotate(90deg); }

/* ── Main Content ── */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.25s ease;
}
.main-content.collapsed { margin-left: 64px; }

/* ── Header ── */
.app-header {
  height: var(--header-height);
  background: var(--color-header-bg);
  backdrop-filter: var(--blur-glass);
  -webkit-backdrop-filter: var(--blur-glass);
  border-bottom: 1px solid var(--color-border);
  display: flex; align-items: center;
  padding: 0 24px; gap: 16px;
  position: sticky; top: 0; z-index: 40;
}
.header-title { font-size: 16px; font-weight: 600; flex: 1; }
.header-warehouse {
  display: flex; align-items: center; gap: 8px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  padding: 6px 12px; font-size: 13px;
  cursor: pointer; transition: var(--transition);
}
.header-warehouse:hover { background: var(--color-surface-2); }

/* The three circular header controls share one definition so they cannot drift
   apart again — the reset button was previously a .btn-icon rounded square. */
.header-bell, .theme-toggle, .header-reset {
  position: relative;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  padding: 0;
  cursor: pointer; font-size: 16px;
  transition: var(--transition);
  flex-shrink: 0;
}
.header-bell:hover, .header-reset:hover { background: var(--color-surface-2); }
.header-reset:hover .icon { transform: rotate(-30deg); transition: var(--transition); }
.bell-badge {
  position: absolute; top: 0; right: 0;
  width: 16px; height: 16px;
  background: var(--color-danger);
  border-radius: 50%;
  font-size: 9px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--color-base);
}

.header-avatar {
  width: 36px; height: 36px;
  background: var(--color-accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-glow);
}

/* ── Page Content ── */
.page-content { flex: 1; padding: 28px 28px; }
.page-header { margin-bottom: 24px; }
.page-title { font-size: 22px; font-weight: 700; }
.page-subtitle { font-size: 13px; color: var(--color-muted); margin-top: 4px; }

/* ── Breadcrumb ── */
.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--color-muted);
  margin-bottom: 6px;
}
.breadcrumb a { color: var(--color-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--color-text); }
.breadcrumb-sep { color: var(--color-muted-2); }

/* ── Glass Card ── */
.glass-card {
  background: var(--color-surface);
  backdrop-filter: var(--blur-glass);
  -webkit-backdrop-filter: var(--blur-glass);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

@supports not (backdrop-filter: blur(12px)) {
  .glass-card { background: var(--color-surface-2); }
  .app-header  { background: var(--color-base-2); }
}

/* ── KPI Tiles ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-card {
  padding: 20px;
  position: relative; overflow: hidden;
}
.kpi-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--color-accent), transparent);
}
.kpi-label { font-size: 12px; color: var(--color-muted); font-weight: 500; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.05em; }
.kpi-value { font-size: 28px; font-weight: 700; line-height: 1; }
.kpi-change { font-size: 12px; color: var(--color-muted); margin-top: 6px; }
.kpi-icon {
  position: absolute; right: 16px; top: 16px;
  font-size: 28px; opacity: 1;
}

/* ── Tables ── */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-card); }
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--color-muted); padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-2);
  white-space: nowrap;
}
thead th:first-child { border-radius: var(--radius-sm) 0 0 0; }
thead th:last-child  { border-radius: 0 var(--radius-sm) 0 0; }
tbody tr { border-bottom: 1px solid var(--color-border); transition: background 0.15s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--color-surface-2); }
tbody td { padding: 12px 16px; font-size: 13px; }

/* ── Badges / Pills ── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
}
.badge-success { background: rgba(34,197,94,0.15);  color: #4ade80; border: 1px solid rgba(34,197,94,0.25); }
.badge-warning { background: rgba(245,158,11,0.15); color: #fbbf24; border: 1px solid rgba(245,158,11,0.25); }
.badge-danger  { background: rgba(239,68,68,0.15);  color: #f87171; border: 1px solid rgba(239,68,68,0.25); }
.badge-info    { background: rgba(56,189,248,0.15);  color: #7dd3fc; border: 1px solid rgba(56,189,248,0.25); }
.badge-neutral { background: var(--color-surface-2); color: var(--color-muted); border: 1px solid var(--color-border); }
.badge-accent  { background: var(--color-accent-glow); color: var(--color-accent-2); border: 1px solid rgba(99,102,241,0.3); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600;
  cursor: pointer; border: none;
  transition: var(--transition); text-decoration: none;
}
.btn-primary {
  background: var(--color-accent); color: #fff;
  box-shadow: 0 2px 12px var(--color-accent-glow);
}
.btn-primary:hover { background: var(--color-accent-2); box-shadow: 0 4px 20px var(--color-accent-glow); }
.btn-ghost {
  background: var(--color-surface); color: var(--color-text);
  border: 1px solid var(--color-border);
}
.btn-ghost:hover { background: var(--color-surface-2); }
.btn-danger { background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid rgba(239,68,68,0.3); }
.btn-danger:hover { background: rgba(239,68,68,0.25); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

/* ── Form Controls ── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--color-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.05em; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  padding: 9px 12px;
  font-size: 14px; font-family: inherit;
  outline: none; transition: var(--transition);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-glow);
}
.form-input::placeholder { color: var(--color-muted-2); }
.form-select { appearance: none; cursor: pointer; }
.form-select option { background: var(--color-select-opt); color: var(--color-text); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-input-group { display: flex; gap: 8px; }
.form-hint { font-size: 11px; color: var(--color-muted); margin-top: 4px; }
.form-error { font-size: 11px; color: var(--color-danger); margin-top: 4px; }

/* ── Toggle / Switch ── */
.toggle {
  width: 40px; height: 22px;
  background: var(--color-surface-3);
  border-radius: var(--radius-pill);
  position: relative; cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
.toggle.on { background: var(--color-accent); }
.toggle::after {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  background: white; border-radius: 50%;
  top: 3px; left: 3px;
  transition: transform 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.toggle.on::after { transform: translateX(18px); }

/* ── Tabs ── */
.tab-bar {
  display: flex; gap: 2px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 20px;
}
.tab-item {
  padding: 10px 16px;
  font-size: 13px; font-weight: 500;
  color: var(--color-muted);
  cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: var(--transition);
  white-space: nowrap;
}
.tab-item:hover { color: var(--color-text); }
.tab-item.active { color: var(--color-accent-2); border-bottom-color: var(--color-accent); }

/* ── Alerts / Status strip ── */
.alert-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
}
.alert-item:last-child { border-bottom: none; }
.alert-dot {
  width: 8px; height: 8px; min-width: 8px;
  border-radius: 50%; margin-top: 4px;
}

/* ── Modal ── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-box {
  width: 100%; max-width: 700px; max-height: 90vh;
  background: var(--color-modal-bg);
  border: 1px solid var(--color-border-2);
  border-radius: var(--radius-card);
  box-shadow: 0 20px 60px rgba(0,0,0,0.7);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--color-border);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.modal-title { font-size: 16px; font-weight: 600; }
.modal-close {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  cursor: pointer; font-size: 16px;
  transition: var(--transition);
}
.modal-close:hover { background: var(--color-surface-2); }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--color-border);
  display: flex; justify-content: flex-end; gap: 8px;
  flex-shrink: 0;
}

/* ── Skeleton loader ── */
.skeleton {
  background: linear-gradient(90deg, var(--color-surface) 25%, var(--color-surface-2) 50%, var(--color-surface) 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: 4px;
}
@keyframes skeleton-pulse {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Empty state ── */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 48px 24px;
  color: var(--color-muted); text-align: center; gap: 12px;
}
.empty-icon { font-size: 36px; opacity: 0.4; }
.empty-title { font-size: 14px; font-weight: 600; color: var(--color-text); }
.empty-desc  { font-size: 13px; color: var(--color-muted); max-width: 300px; line-height: 1.5; }

/* ── Toast ── */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 200;
  padding: 12px 20px;
  background: var(--color-toast-bg);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-card);
  animation: slideInRight 0.3s ease;
}
@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);   opacity: 1; }
}

/* ── Entrance animations ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.45s ease both; }
/* Stagger helpers (max 8) */
.delay-1 { animation-delay: 0.05s; }
.delay-2 { animation-delay: 0.10s; }
.delay-3 { animation-delay: 0.15s; }
.delay-4 { animation-delay: 0.20s; }
.delay-5 { animation-delay: 0.25s; }
.delay-6 { animation-delay: 0.30s; }
.delay-7 { animation-delay: 0.35s; }
.delay-8 { animation-delay: 0.40s; }

/* ── Chip / filter pills ── */
.chip {
  padding: 5px 12px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 500;
  cursor: pointer;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-muted);
  transition: var(--transition);
}
.chip:hover { background: var(--color-surface-2); color: var(--color-text); }
.chip.active { background: var(--color-accent-glow); border-color: rgba(99,102,241,0.4); color: var(--color-accent-2); }

/* ── UoM conversion label ── */
.uom-equiv {
  font-size: 11px; color: var(--color-accent-2);
  background: var(--color-accent-glow);
  padding: 2px 8px; border-radius: var(--radius-pill);
  font-weight: 500; white-space: nowrap;
}

/* ── Search bar ── */
.search-bar {
  position: relative;
}
.search-bar input {
  padding-left: 36px;
}
.search-bar .search-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--color-muted-2); font-size: 14px; pointer-events: none;
}

/* ── Toolbar (search + actions row) ── */
.toolbar {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.toolbar-right { margin-left: auto; display: flex; gap: 8px; }

/* ── Sub-nav (Settings) ── */
.subnav {
  display: flex; flex-direction: column; gap: 2px;
  width: 200px; min-width: 200px;
  padding-right: 16px;
  border-right: 1px solid var(--color-border);
}
.subnav-item {
  padding: 9px 12px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  color: var(--color-muted); cursor: pointer;
  transition: var(--transition);
}
.subnav-item:hover { color: var(--color-text); background: var(--color-surface-2); }
.subnav-item.active { color: var(--color-accent-2); background: var(--color-accent-glow); }

/* ── Two-panel layout (Settings, etc.) ── */
.panel-layout { display: flex; gap: 24px; }
.panel-content { flex: 1; }

/* ── Progress / source-of-truth banner ── */
.truth-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-radius: var(--radius-sm);
  background: var(--color-accent-glow);
  border: 1px solid rgba(99,102,241,0.3);
  font-size: 12px; font-weight: 500; color: var(--color-accent-2);
  margin-bottom: 16px;
}



/* ── Light-mode badge colour boosts (dark values are fine in dark mode) ── */
html:not(.dark) .badge-success { background: rgba(22,163,74,0.12);  color: #15803d; border-color: rgba(22,163,74,0.25); }
html:not(.dark) .badge-warning { background: rgba(217,119,6,0.12);  color: #b45309; border-color: rgba(217,119,6,0.25); }
html:not(.dark) .badge-danger  { background: rgba(220,38,38,0.12);  color: #b91c1c; border-color: rgba(220,38,38,0.25); }
html:not(.dark) .badge-info    { background: rgba(2,132,199,0.12);   color: #0369a1; border-color: rgba(2,132,199,0.25); }
html.dark .badge-success { background: rgba(34,197,94,0.15);  color: #4ade80; border-color: rgba(34,197,94,0.25); }
html.dark .badge-warning { background: rgba(245,158,11,0.15); color: #fbbf24; border-color: rgba(245,158,11,0.25); }
html.dark .badge-danger  { background: rgba(239,68,68,0.15);  color: #f87171; border-color: rgba(239,68,68,0.25); }
html.dark .badge-info    { background: rgba(56,189,248,0.15);  color: #7dd3fc; border-color: rgba(56,189,248,0.25); }

/* ── Theme toggle button ── */
.theme-toggle:hover { background: var(--color-surface-2); transform: rotate(20deg); }

/* ── Login page light mode ── */
.login-bg-light {
  background: radial-gradient(ellipse at 20% 50%, rgba(99,102,241,0.10) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(99,102,241,0.06) 0%, transparent 50%),
              #f1f5f9;
}

/* ── Sales Import: dropzone ── */
.dropzone {
  border: 2px dashed var(--color-border-2);
  border-radius: var(--radius-card);
  padding: 32px 20px;
  /* Own the gap to whatever follows — the error and duplicate-warning blocks
     between this and the submit button are x-show'd, so on the common path the
     button sits directly beneath it. */
  margin-bottom: 16px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  color: var(--color-muted);
}
.dropzone:hover { border-color: var(--color-accent); background: var(--color-surface); }
.dropzone.drag-over { border-color: var(--color-accent); background: var(--color-accent-glow); color: var(--color-accent-2); }
.dropzone-icon { font-size: 26px; color: var(--color-accent-2); margin-bottom: 8px; display: flex; justify-content: center; }

/* ── Sales Import: wizard step breadcrumb ── */
.import-steps {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 20px;
}
.import-step {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--color-muted-2);
}
.import-step-num {
  width: 22px; height: 22px; min-width: 22px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  font-size: 11px;
}
.import-step.active { color: var(--color-text); }
.import-step.active .import-step-num { background: var(--color-accent); border-color: var(--color-accent); color: #fff; }
.import-step.done { color: var(--color-muted); }
.import-step.done .import-step-num { background: var(--color-accent-glow); border-color: rgba(99,102,241,0.4); color: var(--color-accent-2); }
.import-step-sep { flex: 0 0 32px; height: 1px; background: var(--color-border); }

/* ── Reset control badge dot (app-header, all pages) ── */
.reset-badge {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--color-warning);
  border-radius: 50%;
  border: 2px solid var(--color-header-bg);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-content { margin-left: 0 !important; }
  .page-content { padding: 16px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .toolbar { flex-direction: column; align-items: flex-start; }
  .toolbar-right { margin-left: 0; }
  .panel-layout { flex-direction: column; }
  .subnav { width: 100%; min-width: 0; border-right: none; border-bottom: 1px solid var(--color-border); padding-right: 0; padding-bottom: 12px; flex-direction: row; flex-wrap: wrap; }
}

@media (min-width: 769px) and (max-width: 1024px) {
  :root { --sidebar-width: 64px; }
  .nav-label { display: none; }
  .nav-section-label { opacity: 0; }
  .sidebar-logo-text, .sidebar-logo-sub { display: none; }
  .sidebar-logo { padding-left: 12px; padding-right: 12px; }
  .nav-chevron { display: none; }
  .nav-submenu { display: none; }
}


/* ── Lucide icons ── */
/* Hydrated by assets/icons.js: any [data-icon] host gets an inline <svg>.
   Icons size off the host's font-size (1em), so existing type scales carry over. */
[data-icon] {
  display: inline-flex; align-items: center; justify-content: center;
  line-height: 0; flex-shrink: 0;
}
.lucide-icon {
  width: 1em; height: 1em;
  display: inline-block; vertical-align: -0.125em;
  flex-shrink: 0;
}
.icon { font-size: 1em; }

/* Icon-bearing text rows need a gap the emoji glyphs used to provide */
.badge { gap: 4px; }
.tab-item, .subnav-item { display: inline-flex; align-items: center; gap: 7px; }
.subnav-item { display: flex; }
.tab-item [data-icon], .subnav-item [data-icon] { font-size: 15px; }
.nav-chevron { display: flex; align-items: center; font-size: 14px; }
.search-bar .search-icon { font-size: 15px; display: flex; }
.modal-close { display: flex; align-items: center; justify-content: center; }
.empty-icon { display: flex; justify-content: center; }
.kpi-icon { font-size: 20px; color: var(--color-accent-2); opacity: 0.9; }
.kpi-label { padding-right: 30px; }
.badge [data-icon] { font-size: 12px; }
