/* © 2026 www.digitalnyinovator.sk */
/*
 * Optimkaido – web na správu. Rovnaký jazyk ako klient na nahrávanie (agent/ui): systémové písmo,
 * sklenené skupiny, ikony aplikácií s leskom, kapsulové tlačidlá. Rozloženie administrácie:
 * bočný panel s prepínačom organizácií, hlavička stránky s akciami, dlaždice so štatistikou.
 */
:root {
  color-scheme: light dark;
  --window: #e9edf5;
  --label: rgba(0, 0, 0, 0.86);
  --secondary: rgba(0, 0, 0, 0.52);
  --tertiary: rgba(0, 0, 0, 0.3);
  --separator: rgba(0, 0, 0, 0.08);
  --fill: rgba(120, 120, 128, 0.12);
  --fill-strong: rgba(120, 120, 128, 0.22);
  --glass: rgba(255, 255, 255, 0.66);
  --glass-strong: rgba(255, 255, 255, 0.92);
  --glass-edge: rgba(255, 255, 255, 0.95);
  --glass-stroke: rgba(0, 0, 0, 0.06);
  --glass-shadow: 0 10px 30px rgba(15, 25, 45, 0.07), 0 1px 2px rgba(15, 25, 45, 0.05);
  --pop-shadow: 0 24px 60px rgba(15, 25, 45, 0.22), 0 2px 8px rgba(15, 25, 45, 0.12);
  --sidebar: rgba(255, 255, 255, 0.44);
  --accent: #007aff;
  --accent-soft: rgba(0, 122, 255, 0.13);
  --on-accent: #ffffff;
  --focus: rgba(0, 122, 255, 0.42);
  --green: #1f9d48;
  --green-soft: rgba(52, 199, 89, 0.16);
  --orange: #c26a00;
  --orange-soft: rgba(255, 149, 0, 0.16);
  --red: #e5302a;
  --c-active: #0a84ff;
  --c-idle: #b8b8bf;
  --c-private: #c9a6f5;
  --heat: #0a84ff;
  --radius-group: 18px;
  --rounded: ui-rounded, -apple-system, "SF Pro Rounded", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --window: #15171d;
    --label: rgba(255, 255, 255, 0.92);
    --secondary: rgba(255, 255, 255, 0.56);
    --tertiary: rgba(255, 255, 255, 0.3);
    --separator: rgba(255, 255, 255, 0.08);
    --fill: rgba(120, 120, 128, 0.22);
    --fill-strong: rgba(120, 120, 128, 0.34);
    --glass: rgba(44, 46, 54, 0.66);
    --glass-strong: rgba(52, 54, 62, 0.96);
    --glass-edge: rgba(255, 255, 255, 0.1);
    --glass-stroke: rgba(0, 0, 0, 0.4);
    --glass-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.25);
    --pop-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.4);
    --sidebar: rgba(30, 32, 40, 0.55);
    --accent: #0a84ff;
    --accent-soft: rgba(10, 132, 255, 0.22);
    --focus: rgba(10, 132, 255, 0.55);
    --green: #30d158;
    --green-soft: rgba(48, 209, 88, 0.18);
    --orange: #ffb340;
    --orange-soft: rgba(255, 159, 10, 0.2);
    --red: #ff6961;
    --c-idle: #6e6e76;
    --c-private: #9b7ad6;
    --heat: #3d9bff;
  }
}

* { box-sizing: border-box; }
html { background: var(--window); }
body {
  margin: 0;
  min-height: 100vh;
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  color: var(--label);
  background: var(--window);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
/* plocha za oknom: rovnaké farebné rozmazanie ako v náhľade klienta */
body::before {
  content: "";
  position: fixed;
  inset: -60px;
  z-index: -2;
  background:
    radial-gradient(55% 45% at 12% 8%, #8ccbff 0%, transparent 70%),
    radial-gradient(50% 55% at 92% 14%, #c2b0ff 0%, transparent 70%),
    radial-gradient(65% 55% at 75% 100%, #9debd6 0%, transparent 70%),
    radial-gradient(55% 45% at 6% 96%, #ffd0e4 0%, transparent 70%), #e3e9f5;
  filter: blur(40px);
}
body::after { content: ""; position: fixed; inset: 0; z-index: -1; background: rgba(242, 244, 249, 0.58); }
@media (prefers-color-scheme: dark) {
  body::before {
    background:
      radial-gradient(55% 45% at 12% 8%, #1c4a87 0%, transparent 70%),
      radial-gradient(50% 55% at 92% 14%, #46307f 0%, transparent 70%),
      radial-gradient(65% 55% at 75% 100%, #0e5548 0%, transparent 70%), #10131a;
  }
  body::after { background: rgba(22, 24, 30, 0.62); }
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
:focus { outline: none; }
:focus-visible { outline: 3.5px solid var(--focus); outline-offset: 2px; border-radius: 8px; }
code, pre { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.88em; }
code { background: var(--fill); padding: 1px 6px; border-radius: 6px; word-break: break-all; }
pre { background: var(--fill); padding: 12px 14px; border-radius: 12px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; margin: 6px 0 12px; }
.big-code { font-size: 14px; padding: 6px 10px; display: inline-block; }
.selectable { -webkit-user-select: all; user-select: all; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.strong { font-weight: 600; }
.dim { color: var(--secondary); }
.num { text-align: right; white-space: nowrap; }
.sub { display: block; color: var(--secondary); font-size: 12px; margin-top: 1px; font-weight: 400; }
.hint { color: var(--secondary); font-size: 12.5px; margin: 0; }
.footnote { color: var(--secondary); font-size: 12px; line-height: 1.45; margin: 10px 6px 0; }
.footnote code { font-size: 11.5px; }
svg.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

svg.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
svg.i .solid { fill: currentColor; stroke: none; }
svg.i.dim { color: var(--tertiary); }
svg.i.accent { color: var(--accent); }

/* --- farebné ikony (iniciála alebo symbol na farebnom štvorci s leskom) --- */
svg.tile { flex: none; display: block; border-radius: 7px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.14); }
/* favicona webu: obrázok zo servera (na bielom podklade, bez nej glóbus) */
img.tile { flex: none; display: block; border-radius: 6px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.14); }
svg.tile text { fill: #fff; font: 600 13px -apple-system, BlinkMacSystemFont, system-ui, sans-serif; }
.tile-s { width: 22px; height: 22px; }
.tile-m { width: 28px; height: 28px; }
.tile-l { width: 36px; height: 36px; }
svg.tile.tile-l { border-radius: 9px; }
svg.tile.tile-s { border-radius: 6px; }
.symbol-tile { position: relative; display: inline-grid; place-items: center; flex: none; }
.symbol-tile svg.tile { width: 100%; height: 100%; grid-area: 1 / 1; }
.symbol-tile svg.i { grid-area: 1 / 1; position: relative; color: #fff; stroke-width: 2; width: 62%; height: 62%; }

/* --- rozloženie: bočný panel + obsah --- */
.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 12px 14px;
  /* bez backdrop-filter: inak by bol panel obsahovým blokom pre position: fixed a menu by sa nezavieralo klikom mimo */
  background: var(--sidebar);
  box-shadow: inset -1px 0 0 var(--separator);
  overflow-y: auto;
  z-index: 5;
}
.brand-link { padding: 2px 8px 4px; color: var(--label); }
.brand-link:hover { text-decoration: none; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 700; letter-spacing: -0.01em; color: var(--label); }
.brand img { width: 30px; height: 30px; display: block; }
.side-group { display: grid; gap: 1px; }
.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 32px;
  padding: 0 10px;
  border-radius: 9px;
  color: var(--label);
  font-weight: 500;
}
.side-link svg.i { color: var(--accent); }
.side-link:hover { background: var(--fill); text-decoration: none; }
.side-link.active { background: var(--accent-soft); font-weight: 600; }
.side-user {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 6px 0 8px;
  border-top: 1px solid var(--separator);
}
.side-user .who { flex: 1; min-width: 0; display: grid; font-size: 12.5px; font-weight: 500; }
.side-user .who .sub { font-size: 11.5px; }
.side-user form { margin: 0; }

.content { min-width: 0; display: flex; flex-direction: column; }
.content main { width: 100%; max-width: 1200px; margin: 0 auto; padding: 30px 40px 36px; flex: 1; }
.foot { color: var(--secondary); font-size: 12px; padding: 18px 40px 26px; max-width: 1200px; width: 100%; margin: 0 auto; }
main.narrow { max-width: 440px; margin: 0 auto; padding: 9vh 16px 20px; }
main.narrow + .foot { text-align: center; }

/* --- dočasne vypnuté TOTP --- */
.totp-off { background: #d70015; color: #fff; padding: 10px 24px; font-size: 13.5px; position: relative; z-index: 30; }
.totp-off code { background: rgba(255, 255, 255, 0.2); color: #fff; }

/* --- hlavička stránky --- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 22px; }
.head-text { min-width: 0; }
.large-title { font-size: 28px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.12; margin: 0; }
.lede { color: var(--secondary); margin: 6px 0 0; max-width: 72ch; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.back { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; margin: 0 0 6px -4px; }
.back svg.i { width: 16px; height: 16px; }
.head-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 28px 6px 9px; }
.section-title h2 { font-size: 13.5px; font-weight: 600; margin: 0; }
.section-title .aside { color: var(--secondary); font-size: 12.5px; }
.card-title { font-size: 14px; font-weight: 600; margin: 0 0 14px; }

/* --- sklenené skupiny --- */
.group, .kpi, .card {
  background: var(--glass);
  border-radius: var(--radius-group);
  box-shadow: inset 0 1px 0 var(--glass-edge), inset 0 0 0 0.5px var(--glass-stroke), var(--glass-shadow);
}
.group.pad { padding: 18px 20px; }
.join-card { margin-bottom: 8px; }
.join-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.join-head .card-title { margin-bottom: 6px; }
.join-card .hint { max-width: 80ch; }
.join-code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 34px; font-weight: 600; letter-spacing: 0.08em; line-height: 1.15; margin: 0 0 12px; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .join-code { font-size: 28px; } }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 20px; }
.grid-2 > section > .section-title:first-child { margin-top: 8px; }

/* riadky zoznamu (ako v klientovi) */
.row { position: relative; display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 10px 16px; color: var(--label); }
.row + .row::before, .proc + .proc::before {
  content: "";
  position: absolute;
  top: 0;
  right: 16px;
  left: 16px;
  border-top: 1px solid var(--separator);
}
.row.with-icon + .row::before, .row + .row.with-icon::before { left: 60px; }
.row .body { flex: 1; min-width: 0; display: grid; }
.row .label.strong { font-size: 15px; }
.row .trail { display: flex; align-items: center; gap: 8px; color: var(--secondary); text-align: right; }
.link-row:hover { text-decoration: none; background: rgba(120, 120, 128, 0.07); }
.group > .link-row:first-child, .group > .row:first-child { border-top-left-radius: var(--radius-group); border-top-right-radius: var(--radius-group); }
.group > .link-row:last-child, .group > .row:last-child { border-bottom-left-radius: var(--radius-group); border-bottom-right-radius: var(--radius-group); }
.stats { display: flex; gap: 26px; align-items: center; }
.stat { display: grid; text-align: right; min-width: 64px; }
.stat b { font-weight: 600; white-space: nowrap; }
.stat span { color: var(--secondary); font-size: 11.5px; white-space: nowrap; }

/* --- tlačidlá: kapsuly zo skla --- */
.btn, button {
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--label);
  border: none;
  border-radius: 999px;
  height: 30px;
  padding: 0 14px;
  white-space: nowrap;
  cursor: default;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--glass-strong);
  box-shadow: inset 0 1px 0 var(--glass-edge), inset 0 0 0 0.5px var(--glass-stroke), 0 1px 3px rgba(15, 25, 45, 0.1);
  user-select: none;
}
.btn:hover { text-decoration: none; filter: brightness(1.03); }
.btn:active { transform: scale(0.97); filter: brightness(0.96); }
.btn svg.i { width: 15px; height: 15px; stroke-width: 2; }
.btn.primary {
  color: var(--on-accent);
  background-color: var(--accent);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0) 65%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 4px 14px rgba(0, 122, 255, 0.3), 0 1px 2px rgba(0, 0, 0, 0.15);
}
.btn.danger { color: var(--red); }
.btn.danger-fill { color: #fff; background: #ff3b30; box-shadow: 0 4px 14px rgba(255, 59, 48, 0.28); }
.btn.small { height: 26px; padding: 0 11px; font-size: 12px; }
.btn.large { height: 38px; padding: 0 22px; font-size: 14px; }
.btn.wide { width: 100%; justify-content: center; }
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  background: none;
  color: var(--secondary);
}
.icon-btn:hover { background: var(--fill); color: var(--label); }
button.link { background: none; color: var(--accent); padding: 0; height: auto; }
button.primary { color: var(--on-accent); background: var(--accent); height: 36px; padding: 0 20px; font-size: 14px; }

/* segmentové ovládanie */
.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--fill); }
.segmented a { color: var(--label); padding: 0 13px; height: 26px; display: inline-flex; align-items: center; border-radius: 999px; font-size: 13px; font-weight: 500; }
.segmented a:hover { text-decoration: none; background: rgba(255, 255, 255, 0.35); }
.segmented a.active { background: var(--glass-strong); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }

/* --- vyskakovacie menu a okná (details) --- */
details.pop { position: relative; }
details.pop > summary { list-style: none; }
details.pop > summary::-webkit-details-marker { display: none; }
/* klik mimo zavrie: priehľadná vrstva cez celú obrazovku patrí tlačidlu */
details.pop[open] > summary::before { content: ""; position: fixed; inset: 0; z-index: 40; cursor: default; }
.pop-body {
  position: absolute;
  z-index: 50;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  backdrop-filter: blur(30px) saturate(180%);
  border-radius: 14px;
  box-shadow: inset 0 0 0 0.5px var(--glass-stroke), var(--pop-shadow);
}
.menu-list { top: calc(100% + 6px); right: 0; min-width: 250px; padding: 5px; display: grid; }
.menu-list hr { border: none; border-top: 1px solid var(--separator); margin: 4px 8px; }
.menu-list form { margin: 0; }
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: auto;
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 9px;
  background: none;
  color: var(--label);
  font-size: 13.5px;
  font-weight: 400;
  text-align: left;
}
.menu-item:hover { background: var(--accent); color: #fff; text-decoration: none; }
.menu-item:hover svg.i { color: #fff; }
.menu-item svg.i { width: 17px; height: 17px; color: var(--secondary); }
.menu-item.danger { color: var(--red); }
.menu-item.danger svg.i { color: var(--red); }
.menu-item.danger:hover { background: #ff3b30; color: #fff; }
.menu-item span { flex: 1; min-width: 0; }

/* okno s formulárom: v strede obrazovky, za ním stmavené pozadie */
details.sheet[open] > summary::before { background: rgba(20, 25, 40, 0.28); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.sheet-body {
  position: fixed;
  top: 12vh;
  left: 50%;
  transform: translateX(-50%);
  width: min(460px, calc(100vw - 32px));
  max-height: 80vh;
  overflow-y: auto;
  padding: 22px 24px 20px;
  border-radius: 22px;
  text-align: left;
  white-space: normal;
  color: var(--label);
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 -8px 16px 0; }
.sheet-title { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; margin: 0; }
@media (prefers-reduced-motion: no-preference) {
  details.pop[open] > .pop-body { animation: pop-in 0.16s ease-out; }
  details.sheet[open] > .sheet-body { animation: sheet-in 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.1); }
}
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px) scale(0.98); } }
@keyframes sheet-in { from { opacity: 0; transform: translate(-50%, 10px) scale(0.97); } }

/* prepínač organizácie v bočnom paneli */
.switcher { margin: 0 2px; }
.switch-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--glass);
  box-shadow: inset 0 1px 0 var(--glass-edge), inset 0 0 0 0.5px var(--glass-stroke), 0 1px 3px rgba(15, 25, 45, 0.06);
  font-weight: 600;
  cursor: default;
}
.switch-btn:hover { background: var(--glass-strong); }
.switch-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switcher .menu-list { left: 0; right: 0; min-width: 0; top: calc(100% + 6px); }

/* --- formuláre --- */
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 5px; font-size: 12.5px; font-weight: 500; color: var(--secondary); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 6px; }
form.form-actions { margin: 0; }
input, select {
  font: inherit;
  font-size: 14px;
  color: var(--label);
  background: var(--glass-strong);
  border: none;
  border-radius: 9px;
  box-shadow: inset 0 0 0 1px var(--separator), 0 1px 2px rgba(0, 0, 0, 0.04);
  padding: 0 11px;
  height: 36px;
  min-width: 0;
}
input:focus, select:focus { box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 3.5px var(--focus); }
input:disabled, select:disabled { background: transparent; box-shadow: none; color: var(--secondary); padding-left: 0; opacity: 1; }
input::placeholder { color: var(--tertiary); }
input.short { width: 110px; text-align: right; }
fieldset { border: none; padding: 0; margin: 0; }
fieldset legend { font-size: 12.5px; font-weight: 500; color: var(--secondary); padding: 0; margin-bottom: 6px; }
.choices { display: grid; gap: 8px; }
.form .choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--glass);
  box-shadow: inset 0 0 0 1px var(--separator);
  color: var(--label);
  font-size: 14px;
}
.form .choice:has(input:checked) { box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-soft); }
.choice input { height: auto; margin-top: 3px; accent-color: var(--accent); box-shadow: none; }
.choice b { font-weight: 600; }

/* nastavenia: riadky so štítkom vľavo a ovládaním vpravo */
.settings .row.field { cursor: default; }
.settings .row.field input:not(.switch), .settings .row.field select { width: min(320px, 45%); }
.settings .row.field input.short { width: 110px; }
.settings .form-actions { margin-top: 18px; }
input.switch {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  width: 44px;
  height: 24px;
  padding: 0;
  margin: 0;
  border-radius: 999px;
  background: var(--fill-strong);
  box-shadow: inset 0 0.5px 1px rgba(0, 0, 0, 0.08);
  transition: background 0.2s ease;
  flex: none;
}
input.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 26px;
  height: 20px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1.5px 4px rgba(0, 0, 0, 0.22);
  transition: transform 0.22s cubic-bezier(0.3, 1.4, 0.5, 1);
}
input.switch:checked { background: #34c759; }
input.switch:checked::after { transform: translateX(14px); }
input.switch:focus-visible { box-shadow: 0 0 0 3.5px var(--focus); }

/* úprava popisu priamo v tabuľke: vyzerá ako text, tlačidlo sa ukáže pri písaní */
.inline-edit { display: flex; align-items: center; gap: 6px; margin: 0; }
.inline-edit input { background: transparent; box-shadow: none; height: 30px; padding: 0 8px; margin-left: -8px; width: 100%; max-width: 220px; }
.inline-edit input:hover { box-shadow: inset 0 0 0 1px var(--separator); }
.inline-edit input:focus { background: var(--glass-strong); box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 3px var(--focus); }
.inline-edit button { visibility: hidden; }
.inline-edit:focus-within button { visibility: visible; }

/* --- tabuľky v skupine --- */
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th { font-size: 12px; font-weight: 500; color: var(--secondary); text-align: left; padding: 13px 12px 7px; white-space: nowrap; }
.table td { padding: 9px 12px; border-top: 1px solid var(--separator); vertical-align: middle; }
.table tbody tr:first-child td { border-top-color: transparent; }
.table thead + tbody tr:first-child td { border-top-color: var(--separator); }
.table th:first-child, .table td:first-child { padding-left: 18px; }
.table th:last-child, .table td:last-child { padding-right: 16px; }
.table tbody tr:hover td { background: rgba(120, 120, 128, 0.05); }
.table tbody tr:last-child td:first-child { border-bottom-left-radius: var(--radius-group); }
.table tbody tr:last-child td:last-child { border-bottom-right-radius: var(--radius-group); }
.table th.num { text-align: right; }
.table td.w-bar { width: 32%; }
.menu-col { width: 44px; text-align: right; }
.cell-icon { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cell-text { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
svg.bar { width: 100%; height: 6px; display: block; }
.bar-track { fill: var(--fill); }

/* štítky stavu */
.pill { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--fill); color: var(--secondary); white-space: nowrap; }
.pill.ok { background: var(--green-soft); color: var(--green); }
.pill.warn { background: var(--orange-soft); color: var(--orange); }
.pill.busy { background: var(--accent-soft); color: var(--accent); }

/* oznamy */
.notice { padding: 12px 16px; border-radius: 14px; margin: 0 0 18px; background: var(--glass); box-shadow: inset 0 0 0 0.5px var(--glass-stroke), var(--glass-shadow); border-left: 4px solid var(--accent); }
.notice.ok { border-left-color: #34c759; }
.notice.error { border-left-color: #ff3b30; }
.error { color: var(--red); }

/* --- dlaždice so štatistikou (kpi; .tile sú ikony) --- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { display: grid; align-content: start; gap: 4px; padding: 15px 16px 14px; border-radius: 16px; min-width: 0; }
.kpi-label { color: var(--secondary); font-size: 12.5px; font-weight: 500; }
.kpi-main { font-family: var(--rounded); font-size: 26px; font-weight: 700; letter-spacing: -0.015em; line-height: 1.15; white-space: nowrap; }
.kpi-main small { font-size: 15px; font-weight: 600; color: var(--secondary); }
.kpi-sub { color: var(--secondary); font-size: 12px; line-height: 1.35; }

/* --- prstencový graf a legenda (ako v klientovi) --- */
.split { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 24px; align-items: center; }
.donut-wrap { position: relative; width: 180px; height: 180px; }
.donut { width: 100%; height: 100%; overflow: visible; }
.donut .track { fill: none; stroke: var(--fill); stroke-width: 26; }
.donut .seg { fill: none; stroke-width: 26; }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 2px; padding: 0 36px; }
.donut-center b { font-family: var(--rounded); font-size: 21px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.05; }
.donut-center span { color: var(--secondary); font-size: 11.5px; }
.legend { display: grid; gap: 1px; min-width: 0; }
.legend-row { display: grid; grid-template-columns: 4px 22px minmax(0, 1fr) auto 40px; align-items: center; gap: 9px; padding: 4px 6px 4px 0; border-radius: 9px; font-size: 13px; }
.legend-row:hover { background: var(--fill); }
.legend-row .swatch { width: 4px; height: 20px; }
.legend-row .time { color: var(--secondary); font-size: 12px; text-align: right; }
.legend-row .pct { font-weight: 600; text-align: right; }

/* stĺpcové grafy a mapa aktivity */
svg.chart { width: 100%; height: auto; display: block; }
svg.chart .axis { font-size: 11px; fill: var(--secondary); font-family: -apple-system, system-ui, sans-serif; }
svg.chart .grid { stroke: var(--separator); stroke-width: 1; }
.c-active { fill: var(--c-active); }
.c-idle { fill: var(--c-idle); }
.c-private { fill: var(--c-private); }
.heat { fill: var(--heat); }
.heat-empty { fill: var(--fill); }
.legend-inline { display: flex; gap: 16px; align-items: center; font-size: 12px; color: var(--secondary); margin: 10px 0 0; }
.legend-inline span { display: inline-flex; align-items: center; gap: 6px; }
.key { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.key.k-active { background: var(--c-active); }
.key.k-idle { background: var(--c-idle); }
.key.k-private { background: var(--c-private); }

/* --- opakované postupy: rozbaľovacie riadky --- */
.proc { position: relative; }
.proc > summary { list-style: none; cursor: default; }
.proc > summary::-webkit-details-marker { display: none; }
.proc > summary:hover { background: rgba(120, 120, 128, 0.06); }
.proc:first-child > summary { border-top-left-radius: var(--radius-group); border-top-right-radius: var(--radius-group); }
.proc:last-child:not([open]) > summary { border-bottom-left-radius: var(--radius-group); border-bottom-right-radius: var(--radius-group); }
.proc-count { font-family: var(--rounded); font-size: 20px; font-weight: 700; min-width: 58px; letter-spacing: -0.01em; }
.chain { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 4px; }
.chain-stop { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 3px; border-radius: 999px; background: var(--fill); font-size: 12.5px; font-weight: 500; max-width: 220px; }
.chain-stop > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chain-stop .tile { width: 20px; height: 20px; border-radius: 50%; }
svg.i.chain-sep { width: 14px; height: 14px; color: var(--tertiary); }
.proc .disclosure { transition: transform 0.2s ease; }
.proc[open] .disclosure { transform: rotate(180deg); }
.proc-body { padding: 4px 20px 18px 86px; }

/* trasa postupu so zastávkami (rozbalený detail) */
.route { list-style: none; margin: 6px 0 0; padding: 0 0 4px; display: flex; overflow-x: auto; }
.route .stop { position: relative; flex: 1 1 0; min-width: 110px; max-width: 220px; padding: 24px 14px 0 0; }
.route .stop::before { content: ""; position: absolute; top: 8px; left: 0; right: 0; height: 3px; border-radius: 2px; background: var(--fill-strong); }
.route .stop:first-child::before { left: 8px; }
.route .stop:last-child::before { right: auto; width: 8px; }
.route .dot { position: absolute; top: 0; left: 0; width: 18px; height: 18px; }
.route .dot circle { stroke: var(--glass-strong); stroke-width: 3; }
.route .app { display: block; font-weight: 600; font-size: 13px; line-height: 1.25; overflow-wrap: anywhere; }
.route .domain { display: block; color: var(--secondary); font-size: 12px; overflow-wrap: anywhere; }
.route .acts { display: block; color: var(--secondary); font-size: 12px; margin-top: 2px; }

/* postup v Pripojení AI */
ol.steps { margin: 0; padding: 16px 20px 16px 40px; display: grid; gap: 10px; }

/* report analýzy */
.report { max-width: 900px; line-height: 1.55; }
.report h1 { font-size: 22px; margin: 4px 0 12px; }
.report h2 { font-size: 17px; margin: 24px 0 8px; }
.report h3 { font-size: 15px; margin: 18px 0 6px; }
.report table { border-collapse: collapse; margin: 8px 0 16px; font-size: 13px; width: 100%; }
.report th, .report td { text-align: left; padding: 6px 8px; border-top: 1px solid var(--separator); }
.report hr { border: none; border-top: 1px solid var(--separator); margin: 22px 0; }

/* --- úzke stránky: prihlásenie, súhlas, chyby --- */
.card { padding: 30px 30px 26px; }
.narrow-card .brand { margin-bottom: 20px; }
.narrow-card h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 6px; }
.narrow-card .lede { margin: 0 0 20px; }
.narrow-card .form { margin-top: 18px; }
.narrow-card p { margin: 0 0 12px; }
.narrow-card .muted, .muted { color: var(--secondary); }
.narrow-card .actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.narrow-card form + form { margin-top: 12px; }
.narrow-card fieldset { display: grid; gap: 8px; padding: 12px 14px; border-radius: 14px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--separator); }
.check { display: flex !important; align-items: flex-start; gap: 10px; color: var(--label) !important; font-size: 14px !important; font-weight: 400 !important; }
.check input { height: auto; margin-top: 3px; box-shadow: none; accent-color: var(--accent); }
.check.disabled { opacity: 0.55; }
.totp { display: flex; gap: 16px; align-items: center; }
.qr { flex: none; width: 150px; height: 150px; background: #fff; border-radius: 12px; padding: 6px; }
.qr svg { width: 100%; height: 100%; display: block; }
.confirm p { margin: 0 0 14px; }

/* --- úzke obrazovky --- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
  .stats .stat:nth-child(n + 3) { display: none; }
}
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; box-shadow: inset 0 -1px 0 var(--separator); overflow: visible; }
  .sidebar .side-group { display: flex; flex-wrap: wrap; gap: 2px; width: 100%; }
  .side-link { height: 30px; padding: 0 9px; font-size: 13px; }
  .switcher { order: 1; flex: 1 1 200px; }
  .brand-link { order: 0; }
  .side-user { order: 2; margin: 0 0 0 auto; border: none; padding: 0; }
  .side-user .who { display: none; }
  .side-user svg.tile { display: none; }
  .sidebar > .side-group { order: 3; }
  .content main { padding: 22px 16px 28px; }
  .foot { padding: 16px; }
  .split { grid-template-columns: 1fr; justify-items: center; }
  .legend { width: 100%; }
  .stats { display: none; }
  .proc-body { padding: 4px 16px 16px; }
  .route { flex-direction: column; overflow: visible; }
  .route .stop { max-width: none; min-width: 0; padding: 0 0 12px 28px; }
  .route .stop::before { top: 9px; bottom: -9px; left: 7.5px; right: auto; width: 3px; height: auto; }
  .route .stop:first-child::before { left: 7.5px; }
  .route .stop:last-child::before { display: none; }
  .table.stack thead { display: none; }
  .table.stack tr { display: grid; grid-template-columns: 1fr auto; padding: 10px 14px; border-top: 1px solid var(--separator); position: relative; }
  .table.stack tbody tr:first-child { border-top: none; }
  .table.stack td { border: none; padding: 2px 0; }
  .table.stack td:first-child { padding-left: 0; grid-column: 1; }
  .table.stack td:not(:first-child):not(.menu-col) { grid-column: 1; color: var(--secondary); font-size: 13px; }
  .table.stack td.menu-col { position: absolute; top: 10px; right: 10px; width: auto; }
  .settings .row.field { flex-wrap: wrap; }
  .settings .row.field input:not(.switch), .settings .row.field select { width: 100%; }
  .form-row { grid-template-columns: 1fr; }
  .table td.w-bar, .table td.num.dim { display: none; }
}
@media (max-width: 560px) {
  .kpis { grid-template-columns: 1fr; }
  .page-head { align-items: flex-start; }
  .large-title { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
