/* GRATA Maintenance - rozlozenie aplikacie (bocne menu, horna lista, plna sirka); farby su v theme.css */
:root { --side-w: 232px; }

body.app { overflow-x: hidden; }
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr) 0px; min-height: 100vh; transition: grid-template-columns .18s ease; }
.shell.actopen { grid-template-columns: var(--side-w) minmax(0, 1fr) min(380px, 100vw); }
.content { min-width: 0; display: flex; flex-direction: column; }
.app main { max-width: none; margin: 0; padding: 22px 28px 48px; flex: 1; }

/* ---------- bocne menu ---------- */
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--bg2);
  border-right: 1px solid var(--border); padding: 16px 12px 12px; overflow-y: auto; z-index: 60; }
.side .brand { padding: 4px 8px 16px; }
.snav { display: flex; flex-direction: column; gap: 1px; }
.sgroup { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); padding: 16px 10px 6px; font-weight: 700; }
.snav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px; color: var(--text2); font-weight: 500; }
.snav a .ico { color: var(--faint); }
.snav a:hover { background: var(--hi); color: var(--text); text-decoration: none; }
.snav a:hover .ico { color: var(--text2); }
.snav a.on { background: var(--blue-bg); color: #0f4fb8; font-weight: 600; }
.snav a.on .ico { color: var(--blue); }
.ico { width: 18px; height: 18px; flex: none; }
.sfoot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 1px; }
.suser, .slogout { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--muted); font-size: 13px; }
.suser:hover, .slogout:hover { background: var(--hi); color: var(--text); text-decoration: none; }
.sname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sfoot form { margin: 0; }
.slogout { width: 100%; background: none; border: 0; font: inherit; font-size: 13px; cursor: pointer; text-align: left; }
.powered { color: var(--faint); font-size: 12px; padding: 8px 10px 0; }
.powered b { color: var(--muted); letter-spacing: .05em; }
.suser .pill { height: 18px; font-size: 11px; padding: 0 6px; }

/* ---------- horna lista ---------- */
.topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 12px; height: 54px; padding: 0 28px;
  background: rgba(243, 245, 249, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.ptitle { margin: 0; font-size: 17px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topright { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.navbtn { display: none; background: #fff; border: 1px solid var(--border-strong); border-radius: 8px; color: var(--text); padding: 6px; cursor: pointer; }
.navbtn .ico { display: block; }
.livedot { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
#acttoggle { position: relative; }
#acttoggle.active { background: var(--blue-bg); border-color: var(--blue-line); color: #0f4fb8; }
#actbadge { display: inline-flex; align-items: center; justify-content: center; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--azure); color: #04101f; font-size: 10.5px; font-weight: 700; }
#actbadge.err { background: var(--bad); color: #fff; }
#actpanel { grid-column: 3; grid-row: 1; align-self: start; position: sticky; top: 0; height: 100vh; width: 100%; min-width: 0; display: flex; flex-direction: column; background: #050b16; border-left: 1px solid var(--border); box-shadow: -10px 0 30px rgba(0,0,0,.2); overflow: hidden; z-index: 70; }
#actpanel[hidden] { display: none; }
.livedot i { width: 8px; height: 8px; border-radius: 50%; background: #16a571; animation: livepulse 2.4s ease-out infinite; }
@keyframes livepulse { 0% { box-shadow: 0 0 0 0 rgba(22, 165, 113, .5); } 70%, 100% { box-shadow: 0 0 0 7px rgba(22, 165, 113, 0); } }
.scrim { display: none; }

/* ---------- spolocne ---------- */
.app .card { padding: 16px 18px; margin-bottom: 14px; }
.app h2 { font-size: 18px; } .app h3 { font-size: 15px; }

/* ---------- prehlad ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { border: 1px solid var(--border); padding: 12px 16px; display: flex; flex-direction: column; gap: 2px; }
.kpi span { text-transform: uppercase; letter-spacing: .07em; }
.kpi b { font-size: 28px; line-height: 1.15; }
a.kpi { color: var(--text); } a.kpi:hover { text-decoration: none; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.search { position: relative; flex: 1 1 260px; max-width: 420px; margin: 0; }
.search .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; pointer-events: none; }
.search input { width: 100%; min-width: 0; padding-left: 34px; }
.fchips { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.toolbar .grow { margin-left: auto; }
.nores { display: none; color: var(--muted); padding: 10px 2px; }

.sitebox { padding: 0; overflow: hidden; }
.sitebox > .site-head { padding: 12px 18px; margin: 0; background: var(--card2); border-bottom: 1px solid var(--border); }
.sitebox .netsec { border-top: 0; margin: 0; padding: 14px 18px 4px; }
.sitebox .netsec + .netsec { border-top: 1px solid var(--border); }
.sitebox .netsec .site-head { margin-bottom: 8px; }
.sc { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); font-weight: 500; margin-left: 10px; }
.sc b { color: var(--ok); font-weight: 700; }
tr[hidden] { display: none; }

/* ---------- zariadenie ---------- */
.devhead { background: var(--card); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); padding: 14px 18px; margin-bottom: 14px; }
.dh-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dh-top h2 { margin: 0; font-size: 21px; display: flex; align-items: center; gap: 8px; }
.dh-top .dot { width: 11px; height: 11px; margin: 0; }
.crumbs { color: var(--muted); font-size: 12.5px; margin-bottom: 4px; }
.crumbs a { color: var(--muted); } .crumbs a:hover { color: var(--azure); }
.dh-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 8px 22px; margin: 12px 0 0; }
.facts dt { color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.facts dd { margin: 1px 0 0; font-size: 13.5px; overflow-wrap: anywhere; }
details.manage { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
details.manage > summary { cursor: pointer; color: var(--azure); font-size: 13px; font-weight: 600; list-style: none; display: inline-flex; align-items: center; gap: 6px; }
details.manage > summary::-webkit-details-marker { display: none; }
details.manage > summary .ico { width: 15px; height: 15px; }
.manage-body { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; padding-top: 10px; }
.manage-body form { margin: 0; }
.manage-body .mg { display: flex; flex-direction: column; gap: 4px; }
.manage-body .mg > span { color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.devalerts { border-left: 4px solid var(--bad); }
.devalerts h3 { margin-bottom: 4px; }

/* sekcie zariadenia: horne zalozky */
.devlayout { display: block; }
.subnav { position: sticky; top: 54px; z-index: 40; display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 2px;
  background: var(--bg); border-bottom: 1px solid var(--border); padding: 0; margin: 0 0 16px; }
.subnav .sgroup { display: block; width: 1px; height: 18px; padding: 0; margin: 0 5px; background: var(--border-strong); font-size: 0; align-self: center; }
.subnav .sgroup:first-child { display: none; }
.subnav a { display: inline-flex; align-items: center; padding: 11px 13px; border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.subnav a:hover { color: var(--text); text-decoration: none; }
.subnav a.active { color: var(--text); border-bottom-color: var(--blue); font-weight: 650; }
.subnav .badge { margin-left: 6px; }
.devbody { min-width: 0; }

.app .charts { grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); }
.app .hwgrid { grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr)); }
.app .kv { grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); }
.kv dt { color: var(--muted); font-weight: 600; font-size: 11.5px; }

/* ---------- formulare v mriezke ---------- */
.app .ipgrid { grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); gap: 14px 18px; align-items: start; }
.app .ipgrid label { margin: 0; }
.app .ipgrid label > input, .app .ipgrid label > select, .app .ipgrid label > textarea { display: block; width: 100%; min-width: 0; margin-top: 6px; }
.app .ipgrid > div { color: var(--muted); font-size: 12.5px; line-height: 2; }
.app .ipgrid .chk { color: var(--text); font-size: 14px; margin-right: 14px; white-space: normal; }
.app .ipgrid .fbtns { align-self: end; }

/* ---------- uzsie obrazovky ---------- */
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 0 auto 0 0; width: min(280px, 84vw); transform: translateX(-102%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(23, 32, 51, .3); }
  body.nav-open .side { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(23, 32, 51, .45); z-index: 55; }
  .navbtn { display: inline-flex; }
  .topbar { padding: 0 14px; }
  .app main { padding: 16px 14px 40px; }
  .livedot { display: none; }
  .shell.actopen { grid-template-columns: minmax(0, 1fr); }
  #actpanel { position: fixed; inset: 0; height: 100vh; z-index: 950; border-left: 0; }
  .subnav { flex-wrap: nowrap; overflow-x: auto; }
  .subnav .sgroup { flex: none; }
}
@media (prefers-reduced-motion: reduce) { .livedot i { animation: none; } .side { transition: none; } }
@media print { .side, .topbar, .scrim { display: none; } .shell { display: block; } }
