/* ── Reset & Base ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --yellow:      #FFE000;
  --yellow-dark: #D4B800;
  --gray:        #6B6D6F;
  --gray-dark:   #3E3F40;
  --charcoal:    #1C1C1E;
  --surface:     #ffffff;
  --bg:          #F2F2F2;
  --border:      #DCDCDC;
  --text:        #1C1C1E;
  --muted:       #6B6D6F;
  --success:     #16a34a;
  --danger:      #dc2626;

  --brand:       var(--yellow);
  --brand-dark:  var(--yellow-dark);

  --radius: 10px;
  --shadow: 0 4px 24px rgba(0,0,0,.10);
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--charcoal);
  color: var(--text);
  min-height: 100vh;
  position: relative;
}

/* Subtle yellow glow orbs in background */
body::before {
  content: '';
  position: fixed;
  bottom: -120px; right: -120px;
  width: 500px; height: 500px;
  background: #FFE000;
  opacity: .05;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: '';
  position: fixed;
  top: -80px; left: -80px;
  width: 350px; height: 350px;
  background: #FFE000;
  opacity: .04;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.container { position: relative; z-index: 1; }

a { color: var(--gray-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Nav bar ──────────────────────────────────────── */
.nav {
  background: var(--charcoal);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 64px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,.35);
  border-bottom: 3px solid var(--yellow);
}
.nav-brand {
  display: flex; align-items: center; gap: .75rem;
  font-size: 1.15rem; font-weight: 800;
  letter-spacing: .5px; color: var(--yellow);
}
.nav-brand img { height: 38px; width: auto; }
.nav-brand span { color: rgba(255,255,255,.55); font-weight: 400; }
.nav a { color: rgba(255,255,255,.75); font-size: .9rem; margin-left: 1.5rem; }
.nav a:hover { color: var(--yellow); text-decoration: none; }
.nav-user { color: rgba(255,255,255,.55); font-size: .85rem; }

.container { max-width: 1400px; margin: 2rem auto; padding: 0 1.5rem; }
.container-wide { max-width: 98vw; margin: 2rem auto; padding: 0 1.5rem; }

/* ── Card ─────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 4px 32px rgba(0,0,0,.35);
  padding: 1.75rem 2rem;
  margin-bottom: 1.5rem;
  border-top: 3px solid var(--yellow);
}
.card-title {
  font-size: 1.05rem; font-weight: 700;
  margin-bottom: 1.25rem;
  padding-bottom: .75rem;
  border-bottom: 2px solid var(--border);
  color: var(--gray-dark);
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* ── Login page ───────────────────────────────────── */
.login-wrap {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  background: var(--charcoal);
}
.login-box {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 8px 40px rgba(0,0,0,.4);
  padding: 2.5rem 2.25rem;
  width: 100%; max-width: 440px;
  border-top: 5px solid var(--yellow);
}
.login-logo {
  text-align: center; margin-bottom: 2rem;
}
.login-logo img.logo-main {
  height: 100px; width: auto; margin-bottom: .75rem;
}
.login-logo img.logo-fleet {
  height: 56px; width: auto; margin-bottom: .5rem;
}
.login-logo h1 {
  font-size: 1.4rem; font-weight: 800;
  color: var(--charcoal); letter-spacing: .5px;
}
.login-logo .byline {
  color: var(--muted); font-size: .82rem; margin-top: .2rem;
}

/* ── Forms ────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .35rem; color: var(--muted); }
input[type=text], input[type=password], select, textarea {
  width: 100%; padding: .6rem .85rem;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  font-size: .95rem;
  color: var(--text);
  background: #fff;
  transition: border-color .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--gray);
  box-shadow: 0 0 0 3px rgba(107,109,111,.15);
}
textarea { resize: vertical; min-height: 80px; }

/* ── Buttons ──────────────────────────────────────── */
.btn {
  display: inline-block; padding: .55rem 1.2rem;
  border-radius: 7px; border: none; cursor: pointer;
  font-size: .9rem; font-weight: 700;
  transition: background .15s, transform .08s;
}
.btn:active { transform: scale(.97); }
.btn-primary  { background: var(--charcoal); color: var(--yellow); }
.btn-primary:hover  { background: var(--gray-dark); }
.btn-success  { background: var(--yellow);   color: var(--charcoal); }
.btn-success:hover  { background: var(--yellow-dark); }
.btn-danger   { background: var(--danger);   color: #fff; }
.btn-danger:hover   { background: #b91c1c; }
.btn-sm { padding: .35rem .8rem; font-size: .82rem; }
.btn-full { width: 100%; text-align: center; padding: .75rem; font-size: 1rem; }

/* ── Alerts / Flash ───────────────────────────────── */
.alert {
  padding: .75rem 1rem;
  border-radius: 7px;
  margin-bottom: 1rem;
  font-size: .9rem;
  font-weight: 500;
}
.alert-success { background: #dcfce7; color: #166534; border-left: 4px solid var(--success); }
.alert-error   { background: #fee2e2; color: #991b1b; border-left: 4px solid var(--danger); }

/* ── Table ────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
thead th {
  background: var(--charcoal); padding: .7rem 1rem;
  text-align: left; font-size: .75rem;
  text-transform: uppercase; letter-spacing: .7px;
  color: var(--yellow); border-bottom: 2px solid var(--yellow);
}
tbody tr { border-bottom: 1px solid var(--border); }
tbody tr:hover { background: #fafafa; }
tbody td { padding: .75rem 1rem; vertical-align: middle; }

/* ── Status badge ─────────────────────────────────── */
.badge {
  display: inline-block; padding: .25rem .65rem;
  border-radius: 99px; font-size: .75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .4px;
}
.badge-custom {
  background: var(--charcoal); color: var(--yellow);
  font-size: .78rem; padding: .3rem .75rem;
  text-transform: none; letter-spacing: 0;
  border-radius: 6px;
}

/* ── Notes ────────────────────────────────────────── */
.notes-cell { min-width: 280px; max-width: 420px; }
.notes-preview { color: var(--muted); font-size: .82rem; font-style: italic; white-space: pre-wrap; }

/* ── Modal overlay ────────────────────────────────── */
.modal-bg {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.6); z-index: 200;
  align-items: center; justify-content: center;
}
.modal-bg.open { display: flex; }
.modal {
  background: var(--surface); border-radius: var(--radius);
  padding: 2rem; width: 100%; max-width: 520px;
  box-shadow: 0 8px 40px rgba(0,0,0,.3);
  border-top: 4px solid var(--yellow);
  max-height: 90vh; overflow-y: auto;
}
.modal h3 {
  margin-bottom: 1.25rem; font-size: 1.05rem;
  color: var(--charcoal); font-weight: 800;
}
.modal-close {
  float: right; cursor: pointer; font-size: 1.3rem;
  color: var(--muted); line-height: 1;
}
.modal-close:hover { color: var(--danger); }

/* ── Customer portal cards ────────────────────────── */
.vehicle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}
.vehicle-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  border-top: 5px solid var(--yellow);
}
.vehicle-card .vin {
  font-size: 1.1rem; font-weight: 800;
  letter-spacing: .5px; color: var(--charcoal);
}
.vehicle-card .meta { font-size: .8rem; color: var(--muted); margin-top: .25rem; }
.vehicle-card .notes-block {
  margin-top: 1rem; background: var(--bg);
  border-radius: 7px; padding: .75rem 1rem;
  font-size: .88rem; white-space: pre-wrap;
  color: var(--text); border-left: 3px solid var(--yellow);
}

/* ── Stat chips ───────────────────────────────────── */
.stats { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.stat-chip {
  background: var(--charcoal); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1rem 1.75rem;
  text-align: center; flex: 1; min-width: 130px;
}
.stat-chip .num { font-size: 2rem; font-weight: 800; color: var(--yellow); }
.stat-chip .lbl { font-size: .75rem; color: rgba(255,255,255,.6); text-transform: uppercase; letter-spacing: .5px; }

/* ── Grid helpers ─────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 680px) { .grid-2 { grid-template-columns: 1fr; } }

/* ── Nav dropdown ─────────────────────────────────── */
.nav-dropdown { position: relative; }
.nav-dropdown-btn {
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2);
  color: var(--yellow); font-size: .9rem; font-weight: 700;
  padding: .4rem .9rem; border-radius: 7px; cursor: pointer;
  transition: background .15s;
}
.nav-dropdown-btn:hover { background: rgba(255,224,0,.15); }
.nav-dropdown-menu {
  display: none; position: absolute; right: 0; top: calc(100% + .5rem);
  background: var(--charcoal); border: 1px solid rgba(255,224,0,.2);
  border-radius: 9px; min-width: 200px;
  box-shadow: 0 8px 32px rgba(0,0,0,.5); overflow: hidden; z-index: 300;
}
.nav-dropdown-menu a {
  display: block; padding: .75rem 1.1rem;
  color: rgba(255,255,255,.8); font-size: .9rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
  transition: background .12s, color .12s;
}
.nav-dropdown-menu a:last-child { border-bottom: none; }
.nav-dropdown-menu a:hover { background: rgba(255,224,0,.12); color: var(--yellow); text-decoration: none; }
.nav-dropdown.open .nav-dropdown-menu { display: block; }

/* ── Inline form ──────────────────────────────────── */
.inline-form { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.inline-form select { width: auto; padding: .35rem .6rem; font-size: .85rem; }
