/* ═══════════════════════════════════════════════════════════
   PermiGO — Ultra Modern SaaS CSS
   Futuristic · Clean · Professional
═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── CSS Variables ──────────────────────────────────────── */
:root {
  /* Brand */
  --blue-50:  #eff6ff;
  --blue-100: #dbeafe;
  --blue-200: #bfdbfe;
  --blue-400: #60a5fa;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --blue-800: #1e40af;
  --blue-900: #1e3a8a;

  --indigo-500: #6366f1;
  --indigo-600: #4f46e5;

  --cyan-400: #22d3ee;
  --cyan-500: #06b6d4;

  /* Gradients */
  --grad-primary: linear-gradient(135deg, #2563eb 0%, #4f46e5 50%, #06b6d4 100%);
  --grad-card:    linear-gradient(135deg, rgba(37,99,235,0.08) 0%, rgba(79,70,229,0.04) 100%);
  --grad-success: linear-gradient(135deg, #10b981, #059669);
  --grad-warning: linear-gradient(135deg, #f59e0b, #d97706);
  --grad-danger:  linear-gradient(135deg, #ef4444, #dc2626);

  /* Neutrals */
  --white: #ffffff;
  --gray-50:  #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  /* Semantic */
  --bg-primary:   #f8fafc;
  --bg-secondary: #ffffff;
  --text-primary:   #0f172a;
  --text-secondary: #475569;
  --text-muted:     #94a3b8;
  --border-color: #e2e8f0;
  --border-focus: #3b82f6;

  /* Sidebar */
  --sidebar-width: 260px;
  --sidebar-bg: #0f172a;
  --sidebar-text: rgba(255,255,255,0.75);
  --sidebar-active: #3b82f6;

  /* Effects */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
  --shadow-lg:  0 20px 40px rgba(0,0,0,0.1), 0 8px 20px rgba(0,0,0,0.06);
  --shadow-xl:  0 40px 80px rgba(0,0,0,0.12);
  --shadow-blue: 0 8px 30px rgba(37,99,235,0.25);
  --shadow-glow: 0 0 30px rgba(37,99,235,0.15);

  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --radius-xl:  24px;
  --radius-full: 9999px;

  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Dark Mode ──────────────────────────────────────────── */
[data-theme="dark"] {
  --bg-primary:     #070b14;
  --bg-secondary:   #0f172a;
  --text-primary:   #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted:     #475569;
  --border-color:   #1e293b;
  --gray-50:  #0f172a;
  --gray-100: #1e293b;
  --gray-200: #334155;
  --white:    #1e293b;
}

/* ── Reset & Base ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Sora', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ═══════════════════════════════════════════════════════
   LAYOUT
═══════════════════════════════════════════════════════ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: var(--transition);
  overflow: hidden;
}

.sidebar::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 1px; height: 100%;
  background: linear-gradient(to bottom, transparent, rgba(99,102,241,0.5), transparent);
}

.sidebar-logo {
  padding: 28px 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-logo .logo-mark {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 36px; height: 36px;
  background: var(--grad-primary);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(37,99,235,0.4);
}

.logo-text {
  font-size: 1.4rem;
  font-weight: 800;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.sidebar-agency {
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.agency-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}

.agency-avatar {
  width: 32px; height: 32px;
  background: var(--grad-primary);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.agency-info { overflow: hidden; }
.agency-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.agency-plan {
  font-size: 0.65rem;
  color: var(--cyan-400);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.nav-section {
  padding: 8px 12px 4px;
}

.nav-section-label {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.25);
  padding: 0 12px;
  margin-bottom: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  color: var(--sidebar-text);
  font-size: 0.82rem;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
  cursor: pointer;
  margin: 1px 0;
}

.nav-item:hover {
  background: rgba(255,255,255,0.07);
  color: white;
}

.nav-item.active {
  background: rgba(59,130,246,0.15);
  color: white;
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--blue-500);
  border-radius: 0 3px 3px 0;
}

.nav-item .nav-icon {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  font-size: 15px;
  flex-shrink: 0;
  transition: var(--transition);
}

.nav-item.active .nav-icon {
  background: rgba(59,130,246,0.2);
}

.nav-item .nav-badge {
  margin-left: auto;
  background: var(--blue-500);
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  min-width: 18px;
  text-align: center;
}

.sidebar-bottom {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  transition: var(--transition);
  cursor: pointer;
}

.sidebar-user:hover { background: rgba(255,255,255,0.06); }

.user-avatar {
  width: 32px; height: 32px;
  background: var(--grad-primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.user-info .user-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
}

.user-info .user-role {
  font-size: 0.65rem;
  color: var(--sidebar-text);
  text-transform: capitalize;
}

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

/* ── Top Bar ────────────────────────────────────────────── */
.topbar {
  height: 64px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 32px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(20px);
  background: rgba(255,255,255,0.9);
}

[data-theme="dark"] .topbar {
  background: rgba(15,23,42,0.9);
}

.topbar-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.topbar-search {
  flex: 1;
  max-width: 360px;
  position: relative;
}

.topbar-search input {
  width: 100%;
  padding: 8px 16px 8px 40px;
  background: var(--gray-100);
  border: 1.5px solid transparent;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  color: var(--text-primary);
  transition: var(--transition);
}

.topbar-search input:focus {
  outline: none;
  background: white;
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.topbar-search .search-icon {
  position: absolute;
  left: 13px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
}

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

.topbar-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  transition: var(--transition);
  position: relative;
  font-size: 16px;
}

.topbar-btn:hover {
  background: var(--gray-100);
  color: var(--text-primary);
}

.notif-dot {
  position: absolute;
  top: 4px; right: 4px;
  width: 8px; height: 8px;
  background: var(--blue-500);
  border-radius: 50%;
  border: 2px solid var(--bg-secondary);
}

/* ── Page Content ───────────────────────────────────────── */
.page-content {
  padding: 32px;
  flex: 1;
}

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

.page-header h1 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.page-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════
   COMPONENTS
═══════════════════════════════════════════════════════ */

/* ── Cards ─────────────────────────────────────────────── */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-glass {
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

[data-theme="dark"] .card-glass {
  background: rgba(15,23,42,0.7);
  border-color: rgba(255,255,255,0.1);
}

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

.card-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* ── Stat Cards ─────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition-spring);
  cursor: default;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  background: var(--stat-color, var(--blue-500));
  opacity: 0.04;
  border-radius: 50%;
  transform: translate(20px, -20px);
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--stat-color, var(--blue-500));
}

.stat-icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  background: var(--stat-bg, var(--blue-50));
  color: var(--stat-color, var(--blue-600));
}

.stat-info .stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.stat-info .stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -1px;
  line-height: 1;
}

.stat-info .stat-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.stat-trend {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.stat-trend.up { background: #dcfce7; color: #15803d; }
.stat-trend.down { background: #fee2e2; color: #dc2626; }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  white-space: nowrap;
  text-decoration: none;
  font-family: 'Sora', sans-serif;
}

.btn-primary {
  background: var(--grad-primary);
  color: white;
  box-shadow: 0 4px 14px rgba(37,99,235,0.25);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(37,99,235,0.35);
}

.btn-secondary {
  background: var(--gray-100);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--gray-200);
}

.btn-danger {
  background: var(--grad-danger);
  color: white;
  box-shadow: 0 4px 14px rgba(239,68,68,0.2);
}

.btn-success {
  background: var(--grad-success);
  color: white;
  box-shadow: 0 4px 14px rgba(16,185,129,0.2);
}

.btn-warning {
  background: var(--grad-warning);
  color: white;
}

.btn-outline {
  background: transparent;
  color: var(--blue-600);
  border: 1.5px solid var(--blue-600);
}

.btn-outline:hover {
  background: var(--blue-50);
}

.btn-sm { padding: 6px 12px; font-size: 0.75rem; }
.btn-lg { padding: 13px 28px; font-size: 0.9rem; }
.btn-icon { padding: 8px; width: 36px; height: 36px; justify-content: center; border-radius: var(--radius-md); }

/* ── Badges ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: capitalize;
}

.badge-blue    { background: #dbeafe; color: #1d4ed8; }
.badge-green   { background: #dcfce7; color: #15803d; }
.badge-yellow  { background: #fef9c3; color: #854d0e; }
.badge-red     { background: #fee2e2; color: #991b1b; }
.badge-gray    { background: var(--gray-100); color: var(--gray-600); }
.badge-purple  { background: #ede9fe; color: #6d28d9; }
.badge-cyan    { background: #cffafe; color: #155e75; }
.badge-orange  { background: #ffedd5; color: #9a3412; }

/* ── Forms ──────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-primary);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: var(--text-primary);
  transition: var(--transition);
  appearance: none;
}

.form-control:focus {
  outline: none;
  border-color: var(--blue-500);
  background: white;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.form-control::placeholder { color: var(--text-muted); }

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 36px;
  cursor: pointer;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

/* ── Tables ─────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
}

.table thead tr {
  background: var(--gray-50);
  border-bottom: 1px solid var(--border-color);
}

.table thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  white-space: nowrap;
}

.table tbody tr {
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

.table tbody tr:last-child { border-bottom: none; }
.table tbody tr:hover { background: var(--gray-50); }

.table td {
  padding: 14px 16px;
  color: var(--text-primary);
  vertical-align: middle;
}

.table .td-mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.table .td-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

/* ── Alerts ─────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-size: 0.83rem;
  margin-bottom: 16px;
}

.alert-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }
.alert-danger  { background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; }
.alert-warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.alert-info    { background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8; }

/* ── Modal ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-secondary);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 600px;
  box-shadow: var(--shadow-xl);
  transform: scale(0.95) translateY(10px);
  transition: var(--transition-spring);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--border-color);
}

.modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  width: 32px; height: 32px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: var(--transition);
  font-size: 18px;
}

.modal-close:hover {
  background: var(--gray-100);
  color: var(--text-primary);
}

.modal-body { padding: 24px 28px; }
.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 20px 28px 24px;
  border-top: 1px solid var(--border-color);
}

/* ── Tabs ───────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 2px;
  background: var(--gray-100);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 24px;
}

.tab-btn {
  flex: 1;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition);
  text-align: center;
  cursor: pointer;
}

.tab-btn.active {
  background: white;
  color: var(--blue-600);
  box-shadow: var(--shadow-sm);
}

/* ── Search & Filters ───────────────────────────────────── */
.filters-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-box input {
  width: 100%;
  padding: 9px 14px 9px 38px;
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.83rem;
  color: var(--text-primary);
  transition: var(--transition);
}

.search-box input:focus {
  outline: none;
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.search-box .icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 15px;
}

/* ── Chart Container ────────────────────────────────────── */
.chart-container {
  position: relative;
  height: 280px;
}

/* ── Progress Bar ───────────────────────────────────────── */
.progress {
  height: 8px;
  background: var(--gray-100);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--grad-primary);
  transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
}

/* ── Avatar ─────────────────────────────────────────────── */
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 700;
  background: var(--grad-primary);
  color: white;
  flex-shrink: 0;
}

.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-lg { width: 48px; height: 48px; font-size: 16px; }
.avatar-xl { width: 72px; height: 72px; font-size: 24px; }

/* ── Dropdown ───────────────────────────────────────────── */
.dropdown { position: relative; display: inline-block; }

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: var(--transition);
  overflow: hidden;
}

.dropdown:hover .dropdown-menu,
.dropdown.active .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 0.82rem;
  color: var(--text-primary);
  transition: var(--transition);
  cursor: pointer;
}

.dropdown-item:hover { background: var(--gray-50); }
.dropdown-item.danger { color: #dc2626; }
.dropdown-divider { height: 1px; background: var(--border-color); }

/* ── Empty State ────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.empty-icon {
  width: 64px; height: 64px;
  background: var(--gray-100);
  border-radius: var(--radius-xl);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 0.83rem;
  color: var(--text-muted);
  max-width: 280px;
  margin-bottom: 20px;
}

/* ── Calendar ───────────────────────────────────────────── */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-day-header {
  text-align: center;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 6px 0;
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.cal-day:hover { background: var(--gray-100); }
.cal-day.today {
  background: var(--blue-600);
  color: white;
  font-weight: 700;
}

.cal-day.has-event::after {
  content: '';
  position: absolute;
  bottom: 3px;
  width: 4px; height: 4px;
  background: var(--blue-500);
  border-radius: 50%;
}

.cal-day.today.has-event::after { background: white; }
.cal-day.other-month { color: var(--gray-300); }

/* ── Notification Panel ─────────────────────────────────── */
.notif-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 340px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: 200;
  display: none;
}

.notif-panel.active { display: block; }

.notif-item {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
  cursor: pointer;
}

.notif-item:hover { background: var(--gray-50); }
.notif-item:last-child { border-bottom: none; }

.notif-dot-indicator {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 6px;
}

/* ── Vehicle Status Cards ───────────────────────────────── */
.vehicle-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.available  { background: #10b981; }
.status-dot.busy       { background: #f59e0b; }
.status-dot.maintenance { background: #ef4444; }

/* ── Quick Actions ──────────────────────────────────────── */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.quick-action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: var(--transition-spring);
  text-decoration: none;
  color: var(--text-primary);
  text-align: center;
}

.quick-action-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--blue-300);
}

.quick-action-icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  background: var(--blue-50);
}

.quick-action-label {
  font-size: 0.78rem;
  font-weight: 600;
}

/* ── Recent Activity ────────────────────────────────────── */
.activity-list { display: flex; flex-direction: column; gap: 1px; }

.activity-item {
  display: flex;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
  align-items: flex-start;
}

.activity-item:last-child { border-bottom: none; }

.activity-icon {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.activity-content .activity-text {
  font-size: 0.82rem;
  color: var(--text-primary);
  line-height: 1.4;
}

.activity-content .activity-time {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ═══════════════════════════════════════════════════════
   AUTH PAGES
═══════════════════════════════════════════════════════ */
.auth-container {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.auth-left {
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px;
  position: relative;
  overflow: hidden;
}

.auth-left::before {
  content: '';
  position: absolute;
  top: -100px; left: -100px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(37,99,235,0.2) 0%, transparent 70%);
}

.auth-left::after {
  content: '';
  position: absolute;
  bottom: -100px; right: -100px;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(6,182,212,0.15) 0%, transparent 70%);
}

.auth-hero { position: relative; z-index: 1; text-align: center; }

.auth-hero-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 48px;
}

.auth-hero-icon {
  width: 52px; height: 52px;
  background: var(--grad-primary);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  box-shadow: 0 8px 30px rgba(37,99,235,0.4);
}

.auth-hero-name {
  font-size: 2rem;
  font-weight: 800;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-features { list-style: none; text-align: left; }
.auth-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
}

.auth-features li span:first-child {
  font-size: 18px;
}

.auth-right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  background: var(--bg-secondary);
}

.auth-form-box {
  width: 100%;
  max-width: 400px;
}

.auth-form-title {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}

.auth-form-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 32px;
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .form-grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .page-content { padding: 20px 16px; }
  .auth-container { grid-template-columns: 1fr; }
  .auth-left { display: none; }
  .auth-right { padding: 32px 24px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid-3 { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .filters-bar { flex-direction: column; align-items: stretch; }
  .topbar { padding: 0 16px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
}

/* ── Utilities ──────────────────────────────────────────── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.w-full { width: 100%; }
.text-sm { font-size: 0.82rem; }
.text-xs { font-size: 0.72rem; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--blue-600); }
.text-success { color: #15803d; }
.text-danger { color: #dc2626; }
.font-bold { font-weight: 700; }
.font-mono { font-family: 'JetBrains Mono', monospace; }
.text-right { text-align: right; }
.rounded-full { border-radius: var(--radius-full); }

/* ── Animations ─────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.05); }
}

@keyframes spin { to { transform: rotate(360deg); } }

.animate-fade { animation: fadeIn 0.4s ease forwards; }
.animate-pulse { animation: pulse 2s ease infinite; }

.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 0%, var(--gray-200) 50%, var(--gray-100) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

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

/* ── Mobile Toggle ──────────────────────────────────────── */
.mobile-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  font-size: 18px;
  color: var(--text-primary);
}

.mobile-menu-toggle:hover { background: var(--gray-100); }

@media (max-width: 1024px) {
  .mobile-menu-toggle { display: flex; }
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
  backdrop-filter: blur(2px);
}

.sidebar-overlay.active { display: block; }
