:root { --red: #c8000a; --bg: #f4f5f7; --line: #e2e4e8; --muted: #6b7280; --green: #15803d; --amber: #b45309; }
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 "Segoe UI", Arial, sans-serif; background: var(--bg); color: #111; }
a { color: inherit; }
header { display: flex; align-items: center; justify-content: space-between; padding: 10px 24px; background: #fff; border-bottom: 3px solid var(--red); position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 800; font-size: 20px; color: var(--red); text-decoration: none; letter-spacing: 1px; }
.brand span { color: #333; font-weight: 400; letter-spacing: 0; font-size: 16px; }
nav { display: flex; gap: 6px; align-items: center; }
nav a { text-decoration: none; padding: 6px 12px; border-radius: 6px; }
nav a:not(.btn):hover { background: var(--bg); }
main { max-width: 1150px; margin: 0 auto; padding: 20px 24px 60px; }
h1 { font-size: 24px; margin: 8px 0 16px; }
h2 { font-size: 16px; margin: 0 0 10px; text-transform: uppercase; letter-spacing: .5px; color: #444; }
.head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.head h1, .head h2 { margin-bottom: 12px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; margin-bottom: 18px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.grid3 { display: grid; grid-template-columns: 2fr 2fr 1fr; gap: 0 14px; }
@media (max-width: 800px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.btn { display: inline-block; background: var(--red); color: #fff; border: 1px solid var(--red); border-radius: 6px; padding: 7px 14px; font: inherit; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { filter: brightness(1.1); }
.btn.ghost { background: #fff; color: #222; border-color: #c9ccd2; }
.btn.danger { background: #fff; color: var(--red); border-color: var(--red); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.actions form, form.inline { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.flash { background: #ecfdf5; border: 1px solid #a7f3d0; padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; }
.flash.viga { background: #fef2f2; border-color: #fecaca; }
.search { display: flex; gap: 8px; margin-bottom: 18px; }
.search input { flex: 1; font-size: 20px; padding: 12px 16px; border: 2px solid #c9ccd2; border-radius: 10px; }
.search input:focus { border-color: var(--red); outline: none; }
.search button { font-size: 17px; padding: 0 22px; background: var(--red); color: #fff; border: 0; border-radius: 10px; cursor: pointer; }
.filters { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.filters input, .filters select { padding: 6px 8px; border: 1px solid #c9ccd2; border-radius: 6px; font: inherit; }
.filters .total { margin-left: auto; }
.filters button { padding: 6px 14px; border: 1px solid #c9ccd2; border-radius: 6px; background: #fff; font: inherit; cursor: pointer; }
.filters button:hover { border-color: var(--red); }
table.list th.r { text-align: right; }
table.list { width: 100%; border-collapse: collapse; background: #fff; }
table.list th { text-align: left; font-size: 13px; color: var(--muted); border-bottom: 2px solid var(--line); padding: 8px; }
table.list td { padding: 8px; border-bottom: 1px solid var(--line); }
table.list tr.click { cursor: pointer; }
table.list tr.click:hover td { background: #fafafa; }
table.list tfoot td { border: 0; }
table.list tr.sum td { font-weight: 700; font-size: 17px; border-top: 2px solid #111; }
.pdf-link { color: var(--red); text-decoration: none; }
.pdf-link:hover { text-decoration: underline; }
.r { text-align: right; } .muted { color: var(--muted); } .small { font-size: 13px; } .pre { white-space: pre-wrap; }
.late { color: var(--red); font-weight: 600; }
.tag { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 99px; background: #eef0f3; color: #333; text-decoration: none; font-weight: 500; vertical-align: middle; }
.tag.mustand { background: #f3f4f6; color: #555; }
.tag.valjastatud { background: #fef3c7; color: var(--amber); }
.tag.makstud { background: #dcfce7; color: var(--green); }
.plate { display: inline-block; font-family: Consolas, monospace; font-weight: 700; border: 2px solid #222; border-radius: 4px; padding: 0 6px; background: #fff; letter-spacing: 1px; }
.plate.big { font-size: 22px; padding: 2px 10px; }
.row { display: block; padding: 8px 6px; border-bottom: 1px solid var(--line); text-decoration: none; }
.row:hover { background: #fafafa; }
dl { display: grid; grid-template-columns: 150px 1fr; gap: 6px 10px; margin: 0; }
dt { color: var(--muted); } dd { margin: 0; }
.history { border-bottom: 1px solid var(--line); padding: 10px 0; }
.history ul { margin: 6px 0 0; padding-left: 20px; }
.form label { display: block; margin-bottom: 12px; font-size: 13px; color: #444; }
.form input, .form select, .form textarea { display: block; width: 100%; margin-top: 3px; padding: 8px 10px; border: 1px solid #c9ccd2; border-radius: 6px; font: inherit; font-size: 15px; color: #111; background: #fff; }
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--red); outline: none; }
.form .radio { display: flex; gap: 20px; margin-bottom: 12px; }
.form .radio label { display: flex; gap: 6px; align-items: center; font-size: 15px; }
.form .radio input { width: auto; display: inline; margin: 0; }
.form .inline { display: flex; gap: 6px; align-items: center; }
.form .inline .btn { margin-top: 3px; }
.plate-input { text-transform: uppercase; font-family: Consolas, monospace; font-weight: 700; letter-spacing: 1px; }
table.rows { width: 100%; border-collapse: collapse; margin: 10px 0; }
table.rows th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 500; padding: 4px; }
table.rows td { padding: 3px 4px; }
table.rows input { margin: 0; }
table.rows .num { width: 95px; text-align: right; }
table.rows th.unit, table.rows input.unit { width: 70px; }
table.rows td.summa { font-weight: 600; padding-right: 8px; }
table.rows .x { border: 0; background: none; font-size: 20px; color: #999; cursor: pointer; }
table.rows .x:hover { color: var(--red); }
.form .total { text-align: right; font-size: 19px; margin: 8px 0 16px; }
.form .total .btn { font-size: 13px; vertical-align: middle; }
/* avalehe arvete plokk */
.st-tasutud { --c: #0ca30c; } .st-tasumata { --c: #2a78d6; } .st-aegunud { --c: #d03b3b; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 14px; }
.tile { padding: 14px 18px; text-align: center; text-decoration: none; }
.tile + .tile { border-left: 1px solid var(--line); }
.tile:hover { background: #fafafa; }
.tile-label { font-size: 15px; color: #333; display: flex; align-items: center; justify-content: center; gap: 8px; }
.tile-value { font-size: 26px; font-weight: 600; margin: 2px 0; }
.tile-sub { font-size: 13px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); display: inline-block; }
.legend { display: flex; gap: 16px; font-size: 13px; color: #444; margin-bottom: 4px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--c); margin-right: 6px; vertical-align: -1px; }
.chart { position: relative; width: 100%; }
.chart svg { display: block; }
.chart .grid { stroke: #e1e0d9; stroke-width: 1; }
.chart .axis { stroke: #c3c2b7; stroke-width: 1; }
.chart .tick { fill: #898781; font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .val { fill: #52514e; font-size: 12px; font-weight: 600; }
.chart .seg { fill: var(--c); }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit.on { fill: rgba(11, 11, 11, 0.04); }
.chart-tip { position: absolute; pointer-events: none; background: #fff; border: 1px solid rgba(11,11,11,.12); border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0,0,0,.10); padding: 8px 10px; font-size: 13px; min-width: 170px; z-index: 3; }
.chart-tip div { display: flex; align-items: center; }
.chart-tip div span { margin-left: auto; padding-left: 14px; font-variant-numeric: tabular-nums; }
.chart-tip .sum { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; font-weight: 600; }
.dash details { margin-top: 8px; }
@media (max-width: 700px) { .tiles { grid-template-columns: 1fr; } .tile + .tile { border-left: 0; border-top: 1px solid var(--line); } }
.bar { display: inline-block; width: calc(100% - 50px); height: 8px; background: #eef0f3; border-radius: 4px; vertical-align: middle; margin-right: 6px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--red); }
.form label.check { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.form label.check input { width: auto; margin: 0; }
.tag.pakkumine { background: #dbeafe; color: #1e40af; }
.tag.kinnitatud { background: #dcfce7; color: var(--green); }
.tag.keeldunud { background: #fee2e2; color: #991b1b; }
table.list tr.group td { font-size: 15px; font-weight: 600; padding-top: 16px; border-bottom: 1px solid var(--line); }
table.list tr.subtotal td { border-bottom: 0; padding-bottom: 6px; }
.tag.kreedit { background: #fee2e2; color: #991b1b; }
nav form.logout { margin: 0; }
nav form.logout button { background: none; border: 0; font: inherit; color: var(--muted); cursor: pointer; padding: 6px 8px; }
nav form.logout button:hover { color: var(--red); }
body.auth { display: flex; min-height: 100vh; align-items: center; justify-content: center; }
.auth-box { width: 380px; max-width: 92vw; background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--red);
  border-radius: 10px; padding: 26px 28px; }
.auth-box .brand { display: block; margin-bottom: 18px; font-size: 22px; }
.auth-box h2 { text-transform: none; letter-spacing: 0; font-size: 18px; color: #111; }
.btn.wide { width: 100%; padding: 10px; font-size: 16px; }
.code-input { font-size: 24px !important; letter-spacing: 6px; text-align: center; font-family: Consolas, monospace; }
.qr { text-align: center; margin: 10px 0; }
.qr svg { width: 200px; height: 200px; }
code.secret { font-size: 13px; word-break: break-all; background: #f3f4f6; padding: 2px 6px; border-radius: 4px; }
.inline-test { display: flex; gap: 8px; margin-bottom: 12px; }
.inline-test input { margin: 0; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; }
