@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=IBM+Plex+Sans:wght@300;400;500;600&display=swap');

/* ══════════════════════════════════════════
   CSS CUSTOM PROPERTIES
══════════════════════════════════════════ */
:root {
  /* Dark theme (default) */
  --bg-primary: #0a0e17;
  --bg-secondary: #0f172a;
  --bg-card: #131c2e;
  --bg-card-hover: #1a2744;
  --bg-glass: rgba(19, 28, 46, 0.85);
  --border: rgba(59, 130, 246, 0.15);
  --border-hover: rgba(59, 130, 246, 0.4);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent: #3b82f6;
  --accent-light: #60a5fa;
  --accent-glow: rgba(59, 130, 246, 0.3);
  --accent-dim: rgba(59, 130, 246, 0.1);

  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.1);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.1);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.1);
  --info: #06b6d4;
  --info-bg: rgba(6, 182, 212, 0.1);

  --nav-bg: rgba(10, 14, 23, 0.95);
  --nav-border: rgba(59, 130, 246, 0.12);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.5);
  --glow: 0 0 20px rgba(59, 130, 246, 0.2);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --transition: 0.2s ease;
}

html[data-theme="light"] {
  --bg-primary: #f1f5f9;
  --bg-secondary: #e2e8f0;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-glass: rgba(255, 255, 255, 0.9);
  --border: rgba(59, 130, 246, 0.15);
  --border-hover: rgba(59, 130, 246, 0.4);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  --accent: #2563eb;
  --accent-light: #3b82f6;
  --accent-glow: rgba(37, 99, 235, 0.2);
  --accent-dim: rgba(37, 99, 235, 0.08);

  --success: #059669;
  --success-bg: rgba(5, 150, 105, 0.08);
  --warning: #d97706;
  --warning-bg: rgba(217, 119, 6, 0.08);
  --danger: #dc2626;
  --danger-bg: rgba(220, 38, 38, 0.08);
  --info: #0891b2;
  --info-bg: rgba(8, 145, 178, 0.08);

  --nav-bg: rgba(255, 255, 255, 0.95);
  --nav-border: rgba(59, 130, 246, 0.12);
  --shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
  --shadow-card: 0 8px 32px rgba(15, 23, 42, 0.1);
  --glow: 0 0 20px rgba(59, 130, 246, 0.1);
}

/* ══════════════════════════════════════════
   RESET & BASE
══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  transition: background 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

/* Background texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(59, 130, 246, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 40% 30% at 90% 80%, rgba(99, 102, 241, 0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.page-wrapper { position: relative; z-index: 1; }

h1, h2, h3, h4, h5, h6 {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-primary);
}

a { color: var(--accent-light); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent); }

/* ══════════════════════════════════════════
   NAVIGATION
══════════════════════════════════════════ */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: background 0.3s ease;
}

.nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 0;
  height: 60px;
}

.nav-logo {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-right: 2rem;
  white-space: nowrap;
}

.nav-logo-icon {
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: 0 0 12px var(--accent-glow);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;          /* Firefox: прячем полосу прокрутки */
  -ms-overflow-style: none;       /* старый Edge */
  list-style: none;
}
.nav-links::-webkit-scrollbar { display: none; }  /* WebKit: прячем полосу */

.nav-link {
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition);
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
  background: var(--accent-dim);
}

.nav-link.admin-only {
  color: var(--warning);
  opacity: 0.8;
}
.nav-link.admin-only:hover { opacity: 1; background: var(--warning-bg); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
  flex-shrink: 0;   /* кнопка профиля/тема всегда видны, не вытесняются ссылками */
}

.theme-toggle {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  font-size: 1rem;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

.user-menu { position: relative; }

.user-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  background: var(--accent-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  cursor: pointer;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition);
}
.user-btn:hover { border-color: var(--accent); background: var(--accent-dim); }

.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: 'Rajdhani', sans-serif;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
  z-index: 200;
}

.user-menu:hover .user-dropdown,
.user-menu.open .user-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 1rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
  transition: all var(--transition);
}
.dropdown-item:hover { background: var(--accent-dim); color: var(--text-primary); }
.dropdown-item.danger:hover { background: var(--danger-bg); color: var(--danger); }
.dropdown-sep { height: 1px; background: var(--border); margin: 0.25rem 0; }

/* Admin nav dropdown — groups admin-only links so the top nav never overflows */
.nav-dropdown { position: relative; }

.nav-dropdown-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
  z-index: 200;
}

.nav-dropdown:hover .nav-dropdown-panel,
.nav-dropdown.open .nav-dropdown-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  padding: 6px;
  margin-left: auto;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: all 0.3s;
}

/* ══════════════════════════════════════════
   LAYOUT
══════════════════════════════════════════ */
.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.page-title span {
  color: var(--accent-light);
}

/* ══════════════════════════════════════════
   CARDS
══════════════════════════════════════════ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-card), var(--glow);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.875rem;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* ══════════════════════════════════════════
   CAR DASHBOARD CARDS
══════════════════════════════════════════ */
.cars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.5rem;
}

.car-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: all 0.3s ease;
  position: relative;
}

.car-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  opacity: 0;
  transition: opacity 0.3s;
}

.car-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-card), var(--glow);
}

.car-card:hover::before { opacity: 1; }

/* Health-state gradients — двойной селектор даёт приоритет над .car-card::before */
.car-card.car-card--health-good {
  border-color: rgba(16, 185, 129, 0.25);
  box-shadow: var(--shadow-card), 0 0 24px rgba(16, 185, 129, 0.08);
}
.car-card.car-card--health-good::before {
  opacity: 1;
  background: linear-gradient(90deg, var(--success), #34d399);
}
.car-card.car-card--health-good:hover {
  border-color: rgba(16, 185, 129, 0.5);
  box-shadow: var(--shadow-card), 0 0 32px rgba(16, 185, 129, 0.18);
}

.car-card.car-card--health-warn {
  border-color: rgba(245, 158, 11, 0.28);
  box-shadow: var(--shadow-card), 0 0 24px rgba(245, 158, 11, 0.08);
}
.car-card.car-card--health-warn::before {
  opacity: 1;
  background: linear-gradient(90deg, var(--warning), #fbbf24);
}
.car-card.car-card--health-warn:hover {
  border-color: rgba(245, 158, 11, 0.55);
  box-shadow: var(--shadow-card), 0 0 32px rgba(245, 158, 11, 0.18);
}

.car-card.car-card--health-danger {
  border-color: rgba(239, 68, 68, 0.28);
  box-shadow: var(--shadow-card), 0 0 24px rgba(239, 68, 68, 0.08);
}
.car-card.car-card--health-danger::before {
  opacity: 1;
  background: linear-gradient(90deg, var(--danger), #f87171);
}
.car-card.car-card--health-danger:hover {
  border-color: rgba(239, 68, 68, 0.55);
  box-shadow: var(--shadow-card), 0 0 32px rgba(239, 68, 68, 0.18);
}

.car-card-photo {
  position: relative;
  height: 180px;
  overflow: hidden;
  background: var(--bg-secondary);
}

.car-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.car-card:hover .car-card-photo img { transform: scale(1.04); }

.car-card-photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card));
}

.car-photo-icon {
  font-size: 4rem;
  opacity: 0.2;
}

.car-online-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 0.75rem;
  color: var(--success);
  display: flex;
  align-items: center;
  gap: 5px;
  backdrop-filter: blur(8px);
}

.online-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.8); }
}

.car-card-body {
  padding: 1.25rem;
}

.car-card-name {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 0.2rem;
}

.car-card-plate {
  font-family: 'IBM Plex Sans', monospace;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 1rem;
}

.car-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.car-stat {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
}

.car-stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.car-stat-value {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.car-stat-value.warning { color: var(--warning); }
.car-stat-value.danger { color: var(--danger); }
.car-stat-value.success { color: var(--success); }

/* Health Meter */
.health-section {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  transition: background 0.3s, border-color 0.3s;
}

.car-card.car-card--health-good .health-section {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(16, 185, 129, 0.04));
  border-color: rgba(16, 185, 129, 0.3);
}
.car-card.car-card--health-warn .health-section {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(245, 158, 11, 0.04));
  border-color: rgba(245, 158, 11, 0.3);
}
.car-card.car-card--health-danger .health-section {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.14), rgba(239, 68, 68, 0.04));
  border-color: rgba(239, 68, 68, 0.3);
}

.health-circle {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

.health-svg {
  width: 56px;
  height: 56px;
  transform: rotate(-90deg);
}

.health-track {
  fill: none;
  stroke: var(--border);
  stroke-width: 4;
}

.health-bar {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.health-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.875rem;
  font-weight: 700;
}

.health-info { flex: 1; }
.health-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.health-status {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1rem;
  font-weight: 600;
}

.due-reminders {
  margin-bottom: 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.due-reminder-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
}

[data-theme="light"] .due-reminder-item {
  background: rgba(239, 68, 68, 0.07);
  border-color: rgba(239, 68, 68, 0.25);
}

.due-reminder-icon { flex-shrink: 0; font-size: 0.85rem; }

.due-reminder-text { flex: 1; color: var(--text); }

.due-reminder-link {
  flex-shrink: 0;
  color: var(--danger);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.75rem;
  padding: 2px 8px;
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.due-reminder-link:hover { background: var(--danger); color: #fff; }

.car-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.625rem;
}

/* ══════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}
.btn-primary:hover {
  background: var(--accent-light);
  border-color: var(--accent-light);
  box-shadow: 0 0 20px var(--accent-glow);
  color: white;
}

.btn-outline {
  background: transparent;
  color: var(--accent-light);
  border-color: var(--border-hover);
}
.btn-outline:hover {
  background: var(--accent-dim);
  border-color: var(--accent-light);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--bg-secondary); color: var(--text-primary); }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.3);
}
.btn-danger:hover { background: var(--danger-bg); border-color: var(--danger); }

.btn-success {
  background: var(--success);
  color: white;
  border-color: var(--success);
}
.btn-success:hover { filter: brightness(1.1); }

.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 1rem; }
.btn-full { width: 100%; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ══════════════════════════════════════════
   FORMS
══════════════════════════════════════════ */
.form-group { margin-bottom: 1.25rem; }

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.form-control {
  width: 100%;
  padding: 0.6rem 0.875rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  -webkit-appearance: none;
}

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-control::placeholder { color: var(--text-muted); }

select.form-control { cursor: pointer; }
textarea.form-control { min-height: 100px; resize: vertical; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.form-grid-2 { grid-template-columns: 1fr 1fr; }
.form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }

/* Checkbox */
.form-check {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-secondary);
}

.form-check:hover { border-color: var(--accent); background: var(--accent-dim); }
.form-check input[type="checkbox"] { display: none; }

.check-box {
  width: 18px;
  height: 18px;
  min-width: 18px;
  border: 2px solid var(--border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  margin-top: 1px;
}

.form-check input:checked ~ .check-box,
.form-check.checked .check-box {
  background: var(--accent);
  border-color: var(--accent);
}

.check-box-icon { display: none; color: white; font-size: 0.7rem; }
.form-check.checked .check-box-icon { display: block; }

.check-label { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.4; }
.check-label strong { color: var(--text-primary); display: block; }
.check-sub { font-size: 0.75rem; color: var(--text-muted); }

/* File upload */
.file-upload {
  display: block;
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-secondary);
  width: 100%;
  box-sizing: border-box;
}
.file-upload:hover { border-color: var(--accent); background: var(--accent-dim); }
.file-upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-upload-icon { font-size: 2rem; margin-bottom: 0.5rem; opacity: 0.4; }
.file-upload-text { font-size: 0.875rem; color: var(--text-muted); }

/* ══════════════════════════════════════════
   TABLE
══════════════════════════════════════════ */
.table-wrapper { overflow-x: auto; border-radius: var(--radius); }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.table th {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: var(--bg-secondary);
}

.table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: middle;
}

.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background var(--transition); }
.table tbody tr:hover td { background: var(--accent-dim); color: var(--text-primary); }

/* ══════════════════════════════════════════
   BADGES
══════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.625rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}

.badge-success { background: var(--success-bg); color: var(--success); border-color: rgba(16, 185, 129, 0.2); }
.badge-warning { background: var(--warning-bg); color: var(--warning); border-color: rgba(245, 158, 11, 0.2); }
.badge-danger { background: var(--danger-bg); color: var(--danger); border-color: rgba(239, 68, 68, 0.2); }
.badge-info { background: var(--info-bg); color: var(--info); border-color: rgba(6, 182, 212, 0.2); }
.badge-muted { background: var(--bg-secondary); color: var(--text-muted); border-color: var(--border); }
.badge-accent { background: var(--accent-dim); color: var(--accent-light); border-color: var(--border-hover); }

/* ══════════════════════════════════════════
   FLASH MESSAGES
══════════════════════════════════════════ */
.flash-container {
  position: fixed;
  top: 72px;
  right: 1.5rem;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  max-width: 380px;
  width: calc(100vw - 3rem);
}

.flash {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius);
  border-left: 3px solid;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-card);
  animation: flash-in 0.3s ease;
}

@keyframes flash-in {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.flash-success { background: var(--success-bg); border-color: var(--success); color: var(--success); }
.flash-error { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); }
.flash-warning { background: var(--warning-bg); border-color: var(--warning); color: var(--warning); }
.flash-info { background: var(--info-bg); border-color: var(--info); color: var(--info); }

.flash-text { flex: 1; font-size: 0.875rem; color: var(--text-primary); }
.flash-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 1rem; padding: 0;
  transition: color var(--transition);
}
.flash-close:hover { color: var(--text-primary); }

/* ══════════════════════════════════════════
   EMPTY STATES
══════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}

.empty-state-icon { font-size: 3.5rem; margin-bottom: 1rem; opacity: 0.3; }
.empty-state h3 { font-size: 1.25rem; color: var(--text-secondary); margin-bottom: 0.5rem; }
.empty-state p { font-size: 0.875rem; margin-bottom: 1.5rem; }

/* ══════════════════════════════════════════
   STATS ROW
══════════════════════════════════════════ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: all var(--transition);
}

.stat-card:hover { border-color: var(--border-hover); }

.stat-number {
  font-family: 'Rajdhani', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-light);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

/* ══════════════════════════════════════════
   LOGIN PAGE
══════════════════════════════════════════ */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: var(--bg-primary);
  position: relative;
}

.login-wrapper::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 60% at 30% 40%, rgba(59, 130, 246, 0.1) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 70% 70%, rgba(99, 102, 241, 0.08) 0%, transparent 50%);
  pointer-events: none;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-card), 0 0 60px rgba(59, 130, 246, 0.1);
  position: relative;
  z-index: 1;
  animation: login-appear 0.5s ease;
}

@keyframes login-appear {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 1rem;
  box-shadow: 0 0 30px var(--accent-glow);
}

.login-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.login-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ══════════════════════════════════════════
   WAREHOUSE
══════════════════════════════════════════ */
.warehouse-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.warehouse-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  position: sticky;
  top: 80px;
}

.category-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 0.875rem;
  color: var(--text-secondary);
}
.category-item:hover, .category-item.active {
  background: var(--accent-dim);
  color: var(--text-primary);
}

.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.item-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  transition: all var(--transition);
}
.item-card:hover { border-color: var(--border-hover); }
.item-card.low-stock { border-color: rgba(245, 158, 11, 0.3); }

.item-name { font-weight: 500; color: var(--text-primary); margin-bottom: 0.25rem; }
.item-qty {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-light);
}
.item-unit { font-size: 0.75rem; color: var(--text-muted); margin-left: 0.25rem; }

/* ══════════════════════════════════════════
   MAINTENANCE FORM
══════════════════════════════════════════ */
.actions-group { margin-bottom: 1.5rem; }
.actions-group-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-light);
  padding: 0.5rem 0;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.actions-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.625rem;
}

.writeoff-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.writeoff-qty-input {
  width: 80px;
  padding: 0.35rem 0.5rem;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-primary);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.875rem;
}

/* ══════════════════════════════════════════
   STARLINE DASHBOARD
══════════════════════════════════════════ */
.starline-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.starline-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

.starline-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.5;
}

.starline-metric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}
.starline-metric:last-child { border-bottom: none; }
.starline-metric-label { color: var(--text-muted); }
.starline-metric-value { font-weight: 600; color: var(--text-primary); font-family: 'Rajdhani', sans-serif; font-size: 1rem; }

/* ══════════════════════════════════════════
   ADMIN PANEL
══════════════════════════════════════════ */
.admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.5rem;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--warning);
}

/* ══════════════════════════════════════════
   PROGRESS BAR
══════════════════════════════════════════ */
.progress { background: var(--bg-secondary); border-radius: 4px; height: 6px; overflow: hidden; }
.progress-bar {
  height: 100%;
  border-radius: 4px;
  background: var(--accent);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.progress-bar.warning { background: var(--warning); }
.progress-bar.danger { background: var(--danger); }
.progress-bar.success { background: var(--success); }

/* ══════════════════════════════════════════
   SECTION TABS
══════════════════════════════════════════ */
.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.tab-btn {
  padding: 0.625rem 1rem;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--accent-light); border-bottom-color: var(--accent); }

/* ══════════════════════════════════════════
   MODAL
══════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}
.modal-overlay.open { opacity: 1; visibility: visible; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-card);
  transform: scale(0.95);
  transition: transform 0.2s ease;
}
.modal-overlay.open .modal { transform: scale(1); }

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
}
.modal-body { padding: 1.5rem; }
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 1024px) {
  .warehouse-layout { grid-template-columns: 1fr; }
  .warehouse-sidebar { position: static; }
}

@media (max-width: 768px) {
  .nav-links { display: none; position: absolute; top: 60px; left: 0; right: 0; flex-direction: column; padding: 0.75rem; background: var(--nav-bg); border-bottom: 1px solid var(--nav-border); backdrop-filter: blur(16px); gap: 0.25rem; }
  .nav-links.open { display: flex; }
  .nav-toggle { display: flex; }
  .nav-inner { position: relative; flex-wrap: wrap; }

  .cars-grid { grid-template-columns: 1fr; }
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .main-content { padding: 1rem; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .login-card { padding: 1.75rem; }
  .car-stats { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr; }
  .car-card-actions { grid-template-columns: 1fr; }
  .actions-list { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════
   UTILS
══════════════════════════════════════════ */
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-accent { color: var(--accent-light); }
.text-sm { font-size: 0.8125rem; }
.text-xs { font-size: 0.75rem; }
.font-mono { font-family: 'IBM Plex Sans', monospace; }
.font-heading { font-family: 'Rajdhani', sans-serif; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.flex-wrap { flex-wrap: wrap; }

.divider { height: 1px; background: var(--border); margin: 1.25rem 0; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
