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

/* ─── Design Tokens ───────────────────────────────────────────────────────── */
:root {
  --primary: #f59e0b;
  --primary-dark: #d97706;
  --primary-light: #fde68a;
  --secondary: #fb923c;
  --sidebar-w: 256px;
  --sidebar-collapsed-w: 64px;
  --topbar-h: 64px;
  --sidebar-bg: #1f2937;
  --sidebar-text: #d1d5db;
  --sidebar-muted: #9ca3af;
  --sidebar-active-bg: rgba(245,158,11,0.15);
  --sidebar-active-text: #f59e0b;
  --bg: #faf7f2;
  --bg-card: rgba(255,255,255,0.82);
  --bg-card-solid: #ffffff;
  --bg-input: #f3ede3;
  --text: #1c1917;
  --text-muted: #78716c;
  --text-faint: #a8a29e;
  --border: rgba(0,0,0,0.07);
  --border-solid: #e7e5e4;
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.10), 0 2px 8px rgba(0,0,0,0.05);
  --radius: 16px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --radius-full: 9999px;
  --topbar-bg: #ffffff;
  --topbar-border: #f0ebe3;
  --transition: 0.2s ease;
}

[data-theme="dark"] {
  --bg: #1c1917;
  --bg-card: rgba(40,36,28,0.88);
  --bg-card-solid: #28241e;
  --bg-input: #2e2a22;
  --text: #faf7f2;
  --text-muted: #a8a29e;
  --text-faint: #78716c;
  --border: rgba(255,255,255,0.07);
  --border-solid: #3c3830;
  --topbar-bg: #211e18;
  --topbar-border: #3c3830;
  --shadow-md: 0 4px 20px rgba(0,0,0,0.3), 0 1px 4px rgba(0,0,0,0.2);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.25);
  --sidebar-bg: #111008;
}

/* ─── Reset & Base ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
}
h1,h2,h3,h4,h5 { font-family: 'Sora', sans-serif; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; outline: none; }
.hidden { display: none !important; }
img { max-width: 100%; }

/* ─── App Layout ─────────────────────────────────────────────────────────── */
#app {
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar ─────────────────────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: width 0.25s cubic-bezier(0.4,0,0.2,1);
  overflow: hidden;
}
#sidebar.collapsed { width: var(--sidebar-collapsed-w); }

.sidebar-header {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  padding: 0 18px;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.sidebar-logo-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Sora', sans-serif;
  font-weight: 800; font-size: 14px;
  color: white;
  flex-shrink: 0;
}
.sidebar-logo-text {
  font-family: 'Sora', sans-serif;
  font-weight: 700; font-size: 15px;
  color: #f9fafb;
  white-space: nowrap;
  transition: opacity 0.2s;
}
#sidebar.collapsed .sidebar-logo-text { opacity: 0; pointer-events: none; }

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

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--sidebar-text);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  margin-bottom: 2px;
  transition: background var(--transition), color var(--transition);
  position: relative;
}
.nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}
.nav-item.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
}
.nav-item svg {
  width: 18px; height: 18px;
  flex-shrink: 0;
}
.nav-label {
  transition: opacity 0.15s;
  white-space: nowrap;
}
#sidebar.collapsed .nav-label { opacity: 0; pointer-events: none; }

/* Tooltip for collapsed sidebar */
#sidebar.collapsed .nav-item::after {
  content: attr(data-label);
  position: absolute;
  left: calc(var(--sidebar-collapsed-w) + 8px);
  background: #111;
  color: #fff;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 200;
}
#sidebar.collapsed .nav-item:hover::after { opacity: 1; }

.sidebar-footer {
  padding: 12px 8px;
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.sidebar-toggle-btn {
  position: absolute;
  bottom: 80px; right: -12px;
  width: 24px; height: 24px;
  background: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white;
  box-shadow: 0 2px 8px rgba(245,158,11,0.4);
  z-index: 101;
  transition: transform var(--transition);
}
#sidebar.collapsed .sidebar-toggle-btn { transform: rotate(180deg); }

/* ─── Main Area ──────────────────────────────────────────────────────────── */
#main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left 0.25s cubic-bezier(0.4,0,0.2,1);
}
#sidebar.collapsed ~ #main { margin-left: var(--sidebar-collapsed-w); }

/* ─── Topbar ─────────────────────────────────────────────────────────────── */
#topbar {
  height: var(--topbar-h);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--topbar-border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  transition: background var(--transition), border-color var(--transition);
}
.topbar-title {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  flex: 1;
}
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.search-wrap svg {
  position: absolute;
  left: 12px;
  width: 16px; height: 16px;
  color: var(--text-faint);
}
.search-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 8px 16px 8px 36px;
  font-size: 13px;
  color: var(--text);
  width: 220px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(245,158,11,0.15); }
.search-input::placeholder { color: var(--text-faint); }

.topbar-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  background: var(--bg-input);
  border: 1px solid var(--border);
  transition: all var(--transition);
  position: relative;
}
.icon-btn:hover { background: var(--primary); color: white; border-color: var(--primary); }
.icon-btn svg { width: 18px; height: 18px; }
.notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: #ef4444;
  border-radius: 50%;
  border: 2px solid var(--topbar-bg);
}
.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 12px 4px 4px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition);
}
.user-chip:hover { border-color: var(--primary); }
.user-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px;
  color: white;
  font-family: 'Sora', sans-serif;
}
.user-name { font-size: 13px; font-weight: 600; color: var(--text); }
.role-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.role-badge.manager { background: rgba(245,158,11,0.15); color: #d97706; }
.role-badge.admin { background: rgba(251,146,60,0.15); color: #ea580c; }

/* ─── Content Area ───────────────────────────────────────────────────────── */
#content {
  flex: 1;
  padding: 28px;
  overflow-y: auto;
}

/* ─── Cards ──────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background var(--transition), border-color var(--transition);
}
.card-sm { padding: 16px; border-radius: var(--radius-sm); }

/* ─── KPI Cards ──────────────────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}
.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.kpi-icon-chip {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 4px;
  flex-shrink: 0;
}
.kpi-icon-chip svg { width: 22px; height: 22px; }
.kpi-number {
  font-family: 'Sora', sans-serif;
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
}
.kpi-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}
.kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  margin-top: 4px;
  align-self: flex-start;
}
.kpi-trend.up { background: rgba(34,197,94,0.12); color: #16a34a; }
.kpi-trend.down { background: rgba(239,68,68,0.12); color: #dc2626; }
.kpi-trend.neutral { background: rgba(107,114,128,0.12); color: #6b7280; }
.kpi-trend svg { width: 12px; height: 12px; }
.kpi-glow {
  position: absolute;
  right: -20px; bottom: -20px;
  width: 100px; height: 100px;
  border-radius: 50%;
  opacity: 0.07;
}

/* ─── Charts ─────────────────────────────────────────────────────────────── */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}
.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
}
.chart-title {
  font-family: 'Sora', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 20px;
}
.chart-wrap { position: relative; height: 220px; }

/* ─── Section Header ─────────────────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.section-title {
  font-family: 'Sora', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}
.section-sub { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: all var(--transition);
  white-space: nowrap;
  cursor: pointer;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  box-shadow: 0 4px 12px rgba(245,158,11,0.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(245,158,11,0.4); }
.btn-secondary {
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger {
  background: rgba(239,68,68,0.1);
  color: #dc2626;
  border: 1px solid rgba(239,68,68,0.2);
}
.btn-danger:hover { background: #dc2626; color: white; }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 6px 10px;
  font-size: 13px;
}
.btn-ghost:hover { color: var(--primary); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-icon { padding: 7px; }

/* ─── Tables ─────────────────────────────────────────────────────────────── */
.table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
  overflow: hidden;
}
.table-toolbar {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.table-filter {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 7px 14px 7px 36px;
  font-size: 13px;
  color: var(--text);
  width: 200px;
  position: relative;
}
.table-filter-wrap { position: relative; display: flex; align-items: center; }
.table-filter-wrap svg { position: absolute; left: 12px; width: 14px; height: 14px; color: var(--text-faint); }
.table-filter:focus { outline: none; border-color: var(--primary); }
.table-responsive { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
thead { background: rgba(245,158,11,0.04); }
th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  background: var(--bg-card);
}
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tbody tr { transition: background var(--transition); }
tbody tr:hover { background: rgba(245,158,11,0.04); }
.td-muted { color: var(--text-muted); font-size: 13px; }
.td-actions { display: flex; gap: 6px; align-items: center; }

/* ─── Status Pills ───────────────────────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  letter-spacing: 0.03em;
  text-transform: capitalize;
  white-space: nowrap;
}
.pill-dot { width: 6px; height: 6px; border-radius: 50%; }
/* Customer status */
.pill-active { background: rgba(34,197,94,0.12); color: #16a34a; }
.pill-active .pill-dot { background: #16a34a; }
.pill-inactive { background: rgba(239,68,68,0.12); color: #dc2626; }
.pill-inactive .pill-dot { background: #dc2626; }
.pill-prospect { background: rgba(245,158,11,0.12); color: #d97706; }
.pill-prospect .pill-dot { background: #d97706; }
/* Lead status */
.pill-new { background: rgba(59,130,246,0.12); color: #2563eb; }
.pill-new .pill-dot { background: #2563eb; }
.pill-contacted { background: rgba(245,158,11,0.12); color: #d97706; }
.pill-contacted .pill-dot { background: #d97706; }
.pill-qualified { background: rgba(34,197,94,0.12); color: #16a34a; }
.pill-qualified .pill-dot { background: #16a34a; }
.pill-lost { background: rgba(239,68,68,0.12); color: #dc2626; }
.pill-lost .pill-dot { background: #dc2626; }
/* Opportunity stage */
.pill-prospecting { background: rgba(99,102,241,0.12); color: #4f46e5; }
.pill-proposal { background: rgba(245,158,11,0.12); color: #d97706; }
.pill-negotiation { background: rgba(251,146,60,0.12); color: #ea580c; }
.pill-won { background: rgba(34,197,94,0.12); color: #16a34a; }
/* Activity type */
.pill-call { background: rgba(59,130,246,0.12); color: #2563eb; }
.pill-email { background: rgba(139,92,246,0.12); color: #7c3aed; }
.pill-meeting { background: rgba(245,158,11,0.12); color: #d97706; }
.pill-task { background: rgba(107,114,128,0.12); color: #4b5563; }
/* Role */
.pill-manager { background: rgba(245,158,11,0.15); color: #d97706; }
.pill-admin { background: rgba(251,146,60,0.15); color: #ea580c; }

/* ─── Modal ──────────────────────────────────────────────────────────────── */
#modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
#modal {
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn 0.2s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.94) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  padding: 24px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-family: 'Sora', sans-serif; font-size: 18px; font-weight: 700; color: var(--text); }
.modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  background: var(--bg-input);
  transition: all var(--transition);
}
.modal-close:hover { background: #fee2e2; color: #dc2626; }
.modal-close svg { width: 16px; height: 16px; }
.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 0 24px 24px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ─── Forms ──────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(245,158,11,0.15);
}
.form-control::placeholder { color: var(--text-faint); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ─── Login Page ─────────────────────────────────────────────────────────── */
#login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #1f2937 0%, #111827 40%, #92400e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}
#login-page::before {
  content: '';
  position: absolute;
  top: -50%; left: -20%;
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(245,158,11,0.18) 0%, transparent 70%);
  pointer-events: none;
}
#login-page::after {
  content: '';
  position: absolute;
  bottom: -30%; right: -10%;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(251,146,60,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.login-card {
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 24px;
  padding: 48px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 32px 64px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.1);
  position: relative;
  z-index: 1;
}
.login-logo {
  width: 52px; height: 52px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Sora', sans-serif;
  font-weight: 800; font-size: 18px;
  color: white;
  margin-bottom: 24px;
  box-shadow: 0 8px 24px rgba(245,158,11,0.4);
}
.login-title {
  font-family: 'Sora', sans-serif;
  font-size: 26px;
  font-weight: 800;
  color: white;
  margin-bottom: 4px;
}
.login-sub { font-size: 14px; color: rgba(255,255,255,0.5); margin-bottom: 32px; }
.login-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.75);
  margin-bottom: 6px;
}
.login-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255,255,255,0.08);
  border: 1.5px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  font-size: 14px;
  color: white;
  margin-bottom: 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.login-input::placeholder { color: rgba(255,255,255,0.3); }
.login-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(245,158,11,0.2); }
.login-btn {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  font-weight: 700;
  font-size: 15px;
  border-radius: 10px;
  margin-top: 8px;
  box-shadow: 0 8px 24px rgba(245,158,11,0.35);
  transition: all 0.2s;
}
.login-btn:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(245,158,11,0.45); }
.login-btn:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }
.login-error {
  background: rgba(239,68,68,0.15);
  border: 1px solid rgba(239,68,68,0.3);
  color: #fca5a5;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-top: 16px;
}

/* ─── Toast ──────────────────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
  max-width: 320px;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}
.toast-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.toast-error   { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.toast-info    { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.toast svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ─── Empty State ────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}
.empty-state svg { width: 48px; height: 48px; margin: 0 auto 16px; opacity: 0.4; }
.empty-state h3 { font-family: 'Sora', sans-serif; font-size: 16px; margin-bottom: 6px; color: var(--text); }
.empty-state p { font-size: 13px; }

/* ─── Loading ────────────────────────────────────────────────────────────── */
.loader {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  color: var(--primary);
}
.spinner {
  width: 32px; height: 32px;
  border: 3px solid rgba(245,158,11,0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Profile Page ───────────────────────────────────────────────────────── */
.profile-header {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 32px;
}
.profile-avatar-lg {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex; align-items: center; justify-content: center;
  font-family: 'Sora', sans-serif;
  font-weight: 800; font-size: 30px;
  color: white;
  box-shadow: 0 8px 24px rgba(245,158,11,0.3);
  flex-shrink: 0;
}
.profile-info h2 { font-family: 'Sora', sans-serif; font-size: 22px; font-weight: 800; }
.profile-info p { color: var(--text-muted); margin-top: 4px; }

/* ─── Dashboard grid ─────────────────────────────────────────────────────── */
.dashboard-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.recent-list { list-style: none; }
.recent-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.recent-item:last-child { border-bottom: none; }
.recent-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.recent-icon svg { width: 16px; height: 16px; }

/* ─── Checkbox ───────────────────────────────────────────────────────────── */
.check-toggle {
  width: 18px; height: 18px;
  border-radius: 4px;
  border: 2px solid var(--border-solid);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}
.check-toggle.checked { background: #16a34a; border-color: #16a34a; }
.check-toggle.checked::after {
  content: '';
  width: 5px; height: 9px;
  border: 2px solid white;
  border-top: none; border-left: none;
  transform: rotate(45deg) translate(-1px,-1px);
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  #sidebar { width: var(--sidebar-collapsed-w); }
  #sidebar .sidebar-logo-text,
  #sidebar .nav-label,
  #sidebar .nav-section-label { opacity: 0; }
  #main { margin-left: var(--sidebar-collapsed-w); }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-bottom { grid-template-columns: 1fr; }
  .charts-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  #content { padding: 16px; }
  .login-card { padding: 32px 24px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}
