/* ===========================================================
   Kumble — Design System
   Font: Poppins · Accent: Indigo · Icons: Lucide
   =========================================================== */

:root {
  /* Brand */
  --ink: #0B1020;
  --ink-soft: #1B2240;

  /* Indigo accent */
  --accent: #4F46E5;
  --accent-hover: #4338CA;
  --accent-soft: #EEF2FF;
  --accent-mid: #C7D2FE;
  --accent-deep: #312E81;

  /* Status */
  --success: #10B981;
  --success-soft: #ECFDF5;
  --warning: #F59E0B;
  --warning-soft: #FFFBEB;
  --danger:  #EF4444;
  --danger-soft: #FEF2F2;
  --info:    #0EA5E9;
  --info-soft: #ECFEFF;

  /* Neutrals (slightly warm) */
  --bg:      #FAFAFB;
  --surface: #FFFFFF;
  --line:    #ECEEF3;
  --line-2:  #DCE0EA;
  --mute-50:  #F7F8FA;
  --mute-100: #F1F3F8;
  --mute-200: #E5E8F0;
  --mute-300: #C9CFDC;
  --mute-400: #98A1B5;
  --mute-500: #6A7388;
  --mute-600: #4C5468;
  --mute-700: #353B4D;
  --mute-800: #20253A;
  --mute-900: #11152A;

  /* Radii */
  --r-sm: 8px;
  --r:    12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-pill: 999px;

  /* Shadows */
  --sh-1: 0 1px 2px rgba(11,16,32,0.04), 0 1px 3px rgba(11,16,32,0.05);
  --sh-2: 0 6px 18px rgba(11,16,32,0.06), 0 2px 6px rgba(11,16,32,0.04);
  --sh-3: 0 20px 50px rgba(11,16,32,0.12), 0 8px 20px rgba(11,16,32,0.06);
  --sh-accent: 0 10px 24px rgba(79,70,229,0.28);

  /* Layout */
  --sidebar-w: 244px;
  --topbar-h: 64px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

body {
  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
ul { list-style: none; }
img, svg { display: block; max-width: 100%; }

/* Lucide icons base sizing */
[data-lucide] { width: 18px; height: 18px; stroke-width: 1.75; flex-shrink: 0; }
.icon-sm [data-lucide] { width: 14px; height: 14px; }
.icon-lg [data-lucide] { width: 22px; height: 22px; }
.icon-xl [data-lucide] { width: 28px; height: 28px; }

/* ============== LOGO ============== */
.logo {
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
}
.logo .logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--ink);
  border-radius: 8px;
  color: white;
  position: relative;
}
.logo .logo-mark::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 2px solid var(--accent);
  border-radius: 3px;
}
.logo .logo-mark::after {
  content: '';
  position: absolute;
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 2px;
  bottom: 5px; right: 5px;
}
.logo-text { line-height: 1; }
.logo-text .dot { color: var(--accent); }

/* ============== BUTTONS ============== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--r);
  font-size: 14px;
  font-weight: 600;
  border: 1.5px solid transparent;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
  user-select: none;
}
.btn [data-lucide] { width: 16px; height: 16px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: var(--sh-accent);
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 12px 28px rgba(79,70,229,0.35); }

.btn-dark {
  background: var(--ink);
  color: white;
}
.btn-dark:hover:not(:disabled) { background: var(--ink-soft); }

.btn-ghost {
  background: var(--mute-50);
  color: var(--ink);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--mute-100); }

.btn-outline {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-2);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover { background: #DC2626; }

.btn-link {
  background: transparent;
  color: var(--accent);
  padding: 4px 6px;
  font-weight: 600;
}
.btn-link:hover { text-decoration: underline; }

.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: var(--r-sm); }
.btn-sm [data-lucide] { width: 14px; height: 14px; }
.btn-lg { padding: 14px 26px; font-size: 15px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-icon { padding: 8px; width: 36px; height: 36px; }
.btn-icon-sm { padding: 6px; width: 30px; height: 30px; border-radius: var(--r-sm); }

/* ============== FORM ============== */
.field { margin-bottom: 16px; }
.field-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--mute-700);
  margin-bottom: 6px;
}
.field-label .field-hint { font-weight: 500; color: var(--mute-400); font-size: 12px; }

.input, .textarea, .select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--line-2);
  border-radius: var(--r-sm);
  font-size: 14px;
  background: var(--surface);
  color: var(--ink);
  transition: all 0.18s ease;
  outline: none;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.12);
}
.input::placeholder, .textarea::placeholder { color: var(--mute-300); }
.textarea { resize: vertical; min-height: 88px; }

.input-with-icon { position: relative; }
.input-with-icon > [data-lucide] {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--mute-400);
  pointer-events: none;
}
.input-with-icon .input { padding-left: 40px; }
.input-with-icon .input-action {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--mute-400);
  padding: 6px;
  cursor: pointer;
  border-radius: 6px;
}
.input-with-icon .input-action:hover { color: var(--ink); background: var(--mute-50); }

.field-help { font-size: 12px; color: var(--mute-400); margin-top: 6px; }
.field-error { font-size: 12px; color: var(--danger); margin-top: 6px; display: flex; gap: 4px; align-items: center; }

.checkbox, .radio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--mute-600);
  cursor: pointer;
}
.checkbox input, .radio input { accent-color: var(--accent); width: 16px; height: 16px; }

/* ============== CARD ============== */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 24px;
  box-shadow: var(--sh-1);
}
.card-lg { padding: 32px; border-radius: var(--r-lg); }
.card-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title [data-lucide] { color: var(--accent); width: 18px; height: 18px; }
.card-sub { font-size: 13px; color: var(--mute-500); margin-bottom: 18px; }

/* ============== BADGES / TAGS ============== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  letter-spacing: 0.01em;
}
.badge [data-lucide] { width: 11px; height: 11px; stroke-width: 2.5; }
.badge.success { background: var(--success-soft); color: var(--success); }
.badge.warning { background: var(--warning-soft); color: var(--warning); }
.badge.danger  { background: var(--danger-soft); color: var(--danger); }
.badge.info    { background: var(--info-soft); color: var(--info); }
.badge.accent  { background: var(--accent-soft); color: var(--accent); }
.badge.muted   { background: var(--mute-100); color: var(--mute-600); }
.badge.dark    { background: var(--ink); color: white; }

.dot-status {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.dot-status.live { background: var(--success); box-shadow: 0 0 0 4px rgba(16,185,129,0.18); }
.dot-status.off  { background: var(--mute-300); }
.dot-status.warn { background: var(--warning); }

/* ============== TOGGLE ============== */
.toggle {
  width: 38px; height: 22px;
  border-radius: 11px;
  background: var(--mute-200);
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  border: none;
  padding: 0;
  flex-shrink: 0;
}
.toggle::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
  transition: left 0.2s ease;
}
.toggle.on { background: var(--accent); }
.toggle.on::after { left: 19px; }

/* ============== APP SHELL ============== */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}
.app.collapsed { grid-template-columns: 72px 1fr; }

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 20px 14px 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 4px;
  margin-bottom: 22px;
}

.nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}
.nav-section {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute-400);
  padding: 16px 12px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--mute-600);
  transition: all 0.15s;
  cursor: pointer;
}
.nav-item:hover { background: var(--mute-50); color: var(--ink); }
.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.nav-item .nav-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  background: var(--mute-100);
  color: var(--mute-500);
}
.nav-item.active .nav-count { background: white; color: var(--accent); }

.sidebar-user {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--mute-50);
}
.avatar {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), #7C3AED);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.avatar-sm { width: 28px; height: 28px; font-size: 11px; border-radius: 7px; }
.avatar-lg { width: 48px; height: 48px; font-size: 17px; border-radius: 12px; }
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-info .name { font-size: 13px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.sidebar-user-info .sub { font-size: 11px; color: var(--mute-500); }
.sidebar-user .more {
  background: none;
  border: none;
  color: var(--mute-400);
  padding: 4px;
  border-radius: 6px;
  cursor: pointer;
}
.sidebar-user .more:hover { background: var(--mute-100); color: var(--ink); }

/* Sidebar — Admin (dark) */
.sidebar.dark {
  background: var(--mute-900);
  border-right-color: transparent;
}
.sidebar.dark .logo, .sidebar.dark .logo-text { color: white; }
.sidebar.dark .logo-mark { background: rgba(255,255,255,0.08); }
.sidebar.dark .logo-text .dot { color: var(--accent); }
.sidebar.dark .nav-section { color: rgba(255,255,255,0.32); }
.sidebar.dark .nav-item { color: rgba(255,255,255,0.62); }
.sidebar.dark .nav-item:hover { background: rgba(255,255,255,0.05); color: white; }
.sidebar.dark .nav-item.active { background: var(--accent); color: white; }
.sidebar.dark .nav-item.active .nav-count { background: rgba(255,255,255,0.18); color: white; }
.sidebar.dark .nav-item .nav-count { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.5); }
.sidebar.dark .sidebar-user { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.08); }
.sidebar.dark .sidebar-user-info .name { color: white; }
.sidebar.dark .sidebar-user-info .sub { color: rgba(255,255,255,0.45); }
.sidebar.dark .sidebar-user .more { color: rgba(255,255,255,0.5); }
.sidebar.dark .sidebar-user .more:hover { background: rgba(255,255,255,0.08); color: white; }

/* MAIN */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar .search {
  flex: 1;
  max-width: 360px;
  position: relative;
}
.topbar .search [data-lucide] {
  position: absolute;
  left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--mute-400);
  width: 16px; height: 16px;
}
.topbar .search input {
  width: 100%;
  padding: 8px 14px 8px 36px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--mute-50);
  font-size: 13px;
  outline: none;
  transition: all 0.18s;
}
.topbar .search input:focus { background: white; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,70,229,0.12); }
.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.topbar-icon-btn {
  background: transparent;
  border: 1px solid var(--line);
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--mute-500);
  cursor: pointer;
  position: relative;
  transition: all 0.15s;
}
.topbar-icon-btn:hover { color: var(--ink); border-color: var(--line-2); }
.topbar-icon-btn .badge-dot {
  position: absolute;
  top: 7px; right: 7px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid white;
}

.page {
  padding: 28px;
  flex: 1;
}
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.025em;
}
.page-sub {
  font-size: 13.5px;
  color: var(--mute-500);
  margin-top: 4px;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--mute-400);
  margin-bottom: 10px;
}
.breadcrumb a { color: var(--mute-500); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb [data-lucide] { width: 12px; height: 12px; }

/* ============== TABLE ============== */
.table-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--sh-1);
}
.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  gap: 12px;
  flex-wrap: wrap;
}
.table-toolbar .left { display: flex; gap: 8px; align-items: center; }
.table-toolbar .right { display: flex; gap: 8px; align-items: center; }
table.t {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
table.t th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mute-400);
  padding: 12px 18px;
  background: var(--mute-50);
  border-bottom: 1px solid var(--line);
}
table.t td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.t tr:last-child td { border-bottom: none; }
table.t tbody tr { transition: background 0.12s; }
table.t tbody tr:hover { background: var(--mute-50); }
table.t .user-cell { display: flex; align-items: center; gap: 10px; }
table.t .user-cell .name { font-weight: 600; }
table.t .user-cell .sub { font-size: 11px; color: var(--mute-400); }
table.t .actions { display: flex; gap: 4px; justify-content: flex-end; }

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--mute-500);
}
.pagination .pages { display: flex; gap: 4px; }
.pagination .pages button {
  width: 28px; height: 28px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--mute-600);
  font-weight: 600;
  font-size: 12px;
}
.pagination .pages button.active { background: var(--accent); color: white; border-color: var(--accent); }
.pagination .pages button:hover:not(.active) { border-color: var(--accent); color: var(--accent); }

/* ============== TABS ============== */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}
.tab {
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--mute-500);
  cursor: pointer;
  border: none;
  background: transparent;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* Compact segmented (pill) tabs */
.seg {
  display: inline-flex;
  background: var(--mute-100);
  padding: 4px;
  border-radius: var(--r);
  gap: 2px;
}
.seg button {
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  background: transparent;
  border-radius: var(--r-sm);
  color: var(--mute-500);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.seg button.active { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); }

/* ============== STAT CARDS ============== */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px;
  box-shadow: var(--sh-1);
}
.stat-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}
.stat-label { font-size: 12px; color: var(--mute-500); font-weight: 600; }
.stat-ico {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.stat-ico [data-lucide] { width: 16px; height: 16px; }
.stat-ico.green { background: var(--success-soft); color: var(--success); }
.stat-ico.orange { background: var(--warning-soft); color: var(--warning); }
.stat-ico.red { background: var(--danger-soft); color: var(--danger); }
.stat-value {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.stat-trend {
  font-size: 12px;
  font-weight: 500;
  color: var(--success);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.stat-trend.down { color: var(--danger); }
.stat-trend.neutral { color: var(--mute-500); }
.stat-trend [data-lucide] { width: 12px; height: 12px; }

/* Usage bar */
.usage-bar {
  height: 6px;
  background: var(--mute-100);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 10px;
}
.usage-bar > i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
}

/* ============== PROJECT CARDS ============== */
.proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.proj {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--sh-1);
  display: flex;
  flex-direction: column;
}
.proj:hover { transform: translateY(-2px); border-color: var(--accent-mid); box-shadow: var(--sh-2); }
.proj-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}
.proj-thumb {
  width: 44px; height: 44px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.proj-thumb [data-lucide] { width: 20px; height: 20px; }
.thumb-indigo { background: var(--accent-soft); color: var(--accent); }
.thumb-green  { background: var(--success-soft); color: var(--success); }
.thumb-orange { background: var(--warning-soft); color: var(--warning); }
.thumb-pink   { background: #FDF2F8; color: #DB2777; }
.thumb-cyan   { background: var(--info-soft); color: var(--info); }
.thumb-violet { background: #F5F3FF; color: #7C3AED; }
.proj-name { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 4px; }
.proj-meta { font-size: 12px; color: var(--mute-500); display: flex; gap: 6px; align-items: center; }
.proj-foot {
  display: flex;
  gap: 16px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.proj-stat { font-size: 11px; color: var(--mute-400); }
.proj-stat strong { display: block; font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 2px; }
.proj-new {
  border: 1.5px dashed var(--line-2);
  background: var(--mute-50);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--mute-500);
  cursor: pointer;
  min-height: 200px;
  transition: all 0.2s;
}
.proj-new:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.proj-new [data-lucide] { width: 24px; height: 24px; margin-bottom: 8px; }

/* ============== AUTH ============== */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  background:
    radial-gradient(circle at 20% 0%, rgba(79,70,229,0.07), transparent 50%),
    radial-gradient(circle at 80% 100%, rgba(79,70,229,0.05), transparent 50%),
    var(--bg);
  position: relative;
}
.auth-shell::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(11,16,32,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11,16,32,0.025) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(circle at 50% 50%, black, transparent 70%);
          mask-image: radial-gradient(circle at 50% 50%, black, transparent 70%);
  pointer-events: none;
}
.auth-card {
  position: relative;
  width: 100%;
  max-width: 440px;
}
.auth-head {
  text-align: center;
  margin-bottom: 28px;
}
.auth-head .logo { font-size: 24px; margin-bottom: 6px; }
.auth-head p { font-size: 13.5px; color: var(--mute-500); }
.auth-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 36px 32px;
  box-shadow: var(--sh-3);
}
.auth-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.auth-sub {
  font-size: 13.5px;
  color: var(--mute-500);
  margin-bottom: 24px;
}
.auth-foot {
  text-align: center;
  margin-top: 22px;
  font-size: 13px;
  color: var(--mute-500);
}
.auth-foot a { color: var(--accent); font-weight: 600; }
.auth-meta {
  text-align: center;
  margin-top: 24px;
  font-size: 11.5px;
  color: var(--mute-400);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.auth-meta [data-lucide] { width: 12px; height: 12px; }

/* ============== DEMO NAV (floating, shows all 19 screens) ============== */
.demo-nav-fab {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999;
  background: var(--ink);
  color: white;
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--sh-3);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.demo-nav-fab:hover { background: var(--ink-soft); }
.demo-nav-fab [data-lucide] { width: 14px; height: 14px; }
.demo-nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11,16,32,0.45);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.demo-nav-overlay.open { display: flex; }
.demo-nav-modal {
  background: white;
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 920px;
  max-height: 86vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--sh-3);
}
.demo-nav-modal header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.demo-nav-modal header h3 { font-size: 16px; font-weight: 700; }
.demo-nav-modal header p { font-size: 12.5px; color: var(--mute-500); margin-top: 2px; }
.demo-nav-modal header .close {
  background: var(--mute-50);
  border: none;
  width: 32px; height: 32px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--mute-500);
  display: flex; align-items: center; justify-content: center;
}
.demo-nav-modal header .close:hover { background: var(--mute-100); color: var(--ink); }
.demo-nav-body { padding: 22px; overflow-y: auto; }
.demo-nav-group { margin-bottom: 22px; }
.demo-nav-group:last-child { margin-bottom: 0; }
.demo-nav-group h4 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mute-400);
  margin-bottom: 10px;
}
.demo-nav-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}
.demo-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  text-decoration: none;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
  background: var(--surface);
}
.demo-nav-link:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.demo-nav-link.current { background: var(--accent); border-color: var(--accent); color: white; }
.demo-nav-link .num {
  font-size: 10px;
  font-weight: 700;
  width: 22px; height: 22px;
  border-radius: 6px;
  background: var(--mute-50);
  color: var(--mute-500);
  display: flex; align-items: center; justify-content: center;
}
.demo-nav-link:hover .num { background: white; color: var(--accent); }
.demo-nav-link.current .num { background: rgba(255,255,255,0.18); color: white; }

/* ============== UTILITIES ============== */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.flex-1 { flex: 1; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }
.text-mute { color: var(--mute-500); }
.text-sm { font-size: 12.5px; }
.text-xs { font-size: 11.5px; }
.text-lg { font-size: 16px; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-mono { font-family: 'JetBrains Mono', 'SF Mono', Menlo, monospace; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.divider { height: 1px; background: var(--line); margin: 20px 0; }
.hidden { display: none !important; }

/* ============== RESPONSIVE ============== */
@media (max-width: 1024px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  :root { --sidebar-w: 100%; }
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: auto;
    flex-direction: row;
    padding: 12px 16px;
    border-right: none;
    border-bottom: 1px solid var(--line);
    z-index: 30;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .sidebar-head { margin: 0; padding: 0; }
  .nav {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    flex: 1;
    margin-left: 16px;
    padding-bottom: 0;
  }
  .nav-section { display: none; }
  .nav-item { white-space: nowrap; padding: 7px 12px; }
  .nav-item .nav-count { display: none; }
  .sidebar-user { margin-top: 0; margin-left: auto; border: none; background: transparent; padding: 0; }
  .sidebar-user-info { display: none; }
  .main { padding-top: 0; }
  .topbar { padding: 0 16px; gap: 10px; height: 56px; }
  .topbar .search { display: none; }
  .page { padding: 18px 16px 80px; }
  .page-title { font-size: 20px; }
}

@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr; }
  .proj-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; }
  .auth-box { padding: 28px 20px; }
  .demo-nav-fab { padding: 8px 12px; font-size: 11px; }
}
