/* Nunito (variable 200–1000), self-hosted from Google Fonts in /fonts/.
   The metric overrides give a 1.28 line box (Nunito's own is 1.36) with
   caps optically centred, so rows stay as dense as before. */
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 200 1000; font-display: swap;
  src: url("fonts/nunito-latin.woff2") format("woff2");
  ascent-override: 98%; descent-override: 30%; line-gap-override: 0%;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 200 1000; font-display: swap;
  src: url("fonts/nunito-latin-ext.woff2") format("woff2");
  ascent-override: 98%; descent-override: 30%; line-gap-override: 0%;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Nunito"; font-style: italic; font-weight: 200 1000; font-display: swap;
  src: url("fonts/nunito-italic-latin.woff2") format("woff2");
  ascent-override: 98%; descent-override: 30%; line-gap-override: 0%;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Nunito"; font-style: italic; font-weight: 200 1000; font-display: swap;
  src: url("fonts/nunito-italic-latin-ext.woff2") format("woff2");
  ascent-override: 98%; descent-override: 30%; line-gap-override: 0%;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #000; --panel: #0c0c0c; --panel2: #111; --border: #242424;
  --text: #ececec; --muted: #949494; --muted2: #b8b8b8;
  --green: #2fbf4f; --red: #e0413e; --gray: #6b7280; --amber: #f0a500; --accent: #1d6fe0;
  --radius: 10px; --radius-sm: 7px;
  --shadow-hover: 0 4px 20px rgba(0,0,0,.5);
  --transition: 150ms cubic-bezier(.4,0,.2,1);
}
* { box-sizing: border-box; }
button, input, select, textarea, .leaflet-container { font-family: inherit; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  font-family: "Nunito", ui-rounded, system-ui, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text);
  display: flex; flex-direction: column; letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
}

/* ---- animated status dots ---- */
.dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  flex-shrink: 0;
}
.dot.online  { background: var(--green); }
.dot.offline { background: var(--red); }
.dot.inactive{ background: var(--gray); }
.dot.unknown { background: var(--gray); }
.dot.pending { background: var(--amber); }
/* the live pulse is a ring that only scales and fades (transform + opacity),
   so the GPU animates it without repainting the page every frame */
.dot.online, .dot.pending { position: relative; }
.dot.online::after, .dot.pending::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit;
  pointer-events: none; animation: dot-pulse 2.4s ease-in-out infinite;
}
.dot.pending::after { animation-duration: 2s; }
@keyframes dot-pulse {
  0%, 100% { transform: scale(1); opacity: .6; }
  50%      { transform: scale(2); opacity: 0; }
}

/* ---- top nav ---- */
.topnav {
  display: flex; align-items: center; gap: 40px; height: 62px; padding: 0 28px;
  background: #000; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.brand { font-weight: 800; font-size: 20px; letter-spacing: .22em; }
.topnav-links { display: flex; gap: 30px; }
.topnav-links a {
  color: #b0b0b0; text-decoration: none; font-size: 13.5px; letter-spacing: .08em;
  padding: 20px 0; cursor: pointer; border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}
.topnav-links a.active { color: #fff; border-bottom-color: #fff; }
.topnav-links a:not(.disabled):not(.active):hover { color: #fff; }
.topnav-links a.disabled { color: #444; cursor: default; }
.topnav-right { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.cart { display: inline-flex; opacity: .7; transition: opacity var(--transition); }
.cart:hover { opacity: 1; }
.cart svg { width: 20px; height: 20px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: #1e1e1e;
  border: 1px solid var(--border); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; letter-spacing: .05em;
  transition: border-color var(--transition);
}
.avatar:hover { border-color: #555; }
.logout {
  background: transparent; color: var(--muted); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 7px 12px; cursor: pointer; font-size: 13px;
  transition: color var(--transition), border-color var(--transition);
}
.logout:hover { color: #fff; border-color: #555; }

/* ---- shell ---- */
.shell { flex: 1; display: flex; min-height: 0; }
.sidebar {
  width: 256px; background: #030303; border-right: 1px solid var(--border);
  padding: 14px 10px; flex-shrink: 0; display: flex; flex-direction: column; gap: 3px;
}
.side-item {
  display: flex; align-items: center; gap: 14px; padding: 13px 16px;
  border-radius: var(--radius); color: #b0b0b0; text-decoration: none;
  font-size: 14.5px; cursor: pointer;
  transition: background var(--transition), color var(--transition),
              transform var(--transition);
}
.side-item .si-ic {
  width: 22px; height: 22px; display: inline-flex; align-items: center;
  justify-content: center; flex-shrink: 0; opacity: .85;
}
.side-item .si-ic svg { width: 22px; height: 22px; }
.side-item.active { background: #1a1a1a; color: #fff; }
.side-item.active .si-ic { opacity: 1; }
.side-item:not(.disabled):not(.active):hover {
  background: #141414; color: #fff; transform: translateX(2px);
}
.side-item.disabled { color: #444; cursor: default; }

.content { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }

/* ---- dashboard control bar ---- */
.controlbar {
  display: flex; align-items: center; gap: 12px; padding: 13px 20px;
  border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.status-dd {
  background: var(--panel2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 34px 10px 14px; font-size: 14px; color: #d0d0d0; white-space: nowrap;
  cursor: pointer; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%237a7a7a' fill='none' stroke-width='1.5'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center;
  transition: border-color var(--transition);
}
.status-dd:hover { border-color: #444; }
.pills { display: flex; align-items: center; gap: 8px; }
.pill {
  display: flex; align-items: center; gap: 7px; background: var(--panel2);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 9px 14px; font-size: 14px; cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition: border-color var(--transition), background var(--transition),
              transform var(--transition);
}
.pill svg { width: 15px; height: 15px; }
.pill:hover { border-color: #444; background: #161616; transform: translateY(-1px); }
.pill.selected { border-color: #fff; background: #1a1a1a; }
.pill.alert { color: var(--amber); }
.search {
  flex: 1; min-width: 180px; background: var(--panel2); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 14px;
  transition: border-color var(--transition);
}
.search:focus { outline: none; border-color: #444; }
.icon-btn {
  background: var(--panel2); border: 1px solid var(--border); color: #d0d0d0;
  border-radius: var(--radius-sm); padding: 9px 13px; cursor: pointer; font-size: 16px;
  transition: border-color var(--transition), color var(--transition),
              transform var(--transition);
}
.icon-btn:hover { border-color: #444; color: #fff; transform: translateY(-1px); }

/* ---- two panes ---- */
.panes { flex: 1; display: flex; min-height: 0; position: relative; }
.dash-loading {
  position: absolute; inset: 0; z-index: 700;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; background: rgba(0,0,0,.55); backdrop-filter: blur(1.5px);
  animation: fade-in .12s ease;
}
.dash-loading .spinner {
  width: 40px; height: 40px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.15); border-top-color: var(--accent);
  animation: spin .7s linear infinite;
}
.dash-loading-txt { color: var(--text); font-size: 13.5px; font-weight: 500; letter-spacing: .02em; }
@keyframes spin { to { transform: rotate(360deg); } }
.list-pane {
  width: 480px; display: flex; flex-direction: column;
  border-right: 1px solid var(--border); min-width: 0;
}
.list-head {
  padding: 14px 20px; font-size: 13px; color: var(--muted);
  border-bottom: 1px solid var(--border); letter-spacing: .04em; text-transform: uppercase;
}
.list-body { flex: 1; overflow: auto; }
.sl-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 20px; border-bottom: 1px solid #161616; cursor: pointer;
  border-left: 3px solid transparent;
  transition: background var(--transition), border-color var(--transition);
}
.sl-item:hover { background: #0e0e0e; border-left-color: #333; }
.sl-item.selected { background: #0d1420; border-left-color: var(--accent); }
.sl-name {
  font-size: 15px; font-weight: 500; color: #eaeaea;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 340px;
}
.sl-num { font-size: 12.5px; color: var(--muted2); margin-top: 4px; font-family: monospace; font-weight: 500; }
.sl-right {
  display: flex; align-items: center; gap: 8px;
  color: var(--muted2); font-size: 13px; flex-shrink: 0;
}
.list-foot { padding: 10px 20px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--border); }
.map-pane { flex: 1; min-width: 0; position: relative; z-index: 0; }   /* keeps Leaflet's z-indexes (up to 1000) below the dialogs */
#map { height: 100%; width: 100%; background: #050505; }

/* leader-line school labels (placed in free space, pointing to each pin) */
.label-overlay { position: absolute; inset: 0; z-index: 620; pointer-events: none; }
.label-overlay.hidden { display: none; }
.label-lines { position: absolute; inset: 0; overflow: visible; }
.ll-line { stroke: rgba(70,70,70,.6); stroke-width: 1; }
.ll-label {
  position: absolute; white-space: nowrap;
  height: 15px; line-height: 13px; padding: 0 5px; box-sizing: border-box;
  background: rgba(255,255,255,.95); color: #16232e; border: 1px solid rgba(0,0,0,.22);
  border-left: 3px solid #16a34a; border-radius: 3px;
  font-size: 10px; font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.28);
}

/* bold black municipality names (our own, replacing the soft tile labels) */
.muni-name { background: none; border: none; overflow: visible; }
.muni-name span {
  position: absolute; transform: translate(-50%, -50%); white-space: nowrap;
  color: #000; font-weight: 800; font-size: 13px; letter-spacing: .2px;
}

/* full-screen dashboard view */
#view-dashboard:fullscreen { background: var(--bg); }
.icon-btn.active { border-color: var(--accent); color: #fff; }

.badge {
  display: inline-block; font-size: 11px; padding: 2px 8px;
  border-radius: 999px; font-weight: 600; letter-spacing: .03em;
}
.badge.inactive { background: rgba(224,65,62,.15); color: var(--red); }
.badge.active   { background: rgba(47,191,79,.15);  color: var(--green); }
.badge.alert    { background: rgba(240,165,0,.18);  color: var(--amber); }
.muted { color: var(--muted); }

/* ---- home view ---- */
/* The Account view scrolls by itself (the page is fixed to the window). The
   decorative globe sits in a clipping box so it never adds scroll space. */
.view-home { position: relative; overflow-x: hidden; overflow-y: auto; }
.home-globe-clip {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 1;
  /* soft lower edge: the box scrolls away with the page, so no hard line shows */
  -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 70%, transparent 100%);
}
.home-inner { padding: 52px 64px; position: relative; z-index: 2; max-width: 960px; }
.home-title { font-size: 42px; font-weight: 300; margin: 0 0 8px; }
.home-acct { color: var(--muted); margin-bottom: 32px; font-size: 14.5px; }
.home-cards { display: flex; flex-direction: column; gap: 12px; max-width: 900px; }
.home-card {
  display: flex; align-items: center; gap: 18px; background: #060606;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 26px; cursor: pointer;
  transition: border-color var(--transition), background var(--transition),
              transform var(--transition), box-shadow var(--transition);
}
.home-card:hover {
  border-color: #3a3a3a; background: #0d0d0d;
  transform: translateY(-2px); box-shadow: var(--shadow-hover);
}
.hc-ic { width: 30px; display: inline-flex; align-items: center; justify-content: center; color: #b0b0b0; }
.hc-ic svg { width: 26px; height: 26px; }
.hc-sub { color: var(--muted2); font-size: 13.5px; margin-top: 3px; font-weight: 500; }
.home-globe {
  position: absolute; right: -180px; top: 50%; transform: translateY(-50%);
  width: 820px; height: 820px; border-radius: 50%;
  background: radial-gradient(circle at 60% 40%, #141414 0%, #0a0a0a 45%, #000 70%);
  box-shadow: inset 0 0 120px #000; z-index: 1; pointer-events: none;
}
.acct-section { font-size: 15px; color: var(--muted2); margin: 6px 0 14px; font-weight: 600; letter-spacing: .02em; }
.profile-card {
  background: #060606; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px 26px; max-width: 900px; margin-bottom: 28px;
}
.pc-head { display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px; font-size: 16px; }
.pc-edit {
  background: transparent; color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 16px; cursor: pointer; font-size: 13.5px;
  transition: border-color var(--transition), color var(--transition);
}
.pc-edit:hover { border-color: #555; }
.pc-body { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 44px; }
.pc-field { display: flex; flex-direction: column; gap: 5px; }
.pc-l { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.pc-v { font-size: 15px; }
.pc-body input {
  background: var(--panel2); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius-sm); padding: 10px 12px; font-size: 14.5px;
  transition: border-color var(--transition);
}
.pc-body input:focus { outline: none; border-color: #555; }
.pc-actions { grid-column: 1 / -1; display: flex; gap: 10px; margin-top: 4px; }
.pc-save {
  background: var(--accent); color: #fff; border: none; border-radius: var(--radius-sm);
  padding: 10px 24px; cursor: pointer; font-weight: 700;
  transition: background var(--transition), transform var(--transition);
}
.pc-save:hover { background: #1a62cc; transform: translateY(-1px); }
.pc-cancel {
  background: transparent; color: var(--muted); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 18px; cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
}
.pc-cancel:hover { border-color: #555; color: #fff; }
.pc-msg { grid-column: 1 / -1; background: rgba(224,65,62,.15); color: var(--red);
  border-radius: var(--radius-sm); padding: 9px 12px; font-size: 13.5px; }
@media (max-width: 700px) { .pc-body { grid-template-columns: 1fr; } }

/* ---- map: teardrop pin markers ---- */
.sl-pin { background: none; border: none; }
.sl-pin svg {
  display: block;
  filter: drop-shadow(0 3px 4px rgba(0,0,0,.45));
  transition: transform 120ms cubic-bezier(.4,0,.2,1);
  transform-origin: 50% 100%;   /* grow from the tip so the point stays anchored */
}
.sl-pin:hover svg { transform: scale(1.28); }
/* small always-on school label above a focused pin */
.sl-pin-lbl { overflow: visible; }
.pin-school {
  position: absolute; left: 14px; bottom: 44px; transform: translateX(-50%);
  white-space: nowrap;
  background: rgba(12,12,12,.9); color: #fff; border: 1px solid var(--border);
  font-size: 10.5px; font-weight: 600; line-height: 1.3; padding: 2px 6px;
  border-radius: 5px; pointer-events: none;
  box-shadow: 0 2px 6px rgba(0,0,0,.45);
}
.sl-pin-lbl:hover { z-index: 10000 !important; }
/* tiny dot markers for the dense province view */
.sl-dot { background: none; border: none; }
.sl-dot-in {
  display: block; width: 11px; height: 11px; border-radius: 50%; box-sizing: border-box;
  border: 1.5px solid #fff; box-shadow: 0 1px 2px rgba(0,0,0,.45);
  transition: transform 100ms ease;
}
.sl-dot:hover .sl-dot-in { transform: scale(1.5); }
.sl-dot-lbl { overflow: visible; }
.dot-school {
  position: absolute; left: 6px; bottom: 12px; transform: translateX(-50%);
  white-space: nowrap; max-width: 92px; overflow: hidden; text-overflow: ellipsis;
  background: rgba(12,12,12,.78); color: #fff; border: 1px solid rgba(255,255,255,.12);
  font-size: 7px; font-weight: 600; line-height: 1.2; padding: 0 3px;
  border-radius: 3px; pointer-events: none; letter-spacing: -.1px;
}
.sl-dot-lbl:hover { z-index: 10000 !important; }
.sl-dot-lbl:hover .dot-school {
  max-width: none; font-size: 11px; padding: 2px 6px; bottom: 15px;
  background: rgba(12,12,12,.95);
}

/* ---- map: hover info card (tooltip) ---- */
.leaflet-tooltip.sl-tip {
  background: #0c0c0c; border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius-sm); padding: 9px 12px 10px;
  box-shadow: var(--shadow-hover); font-size: 12.5px; line-height: 1.5;
  white-space: nowrap; font-weight: 500;
}
.leaflet-tooltip.sl-tip.leaflet-tooltip-top::before    { border-top-color: var(--border); }
.leaflet-tooltip.sl-tip.leaflet-tooltip-bottom::before { border-bottom-color: var(--border); }
.leaflet-tooltip.sl-tip.leaflet-tooltip-left::before   { border-left-color: var(--border); }
.leaflet-tooltip.sl-tip.leaflet-tooltip-right::before  { border-right-color: var(--border); }
.sl-tip .tip-head {
  font-weight: 600; font-size: 13px; display: flex; align-items: center;
  gap: 7px; margin-bottom: 3px;
}
.sl-tip .tip-sub {
  color: var(--muted2); margin-bottom: 5px; max-width: 270px;
  overflow: hidden; text-overflow: ellipsis;
}
.sl-tip .tip-metrics { color: var(--muted2); font-variant-numeric: tabular-nums; }
.sl-tip .tip-metrics i { color: var(--muted); font-style: normal; }
.sl-tip .tip-st { text-transform: capitalize; color: var(--text); }
.sl-tip .tipc-list { margin-top: 6px; display: flex; flex-direction: column; gap: 3px; }
.sl-tip .tipc-row { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 500; }
.sl-tip .tipc-more { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.sl-tip.prov-tip .tip-head { font-size: 14px; }
.sl-tip.prov-tip .prov-n { color: #8fca63; font-size: 14px; }

/* ---- map: click popup (dark, themed) ---- */
.popup-btn {
  margin-top: 8px; background: var(--accent); color: #fff; border: none;
  border-radius: 6px; padding: 6px 11px; cursor: pointer; font-size: 13px;
  transition: background var(--transition);
}
.popup-btn:hover { background: #1a62cc; }
.leaflet-popup-content { font-size: 13.5px; line-height: 1.6; color: var(--text); margin: 12px 15px; }
.leaflet-popup-content-wrapper {
  background: #0c0c0c; color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
}
.leaflet-popup-tip { background: #0c0c0c; border: 1px solid var(--border); box-shadow: none; }
.leaflet-popup-close-button { color: var(--muted) !important; }
.leaflet-popup-close-button:hover { color: #fff !important; }

/* ---- detail pane ---- */
.detail-pane {
  flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0;
  overflow: hidden; border-left: 1px solid var(--border); background: var(--bg);
}
.detail-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  border-bottom: 1px solid var(--border); padding: 18px 22px 16px; flex-shrink: 0;
}
.detail-title { font-size: 19px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.detail-sub { font-size: 13px; color: var(--muted2); margin-top: 6px; display: flex; align-items: center; gap: 8px; font-weight: 500; }
.detail-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.detail-actions select, .detail-actions button {
  background: var(--panel2); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 11px; cursor: pointer; font-size: 13.5px;
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
}
.detail-actions button:hover, .detail-actions select:hover {
  border-color: #444; background: #161616; transform: translateY(-1px);
}
.detail-pane-body { flex: 1; overflow: auto; padding: 18px 22px 28px; }
.detail-meta {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 10px; margin-bottom: 20px;
}
.mi {
  background: var(--panel2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 13px;
  transition: border-color var(--transition), transform var(--transition);
}
.mi:hover { border-color: #333; transform: translateY(-1px); }
.mi-l { font-size: 11px; text-transform: uppercase; color: var(--muted); letter-spacing: .05em; font-weight: 600; }
.mi-v { font-size: 14px; margin-top: 4px; word-break: break-word; font-weight: 500; }
.detail-charts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.chart-card {
  background: var(--panel2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; height: 190px; display: flex; flex-direction: column;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.chart-card:hover {
  border-color: #333; transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0,0,0,.45);
}
.chart-title { font-size: 13px; color: var(--muted2); margin-bottom: 8px; letter-spacing: .02em; font-weight: 600; }
.chart-card canvas { flex: 1; min-height: 0; }
.no-tel { color: var(--muted); padding: 28px; text-align: center; grid-column: 1 / -1; font-size: 14px; }

/* ---- login ---- */
#login-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.96);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
  animation: fade-in .2s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
#login-form, #register-form {
  background: #0a0a0a; border: 1px solid #2a2a2a;
  border-radius: 16px; padding: 40px 38px 32px; width: 400px;
  display: flex; flex-direction: column; gap: 14px;
  animation: slide-up .25s cubic-bezier(.4,0,.2,1);
}
@keyframes slide-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.login-brand { font-size: 22px; font-weight: 700; text-align: center; margin-bottom: 14px; letter-spacing: .18em; }
#login-form input, #register-form input {
  background: #141414; border: 1px solid #2a2a2a; color: var(--text);
  border-radius: 10px; padding: 15px 16px; font-size: 15px;
  transition: border-color var(--transition), background var(--transition);
}
#login-form input::placeholder, #register-form input::placeholder { color: #555; }
#login-form input:focus, #register-form input:focus { outline: none; border-color: #555; background: #181818; }
#login-form button, #register-form button {
  background: var(--accent); color: #fff; border: none; border-radius: 10px;
  padding: 15px; cursor: pointer; font-weight: 700; font-size: 15px; margin-top: 4px;
  transition: background var(--transition), transform var(--transition);
}
#login-form button:hover, #register-form button:hover { background: #1a62cc; transform: translateY(-1px); }
.login-error {
  background: rgba(224,65,62,.15); color: var(--red); border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 13.5px;
}
.login-alt { text-align: center; font-size: 14px; color: var(--muted); margin-top: 8px; }
.login-alt a { color: #6ea8ff; cursor: pointer; text-decoration: underline; }

/* ---- footer ---- */
.sitefooter { flex-shrink: 0; border-top: 1px solid var(--border); background: #000; padding: 14px 28px; }
.foot-links { display: flex; gap: 24px; flex-wrap: wrap; margin-bottom: 8px; }
.foot-links a {
  color: #888; font-size: 12.5px; text-decoration: none; cursor: pointer;
  transition: color var(--transition);
}
.foot-links a:hover { color: #fff; }
.foot-legal { color: #555; font-size: 12px; display: flex; align-items: center; gap: 10px; }
.foot-legal .x { font-weight: 700; color: #fff; }

/* ---- client management ---- */
.client-mgmt { max-width: 900px; }
.client-mgmt-head { margin-bottom: 18px; }
.btn-add-client {
  background: var(--accent); color: #fff; border: none; border-radius: var(--radius-sm);
  padding: 10px 20px; cursor: pointer; font-weight: 700; font-size: 14px;
  transition: background var(--transition), transform var(--transition);
}
.btn-add-client:hover { background: #1a62cc; transform: translateY(-1px); }
.add-client-form {
  background: #060606; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 26px; margin-bottom: 18px; display: flex; flex-direction: column; gap: 12px;
}
.add-client-form input {
  background: var(--panel2); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius-sm); padding: 11px 13px; font-size: 14.5px;
  transition: border-color var(--transition);
}
.add-client-form input:focus { outline: none; border-color: #444; }
.add-client-form-btns { display: flex; gap: 10px; }
.add-client-submit {
  background: var(--accent); color: #fff; border: none; border-radius: var(--radius-sm);
  padding: 10px 22px; cursor: pointer; font-weight: 700; font-size: 14px;
  transition: background var(--transition), transform var(--transition);
}
.add-client-submit:hover { background: #1a62cc; transform: translateY(-1px); }
.add-client-cancel {
  background: transparent; color: var(--muted); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 18px; cursor: pointer; font-size: 14px;
  transition: border-color var(--transition), color var(--transition);
}
.add-client-cancel:hover { border-color: #555; color: #fff; }
.client-list { display: flex; flex-direction: column; gap: 10px; }
.client-row {
  background: #060606; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 22px; display: flex; align-items: flex-start;
  justify-content: space-between; gap: 16px;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.client-row:hover { border-color: #333; transform: translateY(-1px); box-shadow: var(--shadow-hover); }
.client-info { flex: 1; min-width: 0; }
.client-name { font-size: 15.5px; font-weight: 600; }
.client-email { font-size: 13px; color: var(--muted); margin-left: 10px; }
.client-sls { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.sl-chip {
  font-size: 12px; background: var(--panel2); border: 1px solid var(--border);
  border-radius: 6px; padding: 3px 9px; color: #c0c0c0; font-family: monospace;
  transition: border-color var(--transition);
}
.sl-chip:hover { border-color: #444; }
.client-actions { display: flex; gap: 8px; flex-shrink: 0; }
.btn-assign {
  background: var(--accent); color: #fff; border: none; border-radius: var(--radius-sm);
  padding: 9px 16px; cursor: pointer; font-size: 13.5px;
  transition: background var(--transition), transform var(--transition);
}
.btn-assign:hover { background: #1a62cc; transform: translateY(-1px); }
.btn-del {
  background: transparent; color: var(--red); border: 1px solid rgba(224,65,62,.3);
  border-radius: var(--radius-sm); padding: 9px 16px; cursor: pointer; font-size: 13.5px;
  transition: border-color var(--transition), background var(--transition);
}
.btn-del:hover { border-color: var(--red); background: rgba(224,65,62,.08); }

/* ---- assign modal ---- */
#assign-overlay, #oassign-overlay, #cred-overlay, #wifi-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.8);
  display: flex; align-items: center; justify-content: center; z-index: 950; padding: 24px;
  animation: fade-in .18s ease;
}
#assign-card, #oassign-card {
  background: #0a0a0a; border: 1px solid #2a2a2a; border-radius: 14px;
  width: min(640px, 96vw); max-height: 90vh; display: flex; flex-direction: column;
  padding: 24px 26px; gap: 20px; overflow: hidden;
  animation: slide-up .22s cubic-bezier(.4,0,.2,1);
}
.assign-head { display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; }
.assign-head span { font-size: 17px; font-weight: 600; }
.assign-head button {
  background: transparent; border: none; color: var(--muted);
  cursor: pointer; font-size: 20px; padding: 3px 7px; line-height: 1;
  border-radius: 6px; transition: color var(--transition), background var(--transition);
}
.assign-head button:hover { color: #fff; background: #1a1a1a; }
.assign-section { display: flex; flex-direction: column; gap: 10px; }
.assign-section-label { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; font-weight: 600; }
.assign-chips { display: flex; flex-wrap: wrap; gap: 7px; min-height: 32px; max-height: 140px; overflow-y: auto; }
.assign-chip {
  display: inline-flex; align-items: center; gap: 5px; background: #0e1824;
  border: 1px solid #1d4060; border-radius: 6px; padding: 5px 7px 5px 12px;
  font-size: 12.5px; font-family: monospace; color: #93c5fd;
  transition: border-color var(--transition);
}
.assign-chip:hover { border-color: #2a6090; }
.assign-chip-rm {
  background: transparent; border: none; color: #4b7aad;
  cursor: pointer; font-size: 15px; padding: 0 2px; line-height: 1;
  display: flex; align-items: center;
  transition: color var(--transition);
}
.assign-chip-rm:hover { color: var(--red); }
.assign-search {
  background: #141414; border: 1px solid #2a2a2a; color: var(--text);
  border-radius: var(--radius-sm); padding: 11px 14px; font-size: 14.5px; width: 100%;
  transition: border-color var(--transition), background var(--transition);
}
.assign-search:focus { outline: none; border-color: #444; background: #181818; }
.assign-results {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  max-height: 270px; overflow-y: auto; background: #0d0d0d;
}
.assign-result-item {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px;
  border-bottom: 1px solid #1a1a1a;
  transition: background var(--transition);
}
.assign-result-item:last-child { border-bottom: none; }
.assign-result-item:hover { background: #161616; }
.assign-sln { font-size: 12.5px; font-family: monospace; color: #cfcfcf; flex-shrink: 0; }
.assign-nick { font-size: 13.5px; color: var(--muted); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assign-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.assign-dot.online  { background: var(--green); }
.assign-dot.inactive{ background: var(--gray); }
.assign-add-btn {
  margin-left: auto; background: var(--accent); color: #fff; border: none;
  border-radius: 6px; width: 28px; height: 28px; cursor: pointer; font-size: 20px;
  font-weight: 700; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), transform var(--transition);
}
.assign-add-btn:hover { background: #1a62cc; transform: scale(1.1); }
.assign-no-result { padding: 13px 16px; color: var(--muted); font-size: 14px; }
#assign-card { overflow-y: auto; }
.assign-proj-results { max-height: 220px; }
.assign-proj-count { font-size: 12.5px; color: var(--muted); flex-shrink: 0; }
.assign-foot { display: flex; align-items: center; flex-shrink: 0; }
.assign-msg { color: var(--red); font-size: 13.5px; margin-right: auto; }
.assign-btns { display: flex; gap: 10px; margin-left: auto; }
.assign-save-btn {
  background: var(--accent); color: #fff; border: none; border-radius: var(--radius-sm);
  padding: 10px 24px; cursor: pointer; font-weight: 700; font-size: 14.5px;
  transition: background var(--transition), transform var(--transition);
}
.assign-save-btn:hover { background: #1a62cc; transform: translateY(-1px); }
.assign-cancel-btn {
  background: transparent; color: var(--muted); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 20px; cursor: pointer; font-size: 14.5px;
  transition: border-color var(--transition), color var(--transition);
}
.assign-cancel-btn:hover { border-color: #555; color: #fff; }

/* ---- Omada view ---- */
/* Stay inside the window: before, opening the Organizations panel made the
   view taller than the screen, so the whole page (and the footer) scrolled. */
.view-omada { display: flex; flex-direction: column; overflow: hidden; }
.omada-bar {
  display: flex; align-items: center; gap: 16px; padding: 12px 20px;
  border-bottom: 1px solid var(--border); flex-shrink: 0; flex-wrap: wrap;
}
.omada-stats { display: flex; gap: 22px; flex-wrap: wrap; }
.omada-stat { font-size: 14px; display: flex; align-items: center; gap: 8px; }
.omada-stat-muted { color: var(--muted); font-size: 13px; }
.omada-controls { display: flex; gap: 10px; margin-left: auto; align-items: center; }
.omada-body { flex: 1; display: flex; min-height: 0; overflow: hidden; }

/* Omada site list */
.omada-list {
  width: 380px; flex-shrink: 0; border-right: 1px solid var(--border);
  overflow-y: auto; background: #030303;
}
.omada-site-row {
  display: flex; align-items: center; gap: 13px; padding: 14px 18px;
  border-bottom: 1px solid #181818; cursor: pointer;
  border-left: 3px solid transparent;
  transition: background var(--transition), border-color var(--transition);
}
.omada-site-row:hover { background: #0e0e0e; border-left-color: #333; }
.omada-site-row.selected { background: #0d1420; border-left-color: var(--accent); }
.omada-site-info { flex: 1; min-width: 0; }
.omada-site-name {
  font-size: 14px; font-weight: 500; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.omada-site-sub { font-size: 12.5px; color: var(--muted2); margin-top: 3px; font-weight: 500; }
.omada-site-stat { font-size: 13px; color: var(--muted2); flex-shrink: 0; font-variant-numeric: tabular-nums; }

/* Omada detail */
.omada-detail { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.omada-detail-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 22px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.omada-detail-head button {
  background: transparent; border: none; color: var(--muted);
  font-size: 20px; cursor: pointer; padding: 5px 9px; border-radius: 7px;
  transition: color var(--transition), background var(--transition);
}
.omada-detail-head button:hover { color: #fff; background: #1a1a1a; }
.omada-detail-body { flex: 1; overflow-y: auto; padding: 18px 22px 28px; }

/* site meta strip */
.omada-site-meta {
  display: flex; flex-wrap: wrap; gap: 8px 28px;
  background: #080808; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 18px; margin-bottom: 20px;
}
.omada-site-meta .mi-l { font-size: 11px; text-transform: uppercase; color: var(--muted); letter-spacing: .05em; }
.omada-site-meta .mi-v { font-size: 14px; margin-top: 3px; font-weight: 500; }

/* section label */
.omada-section-label {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted); margin: 22px 0 10px;
}

/* overview cards */
.omada-overview-cards { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.omada-ov-card {
  flex: 1; min-width: 110px; border-radius: var(--radius); padding: 14px 18px;
  border: 1px solid var(--border); background: #0a0a0a; text-align: center;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  cursor: default;
}
.omada-ov-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.omada-ov-card.ov-ok   { border-color: #16a34a50; background: #041a0c; }
.omada-ov-card.ov-warn { border-color: #f0a50040; background: #160f00; }
.omada-ov-card.ov-off  { border-color: #e0413e40; background: #160404; }
.omada-ov-card.ov-neutral { border-color: var(--border); }
.ov-label {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); margin-bottom: 6px;
}
.ov-val   { font-size: 28px; font-weight: 700; line-height: 1; }
.ov-total { font-size: 16px; color: var(--muted); font-weight: 400; }
.ov-sub   { font-size: 12px; color: var(--muted2); margin-top: 5px; line-height: 1.6; font-weight: 500; }

/* device list */
.omada-dev-group { margin-bottom: 16px; }
.omada-dev-group-label {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted); margin-bottom: 7px;
}
.omada-dev-row {
  display: flex; align-items: flex-start; gap: 14px; padding: 14px 16px;
  background: #080808; border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 7px;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.omada-dev-row:hover { border-color: #333; transform: translateY(-1px); box-shadow: 0 3px 12px rgba(0,0,0,.4); }
.omada-dev-info { flex: 1; min-width: 0; }
.omada-dev-name {
  font-size: 14.5px; font-weight: 600;
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
}
.omada-dev-model { font-size: 13px; color: var(--muted2); font-weight: 500; }
.omada-dev-sub { font-size: 13px; color: var(--muted2); margin-top: 4px; line-height: 1.6; font-weight: 500; }
.omada-dev-status {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em;
  padding: 4px 10px; border-radius: 6px; flex-shrink: 0; font-weight: 700; margin-top: 2px;
}
.omada-dev-status.online  { color: var(--green); background: rgba(47,191,79,.12); }
.omada-dev-status.offline { color: var(--red);   background: rgba(224,65,62,.12); }
.omada-dev-status.pending { color: var(--amber); background: rgba(240,165,0,.12); }

/* CPU / RAM utilization bars */
.util-bars { margin-top: 8px; display: flex; flex-direction: column; gap: 5px; }
.util-row  { display: flex; align-items: center; gap: 8px; }
.util-label{ font-size: 12px; color: var(--muted2); width: 32px; flex-shrink: 0; font-weight: 600; }
.util-bar  {
  flex: 1; height: 7px; background: #1e1e1e; border-radius: 4px;
  overflow: hidden; max-width: 160px;
}
.util-fill {
  height: 100%; border-radius: 4px;
  transition: width .6s cubic-bezier(.4,0,.2,1);
}
.util-fill.util-ok  { background: var(--green); }
.util-fill.util-med { background: var(--amber); }
.util-fill.util-high{ background: var(--red);   }
.util-pct  { font-size: 12px; color: var(--muted2); width: 32px; font-weight: 600; }

/* Connected clients table */
.omada-clients-table {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  overflow: hidden; font-size: 13.5px;
}
.oct-head {
  display: grid; grid-template-columns: 2fr 1.2fr 2fr 1.1fr 1.5fr 1fr;
  background: #0e0e0e; padding: 10px 14px; color: var(--muted);
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em;
}
.oct-row  {
  display: grid; grid-template-columns: 2fr 1.2fr 2fr 1.1fr 1.5fr 1fr;
  padding: 11px 14px; border-top: 1px solid #1a1a1a; align-items: center;
  transition: background var(--transition);
}
.oct-row:hover { background: #0c0c0c; }
.oct-mono  { font-family: monospace; font-size: 13px; }
.oct-vendor{ display: block; font-size: 12px; color: var(--muted2); margin-top: 2px; font-weight: 500; }
.oct-ap    { font-size: 11.5px; color: var(--muted2); font-weight: 500; }
.oct-rssi  { font-size: 12px; color: var(--muted2); display: block; margin-top: 2px; font-weight: 500; }

/* Wi-Fi signal bars */
.sig-wrap  { display: flex; gap: 2px; align-items: flex-end; height: 16px; margin-bottom: 2px; }
.sig-bar   { width: 5px; border-radius: 1.5px; }
.sig-bar:nth-child(1) { height: 4px; }
.sig-bar:nth-child(2) { height: 8px; }
.sig-bar:nth-child(3) { height: 12px; }
.sig-bar:nth-child(4) { height: 16px; }
.sig-on  { background: var(--green); }
.sig-off { background: #2a2a2a; }

.omada-empty { padding: 20px 18px; color: var(--muted); font-size: 14px; }

@media (max-width: 760px) { .detail-charts { grid-template-columns: 1fr; } }
@media (max-width: 980px) {
  .sidebar { display: none; }
  .list-pane { width: 100%; flex: 1 1 auto; min-height: 0; }   /* scrolls inside the view */
  .panes { flex-direction: column; }
  .map-pane { height: 300px; }
  .omada-list { width: 100%; border-right: none; border-bottom: 1px solid var(--border);
                flex: 1 1 auto; min-height: 0; }
  .omada-body { flex-direction: column; }
  .oct-head, .oct-row { grid-template-columns: 2fr 1fr 2fr; }
  .oct-head span:nth-child(4),
  .oct-head span:nth-child(5),
  .oct-head span:nth-child(6),
  .oct-row  span:nth-child(4),
  .oct-row  span:nth-child(5),
  .oct-row  span:nth-child(6) { display: none; }
}

/* ---- Omada organizations (admin) ---- */
.omada-orgs-panel {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); margin: 0 16px 12px; padding: 14px 16px;
  flex-shrink: 0; max-height: 50vh; overflow-y: auto;   /* scrolls inside the Omada view */
}
.omada-orgs-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.omada-orgs-title { font-size: 14px; font-weight: 600; color: var(--text); }
.omada-org-form {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
  margin-top: 14px; padding: 18px 20px;
  background: #060606; border: 1px solid var(--border); border-radius: var(--radius);
}
.omada-org-form input {
  background: var(--panel2); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius-sm); padding: 11px 13px; font-size: 14px;
  transition: border-color var(--transition);
}
.omada-org-form input::placeholder { color: #666; }
.omada-org-form input:focus { border-color: var(--accent); outline: none; }
.omada-org-form .login-error { grid-column: 1 / -1; }
.omada-org-form .add-client-form-btns { grid-column: 1 / -1; display: flex; gap: 10px; }
.omada-org-list { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.omada-org-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--panel2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px;
}
.omada-org-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.omada-org-name { font-weight: 600; font-size: 14px; }
.omada-org-sub { font-size: 12px; color: var(--muted2); }
.omada-org-id { font-size: 11px; color: var(--muted); font-family: ui-monospace, monospace; }
.org-err { color: var(--amber); margin-left: 6px; cursor: help; }
/* projects: named groups of organizations */
.omada-proj { display: flex; flex-direction: column; gap: 8px; }
.omada-proj + .omada-proj { margin-top: 10px; }
.omada-proj-head { display: flex; align-items: baseline; gap: 12px; padding: 4px 2px 0; flex-wrap: wrap; }
.omada-proj-name {
  font-size: 13px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--text);
  background: transparent; border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 4px 6px; margin-left: -6px; min-width: 12ch; field-sizing: content; max-width: 100%;
}
.omada-proj-name:hover { border-color: var(--border); }
.omada-proj-name:focus { border-color: var(--accent); outline: none; background: var(--panel2); text-transform: none; }
.omada-proj-edit {
  background: none; border: 1px solid transparent; border-radius: var(--radius-sm); color: var(--muted2);
  font-size: 13px; padding: 2px 6px; cursor: pointer; margin-left: -8px;
}
.omada-proj-edit:hover { color: var(--text); border-color: var(--border); }
.omada-proj-none { font-size: 13px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--muted2); }
.omada-org-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.omada-org-proj { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted2); }
.omada-org-proj input {
  background: var(--panel); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius-sm); padding: 6px 8px; font-size: 13px; width: 190px;
}
.omada-org-proj input:focus { border-color: var(--accent); outline: none; }
.om-msp {
  font-size: 10px; font-weight: 700; letter-spacing: .05em; color: var(--accent);
  border: 1px solid currentColor; border-radius: 4px; padding: 0 4px; margin-left: 4px; vertical-align: 1px;
}
.omada-msp-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--muted2); padding: 2px 2px 6px;
}
.oassign-org.via { opacity: .7; cursor: default; }
.omada-org-group-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted2); padding: 12px 6px 6px; border-bottom: 1px solid var(--border);
  margin-top: 6px;
}
.omada-org-group-count { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--muted); }
@media (max-width: 700px) {
  .omada-org-form { grid-template-columns: 1fr; }
}

/* ---- Starlink plan/account switch ---- */
.account-dd { max-width: 210px; font-weight: 600; }
.group-dd { max-width: 220px; }
.area-mode-dd { max-width: 150px; }
.area-value-dd { max-width: 230px; }
#account-add-btn { white-space: nowrap; }
#account-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.8);
  display: flex; align-items: center; justify-content: center; z-index: 950; padding: 24px;
  animation: fade-in .18s ease;
}
#account-card {
  background: #0a0a0a; border: 1px solid #2a2a2a; border-radius: 14px;
  width: min(460px, 96vw); max-height: 90vh; display: flex; flex-direction: column;
  padding: 22px 24px; gap: 16px; overflow: auto;
  animation: slide-up .22s cubic-bezier(.4,0,.2,1);
}
.account-form { display: flex; flex-direction: column; gap: 12px; }
.account-form input {
  background: var(--panel2); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius-sm); padding: 11px 13px; font-size: 14px;
  transition: border-color var(--transition);
}
.account-form input::placeholder { color: #666; }
.account-form input:focus { outline: none; border-color: var(--accent); }
.account-existing { display: flex; flex-direction: column; gap: 8px; }
.account-existing-label {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); margin-top: 4px;
}
.account-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--panel2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 9px 12px; font-size: 13.5px;
}
.acct-name { font-weight: 600; }
.acct-sub { color: var(--muted); font-size: 12px; margin-left: 8px; }
.acct-primary { color: var(--muted2); font-size: 12px; font-style: italic; }

/* ---- Omada client assignment ---- */
.oassign-orgs { display: flex; flex-direction: column; gap: 8px; }
.oassign-org { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.oassign-org input { width: 16px; height: 16px; accent-color: var(--accent); }
.oassign-org .muted { font-size: 12.5px; }
/* Long project/organization lists scroll inside the dialog so the site search
   and Save/Cancel stay on screen (the card itself is capped at 90vh). */
#oassign-card > .assign-head, #oassign-card > .assign-foot { flex-shrink: 0; }
.oassign-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column;
  gap: 20px; margin-right: -10px; padding-right: 10px; }
#oassign-projects { max-height: 22vh; overflow-y: auto; padding-right: 6px; }
#oassign-orgs { max-height: 32vh; overflow-y: auto; padding-right: 6px; }
.client-omada { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.om-chip {
  font-size: 12px; background: #07131f; border: 1px solid #1d3a5c; color: #9cc3ee;
  border-radius: 6px; padding: 3px 9px; max-width: 360px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.btn-assign.btn-omada { background: #0f3a63; }
.btn-assign.btn-omada:hover { background: #134b80; }

/* ---- SLA report view ---- */
.sla-view { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.sla-controls {
  display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end;
  padding: 14px 20px; border-bottom: 1px solid var(--border); background: #050505;
}
.sla-controls label {
  display: flex; flex-direction: column; gap: 5px; font-size: 11.5px;
  text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
}
.sla-input {
  background: var(--panel2); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius-sm); padding: 8px 10px; font-size: 14px; color-scheme: dark;
}
.sla-input:focus { outline: none; border-color: #444; }
.sla-num { width: 90px; }
#sla-back { margin-left: auto; }
.sla-downloads {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 10px 20px; border-bottom: 1px solid var(--border);
}
.sla-dl-label { font-size: 12.5px; color: var(--muted); margin-right: 4px; }
.sla-downloads .icon-btn { width: auto; padding: 0 12px; font-size: 13px; }
.sla-content { flex: 1; overflow-y: auto; padding: 18px 20px 30px; }
.sla-cards { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.sla-card {
  flex: 1; min-width: 150px; background: #0a0a0a; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 18px;
}
.sla-card .ov-val { font-size: 26px; font-variant-numeric: tabular-nums; }
.sla-card.ok { border-color: #16a34a50; background: #041a0c; }
.sla-card.bad { border-color: #e0413e40; background: #160404; }
.sla-meta { font-size: 12.5px; color: var(--muted); margin-bottom: 14px; line-height: 1.6; }
.sla-tools { display: flex; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.sla-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
table.sla-table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.sla-table th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); background: #0a0a0a; padding: 10px 12px; position: sticky; top: 0;
  cursor: pointer; white-space: nowrap; user-select: none;
}
.sla-table th:hover { color: #fff; }
.sla-table td { padding: 9px 12px; border-top: 1px solid #181818; font-variant-numeric: tabular-nums; }
.sla-table tr.sla-row { cursor: pointer; }
.sla-table tr.sla-row:hover td { background: #0e0e0e; }
.sla-table tr.sla-open td { background: #0d1420; }
.sla-site-name { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sla-bar { display: flex; align-items: center; gap: 8px; min-width: 150px; }
.sla-bar-track { flex: 1; height: 6px; background: #2a0f0f; border-radius: 3px; overflow: hidden; }
.sla-bar-fill { height: 100%; background: var(--green); }
.sla-bar.fail .sla-bar-fill { background: var(--amber); }
.sla-badge {
  font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 5px; letter-spacing: .04em;
}
.sla-badge.pass { color: #4ade80; background: #052e16; }
.sla-badge.fail { color: #fca5a5; background: #3b0a0a; }
.sla-badge.live { color: #fde68a; background: #3a2a00; margin-left: 6px; }
.sla-sub td { background: #070707; padding: 12px 18px 16px; }
.sla-inc-table { border-collapse: collapse; width: 100%; font-size: 12.5px; margin-top: 6px; }
.sla-inc-table th { text-align: left; color: var(--muted); font-weight: 500; padding: 5px 8px; }
.sla-inc-table td { padding: 5px 8px; border-top: 1px solid #1a1a1a; }
.sla-empty { color: var(--muted); padding: 30px; text-align: center; }
.sla-note { font-size: 12px; color: var(--muted); margin-top: 16px; line-height: 1.6; }
.omada-sla-box {
  background: #080808; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 18px; margin-bottom: 18px;
}
.omada-sla-box .sla-kpis { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-bottom: 8px; }
.omada-sla-box .mi, .omada-site-meta .mi { display: flex; flex-direction: column; gap: 3px; }
.sla-table td { white-space: nowrap; }
.sla-table td .sla-badge.live { display: inline-block; margin: 3px 0 0 0; }
.sla-table td:first-child { white-space: normal; }
.sla-badge.nodata { color: var(--muted2); background: #1a1a1a; }

/* ---- organization filter ---- */
.omada-org-dd { max-width: 340px; }
.omada-controls { flex-wrap: wrap; }
.omada-org-group-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  cursor: pointer; transition: background var(--transition), color var(--transition);
}
.omada-org-group-head:hover { background: #0d1420; color: #fff; }
.omada-org-group-head .grp-go { font-size: 11.5px; color: var(--accent); letter-spacing: 0; text-transform: none; }
.dot.degraded { background: var(--amber); }
.omada-filter-chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px;
  background: #07131f; border: 1px solid #1d3a5c; color: #9cc3ee;
  border-radius: 999px; padding: 3px 4px 3px 10px;
}
.omada-filter-chip button {
  background: transparent; border: none; color: #9cc3ee; cursor: pointer; font-size: 14px; padding: 0 6px;
}
.sla-org-table tbody tr { cursor: pointer; }
.sla-org-table tbody tr:hover td { background: #0e0e0e; }
.sla-section-title { font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 6px 0 8px; }

/* ==== dashboards: shared visual system (tiles, charts, findings) ==== */
.viz-summary { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr); gap: 14px; margin-bottom: 14px; }
.viz-hero {
  background: linear-gradient(180deg, #0d1422 0%, #0a0a0a 100%); border: 1px solid #1d2a40;
  border-radius: 14px; padding: 20px 22px; display: flex; flex-direction: column; justify-content: center;
}
.vh-label { font-size: 12.5px; color: var(--muted2); }
.vh-row { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 6px 0 14px; }
.vh-value { font-size: 50px; line-height: 1; font-weight: 700; letter-spacing: -.02em; color: #fff; }
.vh-target { font-size: 12.5px; color: var(--muted2); margin-top: 3px; }
.viz-meter { position: relative; height: 10px; border-radius: 999px; background: #16263d; }
.viz-meter.slim { height: 6px; margin-top: 10px; }
.viz-meter .fill { height: 100%; border-radius: 999px; background: #3987e5; transition: width .5s ease; }
.viz-meter .tick { position: absolute; top: -4px; bottom: -4px; width: 2px; background: #fff; border-radius: 1px; transform: translateX(-1px); }
.viz-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 6px; }
.viz-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.viz-tiles.five { grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 14px; }
.viz-tile {
  background: #0a0a0a; border: 1px solid var(--border); border-radius: 12px; padding: 13px 15px;
  transition: border-color var(--transition), transform var(--transition);
}
.viz-tile:hover { border-color: #333; transform: translateY(-1px); }
.viz-tile.alert { border-color: rgba(208,59,59,.45); background: #150808; }
.vt-label { font-size: 12px; color: var(--muted2); display: flex; align-items: center; gap: 7px; }
.vt-value { font-size: 25px; font-weight: 700; line-height: 1.2; margin-top: 3px; color: #fff; }
.vt-value span { font-size: 14px; color: var(--muted); font-weight: 500; }
.vt-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.viz-delta { font-size: 12px; font-weight: 650; margin-top: 6px; }
.viz-delta span { font-weight: 400; color: var(--muted); }
.viz-delta.up { color: #37c837; } .viz-delta.down { color: #ff6b6b; }
.st-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; }
.st-dot.good { background: #0ca30c; } .st-dot.warn { background: #fab219; } .st-dot.crit { background: #d03b3b; }

.viz-findings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.viz-finding {
  display: flex; gap: 12px; align-items: flex-start; background: #0a0a0a; border: 1px solid var(--border);
  border-radius: 12px; padding: 13px 15px;
}
.viz-finding p { margin: 3px 0 0; font-size: 13px; color: var(--muted2); line-height: 1.5; }
.vf-title { font-weight: 650; font-size: 14px; color: #fff; }
.st-chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 650;
  border: 1px solid #2a2a2a; border-radius: 999px; padding: 2px 9px 2px 3px; color: #e6e6e6; background: #111;
  white-space: nowrap;
}
.st-chip b { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; color: #fff; font-size: 11px; }
.st-chip.crit b { background: #d03b3b; } .st-chip.warn b { background: #c98500; }
.st-chip.info b { background: #2a78d6; } .st-chip.good b { background: #0ca30c; }

.viz-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.viz-card { background: #0a0a0a; border: 1px solid var(--border); border-radius: 14px; padding: 15px 17px 12px; min-width: 0; }
.viz-card.wide { grid-column: 1 / -1; }
.vc-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.vc-title { font-size: 13.5px; font-weight: 650; color: #fff; }
.vc-sub { font-size: 12px; color: var(--muted); }
.vc-sub b { color: #fff; }
.vc-body { position: relative; height: 230px; }
.vc-body.short { height: 170px; }
.vc-foot { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.viz-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted2); }
.viz-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.viz-legend i.ln { width: 16px; height: 3px; border-radius: 2px; vertical-align: 3px; }

.sla-bar-track { position: relative; overflow: visible; }
.sla-bar-tick { position: absolute; top: -3px; bottom: -3px; width: 2px; background: #ddd; transform: translateX(-1px); border-radius: 1px; }
.sla-bar .sla-bar-fill { background: #3987e5; }
.sla-bar-track { background: #16263d; }
.sla-more { font-size: 12.5px; color: var(--muted); padding: 10px 4px; }
.sla-dl-status { font-size: 12.5px; color: var(--muted2); margin-left: 6px; }
.sla-downloads .icon-btn:disabled { opacity: .45; cursor: progress; }

/* ---- Omada overview pane ---- */
.omada-overview { flex: 1; overflow-y: auto; padding: 18px 22px 30px; min-width: 0; }
.ov-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.ov-eyebrow { font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; color: #3987e5; font-weight: 650; }
.ov-title { font-size: 22px; font-weight: 700; color: #fff; margin-top: 2px; }
.ov-head .icon-btn { width: auto; padding: 0 14px; font-size: 13px; }
.ov-down { display: flex; flex-direction: column; }
.ov-down-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-bottom: 1px solid #161616;
  cursor: pointer; border-radius: 6px; font-size: 13px;
}
.ov-down-row:hover { background: #111; }
.ov-down-row .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #e8e8e8; }
.ov-down-row .org { font-size: 11.5px; color: var(--muted2); background: #141414; border: 1px solid #222; border-radius: 6px; padding: 1px 7px; }
.ov-down-row .ago { font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ov-more { font-size: 12.5px; color: #6aa8f0; padding: 10px 6px 2px; cursor: pointer; }
.ov-more:hover { text-decoration: underline; }

@media (max-width: 1100px) {
  .viz-summary { grid-template-columns: 1fr; }
  .viz-tiles.five { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .viz-grid, .viz-findings { grid-template-columns: 1fr; }
  .viz-tiles, .viz-tiles.five { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .omada-overview { display: none; }
}

/* ---- SLA coverage (service hours) ---- */
.sla-cov-custom { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.sla-cov-custom input[type=time] { width: 138px; }
.cov-days { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; height: 36px; }
.cov-days button {
  background: var(--panel2); color: var(--muted); border: 0; border-right: 1px solid var(--border);
  padding: 0 10px; font-size: 12.5px; cursor: pointer; transition: background var(--transition), color var(--transition);
}
.cov-days button:last-child { border-right: 0; }
.cov-days button.on { background: #12305a; color: #fff; }
.cov-days button:hover { color: #fff; }
.sla-cov-save { width: auto; padding: 0 12px; font-size: 12.5px; }
.cov-pill {
  display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px;
  background: #1a1a1a; color: var(--muted2); border: 1px solid #2a2a2a; margin-left: 6px; vertical-align: 1px;
  text-transform: none; letter-spacing: 0;
}
.cov-pill.on { background: #0f2747; color: #9cc3ee; border-color: #1d3a5c; }

/* ---- top-bar guide button ---- */
.docs-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; margin-right: 12px;
  border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 13.5px; text-decoration: none;
  background: #0a0a0a; transition: border-color var(--transition), background var(--transition);
}
.docs-btn svg { width: 16px; height: 16px; }
.docs-btn:hover { border-color: #3987e5; background: #0b1422; }
@media (max-width: 760px) { .docs-btn { font-size: 0; gap: 0; padding: 0 9px; } .docs-btn svg { width: 18px; height: 18px; } }
/* features / guide buttons as one group; labels shorten, then go icon-only */
.docs-links { display: flex; align-items: center; gap: 8px; margin-right: 12px; }
.docs-links .docs-btn { margin-right: 0; }
@media (max-width: 1360px) { .docs-btn .dl-nms { display: none; } }
@media (max-width: 1100px) { .docs-btn { font-size: 0; gap: 0; padding: 0 9px; } .docs-btn svg { width: 18px; height: 18px; } }
@media (max-width: 760px) { .docs-links { gap: 6px; margin-right: 0; } }

/* ---- in-page confirm / notice dialog ---- */
#ui-dialog {
  position: fixed; inset: 0; background: rgba(0,0,0,.72); z-index: 1200;
  display: flex; align-items: center; justify-content: center; padding: 24px; animation: fade-in .15s ease;
}
#ui-dialog-card {
  background: #0c0c0c; border: 1px solid #2a2a2a; border-radius: 14px; width: min(460px, 94vw);
  padding: 22px 24px 18px; box-shadow: 0 18px 60px rgba(0,0,0,.6); animation: slide-up .18s cubic-bezier(.4,0,.2,1);
}
.ui-dialog-title { font-size: 17px; font-weight: 700; color: #fff; margin-bottom: 8px; }
.ui-dialog-msg { font-size: 14px; color: var(--muted2); line-height: 1.55; white-space: pre-line; }
.ui-dialog-btns { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
#ui-dialog-ok.danger { background: var(--red); }
#ui-dialog-ok.danger:hover { background: #c7302d; }

/* ---- per-site SLA reports ---- */
.sla-site-box { position: relative; display: inline-flex; }
.sla-site-input { width: 300px; padding-right: 30px; }
.sla-site-clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: transparent;
  border: 0; color: var(--muted); cursor: pointer; font-size: 13px; }
.sla-site-clear:hover { color: #fff; }
.site-report-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap;
  margin-bottom: 14px; }
.site-facts-ui { display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 13px; color: #e0e0e0; margin-top: 6px; }
.site-facts-ui b { color: var(--muted); font-weight: 500; margin-right: 5px; }
.site-report-actions { display: flex; gap: 8px; }
.site-report-actions .icon-btn, .sub-actions .icon-btn, .site-sla-btn { width: auto; padding: 0 12px; font-size: 13px; }
.sub-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.sub-actions .btn-add-client { padding: 7px 14px; font-size: 13px; }
.site-sla-btn { float: right; margin: -4px 0 6px 10px; }
@media (max-width: 760px) { .sla-site-input { width: 220px; } }

/* ---- navigation labels + client account sections ---- */
.side-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: #6f6f6f; padding: 14px 16px 6px; }
.side-label:first-child { padding-top: 4px; }
.acct-block { margin-top: 26px; padding-top: 4px; }
.acct-block-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.acct-block-head .acct-section { margin: 0; display: flex; align-items: center; gap: 10px; }
.acct-ic { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: #111;
  border: 1px solid var(--border); }
.acct-ic svg { width: 17px; height: 17px; }
.acct-btns { display: flex; gap: 8px; }
.acct-open { width: auto; padding: 0 13px; font-size: 13px; }
.acct-omada-stats { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 14px; margin-bottom: 12px; }
.acct-omada-stats > span { display: inline-flex; align-items: center; gap: 7px; }
.acct-sites { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.acct-site { display: flex; align-items: center; gap: 10px; background: #0a0a0a; border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px; cursor: pointer; font-size: 13.5px;
  transition: border-color var(--transition), background var(--transition); }
.acct-site:hover { border-color: #333; background: #0e0e0e; }
.acct-site .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-site .cnt { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---- edit login ---- */
#cred-card, #wifi-card {
  background: #0a0a0a; border: 1px solid #2a2a2a; border-radius: 14px; width: min(480px, 96vw);
  padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; animation: slide-up .22s cubic-bezier(.4,0,.2,1);
}
#cred-card .assign-head button, #wifi-card .assign-head button { background: transparent; border: 0; color: var(--muted); font-size: 18px; cursor: pointer; }
.cred-sub { font-size: 13.5px; color: var(--muted2); margin-top: -6px; }
.cred-field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--muted2); font-weight: 600; }
.cred-req { font-weight: 400; color: var(--muted); font-size: 11.5px; }
.cred-field input {
  background: var(--panel2); border: 1px solid var(--border); color: var(--text); border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 14.5px; width: 100%;
}
.cred-field input:focus { outline: none; border-color: #444; }
.cred-pw { position: relative; display: block; }
.cred-pw input { padding-right: 58px; }
.cred-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: transparent; border: 0;
  color: var(--muted); font-size: 12px; cursor: pointer; padding: 4px 6px; }
.cred-eye:hover { color: #fff; }
.cred-note { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.btn-edit-login {
  background: transparent; color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 9px 14px; cursor: pointer; font-size: 13.5px; transition: border-color var(--transition);
}
.btn-edit-login:hover { border-color: #555; }
.my-login { display: flex; align-items: center; gap: 12px; background: #0a0a0a; border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 16px; max-width: 900px; margin: 18px 0 6px; }
.my-login .ml-label { font-size: 12px; color: var(--muted); }
.my-login .ml-name { font-size: 15px; font-weight: 650; }
.my-login > div { flex: 1; }
.my-login .icon-btn { width: auto; padding: 0 13px; font-size: 13px; }
.client-actions { flex-wrap: wrap; justify-content: flex-end; }

/* =====================================================================
   NEON THEME — Tailwind palette (slate surfaces; sky / emerald / amber /
   rose / orange accents). One layer on top of the base styles so every
   page shares the same glassy cards, soft glow accents and controls.
   ===================================================================== */
:root {
  --bg: #030712; --panel: #0b1120; --panel2: #0f172a; --border: #1e293b;
  --text: #e2e8f0; --muted: #94a3b8; --muted2: #cbd5e1;
  --green: #34d399; --red: #f43f5e; --amber: #fbbf24; --gray: #64748b; --accent: #2563eb;
  --sky: #38bdf8; --glass: linear-gradient(180deg, rgba(15,23,42,.72), rgba(2,6,23,.78));
  --glass-border: rgba(148,163,184,.14); --glow-sky: 0 0 0 1px rgba(56,189,248,.06), 0 10px 26px -16px rgba(56,189,248,.28);
  --radius: 14px; --radius-sm: 9px;
}
body {
  background:
    radial-gradient(1100px 560px at 85% -12%, rgba(56,189,248,.045), transparent 60%),
    radial-gradient(900px 520px at -12% 112%, rgba(244,63,94,.03), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
.topnav { background: rgba(3,7,18,.82); backdrop-filter: blur(10px); border-bottom: 1px solid var(--glass-border); }
.topnav-links a.active { border-bottom-color: var(--sky); }
.sidebar { background: rgba(3,7,18,.55); border-right: 1px solid var(--glass-border); }
.side-item { border-radius: 10px; }
.side-item:hover { background: rgba(148,163,184,.07); }
.side-item.active { background: linear-gradient(90deg, rgba(56,189,248,.11), rgba(56,189,248,.01)); color: #fff;
  box-shadow: inset 2px 0 0 var(--sky); }
.side-item.active .si-ic { color: var(--sky); }
.sitefooter { background: rgba(3,7,18,.8); border-top-color: var(--glass-border); }

/* cards / panels */
.viz-card, .viz-tile, .viz-finding, .omada-sla-box, .client-row, .my-login, .acct-site, .add-client-form,
.omada-site-meta, .omada-ov-card.ov-neutral, .omada-dev-row, .home-card, .donut-card {
  background: var(--glass); border: 1px solid var(--glass-border); border-radius: 16px;
}
.viz-card:hover, .viz-tile:hover, .client-row:hover, .acct-site:hover, .home-card:hover, .donut-card:hover {
  border-color: rgba(56,189,248,.24); box-shadow: var(--glow-sky);
}
.viz-hero {
  background: radial-gradient(420px 220px at 18% 0%, rgba(56,189,248,.08), transparent 70%), var(--glass);
  border: 1px solid rgba(56,189,248,.2); border-radius: 18px; box-shadow: 0 0 32px -22px rgba(56,189,248,.4);
}
.vh-value { text-shadow: 0 0 18px rgba(56,189,248,.14); }
.viz-meter { background: rgba(56,189,248,.12); }
.viz-meter .fill { background: linear-gradient(90deg, #0ea5e9, #38bdf8); box-shadow: 0 0 6px rgba(56,189,248,.3); }
.viz-meter .tick { background: #f8fafc; box-shadow: 0 0 4px rgba(248,250,252,.3); }
.viz-tile.alert { border-color: rgba(244,63,94,.38); box-shadow: 0 0 24px -16px rgba(244,63,94,.4);
  background: linear-gradient(180deg, rgba(76,5,25,.38), rgba(2,6,23,.78)); }
.viz-delta.up { color: #34d399; } .viz-delta.down { color: #fb7185; }

/* status: a faint halo per colour; icon + label always present */
.st-dot.good, .dot.online { background: #34d399; box-shadow: 0 0 4px rgba(52,211,153,.4); }
.st-dot.warn, .dot.degraded, .dot.pending { background: #fbbf24; box-shadow: 0 0 4px rgba(251,191,36,.38); }
.st-dot.crit, .dot.offline { background: #f43f5e; box-shadow: 0 0 4px rgba(244,63,94,.38); }
.dot.inactive, .dot.unknown { background: #64748b; }
.st-chip { background: rgba(15,23,42,.85); border-color: var(--glass-border); }
.st-chip.crit b { background: #f43f5e; box-shadow: 0 0 5px rgba(244,63,94,.28); }
.st-chip.warn b { background: #f59e0b; box-shadow: 0 0 5px rgba(251,191,36,.26); }
.st-chip.info b { background: #0ea5e9; box-shadow: 0 0 5px rgba(56,189,248,.26); }
.st-chip.good b { background: #10b981; box-shadow: 0 0 5px rgba(52,211,153,.26); }
.omada-ov-card.ov-ok   { border-color: rgba(52,211,153,.4); background: linear-gradient(180deg, rgba(6,78,59,.28), rgba(2,6,23,.7)); }
.omada-ov-card.ov-warn { border-color: rgba(251,191,36,.4); background: linear-gradient(180deg, rgba(120,53,15,.26), rgba(2,6,23,.7)); }
.omada-ov-card.ov-off  { border-color: rgba(244,63,94,.4); background: linear-gradient(180deg, rgba(76,5,25,.32), rgba(2,6,23,.7)); }
.sla-bar-track { background: rgba(56,189,248,.12); }
.sla-bar .sla-bar-fill { background: linear-gradient(90deg, #0ea5e9, #38bdf8); box-shadow: 0 0 4px rgba(56,189,248,.25); }
.sla-badge.pass { color: #6ee7b7; background: rgba(16,185,129,.12); border: 1px solid rgba(52,211,153,.35); }
.sla-badge.fail { color: #fda4af; background: rgba(244,63,94,.12); border: 1px solid rgba(244,63,94,.35); }
.sla-badge.live { color: #fde68a; background: rgba(251,191,36,.12); border: 1px solid rgba(251,191,36,.35); }
.cov-pill.on { background: rgba(56,189,248,.12); color: #bae6fd; border-color: rgba(56,189,248,.4); }
.om-chip { background: rgba(56,189,248,.08); border-color: rgba(56,189,248,.3); color: #bae6fd; }

/* controls */
.btn-add-client, .btn-assign, .assign-save-btn, .add-client-submit, #login-form button {
  background: linear-gradient(180deg, #3b82f6, #2563eb); color: #fff; border: 0;
  box-shadow: 0 0 0 1px rgba(96,165,250,.2), 0 6px 16px -10px rgba(37,99,235,.5);
}
.btn-add-client:hover, .btn-assign:hover, .assign-save-btn:hover, .add-client-submit:hover, #login-form button:hover {
  background: linear-gradient(180deg, #60a5fa, #3b82f6);
}
.btn-assign.btn-omada { background: rgba(56,189,248,.10); color: #bae6fd; box-shadow: none; border: 1px solid rgba(56,189,248,.35); }
.btn-assign.btn-omada:hover { background: rgba(56,189,248,.18); }
.btn-edit-login, .icon-btn, .assign-cancel-btn, .add-client-cancel, .docs-btn, .logout {
  background: rgba(15,23,42,.72); border: 1px solid var(--glass-border); color: var(--text);
}
.btn-edit-login:hover, .icon-btn:hover, .assign-cancel-btn:hover, .add-client-cancel:hover, .docs-btn:hover, .logout:hover {
  border-color: rgba(56,189,248,.4); box-shadow: 0 0 10px -4px rgba(56,189,248,.22); color: #fff;
}
.btn-del { border-color: rgba(244,63,94,.35); color: #fb7185; background: rgba(244,63,94,.05); }
.btn-del:hover { border-color: #f43f5e; background: rgba(244,63,94,.12); box-shadow: 0 0 10px -4px rgba(244,63,94,.3); }
.search, .status-dd, .sla-input, .assign-search, .cred-field input, .add-client-form input, #login-form input {
  background: rgba(15,23,42,.82); border: 1px solid var(--glass-border); color: var(--text);
}
.search:focus, .status-dd:focus, .sla-input:focus, .assign-search:focus, .cred-field input:focus,
.add-client-form input:focus, #login-form input:focus {
  outline: none; border-color: rgba(56,189,248,.6); box-shadow: 0 0 0 3px rgba(56,189,248,.15);
}
.cov-days { border-color: var(--glass-border); }
.cov-days button { background: rgba(15,23,42,.82); border-right-color: var(--glass-border); }
.cov-days button.on { background: rgba(56,189,248,.18); color: #e0f2fe; box-shadow: inset 0 -2px 0 var(--sky); }

/* dialogs */
#assign-card, #oassign-card, #cred-card, #wifi-card, #ui-dialog-card, #account-card, #login-form {
  background: linear-gradient(180deg, #0f172a, #020617); border: 1px solid rgba(148,163,184,.18);
  box-shadow: 0 30px 80px -24px rgba(0,0,0,.85), 0 0 0 1px rgba(56,189,248,.06);
}

/* lists & tables */
.omada-list { background: rgba(2,6,23,.55); border-right-color: var(--glass-border); }
.omada-site-row { border-bottom-color: rgba(148,163,184,.07); }
.omada-site-row:hover { background: rgba(56,189,248,.05); border-left-color: rgba(56,189,248,.3); }
.omada-site-row.selected { background: rgba(56,189,248,.10); border-left-color: var(--sky); }
.omada-org-group-head { color: #cbd5e1; border-bottom-color: var(--glass-border); }
.omada-org-group-head:hover { background: rgba(56,189,248,.06); }
.sla-table-wrap { border-color: var(--glass-border); border-radius: 14px; background: rgba(2,6,23,.45); }
.sla-table th { background: rgba(15,23,42,.9); color: #94a3b8; }
.sla-table td { border-top-color: rgba(148,163,184,.08); }
.sla-table tr.sla-row:hover td, .sla-org-table tbody tr:hover td { background: rgba(56,189,248,.05); }
.sla-table tr.sla-open td { background: rgba(56,189,248,.09); }
.sla-controls, .sla-downloads, .omada-bar, .controlbar { border-bottom-color: var(--glass-border); }
.sla-controls { background: rgba(2,6,23,.5); }
.ov-down-row { border-bottom-color: rgba(148,163,184,.07); }
.ov-down-row:hover { background: rgba(244,63,94,.06); }
.ov-eyebrow { color: var(--sky); text-shadow: 0 0 10px rgba(56,189,248,.18); }

/* donut grid ("Site status by organization") */
.donut-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 12px; }
.donut-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 10px 12px;
  cursor: pointer; transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition); }
.donut-card:hover { transform: translateY(-2px); }
.donut-card:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }
.donut-card.total { grid-column: span 2; flex-direction: row; justify-content: center; gap: 18px; cursor: default;
  border-color: rgba(56,189,248,.28); background: radial-gradient(260px 140px at 30% 50%, rgba(56,189,248,.06), transparent 70%), var(--glass); }
.donut-card.total:hover { transform: none; }
.donut-card.total .donut-name { font-size: 15px; }
.donut-meta { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.donut-card.total .donut-meta { align-items: flex-start; }
.donut-foot { font-size: 12px; color: var(--muted); }
.donut { display: block; overflow: visible; }
.donut-top { fill: #f8fafc; font-size: 22px; font-weight: 750; }
.donut-sub { fill: #94a3b8; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; }
.donut-name { font-size: 13px; font-weight: 650; color: #f1f5f9; text-align: center; }
.donut-counts { display: flex; gap: 10px; font-size: 12px; font-variant-numeric: tabular-nums; }
.donut-counts .g { color: #6ee7b7; } .donut-counts .w { color: #fcd34d; } .donut-counts .c { color: #fda4af; }
@media (max-width: 760px) { .donut-card.total { grid-column: 1 / -1; } }

/* ---- iOne NMS brand ---- */
.brand { letter-spacing: .02em; font-size: 21px; display: inline-flex; align-items: baseline; gap: 7px; }
.brand .b1, .login-brand .b1, .foot-legal .b1 { color: #f8fafc; font-weight: 800; }
.brand .b2, .login-brand .b2, .foot-legal .b2 { color: var(--sky); font-weight: 800; letter-spacing: .14em; }
.login-brand { letter-spacing: .02em; font-size: 30px; display: flex; justify-content: center; align-items: baseline;
  gap: 9px; margin-bottom: 2px; }
.login-sub { text-align: center; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted);
  margin-bottom: 18px; }
.foot-legal { color: #64748b; }

/* ---- download buttons: soft green so they're easy to spot, not loud ---- */
#sla-downloads [data-fmt], .sub-actions [data-act="html"], .sub-actions [data-act="xlsx"],
#dl-btn, .detail-actions #detail-csv {
  background: rgba(16,185,129,.10); border: 1px solid rgba(52,211,153,.42); color: #a7f3d0;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
#sla-downloads [data-fmt]:hover, .sub-actions [data-act="html"]:hover, .sub-actions [data-act="xlsx"]:hover,
#dl-btn:hover, .detail-actions #detail-csv:hover {
  background: rgba(16,185,129,.20); border-color: #34d399; color: #ecfdf5; box-shadow: none;
}
#sla-downloads [data-fmt="xlsx"] { background: rgba(16,185,129,.18); color: #d1fae5; }  /* the main download */
#sla-downloads [data-fmt]:disabled { opacity: .5; }
.sla-dl-label { color: #6ee7b7; font-weight: 600; }

/* ---- long lists stay fast ----
   The Omada site list renders 50 sites at a time; this footer counts them
   ("Showing 50 of 3,453 sites") and loads more. Status dots in long lists
   don't pulse: one animation per row repaints the whole list every frame. */
.omada-list-foot {
  position: sticky; bottom: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 10px 18px; font-size: 12.5px; color: var(--muted);
  border-top: 1px solid var(--glass-border); background: var(--bg);
}
.omada-list-more {
  background: rgba(15,23,42,.72); border: 1px solid var(--glass-border); color: #bae6fd;
  border-radius: 8px; padding: 4px 10px; font-size: 12px; cursor: pointer;
}
.omada-list-more:hover { border-color: rgba(56,189,248,.4); color: #fff; }
.omada-list .dot::after, #lines-body .dot::after { content: none; }

/* ---- SLA exclusions dialog ---- */
#excl-overlay, #lots-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.8); display: flex; align-items: center;
  justify-content: center; z-index: 950; padding: 24px; animation: fade-in .18s ease;
}
#excl-card, #lots-card {
  background: linear-gradient(180deg, #0f172a, #020617); border: 1px solid rgba(148,163,184,.18);
  border-radius: 14px; width: min(860px, 96vw); max-height: 90vh; overflow-y: auto;
  padding: 22px 24px; display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 30px 80px -24px rgba(0,0,0,.85); animation: slide-up .22s cubic-bezier(.4,0,.2,1);
}
#excl-card .assign-head button, #lots-card .assign-head button { background: transparent; border: 0; color: var(--muted); font-size: 18px; cursor: pointer; }
#excl-form { display: flex; flex-direction: column; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--glass-border); }
.excl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.excl-dt { display: flex; gap: 8px; }
.excl-dt input[type="date"] { flex: 1.4; } .excl-dt input[type="time"] { flex: 1; }
#excl-card input, #excl-card select, #lots-card input {
  background: rgba(15,23,42,.82); border: 1px solid var(--glass-border); color: var(--text);
  border-radius: var(--radius-sm); padding: 9px 11px; font-size: 14px; width: 100%; color-scheme: dark;
}
.excl-table { width: 100%; }
.excl-table td { vertical-align: top; }
@media (max-width: 640px) { .excl-grid { grid-template-columns: 1fr; } }
.sla-excl-link { color: #7dd3fc; text-decoration: none; }
.sla-excl-link:hover { text-decoration: underline; }

.lots-upload { display: flex; flex-direction: column; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid var(--glass-border); }
.excl-table .sla-badge { white-space: nowrap; }
.status-dd:disabled { opacity: .45; cursor: not-allowed; }

/* ---- daily data usage (Starlink /data-usage/query) ---- */
.usage-btn { font-size: 13px; font-weight: 600; white-space: nowrap; }
.chart-card.wide { grid-column: 1 / -1; height: 230px; }
.chart-card.usage-card.empty { height: auto; }
.usage-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.usage-title-r { font-weight: 500; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 10px; }
.usage-link {
  background: none; border: 1px solid var(--border); color: var(--muted2); border-radius: 8px;
  padding: 2px 9px; font: inherit; font-size: 11.5px; cursor: pointer;
}
.usage-link:hover { color: #fff; border-color: #444; }
.usage-empty { color: var(--muted); font-size: 13px; padding: 6px 0 2px; }
.usage-tiles { margin-bottom: 14px; }
.usage-top-title { margin: 2px 0 8px; }
.usage-sln { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.usage-table td { white-space: nowrap; }
@media (max-width: 760px) { .usage-tiles { grid-template-columns: 1fr; } }
.usage-table .sla-site-name { max-width: 300px; }

/* ---- devices: STARLINK > WIFI xxxxxx (device_actions.py) ---- */
.dev-card {
  background: var(--panel2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px 14px; margin-bottom: 20px;
}
.dev-empty { color: var(--muted); font-size: 13px; padding: 4px 0; }
.dev-grid { display: grid; grid-template-columns: minmax(190px, 240px) 1fr; gap: 14px; }
.dev-tree { display: flex; flex-direction: column; gap: 6px; }
.dev-children { margin: 4px 0 0 17px; padding-left: 12px; border-left: 1px solid var(--glass-border); display: flex; flex-direction: column; gap: 4px; }
.dev-node {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; cursor: pointer;
  background: transparent; border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 8px 10px; color: var(--text); font: inherit;
  transition: background var(--transition), border-color var(--transition);
}
.dev-node:hover { background: rgba(148,163,184,.06); }
.dev-node.selected { background: rgba(56,189,248,.10); border-color: rgba(56,189,248,.35); }
.dev-ic { width: 20px; height: 20px; flex-shrink: 0; color: var(--sky); display: inline-flex; }
.dev-ic svg { width: 100%; height: 100%; }
.dev-nm { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dev-label { font-weight: 700; font-size: 13.5px; letter-spacing: .04em; }
.dev-sub { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dev-info { min-width: 0; }
.dev-info-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.dev-info-head b { font-size: 15px; letter-spacing: .04em; }
.dev-acts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.dev-act {
  background: transparent; color: var(--muted2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 7px 13px; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.dev-act:hover { border-color: var(--sky); color: #fff; background: rgba(56,189,248,.08); }
.dev-meta .dot { margin-right: 6px; }
.dev-meta { margin-bottom: 0; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.dev-log { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--glass-border); font-size: 12.5px; }
.dev-log-title { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; margin-bottom: 6px; }
.dal-block { margin-bottom: 26px; }
.dal-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.dal-head .status-dd { min-width: 160px; }
.dal-wrap { overflow-x: auto; }
.dal-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.dal-table th { text-align: left; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  font-weight: 600; padding: 6px 10px 6px 0; border-bottom: 1px solid var(--glass-border); white-space: nowrap; }
.dal-table td { padding: 7px 10px 7px 0; border-bottom: 1px solid rgba(148,163,184,.07); vertical-align: top; color: var(--muted2); }
.dal-ts { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--muted); }
.dal-detail { min-width: 220px; max-width: 520px; }
.dal-st { font-weight: 700; white-space: nowrap; }
.dal-sent .dal-st { color: var(--green); }
.dal-failed .dal-st, .dal-denied .dal-st { color: var(--red); }
.dal-pending .dal-st { color: var(--amber); }
@media (max-width: 760px) {
  .dev-grid { grid-template-columns: 1fr; }
}
a.icon-btn { text-decoration: none; }
.client-role { display: inline-flex; align-items: center; gap: 8px; margin-left: 12px; font-size: 12px; color: var(--muted); font-weight: 600; }
.client-role .role-select { padding: 4px 8px; font-size: 13px; min-width: 150px; }
.dal-done .dal-st { color: var(--sky); }

/* ==== Phones (760 px and narrower) ===========================================
   The page is fixed to the screen, so each area scrolls inside itself. Before
   this, the top bar forced the page wider than the phone (it zoomed out to
   514-670 px) and the admin's service-line list made the page 53,000 px tall. */
@media (max-width: 760px) {
  /* top bar: brand + logout on one row, the tabs across the screen below */
  .topnav { flex-wrap: wrap; height: auto; gap: 0 10px; padding: 8px 14px 0; }
  .brand { font-size: 17px; }
  .topnav-right { gap: 8px; }
  .avatar { display: none; }
  .logout { padding: 5px 10px; font-size: 12.5px; }
  .topnav-links { order: 3; flex: 1 0 100%; gap: 0; justify-content: space-around; }
  .topnav-links a { padding: 10px 8px 9px; font-size: 12.5px; letter-spacing: .06em; }

  /* login card: keep a margin at the screen edges */
  #login-form, #register-form { width: min(400px, calc(100vw - 28px)); padding: 30px 22px 24px; }

  /* footer: one thin line */
  .sitefooter { padding: 5px 14px; }
  .foot-legal { font-size: 11px; }

  /* dialogs: use the whole width */
  #assign-overlay, #oassign-overlay, #cred-overlay, #wifi-overlay, #ui-dialog, #account-overlay { padding: 10px; }
  #cred-card, #wifi-card, #assign-card, #oassign-card { padding: 18px 16px; }

  /* Starlink dashboard: filters in one swipeable row, map on top, list below */
  .controlbar { flex-wrap: nowrap; overflow-x: auto; gap: 8px; padding: 8px 12px; scrollbar-width: none; }
  .controlbar::-webkit-scrollbar { display: none; }
  .controlbar > * { flex-shrink: 0; }
  .controlbar .search { flex: 0 0 210px; min-width: 0; padding: 9px 12px; }
  .pill { padding: 7px 11px; font-size: 13px; }
  .map-pane { order: -1; flex: none; height: 34vh; min-height: 190px; }
  .list-pane { flex: 1; min-height: 0; width: 100%; border-right: 0; }
  .list-head { padding: 9px 14px; }
  .list-foot { padding: 8px 14px; }
  .sl-item { padding: 11px 14px; }
  .sl-name { max-width: calc(100vw - 110px); font-size: 14.5px; }

  /* a line's details and the daily usage open as a full-screen sheet (✕ closes) */
  .detail-pane { position: fixed; inset: 0; z-index: 900; border-left: 0; }
  .detail-head { flex-wrap: wrap; gap: 10px; padding: 12px 14px; }
  .detail-head > div:first-child { flex: 1 1 100%; min-width: 0; }
  .detail-title { font-size: 17px; flex-wrap: wrap; }
  .detail-actions { justify-content: flex-start; }
  .detail-pane-body { padding: 14px 12px 24px; }
  .detail-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .mi { padding: 9px 11px; }
  .dev-card { padding: 10px 12px 12px; }
  .dev-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dev-acts { margin-left: 0; width: 100%; }
  .dev-act { flex: 1 1 auto; }
  .chart-card.wide { height: 210px; }

  /* Account */
  .home-inner { padding: 22px 14px 28px; }
  .home-title { font-size: 30px; }
  .home-acct { margin-bottom: 18px; font-size: 13px; }
  .home-globe-clip { display: none; }
  .home-card { padding: 12px 14px; gap: 12px; }
  .client-row { flex-direction: column; padding: 14px; gap: 12px; }
  .client-actions { width: 100%; justify-content: flex-start; }
  .client-role { display: flex; margin: 8px 0 0; }
  .client-email { margin-left: 6px; }
  .my-login { flex-wrap: wrap; }
  .dal-head .status-dd { flex: 1 1 140px; min-width: 0; }

  /* Omada: stats + one swipeable control row; site list fills the screen,
     a site's details open as a full-screen sheet */
  .omada-bar { padding: 8px 12px; gap: 8px; }
  .omada-stats { gap: 4px 14px; }
  .omada-stat { font-size: 12.5px; }
  .omada-controls { margin-left: 0; width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .omada-controls::-webkit-scrollbar { display: none; }
  .omada-controls > * { flex-shrink: 0; }
  .omada-list { border-bottom: 0; }
  .omada-detail { position: fixed; inset: 0; z-index: 900; background: var(--bg); }
  .omada-detail-head { padding: 12px 14px; }
  .omada-detail-body { padding: 14px 12px 24px; }
  .omada-orgs-panel { margin: 0 10px 8px; max-height: 45vh; }
  .omada-org-row { flex-wrap: wrap; }
  .omada-org-actions { width: 100%; justify-content: space-between; }
  .omada-org-proj input { width: 100%; }
  .omada-org-proj { flex: 1; }
  .omada-org-id { word-break: break-all; }

  /* SLA report: the controls are tall on a phone, so the whole view scrolls */
  .sla-view { overflow-y: auto; }
  .sla-content { flex: none; overflow: visible; padding: 14px 12px 24px; }
  .sla-controls { padding: 10px 12px; gap: 10px 12px; }
  .sla-site-wrap, .sla-site-box, .sla-site-input { width: 100%; }
  #sla-back { margin-left: 0; }
  .sla-downloads { padding: 8px 12px; }
}

/* ---- Starlink reports (starlink_reports.py): Wi-Fi clients, online time, performance, usage ---- */
.rep-tabs {
  display: flex; gap: 4px; padding: 10px 22px 0; border-bottom: 1px solid var(--glass-border, var(--border));
  flex-shrink: 0; overflow-x: auto; scrollbar-width: none;
}
.rep-tabs::-webkit-scrollbar { display: none; }
.rep-tabs button {
  background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted);
  font: inherit; font-size: 14px; font-weight: 600; padding: 8px 12px 10px; cursor: pointer; white-space: nowrap;
  transition: color var(--transition), border-color var(--transition);
}
.rep-tabs button:hover { color: var(--text); }
.rep-tabs button.active { color: #fff; border-bottom-color: var(--sky, var(--accent)); }
.rep-nav { display: inline-flex; align-items: center; gap: 6px; }
.rep-nav[hidden], .rep-custom[hidden] { display: none; }
.detail-actions .rep-nav button { padding: 6px 11px; font-size: 16px; line-height: 1; }
.detail-actions .rep-nav button:disabled { opacity: .35; cursor: default; transform: none; }
.rep-label { min-width: 150px; text-align: center; font-size: 13.5px; font-weight: 600; color: var(--text); white-space: nowrap; }
.rep-custom { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.rep-custom input {
  background: var(--panel2); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 7px 9px; font: inherit; font-size: 13px; color-scheme: dark;
}
.viz-tiles.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rep-note {
  border: 1px solid rgba(56,189,248,.28); background: rgba(56,189,248,.06); color: var(--muted2);
  border-radius: 10px; padding: 9px 13px; font-size: 13px; margin-bottom: 12px;
}
#rep-body { transition: opacity var(--transition); }
#rep-body.rep-loading { opacity: .55; pointer-events: none; }
.rep-table-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 2px 0 8px; }
.rep-check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted2); cursor: pointer; }
.rep-table th.sorted { color: #fff; }
.rep-bar {
  display: inline-block; width: 64px; height: 6px; border-radius: 3px; background: rgba(148,163,184,.16);
  margin-right: 8px; vertical-align: 1px; overflow: hidden;
}
.rep-bar i { display: block; height: 100%; background: var(--sky, var(--accent)); border-radius: 3px; }
.seg-mini { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg-mini button {
  background: none; border: 0; color: var(--muted2); font: inherit; font-size: 11.5px; padding: 2px 9px; cursor: pointer;
}
.seg-mini button + button { border-left: 1px solid var(--border); }
.seg-mini button.on { background: rgba(56,189,248,.14); color: #fff; }
@media (max-width: 1100px) { .viz-tiles.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .rep-tabs { padding: 6px 10px 0; }
  .rep-tabs button { padding: 8px 10px 9px; font-size: 13.5px; }
  .viz-tiles.four.usage-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rep-label { min-width: 0; }
  .rep-custom input { width: 140px; }
  .rep-table-head { flex-wrap: wrap; }
}
.vt-sub.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 760px) {
  /* the actions wrap under the title; ✕ stays in the corner of the sheet */
  .report-pane .detail-head { position: relative; padding-right: 58px; }
  .report-pane .detail-actions { flex: 1 1 100%; min-width: 0; }
  .report-pane #rep-close { position: absolute; top: 12px; right: 14px; }
  .rep-custom { flex-wrap: wrap; }
}
/* reports: day by day / week by week / month by month */
.rep-break { display: grid; gap: 14px; margin-bottom: 18px; }
.rep-break-card .vc-title { margin: 0 0 8px; }
.rep-break-table th { cursor: default; white-space: normal; min-width: 90px; vertical-align: bottom; }
.rep-break-table td:first-child { white-space: nowrap; font-weight: 600; }
.detail-actions .rep-nav button:disabled:hover { border-color: var(--border); background: var(--panel2); }
.rep-break-table tfoot td { font-weight: 700; border-top: 1px solid var(--glass-border, var(--border)); background: rgba(56,189,248,.05); }
/* while Reports is open the line list steps aside (filters stay in the control bar) */
.panes.rep-wide .list-pane { display: none; }
.panes.rep-wide .report-pane { border-left: 0; }
/* reports: one site */
.rep-site-input { width: 280px; }
.rep-site-head {
  display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap;
  border: 1px solid var(--glass-border, var(--border)); border-radius: 12px; padding: 12px 15px; margin-bottom: 12px;
  background: rgba(56,189,248,.05);
}
.rep-site-name { font-size: 16px; font-weight: 700; color: #fff; }
.rep-site-sub { font-size: 12.5px; color: var(--muted2); margin-top: 3px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rep-site-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.rep-site-acts .usage-link { padding: 5px 11px; font-size: 12.5px; }
@media (max-width: 760px) { .rep-site-box, .rep-site-input { width: 100%; } }

/* accounts with hide_brand (users.json, temporary): just "NMS", no iOne anywhere */
html.no-brand .topnav .brand .b1, html.no-brand .foot-legal .b1, html.no-brand .foot-legal .b3,
html.no-brand .login-brand .b1 { display: none; }
.foot-legal .b3 { margin-left: -4px; }   /* "© 2026 · iOne Resources, Inc." spaced evenly */
