@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@700&display=swap');
:root {
  --bg: #0B0E13; --rail: #0F1319; --panel: #12161D; --panel2: #181D26; --line: #232A35; --line2: #1C222B;
  --text: #E7ECF3; --muted: #94A0B2; --soft: #C3CBD6;
  --accent: #3D8BFD; --accent-bg: #1F3A63; --sel-bg: #152033;
  --ok: #34C277; --warn: #E8A317; --crit: #F2564D; --unknown: #6B7686;
  --radius: 12px; font-size: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: #7DB2FF; }
h1 { font-size: 18px; margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: 15px; margin: 0; font-weight: 600; }
h3 { font-size: 12px; margin: 18px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* shell */
.app { display: flex; min-height: 100vh; }
nav.rail { flex: 0 0 80px; background: var(--rail); border-right: 1px solid var(--line2); display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 0; position: sticky; top: 0; height: 100vh; }
nav.rail a.logo { width: 44px; height: 44px; padding: 0; border-radius: 12px; background: #0B1220; box-shadow: inset 0 0 0 1px #1E293B; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
nav.rail a.logo:hover { background: #111A2B; }
nav.rail a.logo .mark { width: 30px; height: 30px; }
/* SentriX márka */
.mark { display: block; }
.wordmark { font-family: "Space Grotesk", Inter, system-ui, sans-serif; font-weight: 700; letter-spacing: -0.03em; color: var(--text); }
.wordmark b { color: #3B82F6; font-weight: 700; }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.brand-mark .mark { width: 44px; height: 44px; }
.brand h1 { font-size: 28px; line-height: 1; }
nav.rail a { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 64px; padding: 9px 0 7px; border-radius: 10px; color: var(--muted); font-size: 10.5px; font-weight: 500; }
nav.rail a:hover { color: var(--text); background: #161C25; }
nav.rail a.on { color: var(--text); background: #1B2533; }
nav.rail .spacer { flex: 1; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
header.top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 24px; border-bottom: 1px solid var(--line2); position: sticky; top: 0; background: var(--bg); z-index: 5; }
header.top .grow { flex: 1 1 20px; }
.search { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; color: var(--muted); min-width: 220px; height: 36px; }
.search input { background: transparent; border: 0; outline: none; color: var(--text); font: inherit; font-size: 13px; width: 100%; padding: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 99px; font-size: 12.5px; background: var(--panel2); color: var(--soft); white-space: nowrap; }
.chip.crit { background: #2A1416; color: #FF9A94; } .chip.warn { background: #2A2111; color: #F4C66A; } .chip.ok { background: #12261B; color: #7EE2A8; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: #243041; border: 1px solid var(--line); color: var(--text); font-weight: 600; cursor: pointer; }
.page { padding: 20px 24px 40px; display: flex; flex-direction: column; gap: 16px; }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--unknown); flex: none; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.crit { background: var(--crit); } .dot.info { background: #5B9BF8; }

button, .btn { font-family: inherit; height: 36px; padding: 0 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; color: var(--text); font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
button:hover, .btn:hover { border-color: #3A4555; color: var(--text); }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.danger { color: #FF9A94; }
button.small, .btn.small { height: 30px; padding: 0 10px; font-size: 12.5px; }
button.icon { width: 36px; padding: 0; }
button:disabled { opacity: .45; cursor: default; }
.seg { display: inline-flex; gap: 3px; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.seg button { height: 28px; min-width: 38px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-weight: 600; padding: 0 10px; }
.seg button.on, .seg a.on { background: var(--accent-bg); color: #fff; }
.seg a { height: 28px; display: inline-flex; align-items: center; border-radius: 6px; color: var(--muted); font-weight: 600; padding: 0 12px; font-size: 13px; }
.seg a:hover { color: var(--text); }
input, select, textarea { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 13.5px; width: 100%; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }
input[type=date], input[type=time] { color-scheme: dark; width: auto; }
label.f { display: block; font-size: 12px; color: var(--muted); margin: 12px 0 5px; }
.form { max-width: 560px; }
.help { font-size: 12px; color: var(--muted); margin-top: 4px; }
.checks label { display: flex; gap: 9px; align-items: center; font-size: 14px; margin: 7px 0; cursor: pointer; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.card.click { cursor: pointer; } .card.click:hover { border-color: #3A4555; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.kpi .v { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.bar { height: 6px; border-radius: 99px; background: #232A35; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 99px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 12px; white-space: nowrap; border-top: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 12px; border-top: 0; }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--panel2); }
.tablebox { overflow-x: auto; }
.indent { display: inline-block; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 9px 12px; color: var(--muted); border-bottom: 2px solid transparent; font-size: 13.5px; }
.tabs a.on { color: var(--text); border-color: var(--accent); }
.badge { background: var(--accent); color: #fff; border-radius: 99px; padding: 0 6px; font-size: 11px; margin-left: 5px; }
.log { background: #080B0F; border: 1px solid var(--line); border-radius: 10px; padding: 12px; max-height: 420px; overflow: auto; white-space: pre-wrap; }
.events .ev { display: grid; grid-template-columns: 12px 110px 1fr; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); align-items: baseline; font-size: 13px; }
.events .ev.supp { opacity: .5; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }

/* live */
.split { display: flex; flex: 1; min-height: 0; }
aside.tree { flex: 0 0 290px; background: var(--panel); border-right: 1px solid var(--line2); padding: 14px 10px; overflow-y: auto; max-height: calc(100vh - 61px); position: sticky; top: 61px; }
aside.tree .hd { display: flex; justify-content: space-between; align-items: baseline; padding: 0 8px 10px; }
aside.tree .hd h2 { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.tnode { display: flex; align-items: center; gap: 9px; width: 100%; background: transparent; border: 0; color: var(--text); padding: 7px 8px; border-radius: 8px; cursor: pointer; text-align: left; font-size: 13.5px; height: auto; justify-content: flex-start; }
.tnode:hover { background: #18202B; }
.tnode.site { font-weight: 600; font-size: 14px; }
.tnode.cam { cursor: grab; font-size: 13px; }
.tnode.cam.on { background: var(--sel-bg); }
.tnode .name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tnode .cnt { font-size: 12px; color: var(--muted); font-weight: 400; }
.tnode .more { padding: 0 6px; border-radius: 6px; color: var(--muted); font-weight: 600; line-height: 20px; }
.tnode .more:hover { background: #26303D; color: var(--text); }
.tnode.cam .more { opacity: 0; } .tnode.cam:hover .more, .tnode.cam:focus-visible .more { opacity: 1; }
.tnode.hid { opacity: .5; }
.tgroup { margin-left: 12px; padding-left: 10px; border-left: 1px solid var(--line); }
.tsub { display: flex; align-items: center; gap: 8px; padding: 6px 8px; color: var(--muted); font-size: 12.5px; }
section.stage { flex: 1; min-width: 0; padding: 14px 20px 20px; display: flex; flex-direction: column; gap: 12px; }
.vgrid { display: grid; gap: 6px; }
.tile { position: relative; aspect-ratio: 16 / 9; background: #06080B; border: 2px solid transparent; border-radius: 10px; overflow: hidden; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.tile.sel { border-color: var(--accent); }
.tile.drop { border-color: var(--warn); border-style: dashed; }
.tile video-stream, .tile video { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.tile video { object-fit: contain; background: #06080B; }
.tile .ph { opacity: .18; }
.tile .lbl { position: absolute; left: 10px; top: 9px; font-size: 12.5px; font-weight: 600; background: rgba(6,8,11,.72); padding: 3px 8px; border-radius: 6px; z-index: 2; max-width: 70%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .live { position: absolute; right: 10px; top: 9px; display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; letter-spacing: .05em; background: rgba(6,8,11,.72); padding: 3px 7px; border-radius: 6px; z-index: 2; }
.tile .live i { width: 6px; height: 6px; border-radius: 50%; background: var(--crit); }
.tile .site { position: absolute; left: 10px; bottom: 8px; font-size: 11.5px; color: var(--soft); background: rgba(6,8,11,.72); padding: 2px 7px; border-radius: 6px; z-index: 2; }
.tile .off { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 0 16px; text-align: center; background: #0A0C10; z-index: 1; }
.tile .off b { font-size: 13px; color: #FF9A94; } .tile .off span { font-size: 12px; color: var(--muted); }
.tile.empty { cursor: default; color: var(--muted); font-size: 12.5px; border: 1px dashed #1E2530; background: #080A0D; }
.infostrip { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.infostrip .k { font-size: 11.5px; color: var(--muted); display: block; }
.wall { position: fixed; inset: 0; background: #000; padding: 4px; z-index: 50; }
.wall .vgrid { height: 100%; align-content: center; }

/* playback */
.timeline { display: flex; flex-direction: column; gap: 6px; }
.tl-row { display: flex; align-items: center; gap: 10px; }
.tl-row .nm { flex: 0 0 150px; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-track { position: relative; flex: 1; height: 24px; background: #2A313C; border-radius: 5px; overflow: hidden; cursor: crosshair; }
.tl-track span { position: absolute; top: 0; bottom: 0; }
.tl-ruler { position: relative; flex: 1; height: 16px; font-size: 11px; color: var(--muted); }
.tl-ruler span { position: absolute; transform: translateX(-50%); }
.tl-head { position: absolute; top: -3px; bottom: -3px; width: 2px; background: #fff; border-radius: 2px; pointer-events: none; z-index: 3; }
.legend { display: flex; flex-direction: column; gap: 7px; font-size: 13px; }
.legend span { display: flex; align-items: center; gap: 8px; }
.legend i { width: 18px; height: 8px; border-radius: 3px; display: inline-block; }

/* live view: timeline under the opened camera (UniFi Protect style) */
.vgrid.single .tile { justify-self: center; width: min(100%, calc((100vh - 360px) * 16 / 9)); min-width: 480px; }
.tile .live.pbbadge { background: var(--accent); color: #fff; }
.ltl { position: relative; padding: 10px 14px 12px; display: flex; flex-direction: column; gap: 6px; }
.ltl[hidden] { display: none; }
.ltl-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ltl-bar button.small, .ltl-bar .btn.small { height: 30px; }
.ltl-bar .legend { flex-direction: row; gap: 12px; margin-left: 6px; font-size: 12px; color: var(--muted); }
.ltl-bar .legend i { width: 10px; height: 10px; border-radius: 3px; }
.ltl-live { height: 30px; display: inline-flex; align-items: center; gap: 6px; border-radius: 99px; font-weight: 700; font-size: 12px; letter-spacing: .05em; padding: 0 14px; }
.ltl-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.ltl-live.on { background: var(--crit); border-color: var(--crit); color: #fff; }
.ltl-live.on i { background: #fff; }
.ltl-ruler { position: relative; height: 16px; font-size: 11px; color: var(--muted); overflow: hidden; }
.ltl-ruler span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.ltl-ruler span::after { content: ''; position: absolute; left: 50%; top: 14px; width: 1px; height: 4px; background: var(--line); }
.ltl-track { position: relative; height: 40px; background: repeating-linear-gradient(90deg, #232933 0 8px, #1F252E 8px 16px); border-radius: 6px; overflow: hidden; cursor: grab; user-select: none; touch-action: none; }
.ltl-track:active { cursor: grabbing; }
.ltl-track .rec { position: absolute; left: 0; right: 0; bottom: 0; height: 14px; }
.ltl-track .rec span { position: absolute; top: 0; bottom: 0; }
.ltl-track .note { position: absolute; left: 10px; bottom: 0; height: 14px; line-height: 14px; font-size: 11px; color: var(--muted); }
.ltl-track .mk { position: absolute; top: 5px; width: 4px; height: 18px; margin-left: -2px; border-radius: 2px; cursor: pointer; box-shadow: 0 0 0 1px #0008; }
.ltl-track .mk:hover { transform: scaleY(1.25); width: 6px; margin-left: -3px; z-index: 2; }
.ltl-track .mk.al { background: var(--crit); top: 3px; height: 22px; }
.ltl-track .now { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -2px; background: var(--crit); pointer-events: none; }
.ltl-track .head { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 6px #fff8; pointer-events: none; z-index: 3; }
.ltl-evs { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 2px; scrollbar-width: thin; }
.ltl-evs .ev { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; height: 46px; padding: 3px 10px 3px 3px; border-radius: 8px; text-align: left; }
.ltl-evs .ev img { width: 70px; height: 40px; object-fit: cover; border-radius: 5px; background: #06080B; }
.ltl-evs .ev .ic { width: 10px; height: 40px; border-radius: 4px; margin-left: 3px; }
.ltl-evs .ev .tx { display: flex; flex-direction: column; font-size: 12px; line-height: 1.3; max-width: 170px; }
.ltl-evs .ev .tx b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.ltl-tip { position: absolute; z-index: 20; display: flex; flex-direction: column; gap: 6px; background: #0B0E13; border: 1px solid var(--line); border-radius: 10px; padding: 6px; pointer-events: none; font-size: 12px; max-width: 260px; box-shadow: 0 8px 24px #0009; }
.ltl-tip[hidden] { display: none; }
.ltl-tip img { width: 240px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; background: #06080B; }
@media (max-width: 1800px) { .ltl-bar .legend { display: none; } }
.ltl-tip div { display: flex; justify-content: space-between; gap: 10px; padding: 0 2px; }

/* alarms */
.alarm { display: flex; gap: 12px; padding: 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; }
.alarm.sel { border-color: var(--accent); background: var(--sel-bg); }
.alarm .th { flex: 0 0 104px; width: 104px; height: 58px; align-self: flex-start; background: #06080B; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
#map { position: relative; flex: 1; min-height: 520px; background: #0E1319; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.mappin { display: flex; align-items: center; gap: 8px; background: rgba(11,14,19,.9); border: 1px solid var(--line); border-radius: 99px; padding: 4px 11px 4px 5px; color: var(--text); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.mappin i { width: 13px; height: 13px; border-radius: 50%; border: 3px solid #0B0E13; display: inline-block; }
.leaflet-container { background: #0E1319 !important; font-family: inherit !important; }
.leaflet-div-icon { background: transparent !important; border: 0 !important; }
/* a camera with an ongoing event: blinking dot + spreading ring, and its popup */
.evpulse { position: relative; display: block; width: 36px; height: 36px; cursor: pointer; }
.evpulse i { position: absolute; inset: 11px; border-radius: 50%; background: var(--c); border: 2px solid #0B0E13; box-shadow: 0 0 10px var(--c); animation: evblink 1s step-end infinite; }
.evpulse::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 3px solid var(--c); animation: evring 1.2s ease-out infinite; }
@keyframes evblink { 50% { opacity: .25; } }
@keyframes evring { from { transform: scale(.35); opacity: 1; } to { transform: scale(1.25); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .evpulse i { animation-duration: 2s; } .evpulse::after { animation: none; opacity: .8; } }
.evpop .leaflet-popup-content-wrapper { background: rgba(18,22,29,.96); color: var(--text); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.5); }
.evpop .leaflet-popup-tip { background: rgba(18,22,29,.96); }
.evpop .leaflet-popup-content { margin: 10px; font-size: 13px; line-height: 1.35; }
.evpop a.leaflet-popup-close-button { color: #94A0B2; }
.evp img { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; margin-bottom: 8px; background: #06080B; }
.evp-t { display: flex; justify-content: space-between; gap: 8px; padding-right: 14px; }
.evp-n { font-weight: 600; margin-top: 2px; }
.evp .btn { color: var(--text); }

/* misc */
.login { min-height: 100vh; display: grid; place-items: center; }
.login .card { width: 360px; padding: 28px; }
.toast { position: fixed; right: 18px; bottom: 18px; background: var(--panel2); border: 1px solid var(--line); padding: 11px 15px; border-radius: 10px; z-index: 99; max-width: 440px; font-size: 13.5px; }
.toast.err { border-color: var(--crit); }
.modal-bg { position: fixed; inset: 0; background: #000b; display: grid; place-items: center; z-index: 60; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px; width: min(620px, 94vw); max-height: 90vh; overflow: auto; }
.menu { position: absolute; z-index: 20; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 6px; min-width: 220px; box-shadow: 0 10px 30px #0008; }
.menu button { width: 100%; justify-content: flex-start; border: 0; background: transparent; height: 32px; }
.menu button:hover { background: #222A36; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 7px 14px; font-size: 13.5px; }
.kv div:nth-child(odd) { color: var(--muted); }
.chart { width: 100%; height: 90px; }
.chart path.l { fill: none; stroke: var(--accent); stroke-width: 1.5; }
.chart path.a { fill: #3D8BFD22; }
@media (max-width: 900px) {
  .app { flex-direction: column; } nav.rail { flex-direction: row; height: auto; position: static; overflow-x: auto; padding: 8px; }
  nav.rail a.logo, nav.rail .spacer { display: none; }
  .split { flex-direction: column; } aside.tree { position: static; max-height: 300px; flex: none; }
  .page { padding: 14px; }
}

td.wrap { white-space: normal; }

/* home */
.home { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 210px; gap: 14px; grid-auto-flow: dense; }
.home .hw { display: flex; flex-direction: column; min-height: 0; overflow: hidden; padding: 12px 14px; }
.home.editing .hw { outline: 1px dashed var(--line); cursor: grab; }
.home .hw.drop { outline: 2px solid var(--accent); } .home .hw.dragging { opacity: .4; }
.hw-hd { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; font-size: 13.5px; }
.hw-hd b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hw-tools { display: flex; gap: 4px; flex-wrap: nowrap; } .hw-tools button { height: 26px; padding: 0 8px; }
.hw-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: auto; }
.hw-grid { display: grid; gap: 6px; flex: 1; min-height: 0; grid-auto-rows: minmax(0, 1fr); }
.hw-grid .tile { aspect-ratio: auto; min-height: 0; height: 100%; cursor: pointer; }
.hw-grid .tile .ph svg { width: 28px; height: 28px; }
.hw-pager { display: flex; justify-content: center; align-items: center; gap: 10px; padding-top: 6px; }
.hw-list { display: flex; flex-direction: column; gap: 2px; }
.hw-row { display: flex; align-items: center; gap: 10px; padding: 6px 6px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 13px; line-height: 1.35; }
.hw-row:hover { background: #18202B; } .hw-row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.hw-snap { width: 54px; height: 34px; border-radius: 6px; object-fit: cover; flex: none; display: inline-block; }
.hw-empty { color: var(--muted); font-size: 13px; padding: 10px 2px; }
.hw-note { white-space: pre-wrap; font-size: 13.5px; color: var(--soft); }
.hw-map { flex: 1; min-height: 0; border-radius: 8px; overflow: hidden; background: #0B0E13; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; height: 100%; }
.kpi { display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 10px 14px; border-radius: 10px; background: #121821; border-left: 3px solid var(--line); }
.kpi b { font-size: 26px; font-weight: 650; } .kpi.ok { border-left-color: #34C277; } .kpi.warn { border-left-color: #E8A317; } .kpi.crit { border-left-color: #F2564D; }
.hw-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hw-pick button { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; height: auto; padding: 10px 12px; text-align: left; }
@media (max-width: 1100px) { .home { grid-template-columns: repeat(2, minmax(0, 1fr)); } .home .hw { grid-column: span 2 !important; } .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .home { grid-template-columns: 1fr; grid-auto-rows: 240px; } .home .hw { grid-column: span 1 !important; } }

header.top .lang-sel { width: auto; height: 36px; padding: 0 8px; font-size: 13px; }
.login .lang-sel { width: 100%; }

/* OpenStreetMap tiles darkened to the interface colours */
.leaflet-tile.osm-dark, .osm-dark .leaflet-tile { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9) saturate(.5); }
.leaflet-container .leaflet-control-attribution { background: rgba(11,14,19,.7); color: #94A0B2; font-size: 10px; }
.leaflet-container .leaflet-control-attribution a { color: #94A0B2; }
.leaflet-control-layers { background: #12161D !important; color: #E7ECF3; border: 1px solid #232A35 !important; }

/* event search: filters left, results right */
.srch { display: grid; grid-template-columns: 300px 1fr; gap: 18px; align-items: start; }
.srch-f { position: sticky; top: 12px; }
.srch-f .f:first-child { margin-top: 0; }
.srch-f input[type="datetime-local"] { width: 100%; }
.srch-r { min-width: 0; }
@media (max-width: 900px) { .srch { grid-template-columns: 1fr; } .srch-f { position: static; } }

/* ---- üzemeltetés ---- */
.kbtn { gap: 8px; color: var(--muted); }
.kbtn kbd { font: 600 10.5px ui-monospace, monospace; background: var(--panel2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; color: var(--muted); }
button.icon.on { background: var(--accent-bg); border-color: var(--accent); }
.tile .pmask { position: absolute; background: #000; z-index: 3; pointer-events: none; }
.tile .tbadges { position: absolute; right: 10px; bottom: 8px; display: flex; gap: 4px; z-index: 4; }
.tile .tb { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; background: rgba(6,8,11,.8); padding: 2px 6px; border-radius: 5px; color: var(--soft); }
.tile .tb.ok { color: #7EE2A8; } .tile .tb.warn { color: #F4C66A; } .tile .tb.crit { color: #FF9A94; background: #3a1214e6; }
.tile .tstat { position: absolute; left: 10px; top: 36px; font-size: 11px; background: rgba(6,8,11,.78); color: #C3CBD6; padding: 2px 7px; border-radius: 5px; z-index: 4; pointer-events: none; }
.gal { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.gcard { padding: 10px; }
.gcard.bad { border-color: #6b2a28; }
.gcard img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; background: #06080B; display: block; cursor: zoom-in; }
.gcard .gerr { aspect-ratio: 16/9; border-radius: 8px; background: #0A0C10; color: var(--muted); display: grid; place-items: center; font-size: 12px; padding: 10px; text-align: center; }
.gcard .gname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gflag { font-size: 12px; color: #FF9A94; margin-top: 4px; }
.diff { background: #090C11; border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-top: 12px; font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; max-height: 55vh; overflow: auto; white-space: pre-wrap; word-break: break-all; }
.diff:empty { display: none; }
.diff .dl.add { background: #12301f; color: #9BEBBE; } .diff .dl.rem { background: #3a1416; color: #FFB0AA; } .diff .dl.gap { color: var(--muted); text-align: center; }
.redit { position: relative; user-select: none; touch-action: none; cursor: crosshair; background: #06080B; border-radius: 8px; overflow: hidden; min-height: 120px; }
.redit img { width: 100%; display: block; pointer-events: none; }
.redit #reload { padding: 40px; text-align: center; }
.redit .rz { position: absolute; border: 2px solid var(--crit); background: rgba(242, 86, 77, .28); cursor: pointer; }
.redit .rz.ghost { border-style: dashed; pointer-events: none; }
.photos { display: flex; flex-wrap: wrap; gap: 8px; }
.photos .ph-it { position: relative; }
.photos img { width: 110px; height: 80px; object-fit: cover; border-radius: 8px; cursor: zoom-in; display: block; }
.photos .ph-it button { position: absolute; right: 3px; top: 3px; height: 22px; width: 22px; padding: 0; border-radius: 50%; background: #000a; }
.photos .ph-add { width: 110px; height: 80px; border: 1px dashed var(--line); border-radius: 8px; display: grid; place-items: center; font-size: 26px; color: var(--muted); cursor: pointer; }
.notes { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; max-height: 360px; overflow: auto; }
.note { border-top: 1px solid var(--line); padding-top: 8px; font-size: 13px; }
.note.closed { opacity: .6; }
.pal-bg { place-items: start center; padding-top: 12vh; }
.pal { width: min(640px, 94vw); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: 0 20px 60px #000a; }
.pal input { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 14px 16px; font-size: 15px; background: transparent; }
.pal input:focus { outline: none; }
.pal-l { max-height: 50vh; overflow: auto; padding: 6px; }
.pal-i { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; color: var(--soft); }
.pal-i.on, .pal-i:hover { background: var(--sel-bg); color: var(--text); }
.pal-t { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-s { color: var(--muted); font-size: 12px; margin-left: auto; white-space: nowrap; }
.pal-k { font-size: 10.5px; color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; }
.pal-f { padding: 8px 14px; border-top: 1px solid var(--line); }
.chip.small { font-size: 11px; padding: 2px 7px; }
@media print {
  nav.rail, header.top, .tabs, .noprint, .toast { display: none !important; }
  html, body, .app, .main, .page { background: #fff !important; color: #111 !important; }
  .card { background: #fff !important; border-color: #ccc !important; break-inside: avoid; }
  .muted, th { color: #555 !important; }
  td, th { border-color: #ddd !important; color: #111; }
  .report h1, .report h2 { color: #111; }
}
.opsbody { display: flex; flex-direction: column; gap: 16px; flex: none; }
.opsbody > * { flex-shrink: 0; }
.opsbody .kpis { height: auto; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
