:root{--bg:#f7fafc;--card:#fff;--muted:#64748b;--accent:#000A3E;--button-text:#F0AB00}
html[data-theme="dark"]{--bg:#0f1115;--card:#171a1f;--muted:#aeb7c5;--accent:#03164f;--button-text:#F0AB00;--muted-2:#9aa3b2}
*{box-sizing:border-box}
[hidden]{display:none!important}
body{font-family:Inter,system-ui,Segoe UI,Roboto,Arial,sans-serif;margin:0;background:var(--bg);color:#0f172a}
.container{max-width:880px;margin:3rem auto;padding:1.5rem;background:var(--card);border-radius:12px;box-shadow:0 6px 24px rgba(2,6,23,0.06)}
.page-header{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:1rem;margin-bottom:1.5rem;min-width:0}
.brand-title{display:flex;align-items:center;gap:.6rem;min-width:0;flex:1 1 auto}
.badge-img{width:72px;height:auto;border-radius:6px;flex:0 0 auto;margin-right:.6rem}
.brand-title h1{min-width:0;font-size:1.5rem;line-height:1.2;overflow-wrap:break-word}
.brand-subtitle{color:var(--muted);font-size:1.2rem;font-weight:normal}
.lead{margin:0 0 1rem;color:var(--muted)}
.counters{list-style:none;padding:0;margin:0;display:grid;gap:1rem}
.counter-group-heading{margin:.25rem 0 -.25rem;padding:.25rem 0;border-bottom:1px solid rgba(15,23,42,0.08)}
.counter-group-heading h3{margin:0;color:var(--accent);font-size:.95rem;line-height:1.2;text-transform:uppercase}
.counter{display:flex;align-items:center;justify-content:space-between;padding:.75rem;border-radius:8px;background:#f8fafc;border:1px solid rgba(15,23,42,0.04)}
.controls{display:flex;align-items:center;gap:.75rem}
.controls .value{min-width:48px;text-align:center;font-weight:700}
button,
.btn,
.link{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:auto;
  max-width:100%;
  min-width:0;
  padding:.6rem 1rem;
  border-radius:8px;
  border:none;
  background:var(--accent);
  color:var(--button-text);
  font-family:inherit;
  font-size:inherit;
  line-height:1.2;
  text-decoration:none;
  cursor:pointer;
  box-sizing:border-box;
}
button:active{transform:translateY(1px)}
.actions{display:flex;gap:1rem;align-items:center;margin-top:1rem}
.btn.secondary,
.link.secondary,
button.secondary{background:var(--accent);color:var(--button-text);border:none}
.btn[aria-current="page"],
.link[aria-current="page"]{background:var(--button-text);color:var(--accent);cursor:default;box-shadow:inset 0 0 0 2px var(--accent)}
.btn.danger,
.btn-reset,
#reset,
.btn-clear,
#clearBtn,
.btn-confirm{background:#ef4444;color:#fff}
.btn.danger:hover,
.btn-reset:hover,
#reset:hover,
.btn-clear:hover,
#clearBtn:hover,
.btn-confirm:hover{background:#dc2626}
.btn.neutral,
.btn-cancel{background:#64748b;color:#fff}
.btn-sm{padding:.25rem .5rem;font-size:.8rem;border-radius:4px}
.btn-danger{background:#b91c1c;color:#fff}
.btn-edit{background:#3b82f6;color:#fff}
.flex-break{flex-basis:100%;height:0}
.shift-action{width:auto}
.page-nav{margin-top:.75rem;display:flex;gap:.75rem;align-items:center;flex-wrap:wrap;min-width:0}
.back{margin-left:auto;color:var(--accent);text-decoration:none}
.visually-hidden{position:absolute!important;height:1px;width:1px;overflow:hidden;clip:rect(1px,1px,1px,1px);white-space:nowrap}
@media(max-width:600px){.badge-img{width:48px;margin-right:.4rem}}

html[data-theme="dark"],
html[data-theme="dark"] body{
  background:#0f1115;
  color:#e8edf5;
}

html[data-theme="dark"] body{
  background:
    radial-gradient(circle at 20% 0%, rgba(255,255,255,.05), transparent 28rem),
    #0f1115;
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .container,
html[data-theme="dark"] .topcard,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .counter,
html[data-theme="dark"] .counter-group-heading,
html[data-theme="dark"] .item,
html[data-theme="dark"] .entry-card,
html[data-theme="dark"] #vehicleEntries,
html[data-theme="dark"] .case-grid,
html[data-theme="dark"] .case-grid-row{
  background:linear-gradient(135deg,#181c22,#101318);
  border-color:#2b3340;
  box-shadow:0 8px 24px rgba(0,0,0,.35);
}

html[data-theme="dark"] .panel,
html[data-theme="dark"] .vehicle-card{
  background:linear-gradient(135deg,#1a1f26,#12161b);
}

html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] label,
html[data-theme="dark"] legend,
html[data-theme="dark"] .meta,
html[data-theme="dark"] .lead,
html[data-theme="dark"] p,
html[data-theme="dark"] .brand-subtitle,
html[data-theme="dark"] .topcard .label,
html[data-theme="dark"] .value,
html[data-theme="dark"] .total,
html[data-theme="dark"] .field-box,
html[data-theme="dark"] .vehicle-meta{
  color:#d7deea;
}

html[data-theme="dark"] .meta,
html[data-theme="dark"] .lead,
html[data-theme="dark"] p,
html[data-theme="dark"] label.small,
html[data-theme="dark"] .vehicle-card .small,
html[data-theme="dark"] .meta-small{
  color:#aeb7c5;
}

html[data-theme="dark"] .panel h3,
html[data-theme="dark"] .counter-group-heading h3,
html[data-theme="dark"] .case-grid-header,
html[data-theme="dark"] .case-grid-cell::before{
  color:var(--button-text);
}

html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select,
html[data-theme="dark"] .field-box{
  background:#0e1116;
  color:#e8edf5;
  border-color:#303846;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder{
  color:#9aa3b2;
}

html[data-theme="dark"] input[type="checkbox"],
html[data-theme="dark"] input[type="radio"]{
  accent-color:var(--button-text);
}

html[data-theme="dark"] table td,
html[data-theme="dark"] table th,
html[data-theme="dark"] .item,
html[data-theme="dark"] .case-item,
html[data-theme="dark"] .case-grid,
html[data-theme="dark"] .case-grid-cell{
  border-color:#2b3340;
}

html[data-theme="dark"] .case-grid-header{
  background:#121722;
}

html[data-theme="dark"] .btn,
html[data-theme="dark"] .link,
html[data-theme="dark"] button{
  background:#03164f;
  color:var(--button-text);
  border:1px solid #243b7a;
}

html[data-theme="dark"] .btn:hover,
html[data-theme="dark"] .link:hover,
html[data-theme="dark"] button:hover{
  border-color:var(--button-text);
}

html[data-theme="dark"] .btn[aria-current="page"],
html[data-theme="dark"] .link[aria-current="page"]{
  background:linear-gradient(180deg,#ffc928,#f0ab00);
  color:#07111f;
  border-color:#f0ab00;
}

html[data-theme="dark"] .btn-clear,
html[data-theme="dark"] .btn-reset,
html[data-theme="dark"] .btn-confirm,
html[data-theme="dark"] #reset,
html[data-theme="dark"] #clearBtn{
  background:#ef4444;
  color:#fff;
  border-color:#ef4444;
}

html[data-theme="dark"] .btn-danger{
  background:#b91c1c;
  color:#fff;
  border-color:#b91c1c;
}

html[data-theme="dark"] .btn-edit{
  background:#1d4ed8;
  color:#fff;
  border-color:#1d4ed8;
}

html[data-theme="dark"] .btn-cancel{
  background:#64748b;
  color:#fff;
  border-color:#64748b;
}

html[data-theme="dark"] .modal-box{
  background:#171a1f;
  color:#e8edf5;
  border:1px solid #2b3340;
}
