:root {
  --navy: #153c60;
  --teal: #1d9c9a;
  --teal-dark: #157d7b;
  --bg: #f4f7f9;
  --card: #ffffff;
  --line: #e1e8ee;
  --muted: #63788a;
  --danger: #b53c3c;
  --radius: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg); color: var(--navy); line-height: 1.6; min-height: 100vh;
  display: flex; flex-direction: column;
}
a { color: var(--teal-dark); }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: 2rem; letter-spacing: -.02em; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

/* header + footer */
.site-header {
  background: #fff; border-bottom: 1px solid var(--line); padding: 16px 6%;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.logo { font-size: 1.4rem; font-weight: 700; color: var(--navy); text-decoration: none; }
.logo span { color: var(--teal); }
.site-header nav { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.site-header nav a { color: var(--navy); text-decoration: none; font-size: .95rem; }
.site-header nav a:hover { color: var(--teal-dark); }
.site-header nav a.current { font-weight: 700; }
.site-header nav a.btn, .site-header nav a.btn:hover { color: #fff; }
.site-header nav button.linklike { color: var(--navy); font-size: .95rem; }
.site-footer { margin-top: auto; padding: 28px 6%; color: var(--muted); font-size: .875rem; border-top: 1px solid var(--line); background: #fff; }
.site-footer a { color: var(--muted); margin-right: 16px; }

main.container { width: 100%; max-width: 980px; margin: 36px auto 56px; padding: 0 20px; }
main.narrow { max-width: 520px; }
main.medium { max-width: 760px; }

/* cards + forms */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 28px; margin-bottom: 22px; box-shadow: 0 4px 18px rgba(0,0,0,.04); }
.card > :last-child { margin-bottom: 0; }
label { display: block; font-weight: 600; margin: 16px 0 6px; font-size: .95rem; }
label .hint { font-weight: 400; color: var(--muted); }
input, textarea, select {
  width: 100%; padding: 12px; border: 1px solid #ccd5dd; border-radius: 8px; font: inherit; color: var(--navy); background: #fff;
}
input:focus, textarea:focus, select:focus, button:focus-visible, a:focus-visible { outline: 3px solid rgba(29,156,154,.45); outline-offset: 1px; }
textarea { min-height: 90px; resize: vertical; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 650px) { .row { grid-template-columns: 1fr; } }

button, .btn {
  display: inline-block; background: var(--navy); color: #fff; border: 0; border-radius: 8px; padding: 12px 22px;
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; margin-top: 16px;
}
button:hover, .btn:hover { background: var(--teal-dark); color: #fff; }
button:disabled { opacity: .55; cursor: not-allowed; }
button.secondary, .btn.secondary { background: #fff; color: var(--navy); border: 1px solid #b8c6d2; }
button.secondary:hover, .btn.secondary:hover { background: #eef3f6; color: var(--navy); }
button.danger { background: var(--danger); }
button.danger:hover { background: #922d2d; }
button.small, .btn.small { padding: 8px 14px; font-size: .875rem; margin-top: 8px; }
button.linklike { background: none; border: 0; padding: 0; margin: 0; color: var(--teal-dark); text-decoration: underline; font-weight: 400; cursor: pointer; }
button.linklike:hover { background: none; color: var(--navy); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.actions > * { margin-top: 8px; }

.msg { margin: 14px 0 0; padding: 10px 14px; border-radius: 8px; font-size: .95rem; display: none; }
.msg.show { display: block; }
.msg.error { background: #fde8e8; color: #8f2222; }
.msg.ok { background: #e3f6ea; color: #14683a; }
.msg.info { background: #e6f1fb; color: #1d4f84; }
.banner { background: #fff4d6; color: #6b4b00; border: 1px solid #f0d98a; border-radius: 10px; padding: 12px 16px; margin-bottom: 20px; }
.banner button { margin: 0 0 0 8px; }

/* home */
.hero { background: #f0f6f9; text-align: center; padding: 80px 20px; }
.hero h1 { font-size: 2.6rem; max-width: 720px; margin: 0 auto 18px; }
.hero p { color: #516477; font-size: 1.15rem; max-width: 620px; margin: 0 auto 28px; }
.hero .actions { justify-content: center; }
.hero .btn { margin-top: 8px; padding: 15px 30px; }
.features { padding: 56px 6%; text-align: center; max-width: 1100px; margin: 0 auto; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 28px; text-align: left; }
.feature { background: #fff; padding: 28px 22px; border-radius: var(--radius); border: 1px solid var(--line); }
.feature p { color: #516477; margin: 0; }
@media (max-width: 800px) { .feature-grid { grid-template-columns: 1fr; } .hero h1 { font-size: 2rem; } }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 0; display: grid; gap: 14px; }
.steps li { counter-increment: s; padding-left: 46px; position: relative; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--teal); color: #fff; font-weight: 700; display: grid; place-items: center; }

/* garage */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 22px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px 22px; }
.stat b { display: block; font-size: 2rem; line-height: 1.1; }
.stat span { color: var(--muted); font-size: .9rem; }
@media (max-width: 650px) { .stats { grid-template-columns: 1fr; } }
details.panel > summary { cursor: pointer; font-weight: 700; font-size: 1.1rem; list-style-position: inside; }
details.panel[open] > summary { margin-bottom: 14px; }
.vehicle-list { display: grid; gap: 14px; }
a.vehicle-card { display: flex; gap: 16px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; text-decoration: none; color: var(--navy); }
a.vehicle-card:hover { border-color: var(--teal); box-shadow: 0 3px 12px rgba(0,0,0,.06); }
.vehicle-icon { background: #f0f6f9; border-radius: 12px; padding: 12px; font-size: 1.6rem; }
.vehicle-card h3 { margin: 0 0 2px; }
.vehicle-card p { margin: 0; color: var(--muted); font-size: .9rem; }
.spacer { margin-left: auto; }

/* badges */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; border: 1px solid transparent; white-space: nowrap; }
.badge.verified { background: #e3f6ea; color: #14683a; border-color: #b5e2c5; }
.badge.invoice { background: #e6f1fb; color: #1d4f84; border-color: #bcd8f2; }
.badge.owner { background: #eef1f4; color: #4b5d6e; border-color: #d4dce3; }
.badge.disputed { background: #fde8e8; color: #9b2222; border-color: #f2bcbc; }
.badge.pending { background: #fff4d6; color: #7a5600; border-color: #f0d98a; }
.badge.available { background: #e3f6ea; color: #14683a; border-color: #b5e2c5; }

/* records */
.record { border: 1px solid var(--line); border-left: 4px solid var(--teal); border-radius: 10px; padding: 16px 18px; margin-top: 14px; background: #fbfdfe; }
.record.verified { border-left-color: #2e9e5b; }
.record.disputed { border-left-color: #c24a4a; }
.record.owner { border-left-color: #9aa9b6; }
.record header { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.record header strong { font-size: 1.05rem; }
.record dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px 14px; margin: 6px 0; font-size: .95rem; }
.record dt { color: var(--muted); }
.record dd { margin: 0; overflow-wrap: anywhere; }
.record .note { font-size: .9rem; color: var(--muted); margin: 8px 0 0; }
.record .warn { color: #8f5a00; font-size: .9rem; margin: 6px 0 0; }
.record .subform { background: #f4f7f9; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-top: 12px; }
.record ul.plain { margin: 6px 0; padding-left: 20px; font-size: .92rem; }
.linkrow { display: flex; gap: 8px; }
.linkrow input { flex: 1; }
.linkrow button { margin-top: 0; }

/* report */
.report { background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 35px rgba(21,60,96,.08); overflow: hidden; }
.report-head { background: var(--navy); color: #fff; padding: 32px 36px 26px; }
.report-head h1 { margin: 0 0 4px; font-size: 1.8rem; }
.report-head p { margin: 0; color: #d5e6ef; }
.report-body { padding: 28px 36px 36px; }
.meta { background: #f4f8fa; border: 1px solid #e0e9ee; border-radius: 10px; padding: 8px 20px; margin-bottom: 22px; }
.meta div { display: flex; justify-content: space-between; gap: 20px; padding: 8px 0; }
.meta div + div { border-top: 1px solid #e0e9ee; }
.meta span { color: var(--muted); }
.meta strong { text-align: right; overflow-wrap: anywhere; }
.vehicle-box { border-left: 5px solid var(--teal); background: #f4f8fa; padding: 20px 24px; border-radius: 10px; margin-bottom: 22px; }
.vehicle-box h2 { margin: 0 0 4px; font-size: 1.5rem; }
.vehicle-box p { margin: 0; color: var(--muted); }
.report-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 26px; }
.report-stats .stat { border-top: 4px solid var(--teal); padding: 14px 16px; }
.report-stats .stat b { font-size: 1.6rem; }
@media (max-width: 760px) { .report-stats { grid-template-columns: 1fr 1fr; } .report-body, .report-head { padding-left: 20px; padding-right: 20px; } }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0 0 8px; font-size: .88rem; color: var(--muted); }
.notice { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); font-size: .85rem; color: var(--muted); }
.print-only { display: none; }
@media print {
  body { background: #fff; }
  .site-header, .site-footer, .no-print { display: none !important; }
  main.container { margin: 0; max-width: none; padding: 0; }
  .report { box-shadow: none; border: 0; }
  .record { break-inside: avoid; }
  .report-head, .badge { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
pre.mail { white-space: pre-wrap; background: #f4f7f9; border: 1px solid var(--line); border-radius: 8px; padding: 12px; font-size: .88rem; overflow-wrap: anywhere; }
.big-ref { font-size: 1.4rem; font-weight: 700; letter-spacing: .04em; }
.draft-banner { background: #fff4d6; border: 1px solid #f0d98a; border-radius: 10px; padding: 10px 14px; margin-bottom: 20px; font-size: .92rem; color: #6b4b00; }
table.simple { width: 100%; border-collapse: collapse; }
table.simple th, table.simple td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
