:root {
  --bg: #eef1f3;
  --surface: #ffffff;
  --ink: #1b252c;
  --muted: #5d6a73;
  --line: #d5dce0;
  --accent: #0e7c86;
  --accent-ink: #ffffff;
  --ok: #2d8a4e;
  --warn: #9a5c00;
  --bad: #b3261e;
  --plate-top: #e9edf0;
  --plate-bottom: #d4dbe0;
  --plate-edge: #aab4bb;
  --plate-ink: #24313a;
  --radius: 10px;
  --sans: "Segoe UI", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --condensed: "Arial Narrow", "Roboto Condensed", "Helvetica Neue Condensed", "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12181c;
    --surface: #1a2227;
    --ink: #e4eaee;
    --muted: #93a1aa;
    --line: #2c373e;
    --accent: #3fb7bf;
    --accent-ink: #0b2a2d;
    --ok: #5cc27f;
    --warn: #e0a640;
    --bad: #f07067;
    --plate-top: #2b353c;
    --plate-bottom: #1f282e;
    --plate-edge: #45525a;
    --plate-ink: #dde5ea;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--sans);
  font-variant-numeric: tabular-nums;
}
a { color: var(--accent); }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0 0 1rem; letter-spacing: -0.01em; }
h2 { font-size: 1.05rem; margin: 0 0 .75rem; }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.mono { font-family: var(--mono); font-size: .92em; }
.neg { color: var(--bad); }
.pos { color: var(--ok); }
.hint { color: var(--muted); font-weight: 400; font-size: .85em; }
.narrow { max-width: 620px; }
.wrap { word-break: break-all; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* glava */
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top-inner {
  max-width: 1040px; margin: 0 auto; padding: 0 16px;
  display: flex; align-items: center; gap: 24px; min-height: 56px; flex-wrap: wrap;
}
.brand { font-weight: 700; color: var(--ink); text-decoration: none; font-size: 1.05rem; }
.brand-tag { font-weight: 400; color: var(--muted); font-size: .9rem; margin-left: 4px; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 6px; font-size: .95rem; }
.nav a:hover { color: var(--ink); background: var(--bg); }
.nav a.on { color: var(--ink); background: var(--bg); font-weight: 600; }
.logout { display: flex; align-items: center; gap: 10px; margin-left: auto; font-size: .9rem; }
.who { color: var(--muted); }
button.link { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; padding: 0; }

.page { max-width: 1040px; margin: 0 auto; padding: 28px 16px 64px; }

/* gumbi in obrazci */
.btn, .btn-s {
  display: inline-block; border: 0; cursor: pointer; font: inherit; text-decoration: none;
  background: var(--accent); color: var(--accent-ink); border-radius: 7px; padding: 10px 18px; font-weight: 600;
}
.btn-s { background: transparent; color: var(--accent); border: 1px solid var(--line); padding: 5px 10px; font-size: .875rem; font-weight: 500; }
.btn-s:hover { border-color: var(--accent); }
.btn:hover { filter: brightness(1.08); }
form { margin: 0; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.row.tight { gap: 6px; flex-wrap: nowrap; }
label { display: flex; flex-direction: column; gap: 5px; font-size: .9rem; font-weight: 600; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
input, select, textarea {
  font: inherit; font-weight: 400; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 7px; padding: 9px 11px; min-width: 0;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 0; display: flex; flex-direction: column; gap: 12px; }
legend { font-weight: 600; padding: 0 6px; }
details.inline, details.add { margin-top: 8px; }
details summary { list-style: none; display: inline-block; cursor: pointer; }
details summary::-webkit-details-marker { display: none; }
details[open] > form { margin-top: 10px; padding: 12px; background: var(--bg); border-radius: 8px; }

/* obvestila */
.flash { padding: 11px 14px; border-radius: 8px; margin-bottom: 18px; border-left: 4px solid; background: var(--surface); }
.flash-ok { border-color: var(--ok); }
.flash-bad { border-color: var(--bad); }
.alerts { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-direction: column; gap: 8px; }
.alert { padding: 10px 14px; border-radius: 8px; background: var(--surface); border-left: 4px solid var(--muted); }
.alert-bad { border-color: var(--bad); }
.alert-warn { border-color: var(--warn); }
.alert-info { border-color: var(--accent); }
.empty { color: var(--muted); padding: 14px 0; }

/* prijava */
.auth { max-width: 400px; margin: 6vh auto 0; background: var(--surface); padding: 28px; border-radius: var(--radius); border: 1px solid var(--line); }

/* ---------- portal stranke ---------- */
.today { margin: 4px 0 28px; }
.today-label { color: var(--muted); margin: 0 0 2px; }
.today-value { font-size: clamp(2.2rem, 7vw, 3.6rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.05; margin: 0 0 8px; }

.plates { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; margin-bottom: 36px; }

/* tipska ploščica stroja: kovinska ploščica z zakovicami */
.plate {
  position: relative;
  color: var(--plate-ink);
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.035) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, var(--plate-top), var(--plate-bottom));
  border: 1px solid var(--plate-edge);
  border-radius: 6px;
  padding: 20px 24px 16px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), inset 0 -1px 0 rgba(0,0,0,.08);
}
.plate::before, .plate::after {
  content: ""; position: absolute; top: 9px; width: 8px; height: 8px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,.8), var(--plate-edge) 60%);
  box-shadow: 0 0 0 1px rgba(0,0,0,.12);
}
.plate::before { left: 9px; }
.plate::after { right: 9px; }
.plate-off { opacity: .6; }
.plate-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--plate-edge); }
.plate-model { font-family: var(--condensed); font-stretch: condensed; font-weight: 700; font-size: 1.45rem; line-height: 1.1; letter-spacing: .01em; }
.plate-label { font-size: .85rem; opacity: .75; margin-top: 2px; }
.plate-status { display: flex; align-items: center; gap: 7px; font-weight: 600; font-size: .9rem; white-space: nowrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }
.plate-specs { margin: 12px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.plate-specs div { display: flex; flex-direction: column; }
.plate-specs .wide { grid-column: 1 / -1; }
.plate-specs dt { font-size: .75rem; opacity: .7; }
.plate-specs dd { margin: 0; font-family: var(--condensed); font-stretch: condensed; font-weight: 700; font-size: 1.05rem; }
.plate-foot { display: flex; gap: 10px; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--plate-edge); flex-wrap: wrap; }
.plate-foot div { display: flex; flex-direction: column; }
.plate-foot span { font-size: .75rem; opacity: .7; }
.plate-foot b { font-size: .98rem; }

.money { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 28px; }
.money h2 { font-weight: 600; color: var(--muted); font-size: .95rem; margin-bottom: 2px; }
.balance { font-size: 2rem; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 6px; }
.usd { font-size: 1rem; font-weight: 400; color: var(--muted); margin-left: 6px; }
.money-side { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; align-content: center; }
.money-side dt, .stats dt, .kv dt { font-size: .82rem; color: var(--muted); }
.money-side dd, .stats dd { margin: 0; font-weight: 600; }
.addr { word-break: break-all; }

.block { margin-bottom: 32px; }
.block.two { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.chart { width: 100%; height: 170px; display: block; }
.chart .bar { fill: var(--accent); }
.chart .bar:hover { fill: var(--ink); }
.chart .base { stroke: var(--line); }
.chart .ax { fill: var(--muted); font-size: 11px; font-family: var(--sans); }

/* tabele */
.table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.table th, .table td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: .82rem; color: var(--muted); font-weight: 600; background: color-mix(in srgb, var(--bg) 60%, var(--surface)); }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; white-space: nowrap; }
.table.small td, .table.small th { padding: 6px 10px; font-size: .875rem; }
.table tr.dim td { opacity: .5; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
td.actions { display: table-cell; }
td.actions > * { display: inline-flex; margin: 2px 4px 2px 0; vertical-align: middle; }
.addr-cell { max-width: 220px; word-break: break-all; }
.tx { white-space: nowrap; }

.pill { display: inline-block; font-size: .78rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; }
.pill-ok { color: var(--ok); }
.pill-bad { color: var(--bad); }
.pill-warn { color: var(--warn); }
.pill-info { color: var(--accent); }
.pill-neutral { color: var(--muted); }

/* admin */
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.head-row h1, .head-row h2 { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 0 0 28px; }
.stats div { background: var(--surface); padding: 14px 16px; }
.stats dd { font-size: 1.2rem; }
.kv { margin: 0 0 12px; display: grid; gap: 8px; }
.kv div { display: grid; grid-template-columns: 160px 1fr; gap: 12px; }
.kv dd { margin: 0; word-break: break-all; }
.actions-bar { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-top: 18px; }
.creds dd { font-size: 1.05rem; }

@media (max-width: 720px) {
  .money, .block.two { grid-template-columns: 1fr; }
  .table { display: block; overflow-x: auto; white-space: nowrap; }
  .table.fluid { display: table; white-space: normal; font-size: .9rem; }
  .table.fluid th, .table.fluid td { padding: 8px 8px; }
  .chart .ax { font-size: 22px; }
  .kv div { grid-template-columns: 1fr; gap: 0; }
  .top-inner { gap: 10px; padding-top: 8px; padding-bottom: 8px; }
  .logout { margin-left: 0; }
  .row.tight { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
