:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #1c2026;
  --muted: #667085;
  --line: #e2e5ea;
  --accent: #1f5fbf;
  --accent-text: #ffffff;
  --ok: #1f7a3d;
  --ok-bg: #e6f4ea;
  --warn: #8a5a00;
  --warn-bg: #fff3d6;
  --bad: #a4262c;
  --bad-bg: #fde7e9;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171b;
    --surface: #1c2026;
    --text: #e8eaee;
    --muted: #9aa3b2;
    --line: #2b313a;
    --accent: #6ea3ee;
    --accent-text: #0f1722;
    --ok: #7bd69a;
    --ok-bg: #1b3326;
    --warn: #f2c66d;
    --warn-bg: #3a2f14;
    --bad: #f2868c;
    --bad-bg: #3b1d20;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
main { max-width: 960px; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.6rem; margin: 0 0 4px; }
h2 { font-size: 1.15rem; margin: 0 0 12px; }
small { font-weight: 400; color: var(--muted); }
section { margin-bottom: 32px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }

.top {
  display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
  padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; color: var(--text); }
.search { flex: 1 1 280px; }
.search input { width: 100%; }

input, select, textarea, button {
  font: inherit; color: var(--text);
}
input, select, textarea {
  width: 100%; padding: 8px 10px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px;
}
textarea { resize: vertical; }
button {
  padding: 8px 14px; border: 0; border-radius: 8px; cursor: pointer;
  background: var(--accent); color: var(--accent-text); font-weight: 600;
}
button.link { background: none; color: var(--muted); padding: 2px 6px; font-weight: 400; }
button.link.danger:hover { color: var(--bad); }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.grid label { display: flex; flex-direction: column; gap: 4px; font-size: .875rem; color: var(--muted); }
.grid .wide { grid-column: 1 / -1; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.card {
  display: flex; flex-direction: column; gap: 6px; padding: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--text);
}
.card:hover { border-color: var(--accent); text-decoration: none; }
.card-title { font-weight: 700; font-size: 1.05rem; }

.plate {
  display: inline-block; align-self: flex-start; padding: 2px 10px;
  border: 2px solid var(--text); border-radius: 6px; font-weight: 700; letter-spacing: .08em;
  background: var(--surface);
}
.pill { display: inline-block; align-self: flex-start; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; }
.pill.ok { color: var(--ok); background: var(--ok-bg); }
.pill.warn { color: var(--warn); background: var(--warn-bg); }
.pill.bad { color: var(--bad); background: var(--bad-bg); }

.vehicle-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.facts { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }

.tabs {
  position: sticky; top: 0; z-index: 5; display: flex; gap: 4px; flex-wrap: wrap;
  padding: 8px 0; margin-bottom: 16px; background: var(--bg); border-bottom: 1px solid var(--line);
}
.tabs a { padding: 6px 12px; border-radius: 8px; color: var(--text); }
.tabs a:hover { background: var(--surface); text-decoration: none; }

.list { list-style: none; margin: 0 0 12px; padding: 0; }
.list li { padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; }
.row { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.actions { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.when { font-size: .8rem; color: var(--muted); }
.tag {
  display: inline-block; padding: 0 8px; margin-left: 6px; border-radius: 6px;
  font-size: .75rem; background: var(--bg); border: 1px solid var(--line); color: var(--muted);
}
.tag.prio1 { color: var(--bad); border-color: var(--bad); }
.links { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; }

details.add { margin-top: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
details summary { cursor: pointer; font-weight: 600; }
details[open] > summary { margin-bottom: 12px; }
form.inline { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; justify-content: flex-end; }
form.inline input { width: 130px; }

.pricebox { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); }
.shoplist { margin: 6px 0 0; padding-left: 18px; }
.shoplist li { margin-bottom: 2px; }

@media (max-width: 560px) {
  .facts { align-items: flex-start; }
  .row { flex-direction: column; }
  .actions { align-items: flex-start; }
}

/* Konten */
.narrow { max-width: 420px; margin: 24px auto; }
form.stack { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
form.stack label { display: flex; flex-direction: column; gap: 4px; font-size: .875rem; color: var(--muted); }
form.plain { display: inline; margin: 0; }
form.inline-left { display: flex; gap: 8px; flex-wrap: wrap; max-width: 520px; }
form.inline-left select { flex: 1 1 260px; width: auto; }
.usernav { display: flex; gap: 12px; align-items: center; margin-left: auto; }
.banner { padding: 10px 14px; border-radius: 10px; margin: 0 0 16px; }
.banner.ok { color: var(--ok); background: var(--ok-bg); }
.banner.warn { color: var(--warn); background: var(--warn-bg); }
.banner.bad { color: var(--bad); background: var(--bad-bg); }
div.banner .big { font-size: 1.4rem; margin: 8px 0; user-select: all; }
button.danger:not(.link) { background: var(--bad); color: #fff; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
label.check { display: flex; gap: 10px; align-items: flex-start; }
label.check input { width: auto; margin-top: 5px; }
.narrow.wide-ok { max-width: 640px; }
