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

:root {
  --green: #1D9E75;
  --green-dark: #0F6E56;
  --bg: #F5F5F2;
  --surface: #FFFFFF;
  --border: rgba(0,0,0,0.1);
  --border-md: rgba(0,0,0,0.15);
  --text: #1a1a1a;
  --text-muted: #666;
  --text-hint: #999;
  --radius: 8px;
  --radius-lg: 12px;
}

body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }

/* Navbar */
.navbar { display: flex; align-items: center; gap: 24px; padding: 0 24px; height: 52px; background: var(--surface); border-bottom: 0.5px solid var(--border); position: sticky; top: 0; z-index: 100; }
.nav-brand { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 15px; }
.brand-icon { color: var(--green); font-size: 18px; }
.nav-links { display: flex; gap: 4px; flex: 1; }
.nav-link { padding: 5px 10px; border-radius: var(--radius); color: var(--text-muted); text-decoration: none; font-size: 13px; }
.nav-link:hover { background: var(--bg); color: var(--text); }
.nav-link.active { color: var(--text); font-weight: 500; }
.nav-right { display: flex; align-items: center; gap: 12px; }
.nav-user { font-size: 13px; color: var(--text-muted); }

/* Main */
.main-content { max-width: 1100px; margin: 0 auto; padding: 24px 20px; }

/* Page header */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; }
.page-header h1 { font-size: 20px; font-weight: 500; display: flex; align-items: center; gap: 10px; }
.page-sub { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.stat-card { background: var(--surface); border: 0.5px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.stat-value { font-size: 22px; font-weight: 500; display: flex; align-items: center; gap: 6px; }

/* Cards */
.card { background: var(--surface); border: 0.5px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.card-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: #fafaf8; border-bottom: 0.5px solid var(--border); }
.card-title { font-size: 13px; font-weight: 500; }
.card-body { padding: 16px; }
.card-footer { padding: 12px 16px; border-top: 0.5px solid var(--border); background: #fafaf8; display: flex; align-items: center; gap: 10px; }

/* Form */
.form-card { }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; font-weight: 500; color: var(--text-muted); }
.field input { padding: 8px 10px; border: 0.5px solid var(--border-md); border-radius: var(--radius); font-size: 13px; background: var(--surface); color: var(--text); transition: border-color .15s; }
.field input:focus { outline: none; border-color: var(--green); }
.field-hint { font-size: 11px; color: var(--text-hint); }
.field-wide { grid-column: span 2; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* Two col */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Table */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { padding: 8px 12px; text-align: left; font-size: 11px; font-weight: 500; color: var(--text-muted); background: #fafaf8; border-bottom: 0.5px solid var(--border); text-transform: uppercase; letter-spacing: .04em; }
.table td { padding: 10px 12px; border-bottom: 0.5px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: #fafaf8; }

/* Info table */
.info-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.info-table td { padding: 7px 0; border-bottom: 0.5px solid var(--border); }
.info-table td:first-child { color: var(--text-muted); width: 45%; }
.info-table tr.separator td { border-top: 1px solid var(--border-md); font-weight: 500; }

/* Total box */
.total-box { display: flex; justify-content: space-between; align-items: center; background: #E1F5EE; border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; }
.total-box span { font-size: 13px; color: #0F6E56; }
.total-box strong { font-size: 20px; font-weight: 500; color: #085041; }

/* Badges */
.badge { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 500; }
.badge-gray   { background: #f0ede8; color: #5F5E5A; }
.badge-blue   { background: #E6F1FB; color: #185FA5; }
.badge-amber  { background: #FAEEDA; color: #854F0B; }
.badge-green  { background: #EAF3DE; color: #3B6D11; }
.badge-red    { background: #FCEBEB; color: #A32D2D; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: var(--radius); font-size: 13px; font-weight: 500; border: 0.5px solid var(--border-md); background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none; transition: background .12s; }
.btn:hover { background: var(--bg); }
.btn-primary { background: var(--green); color: white; border-color: var(--green-dark); }
.btn-primary:hover { background: var(--green-dark); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; }

/* Alerts */
.alert { padding: 11px 14px; border-radius: var(--radius); margin-bottom: 16px; font-size: 13px; }
.alert-danger  { background: #FCEBEB; color: #791F1F; border: 0.5px solid #F09595; }
.alert-success { background: #EAF3DE; color: #27500A; border: 0.5px solid #97C459; }
.alert-warning { background: #FAEEDA; color: #633806; border: 0.5px solid #EF9F27; }

/* Empty state */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-state p { margin-bottom: 16px; }

/* Misc */
.mono { font-family: ui-monospace, monospace; font-size: 12px; }
.text-muted { color: var(--text-muted); }
.car-name { font-size: 13px; font-weight: 500; }
.car-vin { font-size: 11px; color: var(--text-hint); font-family: ui-monospace, monospace; margin-top: 1px; }
.row-actions { display: flex; gap: 6px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.dot-green { background: #639922; }
.dot-amber { background: #BA7517; }
.dot-red   { background: #A32D2D; }
.dot-gray  { background: #888; }

/* Login */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box { background: var(--surface); border: 0.5px solid var(--border); border-radius: var(--radius-lg); padding: 32px; width: 360px; }
.login-logo { text-align: center; margin-bottom: 28px; }
.logo-icon { font-size: 32px; color: var(--green); display: block; margin-bottom: 8px; }
.logo-text { font-size: 20px; font-weight: 500; }
.logo-sub { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.login-form { display: flex; flex-direction: column; gap: 14px; }

@media (max-width: 700px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .field-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: span 1; }
}
