:root {
  --bg: #f4f5f7; --surface: #fff; --ink: #1b2430; --muted: #5f6b7a; --line: #dfe3e8;
  --brand: #12355b; --brand-ink: #fff; --accent: #c8102e; --ok: #1f7a4d; --warn: #9a6400; --info: #1d5fa8;
  --radius: 8px; --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 var(--font); color: var(--ink); background: var(--bg); }
a { color: var(--info); }
h1 { font-size: 1.5rem; margin: 0 0 .25rem; } h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .nowrap { white-space: nowrap; }
.topbar { background: var(--brand); color: var(--brand-ink); display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; padding: .6rem 1.25rem; }
.topbar .logo { font-weight: 700; font-size: 1.15rem; letter-spacing: .02em; color: #fff; text-decoration: none; }
.topbar .logo span { color: #ff8a9b; }
.topbar nav { display: flex; gap: .25rem; flex: 1; flex-wrap: wrap; }
.topbar nav a { color: #dbe6f2; text-decoration: none; padding: .35rem .7rem; border-radius: 6px; }
.topbar nav a.on, .topbar nav a:hover { background: rgba(255,255,255,.14); color: #fff; }
.topbar .who { text-align: right; font-size: .85rem; line-height: 1.3; }
.topbar .who strong { display: block; font-size: .95rem; }
.topbar form { margin: 0; }
.context { background: #0d2742; color: #cfe0f1; padding: .3rem 1.25rem; font-size: .85rem; display: flex; gap: 1rem; flex-wrap: wrap; }
.context a { color: #fff; }
main { max-width: 1240px; margin: 1.5rem auto; padding: 0 1.25rem; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; margin-bottom: 1rem; }
.grid { display: grid; gap: 1rem; } .g2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); } .g3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .55rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #fafbfc; }
tbody tr:hover { background: #f8fafc; }
.plate { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700; letter-spacing: .06em; border: 1.5px solid var(--ink); border-radius: 4px; padding: .05rem .4rem; background: #fff; white-space: nowrap; }
.badge { display: inline-block; padding: .12rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.st-routed { background: #fde8ea; color: #9b1026; } .st-assigned { background: #fff1d6; color: #7a4f00; }
.st-en_route { background: #dfeaf8; color: #174c88; } .st-on_site { background: #e4e0fa; color: #40318f; }
.st-removed { background: #d9f0ee; color: #0f5f58; } .st-completed { background: #dff3e7; color: #17603c; }
form.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; align-items: end; }
label { display: block; font-size: .82rem; font-weight: 600; color: var(--muted); margin-bottom: .2rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], select, textarea {
  width: 100%; padding: .5rem .6rem; border: 1px solid #b9c1cc; border-radius: 6px; font: inherit; background: #fff; color: var(--ink); }
textarea { min-height: 7rem; font-family: ui-monospace, Menlo, monospace; font-size: .85rem; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid #8ab4f8; outline-offset: 1px; }
input:disabled, select:disabled { background: #eef0f3; color: var(--muted); }
.field { margin-bottom: .9rem; } .field .help { font-size: .8rem; color: var(--muted); margin-top: .2rem; }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; color: var(--ink); font-size: .95rem; }
.check input { width: 1.05rem; height: 1.05rem; }
.btn { display: inline-block; background: var(--brand); color: #fff; border: 0; border-radius: 6px; padding: .55rem 1rem; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: #0d2742; } .btn.ghost { background: transparent; color: var(--brand); border: 1px solid #b9c1cc; } .btn.ghost:hover { background: #eef2f6; }
.btn.light { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.3); padding: .3rem .7rem; font-weight: 500; }
.btn.danger { background: var(--accent); }
.alert { border-radius: var(--radius); padding: .7rem 1rem; margin-bottom: 1rem; border: 1px solid; }
.alert.ok { background: #e8f6ee; border-color: #a9d9bd; color: #17603c; } .alert.err { background: #fdecee; border-color: #f0b3bb; color: #8f1024; }
.alert.info { background: #eaf2fb; border-color: #b7d0ee; color: #174c88; }
dl.data { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: .4rem .9rem; margin: 0; }
dl.data dt { color: var(--muted); font-size: .85rem; } dl.data dd { margin: 0; }
ol.timeline { list-style: none; margin: 0; padding: 0 0 0 1.1rem; border-left: 2px solid var(--line); }
ol.timeline li { position: relative; padding: 0 0 1rem .9rem; }
ol.timeline li::before { content: ""; position: absolute; left: -1.52rem; top: .35rem; width: .7rem; height: .7rem; border-radius: 50%; background: var(--brand); border: 2px solid #fff; }
ol.timeline li.minor::before { background: #aab3bf; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.photos img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); display: block; }
.pagination { display: flex; gap: .75rem; align-items: center; justify-content: flex-end; margin-top: .9rem; }
.login { max-width: 400px; margin: 9vh auto; padding: 0 1rem; } .login .brand { text-align: center; margin-bottom: 1.25rem; }
.login .brand b { font-size: 1.9rem; color: var(--brand); } .login .brand b span { color: var(--accent); }
.tiles a { display: block; text-decoration: none; color: inherit; } .tiles a:hover .card { border-color: var(--brand); }
.stat { font-size: 1.7rem; font-weight: 700; }
.empty { text-align: center; padding: 2.2rem 1rem; color: var(--muted); }
@media (max-width: 640px) { .topbar .who { text-align: left; } dl.data { grid-template-columns: 1fr; gap: .1rem .9rem; } dl.data dd { margin-bottom: .5rem; } }
