:root {
  font: 16px/1.5 system-ui, sans-serif;
  color: #191a1b;
  background: #f7f6f4;
  --orange: #ff5a00;
  --accent: #b53d00;
  --muted: #5e5c58;
  --border: #e8e4df;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.1; letter-spacing: -.04em; }
h2 { font-size: 1.2rem; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; border-radius: 10px; padding: .55rem .85rem; font-weight: 700; }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input, textarea, select { padding: .6rem .75rem; border: 1px solid #cbc6c1; border-radius: 8px; background: white; color: inherit; min-width: 0; }
label { display: grid; gap: .3rem; }
form { display: grid; gap: 1rem; }
.primary { border: 1px solid var(--accent); background: var(--accent); color: white; }
.outline { border: 1px solid #e9c4ad; background: white; color: var(--accent); }
.card { background: white; border: 1px solid var(--border); border-radius: 14px; padding: 1.2rem; }
.login { width: min(100% - 2rem, 400px); margin: 10vh auto; padding: 1.75rem; }
.login h1 { margin: .6rem 0 1.3rem; font-size: 1.65rem; }
.brand { color: var(--accent); font-size: 1.7rem; font-weight: 900; letter-spacing: -.055em; }
.eyebrow { font-size: .72rem; letter-spacing: .12em; color: var(--muted); font-weight: 700; }
.shell { display: grid; grid-template-columns: 225px minmax(0, 1fr); min-height: 100vh; }
aside { padding: 1.75rem 1.15rem; background: white; border-right: 1px solid var(--border); }
nav { display: grid; gap: .4rem; margin-top: 2rem; }
nav button, .filters button:not(.outline) { border: 1px solid transparent; background: transparent; text-align: left; color: inherit; }
nav button[aria-current], .filters button[aria-pressed="true"] { color: var(--accent); background: #fff0e6; border-color: #f8e3d4; }
.main { width: min(100%, 1300px); padding: clamp(1rem, 3vw, 2.5rem); }
header, .toolbar { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; }
#subtitle, #client-count { color: var(--muted); margin-top: .4rem; }
[role="status"]:not(:empty) { margin: .8rem 0; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; margin: 1.35rem 0; }
.metric { border-top: 3px solid var(--orange); color: var(--muted); }
.metric strong { display: block; font-size: 1.8rem; color: #191a1b; }
#drivers, #clients { margin-top: 1.25rem; }
.search { display: flex; align-items: center; position: relative; }
.search input { padding-left: 2.25rem; width: min(100%, 280px); }
.search svg { position: absolute; left: .7rem; width: 1.1rem; fill: none; stroke: var(--muted); stroke-width: 2; pointer-events: none; }
.filters { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: 1rem; }
.scroll { overflow-x: auto; margin-top: 1rem; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { background: #f5f3f0; }
td, th { padding: .8rem; border-bottom: 1px solid var(--border); }
td:first-child { font-weight: 700; }
td.empty { text-align: center; color: var(--muted); }
.badge { display: inline-block; color: #914000; background: #fff0e6; font-size: .85rem; border-radius: 8px; padding: .2rem .55rem; }
.badge.approved { background: #e8f4eb; color: #155729; }
dialog { border: 1px solid var(--border); border-radius: 14px; padding: 1.4rem; width: min(95vw, 470px); }
dialog::backdrop { background: #18151266; }
dialog p { margin: .65rem 0; }
#credit-fields { display: grid; gap: .65rem; }
#new-balance { color: #155729; font-weight: 750; }
#vehicle-photo { width: 100%; max-height: 280px; object-fit: contain; margin: .7rem 0; }
@media (max-width: 700px) {
  .shell { display: block; }
  aside { border-right: 0; border-bottom: 1px solid var(--border); padding: .8rem 1rem; }
  nav { display: flex; flex-wrap: wrap; margin-top: .75rem; }
  .metrics { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
  .card { padding: .85rem; }
}

#reports { margin-top: 1.25rem; }
#report-list, #history-list, #history-wallet { overflow-x: auto; margin: .8rem 0; }
dialog:has(#history:not([hidden])) { width: min(95vw, 850px); }
#profile-photo { width: 76px; height: 76px; object-fit: cover; border-radius: 50%; }
details { border-top: 1px solid var(--border); margin-top: 1.25rem; padding-top: .75rem; }
summary { cursor: pointer; font-weight: 750; margin-bottom: .75rem; }
#finance-form { max-width: 420px; }
