/* ── The Valet Van — Admin Stylesheet ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:   #1a2744;
  --navy2:  #243660;
  --green:  #00c853;
  --green2: #00b248;
  --white:  #ffffff;
  --light:  #f0f4f8;
  --border: #e2e8f0;
  --text:   #1a202c;
  --muted:  #64748b;
  --sidebar-w: 240px;
  --radius: 8px;
  --shadow: 0 2px 12px rgba(0,0,0,.08);
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--light);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Login page ─────────────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy2) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,.2);
  width: 100%;
  max-width: 380px;
  padding: 40px 36px;
}
.login-logo {
  text-align: center;
  margin-bottom: 28px;
}
.login-logo h1 { color: var(--navy); font-size: 1.5rem; }
.login-logo p  { color: var(--muted); font-size: .85rem; }

/* ── Layout ─────────────────────────────────────────────────────────────── */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
  width: var(--sidebar-w);
  background: var(--navy);
  color: #fff;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 50;
  display: flex;
  flex-direction: column;
}
.sidebar-brand {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar-brand h2 { font-size: 1rem; color: #fff; }
.sidebar-brand p  { font-size: .75rem; color: rgba(255,255,255,.5); margin-top: 2px; }
.sidebar-nav { flex: 1; padding: 16px 0; }
.nav-item a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  color: rgba(255,255,255,.75);
  font-size: .9rem;
  transition: all .15s;
}
.nav-item a:hover {
  background: rgba(255,255,255,.07);
  color: #fff;
  text-decoration: none;
}
.nav-item.active a {
  background: rgba(0,200,83,.15);
  color: var(--green);
  border-right: 3px solid var(--green);
}
.nav-icon { font-size: 1rem; width: 20px; text-align: center; }
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.1);
}
.sidebar-footer a {
  color: rgba(255,255,255,.55);
  font-size: .82rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-footer a:hover { color: #fff; text-decoration: none; }

/* Main content */
.admin-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
}
.admin-topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
}
.admin-topbar h1 { font-size: 1.15rem; color: var(--navy); font-weight: 700; }
.topbar-right { display: flex; align-items: center; gap: 16px; font-size: .85rem; color: var(--muted); }
.topbar-right a { color: var(--muted); }
.topbar-right a:hover { color: var(--navy); }
.admin-content { padding: 28px; }

/* ── Stat cards ──────────────────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--navy);
}
.stat-card.green { border-left-color: var(--green); }
.stat-card.orange { border-left-color: #f59e0b; }
.stat-card.red   { border-left-color: #ef4444; }
.stat-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 6px; }
.stat-value { font-size: 1.8rem; font-weight: 700; color: var(--navy); }
.stat-sub   { font-size: .8rem; color: var(--muted); margin-top: 4px; }

/* ── Tables ──────────────────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 24px;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-header h3 { font-size: 1rem; color: var(--navy); }
.card-body { padding: 20px; }
.card-body.no-pad { padding: 0; }

.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}
.data-table th {
  background: var(--light);
  padding: 10px 14px;
  text-align: left;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #fafafa; }

/* Status badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-pending   { background: #fffbeb; color: #92400e; }
.badge-approved  { background: #eff6ff; color: #1e40af; }
.badge-complete  { background: #f0fff4; color: #166534; }
.badge-cancelled { background: #fff5f5; color: #991b1b; }
.badge-paid      { background: #f0fff4; color: #166534; }
.badge-unpaid    { background: #fff5f5; color: #991b1b; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all .15s;
  white-space: nowrap;
  line-height: 1.4;
}
.btn-sm   { padding: 5px 10px; font-size: .78rem; }
.btn-lg   { padding: 12px 24px; font-size: 1rem; }
.btn-block { display: block; width: 100%; text-align: center; }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green2); color: #fff; text-decoration: none; }
.btn-navy   { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy2); color: #fff; text-decoration: none; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; color: #fff; text-decoration: none; }
.btn-warning { background: #f59e0b; color: #fff; }
.btn-warning:hover { background: #d97706; color: #fff; text-decoration: none; }
.btn-outline {
  background: transparent;
  border: 2px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--navy); color: var(--navy); text-decoration: none; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 5px;
}
.form-control {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: 2px solid var(--border);
  border-radius: 6px;
  font-size: .9rem;
  font-family: inherit;
  transition: border-color .15s;
  background: var(--white);
  color: var(--text);
}
.form-control:focus { outline: none; border-color: var(--navy); }
.form-hint  { font-size: .78rem; color: var(--muted); margin-top: 4px; }
select.form-control { cursor: pointer; }

/* ── Tabs ────────────────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.tab-btn {
  padding: 9px 18px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: .9rem;
  color: var(--muted);
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all .15s;
}
.tab-btn.active   { color: var(--navy); border-bottom-color: var(--navy); font-weight: 700; }
.tab-btn:hover    { color: var(--navy); }
.tab-content      { display: none; }
.tab-content.active { display: block; }

/* ── Revenue chart (CSS bars) ────────────────────────────────────────────── */
.chart-wrap {
  padding: 20px;
}
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 160px;
  margin-bottom: 8px;
}
.chart-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  gap: 4px;
}
.chart-bar {
  width: 100%;
  background: var(--navy);
  border-radius: 4px 4px 0 0;
  transition: background .2s;
  min-height: 2px;
}
.chart-bar:hover { background: var(--green); }
.chart-label {
  font-size: .62rem;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  max-width: 100%;
}
.chart-value {
  font-size: .65rem;
  color: var(--muted);
  text-align: center;
}

/* ── Availability grid ───────────────────────────────────────────────────── */
.avail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.avail-day {
  background: var(--light);
  border-radius: 6px;
  padding: 12px;
  text-align: center;
}
.avail-day h4 { font-size: .85rem; margin-bottom: 8px; color: var(--navy); }
.avail-day label { display: flex; align-items: center; gap: 6px; font-size: .8rem; cursor: pointer; justify-content: center; }
.avail-day input[type=checkbox] { accent-color: var(--green); }

.time-slot-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.time-slot-tag  {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: .85rem;
}
.time-slot-tag .remove-slot {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 1rem;
  padding: 0;
  line-height: 1;
}
.time-slot-tag .remove-slot:hover { color: #ef4444; }

/* ── Alerts ──────────────────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: .9rem;
}
.alert-success { background: #f0fff4; border-left: 4px solid var(--green); color: #166534; }
.alert-error   { background: #fff5f5; border-left: 4px solid #dc2626; color: #991b1b; }
.alert-info    { background: #eff6ff; border-left: 4px solid #3b82f6; color: #1e40af; }
.alert-warning { background: #fffbeb; border-left: 4px solid #f59e0b; color: #92400e; }

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 8px 40px rgba(0,0,0,.2);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  margin: 20px;
}
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 { font-size: 1rem; color: var(--navy); }
.modal-close {
  background: none; border: none; cursor: pointer;
  font-size: 1.3rem; color: var(--muted);
}
.modal-close:hover { color: var(--text); }
.modal-body   { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ── Finance summary ──────────────────────────────────────────────────────── */
.finance-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.finance-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  text-align: center;
}
.finance-card .f-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 6px; }
.finance-card .f-value { font-size: 1.6rem; font-weight: 700; }
.finance-card.income .f-value { color: var(--green); }
.finance-card.expense .f-value { color: #ef4444; }
.finance-card.profit  .f-value { color: var(--navy); }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .admin-sidebar {
    width: 200px;
    transform: translateX(-100%);
    transition: transform .3s;
  }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .form-row { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .admin-content { padding: 16px; }
}
