/* ============================================================
   Crackin Events Fleet Management System
   fleet.css — Professional dark-sidebar layout
   ============================================================ */

:root {
  --sidebar-bg:     #0f1923;
  --sidebar-width:  260px;
  --sidebar-accent: #e63946;
  --sidebar-hover:  rgba(255,255,255,0.07);
  --sidebar-active-bg: rgba(230,57,70,0.15);
  --sidebar-text:   #94a3b8;
  --sidebar-text-bright: #f1f5f9;

  --topbar-bg:   #ffffff;
  --topbar-h:    64px;

  --body-bg:     #f3f6fb;
  --card-bg:     #ffffff;
  --border:      #e2e8f0;

  --primary:     #e63946;
  --primary-dk:  #c1121f;
  --success:     #22c55e;
  --warning:     #f59e0b;
  --danger:      #ef4444;
  --info:        #3b82f6;

  --font-body:   'DM Sans', sans-serif;
  --font-head:   'Space Grotesk', sans-serif;

  --radius:      10px;
  --shadow:      0 1px 4px rgba(0,0,0,0.07), 0 4px 20px rgba(0,0,0,0.05);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  background: var(--body-bg);
  color: #1e293b;
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ── Layout ──────────────────────────────────────────────── */
.fleet-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.fleet-sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.25s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.brand-icon {
  width: 38px; height: 38px;
  background: var(--sidebar-accent);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px;
  flex-shrink: 0;
}

.brand-name {
  display: block;
  font-family: var(--font-head);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--sidebar-text-bright);
  line-height: 1.2;
}

.brand-sub {
  display: block;
  font-size: 0.68rem;
  color: var(--sidebar-text);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #475569;
  padding: 14px 8px 6px;
  font-weight: 600;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s;
  margin-bottom: 2px;
}

.sidebar-nav .nav-link i { font-size: 1rem; flex-shrink: 0; }

.sidebar-nav .nav-link:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-bright);
}

.sidebar-nav .nav-link.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-accent);
  font-weight: 600;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.user-avatar {
  width: 34px; height: 34px;
  background: var(--sidebar-accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.user-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--sidebar-text-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.7rem;
  color: var(--sidebar-text);
  text-transform: capitalize;
}

.btn-logout {
  color: var(--sidebar-text);
  font-size: 1.1rem;
  text-decoration: none;
  transition: color 0.15s;
  flex-shrink: 0;
}
.btn-logout:hover { color: var(--sidebar-accent); }

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

/* ── Topbar ──────────────────────────────────────────────── */
.fleet-topbar {
  height: var(--topbar-h);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 1px 0 var(--border);
}

.sidebar-toggle {
  background: none; border: none;
  font-size: 1.25rem;
  color: #64748b;
  cursor: pointer;
  display: none;
  padding: 4px 8px;
  border-radius: 6px;
}
.sidebar-toggle:hover { background: var(--body-bg); }

.topbar-title {
  flex: 1;
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 600;
  color: #0f1923;
}

.topbar-actions { display: flex; align-items: center; gap: 12px; }

.topbar-notif {
  position: relative;
  color: #64748b;
  font-size: 1.2rem;
  text-decoration: none;
  padding: 6px;
  border-radius: 8px;
  transition: all 0.15s;
}
.topbar-notif:hover { background: var(--body-bg); color: #1e293b; }

.notif-badge {
  position: absolute; top: 2px; right: 2px;
  background: var(--sidebar-accent);
  color: #fff;
  border-radius: 50%;
  font-size: 0.6rem;
  min-width: 16px; height: 16px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}

/* ── Content ─────────────────────────────────────────────── */
.fleet-content {
  padding: 28px;
  flex: 1;
}

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-header {
  background: transparent;
  border-bottom: 1px solid var(--border);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.95rem;
}

.card-body { padding: 24px; }

/* ── Stat Cards ──────────────────────────────────────────── */
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}

.stat-card.danger::before  { background: var(--danger); }
.stat-card.warning::before { background: var(--warning); }
.stat-card.success::before { background: var(--success); }
.stat-card.info::before    { background: var(--info); }
.stat-card.primary::before { background: var(--primary); }

.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 16px;
}

.stat-card.danger  .stat-icon { background: #fef2f2; color: var(--danger); }
.stat-card.warning .stat-icon { background: #fffbeb; color: var(--warning); }
.stat-card.success .stat-icon { background: #f0fdf4; color: var(--success); }
.stat-card.info    .stat-icon { background: #eff6ff; color: var(--info); }
.stat-card.primary .stat-icon { background: #fff1f2; color: var(--primary); }

.stat-value {
  font-family: var(--font-head);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.82rem;
  color: #64748b;
  font-weight: 500;
}

/* ── Tables ──────────────────────────────────────────────── */
.table {
  font-size: 0.85rem;
  margin: 0;
}

.table th {
  font-family: var(--font-head);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  border-bottom-width: 1px !important;
  padding: 12px 16px;
  white-space: nowrap;
  background: #f8fafc;
}

.table td {
  padding: 12px 16px;
  vertical-align: middle;
  border-color: var(--border);
}

.table-hover tbody tr:hover { background: #f8fafc; }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: capitalize;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-dk);
  border-color: var(--primary-dk);
}

/* ── Page header ─────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
  flex-wrap: wrap;
}

.page-header h1 {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f1923;
  margin: 0;
}

.page-header .subtitle {
  font-size: 0.82rem;
  color: #64748b;
  margin-top: 2px;
}

/* ── Alert cards ─────────────────────────────────────────── */
.alert-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 8px;
  border-left: 3px solid;
  background: var(--card-bg);
  border-color: var(--border);
  margin-bottom: 8px;
}
.alert-item.critical { border-left-color: var(--danger); background: #fff5f5; }
.alert-item.urgent   { border-left-color: var(--warning); background: #fffdf0; }
.alert-item.warning  { border-left-color: var(--warning); }
.alert-item.info     { border-left-color: var(--info); }

/* ── Login page ──────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sidebar-bg);
  padding: 24px;
}

.login-box {
  width: 100%;
  max-width: 420px;
  background: var(--card-bg);
  border-radius: 16px;
  padding: 48px 40px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo .brand-icon {
  width: 54px; height: 54px;
  font-size: 24px;
  margin: 0 auto 12px;
}

.login-logo h1 {
  font-family: var(--font-head);
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0;
}

.login-logo p {
  font-size: 0.82rem;
  color: #64748b;
  margin: 4px 0 0;
}

/* ── Forms ───────────────────────────────────────────────── */
.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 5px;
}

.form-control, .form-select {
  font-size: 0.875rem;
  border-color: var(--border);
  border-radius: 8px;
  padding: 9px 13px;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(230,57,70,0.1);
}

/* ── Upload zone ─────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #f8fafc;
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--primary);
  background: #fff5f5;
}

.upload-zone i {
  font-size: 2.5rem;
  color: #94a3b8;
  margin-bottom: 12px;
  display: block;
}

.upload-zone p { color: #64748b; font-size: 0.875rem; margin: 0; }

/* ── Status Indicator ────────────────────────────────────── */
.status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}
.status-dot.success { background: var(--success); }
.status-dot.warning { background: var(--warning); }
.status-dot.danger  { background: var(--danger); }
.status-dot.info    { background: var(--info); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .fleet-sidebar {
    transform: translateX(-100%);
  }
  .fleet-sidebar.open {
    transform: translateX(0);
  }
  .fleet-main {
    margin-left: 0;
  }
  .sidebar-toggle { display: flex; }
  .fleet-content { padding: 16px; }
}

/* ── Utilities ───────────────────────────────────────────── */
.text-muted-sm { font-size: 0.78rem; color: #94a3b8; }
.fw-semibold { font-weight: 600; }
.font-head { font-family: var(--font-head); }
.gap-2 { gap: 8px; }

.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

/* Extracted PDF data display */
.pdf-extracted {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 16px 20px;
}

.pdf-extracted h6 {
  font-family: var(--font-head);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #166534;
  margin-bottom: 12px;
}

.pdf-data-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.pdf-data-item label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #4ade80;
  margin-bottom: 2px;
}

.pdf-data-item span {
  font-size: 0.875rem;
  font-weight: 600;
  color: #14532d;
}


/* ── UK Number Plate ── */
.uk-plate {
    display: inline-block;
    background: #f5c518;
    color: #000;
    font-family: 'UKNumberPlate', 'Charles Wright', 'Arial Black', monospace;
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: .12em;
    padding: .3rem 1rem;
    border-radius: 4px;
    border: 2px solid #333;
    text-transform: uppercase;
}

/* ── Compliance Items ── */
.compliance-item.border-danger  { border-color: var(--fleet-danger) !important; background: rgba(220,53,69,.05); }
.compliance-item.border-warning { border-color: var(--fleet-warning) !important; background: rgba(255,193,7,.05); }
.compliance-item.border-success { border-color: var(--fleet-success) !important; }

/* ── Print styles ── */
@media print {
    .sidebar, .topbar, .btn, nav, form { display: none !important; }
    .main-content { margin-left: 0 !important; padding: 0 !important; }
    .card { border: 1px solid #ccc !important; box-shadow: none !important; }
    .badge { border: 1px solid #999 !important; }
}

/* ── Table row expiry highlighting ── */
tr.expiry-expired td { background: rgba(220,53,69,.08) !important; }
tr.expiry-warning td { background: rgba(255,193,7,.08) !important; }
