/* Voltie Lite operator UI. Brand: Voltie 2026 Corporate Guidelines (light theme):
   white / Editorial Background #EAF4F8, accent SKY Blue #00CBFF, red only for warnings,
   radius >= 12 px doubling outwards. Inter from Google Fonts (index.html); Open Runde is not used (no licence
   text at hand, Optimus 20279): headings fall back to the system's rounded face. Status colours: bezier UI/UX 4.4,
   Tamás tg 22267: no green, charging SKY Blue, online black, late amber, offline grey, error / disabled red. */
:root {
  --bg: #EAF4F8;
  --surface: #FFFFFF;
  --ink: #000000;
  --muted: #4F5B66;
  --line: #CFDEE6;
  --accent: #00CBFF;
  --accent-ink: #0A5C8C;      /* text-safe darker blue for links on white */
  --blue: #367CDA;
  --red: #FF0000;
  --red-ink: #B00000;
  --amber: #E0A100;
  --amber-ink: #8A6200;
  --grey: #9AA5AE;
  --warn-bg: #FFF4E5;
  --radius: 12px;
  --radius-2: 24px;
  --font-head: ui-rounded, "SF Pro Rounded", Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 14px/1.45 var(--font-body); }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; margin: 0 0 .5em; }
h1 { font-size: 26px; } h2 { font-size: 18px; } h3 { font-size: 16px; } h4 { font-size: 14px; }
a { color: var(--accent-ink); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12px; }
.error { color: var(--red-ink); }
[hidden] { display: none !important; }

/* top bar */
.topbar { display: flex; align-items: center; gap: 12px; padding: 10px 20px; background: var(--surface);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar .logo { height: 22px; }
.topbar .product { font-family: var(--font-head); font-weight: 700; font-size: 15px; }
.topbar .spacer { flex: 1; }
.devtoggle { display: flex; gap: 4px; align-items: center; }

/* buttons and inputs */
button { font: inherit; border-radius: var(--radius); border: 1px solid var(--ink); background: var(--surface);
  color: var(--ink); padding: 7px 14px; cursor: pointer; }
button:hover:not(:disabled) { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 203, 255, .25); }
button.primary { background: var(--ink); color: #fff; }
button.ghost { border-color: var(--line); }
button.danger { border-color: var(--red); color: var(--red-ink); }
button.danger.filled { background: var(--red); color: #fff; }
button.small { padding: 4px 10px; font-size: 12px; }
button:disabled { opacity: .45; cursor: not-allowed; }
input, select, textarea { font: inherit; border: 1px solid var(--line); border-radius: var(--radius); padding: 7px 10px;
  background: var(--surface); color: var(--ink); }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--blue); }
input[type=range] { accent-color: var(--blue); }
textarea { font-family: var(--mono); font-size: 12px; width: 100%; min-height: 80px; }
label { display: block; }

/* login */
.login { display: grid; place-items: center; min-height: calc(100vh - 60px); padding: 16px; }
.login-card { width: min(420px, 100%); display: grid; gap: 12px; }
.login-card input, .login-card select { width: 100%; margin-top: 4px; }

/* layout */
.layout { display: grid; grid-template-columns: 300px 1fr; min-height: calc(100vh - 47px);
  background: linear-gradient(to right, var(--surface) 300px, var(--bg) 300px); }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); padding: 16px; display: flex;
  flex-direction: column; gap: 10px; overflow: auto; max-height: calc(100vh - 47px); position: sticky; top: 47px; }
.sidebar-head { display: flex; align-items: baseline; justify-content: space-between; }
.sidebar input[type=search] { width: 100%; }
.charger-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.charger-list li { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; cursor: pointer; }
.charger-list li:hover { border-color: var(--accent); }
.charger-list li.sel { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(0, 203, 255, .3); }
.charger-list .name { font-weight: 600; display: flex; gap: 6px; align-items: center; }
.charger-list .sub { font-size: 12px; color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--grey); flex: none; }
.dot.online { background: var(--ink); }
.dot.charge { background: var(--accent); box-shadow: 0 0 0 1px #0A5C8C33; }
.dot.late { background: var(--amber); }
.dot.error { background: var(--red); }

.detail { padding: 20px 24px 60px; min-width: 0; }
.empty { padding: 60px 0; text-align: center; }

/* charger header */
.chead { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-bottom: 14px; }
.chead h1 { margin: 0; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border-radius: 999px; padding: 2px 10px; font-size: 12px; border: 1px solid var(--line); background: var(--surface); }
.chip.on { border-color: var(--ink); color: var(--ink); }
.chip.warn { border-color: var(--amber); color: var(--amber-ink); }
.chip.err { border-color: var(--red); color: var(--red-ink); }
.chip.charge { border-color: var(--accent); background: rgba(0, 203, 255, .12); }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs button { border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: none; padding: 8px 14px;
  font-family: var(--font-head); font-weight: 700; }
.tabs button.on { border-bottom-color: var(--accent); }
.tabs button:hover { box-shadow: none; }
.tabs .devtab { color: var(--accent-ink); }

/* settings layout */
.settings { display: grid; grid-template-columns: 220px 1fr; gap: 16px; }
.subnav { display: grid; gap: 4px; align-content: start; }
.subnav button { text-align: left; border-color: transparent; background: none; }
.subnav button.on { background: var(--surface); border-color: var(--line); font-weight: 600; }
.subnav .sum { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }

/* cards and rows */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-2); padding: 18px 20px; margin-bottom: 14px; }
.card h3 { display: flex; align-items: center; gap: 8px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 16px; }
.kv > div { border-radius: var(--radius); background: var(--bg); padding: 8px 10px; }
.kv .k { font-size: 11px; color: var(--muted); }
.kv .v { font-weight: 600; font-variant-numeric: tabular-nums; }
.big { font-family: var(--font-head); font-size: 28px; font-weight: 700; }
/* The charge tab's "Most" block (bezier UI/UX 3.3): the state and, while charging, the power on one weight */
.most-head { gap: 28px; align-items: baseline; }
.most-actions { margin: 10px 0 4px; }
.last { margin-top: 8px; }
.num { font-variant-numeric: tabular-nums; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.field { display: grid; gap: 4px; margin: 10px 0; }
.field .hint { font-size: 12px; color: var(--muted); }
.setting { border-top: 1px solid var(--line); padding: 12px 0; }
.setting:first-of-type { border-top: 0; }
.setting .title { font-weight: 600; }
.setting .desc { font-size: 12px; color: var(--muted); }
.setting.off .title { color: var(--muted); }
details.setting.off { padding: 8px 0; }
details.setting.off > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; list-style: none; }
details.setting.off > summary::-webkit-details-marker { display: none; }
details.setting.off > summary .title { font-weight: 500; }
details.setting.off[open] > summary { margin-bottom: 6px; }
.offtag { flex: none; font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.reason { margin-top: 6px; font-size: 12px; color: #444; background: var(--bg); border-radius: var(--radius); padding: 6px 10px; }
.reason .tag { font-family: var(--mono); font-size: 11px; color: var(--accent-ink); }
.alert { border: 1px solid var(--red); border-radius: var(--radius); padding: 10px 12px; margin: 10px 0;
  background: #FFF5F5; color: var(--red-ink); }
.note { border-radius: var(--radius); padding: 10px 12px; background: var(--bg); margin: 10px 0; font-size: 13px; }
.note.err { border-left: 3px solid var(--red); color: var(--red-ink); }
.dangerzone { border-color: var(--red); }
.dangerzone h3 { color: var(--red-ink); }

/* tables */
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tablewrap { overflow-x: auto; }
pre.log { background: #0B0F12; color: #DDE6EC; border-radius: var(--radius); padding: 10px; max-height: 360px;
  overflow: auto; font: 12px/1.4 var(--mono); white-space: pre-wrap; margin: 0; }
pre.json { background: var(--bg); border-radius: var(--radius); padding: 10px; max-height: 300px; overflow: auto;
  font: 12px/1.4 var(--mono); white-space: pre-wrap; margin: 0; }
.lp1 { color: #FF8A8A; } .lp2 { color: #DDE6EC; } .lp3 { color: #8FA3B0; }

/* toasts */
.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 20; max-width: min(420px, 90vw); }
.toast { background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--blue);
  border-radius: var(--radius); padding: 10px 12px; box-shadow: 0 6px 20px rgba(0, 0, 0, .12); font-size: 13px; }
.toast.ok { border-left-color: var(--accent); }
.toast.err { border-left-color: var(--red); }
.toast .dev { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 4px; }

/* dialog */
dialog { border: 1px solid var(--line); border-radius: var(--radius-2); padding: 0; max-width: 480px; width: 92vw; }
dialog::backdrop { background: rgba(0, 0, 0, .35); }
.confirm { padding: 20px; display: grid; gap: 12px; }
.confirm input { width: 100%; margin-top: 6px; }

/* phone width */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; background: var(--bg); }
  .sidebar { position: static; max-height: none; border-right: 0; border-bottom: 1px solid var(--line); }
  .settings { grid-template-columns: 1fr; }
  .detail { padding: 16px; }
  .topbar { flex-wrap: wrap; padding: 10px 16px; }
}
details.advanced { margin: 10px 0; }
details.advanced > summary { cursor: pointer; font-weight: 600; }
button:disabled { opacity: .45; cursor: not-allowed; }
/* The fleet overview (bezier UI/UX 3.1) and the signal-freshness gauge */
.sig { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; margin-left: 6px; vertical-align: middle; }
.sig i { width: 3px; background: var(--line); border-radius: 1px; }
.sig i:nth-child(1) { height: 4px; } .sig i:nth-child(2) { height: 7px; } .sig i:nth-child(3) { height: 10px; } .sig i:nth-child(4) { height: 12px; }
.sig i.on { background: var(--ink); }
.sig.late i.on { background: var(--amber); }
.sig.off i { background: #C5CDD3; }
.fleetbar { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.chipbtn { border-radius: 999px; padding: 4px 12px; font-size: 13px; border: 1px solid var(--line); background: var(--surface); }
.chipbtn.on { border-color: var(--ink); background: var(--ink); color: #fff; }
table.fleet tbody tr { cursor: pointer; }
table.fleet tbody tr:hover { background: var(--bg); }
table.fleet tr.g-error td { color: var(--red-ink); }
table.fleet tr.g-offline td { color: var(--muted); }
table.fleet td.nm { font-weight: 600; }
.oldfw { color: #8A6200; font-size: 12px; }
@media (max-width: 700px) {
  table.fleet thead { display: none; }
  table.fleet, table.fleet tbody, table.fleet tr, table.fleet td { display: block; width: 100%; }
  table.fleet tr { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; margin-bottom: 8px; background: var(--surface); }
  table.fleet td { border: 0; padding: 2px 0; }
  table.fleet td[data-k]::before { content: attr(data-k) ": "; color: var(--muted); font-size: 12px; }
  table.fleet td[data-k="Név"]::before, table.fleet td[data-k="Jel"]::before { content: ""; }
}
/* The developer tab's sub-tabs and pages (bezier UI/UX 3.8) */
.devnav { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
td.when { white-space: nowrap; font-variant-numeric: tabular-nums; }
.pager { justify-content: center; margin-top: 8px; }
/* Mobile (bezier UI/UX 3.9): the list and the detail are two screens, the settings sub-menu is a start screen,
   no horizontal scrolling at 390 px, 44 px touch targets */
.mobile-only { display: none; }
@media (max-width: 860px) {
  .mobile-only { display: inline-block; }
  body.has-detail .sidebar { display: none; }
  body:not(.has-detail) .detail { display: none; }
  .back { margin-bottom: 8px; }
  .settings:not(.sec-open) > .pane { display: none; }
  .settings.sec-open > .subnav { display: none; }
  .tabs { overflow-x: auto; flex-wrap: nowrap; white-space: nowrap; }
  button, input, select, .chipbtn { min-height: 44px; }
  input[type=checkbox], input[type=radio] { min-height: 0; width: 22px; height: 22px; }
  .tablewrap { overflow-x: auto; max-width: 100%; }
  .kv { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .chead { flex-direction: column; align-items: flex-start; }
  .grid2 { grid-template-columns: 1fr; }
  input:not([type=checkbox]):not([type=radio]) { max-width: 100%; }
  select { max-width: 100%; }
  .row > label { max-width: 100%; min-width: 0; }
}
/* a grid column must not grow to its content's min-content width (the 430 px Rendszer page, bezier 3.9) */
.settings > .pane, .settings > .subnav, .grid2 > * { min-width: 0; }

/* F3: the operator's disable in the header (REST mt 50 pending: disabled with its reason) */
.disable-ctl { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.disabled-band { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px;
  border: 2px solid var(--red); border-radius: var(--radius); background: var(--surface); color: var(--red-ink); }
.disabled-band .spacer { flex: 1; }

/* F4: sliders save on a button */
.savedslider .rangelimits { display: flex; justify-content: space-between; margin: 2px 0 6px; }
.savedslider .row { gap: 8px; align-items: center; }

/* FW 1.3.2 settings on the REST (7aa3584): schedule, cards, invite, power detail */
ul.plain { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; }
.row .spacer { flex: 1; }
.sched-row, .card-row { border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.sched-form { display: grid; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.sched-form .days { gap: 4px; }
.sched-form .day { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border: 1px solid var(--line); border-radius: var(--radius); }
.card-row input:not([type=checkbox]) { flex: 0 1 280px; min-width: 0; }
.invite { display: grid; gap: 6px; margin-top: 8px; }
.invite .big { font-size: 20px; letter-spacing: 1px; word-break: break-all; }
table.power-detail td, table.power-detail th { padding: 4px 10px; }
