/* DuraCloud admin UI — hand-written equivalent of the React app's Tailwind/shadcn look. */
:root {
  --bg: #ffffff; --fg: #020817; --muted: #f1f5f9; --muted-fg: #64748b; --border: #e2e8f0;
  --primary: #0f172a; --primary-fg: #f8fafc; --navy: #001E30; --blue: #2563eb; --blue-hover: #1d4ed8; --blue-soft: #eff6ff; --blue-ink: #1e40af;
  --sidebar-fg: #ffffff; --sidebar-muted: rgba(255,255,255,.62); --sidebar-hover: rgba(255,255,255,.10); --sidebar-active: rgba(255,255,255,.16);
  --green: #10b981; --green-dark: #059669; --red: #dc2626; --red-bg: #fef2f2; --amber: #d97706; --yellow: #ca8a04;
  --radius: 8px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.5 system-ui, Avenir, Helvetica, Arial, sans-serif; color: var(--fg); background: var(--bg);
       -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
a.link, .link { color: var(--blue); } a.link:hover { text-decoration: underline; }
h1 { font-size: 18px; font-weight: 600; margin: 0; } h2 { font-size: 14px; font-weight: 600; margin: 0; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.muted { color: var(--muted-fg); } .xs { font-size: 12px; } .sm { font-size: 13px; } .tiny { font-size: 11px; }
.hidden { display: none !important; }

/* layout */
.shell { min-height: 100vh; display: flex; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 224px; background: var(--navy); color: var(--sidebar-fg); display: flex;
           flex-direction: column; z-index: 20; transition: width .2s; }
.sidebar .brand { height: 56px; display: flex; align-items: center; gap: 12px; padding: 0 16px; font-weight: 600; }
.sidebar .brand img { height: 32px; width: 32px; object-fit: contain; }
.sidebar nav { flex: 1; display: flex; flex-direction: column; gap: 4px; padding: 16px 12px 0; overflow-y: auto; }
.sidebar nav a { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 6px; font-weight: 500;
                 color: var(--sidebar-muted); }
.sidebar nav a:hover { background: var(--sidebar-hover); color: var(--sidebar-fg); }
.sidebar nav a.on { background: var(--sidebar-active); color: var(--sidebar-fg); }
.sidebar nav .sep { height: 1px; background: var(--sidebar-hover); margin: 8px 4px; }
.sidebar .me { border-top: 1px solid var(--sidebar-hover); padding: 12px 16px; display: flex; gap: 12px; align-items: center; }
.sidebar .avatar { height: 32px; width: 32px; border-radius: 50%; background: var(--sidebar-active); display: grid;
                   place-items: center; font-size: 12px; font-weight: 600; flex: 0 0 auto; }
.sidebar .me .who { min-width: 0; } .sidebar .me .who p { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar .logout { display: flex; gap: 12px; align-items: center; width: 100%; padding: 12px 16px; color: var(--sidebar-muted);
                   background: none; border: 0; font: inherit; cursor: pointer; }
.sidebar .logout:hover { background: var(--sidebar-hover); color: var(--sidebar-fg); }
.sidebar .collapse { background: none; border: 0; color: var(--sidebar-muted); padding: 8px; cursor: pointer; width: 100%; }
body.collapsed .sidebar { width: 68px; }
body.collapsed .sidebar .label, body.collapsed .sidebar .who, body.collapsed .sidebar .brand span { display: none; }
body.collapsed .sidebar nav a, body.collapsed .sidebar .logout, body.collapsed .sidebar .me { justify-content: center; padding-left: 0; padding-right: 0; }
body.collapsed .main { margin-left: 68px; }
.main { flex: 1; margin-left: 224px; transition: margin .2s; min-width: 0; }
.page { max-width: 1280px; margin: 0 auto; padding: 32px; }
@media (max-width: 800px) {
  .sidebar { width: 68px; } .sidebar .label, .sidebar .who, .sidebar .brand span { display: none; }
  .sidebar nav a, .sidebar .logout, .sidebar .me { justify-content: center; padding-left: 0; padding-right: 0; }
  .main { margin-left: 68px; } .page { padding: 16px; }
}
.icon { width: 16px; height: 16px; flex: 0 0 auto; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 14px; height: 14px; } .icon.lg { width: 20px; height: 20px; } .icon.xl { width: 32px; height: 32px; }

/* toolbar rows */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; } .grow { flex: 1; } .gap4 { gap: 16px; }

/* cards */
.card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.card-pad { padding: 20px; } .card-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 8px; }
.card + .card, .mb { margin-bottom: 24px; }
.grid2 { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; } @media (max-width: 1000px) { .grid2 { grid-template-columns: 1fr; } }
.grid4 { display: grid; gap: 16px; grid-template-columns: repeat(4, 1fr); } @media (max-width: 1000px) { .grid4 { grid-template-columns: repeat(2, 1fr); } }
.stat .label { font-size: 13px; font-weight: 500; color: var(--muted-fg); display: flex; justify-content: space-between; }
.stat .value { font-size: 30px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.pulse { height: 10px; width: 10px; border-radius: 50%; background: #22c55e; animation: pulse 2s infinite; display: inline-block; }
.pulse.off { background: #9ca3af; animation: none; }
@keyframes pulse { 50% { opacity: .4; } }
dl.fields { margin: 0; display: grid; gap: 16px; } dl.fields dt { font-size: 11px; font-weight: 500; color: var(--muted-fg);
            text-transform: uppercase; letter-spacing: .05em; } dl.fields dd { margin: 2px 0 0; font-size: 14px; }

/* tables */
/* Tab page: folder tabs sitting on the panel (table) below them. */
.page-tabs { display: flex; gap: 4px; align-items: flex-end; margin-bottom: -1px; position: relative; z-index: 1; }
.page-tabs button { display: inline-flex; align-items: center; gap: 8px; padding: 10px 22px; border: 1px solid var(--border); border-radius: 8px 8px 0 0;
  background: var(--muted); color: var(--muted-fg); font: 500 14px system-ui, sans-serif; cursor: pointer; }
.page-tabs button:hover { color: var(--fg); }
.page-tabs button.on { background: var(--bg); color: var(--blue-ink); font-weight: 600; border-bottom-color: var(--bg); box-shadow: inset 0 3px 0 var(--blue); padding-top: 12px; }
.page-tabs .n { font-size: 11px; font-weight: 600; background: var(--border); color: var(--muted-fg); border-radius: 99px; padding: 1px 8px; }
.page-tabs button.on .n { background: var(--blue-soft); color: var(--blue-ink); }
.page-tabs + .table-wrap { border-top-left-radius: 0; }
.table-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; background: var(--bg); }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 500; color: var(--muted-fg); height: 44px; padding: 0 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; } tr.click:hover, tbody tr.hover:hover { background: #f1f5f9; }
tr.group td { background: rgba(241,245,249,.6); padding: 8px 12px; }
td.empty { height: 96px; text-align: center; color: var(--muted-fg); }
.right { text-align: right; } .center { text-align: center; } .nowrap { white-space: nowrap; }
.truncate { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* badges & dots */
.badge { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 1px 10px; font-size: 12px; font-weight: 500;
         border: 1px solid var(--border); background: var(--bg); white-space: nowrap; }
.badge.secondary { background: var(--muted); border-color: transparent; }
.badge.sq { border-radius: 3px; padding: 0 6px; font-weight: 400; }
.badge.blue { background: var(--blue); color: #fff; border-color: transparent; }
.badge.green { background: #16a34a; color: #fff; border-color: transparent; } .badge.yellow { background: var(--yellow); color: #fff; border-color: transparent; }
.badge.red { background: var(--red); color: #fff; border-color: transparent; }
.badge.soft-red { background: rgba(239,68,68,.1); color: #dc2626; border-color: transparent; }
.badge.full { color: var(--blue); } .badge.customer { color: #16a34a; } .badge.guest { color: var(--amber); }
.dot { display: inline-block; height: 10px; width: 10px; border-radius: 50%; border: 1px solid #9ca3af; background: #d1d5db; }
.dot.on { background: var(--green); border-color: var(--green-dark); }
.dot.on.warn { background: #f59e0b; border-color: #b45309; } .dot.on.err { background: #dc2626; border-color: #991b1b; }
.lvl-info { background: rgba(59,130,246,.1); color: #2563eb; border-color: rgba(59,130,246,.2); }
.lvl-warn { background: rgba(234,179,8,.1); color: #ca8a04; border-color: rgba(234,179,8,.2); }
.lvl-error { background: rgba(239,68,68,.1); color: #dc2626; border-color: rgba(239,68,68,.2); }
.cat { display: inline-flex; padding: 1px 6px; border-radius: 4px; font-size: 10px; font-weight: 500; background: rgba(107,114,128,.15); color: #374151; }
.cat-mqtt { background: rgba(168,85,247,.15); color: #7e22ce; } .cat-connect { background: rgba(34,197,94,.15); color: #15803d; }
.cat-auth { background: rgba(59,130,246,.15); color: #1d4ed8; } .cat-rate-limit { background: rgba(249,115,22,.15); color: #c2410c; }
.cat-error { background: rgba(239,68,68,.15); color: #b91c1c; }
.t-device { background: rgba(168,85,247,.15); color: #7e22ce; } .t-user { background: rgba(59,130,246,.15); color: #1d4ed8; }
.t-admin { background: rgba(16,185,129,.15); color: #047857; }

/* buttons & forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 6px;
       font: 500 13px/1 system-ui, sans-serif; border: 1px solid transparent; background: var(--primary); color: var(--primary-fg); cursor: pointer; white-space: nowrap; }
.btn:hover { opacity: .92; } .btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.blue { background: var(--blue); color: #fff; } .btn.blue:hover { background: var(--blue-hover); opacity: 1; }
.btn.outline { background: var(--bg); color: var(--fg); border-color: var(--border); box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.btn.outline:hover { background: var(--muted); opacity: 1; }
.btn.ghost { background: transparent; color: var(--fg); } .btn.ghost:hover { background: var(--muted); }
.btn.danger { background: var(--red); color: #fff; } .btn.dashed { border-style: dashed; }
.btn.icon-only { width: 32px; height: 32px; padding: 0; } .btn.sq { width: 36px; padding: 0; }
.btn.on { background: var(--muted); }
button.plain { background: none; border: 0; padding: 0; cursor: pointer; color: var(--muted-fg); font: inherit; }
button.plain:hover { color: var(--fg); } button.plain.link { color: var(--blue); }
input, select, textarea { font: inherit; color: var(--fg); background: #fff; border: 1px solid #d1d5db; border-radius: 6px; height: 36px; padding: 0 10px; }
textarea { height: auto; padding: 8px 10px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
input[type=checkbox] { height: auto; width: auto; } input[type=file] { padding: 6px 10px; height: auto; }
.search { position: relative; } .search .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted-fg); }
.search input { padding-left: 32px; width: 256px; }
.form-grid { display: grid; gap: 16px; } .form-grid label, .lbl { display: block; font-size: 13px; color: #374151; margin-bottom: 6px; }
.form-grid input, .form-grid select, .form-grid textarea { width: 100%; height: 44px; } .form-grid textarea { height: auto; }
.help { font-size: 12px; color: var(--muted-fg); margin-top: 4px; } .errorlist { color: var(--red); font-size: 13px; margin: 4px 0 0; padding-left: 18px; }

/* alerts */
.alert { padding: 12px 14px; border-radius: 8px; display: flex; gap: 8px; align-items: flex-start; font-size: 13px; margin-bottom: 16px; border: 1px solid; }
.alert.error { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.alert.success { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.alert.warn { background: rgba(234,179,8,.06); color: #a16207; border-color: rgba(234,179,8,.3); }
.alert.info { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }

/* dialogs (native <dialog>) */
dialog { border: 1px solid #e5e7eb; border-radius: 8px; padding: 0; background: #f8f8f8; width: min(600px, calc(100vw - 32px));
         box-shadow: 0 10px 30px rgba(0,0,0,.2); color: var(--fg); }
dialog::backdrop { background: rgba(0,0,0,.5); }
dialog .dlg { padding: 24px; } dialog h2 { font-size: 20px; color: #1f2937; margin-bottom: 8px; }
dialog .dlg-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 28px; }
dialog.sm { width: min(450px, calc(100vw - 32px)); } dialog.lg { width: min(820px, calc(100vw - 32px)); }

/* collapsible sections */
details.section > summary { list-style: none; display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; cursor: pointer; }
details.section > summary::-webkit-details-marker { display: none; }
details.section > summary:hover { background: rgba(241,245,249,.5); }
details.section[open] > summary .chev { transform: rotate(90deg); } .chev { transition: transform .15s; }
.empty-state { display: flex; flex-direction: column; align-items: center; padding: 40px 0; color: var(--muted-fg); text-align: center; }
.empty-state .icon { opacity: .4; margin-bottom: 8px; }

/* tooltips (hover) */
.tip { position: relative; } .tip .tip-body { display: none; position: absolute; z-index: 30; left: 0; top: 100%; margin-top: 4px;
       background: #fff; color: #1f2937; padding: 12px; border-radius: 6px; border: 1px solid #e5e7eb; box-shadow: 0 8px 20px rgba(0,0,0,.12); min-width: 320px; }
.tip:hover .tip-body { display: block; }

/* violations */
.vrow { border-radius: 6px; box-shadow: 0 0 0 1px var(--border); background: rgba(241,245,249,.4); margin-bottom: 8px; }
.vrow.active { background: rgba(239,68,68,.05); box-shadow: 0 0 0 1px rgba(239,68,68,.25); }
.vrow summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 10px 12px; cursor: pointer; }
.vrow summary::-webkit-details-marker { display: none; }
.vrow .vdetails { display: grid; grid-template-columns: 5rem 1fr; gap: 4px 12px; padding: 0 12px 12px 36px; font-size: 12px; }

/* logs */
.logbox { height: calc(100vh - 300px); min-height: 320px; overflow-y: auto; }
.logs td { font-family: ui-monospace, Menlo, monospace; font-size: 12px; padding: 6px 12px; }
.logs tr.warn td:first-child { box-shadow: inset 2px 0 0 #facc15; } .logs tr.error td:first-child { box-shadow: inset 2px 0 0 #f87171; }
.logs pre { background: #fff; border: 1px solid var(--border); border-radius: 4px; padding: 8px; max-height: 256px; overflow: auto; font-size: 11px; margin: 4px 0 0; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.seg a, .seg button { padding: 0 12px; height: 32px; display: inline-flex; align-items: center; gap: 6px; background: var(--bg); border: 0;
                      font: inherit; font-size: 13px; cursor: pointer; color: var(--fg); }
.seg a.on, .seg button.on { background: var(--muted); font-weight: 500; }
.multi { position: relative; } .multi .menu { display: none; position: absolute; z-index: 20; top: 100%; left: 0; margin-top: 4px; background: #fff;
         border: 1px solid var(--border); border-radius: 6px; padding: 6px; min-width: 180px; box-shadow: 0 8px 20px rgba(0,0,0,.12); }
.multi.open .menu { display: block; } .multi .menu label { display: flex; gap: 8px; align-items: center; padding: 4px 6px; text-transform: capitalize; cursor: pointer; }

/* login */
.login { min-height: 100vh; display: flex; }
.login .side { flex: 1; background: var(--navy); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.login .side img { height: 96px; margin-bottom: 48px; } .login .feats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; text-align: center; }
.login .feat .box { height: 48px; width: 48px; border-radius: 8px; background: rgba(255,255,255,.1); display: grid; place-items: center; margin: 0 auto 8px; }
.login .feat span { font-size: 13px; color: rgba(255,255,255,.6); }
.login .form { flex: 1; display: flex; align-items: center; justify-content: center; padding: 32px; }
.login .form > div { width: 100%; max-width: 320px; }
.login .ms { width: 100%; height: 48px; background: var(--navy); color: #fff; gap: 12px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted-fg); font-size: 12px; margin: 20px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
@media (max-width: 1000px) { .login .side { display: none; } }

/* ---- shared additions (Alpine pages) ---- */
[x-cloak] { display: none !important; }
.spin { display: inline-flex; animation: spin 1s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } }
.txt-red { color: #dc2626; } .txt-green { color: #16a34a; } .txt-amber { color: #d97706; } .txt-blue { color: #2563eb; }
.stack { display: flex; flex-direction: column; gap: 16px; } .grid3 { display: grid; gap: 16px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1000px) { .grid3 { grid-template-columns: 1fr; } }
.lbl { font-size: 12px; font-weight: 500; color: #374151; margin: 0 0 6px; }
.vsep { width: 1px; height: 20px; background: var(--border); display: inline-block; }
.page-title { margin-bottom: 20px; } .page-title h1 { font-size: 20px; }
.live-grid { display: grid; grid-template-columns: 240px 1fr; gap: 24px; align-items: center; } @media (max-width: 800px) { .live-grid { grid-template-columns: 1fr; } }
.big-num { font-size: 30px; font-weight: 700; margin: 0 0 4px; font-variant-numeric: tabular-nums; }
.metric { display: flex; gap: 12px; align-items: flex-start; } .metric p { margin: 0; } .mico { padding: 8px; border-radius: 6px; background: var(--muted); color: var(--muted-fg); display: flex; }
.mval { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.center-msg { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 24px 0; font-size: 13px; }
.section-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; cursor: pointer; } .section-head:hover { background: rgba(241,245,249,.5); }
.vsum { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: none; border: 0; font: inherit; cursor: pointer; text-align: left; color: inherit; }
.pulse.red { background: #ef4444; height: 6px; width: 6px; }
.badge.xs { font-size: 11px; padding: 0 8px; } .badge.yellow-soft { background: #fef9c3; color: #854d0e; border-color: transparent; }
.badge.green-soft { background: #dcfce7; color: #166534; border-color: transparent; } .badge.blue-soft { background: #dbeafe; color: #1e40af; border-color: transparent; }
.badge.role { text-transform: capitalize; } .badge.r-distro { color: #7e22ce; } .badge.r-installer { color: var(--blue); } .badge.r-customer { color: #16a34a; } .badge.r-guest { color: var(--amber); }
.sel-icon { position: relative; display: inline-flex; align-items: center; } .sel-icon .icon { position: absolute; left: 10px; color: var(--muted-fg); pointer-events: none; }
.sel-icon select { padding-left: 30px; }
.scroll-sm { max-height: 128px; overflow-y: auto; margin-top: 4px; }
.person { display: flex; align-items: center; gap: 10px; padding: 8px 0; } .avatar-sm { height: 28px; width: 28px; border-radius: 50%; background: var(--muted); display: grid; place-items: center; color: var(--muted-fg); flex: 0 0 auto; }
.avatar-sm.amber { background: #fef3c7; color: #d97706; }
.access-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.round-ico { height: 48px; width: 48px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 16px; } .round-ico.red { background: #fee2e2; color: #dc2626; } .round-ico.blue { background: #dbeafe; color: #2563eb; }
.combo { position: absolute; z-index: 50; top: 100%; left: 0; right: 0; margin-top: 4px; background: #fff; border: 1px solid var(--border); border-radius: 6px; box-shadow: 0 8px 20px rgba(0,0,0,.12); max-height: 260px; overflow-y: auto; padding: 4px; }
.combo-item { width: 100%; display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: none; border: 0; border-radius: 4px; font: inherit; text-align: left; cursor: pointer; color: inherit; }
.combo-item:hover { background: var(--muted); }
.combo-btn { width: 100%; height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 12px; background: #fff; border: 1px solid #d1d5db; border-radius: 6px; font: inherit; cursor: pointer; color: inherit; }
.pop { position: relative; display: inline-flex; } .pop-body { position: absolute; right: 0; top: 100%; z-index: 30; width: 260px; background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 12px; box-shadow: 0 8px 20px rgba(0,0,0,.12); }
tr.sel td { background: rgba(241,245,249,.6); } tr.detail td { background: rgba(241,245,249,.4); font-size: 12px; }
.switch { position: relative; width: 36px; height: 20px; border-radius: 999px; background: #cbd5e1; border: 0; cursor: pointer; vertical-align: middle; padding: 0; }
.switch span { position: absolute; top: 2px; left: 2px; height: 16px; width: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch.on { background: var(--green); } .switch.on span { left: 18px; }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #0f172a; color: #fff; padding: 10px 14px; border-radius: 8px; font-size: 13px; box-shadow: 0 8px 20px rgba(0,0,0,.2); max-width: 380px; }
.toast.error { background: #b91c1c; }

/* ---- pool configuration (external portal) ---- */
.pool { min-height: 100vh; display: flex; flex-direction: column; background: #f8fafc; }
.pool-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 10px 20px; background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 15; flex-wrap: wrap; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--muted); cursor: pointer; text-transform: capitalize; }
.status-pill.st-online { background: #dcfce7; color: #166534; } .status-pill.st-offline { background: #fee2e2; color: #991b1b; }
.status-pill.st-starting { background: #fef9c3; color: #854d0e; } .status-pill.st-updating { background: #dbeafe; color: #1e40af; }
.nbar { padding: 8px 20px; font-size: 13px; font-weight: 500; display: flex; justify-content: space-between; align-items: center; }
.nbar.error { background: #fee2e2; color: #991b1b; } .nbar.warn { background: #fef3c7; color: #92400e; }
.pool-body { flex: 1; display: flex; min-height: 0; }
.pool-nav { width: 190px; flex: 0 0 auto; background: #fff; border-right: 1px solid var(--border); padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; }
.pool-nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 6px; font-size: 13px; color: #475569; }
.pool-nav a:hover { background: var(--muted); color: var(--fg); } .pool-nav a.on { background: var(--blue-soft); color: var(--blue-ink); font-weight: 500; }
@media (max-width: 800px) { .pool-nav { width: 52px; } .pool-nav a span { display: none; } }
.pool-main { flex: 1; min-width: 0; position: relative; } .pool-page { padding: 20px; }
.overlay { position: absolute; inset: 0; z-index: 20; display: flex; justify-content: center; align-items: flex-start; background: rgba(255,255,255,.8); backdrop-filter: blur(3px); }
.overlay-card { position: relative; margin-top: 96px; width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 32px; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,.12); }
.spinner { height: 64px; width: 64px; margin: 0 auto 24px; border-radius: 50%; border-bottom: 2px solid #ca8a04; animation: spin 1s linear infinite; } .spinner.updating { border-color: var(--blue); }
.toggles { display: flex; gap: 4px; background: #f1f5f9; padding: 4px; border-radius: 8px; }
.toggles button { border: 0; background: none; padding: 4px 12px; border-radius: 6px; font: 500 12px system-ui; color: #64748b; cursor: pointer; }
.toggles button.on { background: #fff; color: var(--fg); box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 0 0 1px var(--border); }
.vtiles { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.vtile { background: #f9fafb; border-radius: 8px; padding: 8px 12px; box-shadow: inset 0 0 0 1px rgba(229,231,235,.7); }
.vl { font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; color: #6b7280; }
.vv { font: 600 13px ui-monospace, Menlo, monospace; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .vv.accent { color: var(--blue-ink); } .vv.miss { color: #9ca3af; font: 400 13px system-ui; }
.dev-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); } .dev-grid.wide { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
.dev-card { background: #fff; border-radius: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 0 0 1px #e5e7eb; display: flex; flex-direction: column; }
.dev-card.has-err { box-shadow: 0 0 0 2px #f87171; }
.dev-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid #f3f4f6; }
.dev-tile { height: 32px; width: 32px; border-radius: 8px; display: grid; place-items: center; font-size: 16px; flex: 0 0 auto; }
.t-amber { background: #fffbeb; box-shadow: inset 0 0 0 1px #fde68a; } .t-sky { background: #f0f9ff; box-shadow: inset 0 0 0 1px #bae6fd; } .t-orange { background: #fff7ed; box-shadow: inset 0 0 0 1px #fed7aa; }
.t-slate { background: #f8fafc; box-shadow: inset 0 0 0 1px #e2e8f0; } .t-emerald { background: #ecfdf5; box-shadow: inset 0 0 0 1px #a7f3d0; } .t-cyan { background: #ecfeff; box-shadow: inset 0 0 0 1px #a5f3fc; }
.t-violet { background: #f5f3ff; box-shadow: inset 0 0 0 1px #ddd6fe; } .t-gray { background: #f9fafb; }
.dev-name { margin: 0; font-size: 14px; font-weight: 600; text-transform: capitalize; line-height: 1.2; } .it { font-style: italic; }
.subsel { position: relative; margin-left: auto; } .subsel-btn { display: inline-flex; gap: 4px; align-items: center; font-size: 11px; background: #e5e7eb; color: #374151; padding: 2px 8px; border-radius: 4px; border: 0; cursor: pointer; }
.subsel-menu { position: absolute; right: 0; top: 100%; margin-top: 4px; background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 4px; z-index: 20; box-shadow: 0 8px 20px rgba(0,0,0,.12); white-space: nowrap; }
.subsel-menu div { font-size: 12px; padding: 4px 8px; border-radius: 4px; cursor: pointer; } .subsel-menu div:hover { background: #f3f4f6; } .subsel-menu div.on { background: var(--blue-soft); }
.dev-body { padding: 12px; flex: 1; } .err-box { margin-bottom: 12px; border-radius: 8px; background: #fef2f2; color: #b91c1c; padding: 6px 8px; font-size: 11px; box-shadow: inset 0 0 0 1px #fecaca; }
.controls { margin-bottom: 4px; } .cbtn { background: #0f172a; color: #fff; border: 0; border-radius: 6px; padding: 6px 10px; font: 500 12px system-ui; cursor: pointer; }
.cbtn:hover { background: #1e293b; } .cbtn:active { background: var(--blue); }
.panel { margin-top: 12px; border-radius: 8px; background: #f9fafb; padding: 8px; box-shadow: inset 0 0 0 1px rgba(229,231,235,.7); }
.panel h4 { margin: 0 0 4px; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: #6b7280; }
.panel2 { margin-bottom: 14px; border-radius: 10px; background: #fff; padding: 12px 14px; box-shadow: 0 0 0 1px #e5e7eb; }
.panel2 h4 { margin: 0 0 8px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: #6b7280; }
.props { margin: 0; } .prop { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-top: 1px solid rgba(229,231,235,.7); } .prop:first-child { border-top: 0; }
.prop dt { font-size: 11px; color: #6b7280; } .prop dt.err { color: #dc2626; font-weight: 500; } .prop dd { margin: 0; text-align: right; }
.pv { font: 600 11px ui-monospace, Menlo, monospace; color: #111827; } .onoff { border-radius: 999px; padding: 1px 6px; font-size: 10px; font-weight: 600; text-transform: uppercase; background: #f3f4f6; color: #6b7280; }
.onoff.on { background: #dcfce7; color: #15803d; } .chips { display: inline-flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.chip { border-radius: 4px; background: #f3f4f6; padding: 1px 6px; font: 11px ui-monospace, Menlo, monospace; color: #374151; } .chip.red { background: #fee2e2; color: #b91c1c; font-family: system-ui; font-weight: 500; }
.sched-list { list-style: none; margin: 0; padding: 0; background: #fff; border-radius: 8px; box-shadow: 0 0 0 1px var(--border); }
.sched-list li { display: flex; justify-content: space-between; align-items: center; padding: 12px; border-top: 1px solid var(--border); cursor: pointer; } .sched-list li:first-child { border-top: 0; }
.sched-list li:hover { background: #f9fafb; } .sched-list li.sel { background: var(--blue-soft); box-shadow: inset 4px 0 0 var(--blue); }
.modal-bg { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.5); display: grid; place-items: center; padding: 16px; }
.modal { background: #fff; border-radius: 10px; padding: 20px; width: 100%; max-width: 460px; box-shadow: 0 10px 30px rgba(0,0,0,.25); } .modal.wide { max-width: 900px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; } .modal-head h2 { font-size: 17px; }
.pre { background: #f9fafb; border: 1px solid var(--border); border-radius: 6px; padding: 10px; font-size: 11px; max-height: 360px; overflow: auto; margin: 6px 0 0; } .sm-pre { max-height: 128px; }
.pick { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; background: #fff; cursor: pointer; font: inherit; text-align: left; }
.pick:hover { border-color: var(--blue); background: var(--blue-soft); } .pick span { font-size: 12px; color: var(--muted-fg); }
.chipbtn { padding: 6px 14px; border-radius: 6px; font: 500 13px system-ui; background: #f3f4f6; color: #374151; border: 0; cursor: pointer; } .chipbtn.sm { padding: 2px 8px; font-size: 11px; }
.chipbtn.on-blue { background: #3b82f6; color: #fff; } .chipbtn.on-red { background: #ef4444; color: #fff; } .chipbtn.on-green { background: #22c55e; color: #fff; }
.chipbtn.on-yellow { background: #eab308; color: #fff; } .chipbtn.on-dark { background: #374151; color: #fff; }
.chipbtn.lv-INFO { background: #dbeafe; color: #1e40af; } .chipbtn.lv-WARNING { background: #fef9c3; color: #854d0e; } .chipbtn.lv-ERROR { background: #fee2e2; color: #991b1b; } .chipbtn.lv-DEBUG { background: #e5e7eb; color: #111827; }
.info-pop { position: relative; } .info-pop summary { list-style: none; } .info-pop summary::-webkit-details-marker { display: none; }
.info-pop pre { position: absolute; right: 0; top: 36px; z-index: 30; width: 320px; background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 10px; font-size: 11px; box-shadow: 0 8px 20px rgba(0,0,0,.12); }
.tl-head, .tl-row { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; } .tl-head { border-bottom: 1px solid var(--border); background: #f9fafb; font-size: 12px; font-weight: 600; color: #374151; }
.tl-head div { padding: 8px 12px; border-right: 1px solid var(--border); } .tl-body { position: relative; }
.tl-row { height: 60px; border-bottom: 1px solid #f1f5f9; } .tl-row > div { border-right: 1px solid #f1f5f9; } .tl-time { padding: 4px 12px; font: 12px ui-monospace, Menlo, monospace; color: #6b7280; }
.tl-c1 { background: #f0fdfa; } .tl-c2 { background: #fef2f2; } .tl-c3 { background: #fefce8; }
.tl-ev { position: absolute; z-index: 10; border-radius: 4px; padding: 4px 8px; font-size: 11px; font-weight: 500; color: #fff; overflow: hidden; min-height: 20px; }
.tl-ev.editable { cursor: pointer; } .tl-ev.editable:hover { opacity: .85; } .tl-ev.active { box-shadow: 0 0 0 2px rgba(74,222,128,.7); }
.tl-f1 { background: #14b8a6; } .tl-f2 { background: #0d9488; } .tl-f3 { background: #115e59; } .tl-heat { background: #dc2626; } .tl-lamp { background: #eab308; color: #000; } .tl-off { background: #9ca3af; }
.tl-x { position: absolute; top: 2px; right: 2px; height: 18px; width: 18px; border-radius: 50%; border: 0; background: rgba(0,0,0,.25); color: #fff; cursor: pointer; line-height: 1; }
.tl-now { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid #ef4444; z-index: 12; pointer-events: none; }
.tl-now span { position: absolute; left: 4px; top: -10px; background: #ef4444; color: #fff; font-size: 10px; padding: 1px 4px; border-radius: 3px; }
/* Lights page of Link devices (pool/link_lights.html), after the app's Lights screen */
.li-page { max-width: 520px; margin: 0 auto; }
.li-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; } .li-head h1 { font-size: 22px; }
.li-card { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; margin-bottom: 14px; }
.li-row { display: flex; align-items: center; gap: 12px; }
.li-card.li-row { padding: 14px 18px; flex-wrap: wrap; row-gap: 10px; }
.li-title { font-size: 18px; font-weight: 500; flex: 1; }
/* pool layout: the Schedule tab of the device panel */
.sch-row { display: flex; gap: 12px; align-items: baseline; padding: 6px 0; border-top: 1px solid rgba(229,231,235,.7); font-size: 12.5px; } .sch-row:first-of-type { border-top: 0; }
.sch-row b { flex: 0 0 auto; font-size: 12px; } .sch-row small { display: block; color: #94a3b8; font-size: 11px; } .sch-row.off { opacity: .5; }
.sch-item { display: flex; gap: 8px; align-items: center; padding: 5px 6px; border-radius: 6px; font-size: 12.5px; } .sch-item.sel { background: #eff6ff; }
.sch-item .switch { flex: 0 0 auto; } .sch-name { flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: 2px 0; font: inherit; color: inherit; cursor: pointer; }
.sch-name small { margin-left: 6px; color: #94a3b8; font-size: 11px; } .sch-item.sel .sch-name { font-weight: 600; }
.sch-acts { display: flex; flex: 0 0 auto; } .sch-acts .btn { height: 24px; width: 24px; padding: 0; } .sch-row .sch-acts { align-self: center; }
.sch-in { flex: 1; min-width: 0; height: 28px; font-size: 12.5px; } .sch-time { flex: 1; min-width: 0; height: 28px; font-size: 12px; padding: 0 4px; }
.sch-form { display: grid; gap: 8px; margin-top: 10px; padding: 10px; border-radius: 6px; background: #f8fafc; }
.sch-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .sch-grid label { display: grid; gap: 3px; font-size: 11px; color: #64748b; }
.sch-grid select, .sch-grid input { height: 28px; width: 100%; font-size: 12.5px; }
/* pool layout: a trend opened large (history window) */
.tw-back { position: fixed; inset: 0; z-index: 60; background: rgba(15,23,42,.45); display: grid; place-items: center; padding: 24px; }
.tw-win { width: min(1100px, 100%); max-height: 100%; overflow: auto; background: #fff; border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,.3); padding: 18px 22px 16px; }
.tw-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; } .tw-head h2 { margin: 0; font-size: 19px; }
.tw-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 12px 0 6px; } .tw-range { margin: 0 0 4px; font-size: 13px; }
.tw-svg { display: block; width: 100%; height: auto; cursor: crosshair; } .tw-grid { stroke: #eef2f6; } .tw-grid.v { stroke: #f4f6f9; } .tw-ax { font-size: 12px; fill: #64748b; }
.tw-line { fill: none; stroke: #2563eb; stroke-width: 2; stroke-linejoin: round; } .tw-area { fill: #2563eb; opacity: .08; } .tw-dot { fill: #2563eb; stroke: #fff; stroke-width: 2; } .tw-cross { stroke: #94a3b8; stroke-dasharray: 4 3; }
.tw-stats { display: flex; gap: 26px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 10px; margin-top: 4px; } .tw-stats span { display: block; font-size: 11px; color: #64748b; } .tw-stats b { font-size: 15px; }
/* owner's Energy page: line graphs of power */
.pw-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); } .pw-card { padding: 14px 16px 8px; }
.pw-svg { display: block; width: 100%; height: auto; } .pw-gridline { stroke: #eef2f6; } .pw-ax { font-size: 10px; fill: #94a3b8; }
.pw-line { fill: none; stroke: #2563eb; stroke-width: 2; stroke-linejoin: round; } .pw-area { fill: #2563eb; opacity: .08; }
.pw-dot { fill: #2563eb; stroke: #fff; stroke-width: 1.5; } .pw-heat .pw-dot { fill: #ef4444; } .pw-lights .pw-dot { fill: #f59e0b; } .pw-total .pw-dot { fill: #0f2540; }
.pw-heat .pw-line { stroke: #ef4444; } .pw-heat .pw-area { fill: #ef4444; } .pw-lights .pw-line { stroke: #f59e0b; } .pw-lights .pw-area { fill: #f59e0b; }
.pw-total .pw-line { stroke: #0f2540; } .pw-total .pw-area { fill: #0f2540; }
/* owner's dashboard of a pool: a tile per device (pool/customer_dashboard.html). Compact, so the tiles, the
   schedule and the weather fit on one screen. */
.pool-page.cdash { max-width: 1160px; padding: 12px 20px; } .cdash-bar { display: flex; align-items: center; gap: 12px; margin: 0 0 8px; } .cdash-bar .btn { height: 30px; }
.cdash-link { color: #2f9bd6; font-weight: 600; font-size: 12px; text-decoration: none; display: block; }
.cdash-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }
.cdash-tile { position: relative; min-width: 0; display: flex; flex-direction: column; background: #fff; border: 1.5px solid #e3e6ea; border-radius: 14px; padding: 10px 12px 8px; cursor: pointer; text-align: left; transition: box-shadow .15s, border-color .15s; }
.cdash-tile:hover, .cdash-tile:focus-visible { border-color: #9fd0f0; box-shadow: 0 4px 14px rgba(15,37,64,.08); outline: none; }
.cdash-tile.editing { cursor: default; border-style: dashed; } .cdash-tile.offline { opacity: .65; }
.cdash-x { position: absolute; top: -8px; right: -8px; height: 22px; width: 22px; border-radius: 50%; border: 0; background: #ef4444; color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.cdash-head { display: flex; align-items: center; gap: 9px; } .cdash-head h3 { margin: 0; font-size: 13.5px; line-height: 1.15; font-weight: 700; color: #0f2540; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cdash-head { min-height: 36px; }
.cdash-head p { margin: 0; font-size: 11px; color: #a3a9b1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cdash-ico { height: 34px; width: 34px; border-radius: 50%; background: #a9d8f5; display: grid; place-items: center; flex: 0 0 auto; color: #2b7fb5; }
.cdash-ico svg { height: 19px; width: 19px; fill: none; stroke: #2b7fb5; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; } .cdash-ico.grey { background: #eceef0; color: #5b6470; }
.cdash-vals { display: flex; gap: 10px; align-items: flex-end; min-height: 34px; margin: 8px 0; } .cdash-vals > div { min-width: 0; flex: 1; }
.cdash-vals span { display: block; font-size: 10.5px; line-height: 1.2; color: #475569; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .cdash-vals b { display: block; font-size: 14px; font-weight: 700; color: #0f2540; white-space: nowrap; }
.cdash-vals > .cdash-cover { flex: 0 0 34%; } .cdash-cover { height: 28px; border: 2px solid #0b0b0b; border-radius: 6px; background: #a9d8f5; overflow: hidden; } .cdash-cover i { display: block; height: 100%; background: repeating-linear-gradient(90deg, #1e3a8a 0 5px, #3b5fc0 5px 7px); }
/* the tiles of a row are equally high and the foot sits at the bottom, so the dashed lines are level */
.cdash-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; border-top: 1.5px dashed #dde1e6; padding-top: 6px; min-height: 32px; }
.cdash-foot b { font-size: 14px; font-weight: 700; color: #0f2540; text-transform: capitalize; }
.cdash-foot .li-switch { width: 44px; height: 24px; } .cdash-foot .li-switch span { height: 18px; width: 18px; } .cdash-foot .li-switch.on span { left: 23px; }
.cdash-menu { position: absolute; right: 0; top: 34px; z-index: 20; min-width: 220px; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 4px; }
.cdash-menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 6px; cursor: pointer; font: inherit; } .cdash-menu button:hover { background: var(--muted); }
.cdash-menu small { display: block; color: #94a3b8; font-size: 11px; }
.cdash-more { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); margin-top: 10px; }
.cdash-more > a, .cdash-sched { display: flex; align-items: center; gap: 10px; min-width: 0; background: #fff; border: 1.5px solid #e3e6ea; border-radius: 14px; padding: 8px 12px; text-decoration: none; color: #0f2540; }
.cdash-more > a:hover { border-color: #9fd0f0; } .cdash-more > a > span:nth-child(2) { flex: 1; min-width: 0; } .cdash-more b { display: block; font-size: 14px; } .cdash-more small { display: block; color: #a3a9b1; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cdash-sched select { max-width: 45%; height: 32px; border-radius: 9px; padding: 0 8px; font-weight: 700; font-size: 13px; color: #0f2540; }
.cdash-back { display: inline-flex; align-items: center; gap: 6px; margin: 16px 20px 0; color: #0f2540; font-weight: 600; text-decoration: none; }
.li-switch { position: relative; width: 58px; height: 32px; border-radius: 999px; background: #d1d5db; border: 0; cursor: pointer; padding: 0; flex: 0 0 auto; transition: background .15s; }
.li-switch span { position: absolute; top: 3px; left: 3px; height: 26px; width: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: left .15s; }
.li-switch.on { background: var(--blue); } .li-switch.on span { left: 29px; } .li-switch:disabled { opacity: .6; cursor: default; }
.li-slider-wrap { display: flex; align-items: center; gap: 12px; padding: 8px 6px 18px; }
.li-val { font-size: 12px; color: var(--muted-fg); width: 42px; text-align: right; font-variant-numeric: tabular-nums; }
.li-range { -webkit-appearance: none; appearance: none; flex: 1; height: 26px; border-radius: 999px; outline: none; cursor: pointer; margin: 0; }
.li-range.li-cct { background: linear-gradient(90deg, #f7e04a, #c8dd7c 45%, #8ed1e2); }
.li-range.li-dim { background: linear-gradient(90deg, #111, #888 55%, #f4f4f4); border: 1px solid #d4d4d4; }
.li-range::-webkit-slider-thumb { -webkit-appearance: none; height: 34px; width: 34px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3); border: 0; }
.li-range::-moz-range-thumb { height: 34px; width: 34px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3); border: 0; }
.li-range:disabled { opacity: .6; cursor: default; }
.li-range:focus-visible { box-shadow: 0 0 0 3px var(--blue-soft); }
.li-wheel-wrap { display: flex; justify-content: center; padding: 6px 0 18px; }
.li-wheel-box { position: relative; width: min(320px, 78vw); aspect-ratio: 1; touch-action: none; cursor: pointer; }
.li-wheel-box.ro { cursor: default; }
/* ring: 88% of the box across; the knob runs on its middle (44% from the centre) */
.li-wheel { position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
  -webkit-mask: radial-gradient(closest-side, transparent 80%, #000 81%, #000 95%, transparent 96%); mask: radial-gradient(closest-side, transparent 80%, #000 81%, #000 95%, transparent 96%); }
.li-knob { position: absolute; width: 13%; aspect-ratio: 1; border-radius: 50%; transform: translate(-50%, -50%); border: 3px solid #fff; box-shadow: 0 1px 5px rgba(0,0,0,.35); pointer-events: none; opacity: .55; }
.li-knob.active { opacity: 1; }
.li-center { position: absolute; inset: 30%; display: grid; place-items: center; text-align: center; pointer-events: none; }
.li-badge { background: var(--navy); color: #fff; font-weight: 700; font-size: 18px; border-radius: 8px; padding: 6px 16px; min-width: 64px; text-align: center; }
.li-scene { font-size: 20px; }
.li-scenes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.li-seg { display: inline-flex; background: #e5e7eb; border-radius: 999px; padding: 3px; }
.li-seg button { border: 0; background: none; padding: 6px 18px; border-radius: 999px; font: 500 15px system-ui, sans-serif; color: #9ca3af; cursor: pointer; }
.li-seg button.on { background: var(--navy); color: #fff; } .li-seg button:disabled { cursor: default; }
.li-for { color: #9ca3af; font-size: 16px; }
.li-select { height: 36px; border-radius: 8px; border: 0; background: #f3f4f6; padding: 0 10px; font-size: 14px; min-width: 0; max-width: 100%; }
.li-slots { display: grid; gap: 8px; margin-top: 12px; }
.li-slot { display: grid; grid-template-columns: auto auto 1fr auto 1fr; align-items: center; gap: 8px; }
.li-slot input[type=time] { height: 32px; min-width: 0; width: 100%; }
@media (max-width: 560px) {
  .li-slot { grid-template-columns: 1fr 1fr; row-gap: 4px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
  .li-slot label { grid-column: 1 / -1; } .li-slot .xs { display: none; }
  .li-scene { font-size: 17px; }
}
/* HICO dashboard (pool/hico_dashboard.html), after the app's Dashboard screen */
.hd-modes { display: flex; border: 1.5px solid #9fd3ea; border-radius: 12px; padding: 5px; gap: 4px; margin-bottom: 14px; background: var(--bg); }
.hd-modes button { flex: 1; min-width: 0; border: 0; background: none; padding: 10px 6px; border-radius: 9px; font: 500 16px system-ui, sans-serif; color: #111827;
  cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hd-modes button.on { background: var(--navy); color: #fff; } .hd-modes button:disabled { cursor: default; }
@media (max-width: 560px) { .hd-modes { padding: 4px; gap: 2px; } .hd-modes button { font-size: 13px; padding: 9px 2px; } }
.hd-errors { padding: 12px 18px; } .hd-errors ul { margin: 6px 0 0; padding-left: 26px; font-size: 14px; } .hd-errors li + li { margin-top: 2px; }
.hd-err-title { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 600; }
.hd-errors.bad { border-color: #f3c4c4; background: #fdf3f3; color: #b42323; } .hd-errors.good { color: #0c7a0c; }
.hd-value { text-align: center; } .hd-value span { display: block; font-size: 17px; }
.hd-value b { display: block; font-size: 34px; color: var(--navy); font-variant-numeric: tabular-nums; }
.hd-dial-card { display: flex; flex-direction: column; align-items: center; }
.hd-dial { width: min(300px, 75vw); touch-action: none; cursor: pointer; outline: none; }
.hd-dial.ro { cursor: default; } .hd-dial:focus-visible .hd-track { stroke: var(--blue-soft); }
.hd-track { fill: none; stroke: #eeeeee; stroke-width: 14; stroke-linecap: round; }
.hd-fill { fill: none; stroke: #e05440; stroke-width: 14; stroke-linecap: round; }
.hd-knob { fill: #f1f1f1; stroke: #fff; stroke-width: 2; filter: drop-shadow(0 1px 2px rgba(0,0,0,.25)); }
.hd-label { font: 15px system-ui, sans-serif; fill: #111827; text-anchor: middle; }
.hd-big { font: 700 21px system-ui, sans-serif; fill: var(--navy); text-anchor: middle; }
.hd-steps { gap: 14px; margin-top: -8px; } .hd-steps .btn { height: 30px; width: 36px; padding: 0; justify-content: center; }
/* weather at the pool (partials/weather.html) */
.wx { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); padding: 14px 16px; }
.wx.mb { margin-bottom: 16px; }
.wx.float { position: absolute; top: 14px; right: 14px; width: 330px; max-width: calc(100% - 28px); box-shadow: 0 1px 4px rgba(0,0,0,.15); z-index: 2; }
.wx.float.closed { width: auto; padding: 8px 12px; }
.wx-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; } .wx.closed .wx-head { margin-bottom: 0; }
.wx-head h2 { font-size: 14px; margin: 0; } .wx-head h2 span { font-weight: 400; }
.wx-now { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.wx-ico { font-size: 38px; line-height: 1; } .wx-temp { display: block; font-size: 26px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.wx-facts { display: flex; gap: 18px; margin: 0 0 0 auto; } .wx-facts dt { font-size: 11px; color: var(--muted-fg); } .wx-facts dd { margin: 0; font-size: 13px; font-weight: 500; }
.wx-days { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.wx-day { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; } .wx-dico { font-size: 22px; line-height: 1.2; }
.wx.float .wx-facts { margin-left: 0; width: 100%; justify-content: space-between; }
/* energy page for owners / guests: graphs instead of tables */
.en-row { display: grid; grid-template-columns: 90px 1fr 80px 150px; align-items: center; gap: 12px; padding: 7px 0; font-size: 13px; }
.en-name { font-weight: 500; } .en-val { text-align: right; font-variant-numeric: tabular-nums; } .en-week { text-align: right; }
.en-track { height: 12px; background: var(--muted); border-radius: 4px; overflow: hidden; } .en-track i { display: block; height: 100%; background: var(--blue); border-radius: 0 4px 4px 0; transition: width .3s; }
@media (max-width: 640px) { .en-row { grid-template-columns: 80px 1fr 70px; } .en-week { grid-column: 2 / -1; text-align: left; } }
.en-chart { position: relative; } .en-chart svg { display: block; width: 100%; height: auto; }
.en-grid { stroke: #e5e7eb; stroke-width: 1; } .en-grid.base { stroke: #9ca3af; } .en-axis { font: 11px system-ui, sans-serif; fill: #6b7280; }
.en-line { fill: none; stroke: var(--blue); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; } .en-area { fill: var(--blue); opacity: .08; }
.en-cross { stroke: #9ca3af; stroke-width: 1; stroke-dasharray: 3 3; } .en-dot { fill: var(--blue); stroke: #fff; stroke-width: 2; }
.en-tip { position: absolute; transform: translate(-50%, calc(-100% - 8px)); background: #111827; color: #fff; border-radius: 6px; padding: 6px 10px; font-size: 12px;
  white-space: nowrap; pointer-events: none; display: flex; flex-direction: column; gap: 1px; z-index: 2; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.en-tip span { color: #d1d5db; font-size: 11px; }
.tabs-line { display: flex; gap: 24px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.tabs-line button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 2px; font: 500 13px system-ui; color: #6b7280; cursor: pointer; margin-bottom: -1px; }
.tabs-line button.on { border-color: var(--blue); color: var(--blue); }
.sensor { background: #fff; border-radius: 16px; padding: 20px; box-shadow: 0 0 0 1px var(--border); display: flex; gap: 16px; align-items: center; }
.sico { height: 64px; width: 64px; border-radius: 16px; background: #f3f4f6; display: grid; place-items: center; font-size: 26px; flex: 0 0 auto; }
.sval { font-size: 34px; font-weight: 700; color: #111827; } .sval.dim { color: #d1d5db; } .sunit { font-size: 16px; color: #9ca3af; font-weight: 400; }
.demander { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--border); background: #fff; border-radius: 8px; overflow: hidden; }
@media (max-width: 1100px) { .demander { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dcol { height: 50vh; border: 1px solid #f1f5f9; display: flex; flex-direction: column; } .dcol-head { text-align: center; font-weight: 700; padding: 6px; border-bottom: 1px solid #f1f5f9; }
.dcol-body { overflow-y: auto; flex: 1; } .task { position: relative; margin: 10px; padding: 12px; background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; }
.task-x { position: absolute; top: 6px; right: 6px; height: 24px; width: 24px; border-radius: 50%; border: 0; background: none; color: #ef4444; cursor: pointer; display: grid; place-items: center; } .task-x:hover { background: #fef2f2; }
.gwlog { background: #0b1220; color: #e2e8f0; border-radius: 8px; padding: 10px 12px; height: calc(100vh - 330px); min-height: 300px; overflow-y: auto; font: 12px/1.6 ui-monospace, Menlo, monospace; }
.gwline { word-break: break-word; } .gwline .muted { color: #64748b; } .gwline .lvl { font-weight: 700; margin: 0 6px; } .gwline .cat2 { color: #93c5fd; margin-right: 6px; }
.gwline.lv-ERROR .lvl { color: #f87171; } .gwline.lv-WARNING .lvl { color: #facc15; } .gwline.lv-INFO .lvl { color: #4ade80; } .gwline.lv-DEBUG .lvl { color: #94a3b8; }
.canmsg { border-radius: 4px; padding: 0 5px; background: #334155; color: #e2e8f0; } .cf-filtration { background: #155e75; } .cf-heater { background: #9a3412; } .cf-lamp { background: #6b21a8; } .cf-cover { background: #065f46; } .cf-errors { background: #991b1b; }
.zones { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); } .zones.one { grid-template-columns: 1fr; } @media (max-width: 1000px) { .zones { grid-template-columns: 1fr; } }
.zone-lines { background: #f9fafb; border-radius: 6px; padding: 8px; font: 12px ui-monospace, Menlo, monospace; max-height: 384px; overflow-y: auto; white-space: pre-wrap; margin-top: 6px; }
.relays { overflow: hidden; } .rgrid { display: grid; grid-template-columns: 60px 60px 90px 1.2fr 1.4fr 1.4fr 1.6fr; gap: 8px; align-items: center; padding: 10px 14px; position: relative; }
.rhead { background: #f9fafb; font-size: 12px; font-weight: 600; color: #6b7280; border-bottom: 1px solid var(--border); } .rrow { border-bottom: 1px solid #f1f5f9; }
.rgrid select { height: 30px; font-size: 12px; width: 100%; } .rstate { display: inline-block; height: 14px; width: 14px; border-radius: 50%; background: #d1d5db; } .rstate.on { background: #22c55e; }
.rlock { position: absolute; inset: 0; background: rgba(243,244,246,.9); display: flex; gap: 8px; align-items: center; justify-content: center; color: #4b5563; }
.mini { height: 26px; padding: 0 10px; border: 0; border-radius: 4px; font: 500 12px system-ui; cursor: pointer; background: #e5e7eb; color: #374151; }
.mini.blue { background: #3b82f6; color: #fff; } .mini.green { background: #22c55e; color: #fff; } .mini.red { background: #ef4444; color: #fff; } .mini:disabled { opacity: .5; }
.meter { height: 12px; border-radius: 999px; background: #e5e7eb; overflow: hidden; margin-bottom: 4px; } .meter div { height: 100%; background: #3b82f6; border-radius: 999px; } .meter div.hot { background: #ef4444; }
.btn.act-yellow { background: #eab308; } .btn.act-orange { background: #f97316; } .btn.act-red { background: #ef4444; } .btn.act-green { background: #22c55e; }
.kv { display: flex; flex-direction: column; gap: 8px; } .kv > div { display: flex; gap: 16px; align-items: center; background: #f9fafb; border-radius: 6px; padding: 10px 12px; font-size: 13px; }
.kv > div > span:first-child { font-weight: 500; color: #374151; min-width: 180px; } .kv input, .kv select { height: 32px; flex: 1; }
.keypad { background: #111827; color: #fff; border-radius: 10px; max-width: 420px; margin: 0 auto; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,.2); }
.krow { display: flex; align-items: center; padding: 12px; border-bottom: 1px solid #1f2937; } .kled { height: 12px; width: 12px; border-radius: 50%; background: #4b5563; margin-right: 12px; }
.kled.on { background: #22c55e; box-shadow: 0 0 8px #22c55e; } .kname { border-left: 1px solid #374151; padding-left: 12px; }
.rawbox { max-height: calc(100vh - 250px); overflow-y: auto; } .rawrow { border-bottom: 1px solid rgba(226,232,240,.6); }
.rawsum { width: 100%; display: grid; grid-template-columns: 180px 64px minmax(0, 1fr); gap: 12px; align-items: center; padding: 6px 14px; background: none; border: 0; font: inherit; text-align: left; cursor: pointer; color: inherit; }
.rawsum:hover { background: rgba(241,245,249,.6); } .rt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dir { display: inline-flex; font: 600 10px ui-monospace, Menlo, monospace; padding: 1px 6px; border-radius: 4px; } .dir.in { background: #e0f2fe; color: #0369a1; } .dir.out { background: #fef3c7; color: #b45309; }
.rawpre { margin: 0; padding: 8px 14px; background: rgba(241,245,249,.5); font-size: 11px; white-space: pre-wrap; word-break: break-all; border-top: 1px solid rgba(226,232,240,.6); }
.sect { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: #6b7280; margin-bottom: 6px; }
input.dirty { border-color: #fbbf24; }
.note-amber { margin: 10px 0 0; border-radius: 6px; background: #fffbeb; color: #92400e; padding: 6px 8px; font-size: 11px; box-shadow: inset 0 0 0 1px #fde68a; }

/* ---- P&ID diagram ---- */
.pid { height: 100vh; display: flex; flex-direction: column; background: #f3f5f8; }
.pid-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 18px; background: #fff; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.pid-chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #334155; margin-left: 10px; cursor: pointer; }
.pid-chk input { accent-color: #3b82f6; height: 15px; width: 15px; }
.pid-body { flex: 1; display: flex; min-height: 0; }
.pid-palette { width: 200px; flex: 0 0 auto; background: #fff; border-right: 1px solid var(--border); padding: 12px; overflow-y: auto; }
.pal-group { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: #94a3b8; margin: 10px 2px 4px; }
.pal-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border: 1px solid transparent; border-radius: 6px; background: none; font: 13px system-ui; cursor: pointer; color: var(--fg); text-align: left; }
.pal-item:hover { background: #f1f5f9; border-color: var(--border); }
.pal-ico { height: 20px; width: 20px; border-radius: 5px; background: #e2e8f0; flex: 0 0 auto; }
.pi-pool { background: linear-gradient(#e5e7eb 30%, #3b9be8 30%); } .pi-coverpanel { background: linear-gradient(#e2e8f0 45%, #475569 45%, #475569 55%, #e2e8f0 55%); } .pi-fillsensor { border-radius: 10px; background: linear-gradient(#e5e7eb 55%, #3b9be8 55%); } .pi-tap { background: linear-gradient(90deg, #94a3b8 55%, #3b9be8 55%); } .pi-jacuzzi { border-radius: 50%; background: linear-gradient(#e5e7eb 30%, #3b9be8 30%); } .pi-pump { border-radius: 50%; background: radial-gradient(#475569 40%, #cbd5e1 42%); }
.pi-heater { background: #fee2e2; box-shadow: inset 0 -5px 0 #ef4444; } .pi-filter { border-radius: 10px; background: linear-gradient(#e5e7eb 55%, #e7c98a 55%); }
.pi-valve { background: none; border: 2px solid #64748b; clip-path: polygon(0 0, 50% 50%, 100% 0, 100% 100%, 50% 50%, 0 100%); }
.pi-backwash { border-radius: 50%; background: #fff; border: 3px solid #0ea5e9; border-left-color: transparent; }
.pi-chlorinator { background: linear-gradient(90deg, #d1fae5 50%, #fef9c3 50%); border: 1.5px solid #10b981; }
.pi-cover { background: repeating-linear-gradient(90deg, #1e3a8a 0 3px, #3b5fc0 3px 4px); }
.pi-valve3 { background: #64748b; clip-path: polygon(0 20%, 50% 50%, 100% 20%, 100% 80%, 62% 55%, 80% 100%, 20% 100%, 38% 55%, 0 80%); }
.pi-valve5 { border-radius: 50%; background: radial-gradient(#fff 30%, #64748b 32% 45%, transparent 47%), conic-gradient(#64748b 0 8%, transparent 0 20%, #64748b 0 28%, transparent 0 40%, #64748b 0 48%, transparent 0 60%, #64748b 0 68%, transparent 0 80%, #64748b 0 88%, transparent 0); }
.pi-waste { background: #f5f0e8; border: 1.5px solid #92400e; }
.pi-outlet { background: #eff6ff; border: 1.5px solid #3b82f6; } .pi-lamp { border-radius: 50%; background: #fde047; box-shadow: 0 0 6px #fde047; }
.pi-link-mini, .pi-link-one, .pi-link-three { background: #001E30; } .pi-dlm-450, .pi-dlm-600, .pi-link-five { background: #001E30; border-left: 3px solid #94a3b8; border-right: 3px solid #94a3b8; } .pi-gauge { background: #fff; border: 1.5px solid #94a3b8; }
.pi-meter { background: #fff; border: 1.5px solid #f59e0b; box-shadow: inset 0 -6px 0 #fde68a; }
.pi-chart { background: linear-gradient(135deg, #dbeafe 50%, #93c5fd 50%); } .pi-status { background: linear-gradient(#34d399 33%, #60a5fa 33% 66%, #facc15 66%); }
.pid-canvas { flex: 1; position: relative; min-width: 0; }
.pid-svg { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; user-select: none; }
.pid-svg:active { cursor: grabbing; } .pid-svg.connecting { cursor: crosshair; }
.pid-empty { position: absolute; top: 40%; left: 0; right: 0; text-align: center; color: var(--muted-fg); pointer-events: none; }
.pid-zoom { position: absolute; left: 14px; bottom: 14px; display: flex; flex-direction: column; background: #fff; border-radius: 6px; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.pid-zoom button { height: 30px; width: 30px; border: 0; border-bottom: 1px solid #f1f5f9; background: none; cursor: pointer; display: grid; place-items: center; color: #334155; }
.pid-zoom button:last-child { border-bottom: 0; } .pid-zoom button:hover { background: #f8fafc; }
.pid-scale { position: absolute; right: 14px; bottom: 14px; display: flex; gap: 2px; background: #fff; border-radius: 6px; padding: 4px; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.pid-scale button { border: 0; background: none; padding: 6px 12px; font: 13px system-ui; cursor: pointer; border-radius: 4px; color: #334155; } .pid-scale button.on { background: var(--blue-soft); color: var(--blue-ink); }
.pid-props { width: 260px; flex: 0 0 auto; background: #fff; border-left: 1px solid var(--border); padding: 16px; overflow-y: auto; }
.pid-props .lbl { margin-top: 12px; } .pin { width: 100%; height: 34px; }
kbd { font: 11px ui-monospace, monospace; background: #f1f5f9; border: 1px solid var(--border); border-radius: 3px; padding: 0 4px; }
/* svg parts */
.pid-svg text { font-family: system-ui, sans-serif; }
.edge .hit { stroke: transparent; stroke-width: 18; fill: none; }
.edge .pipe { stroke: #60a5fa; stroke-width: 10; fill: none; stroke-linejoin: round; stroke-linecap: round; opacity: .55; }
.edge .water { stroke: #2563eb; stroke-width: 10; fill: none; stroke-linejoin: round; stroke-dasharray: 14 10; opacity: .35; }
.edge .water.flow { opacity: 1; stroke: #1d6fe0; animation: pidflow .9s linear infinite; }
.edge .water.flow.rev { animation-direction: reverse; }
.edge .sig { stroke: #c4b5fd; stroke-width: 2; fill: none; stroke-dasharray: 6 5; }
.edge .sig.live { stroke: #8b5cf6; animation: pidflow 1.2s linear infinite; }
.edge .wire { stroke: #475569; stroke-width: 2.5; fill: none; stroke-linejoin: round; } .edge .wire.live { stroke: #f59e0b; }
.edge.sel .pipe, .edge.sel .sig, .edge.sel .wire { stroke: #f59e0b; opacity: 1; }
@keyframes pidflow { to { stroke-dashoffset: -24; } }
path.ghost { stroke: #3b82f6; stroke-width: 2; stroke-dasharray: 5 4; fill: none; pointer-events: none; }
.node { cursor: pointer; } .editing .node { cursor: move; }
circle.via { fill: #f59e0b; stroke: #fff; stroke-width: 1.5; pointer-events: none; } .editing .edge { cursor: grab; }
.selbox { fill: none; stroke: #3b82f6; stroke-width: 1.5; stroke-dasharray: 5 4; }
.port { fill: #2f80ed; stroke: #fff; stroke-width: 1.5; } .port.sigp { fill: #8b5cf6; } .port.elp { fill: #475569; }
.port.edit { cursor: crosshair; } .port.edit:hover, .port.active { r: 8; fill: #f59e0b; }
.nlabel { font-size: 13px; font-weight: 500; fill: #1f2937; text-anchor: middle; } .nlabel.sm { font-size: 11px; fill: #64748b; }
.offline { font-size: 10px; fill: #dc2626; text-anchor: middle; }
.tank { fill: #e5e7eb; stroke: #94a3b8; stroke-width: 2; }
.key { fill: #cbd5e1; stroke: #64748b; stroke-width: 1.2; } .key.on { fill: #22e58f; stroke: #15803d; }
.sens-cable { stroke: #64748b; stroke-width: 2; } .sens-float { fill: #f8fafc; stroke: #64748b; stroke-width: 1.5; } .sens-float.low { fill: #fde68a; stroke: #d97706; }
.sens-level { stroke: #3b9be8; stroke-width: 2; stroke-dasharray: 4 3; }
.tap-body { fill: #cbd5e1; stroke: #64748b; stroke-width: 1.5; } .tap-body.on { fill: #dbeafe; stroke: #2563eb; } .tap-handle { fill: #64748b; } .tap-handle.on { fill: #2563eb; } .tank-water { fill: #3b9be8; } .wave { fill: none; stroke: #bfdbfe; stroke-width: 2; }
.tick { stroke: #64748b; } .tickt { font-size: 9px; fill: #64748b; } .big { font-size: 22px; font-weight: 600; fill: #fff; text-anchor: middle; }
.pump-ring { fill: #e2e8f0; stroke: #94a3b8; stroke-width: 2; } .pump-in { fill: #64748b; } .pump-in.on { fill: #475569; }
.blade { fill: #94a3b8; opacity: .7; } .hub { fill: #1e293b; }
.spin { animation: pidspin 1.2s linear infinite; } @keyframes pidspin { to { transform: rotate(360deg); } }
.chk rect { fill: #fff; stroke: #94a3b8; stroke-width: 1.5; } .chk rect.on { fill: var(--blue); stroke: var(--blue-hover); } .chk path { stroke: #fff; stroke-width: 2; fill: none; }
.val { font-size: 11px; fill: #475569; text-anchor: middle; } .val.strong { font-size: 12px; font-weight: 600; fill: #111827; } .unit { font-size: 9px; fill: #64748b; text-anchor: middle; }
.box { fill: #fff; stroke: #cbd5e1; stroke-width: 1.5; filter: drop-shadow(0 1px 2px rgba(0,0,0,.08)); } .box.heat { stroke: #f87171; fill: #fff7f7; }
.box.ctrl { fill: #0b2536; stroke: #001E30; } .ctrl + .btitle, .box.ctrl ~ .btitle { fill: #fff; } .box.ctrl ~ .unit { fill: #94a3b8; }
.btitle { font-size: 12px; font-weight: 600; fill: #1f2937; text-anchor: middle; }
.sol { fill: #e2e8f0; stroke: #64748b; stroke-width: 1; } .sol.on { fill: #10b981; stroke: #047857; } .sol-stem { stroke: #94a3b8; stroke-width: 2; }
/* filter pump, heat pump, purification: blue = off / not operational, green = on, red = error */
.node .st-off { stroke: #3b82f6; stroke-width: 2.5; } .node .st-on { stroke: #10b981; stroke-width: 2.5; } .node .st-err { stroke: #ef4444; stroke-width: 3; }
.pstrip { fill: #e2e8f0; stroke: #94a3b8; stroke-width: 1; } .pstrip-led { stroke: #fff; stroke-width: 1; }
.pstrip-led.live { fill: #22e58f; stroke: #fff; stroke-width: 1; filter: drop-shadow(0 0 2px #22e58f); } .pstrip-t { font-size: 7.5px; fill: #475569; text-anchor: middle; }
.dlm-fn { font-size: 10px; font-weight: 500; fill: #e2e8f0; } .dlm-tm { font-size: 8.5px; fill: #94a3b8; } .dlm-rule { stroke: #1e3a4c; stroke-width: 1; }
.coil { fill: none; stroke: #cbd5e1; stroke-width: 3; } .coil.on { stroke: #ef4444; }
.box.wash { stroke: #0ea5e9; fill: #f0f9ff; } .box.chlor { stroke: #10b981; fill: #f3fdf8; }
.wash-arrow { fill: none; stroke: #94a3b8; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; } .wash-arrow.on { stroke: #0ea5e9; }
.cover-water { fill: #93c5fd; } .cover-slats { fill: #1e3a8a; } .cover-slat { stroke: #3b5fc0; stroke-width: 1; } .cover-roller { fill: #64748b; } .cover-roller.on { fill: var(--blue); }
.vessel { fill: #f1f5f9; stroke: #94a3b8; stroke-width: 2; } .sand { fill: #e7c98a; }
.vbody path { fill: #fff; stroke: #64748b; stroke-width: 2; } .vbody.open path { fill: #d1fae5; stroke: #059669; }
.zone.waste { stroke: #92400e; fill: #fdf8f1; } .ztext.waste { fill: #92400e; } .waste-ico { fill: none; stroke: #92400e; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.vtri { fill: #fff; stroke: #64748b; stroke-width: 2; stroke-linejoin: round; } .vtri.open { fill: #d1fae5; stroke: #059669; }
.vhub { fill: #fff; stroke: #64748b; stroke-width: 2; } .vhub.open { fill: #d1fae5; stroke: #059669; } .vport { font-size: 10px; font-weight: 600; fill: #64748b; text-anchor: middle; }
.vbody line { stroke: #64748b; stroke-width: 2; } .vbody rect { fill: #94a3b8; }
.zone { fill: #fff; stroke: #3b82f6; stroke-width: 1.5; } .ztext { font-size: 13px; fill: #2563eb; text-anchor: middle; }
.lamp-ring { fill: #fff; stroke: #94a3b8; stroke-width: 2; } .glow { animation: pidglow 2s ease-in-out infinite; } @keyframes pidglow { 50% { opacity: .1; } }
.dot-on { fill: #10b981; } .dot-off { fill: #94a3b8; }
.panel.solar { stroke: #f59e0b; stroke-width: 1.6; } .sun circle { fill: #f59e0b; } .sun line { stroke: #f59e0b; stroke-width: 1.6; stroke-linecap: round; }
.dbtn { cursor: pointer; } .dbtn rect { fill: #f1f5f9; stroke: #cbd5e1; } .dbtn text { font-size: 10px; fill: #334155; text-anchor: middle; }
.dbtn.on rect { fill: var(--blue); stroke: var(--blue-hover); } .dbtn.on text { fill: #fff; } .dbtn:hover rect { stroke: var(--blue); }
.panel { fill: #fff; stroke: #d6dde6; stroke-width: 1.2; filter: drop-shadow(0 1px 3px rgba(0,0,0,.08)); }
.glabel { font-size: 10px; fill: #64748b; } .gval { font-size: 22px; font-weight: 300; fill: #111827; }
.gtrack { fill: #e5e7eb; } .gbar { fill: #3b82f6; }
.ptitle { font-size: 12px; font-weight: 600; fill: #1f2937; } .grid { stroke: #eef2f6; } .axis { font-size: 8px; fill: #94a3b8; text-anchor: end; }
.area { fill: #93c5fd; opacity: .35; } .line { fill: none; stroke: #3b82f6; stroke-width: 1.5; }
/* trends: a dashed red vertical line where the device got an error (thicker: the first time ever), dotted where its codes changed */
.errline { stroke: #dc2626; stroke-width: 1.5; stroke-dasharray: 6 4; } .errline.first { stroke-width: 3; } .errline.chg { stroke-dasharray: 2 3; }
.errhit { stroke: transparent; stroke-width: 10; pointer-events: stroke; } .errmark { cursor: help; }
.tw-errlbl { font-size: 11.5px; font-weight: 600; fill: #b42323; paint-order: stroke; stroke: #fff; stroke-width: 3px; }
.tw-errs { margin: 6px 0 2px; padding: 0; list-style: none; font-size: 12.5px; } .tw-errs li { display: flex; gap: 10px; padding: 3px 0; border-top: 1px dashed #eeede8; }
.tw-errs time { color: #b42323; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; } .tw-errs .src { color: #64748b; }
.rlabel { font-size: 11px; fill: #475569; } .rval { font-size: 11px; font-weight: 600; fill: #1f2937; text-anchor: end; }
.bar-g { fill: #34d399; } .bar-b { fill: #60a5fa; } .bar-v { fill: #a78bfa; } .bar-y { fill: #facc15; }

/* ---- installations map ---- */
.mapx { height: 100vh; display: flex; flex-direction: column; }
.map-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 18px; background: #fff; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.map-body { flex: 1; display: flex; min-height: 0; }
.map-canvas { flex: 1; min-width: 0; z-index: 0; } .map-canvas.picking { cursor: crosshair; }
.map-side { width: 360px; flex: 0 0 auto; border-left: 1px solid var(--border); background: #fff; overflow-y: auto; }
@media (max-width: 900px) { .map-body { flex-direction: column; } .map-side { width: auto; height: 45vh; border-left: 0; border-top: 1px solid var(--border); } }
.side-pad { padding: 14px 16px; }
.sdot { display: inline-block; height: 10px; width: 10px; border-radius: 50%; flex: 0 0 auto; }
.sdot.none { background: #64748b; } .sdot.offline { background: #94a3b8; } .sdot.ok { background: #16a34a; } .sdot.warning { background: #f59e0b; } .sdot.error { background: #dc2626; } .sdot.big { height: 14px; width: 14px; }
.badge.st-ok { background: #dcfce7; color: #166534; border-color: transparent; } .badge.st-warning { background: #fef3c7; color: #92400e; border-color: transparent; }
.badge.st-error { background: #fee2e2; color: #991b1b; border-color: transparent; } .badge.st-offline { background: #f1f5f9; color: #475569; border-color: transparent; }
.loc-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 16px; border: 0; border-bottom: 1px solid #f1f5f9; background: none; text-align: left; font: inherit; cursor: pointer; color: inherit; }
.loc-row:hover { background: #f8fafc; }
.dev-row { padding: 12px 16px; border-bottom: 1px solid #f1f5f9; }
.reason { font-size: 11px; margin-top: 3px; padding: 2px 6px; border-radius: 4px; display: inline-block; margin-right: 4px; }
.reason.error { background: #fee2e2; color: #991b1b; } .reason.warning { background: #fef3c7; color: #92400e; }
.mini-btn { height: 26px; padding: 0 8px; font-size: 11px; }
.pin { background: none; border: 0; position: relative; } .pin svg { filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); position: relative; z-index: 1; }
.pin-pulse { position: absolute; left: 50%; bottom: -4px; height: 14px; width: 28px; margin-left: -14px; border-radius: 50%; opacity: .5; animation: pinpulse 1.6s ease-out infinite; }
@keyframes pinpulse { 0% { transform: scale(.4); opacity: .6; } 100% { transform: scale(1.6); opacity: 0; } }
.pick-dot { height: 22px; width: 22px; border-radius: 50%; background: #2563eb; border: 3px solid #fff; box-shadow: 0 0 0 2px #2563eb, 0 2px 6px rgba(0,0,0,.4); margin: 4px; }
.switch:disabled { opacity: .5; cursor: not-allowed; }
.dpanel { width: 360px; } .dpanel .lbl { margin-top: 4px; }
.dtabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin: 12px 0 14px; }
.dtabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 7px 10px; font: 500 13px system-ui; color: #64748b; cursor: pointer; margin-bottom: -1px; }
.dtabs button.on { color: var(--blue-ink); border-color: var(--blue); }
.kvline { display: flex; justify-content: space-between; align-items: center; background: #f8fafc; border-radius: 6px; padding: 8px 10px; font-size: 13px; }
.dpanel .prop dt { font-size: 12px; } .dpanel .pv { font-size: 12px; }

/* installer branding in the sidebar */
.sidebar .brand.custom { height: auto; min-height: 56px; padding: 12px 16px; }
.sidebar .brand.custom img { height: 36px; width: auto; max-width: 64px; border-radius: 6px; background: rgba(255,255,255,.92); padding: 3px; }
.sidebar .brand-mono { height: 36px; width: 36px; border-radius: 8px; flex: 0 0 auto; display: grid; place-items: center; font-size: 13px; font-weight: 700;
                       background: var(--blue); color: #fff; letter-spacing: .5px; }
.sidebar .brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.sidebar .brand-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar .brand-text small { font-size: 10px; font-weight: 400; color: var(--sidebar-muted); letter-spacing: .3px; }
body.collapsed .sidebar .brand-text { display: none; }
body.collapsed .sidebar .brand.custom { justify-content: center; padding: 12px 0; }

/* ---------- installer branding page ---------- */
.mb-s { margin-bottom: 12px; }
.brand-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 24px; align-items: start; }
@media (max-width: 1000px) { .brand-grid { grid-template-columns: 1fr; } }
.brand-grid .stack .card + .card { margin-top: 16px; margin-bottom: 0; }
.field { display: flex; flex-direction: column; gap: 6px; } .field input[type=text] { width: 100%; }
.sm-btn { height: 30px; padding: 0 10px; font-size: 12px; }
.logo-drop { position: relative; height: 132px; border: 1.5px dashed var(--border); border-radius: 10px; display: grid; place-items: center;
             cursor: pointer; background: repeating-conic-gradient(#f8fafc 0 25%, #fff 0 50%) 0 0 / 16px 16px; transition: border-color .15s, background-color .15s; }
.logo-drop:hover, .logo-drop.drag { border-color: var(--blue); }
.logo-drop img { max-height: 104px; max-width: 80%; object-fit: contain; }
.logo-busy { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(255,255,255,.8); border-radius: 10px; font-size: 13px; }
.presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.preset { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 4px; border: 1px solid var(--border); border-radius: 8px;
          background: var(--bg); cursor: pointer; font: inherit; color: var(--fg); transition: border-color .15s, box-shadow .15s; }
.preset:hover { border-color: #cbd5e1; } .preset.on { border-color: var(--fg); box-shadow: 0 0 0 1px var(--fg); }
.preset .sw { display: flex; height: 26px; width: 100%; max-width: 72px; border-radius: 6px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.preset .sw i { flex: 1.4; } .preset .sw i + i { flex: 1; }
.color-in { display: flex; gap: 8px; align-items: center; }
.color-in input[type=color] { height: 36px; width: 44px; padding: 2px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); cursor: pointer; flex: 0 0 auto; }
.color-in input[type=text] { flex: 1; text-transform: lowercase; }
.preview-col { position: sticky; top: 24px; }
.bpv { display: flex; height: 360px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; box-shadow: 0 12px 32px -12px rgba(15,23,42,.25); background: #fff; }
.bpv-side { width: 38%; background: var(--pv-side); color: var(--pv-fg); display: flex; flex-direction: column; padding: 14px 10px; gap: 6px; transition: background .2s; }
.bpv-side small { display: block; font-size: 9px; color: var(--pv-muted); font-weight: 400; }
.bpv-brand { display: flex; gap: 8px; align-items: center; padding: 0 4px 12px; font-size: 13px; min-width: 0; }
.bpv-brand b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 110px; }
.bpv-brand img { height: 30px; max-width: 48px; object-fit: contain; border-radius: 5px; background: rgba(255,255,255,.92); padding: 2px; }
.bpv-mono { height: 30px; width: 30px; border-radius: 7px; display: grid; place-items: center; background: var(--pv-primary); color: #fff; font-size: 11px; font-weight: 700; flex: 0 0 auto; }
.bpv-nav { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 6px; font-size: 12px; color: var(--pv-muted); }
.bpv-nav.on { background: var(--pv-active); color: var(--pv-fg); } .bpv-nav .icon { height: 14px; width: 14px; }
.bpv-foot { margin-top: auto; display: flex; gap: 8px; align-items: center; font-size: 11px; padding: 8px 4px 0; border-top: 1px solid var(--pv-active); }
.bpv-av { height: 24px; width: 24px; border-radius: 50%; background: var(--pv-active); display: grid; place-items: center; font-size: 9px; font-weight: 600; }
.bpv-main { flex: 1; background: #f8fafc; padding: 14px; min-width: 0; }
.bpv-tabs { display: flex; gap: 4px; margin-bottom: 12px; font-size: 11px; flex-wrap: wrap; }
.bpv-tabs span { padding: 5px 9px; border-radius: 6px; color: #475569; } .bpv-tabs span.on { background: var(--pv-soft); color: var(--pv-ink); font-weight: 600; }
.bpv-card { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 14px; }
.bpv-pill { display: inline-flex; gap: 4px; align-items: center; font-size: 10px; padding: 2px 8px; border-radius: 99px; background: #e7f6e7; color: #0b0b0b; }
.bpv-pill .icon { height: 12px; width: 12px; color: #0ca30c; }
.bpv-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.bpv-kpis div { background: #f8fafc; border-radius: 8px; padding: 8px; } .bpv-kpis small { display: block; font-size: 10px; color: #64748b; } .bpv-kpis b { font-size: 14px; }
.bpv-bar { height: 6px; background: #e2e8f0; border-radius: 99px; margin-top: 14px; overflow: hidden; } .bpv-bar i { display: block; height: 100%; background: var(--pv-primary); border-radius: 99px; }
.bpv-btn { display: inline-flex; gap: 5px; align-items: center; font-size: 11px; padding: 6px 10px; border-radius: 6px; background: var(--pv-primary); color: #fff; font-weight: 500; }
.bpv-btn .icon { height: 12px; width: 12px; } .bpv-btn.ghost { background: #fff; color: var(--pv-ink); border: 1px solid var(--border); }

/* ---------- distro dashboard ---------- */
.dash .card + .card { margin-bottom: 0; }
.hero { position: relative; overflow: hidden; display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap;
        padding: 28px 28px 24px; border-radius: 14px; margin-bottom: 20px; color: #fff;
        background: radial-gradient(120% 140% at 100% 0%, rgba(42,120,214,.55) 0%, rgba(42,120,214,0) 55%),
                    radial-gradient(90% 120% at 0% 100%, rgba(27,175,122,.28) 0%, rgba(27,175,122,0) 60%), var(--navy); }
.hero::after { content: ""; position: absolute; right: -40px; bottom: -70px; width: 360px; height: 180px; opacity: .12; pointer-events: none;
               background: repeating-radial-gradient(ellipse at 50% 100%, transparent 0 14px, #fff 14px 16px); }
.hero h1 { font-size: 26px; font-weight: 700; letter-spacing: -.01em; margin: 2px 0 10px; }
.hero-date { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.65); }
.hero-sub { margin: 0; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 13px; color: rgba(255,255,255,.78); }
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; position: relative; z-index: 1; }
.qa { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 9px; font: 500 13px system-ui, sans-serif;
      background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.18); cursor: pointer; backdrop-filter: blur(4px); transition: background .15s; }
.qa:hover { background: rgba(255,255,255,.2); } .qa .icon { height: 16px; width: 16px; }
.live-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 500;
             background: rgba(255,255,255,.12); }
.live-chip .dot { height: 8px; width: 8px; border-radius: 50%; background: #9ca3af; }
.live-chip.on .dot { background: #22c55e; box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: pulse 2s infinite; }
.live-chip.sm { background: var(--muted); color: var(--muted-fg); font-size: 11px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; } .kpis.five { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1100px) { .kpis, .kpis.five { grid-template-columns: repeat(2, 1fr); } }
.kpi { display: flex; gap: 14px; align-items: flex-start; padding: 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg);
       box-shadow: 0 1px 2px rgba(0,0,0,.04); transition: box-shadow .15s, transform .15s; }
a.kpi:hover { box-shadow: 0 8px 20px -10px rgba(15,23,42,.25); transform: translateY(-1px); }
.kpi-ico { height: 42px; width: 42px; border-radius: 11px; display: grid; place-items: center; flex: 0 0 auto; }
.kpi-ico .icon { height: 20px; width: 20px; }
.k-blue { background: #e6effa; color: #2a78d6; } .k-green { background: #e7f6e7; color: #0ca30c; } .k-amber { background: #fff4d9; color: #b27c00; }
.k-red { background: #fbe8e8; color: #d03b3b; } .k-violet { background: #efeafc; color: #6d4bd8; }
.kpi-body { min-width: 0; flex: 1; } .kpi-body p { margin: 0; }
.kpi-label { font-size: 12px; font-weight: 500; color: #52514e; margin: 0; }
.kpi-val { font-size: 28px; font-weight: 700; line-height: 1.2; color: #0b0b0b; font-variant-numeric: tabular-nums; }
.kpi-val small { font-size: 14px; font-weight: 500; color: #898781; margin-left: 4px; }
.kpi-note { font-size: 12px; color: #898781; margin-top: 2px !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi-meter { height: 6px; background: #eeede8; border-radius: 99px; margin: 6px 0 2px; overflow: hidden; }
.kpi-meter i { display: block; height: 100%; background: #0ca30c; border-radius: 99px; transition: width .4s; }
.dash-row { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 20px; margin-bottom: 20px; }
.dash-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) { .dash-row, .dash-row.three { grid-template-columns: 1fr; } }
.dash .card { border-radius: 12px; }
.subhead { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: #898781; margin: 20px 0 8px; }
.hseg { position: relative; display: flex; gap: 2px; height: 14px; }
.seg-part { border-radius: 4px; min-width: 6px; cursor: default; transition: filter .15s; } .seg-part:hover { filter: brightness(.92); }
.hseg.empty { background: #f4f3ef; border-radius: 4px; height: auto; padding: 8px 12px; }
.tooltip { position: absolute; z-index: 5; pointer-events: none; background: #0b0b0b; color: #fff; font-size: 12px; padding: 6px 10px; border-radius: 6px;
           white-space: nowrap; box-shadow: 0 6px 16px rgba(0,0,0,.2); display: flex; gap: 6px; align-items: baseline; }
.tooltip span { color: rgba(255,255,255,.72); }
.seg-tip { top: 22px; left: 50%; transform: translateX(-50%); }
.legend { display: flex; gap: 20px; margin-top: 12px; flex-wrap: wrap; }
.hl { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #52514e; } .hl b { color: #0b0b0b; font-variant-numeric: tabular-nums; }
.hl-ico .icon, .attn-ico .icon, .all-good .icon { height: 16px; width: 16px; display: block; }
.attn { list-style: none; margin: 0; padding: 0; }
.attn li + li { border-top: 1px solid #eeede8; }
.attn a { display: grid; grid-template-columns: 20px minmax(0, 1fr) minmax(0, 1.2fr) auto; gap: 12px; align-items: center; padding: 10px 6px; border-radius: 6px; }
.attn a:hover { background: #f8f8f6; }
.attn-main { min-width: 0; } .attn-main b { display: block; font-size: 13px; font-weight: 600; color: #0b0b0b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attn-main small { display: block; font-size: 11px; color: #898781; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attn-reason { font-size: 12px; color: #52514e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-tag { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; color: #0b0b0b; }
.st-tag.st-error { background: #fbe8e8; } .st-tag.st-offline { background: #f1f5f9; } .st-tag.st-warning { background: #fff4d9; } .st-tag.st-ok { background: #e7f6e7; }
.all-good { display: flex; align-items: center; gap: 8px; padding: 12px; border-radius: 8px; background: #f3faf3; font-size: 13px; color: #0b0b0b; }
.all-good .icon { color: #0ca30c; }
.live-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 8px; }
.live-mini { display: flex; gap: 14px; font-size: 12px; color: #898781; } .live-mini b { color: #0b0b0b; font-variant-numeric: tabular-nums; }
.chart { position: relative; height: 140px; cursor: crosshair; }
.chart-svg { width: 100%; height: 100%; display: block; overflow: visible; }
.grid-ln { stroke: #e1e0d9; stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.base-ln { stroke: #c9c8c1; stroke-width: 1; vector-effect: non-scaling-stroke; }
.cross { stroke: #52514e; stroke-width: 1; stroke-dasharray: 2 2; }
.y-lbl { position: absolute; left: 0; font-size: 10px; color: #898781; background: rgba(255,255,255,.85); padding: 0 3px; line-height: 16px; }
.dot-mark { position: absolute; height: 10px; width: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: #2a78d6; box-shadow: 0 0 0 2px #fff; pointer-events: none; }
.chart-tip { top: -8px; transform: translate(-50%, -100%); }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; }
.x-lbls { display: flex; justify-content: space-between; margin-top: 4px; }
.live-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; padding-top: 16px; border-top: 1px solid #eeede8; }
.live-stats > div { display: flex; gap: 10px; align-items: flex-start; } .live-stats p { margin: 0; } .live-stats b { font-size: 16px; font-variant-numeric: tabular-nums; }
.hbar { display: grid; grid-template-columns: 90px 1fr 32px; gap: 10px; align-items: center; padding: 5px 0; font-size: 13px; }
.hb-l { color: #52514e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-t { height: 10px; background: #f4f3ef; border-radius: 0 4px 4px 0; }
.hb-t i { display: block; height: 100%; min-width: 3px; background: #2a78d6; border-radius: 0 4px 4px 0; transition: width .4s; }
.hbar:hover .hb-t i { background: #1f63b5; }
.hbar b { text-align: right; font-variant-numeric: tabular-nums; color: #0b0b0b; }

.installer-banner { display: flex; align-items: center; gap: 14px; padding: 12px 16px; margin: 0 0 20px; border-radius: 10px;
                    background: var(--blue-soft); border: 1px solid color-mix(in srgb, var(--blue) 18%, transparent); }
.installer-banner img { height: 40px; max-width: 120px; object-fit: contain; }
.installer-banner .brand-mono { height: 40px; width: 40px; border-radius: 9px; display: grid; place-items: center; background: var(--blue); color: #fff; font-weight: 700; }

input[type=range], input[type=checkbox], input[type=radio] { accent-color: var(--blue); }

/* ---------- registration + accounts ---------- */
.reg-form { gap: 14px; }
.reg-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } @media (max-width: 560px) { .reg-2 { grid-template-columns: 1fr; } }
.reg-form textarea { width: 100%; resize: vertical; }
.field-err { color: var(--red); font-size: 12px; margin: 4px 0 0; } .field-hint { color: var(--muted-fg); font-size: 12px; margin: 4px 0 0; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
label.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; font-weight: 400; cursor: pointer; }
label.check input { margin-top: 3px; }
.steps-list { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 12px; }
.steps-list li { counter-increment: s; display: grid; grid-template-columns: 28px 1fr; column-gap: 12px; }
.steps-list li::before { content: counter(s); grid-row: span 2; height: 28px; width: 28px; border-radius: 50%; display: grid; place-items: center;
                         background: var(--muted); font-size: 13px; font-weight: 600; }
.steps-list li:first-child::before { background: #0ca30c; color: #fff; content: "✓"; }
.steps-list b { font-size: 14px; } .steps-list span { font-size: 13px; color: var(--muted-fg); }
.sidebar a.me { color: inherit; } .sidebar a.me:hover, .sidebar a.me.on { background: var(--sidebar-hover); }
.nav-count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: #fab219; color: #0b0b0b;
             font-size: 11px; font-weight: 700; display: grid; place-items: center; }
body.collapsed .nav-count { position: absolute; margin: -18px 0 0 18px; min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }
.sidebar nav a { position: relative; }
.acct-table td { vertical-align: middle; }
.pool-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pool-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 10px; border-radius: 99px; background: var(--blue-soft);
             color: var(--blue-ink); font-size: 12px; font-weight: 500; }
.pool-chip button { border: 0; background: none; color: inherit; opacity: .6; cursor: pointer; height: 18px; width: 18px; border-radius: 50%; display: grid; place-items: center; padding: 0; }
.pool-chip button:hover { opacity: 1; background: rgba(0,0,0,.08); } .pool-chip .icon { height: 12px; width: 12px; }
.st { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: #52514e; } .st .icon { height: 14px; width: 14px; }
.st.active .icon { color: #0ca30c; } .st.invited .icon { color: #2a78d6; } .st.pending .icon { color: #b27c00; } .st.disabled .icon, .st.rejected .icon { color: #d03b3b; }
.dlg-back { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 50; display: grid; place-items: center; padding: 16px; }
.dlg { background: var(--bg); border-radius: 12px; width: 100%; max-width: 480px; box-shadow: 0 24px 48px -12px rgba(0,0,0,.35); }
.dlg-head { padding: 18px 20px 0; } .dlg-body { padding: 16px 20px; display: grid; gap: 14px; } .dlg-foot { padding: 0 20px 18px; display: flex; justify-content: flex-end; gap: 8px; }
.dlg label { font-size: 12px; font-weight: 500; color: var(--muted-fg); display: block; margin-bottom: 4px; }
.dlg input[type=text], .dlg input[type=email], .dlg input[type=tel], .dlg textarea, .dlg select { width: 100%; }
.check-list { max-height: 180px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; padding: 4px; }
.check-list label { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 6px; margin: 0; font-size: 13px; color: var(--fg); font-weight: 400; cursor: pointer; }
.check-list label:hover { background: var(--muted); } .check-list small { color: var(--muted-fg); margin-left: auto; }
.reg-card { display: grid; grid-template-columns: 44px 1fr auto; gap: 16px; align-items: start; padding: 18px 20px; }
.reg-card + .reg-card { border-top: 1px solid var(--border); }
.reg-av { height: 44px; width: 44px; border-radius: 11px; display: grid; place-items: center; background: #efeafc; color: #6d4bd8; font-weight: 700; }
.reg-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; color: var(--muted-fg); margin-top: 4px; }
.reg-meta span { display: inline-flex; gap: 5px; align-items: center; } .reg-meta .icon { height: 13px; width: 13px; }
.reg-msg { margin: 10px 0 0; padding: 8px 12px; border-left: 3px solid var(--border); background: #fafaf9; font-size: 13px; border-radius: 0 6px 6px 0; }
.seg-tabs { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; padding: 3px; gap: 2px; background: var(--muted); }
.seg-tabs button { border: 0; background: none; padding: 5px 12px; border-radius: 6px; font: 500 13px system-ui, sans-serif; color: var(--muted-fg); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.seg-tabs button.on { background: var(--bg); color: var(--fg); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.seg-tabs .n { font-size: 11px; background: var(--border); border-radius: 99px; padding: 0 6px; }
.acct-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; } @media (max-width: 1000px) { .acct-grid { grid-template-columns: 1fr; } }
.form-grid label.check input { width: auto; height: auto; }
.pw-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 6px; }
.pw-meter i { height: 4px; border-radius: 99px; background: var(--border); }
.pw-meter i.s1 { background: #d03b3b; } .pw-meter i.s2 { background: #fab219; } .pw-meter i.s3, .pw-meter i.s4 { background: #0ca30c; }
input:disabled, select:disabled, textarea:disabled { background: var(--muted); color: var(--muted-fg); cursor: not-allowed; }

.lf-row { display: flex; gap: 6px; align-items: center; padding: 4px 6px; border-radius: 6px; font-size: 12.5px; }
.lf-row.wrap { flex-wrap: wrap; } .lf-row b { width: 22px; flex: 0 0 auto; } .lf-row .grow { flex: 1; min-width: 0; }
.lf-row select, .lf-row input { height: 28px; font-size: 12px; max-width: 150px; } .lf-row.changed { background: #fef9c3; }

/* Pool maintenance: the day planner next to the map */
.mt-grid { display: grid; grid-template-columns: minmax(340px, 420px) 1fr; gap: 16px; align-items: start; }
@media (max-width: 1000px) { .mt-grid { grid-template-columns: 1fr; } }
.mt-day { position: sticky; top: 12px; }
.mt-date { display: block; margin: 2px auto 0; height: 26px; font-size: 12px; }
.mt-mapcard { overflow: hidden; } .mt-map { height: calc(100vh - 190px); min-height: 460px; } .mt-map.picking { cursor: crosshair; }
.mt-visit { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }
.mt-visit.done { background: #f0fdf4; border-color: #bbf7d0; }
.mt-num { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%; background: #2563eb; color: #fff; font: 600 12px/24px system-ui, sans-serif; text-align: center; }
.mt-visit.done .mt-num { background: #16a34a; }
.mt-acts { display: flex; gap: 2px; align-items: center; flex-wrap: wrap; justify-content: flex-end; max-width: 150px; }
.mt-dur { width: 58px; height: 22px; font-size: 12px; padding: 0 4px; }
.mt-leg { display: flex; gap: 6px; align-items: center; padding: 4px 0 4px 16px; font-size: 11px; color: var(--muted); }
.mt-pin { width: 26px; height: 26px; border-radius: 50%; background: #94a3b8; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35);
  color: #fff; font: 700 12px/22px system-ui, sans-serif; text-align: center; cursor: pointer; }
.mt-pin.on { background: #2563eb; } .mt-pin.base { width: 28px; height: 28px; background: #0f172a; font-size: 15px; line-height: 24px; }
.mt-water { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; } .mt-water label { display: flex; flex-direction: column; gap: 2px; }
.mt-water input { width: 100%; }
@media (max-width: 700px) { .mt-water { grid-template-columns: repeat(2, 1fr); } }
.mt-kinds { gap: 12px; margin-top: 3px; } .mt-kinds label { display: inline-flex; gap: 4px; align-items: center; cursor: pointer; }

/* the maintenance report as the pool maintenance sheet */
.mt-sheet { --mt-teal: #3a9cbd; --mt-light: #b7def0; --mt-pale: #dcecf7; }
.mt-title { color: var(--mt-teal); font-size: 26px; font-weight: 800; letter-spacing: .02em; margin: 0; }
.mt-days { display: flex; gap: 3px; } .mt-days span { min-width: 30px; height: 26px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--mt-pale); font: 700 10px system-ui, sans-serif; color: #374151; }
.mt-days span.on { background: var(--mt-teal); color: #fff; }
.mt-insp { display: grid; grid-template-columns: 2.6fr 1fr 1fr 1.3fr; border-top: 2px solid #9aa6b2; border-bottom: 2px solid #9aa6b2; margin: 0 0 16px; }
.mt-insp label { display: flex; flex-direction: column; gap: 6px; padding: 6px 8px 10px; border-right: 1px dashed #9aa6b2; }
.mt-insp label:last-child { border-right: 0; } .mt-insp span { font: 700 10px system-ui, sans-serif; letter-spacing: .05em; color: #374151; }
.mt-insp input { height: 28px; } .mt-insp b { font-weight: 500; font-size: 13px; padding-top: 5px; }
@media (max-width: 700px) { .mt-insp { grid-template-columns: 1fr 1fr; } }
table.mt-levels { width: 100%; border-collapse: collapse; font-size: 12px; }
table.mt-levels th { background: var(--mt-light); font: 700 10px system-ui, sans-serif; letter-spacing: .04em; text-align: left; padding: 6px 8px; }
table.mt-levels th i { font-weight: 400; } table.mt-levels td { padding: 6px 8px; border-bottom: 1px dashed #c3ccd6; vertical-align: middle; }
table.mt-levels td:nth-child(2), table.mt-levels td:nth-child(3), table.mt-levels td:nth-child(4) { border-right: 1px solid #9aa6b2; }
table.mt-levels td input { width: 100%; height: 28px; } .mt-range { font-size: 11px; white-space: pre-line; text-align: center; color: #374151; }
.mt-dot input[type=checkbox] { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--mt-pale);
  border: 0; margin: 0; cursor: pointer; display: grid; place-content: center; }
.mt-dot input[type=checkbox]:checked { background: var(--mt-teal); } .mt-dot input[type=checkbox]:checked::after { content: "✓"; color: #fff; font-size: 11px; font-weight: 700; }
.mt-two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 16px; } @media (max-width: 700px) { .mt-two { grid-template-columns: 1fr; } }
.mt-h { font: 700 11px system-ui, sans-serif; letter-spacing: .05em; color: #374151; margin: 0 0 8px; padding-bottom: 6px; border-bottom: 2px solid #9aa6b2; }
.mt-svc { display: flex; gap: 10px; align-items: center; padding: 4px 0; font-size: 11px; letter-spacing: .04em; color: #374151; cursor: pointer; }
.mt-svc input:not([type=checkbox]) { height: 26px; flex: 1; }
.mt-notes { border: 2px solid var(--mt-light); padding: 10px 12px; display: flex; flex-direction: column; }
.mt-notes .mt-h { border: 0; padding: 0; } .mt-notes textarea { flex: 1; min-height: 180px; border: 0; resize: vertical; padding: 0; outline: none; }
.mt-eq { margin-top: 14px; } .mt-eq summary { cursor: pointer; margin-bottom: 6px; }

/* My installations: the installer's pools on a small map */
.install-map { margin-bottom: 20px; overflow: hidden; padding: 0; }
.install-map-canvas { height: 340px; border-top: 1px solid var(--border); z-index: 0; }
@media (max-width: 700px) { .install-map-canvas { height: 260px; } }

/* a small photo of the pool in the Pools table, and the photo dialog */
.pool-thumb { width: 52px; height: 38px; padding: 0; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: var(--muted-bg, #f1f5f9);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--muted, #64748b); vertical-align: middle; }
.pool-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pool-thumb.empty { border-style: dashed; } .pool-thumb:hover:not(:disabled) { border-color: var(--primary, #2563eb); }
.pool-thumb:disabled { cursor: default; }
.pool-photo-big { min-height: 160px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: var(--muted-bg, #f1f5f9); }
.pool-photo-big img { width: 100%; max-height: 360px; object-fit: contain; display: block; }

/* map list: the devices of a pool in the filtered state, with since when */
.match-row { display: flex; gap: 10px; align-items: flex-start; padding: 4px 16px 8px 40px; cursor: pointer; }
.match-row .sdot { margin-top: 5px; } .match-row:hover { background: var(--hover, #f8fafc); }

/* Dashboard: the errors devices sent in the past 24 h, once each, at the time last received */
.err-feed { margin-top: 14px; }
.err-head { display: flex; justify-content: space-between; margin: 0 0 4px; font-size: 12px; font-weight: 600; color: #52514e; }
.err-head b { color: #d03b3b; }
.err-feed ul { list-style: none; margin: 0; padding: 0; }
.err-feed li + li { border-top: 1px dashed #eeede8; }
.err-feed a, .err-cols { display: grid; grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1.4fr) 92px; gap: 10px; align-items: center; padding: 7px 6px; border-radius: 6px; }
.err-cols { padding: 2px 6px; font-size: 11px; color: #898781; text-transform: uppercase; letter-spacing: .03em; }
.err-status { justify-self: start; padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.err-status.err { background: #fdecec; color: #b42323; } .err-status.warn { background: #fef4dc; color: #a16207; }
.err-status.ok { background: #e7f6e7; color: #0c7a0c; } .err-status.off { background: #eef0f3; color: #64748b; }
.err-feed a:hover { background: #f8f8f6; }
.err-feed li.not-counted { opacity: .55; } .err-feed li.not-counted time { color: #898781; }
.err-feed time { font-size: 12px; font-variant-numeric: tabular-nums; color: #d03b3b; font-weight: 600; white-space: nowrap; }
.err-dev { min-width: 0; } .err-dev b { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.err-dev small { display: block; font-size: 11px; color: #898781; }
.err-text { font-size: 12px; color: #52514e; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.err-src { display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 4px; background: #fdecec; color: #b42323; font-size: 11px; }
