#adm { max-width: 1280px; margin: 0 auto; padding: 16px; }
body { padding: calc(env(safe-area-inset-top) + 60px) 0 24px; }
.bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 14px; }
.bar .grow { flex: 1 1 260px; color: var(--muted); font-size: 14px; }
.btn.sm { padding: 7px 11px; font-size: 14px; }
.hint2 { color: var(--muted); font-size: 13px; }

/* kafelki */
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.tile { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 14px 12px;
  box-shadow: var(--shadow); cursor: pointer; transition: border-color .15s, transform .15s; }
.tile:hover { border-color: var(--accent); transform: translateY(-1px); }
.tile.off { opacity: .6; }
.tile.alarm { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, var(--card)); box-shadow: 0 0 0 1px var(--bad), var(--shadow); }
.tile .head { display: flex; align-items: center; gap: 8px; padding-right: 28px; }
.tile .sdot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.tile .sdot.on { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }
.tile .sdot.bad { background: var(--bad); }
.tile h3 { margin: 0; font-size: 17px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .id { color: var(--muted); font-size: 13px; font-weight: 500; flex: none; }
.tile .chk { position: absolute; top: 12px; right: 12px; }
.tile .chk input { width: 20px; height: 20px; cursor: pointer; }
.tile .badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 650; background: var(--chip); color: var(--ink); }
.badge.ok { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.badge.warn { background: color-mix(in srgb, var(--warn) 20%, transparent); color: var(--warn); }
.badge.bad { background: var(--bad); color: #fff; }
.tile .kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 12px 0 0; }
.tile .kv div { background: var(--chip); border-radius: 10px; padding: 6px 8px; }
.tile .kv small { display: block; color: var(--muted); font-size: 11px; }
.tile .kv b { font-size: 15px; font-variant-numeric: tabular-nums; }
.tile .foot { margin: 10px 0 0; color: var(--muted); font-size: 12.5px; display: flex; justify-content: space-between; gap: 8px; }
.tile .note { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* szczegoly urzadzenia */
.dhead { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 12px; }
.dhead h2 { margin: 0; font-size: 20px; }
.dhead .grow { flex: 1; }
.dhead .badges { display: flex; flex-wrap: wrap; gap: 6px; }
.edit { display: grid; gap: 10px; grid-template-columns: 1fr 1fr auto; align-items: end; }
@media (max-width: 700px) { .edit { grid-template-columns: 1fr; } }
iframe.dev { width: 100%; height: calc(100vh - 200px); height: calc(100dvh - 200px); min-height: 480px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg); display: block; }
@media (max-width: 700px) { iframe.dev { height: calc(100dvh - 270px); min-height: 420px; } #adm { padding: 12px; } .dhead .hint2 { display: none; } .dhead h2 { font-size: 18px; flex: 1 1 60%; } }

/* zdalna diagnostyka */
.diag .drow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 10px; }
.diag .drow input { flex: 1 1 220px; min-width: 0; }
.diag .dfiles { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; max-height: 260px; overflow: auto; }
.diag .dfiles a { color: var(--accent); word-break: break-all; }

/* 2026-11-15: rodzaj alarmu na kafelku */
.tile .altxt { margin: 8px 0 0; color: var(--bad); font-size: 13px; font-weight: 600; }

/* historia temperatur (2026-11-20); kolory czujnikow stale, osobno dla jasnego i ciemnego tla */
:root { --h-t2: #2a78d6; --h-t1: #eb6834; --h-t3: #1baf7a; --h-t6: #eda100; --h-t8: #e87ba4; --h-t9: #008300; --h-t10: #6250d6; --h-t11: #8a8a85; }
@media (prefers-color-scheme: dark) { :root { --h-t2: #3987e5; --h-t1: #d95926; --h-t3: #199e70; --h-t6: #c98500; --h-t8: #d55181; --h-t9: #0ca30c; --h-t10: #9085e9; --h-t11: #9a9a94; } }
.hist .hbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 10px; }
.hist .hbar .grow { flex: 1; }
.hist .hseg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.hist .hseg button { font: inherit; font-size: 14px; font-weight: 650; border: 0; background: var(--chip); color: var(--muted); padding: 7px 12px; cursor: pointer; }
.hist .hseg button + button { border-left: 1px solid var(--line); }
.hist .hseg button.on { background: var(--accent); color: #fff; }
.hist .hleg { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.hchip { display: inline-flex; align-items: center; gap: 7px; font: inherit; font-size: 13px; font-weight: 600; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--chip); color: var(--ink); cursor: pointer; }
.hchip.off { opacity: .45; text-decoration: line-through; }
.hist .sw { display: inline-block; width: 16px; height: 0; border-top: 3px solid; border-radius: 2px; flex: none; }
.hist .sw.dash { border-top-style: dashed; }
.hplot { position: relative; user-select: none; -webkit-user-select: none; min-height: 120px; }
.hplot svg { display: block; width: 100%; height: auto; }
.hplot .ax { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.hplot .gr { stroke: var(--line); stroke-width: 1; } .hplot .gr.minor { stroke-dasharray: 2 4; }
.hplot .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; } .hplot .ln.dash { stroke-dasharray: 6 4; }
.hplot .alb { fill: var(--bad); opacity: .14; } .hplot .als { fill: var(--bad); }
.hplot .alm line { stroke: var(--bad); stroke-width: 1.5; stroke-dasharray: 4 3; } .hplot .alm path { fill: var(--bad); }
.hplot .xh { stroke: var(--muted); stroke-width: 1; } .hplot .dot { stroke: var(--card); stroke-width: 2; }
.hplot .sel { fill: var(--accent); opacity: .15; }
.hplot .hempty { color: var(--muted); margin: 40px 0; text-align: center; }
.htip { position: absolute; pointer-events: none; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; box-shadow: var(--shadow); min-width: 200px; z-index: 2; }
.htip .tt { font-weight: 650; margin: 0 0 4px; }
.htip .r { display: flex; justify-content: space-between; gap: 12px; padding: 1px 0; } .htip .r > span { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.htip b { font-variant-numeric: tabular-nums; color: var(--ink); } .htip .r.m { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; }
.htip .r.al span { color: var(--bad); font-weight: 650; }

/* historia: zakres od-do i starty sprezarki (2026-11-21) */
.hist .hrange { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hist .hrange label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.hist .hin { width: 12em; font: inherit; font-variant-numeric: tabular-nums; font-size: 14px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--chip); color: var(--ink); color-scheme: light dark; }
.hist .hmsg { display: block; color: var(--bad); font-size: 13px; font-weight: 600; margin: -4px 0 8px; min-height: 0; }
.hist .hmsg:empty { display: none; }
.hist .hstarts { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.hist .shead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin: 0 0 6px; }
.hist .shead h3 { margin: 0; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.hist .hsum { font-size: 13px; color: var(--ink); font-variant-numeric: tabular-nums; }
.hchip.static { cursor: default; }
.hist .swb { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.hplot .sbg { fill: var(--chip); stroke: var(--line); stroke-width: 1; }
.htip .tl { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; }

/* konta instalatorow i panel serwisowy (2026-11-21) */
.badge.inst { background: var(--chip); color: var(--muted); font-weight: 600; }
.konta .kform { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; align-items: end; }
.konta .kmsg { font-weight: 650; color: var(--ink); background: var(--chip); border-radius: 10px; padding: 10px 12px; margin: 12px 0; word-break: break-word; }
.konta .kmsg:empty { display: none; }
.konta .klist { display: grid; gap: 8px; margin: 8px 0; }
.konta .krow { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) auto; gap: 8px 14px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.konta .krow.off { opacity: .6; }
.konta .kbtn { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 640px) { .konta .krow { grid-template-columns: 1fr; } }
.kinst { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.kinst .f { flex: 1 1 260px; margin: 0; }
.ksel { width: 100%; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.kerr { color: var(--bad); font-weight: 650; min-height: 1.2em; margin: 4px 0 10px; }
.krowb { display: flex; gap: 10px; flex-wrap: wrap; }
.konta .kdel { color: var(--bad); }
.tile .tnote { margin: 8px 0 0; color: var(--ink); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dodaj .kodin { font: inherit; font-size: 26px; font-weight: 800; letter-spacing: .15em; width: 8.5em; text-align: center; font-variant-numeric: tabular-nums;
  color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.kok { color: var(--ok); font-weight: 650; margin: 8px 0 0; }

/* powiadomienia instalatora (etap 3, 2026-11-21) */
.ntfy .nkroki { margin: 8px 0 6px; padding-left: 1.3em; line-height: 1.7; }
.ntfy .nkroki li { margin: 2px 0; }
.ntfy .nval { font: 600 0.95em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--chip, rgba(127,127,127,.15)); padding: 1px 6px; border-radius: 5px; user-select: all; word-break: break-all; }
.ntfy a { color: inherit; }

/* praca: sam pasek (2026-11-21) */
.hstarts .hplot { min-height: 0; }
.hist .stabw { overflow-x: auto; margin: 10px 0 6px; }
.hist .stab { border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; width: 100%; max-width: 560px; }
.hist .stab th, .hist .stab td { padding: 6px 10px 6px 0; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
.hist .stab thead th { color: var(--muted); font-weight: 600; font-size: 12px; }
.hist .stab th[scope=row] { text-align: left; color: var(--muted); font-weight: 600; }
.hist .stab td.tot { font-weight: 700; color: var(--ink); }
.hist .stab .swb { margin-right: 6px; }
.hist .snote { margin: 0 0 8px; }

/* >>> pasek pomaranczowy z czarna kozica (2026-11-21) >>> */
body .top { background: #ff8a1f; border-bottom: 1px solid #d96f0e; }
body .top .top-title { color: #140c04; }
body .top .top-sub { color: rgba(20, 12, 4, .7); }
body .top .conn { color: #f4ede6; background: #0a0a0a; padding: 6px 12px; border-radius: 999px; font-weight: 600; }
body .top .brand::before { content: ""; width: 42px; height: 42px; flex: none; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath fill='%230d0b09' d='M29.5 65.7L25.3 66.0L24.3 66.4L24.0 67.0L24.5 68.4L25.8 69.8L27.8 71.3L30.5 72.7L32.7 73.9L33.3 74.5L33.3 74.9L33.4 75.6L34.2 76.2L35.1 76.8L35.4 77.6L35.2 78.6L34.3 80.1L33.5 81.0L32.7 81.1L31.4 80.2L29.2 78.3L25.3 74.3L21.2 69.6L17.0 64.4L20.6 61.1L24.2 57.8L21.6 52.6L19.5 47.2L18.3 41.4L17.9 38.0L17.5 36.2L16.8 35.4L15.6 35.3L14.0 35.5L13.0 36.2L13.0 36.8L13.8 37.1L14.8 37.7L15.2 39.2L15.5 41.1L16.2 42.5L16.9 43.2L16.7 43.5L13.5 42.5L11.9 42.1L10.8 42.0L9.8 42.5L8.6 43.5L6.4 45.2L5.5 45.4L4.7 45.2L4.0 44.6L3.4 43.6L2.5 40.3L0.6 31.9L0.0 28.8L0.3 26.8L0.8 24.7L1.0 21.4L1.2 19.2L1.8 16.9L4.0 12.3L7.3 8.0L11.4 4.3L14.1 2.6L16.2 1.6L18.6 1.2L22.0 1.1L25.4 1.2L27.7 1.7L29.5 2.7L31.7 4.7L33.8 6.8L34.9 8.4L35.4 10.2L35.4 12.8L35.4 17.2L34.2 13.8L32.6 10.6L30.5 8.0L29.0 6.8L27.6 6.1L25.9 5.9L23.3 6.1L19.0 7.2L15.4 9.3L12.6 12.2L11.6 13.9L10.9 15.8L10.1 18.7L10.1 19.9L11.1 19.8L13.1 18.5L16.4 16.4L15.9 18.4L15.9 19.7L16.9 20.7L19.2 21.7L23.2 22.7L28.9 25.9L39.5 32.9L51.7 40.9L55.7 42.9L58.9 44.1L64.4 45.9L70.0 48.2L75.7 50.3L81.3 51.6L85.1 52.2L86.7 52.8L86.2 54.0L84.8 55.2L83.1 56.1L81.5 56.5L80.4 56.6L79.8 57.0L79.7 58.1L80.0 60.0L80.5 65.8L80.8 67.1L81.4 68.3L84.5 71.2L87.9 73.9L89.9 76.0L91.1 78.3L91.9 81.7L92.6 84.4L93.4 86.3L94.7 87.8L96.5 89.3L98.7 91.5L99.9 93.7L100.0 95.9L98.9 97.9L98.1 98.7L97.3 98.9L96.5 98.5L95.2 97.6L94.2 96.6L94.1 96.2L94.1 95.5L93.1 93.7L88.7 85.5L86.0 79.9L76.0 75.9L67.5 72.0L64.6 70.2L62.4 68.4L60.3 66.5L58.1 65.3L54.9 64.7L49.4 64.1L41.2 63.5L39.1 63.8L37.5 64.4L34.1 65.3Z'/%3E%3C/svg%3E") center / contain no-repeat; }
/* pasek wyrownany do szerokosci tresci (#adm: 1280 px, margines 16 px; na telefonie 12 px) */
body .top { padding-left: max(16px, calc((100% - 1280px) / 2 + 16px)); padding-right: max(16px, calc((100% - 1280px) / 2 + 16px)); }
@media (max-width: 700px) { body .top { padding-left: 12px; padding-right: 12px; } }
/* kafelki: pasek z nazwa i numerem w kolorze paska; pod nim status: zielony online, czerwony offline (zamiast kropki) */
body .tile .head { margin: -14px -14px 0; padding: 12px 46px 12px 14px; background: #ff8a1f; border-radius: 15px 15px 0 0; }
body .tile h3 { color: #140c04; }
body .tile .id { color: rgba(20, 12, 4, .7); }
body .tile .sdot { display: none; }
body .tile .head { border-bottom: 6px solid var(--ok); }
body .tile.off .head { border-bottom-color: var(--bad); }
body .tile .chk { top: 12px; right: 14px; }
/* <<< pasek <<< */

/* >>> tabela urzadzen (2026-11-22) >>> */
.vseg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; flex: none; }
.vseg button { font: inherit; font-size: 14px; font-weight: 650; border: 0; background: var(--chip); color: var(--muted); padding: 7px 12px; cursor: pointer; }
.vseg button + button { border-left: 1px solid var(--line); }
.vseg button.on { background: #ff8a1f; color: #140c04; }
.fbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 10px; }
.fbar input[type=search] { font: inherit; font-size: 14px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); flex: 0 1 340px; min-width: 0; }
.fbar .fchip { font: inherit; font-size: 13px; font-weight: 600; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--chip); color: var(--ink); cursor: pointer; }
.fbar .fchip.on { background: #ff8a1f; color: #140c04; border-color: #ff8a1f; }
.fbar .fcnt { margin-left: auto; color: var(--muted); font-size: 13px; }
.twrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
table.dtab { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.dtab th { text-align: left; padding: 0; background: var(--chip); border-bottom: 1px solid var(--line); white-space: nowrap; }
.dtab th button { font: inherit; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); background: none; border: 0; padding: 9px 8px; width: 100%; text-align: inherit; cursor: pointer; white-space: nowrap; }
.dtab th[aria-sort="ascending"] button, .dtab th[aria-sort="descending"] button { color: var(--ink); }
.dtab .n { text-align: right; }
.dtab td { padding: 8px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dtab tbody tr { cursor: pointer; }
.dtab tbody tr:last-child td { border-bottom: 0; }
.dtab tbody tr:hover, .dtab tbody tr:focus-visible { background: var(--chip); outline: none; }
.dtab td.c-chk { width: 1%; padding: 8px 6px 8px 12px; box-shadow: inset 5px 0 0 var(--ok); }
.dtab tr.off td.c-chk { box-shadow: inset 5px 0 0 var(--bad); }
.dtab th.c-chk { width: 1%; }
.dtab td.c-chk input { width: 18px; height: 18px; cursor: pointer; vertical-align: middle; }
.dtab tr.off td:not(.c-chk):not(.c-name) { color: var(--muted); }
.dtab tr.alarm { background: color-mix(in srgb, var(--bad) 9%, transparent); }
.dtab .c-id { color: var(--muted); font-weight: 600; }
.dtab .nm { max-width: 300px; }
.dtab .ins { display: inline-block; max-width: 200px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.dtab .onl { color: var(--ok); font-size: 12.5px; font-weight: 650; }
.dtab .nm b { display: block; overflow: hidden; text-overflow: ellipsis; }
.dtab .nm small { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.dtab .nm small.al { color: var(--bad); font-weight: 600; }
.dtab .badge { font-size: 12px; padding: 2px 8px; }
@media (max-width: 1100px) { .dtab .opt { display: none; } }
@media (max-width: 700px) { .dtab .opt, .dtab .mob, .dtab .c-chk { display: none; } .dtab .c-id { box-shadow: inset 5px 0 0 var(--ok); padding-left: 12px; } .dtab tr.off .c-id { box-shadow: inset 5px 0 0 var(--bad); } .dtab .nm { max-width: 170px; } .dtab td, .dtab th button { padding-left: 6px; padding-right: 6px; } .fbar input[type=search] { flex: 1 1 100%; } .fbar .fcnt { margin-left: 0; } }
/* <<< tabela <<< */

/* >>> powiadomienia e-mail (2026-11-22) >>> */
.ntfy .nform { display: grid; gap: 8px; max-width: 560px; margin: 6px 0 4px; }
.ntfy .nlab { font-weight: 650; font-size: 14px; }
.ntfy .nmail { font: inherit; font-size: 15px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); width: 100%; box-sizing: border-box; }
.ntfy .nchk { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; line-height: 1.35; cursor: pointer; }
.ntfy .nchk input { width: 18px; height: 18px; margin: 1px 0 0; flex: none; }
.ntfy .nsub { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 16px 0 4px; border-top: 1px solid var(--line); padding-top: 12px; }
/* <<< powiadomienia e-mail <<< */
