:root {
  --primary: #f59e0b;
  --primary-light: #fbbf24;
  --accent: #06b6d4;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --dark: #0a0a0a;
  --dark-elevated: #111111;
  --card: rgba(17, 17, 17, 0.7);
  --glass: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glow: rgba(245, 158, 11, 0.4);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.5);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--dark);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 40%, rgba(245, 158, 11, 0.1), transparent),
    radial-gradient(ellipse 60% 40% at 80% 60%, rgba(6, 182, 212, 0.08), transparent);
  pointer-events: none;
  z-index: -1;
}

/* Login Page */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-box {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 40px;
  backdrop-filter: blur(20px);
}

.login-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-align: center;
  margin-bottom: 8px;
}

.login-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.form-input {
  width: 100%;
  padding: 14px 18px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.3s;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: var(--dark);
  width: 100%;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px -10px var(--glow);
}

.btn-secondary {
  background: var(--glass);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.3);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

/* Admin Layout */
.admin-layout {
  display: block;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  background: var(--dark-elevated);
  border-right: 1px solid var(--glass-border);
  padding: 24px;
  display: flex;
  flex-direction: column;
  position: fixed;
  width: 260px;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 40px;
}

.nav-menu {
  list-style: none;
  flex: 1;
}

.nav-item {
  margin-bottom: 8px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 12px;
  transition: all 0.3s;
}

.nav-link:hover,
.nav-link.active {
  background: var(--glass);
  color: var(--text-primary);
}

.nav-link.active {
  border: 1px solid var(--glass-border);
}

.nav-icon {
  width: 20px;
  height: 20px;
}

.sidebar-footer {
  padding-top: 20px;
  border-top: 1px solid var(--glass-border);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--dark);
}

.user-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.user-role {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Main Content */
.main-content {
  margin-left: 260px;
  padding: 32px;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--glass-border);
}

.header-title h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.header-title p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.header-actions {
  display: flex;
  gap: 12px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 24px;
  backdrop-filter: blur(10px);
  transition: all 0.3s;
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: rgba(245, 158, 11, 0.2);
}

.stat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.stat-icon.blue { background: rgba(6, 182, 212, 0.1); }
.stat-icon.green { background: rgba(16, 185, 129, 0.1); }
.stat-icon.orange { background: rgba(245, 158, 11, 0.1); }
.stat-icon.red { background: rgba(239, 68, 68, 0.1); }

.stat-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  margin-top: 4px;
}

/* Content Card */
.content-card {
  background: var(--card);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  border-bottom: 1px solid var(--glass-border);
}

.card-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
}

/* Table */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: var(--glass);
}

th {
  text-align: left;
  padding: 16px 24px;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

td {
  padding: 20px 24px;
  border-bottom: 1px solid var(--glass-border);
}

tbody tr:hover {
  background: var(--glass);
}

.car-cell {
  display: flex;
  align-items: center;
  gap: 16px;
}

.car-thumb {
  width: 60px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--dark);
}

.car-name {
  font-weight: 600;
}

.car-specs {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.spec-tag {
  padding: 2px 8px;
  background: var(--glass);
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Status Badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-available {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.status-available::before {
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.status-busy {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.status-busy::before {
  background: #ef4444;
  box-shadow: 0 0 6px #ef4444;
}

.status-maintenance {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.status-maintenance::before {
  background: #f59e0b;
  box-shadow: 0 0 6px #f59e0b;
}

/* Actions */
.actions {
  display: flex;
  gap: 8px;
}

.btn-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.btn-icon.edit:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-icon.delete:hover {
  border-color: var(--danger);
  color: var(--danger);
}

/* Search & Filter */
.toolbar {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 280px;
}

.search-box input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.filter-select {
  padding: 12px 40px 12px 16px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 0.95rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}

/* Form Styles */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.form-group.full-width {
  grid-column: span 2;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 14px 18px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.3s;
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.image-upload {
  border: 2px dashed var(--glass-border);
  border-radius: 16px;
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
}

.image-upload:hover {
  border-color: var(--primary);
  background: rgba(245, 158, 11, 0.05);
}

.image-upload-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.image-upload-text {
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.image-upload-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
}

#imagePreview img {
  max-width: 100%;
  max-height: 200px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  justify-content: center;
  align-items: center;
  z-index: 2000;
  padding: 20px;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--dark-elevated);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  max-width: 500px;
  width: 100%;
  padding: 32px;
  text-align: center;
}

.modal-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  background: rgba(239, 68, 68, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.modal-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.modal-text {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--card);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  transform: translateX(150%);
  transition: transform 0.3s;
  z-index: 3000;
}

.toast.show {
  transform: translateX(0);
}

.toast.success {
  border-color: rgba(16, 185, 129, 0.3);
}

.toast.error {
  border-color: rgba(239, 68, 68, 0.3);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.empty-text {
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* Responsive */
@media (max-width: 1024px) {
  .sidebar {
    position: fixed;
    left: -260px;
    z-index: 100;
    transition: left 0.3s;
  }

  .sidebar.open {
    left: 0;
  }

  .main-content {
    margin-left: 0;
    padding: 80px 20px 20px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-group.full-width {
    grid-column: span 1;
  }

  /* Mobile menu toggle */
  .mobile-toggle {
    display: flex !important;
  }

  .header {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }
}

/* Mobile menu button */
.mobile-toggle {
  display: none;
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 101;
  width: 44px;
  height: 44px;
  background: var(--card);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: var(--text-primary);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

@media (max-width: 640px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  th, td {
    padding: 12px 16px;
  }

  .car-thumb {
    display: none;
  }
}

/* Loading */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--glass-border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
