:root {
  --sidebar-w: 240px;
  --sidebar-bg: #1a2744;
  --sidebar-hover: #253560;
  --sidebar-active: #2563eb;
  --topbar-h: 56px;
  --body-bg: #f0f4f8;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--body-bg);
  color: #1e293b;
}

/* ── Sidebar ── */
.vp-sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  overflow-y: auto;
  transition: transform .25s ease;
}

.vp-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  flex-shrink: 0;
}

.vp-occ-mini {
  padding: 14px 20px 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}

.vp-nav { flex: 1; padding: 8px 0; }

.vp-sep {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: rgba(255,255,255,.35);
  padding: 16px 20px 4px;
  text-transform: uppercase;
}

.vp-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: rgba(255,255,255,.75);
  text-decoration: none;
  font-size: .9rem;
  border-left: 3px solid transparent;
  transition: background .15s, color .15s;
}
.vp-nav-link:hover { background: var(--sidebar-hover); color: #fff; }
.vp-nav-link.active {
  background: rgba(37,99,235,.25);
  color: #fff;
  border-left-color: var(--sidebar-active);
  font-weight: 600;
}
.vp-nav-link i { font-size: 1rem; width: 20px; text-align: center; }

.vp-user-info {
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,.1);
  flex-shrink: 0;
}
.vp-user-name { color: #fff; font-weight: 600; font-size: .9rem; }
.vp-user-role { color: rgba(255,255,255,.5); font-size: .78rem; margin-bottom: 8px; }
.vp-logout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255,255,255,.5);
  text-decoration: none;
  font-size: .82rem;
  transition: color .15s;
}
.vp-logout:hover { color: #f87171; }

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

.vp-topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.vp-topbar-title { font-weight: 700; color: #1e293b; flex: 1; font-size: .95rem; }
.vp-toggle { padding: 4px 8px; color: #64748b; }

/* ── Cards ── */
.vp-stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
  display: flex;
  align-items: center;
  gap: 16px;
}
.vp-stat-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.vp-stat-label { font-size: .8rem; color: #64748b; margin-bottom: 2px; }
.vp-stat-value { font-size: 1.6rem; font-weight: 700; color: #1e293b; }

/* ── Tables ── */
.vp-table-wrap {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
  overflow: hidden;
}
.vp-table-wrap .table { margin: 0; }
.vp-table-wrap .table thead th {
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
  font-weight: 600;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #64748b;
  white-space: nowrap;
}
.vp-table-wrap .table td { vertical-align: middle; font-size: .9rem; }
.vp-table-header {
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.vp-table-header h6 { margin: 0; font-weight: 700; }

/* ── Forms ── */
.vp-form-card {
  background: #fff;
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
  max-width: 640px;
}

.vp-type-btn {
  cursor: pointer;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 16px;
  text-align: center;
  transition: all .15s;
  background: #fff;
  font-size: .85rem;
}
.vp-type-btn:hover { border-color: #93c5fd; background: #eff6ff; }
.vp-type-btn.selected { border-color: #2563eb; background: #eff6ff; color: #2563eb; font-weight: 600; }
.vp-type-btn i { font-size: 1.6rem; display: block; margin-bottom: 4px; }

/* ── Plate input ── */
.plate-input {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-align: center;
  font-family: 'Courier New', monospace;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 16px;
  width: 100%;
}
.plate-input:focus { border-color: #2563eb; outline: none; box-shadow: 0 0 0 3px rgba(37,99,235,.15); }

/* ── Occupancy grid ── */
.vp-space-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 8px;
}
.vp-space-cell {
  border-radius: 8px;
  padding: 8px 4px;
  text-align: center;
  font-size: .78rem;
  font-weight: 600;
  border: 2px solid transparent;
}
.vp-space-cell.available  { background: #dcfce7; color: #15803d; border-color: #86efac; }
.vp-space-cell.occupied   { background: #fee2e2; color: #b91c1c; border-color: #fca5a5; }
.vp-space-cell.reserved   { background: #fef9c3; color: #92400e; border-color: #fde047; }
.vp-space-cell.maintenance{ background: #f1f5f9; color: #94a3b8; border-color: #cbd5e1; }

/* ── Badges ── */
.badge-monthly { background: #7c3aed; }

/* ── Login ── */
.vp-login-wrap {
  min-height: 100vh;
  background: linear-gradient(135deg, #1a2744 0%, #2563eb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.vp-login-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.vp-login-logo {
  text-align: center;
  margin-bottom: 28px;
}

/* ── Overlay mobile ── */
.vp-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0,0,0,.45);
}
.vp-overlay.show { display: block; }

/* ── Responsive ── */
@media (max-width: 767px) {
  .vp-sidebar {
    transform: translateX(-100%);
  }
  .vp-sidebar.show {
    transform: translateX(0);
  }
  .vp-main {
    margin-left: 0;
  }
}

/* ── Utilities ── */
.cursor-pointer { cursor: pointer; }
.text-muted-sm  { font-size: .8rem; color: #94a3b8; }
.fs-7           { font-size: .85rem; }

/* ── Dark Mode ── */
[data-theme="dark"] {
  --body-bg: #0f172a;
  --sidebar-bg: #0d1526;
  --sidebar-hover: #1e293b;
  --sidebar-active: #2563eb;
}

[data-theme="dark"] body {
  background: var(--body-bg);
  color: #e2e8f0;
}

[data-theme="dark"] .vp-topbar {
  background: #1e293b;
  border-bottom-color: #334155;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
[data-theme="dark"] .vp-topbar-title { color: #f1f5f9; }
[data-theme="dark"] .vp-toggle       { color: #94a3b8; }

[data-theme="dark"] .vp-stat-card,
[data-theme="dark"] .vp-table-wrap,
[data-theme="dark"] .vp-form-card {
  background: #1e293b;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
[data-theme="dark"] .vp-stat-label { color: #94a3b8; }
[data-theme="dark"] .vp-stat-value { color: #f1f5f9; }

[data-theme="dark"] .vp-table-wrap .table thead th {
  background: #0f172a;
  border-bottom-color: #334155;
  color: #64748b;
}
[data-theme="dark"] .vp-table-wrap .table td   { color: #e2e8f0; }
[data-theme="dark"] .vp-table-wrap .table tbody tr:hover td { background: #263045; }
[data-theme="dark"] .vp-table-header {
  border-bottom-color: #334155;
}
[data-theme="dark"] .vp-table-header h6 { color: #f1f5f9; }

[data-theme="dark"] .plate-input {
  background: #0f172a;
  border-color: #334155;
  color: #f1f5f9;
}
[data-theme="dark"] .plate-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.2);
}

[data-theme="dark"] .vp-type-btn {
  background: #0f172a;
  border-color: #334155;
  color: #e2e8f0;
}
[data-theme="dark"] .vp-type-btn:hover { border-color: #93c5fd; background: #1d3a6e; }
[data-theme="dark"] .vp-type-btn.selected {
  border-color: #2563eb;
  background: #1d3a6e;
  color: #93c5fd;
}

[data-theme="dark"] .vp-login-card {
  background: #1e293b;
  color: #e2e8f0;
}
[data-theme="dark"] .vp-login-card .text-muted { color: #94a3b8 !important; }
