/* ===================================================================
   Vrbánska 3 – dashboard. Paleta a základ = www.valderama.sk (tmavá).
=================================================================== */

:root {
  --bg:        #0b0d15;
  --bg-alt:    #0f1119;
  --surface:   #161a26;
  --surface-2: #1c2130;
  --text:      #eceefa;
  --text-dim:  #9ca2c0;
  --border:    rgba(150, 160, 220, 0.12);
  --border-strong: rgba(150, 160, 220, 0.28);

  --accent:    #7d86d3;
  --accent-2:  #a78bd8;
  --grad:      linear-gradient(120deg, var(--accent), var(--accent-2));

  --ok:        #4cc38a;
  --warn:      #e0b341;
  --err:       #e5484d;
  --info:      #5ab0f0;
  --heat:      #f0834f;
  --cool:      #5ab0f0;
  --gas:       #e0b341;
  --el:        #7d86d3;
  --ac:        #a78bd8;

  --radius:    16px;
  --radius-sm: 10px;
  --container: 1180px;
  --ease:      cubic-bezier(0.22, 1, 0.36, 1);
  --shadow:    0 18px 40px rgba(0, 0, 0, 0.4);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.92em; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.container--narrow { max-width: 900px; }
h1, h2, h3 { font-family: "Space Grotesk", "Inter", sans-serif; line-height: 1.15; font-weight: 600; }
.main { flex: 1; }
.num { font-family: "Space Grotesk", "Inter", sans-serif; font-variant-numeric: tabular-nums; }

/* ---------- Tlačidlá ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 26px; border-radius: 999px; font-weight: 600; font-size: 0.96rem;
  cursor: pointer; border: 1px solid transparent;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s, border-color 0.2s;
}
.btn--primary { background: var(--grad); color: #fff; box-shadow: 0 8px 24px rgba(125, 134, 211, 0.32); }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(125, 134, 211, 0.45); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn--ghost:hover { background: var(--surface-2); transform: translateY(-2px); }
.btn--danger { background: transparent; color: var(--err); border-color: rgba(229, 72, 77, 0.4); }
.btn--danger:hover { background: rgba(229, 72, 77, 0.12); }
.btn--block { width: 100%; }
.btn--sm { padding: 8px 16px; font-size: 0.86rem; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

/* ---------- Navigácia ---------- */
.nav { position: fixed; inset: 0 0 auto 0; z-index: 100; transition: background 0.3s, border-color 0.3s; border-bottom: 1px solid transparent; background: rgba(11, 13, 21, 0.6); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.nav.scrolled { background: rgba(11, 13, 21, 0.82); border-bottom-color: var(--border); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand__mark { height: 28px; width: auto; }
.brand__word { height: 14px; width: auto; }
.brand__sub { color: var(--text-dim); font-size: 0.86rem; font-weight: 500; padding-left: 12px; border-left: 1px solid var(--border-strong); white-space: nowrap; }
.nav__links { display: flex; align-items: center; gap: 24px; }
.nav__links a { color: var(--text-dim); font-weight: 500; transition: color 0.2s; font-size: 0.95rem; white-space: nowrap; }
.nav__links a:hover, .nav__links a.is-active { color: var(--text); }
.nav__user { display: inline-flex; align-items: center; gap: 8px; }
.nav__avatar { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--grad); color: #fff; font-weight: 700; font-size: 0.8rem; }
.nav__logout { display: inline; }
.nav__cta { color: var(--text) !important; border: 1px solid var(--border-strong); padding: 8px 18px; border-radius: 999px; background: transparent; cursor: pointer; font-weight: 500; transition: background 0.2s, border-color 0.2s; }
.nav__cta:hover { background: var(--surface); border-color: var(--accent); }
.nav__toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav__toggle span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: transform 0.3s, opacity 0.3s; }

/* ---------- Sekcie ---------- */
.section { padding: 56px 0; }
.section--first { padding-top: 110px; }
.section--alt { background: var(--bg-alt); }
.section--narrow .container { max-width: 760px; }
.section__tag { color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: 2px; font-size: 0.78rem; margin-bottom: 8px; }
.section__title { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 10px; }
.section__intro { color: var(--text-dim); font-size: 1.02rem; margin-bottom: 26px; }
.section__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.section__head .section__intro { margin-bottom: 0; }
.lead { font-size: 1.12rem; color: var(--text); margin-bottom: 18px; }

/* ---------- Karty ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 18px; }
.cards--2 { grid-template-columns: repeat(2, 1fr); }
.cards--4 { grid-template-columns: repeat(4, 1fr); }
.cards--5 { grid-template-columns: repeat(5, 1fr); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 22px;
  transition: border-color 0.3s, box-shadow 0.3s; min-width: 0;
}
.card:hover { border-color: rgba(125, 134, 211, 0.4); }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card__title { font-size: 1.05rem; margin-bottom: 4px; }
.card__sub { color: var(--text-dim); font-size: 0.86rem; }
.card--table { padding: 18px 0 6px; }
.card--table .card__head, .card--table .table-wrap { padding: 0 22px; }
.card--wide { grid-column: 1 / -1; }
.card--placeholder { border-style: dashed; color: var(--text-dim); }

/* ---------- Ikony ---------- */
.ico { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }

/* ---------- Stavový pás ---------- */
.status__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.status__head .section__title { margin-bottom: 0; }
.status { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 16px; }
.status .card { padding: 20px 22px; }

.meter__head { display: flex; align-items: center; gap: 8px; color: var(--text-dim); font-size: 0.92rem; font-weight: 500; margin-bottom: 12px; }
.meter--el .meter__head { color: var(--el); }
.meter--gas .meter__head { color: var(--gas); }
.outdoor .meter__head { color: var(--warn); }
.meter__win {
  display: inline-flex; align-items: baseline; background: #07080d; border: 1px solid var(--border-strong);
  border-radius: 8px; padding: 8px 12px; font-family: "Space Grotesk", monospace; font-variant-numeric: tabular-nums;
  font-size: 1.8rem; font-weight: 700; letter-spacing: 0.08em; line-height: 1; box-shadow: inset 0 2px 8px rgba(0,0,0,0.6);
  max-width: 100%;
}
.meter__int { color: var(--text); }
.meter__dec { color: var(--text-dim); font-size: 0.75em; }
.meter--gas .meter__dec { color: #e0a4a4; }
.meter__foot { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-top: 10px; font-size: 0.86rem; flex-wrap: wrap; }
.meter__unit { font-weight: 600; }
.meter__note { color: var(--text-dim); font-size: 0.78rem; margin-top: 6px; line-height: 1.4; }

.outdoor__temp { font-family: "Space Grotesk", sans-serif; font-size: 2.2rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.outdoor__temp small { font-size: 0.5em; color: var(--text-dim); margin-left: 4px; font-weight: 600; }
.outdoor__row { display: flex; gap: 14px; flex-wrap: wrap; color: var(--text-dim); font-size: 0.86rem; margin-top: 8px; }
.outdoor__row b { color: var(--text); font-weight: 600; }

/* ---------- Sparkline ---------- */
.spark { height: 40px; margin-top: 10px; }
.spark--sm { height: 30px; }
.spark--empty { display: none; }
.spark__svg { width: 100%; height: 100%; display: block; overflow: visible; }

.kpi__cost { font-size: 1.05rem; margin-top: 2px; }
.kpi__cost b { font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 1.2rem; }
.kpi__eur { color: var(--text-dim); font-size: 0.55em; font-weight: 600; margin-left: 10px; }
.kpi__eur span { color: var(--text); }
.seg-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Segmentové tlačidlá ---------- */
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 999px; padding: 3px; gap: 2px; }
.seg__btn { border: 0; background: transparent; color: var(--text-dim); padding: 6px 14px; border-radius: 999px; cursor: pointer; font-size: 0.86rem; font-weight: 500; }
.seg__btn.is-active { background: var(--surface-2); color: var(--text); }
.seg__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------- Stĺpcové grafy ---------- */
.bars__svg { display: block; }
.bars__grid { stroke: var(--border); stroke-width: 1; }
.bars__lbl { fill: var(--text-dim); font-size: 11px; font-family: "Inter", sans-serif; }
.bars__msg { fill: var(--text-dim); font-size: 13px; font-family: "Inter", sans-serif; }
.bars__total { fill: var(--el); fill-opacity: 0.55; }
.bars__ac { fill: var(--ac); }
.bars__bar.is-partial .bars__total { fill-opacity: 0.25; stroke: var(--el); stroke-dasharray: 3 2; }
.bars__bar:hover .bars__total { fill-opacity: 0.85; }
.bars__none { fill: var(--border-strong); }
#gasChart .bars__total { fill: var(--gas); fill-opacity: 0.6; }
.legend__el { background: var(--el); opacity: 0.6; }
.legend__ac { background: var(--ac); }
.legend__part { background: transparent; border: 1px dashed var(--el); }

/* ---------- Energie ---------- */
.energy { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.energy__gas { grid-column: 1 / -1; }
.energy__side { display: flex; flex-direction: column; gap: 22px; justify-content: space-between; }
.gas__row { display: flex; gap: 32px; flex-wrap: wrap; margin-bottom: 8px; }
.chip--gas { color: var(--gas); border-color: rgba(224, 179, 65, 0.4); background: rgba(224, 179, 65, 0.1); }
.bar--ac > span { background: var(--ac); }

/* ---------- Termostaty ---------- */
.therms { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 34px; }
.therm__top, .ac__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.therm__temps { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.therm__cur { font-family: "Space Grotesk", sans-serif; font-size: 1.9rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.therm__cur small { font-size: 0.5em; color: var(--text-dim); margin-left: 3px; font-weight: 600; }
.therm.is-heating .therm__cur, .therm.is-heating .therm__act { color: var(--heat); }
.therm.is-heating { border-color: rgba(240, 131, 79, 0.45); }
.therm.is-off .therm__cur { color: var(--text-dim); }
.is-dead { opacity: 0.55; }
.therm__foot { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; color: var(--text-dim); font-size: 0.82rem; margin-top: 8px; }
.therm__foot b { color: var(--text); font-weight: 600; }
.therm__act:empty { display: none; }

.boiler .boiler__flame { color: var(--text-dim); border-color: var(--border-strong); background: transparent; }
.boiler.is-burning .boiler__flame, .boiler.flame-on .boiler__flame { color: var(--heat); border-color: rgba(240, 131, 79, 0.45); background: rgba(240, 131, 79, 0.12); }
.boiler.flame-on { border-color: rgba(240, 131, 79, 0.45); }
.boiler__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; margin: 4px 0 10px; }
.boiler__grid > div { display: flex; flex-direction: column; font-size: 0.82rem; }
.boiler__grid b { font-size: 1.05rem; font-weight: 600; }

.rooms__title { font-size: 1.05rem; margin-bottom: 12px; color: var(--text-dim); font-weight: 500; }
.room small { font-size: 0.55em; color: var(--text-dim); font-weight: 600; }
.room__spark { height: 26px; margin-top: 4px; }

/* ---------- Klimatizácie ---------- */
.acs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.ac__mode { display: inline-flex; align-items: center; gap: 6px; font-size: 0.82rem; font-weight: 600; color: var(--text-dim); }
.ac.mode-cool { border-color: rgba(90, 176, 240, 0.45); }
.ac.mode-cool .ac__mode, .ac.mode-cool .therm__cur, .ac.mode-dry .ac__mode { color: var(--cool); }
.ac.mode-heat { border-color: rgba(240, 131, 79, 0.45); }
.ac.mode-heat .ac__mode, .ac.mode-heat .therm__cur { color: var(--heat); }
.ac.mode-off .therm__cur { color: var(--text-dim); }
.ac__kwh { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; font-size: 0.78rem; }
.ac__kwh > div { display: flex; flex-direction: column; }
.ac__kwh b { font-size: 0.95rem; font-weight: 600; white-space: nowrap; }
.ac__split { height: 5px; border-radius: 999px; background: var(--cool); opacity: 0.8; overflow: hidden; margin-top: 10px; }
.ac__split-heat { display: block; height: 100%; background: var(--heat); width: 0; transition: width 0.6s var(--ease); }

/* ---------- zmena hodnoty ---------- */
.did-change { animation: blink 1.2s var(--ease); }
@keyframes blink { 0% { color: var(--accent); } 100% { color: inherit; } }
.dot--live { background: var(--ok); box-shadow: 0 0 0 0 rgba(76, 195, 138, 0.5); animation: ping 2.4s ease-out infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(76, 195, 138, 0.5); } 70% { box-shadow: 0 0 0 7px rgba(76, 195, 138, 0); } 100% { box-shadow: 0 0 0 0 rgba(76, 195, 138, 0); } }
.fresh--stale .dot { background: var(--warn); }
.fresh--dead .dot, .fresh--none .dot { background: var(--err); }

/* ---------- KPI ---------- */
.kpi { display: flex; flex-direction: column; gap: 6px; }
.kpi__label { color: var(--text-dim); font-size: 0.86rem; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.kpi__value { font-family: "Space Grotesk", sans-serif; font-size: 2.1rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi__value small { font-size: 0.5em; color: var(--text-dim); font-weight: 600; margin-left: 4px; }
.kpi__note { color: var(--text-dim); font-size: 0.86rem; }
.kpi__row { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 6px; }
.kpi__row > div { display: flex; flex-direction: column; }
.kpi__row .num { font-size: 1.15rem; font-weight: 600; }
.kpi__row span:not(.num) { color: var(--text-dim); font-size: 0.8rem; }
.kpi--el .kpi__label::before, .kpi--gas .kpi__label::before, .kpi--water .kpi__label::before, .kpi--ac .kpi__label::before { content: ""; width: 8px; height: 8px; border-radius: 50%; }
.kpi--el .kpi__label::before { background: var(--el); }
.kpi--gas .kpi__label::before { background: var(--gas); }
.kpi--water .kpi__label::before { background: var(--info); }
.kpi--ac .kpi__label::before { background: var(--ac); }

/* ---------- Čipy a odznaky ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; border: 1px solid var(--border-strong); color: var(--text-dim); white-space: nowrap; vertical-align: middle; }
.chip--ok { color: var(--ok); border-color: rgba(76, 195, 138, 0.4); background: rgba(76, 195, 138, 0.1); }
.chip--warn { color: var(--warn); border-color: rgba(224, 179, 65, 0.4); background: rgba(224, 179, 65, 0.1); }
.chip--err { color: var(--err); border-color: rgba(229, 72, 77, 0.45); background: rgba(229, 72, 77, 0.12); }
.chip--accent { color: var(--accent); border-color: rgba(125, 134, 211, 0.45); background: rgba(125, 134, 211, 0.12); }
.chip--accent2 { color: var(--accent-2); border-color: rgba(167, 139, 216, 0.45); background: rgba(167, 139, 216, 0.12); }
.chip--heat { color: var(--heat); border-color: rgba(240, 131, 79, 0.45); background: rgba(240, 131, 79, 0.12); }
.chip--cool { color: var(--cool); border-color: rgba(90, 176, 240, 0.45); background: rgba(90, 176, 240, 0.12); }
.chip--dim { opacity: 0.7; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.dot--pulse { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.7); } }

/* ---------- Alarm ---------- */
.alarm { display: flex; gap: 18px; align-items: flex-start; }
.alarm__label { color: var(--text-dim); font-size: 0.92rem; font-weight: 500; }
.alarm__state { font-family: "Space Grotesk", sans-serif; font-size: 1.7rem; font-weight: 700; line-height: 1.15; margin: 2px 0 4px; }
.alarm__icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; flex: none; }
.alarm__icon .ico { width: 28px; height: 28px; }
.alarm__body { min-width: 0; }
.alarm__sections { margin-top: 10px; }
.alarm__sections .chip b { font-weight: 600; color: inherit; }
.alarm--disarmed .alarm__icon { background: rgba(76, 195, 138, 0.15); color: var(--ok); }
.alarm--armed_home .alarm__icon, .alarm--armed_night .alarm__icon { background: rgba(125, 134, 211, 0.18); color: var(--accent); }
.alarm--armed_away .alarm__icon { background: rgba(167, 139, 216, 0.18); color: var(--accent-2); }
.alarm--arming .alarm__icon, .alarm--pending .alarm__icon { background: rgba(224, 179, 65, 0.18); color: var(--warn); }
.alarm--triggered .alarm__icon { background: rgba(229, 72, 77, 0.2); color: var(--err); animation: pulse 0.9s ease-in-out infinite; }
.alarm--unknown .alarm__icon, .alarm--unavailable .alarm__icon { background: var(--surface-2); color: var(--text-dim); }
.alarm--disarmed .alarm__state { color: var(--ok); }
.alarm--triggered .alarm__state { color: var(--err); }
.alarm--arming .alarm__state, .alarm--pending .alarm__state { color: var(--warn); }
.alarm__sections { display: flex; gap: 8px; flex-wrap: wrap; }
.alarm__meta { color: var(--text-dim); font-size: 0.86rem; }
.chip--dim { opacity: 0.8; }

/* ---------- Termostaty / klímy ---------- */
.therm { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; }
.therm__name { font-weight: 600; }
.therm__temps { display: flex; align-items: baseline; gap: 10px; grid-column: 1 / -1; }
.therm__cur { font-family: "Space Grotesk", sans-serif; font-size: 1.9rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.therm__set { color: var(--text-dim); font-size: 0.95rem; }
.therm__set strong { color: var(--text); font-weight: 600; }
.therm__foot { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; color: var(--text-dim); font-size: 0.82rem; }
.card--off { opacity: 0.75; }

/* ---------- Izbové teploty (mriežka) ---------- */
.rooms { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.room { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; gap: 4px 10px; align-items: center; min-width: 0; }
.room__name { grid-column: 1; grid-row: 1; font-size: 0.9rem; font-weight: 500; }
.room__val { grid-column: 2; grid-row: 1; text-align: right; font-family: "Space Grotesk", sans-serif; font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.room__spark { grid-column: 1 / -1; grid-row: 2; height: 34px; margin-top: 6px; }
.room__spark canvas, .room__spark svg { width: 100%; height: 100%; display: block; }
.rooms__group { grid-column: 1 / -1; color: var(--text-dim); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 1.5px; font-weight: 600; margin-top: 8px; }

/* ---------- Grafy ---------- */
.chart { position: relative; width: 100%; height: 260px; }
.chart--sm { height: 180px; }
.chart canvas { width: 100% !important; height: 100% !important; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; color: var(--text-dim); font-size: 0.82rem; margin-top: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }

/* ---------- Progress ---------- */
.bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--grad); border-radius: 999px; width: 0; transition: width 0.6s var(--ease); }
.bar--heat > span { background: var(--heat); }
.bar--cool > span { background: var(--cool); }

/* ---------- Formuláre ---------- */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 0.86rem; color: var(--text-dim); font-weight: 500; }
.field input, .field select, .field textarea {
  background: var(--bg); border: 1px solid var(--border-strong); border-radius: 10px; padding: 12px 14px;
  color: var(--text); font: inherit; width: 100%; transition: border-color 0.2s, box-shadow 0.2s;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(125, 134, 211, 0.22); }
.field--inline { grid-template-columns: 1fr auto; align-items: end; }
.check { display: flex; align-items: center; gap: 10px; color: var(--text-dim); font-size: 0.92rem; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.form__note { font-size: 0.82rem; color: var(--text-dim); }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ---------- Hlásenia ---------- */
.flash { padding: 12px 16px; border-radius: 10px; border: 1px solid var(--border-strong); margin: 0 0 16px; font-size: 0.94rem; }
.flash--ok { background: rgba(76, 195, 138, 0.1); border-color: rgba(76, 195, 138, 0.4); color: #a7e8c5; }
.flash--err { background: rgba(229, 72, 77, 0.12); border-color: rgba(229, 72, 77, 0.45); color: #f5b3b5; }
.flash--warn { background: rgba(224, 179, 65, 0.1); border-color: rgba(224, 179, 65, 0.4); color: #f0d68f; }
.flash--info { background: rgba(90, 176, 240, 0.1); border-color: rgba(90, 176, 240, 0.4); color: #b6dcf7; }
.page-app .main > .container > .flash:first-child { margin-top: 88px; }

/* ---------- Tabuľky ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th, .table td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
.table th { color: var(--text-dim); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 1px; }
.table tr:last-child td { border-bottom: 0; }
.table tr.is-current td { background: rgba(125, 134, 211, 0.06); }
.table td.actions { text-align: right; }
.table td.actions form { display: inline-block; margin-left: 6px; }
.table .num { text-align: right; }

/* ---------- Auth stránky ---------- */
.page-auth { background: var(--bg); }
.auth { min-height: 100vh; display: grid; place-items: center; padding: 40px 20px; position: relative; overflow: hidden; }
.auth__bg { position: absolute; inset: 0;
  background:
    radial-gradient(60% 50% at 20% 20%, rgba(125, 134, 211, 0.20), transparent 60%),
    radial-gradient(50% 50% at 85% 30%, rgba(167, 139, 216, 0.18), transparent 60%),
    radial-gradient(60% 60% at 50% 100%, rgba(125, 134, 211, 0.12), transparent 60%);
}
.auth__bg::after { content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 64px 64px; opacity: 0.5;
  mask-image: radial-gradient(circle at 50% 40%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(circle at 50% 40%, #000 30%, transparent 75%);
}
.auth__card { position: relative; width: 100%; max-width: 440px; background: rgba(22, 26, 38, 0.92); border: 1px solid var(--border-strong); border-radius: 22px; padding: 38px 36px; box-shadow: var(--shadow); backdrop-filter: blur(10px); }
.auth__brand { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 8px; }
.auth__mark { width: 64px; filter: drop-shadow(0 10px 30px rgba(125, 134, 211, 0.35)); }
.auth__word { width: 150px; }
.auth__eyebrow { text-align: center; color: var(--text-dim); font-weight: 600; letter-spacing: 3px; text-transform: uppercase; font-size: 0.74rem; margin-bottom: 26px; }
.auth__title { font-size: 1.6rem; margin-bottom: 6px; }
.auth__sub { color: var(--text-dim); font-size: 0.94rem; margin-bottom: 22px; }

/* ---------- Pätička ---------- */
.footer { border-top: 1px solid var(--border); padding: 26px 0; margin-top: 30px; }
.footer__inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; color: var(--text-dim); font-size: 0.84rem; }

/* ---------- Čerstvosť dát ---------- */
.fresh { display: inline-flex; align-items: center; gap: 8px; color: var(--text-dim); font-size: 0.86rem; }
.fresh--stale { color: var(--warn); }
.fresh--dead { color: var(--err); }

/* ---------- Admin ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 8px 0 26px; flex-wrap: wrap; }
.tabs a { padding: 10px 14px; color: var(--text-dim); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); }
.tabs a.is-active { color: var(--text); border-bottom-color: var(--accent); }
.h2 { font-size: 1.2rem; margin: 30px 0 6px; }
.list { padding-left: 18px; color: var(--text-dim); display: grid; gap: 8px; font-size: 0.94rem; }
.list a { color: var(--accent); }
.card--invite { border-color: rgba(76, 195, 138, 0.45); margin-bottom: 18px; }
.inline { display: inline-flex; gap: 6px; align-items: center; }
.select-sm { background: var(--bg); border: 1px solid var(--border-strong); border-radius: 8px; padding: 6px 8px; color: var(--text); font: inherit; font-size: 0.86rem; }
.table tr.is-inactive td { opacity: 0.55; }
.table td.wrap { white-space: normal; max-width: 420px; }
.linkbtn { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; font: inherit; text-decoration: underline; }
/* ---------- Kamery ---------- */
.cams { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.cams--admin { margin-top: 12px; }
.cam { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; cursor: zoom-in; transition: border-color 0.25s, transform 0.25s var(--ease); }
.cam:hover, .cam:focus-visible { border-color: rgba(125, 134, 211, 0.5); transform: translateY(-2px); outline: none; }
.cam:focus-visible { box-shadow: 0 0 0 3px rgba(125, 134, 211, 0.35); }
.cams { align-items: start; }
.cam__frame { position: relative; aspect-ratio: 16 / 9; background: #07080d; overflow: hidden; }
.cam__frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.cam__err { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-dim); font-size: 0.86rem; text-align: center; padding: 8px; }
.cam.is-dead .cam__frame img { display: none; }
.cam figcaption { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 12px; font-size: 0.88rem; font-weight: 500; }
.cam__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border-strong); flex: none; }
.cam__dot.is-fresh { animation: camfade 4s ease-out forwards; }
@keyframes camfade { 0% { background: var(--ok); } 100% { background: var(--border-strong); } }
.seg__btn--solo { border: 1px solid var(--border-strong); border-radius: 999px; }
.seg__btn--solo:hover { background: var(--surface-2); color: var(--text); }

.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(5, 6, 11, 0.94); display: grid; place-items: center; padding: 24px; backdrop-filter: blur(6px); }
.lightbox[hidden] { display: none; }
.cam__err[hidden] { display: none; }
.lightbox__inner { margin: 0; max-width: min(1500px, 96vw); display: flex; flex-direction: column; gap: 10px; }
.lightbox__inner img { max-width: 100%; max-height: 86vh; object-fit: contain; border-radius: 10px; background: #07080d; }
.lightbox__inner figcaption { text-align: center; color: var(--text-dim); font-size: 0.95rem; }
.lightbox__close { position: absolute; top: 16px; right: 20px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-size: 1.6rem; line-height: 1; cursor: pointer; }
.lightbox__close:hover { border-color: var(--accent); }
body.has-lightbox { overflow: hidden; }
.input-xs { width: 64px; text-align: right; }
@media (max-width: 1100px) { .cams { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 860px) { .cams { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .cams { grid-template-columns: 1fr; } }

.names { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 18px; margin-top: 10px; }
.names__actions { display: flex; gap: 12px; flex-wrap: wrap; }
@media (max-width: 860px) { .names { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .names { grid-template-columns: 1fr; } }

/* ---------- Pomocné ---------- */
.muted { color: var(--text-dim); }
.right { text-align: right; }
.mt { margin-top: 18px; }
.hidden { display: none !important; }
.copybox { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.copybox input { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.86rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .dot--pulse, .alarm--triggered .alarm__icon { animation: none; }
}

/* ---------- Responzív ---------- */
@media (max-width: 1100px) {
  .cards--4, .cards--5 { grid-template-columns: repeat(3, 1fr); }
  .rooms { grid-template-columns: repeat(3, 1fr); }
  .status { grid-template-columns: 1fr 1fr; }
  .status .alarm { grid-column: 1 / -1; }
  .therms { grid-template-columns: repeat(3, 1fr); }
  .acs { grid-template-columns: repeat(3, 1fr); }
  .energy { grid-template-columns: 1fr; }
  .energy__side { flex-direction: row; flex-wrap: wrap; gap: 24px 40px; justify-content: flex-start; }
}
@media (max-width: 860px) {
  .nav__links {
    position: fixed; inset: 68px 0 auto 0; flex-direction: column; gap: 0; align-items: stretch;
    background: rgba(11, 13, 21, 0.97); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border); padding: 8px 24px 20px;
    transform: translateY(-130%); transition: transform 0.35s var(--ease);
  }
  .nav__links.open { transform: translateY(0); }
  .nav__links a { padding: 13px 0; width: 100%; border-bottom: 1px solid var(--border); }
  .nav__logout { margin-top: 12px; }
  .nav__cta { width: 100%; }
  .nav__toggle { display: flex; }
  .nav__toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav__toggle.open span:nth-child(2) { opacity: 0; }
  .nav__toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .brand__sub { display: none; }
  .cards, .cards--2, .cards--4, .cards--5 { grid-template-columns: 1fr 1fr; }
  .rooms { grid-template-columns: 1fr 1fr; }
  .therms, .acs { grid-template-columns: 1fr 1fr; }
  .section { padding: 40px 0; }
  .section--first { padding-top: 96px; }
  .form__row { grid-template-columns: 1fr; }
  .meter__win { font-size: 1.5rem; }
}
@media (max-width: 520px) {
  .cards, .cards--2, .cards--4, .cards--5 { grid-template-columns: 1fr; }
  .status { grid-template-columns: 1fr; }
  .therms, .acs { grid-template-columns: 1fr; }
  .rooms { grid-template-columns: 1fr 1fr; }
  .auth__card { padding: 30px 22px; }
  .kpi__value { font-size: 1.8rem; }
  .chart { height: 220px; }
}
