@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&family=DM+Mono:wght@400;500&display=swap');


*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

* {
  overflow-x: hidden;
}
:root {
  --white: #ffffff;
  --bg: #f5f5f7;
  --surface: #ffffff;
  --border: #e8e8ed;
  --border-light: #f0f0f5;
  --text-primary: #1a1a2e;
  --text-secondary: #6b6b80;
  --text-muted: #9999aa;
  --accent: #2563eb;
  --accent-light: #eff6ff;
  --accent-hover: #1d4ed8;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --success: #22c55e;
  --success-light: #f0fdf4;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --sidebar-w: 260px;
  --topbar-h: 60px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.10);
  --font: 'DM Sans', sans-serif;
  --mono: 'DM Mono', monospace;
  --transition: 0.2s ease;
}

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── LAYOUT ── */
.layout { display: flex; min-height: 100vh; }

.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin var(--transition);
}

/* ── SIDEBAR ── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--white);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--transition);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-logo .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.sidebar-logo .brand-icon {
  width: 36px; height: 36px;
  background: var(--text-primary);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}

.sidebar-logo .brand-icon svg { color: white; }

.sidebar-logo .brand-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.sidebar-close {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text-secondary);
  border-radius: 6px;
  transition: background var(--transition), color var(--transition);
}

.sidebar-close:hover { background: var(--bg); color: var(--text-primary); }

.sidebar-nav { padding: 12px 12px; flex: 1; }

.nav-section-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 10px 6px;
  margin-top: 8px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  margin-bottom: 2px;
  position: relative;
}

.nav-link svg { flex-shrink: 0; opacity: 0.7; transition: opacity var(--transition); }

.nav-link:hover {
  background: var(--bg);
  color: var(--text-primary);
}

.nav-link:hover svg { opacity: 1; }

.nav-link.active {
  background: var(--accent-light);
  color: var(--accent);
}

.nav-link.active svg { opacity: 1; }

.nav-link.danger { color: var(--danger); }
.nav-link.danger:hover { background: var(--danger-light); }
.nav-link.danger svg { opacity: 0.8; }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-light);
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ── OVERLAY ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.25);
  z-index: 99;
  backdrop-filter: blur(2px);
}

/* ── TOPBAR ── */
.topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.menu-toggle:hover { background: var(--bg); color: var(--text-primary); }

.topbar-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.topbar-actions { display: flex; align-items: center; gap: 8px; }

/* ── PAGE CONTENT ── */
.page-body {
  padding: 24px;
  flex: 1;
}

.page-header {
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.page-header p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ── CARDS ── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.card-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  font-family: var(--mono);
}

.stat-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}

.stat-icon.blue { background: var(--accent-light); color: var(--accent); }
.stat-icon.green { background: var(--success-light); color: var(--success); }
.stat-icon.orange { background: var(--warning-light); color: var(--warning); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  box-shadow: var(--shadow);
}

/* ── FORMS ── */
.form-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.form-row { margin-bottom: 16px; }

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="file"],
input[type="datetime-local"],
select,
textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.875rem;
  color: var(--text-primary);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

input[type="file"] { padding: 7px 12px; cursor: pointer; }

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b6b80' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--text-primary);
  color: var(--white);
}

.btn-primary:hover {
  background: #2a2a45;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-outline:hover { background: var(--bg); }

.btn-danger {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid #fecaca;
}

.btn-danger:hover { background: #fee2e2; }

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: 6px;
}

/* ── TABLES ── */
.table-wrap {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead th {
  background: var(--bg);
  padding: 11px 16px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}

tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }

tbody tr:hover { background: var(--bg); }

/* ── BADGES ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-blue { background: var(--accent-light); color: var(--accent); }
.badge-green { background: var(--success-light); color: #15803d; }
.badge-orange { background: var(--warning-light); color: #b45309; }
.badge-red { background: var(--danger-light); color: var(--danger); }

/* ── VEHICLE / BOOKING CARDS ── */
.item-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition);
}

.item-card:hover { box-shadow: var(--shadow-md); }

.item-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.item-thumb {
  width: 56px; height: 56px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.item-info { flex: 1; min-width: 0; }

.item-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-sub {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 10px;
}

.item-meta-row {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.item-meta-row strong {
  color: var(--text-primary);
  font-weight: 600;
}

.item-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── COLLAPSIBLE UPDATE BOX ── */
.update-box {
  display: none;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

.update-box .form-row { margin-bottom: 12px; }

/* ── FILTER BAR ── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: var(--shadow);
}

.filter-bar select,
.filter-bar input[type="date"] {
  width: auto;
  min-width: 140px;
}

/* ── CHART CONTAINER ── */
.chart-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.chart-card h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}

/* ── DASHBOARD TABLES GRID ── */
.tables-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 24px;
}

/* ── LOGIN PAGE ── */
.login-page {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.login-logo-icon {
  width: 42px; height: 42px;
  background: var(--text-primary);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}

.login-logo-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.login-card h1 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.login-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.alert-error {
  background: var(--danger-light);
  border: 1px solid #fecaca;
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
}

.empty-state svg { color: var(--text-muted); margin-bottom: 12px; }

.empty-state h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.empty-state p { font-size: 0.85rem; color: var(--text-muted); }

/* ── CUSTOMER IMAGE ── */
.customer-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

.avatar-placeholder {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
}

/* ── FORM FILE PREVIEW ── */
.file-preview-wrap { position: relative; display: inline-block; }

.file-preview-img {
  width: 80px; height: 80px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: block;
  margin-bottom: 8px;
}

/* ── INVOICE ── */
.invoice-items-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 12px;
}

.invoice-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
}

.invoice-row:last-child { border-bottom: none; }

.invoice-row select { flex: 2; }
.invoice-row input { flex: 1; }

/* ── QR ── */
.qr-card {
  margin: 0 auto;
}

/* ── SHOP ── */
.shop-preview-img {
  width: 100px; height: 100px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 12px;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #ccc; }

/* ── DIVIDER ── */
.divider {
  height: 1px;
  background: var(--border-light);
  margin: 20px 0;
}

/* ── CHECKBOX ── */
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.checkbox-row input[type="checkbox"] {
  width: auto;
  width: 16px; height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.checkbox-row span {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .sidebar-close { display: flex; }

  .sidebar-overlay.show { display: block; }

  .main-content { margin-left: 0; }

  .menu-toggle { display: flex; }

  .stats-grid { grid-template-columns: 1fr; gap: 12px; }

  .tables-grid { grid-template-columns: 1fr; }

  .page-body { padding: 16px; }

  .topbar { padding: 0 16px; }

  .filter-bar { padding: 12px 14px; }

  .filter-bar select,
  .filter-bar input[type="date"] { width: 100%; }

  table { min-width: 480px; }

  .table-responsive { overflow-x: auto; }

  .login-card { padding: 28px 22px; }

  .form-card { padding: 18px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .item-actions .btn { flex: 1; justify-content: center; }
}