/* Nowera Fleet – rozloženie a komponenty nad sklenenou témou z nowera tasks (theme.css) */
:root {
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

body { padding: env(safe-area-inset-top) 0 calc(104px + env(safe-area-inset-bottom)); }
a { color: var(--accent-text); }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
h1, h2, h3 { line-height: 1.2; text-wrap: balance; }
h2 { font-size: var(--fs-lg); font-weight: 650; letter-spacing: -.01em; }
h3 { font-size: var(--fs-md); font-weight: 650; }

/* ------------------------------------------------------------ navigácia (spodná lišta / bočný pás ako v nowera tasks) */
.nav { position: fixed; z-index: 30; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); border-radius: 30px; padding: 6px; }
.nav-brand { display: none; }
.nav-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; }
.tab {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 7px 4px 6px; border-radius: 22px; font-size: 11px; font-weight: 600; color: var(--text-2); text-decoration: none !important;
  transition: background .25s var(--ease), color .2s var(--ease), transform .3s var(--spring);
}
.tab svg { width: 23px; height: 23px; }
.tab:active { transform: scale(.94); }
.tab.active { color: var(--accent-text); background: var(--sheen), var(--glass-solid); box-shadow: var(--rim), 0 2px 10px -4px rgba(0, 0, 0, .25); }
.badge {
  position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px;
  background: var(--danger); color: #fff; font-size: 11px; font-weight: 750; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--glass-solid);
}
@media (min-width: 900px) {
  body { padding: 0 0 32px 112px; }
  .nav { left: 14px; right: auto; top: 14px; bottom: 14px; width: 84px; padding: 12px 8px; display: flex; flex-direction: column; align-items: center; gap: 14px; border-radius: 32px; }
  .nav-brand { display: grid; place-items: center; }
  .nav-brand .logo { width: 44px; height: 44px; border-radius: 13px; box-shadow: 0 6px 16px -8px rgba(125, 22, 255, .7); }
  .nav-tabs { display: flex; flex-direction: column; gap: 6px; flex: 1; width: 100%; }
  .tab { padding: 10px 2px 8px; border-radius: 20px; }
}

/* ------------------------------------------------------------ horná lišta */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; max-width: 1320px; margin: 0 auto; padding: 10px 16px 8px; }
.brand { display: inline-flex; align-items: center; gap: 8px; padding: 7px 16px 7px 8px; border-radius: 999px; font-family: var(--font-display); font-size: 17px; font-weight: 750; letter-spacing: -.02em; color: var(--text); text-decoration: none !important; }
.brand .logo { width: 24px; height: 24px; border-radius: 7px; }
.brand span { color: var(--accent-text); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; padding: 4px 4px 4px 14px; border-radius: 999px; }
.top-actions .me { font-size: 13.5px; font-weight: 600; color: var(--text-2); margin-right: 4px; }
.top-actions .icon-btn { width: 40px; height: 40px; }
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .i-sun { display: none; }
  :root:not([data-theme]) .i-moon { display: block; }
}
@media (max-width: 899px) {
  .topbar { background: var(--sheen), var(--glass-chrome); -webkit-backdrop-filter: blur(var(--blur)) saturate(var(--sat)); backdrop-filter: blur(var(--blur)) saturate(var(--sat)); box-shadow: inset 0 -.5px 0 var(--sep); padding-top: calc(10px + env(safe-area-inset-top)); margin-top: calc(-1 * env(safe-area-inset-top)); }
  .topbar .chrome { -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: var(--rim); }
  .top-actions .me { display: none; }
}
@media (min-width: 900px) {
  .topbar { padding: 14px 24px 10px; }
  .topbar .brand { display: none; }
}

main { max-width: 1320px; margin: 0 auto; padding: 8px max(16px, env(safe-area-inset-left)) 24px; display: flex; flex-direction: column; gap: 16px; }
@media (min-width: 900px) { main { padding: 8px 24px 24px; } }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; margin: 6px 0 2px; }
.page-head > div:first-child { flex: 1 1 260px; min-width: 0; }
.page-head h1 { font-family: var(--font-display); font-size: var(--fs-title); line-height: 1.08; font-weight: 750; letter-spacing: -.035em; overflow-wrap: anywhere; }
.page-head p { margin: 6px 0 0; color: var(--text-2); }
.back { display: inline-flex; gap: 4px; align-items: center; color: var(--text-2); font-size: 14px; font-weight: 600; }

/* ------------------------------------------------------------ karty (sklo) */
.panel { background: var(--sheen), var(--glass); box-shadow: var(--rim), var(--shadow); border-radius: var(--r-lg); min-width: 0; }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; flex-wrap: wrap; }
.panel-h + * { border-top: 1px solid var(--sep); }
.panel-b { padding: 14px 18px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 16px; }
.muted { color: var(--text-3); }
.small { font-size: 12.5px; }
.err { color: var(--danger); }
.stack { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; min-width: 0; }

/* dlaždice: len čísla, ktoré vedú k akcii */
.tiles { margin-bottom: 0; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.tile { border: 0; text-align: left; cursor: pointer; color: var(--text); font: inherit; transition: transform .25s var(--spring), box-shadow .2s var(--ease); }
.tile:active { transform: scale(.98); }
.tile.crit b { color: var(--danger); }
.tile.warn b { color: var(--warn); }
.tile.on { box-shadow: var(--rim), 0 0 0 2px var(--accent-2); }

/* čipy so stavom (bodka = stav, farba = význam) */
.chip { gap: 6px; font-size: 12px; font-weight: 650; padding: 3px 10px; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.chip.ok { background: rgba(34, 165, 89, .14); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.crit { background: var(--danger-soft); color: var(--danger); }
.chip.acc { background: var(--accent-soft); color: var(--accent-text); }
.chip.plain::before { display: none; }

/* tabuľky v skle */
.tbl { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th { text-align: left; font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); font-weight: 650; padding: 10px 12px; white-space: nowrap; }
td { padding: 10px 12px; border-top: 1px solid var(--sep); vertical-align: top; }
thead + tbody tr:first-child td { border-top: 1px solid var(--sep); }
table:not(:has(thead)) tr:first-child td { border-top: 0; }
th:first-child, td:first-child { padding-left: 18px; }
th:last-child, td:last-child { padding-right: 18px; }
tbody tr.click { cursor: pointer; transition: background .15s var(--ease); }
tbody tr.click:hover { background: var(--fill); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.cell-sub { color: var(--text-3); font-size: 12.5px; }

/* tlačidlá: menšie varianty pre husté tabuľky */
.btn.sm { min-height: 32px; padding: 0 12px; font-size: 13px; }
.btn.danger { color: var(--danger); }

/* formuláre */
input[type=text], input[type=email], input[type=password], input[type=search], select, textarea {
  min-height: 44px; padding: 10px 14px; font: inherit; font-size: 15px; color: var(--text); min-width: 0;
  background: var(--glass-input); border: 0; border-radius: var(--r-sm); outline: none;
  box-shadow: inset 0 0 0 1px var(--field-line), inset 0 1px 2px rgba(0, 0, 0, .06); transition: box-shadow .2s var(--ease);
}
input:focus, select:focus, textarea:focus { box-shadow: inset 0 0 0 1.5px var(--accent-2), 0 0 0 4px var(--accent-soft); }
input[type=search] { border-radius: 999px; padding: 0 16px; }
textarea { width: 100%; min-height: 150px; font-family: var(--mono); font-size: 13px; resize: vertical; }
label.f { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; align-items: end; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); vertical-align: -3px; }

.banner { border-radius: var(--r-md); padding: 12px 16px; background: var(--sheen), var(--warn-soft); box-shadow: var(--rim); color: var(--warn); font-weight: 650; overflow-wrap: anywhere; }
.banner.crit { background: var(--sheen), var(--danger-soft); color: var(--danger); }
.code-box { font-family: var(--mono); font-size: 12.5px; word-break: break-all; background: var(--glass-input); box-shadow: inset 0 0 0 1px var(--accent-2); border-radius: var(--r-sm); padding: 12px; user-select: all; }
.kv { display: grid; grid-template-columns: minmax(130px, 40%) 1fr; gap: 8px 14px; font-size: 14px; margin: 0; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.seg { flex-wrap: wrap; }
.seg button { min-height: 34px; padding: 5px 12px; font-size: 13.5px; }
.spark { display: flex; gap: 2px; align-items: flex-end; height: 28px; }
.spark i { width: 5px; border-radius: 2px; background: var(--ok); opacity: .75; }
.spark i.bad { background: var(--danger); opacity: 1; }
.empty { padding: 28px 18px; text-align: center; color: var(--text-3); }

/* nastavenia: riadky ako v nowera tasks */
.lrow { display: flex; align-items: center; gap: 12px; padding: 11px 18px; flex-wrap: wrap; min-height: 56px; }
.lrow + .lrow { border-top: 1px solid var(--sep); }
.lrow > div:first-child { flex: 1 1 170px; min-width: 0; }
.lrow b { display: block; font-weight: 600; }
.lrow small { display: block; color: var(--text-2); font-size: 13px; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer; padding: 0; box-shadow: var(--rim), 0 2px 6px -2px rgba(0, 0, 0, .3); transition: transform .3s var(--spring); }
.swatch.on { box-shadow: 0 0 0 2px var(--glass-solid), 0 0 0 4px var(--accent-2); }
.sw-aurora { background: radial-gradient(circle at 25% 25%, #7d16ff, transparent 60%), radial-gradient(circle at 80% 70%, #3b82f6, transparent 60%), #e4e1f0; }
.sw-sand { background: radial-gradient(circle at 25% 25%, #fbbf24, transparent 60%), radial-gradient(circle at 80% 70%, #f472b6, transparent 60%), #f1ece4; }
.sw-sage { background: radial-gradient(circle at 25% 25%, #4ade80, transparent 60%), radial-gradient(circle at 80% 70%, #2dd4bf, transparent 60%), #e3ece8; }
.sw-graphite { background: radial-gradient(circle at 25% 25%, #94a3b8, transparent 60%), radial-gradient(circle at 80% 70%, #64748b, transparent 60%), #e2e4e8; }

/* prihlásenie */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(380px, 100%); display: grid; gap: 12px; text-align: center; justify-items: center; padding: 30px 24px; border-radius: var(--r-xl); }
.login-card > * { width: 100%; }
.login-card > .login-logo { width: 64px; height: 64px; border-radius: 19px; box-shadow: 0 10px 24px -10px rgba(125, 22, 255, .6); }
.login-card .brand { justify-content: center; font-size: 28px; padding: 0; }
.login-card p { margin: 0; color: var(--text-2); font-size: 14px; }
.login-card input { text-align: center; height: 50px; border-radius: 999px; width: 100%; }
.login-card .btn { min-height: 50px; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 60; bottom: calc(100px + env(safe-area-inset-bottom));
  max-width: min(520px, calc(100% - 28px)); padding: 12px 18px; border-radius: 999px;
  background: rgba(20, 24, 26, .86); color: #f2f6f6; font-size: 14.5px; font-weight: 550;
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); box-shadow: inset 0 1px 1px rgba(255, 255, 255, .15), 0 16px 40px -12px rgba(0, 0, 0, .5);
}
@media (min-width: 900px) { .toast { bottom: 28px; left: calc(50% + 56px); } }

@media (max-width: 720px) {
  .hide-sm { display: none; }
  th, td { padding: 9px 8px; }
  th:first-child, td:first-child { padding-left: 14px; }
}

/* ------------------------------------------------------------ podboxy v karte Stav: PageSpeed a Uptime */
.subbox { align-self: stretch; display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; border-radius: var(--r-md); background: var(--fill); box-shadow: inset 0 0 0 .5px var(--sep); }
.subbox-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.subbox p { margin: 0; }
.psi-rings { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.psi-ring { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: 12px; font-weight: 600; color: var(--text-2); line-height: 1.25; }
.psi-ring .ring { width: 64px; height: 64px; }
.psi-ring .ring b { font-size: 18px; }
.psi-ring .rb { stroke: var(--fill-2); fill: none; }
.psi-ring .rf { fill: none; stroke: var(--text-3); }
.psi-ring.good .rf { stroke: var(--ok); }
.psi-ring.good b { color: var(--ok); }
.psi-ring.mid .rf { stroke: var(--warn); }
.psi-ring.mid b { color: var(--warn); }
.psi-ring.bad .rf { stroke: var(--danger); }
.psi-ring.bad b { color: var(--danger); }
.psi-metrics { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.psi-metrics b { color: var(--text); font-weight: 650; }
.chip.psi-good { background: rgba(34, 165, 89, .14); color: var(--ok); }
.chip.psi-mid { background: var(--warn-soft); color: var(--warn); }
.chip.psi-bad { background: var(--danger-soft); color: var(--danger); }
.chip[class*="psi-"]::before { display: none; }
.uptime-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.uptime-stats div { display: flex; flex-direction: column; gap: 2px; }
.uptime-stats b { font-family: var(--font-display); font-size: 22px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.uptime-stats b.ok { color: var(--ok); }
.uptime-stats b.warn { color: var(--warn); }
.uptime-stats b.crit { color: var(--danger); }
.uptime-stats span { font-size: 12.5px; color: var(--text-2); }
.subbox .spark { height: 32px; gap: 2px; }
.subbox .spark i { flex: 1; min-width: 2px; max-width: 6px; }
@media (max-width: 420px) {
  .psi-ring .ring { width: 54px; height: 54px; }
  .psi-ring .ring b { font-size: 15px; }
}

/* akceptované riziko */
.accept-form { display: flex; flex-direction: column; gap: 8px; min-width: 260px; }
.accept-form textarea { min-height: 64px; font-family: var(--font); font-size: 14px; }
.accepted-reason { max-width: 260px; white-space: normal; font-style: italic; }
.psi-body { display: flex; flex-direction: column; gap: 12px; }
