:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --ink: #1f2a24;
  --ink-soft: #5b6660;
  --line: #dfdcd3;
  --accent: #003a7d;
  --accent-ink: #ffffff;
  --good: #2f6b4f;
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 18px;
  line-height: 1.4;
}

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}

header.top {
  padding: 18px 16px 10px;
  border-bottom: 3px solid var(--ink);
  background: var(--surface);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

header.top .logo {
  height: 40px;
  flex-shrink: 0;
}

header.top .brand {
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 600;
}

header.top h1 {
  margin: 4px 0 0;
  font-size: 26px;
  font-weight: 800;
}

h2 { font-size: 20px; margin: 28px 0 12px; }

a { color: var(--accent); }

.vehicle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.vehicle-card {
  display: block;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 14px;
  text-decoration: none;
  color: var(--ink);
  text-align: center;
  font-weight: 700;
  font-size: 20px;
  transition: border-color 0.15s ease, transform 0.05s ease;
}

.vehicle-card:active { transform: scale(0.98); }
.vehicle-card:hover { border-color: var(--accent); }

.vehicle-card .plate {
  display: block;
  margin-top: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  letter-spacing: 0.03em;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 20px;
}

.field { margin-bottom: 16px; }

label {
  display: block;
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 6px;
}

input[type="date"],
input[type="text"],
input[type="number"] {
  width: 100%;
  padding: 14px 12px;
  font-size: 20px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
}

input:focus {
  outline: none;
  border-color: var(--accent);
}

.km-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.btn {
  display: inline-block;
  padding: 14px 22px;
  font-size: 18px;
  font-weight: 700;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  width: 100%;
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border: 2px solid var(--line);
}

.btn-small {
  padding: 8px 12px;
  font-size: 14px;
}

.btn-danger {
  background: #fff;
  color: #a03b2e;
  border: 2px solid #e4b4a8;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  font-size: 15px;
}

th, td {
  border: 1px solid var(--line);
  padding: 8px 6px;
  text-align: left;
}

th {
  background: #efece4;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.row-actions { white-space: nowrap; }
.row-actions a { margin-right: 6px; font-size: 13px; }

.total-line {
  margin-top: 10px;
  font-weight: 700;
  text-align: right;
}

.month-picker {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.month-picker select {
  padding: 10px;
  font-size: 16px;
  border-radius: 8px;
  border: 2px solid var(--line);
}

.hint {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: -8px;
  margin-bottom: 16px;
}

.back-link {
  display: inline-block;
  margin-bottom: 14px;
  font-weight: 600;
  text-decoration: none;
}

.empty-state {
  text-align: center;
  color: var(--ink-soft);
  padding: 30px 10px;
}

/* Print view */
.print-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 16px;
}

.print-header h1 { font-size: 22px; margin: 0; }
.print-header .vehicle-id { text-align: right; font-size: 18px; font-weight: 800; }
.print-header .vehicle-id .plate { display: block; font-size: 15px; font-weight: 600; color: var(--ink-soft); }

.print-actions { margin: 16px 0; }

@media print {
  @page {
    size: landscape;
    margin: 8mm;
  }
  .no-print { display: none !important; }
  body { background: #fff; font-size: 12px; }
  .wrap { max-width: none; padding: 0; margin: 0; }
  .print-header { margin-bottom: 8px; }
  .print-header h1 { font-size: 18px; }
  .print-header .vehicle-id { font-size: 15px; }
  table {
    font-size: 9.5px;
    table-layout: fixed;
    width: 100%;
  }
  th, td {
    padding: 2px 4px;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  th { background: #eee; -webkit-print-color-adjust: exact; print-color-adjust: exact; font-size: 8.5px; }
  .total-line { font-size: 10px; margin-top: 6px; }
  .card { border: none; padding: 0; }
}
