/* RBI Client Portal. Same palette and components as the staff portal
   (portal/frontend/css/style.css): phosphor green on near-black, dark cards
   with a green-tinted edge, glass top bar. Dark only, as the staff portal is. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
/* `hidden` must win over the display rules below (.who, .topnav are flex). */
[hidden] { display: none !important; }

:root {
  color-scheme: dark;
  --navy:        #b2d76c;   /* headline numbers and titles */
  --navy-dark:   #040502;
  --navy-light:  #10150c;
  --blue:        #99ca3c;   /* the Reality Bytes green */
  --blue-light:  #a8d356;
  --success:     #99ca3c;
  --warning:     #ff9f2e;
  --danger:      #ff4d5e;
  --bg:          #050703;
  --card:        #0a0d07;
  --surface-2:   #10150c;
  --border:      #2b3a1b;
  --border-light: #1d2713;
  --text:        #dfeccc;
  --text-muted:  #8a9c72;
  --text-light:  #5f6d50;
  --accent:      #99ca3c;
  --accent-dim:  #769d2a;
  --warn-bg:     #2b1c07;
  --danger-bg:   #2a0d12;
  --ok-bg:       #202b0c;
}

/* Montserrat, self-hosted (SIL Open Font License: /static/fonts/LICENSE-Montserrat.txt).
   One variable-weight file per script covers every weight from 100 to 900. */
@font-face {
  font-family: 'Montserrat'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('/static/fonts/montserrat-latin-ext-wght-normal.woff2') format('woff2');
  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: 'Montserrat'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('/static/fonts/montserrat-latin-wght-normal.woff2') format('woff2');
  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;
}

body {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.5; min-height: 100vh;
}
/* Form controls do not inherit the page font on their own. */
button, input, select, textarea { font-family: inherit; }
::selection { background: rgba(153, 202, 60, .28); color: var(--text); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #26310f; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-dim); }
:where(a) { color: var(--blue-light); text-decoration: none; }
:where(a):hover { color: var(--accent); text-decoration: underline; }
a:focus-visible, button:focus-visible, tr.clickable:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* ─── Top bar: logo, sections, who is signed in ─────────────────────────── */
.top {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 28px;
  padding: 10px 28px;
  background: rgba(10, 13, 7, .88);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid rgba(153, 202, 60, .18);
  box-shadow: 0 6px 28px rgba(0, 0, 0, .40);
}
.brand {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  text-decoration: none; flex-shrink: 0;
}
.brand:hover { text-decoration: none; }
.brand-logo { width: 54px; height: 54px; display: block; }
.brand-name {
  font-size: .64rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--navy); white-space: nowrap;
  text-shadow: 0 0 12px rgba(153, 202, 60, .28);
}

.topnav { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; }
.topnav button {
  background: none; border: 0; border-radius: 8px; cursor: pointer;
  padding: 9px 14px; font: inherit; font-size: .9rem; font-weight: 500;
  color: rgba(255, 255, 255, .7); white-space: nowrap;
  transition: color .15s, background-color .15s, box-shadow .15s;
}
.topnav button:hover { color: #eff6e2; background: rgba(255, 255, 255, .07); }
.topnav button.on {
  color: #eff6e2; background: rgba(153, 202, 60, .14);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.who { display: flex; align-items: center; gap: 16px; margin-left: auto; flex-shrink: 0; }
.who-text { display: flex; flex-direction: column; text-align: right; line-height: 1.25; font-size: .85rem; }
.who-text #who-name { color: var(--text); font-weight: 600; }
.muted { color: var(--text-muted); }
.small { font-size: .8rem; }

/* ─── Content ─────────────────────────────────────────────────────────────── */
main { max-width: 1240px; margin: 0 auto; padding: 24px 28px 48px; }
h1, h2, h3 { line-height: 1.25; color: var(--navy); }
h1 { font-size: 1.75rem; font-weight: 700; margin-bottom: 6px; }
h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 14px; }
h3 { font-size: 1rem; font-weight: 700; margin-bottom: 10px; }
p { margin-bottom: 8px; }

.card {
  background: rgba(10, 13, 7, .84); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px; margin: 16px 0;
}

/* Sign-in card, as the staff portal's login card. */
.login-card {
  max-width: 400px; margin: 64px auto; text-align: center;
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 44px 36px; box-shadow: 0 25px 60px rgba(0, 0, 0, .3);
}
.login-card .login-logo { width: 96px; height: 96px; margin: 0 auto 18px; display: block; }
.login-card p { color: var(--text-muted); font-size: .95rem; margin-bottom: 28px; }
.btn-ms-login {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; padding: 13px 20px;
  background: var(--card); border: 2px solid var(--border); border-radius: 8px;
  font-size: .95rem; font-weight: 600; color: var(--text); text-decoration: none;
  transition: all .2s; cursor: pointer;
}
.btn-ms-login:hover {
  border-color: var(--blue); background: var(--surface-2); color: var(--text);
  text-decoration: none; box-shadow: 0 2px 12px rgba(153, 202, 60, .15);
}
.notice {
  background: var(--warn-bg); border-left: 3px solid var(--warning); color: var(--text);
  padding: 10px 12px; border-radius: 6px; margin-bottom: 20px; text-align: left; font-size: .9rem;
}

button.link { background: none; border: 0; color: var(--text-muted); cursor: pointer; font: inherit; font-size: .85rem; padding: 0; }
button.link:hover { color: var(--danger); }

/* Stat tiles, as .stat-card in the staff portal: the number carries the colour. */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat {
  background: rgba(10, 13, 7, .84); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px;
}
.stat-value {
  font-size: 2rem; font-weight: 800; color: var(--navy); line-height: 1; margin-bottom: 6px;
  text-shadow: 0 0 12px rgba(153, 202, 60, .28);
}
.stat-label { font-size: .8rem; color: var(--text-muted); font-weight: 500; }
.stat-note { font-size: .75rem; color: var(--text-light); margin-top: 4px; }
.stat.good .stat-value { color: var(--success); }
.stat.warn .stat-value { color: var(--warning); text-shadow: none; }
.stat.bad  .stat-value { color: var(--danger); text-shadow: none; }

/* Filter chips, as the staff portal's segmented control. */
.filters {
  display: inline-flex; flex-wrap: wrap; max-width: 100%; gap: 2px; padding: 2px; margin-bottom: 14px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg);
}
.chip {
  background: none; border: 0; border-radius: 6px; cursor: pointer;
  padding: 5px 14px; font: inherit; font-size: .84rem; font-weight: 600; color: var(--text-muted);
}
.chip:hover { color: var(--accent); background: rgba(153, 202, 60, .10); }
.chip.on { color: var(--accent); background: rgba(153, 202, 60, .16); box-shadow: inset 0 -2px 0 var(--accent); }

/* Tickets toolbar: search, filters, the My/All switch and the pager. */
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar h2 { margin: 0; flex: 1; }
.toolbar .filters { margin-bottom: 0; }
input.search {
  flex: 1; min-width: 220px; max-width: 420px; padding: 8px 12px; font: inherit; font-size: .88rem;
  background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 8px;
}
input.search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(153, 202, 60, .18); }
.scope-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; position: relative; }
.scope-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.scope-label { font-size: .86rem; font-weight: 600; color: var(--text-muted); transition: color .15s; }
.scope-label.on { color: var(--accent); }
.scope-track {
  position: relative; width: 44px; height: 24px; border-radius: 12px; flex-shrink: 0;
  background: var(--surface-2); border: 1px solid var(--border); transition: background-color .15s;
}
.scope-track::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); transition: transform .15s;
}
.scope-switch input:checked + .scope-track { background: rgba(153, 202, 60, .18); }
.scope-switch input:checked + .scope-track::after { transform: translateX(20px); }
.scope-switch input:focus-visible + .scope-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.pager-buttons { display: flex; align-items: center; gap: 10px; }
.chip:disabled { opacity: .4; cursor: default; }
@media (prefers-reduced-motion: reduce) { .scope-track, .scope-track::after { transition: none; } }

/* Tables, as the staff portal's. */
.table-wrap {
  overflow-x: auto; background: rgba(10, 13, 7, .84);
  border: 1px solid var(--border); border-radius: 12px;
}
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
thead th {
  text-align: left; padding: 10px 12px; background: var(--bg);
  border-bottom: 2px solid var(--border);
  font-size: .75rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .04em; white-space: nowrap;
}
tbody td { padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: top; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface-2); }
tr.clickable { cursor: pointer; }

.empty { color: var(--text-muted); padding: 24px 0; }
.foot { text-align: center; color: var(--text-light); font-size: .8rem; padding: 0 16px 32px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ─── Chart colours ──────────────────────────────────────────────────────────
   Every chart part takes its colour from --c, set by one tone or series class,
   so the same class colours a gauge arc, a donut slice, a meter or a pill. */
:root {
  --seg0: #99ca3c; --seg1: #4fb3d9; --seg2: #ffb547; --seg3: #a78bfa;
  --seg4: #ff6b7a; --seg5: #8a9c72; --seg6: #4d5a40;
}
.tone-ok { --c: var(--success); }  .tone-warn { --c: var(--warning); }
.tone-bad { --c: var(--danger); }  .tone-none { --c: var(--text-light); }
.seg-0 { --c: var(--seg0); } .seg-1 { --c: var(--seg1); } .seg-2 { --c: var(--seg2); } .seg-3 { --c: var(--seg3); }
.seg-4 { --c: var(--seg4); } .seg-5 { --c: var(--seg5); } .seg-6 { --c: var(--seg6); }
.tone-text-ok { color: var(--success); } .tone-text-warn { color: var(--warning); }
.tone-text-bad { color: var(--danger); } .tone-text-none { color: var(--text-light); }
.tone-bg-ok { background: var(--success); } .tone-bg-warn { background: var(--warning); } .tone-bg-bad { background: var(--danger); }

/* Gauges */
.gauge { text-align: center; min-width: 140px; }
.gauge svg { display: block; margin: 0 auto; max-width: 100%; height: auto; }
.gauge-track { fill: none; stroke: var(--surface-2); stroke-width: 12; stroke-linecap: round; }
.gauge-fill { fill: none; stroke: var(--c); stroke-width: 12; stroke-linecap: round;
  filter: drop-shadow(0 0 4px color-mix(in srgb, var(--c) 45%, transparent)); }
.gauge-value { fill: var(--text); font-size: 24px; font-weight: 800; }
.gauge-label { font-size: .82rem; font-weight: 700; color: var(--navy); margin-top: -2px; }
.gauge-state { font-size: .74rem; font-weight: 600; }
.gauge-sub { font-size: .72rem; color: var(--text-muted); margin-top: 1px; }
.gauge-row { display: flex; flex-wrap: wrap; justify-content: space-around; gap: 18px 10px; padding: 18px 12px 14px; }
.gauge-pair { display: flex; flex-wrap: wrap; justify-content: space-around; gap: 8px; }

/* Donuts */
.donut { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut svg { flex-shrink: 0; }
.donut-track { fill: none; stroke: var(--surface-2); stroke-width: 15; }
.donut-seg { fill: none; stroke: var(--c); stroke-width: 15; transition: stroke-width .15s; }
.donut-seg:hover { stroke-width: 18; }
.donut-value { fill: var(--navy); font-size: 24px; font-weight: 800; }
.donut-label { fill: var(--text-muted); font-size: 11px; }
.legend { list-style: none; display: grid; gap: 6px; font-size: .82rem; min-width: 150px; flex: 1; }
.legend li { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 8px; }
.legend-value { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.legend-label { color: var(--text-muted); }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.legend-row { display: flex; gap: 16px; justify-content: center; margin-top: 4px; font-size: .76rem; color: var(--text-muted); }
.legend-row > span { display: inline-flex; align-items: center; gap: 6px; }

/* Bars, meters, sparklines */
.bars { width: 100%; height: auto; display: block; }
.bars .grid { stroke: var(--border-light); stroke-width: 1; }
.bars .axis { fill: var(--text-light); font-size: 10px; }
.bar-a { fill: var(--seg1); } .bar-b { fill: var(--seg0); }
.bar-a-swatch { background: var(--seg1); } .bar-b-swatch { background: var(--seg0); }
.bars rect:hover { opacity: .8; }
.meter { display: inline-block; vertical-align: middle; flex-shrink: 0; }
.meter-track { fill: var(--surface-2); }
.meter-fill { fill: var(--c); }
.hbars { display: grid; gap: 8px; margin-top: 10px; }
.hbar { display: grid; grid-template-columns: minmax(110px, 1fr) 90px 3ch; align-items: center; gap: 10px; font-size: .82rem; }
.hbar-label { color: var(--text-muted); }
.hbar-value { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.spark { display: block; }
.spark-line { fill: none; stroke: var(--c); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark-dot { fill: var(--c); }

/* Pills */
.pill {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .75rem; font-weight: 700;
  white-space: nowrap; color: var(--c, var(--text-muted));
  background: color-mix(in srgb, var(--c, var(--text-muted)) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--c, var(--text-muted)) 35%, transparent);
}
.pill.seg-6 { color: var(--text-muted); }
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }

/* Panels and key figures */
.page-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.page-head h2, .page-head h3 { margin: 0; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 16px; margin: 16px 0; }
.panel {
  background: rgba(10, 13, 7, .84); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; min-width: 0;
}
.panel-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin: 0; }
.panel-link { align-self: flex-end; margin-top: auto; background: none; border: 0; cursor: pointer; font: inherit;
  font-size: .82rem; font-weight: 600; color: var(--accent); padding: 2px 0; }
.panel-link:hover { text-decoration: underline; }
.kpis { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.kpi-value { font-size: 1.45rem; font-weight: 800; color: var(--navy); line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi.tone-text-ok .kpi-value { color: var(--success); } .kpi.tone-text-warn .kpi-value { color: var(--warning); }
.kpi.tone-text-bad .kpi-value { color: var(--danger); }
.kpi-label { font-size: .74rem; color: var(--text-muted); }
.attention { list-style: none; display: grid; gap: 9px; }
.attention li { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 10px; font-size: .86rem; }
.dot { width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 6px currentColor; }
.section-title { margin: 22px 0 10px; }
.device-summary { margin-bottom: 18px; }
.ticket-stats .grid-3 { margin-top: 4px; }

/* Tables: sortable headers, links, meters in cells */
.th-sort { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer;
  text-transform: inherit; letter-spacing: inherit; }
.th-sort:hover, .th-sort.on { color: var(--accent); }
td.wrap { min-width: 220px; }
.ticket-link { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; cursor: pointer;
  color: var(--blue-light); white-space: nowrap; }
.ticket-link:hover { color: var(--accent); text-decoration: underline; }
.cell-name { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.kind-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.kind-server { background: var(--seg1); } .kind-endpoint { background: var(--seg0); }
.kind-network { background: var(--seg3); } .kind-security { background: var(--seg2); }
.cell-meter { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }

/* Locations (UniFi sites) */
.site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.site-card { background: rgba(10, 13, 7, .84); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 16px; display: grid; gap: 10px; }
.site-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.site-head h4 { font-size: .95rem; color: var(--navy); margin: 0; }
.site-row, .site-spark { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Internet connections (AIS): uptime ring, facts with icons, 30-day strip.
   Every box may shrink (min-width: 0) and long names wrap, so nothing spills. */
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.section-head .section-title { margin-bottom: 4px; }
.strip-legend { justify-content: flex-start; flex-wrap: wrap; gap: 4px 14px; margin: 0 0 10px; }
.swatch.day-ok, .day.tone-ok { --c: color-mix(in srgb, var(--success) 34%, var(--card)); }
.conn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 14px; }
.conn-card { background: rgba(10, 13, 7, .84); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px; display: grid; gap: 14px; min-width: 0; align-content: start; }
.conn-card.is-down { border-color: color-mix(in srgb, var(--danger) 50%, var(--border)); }
.conn-head { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 4px 12px; align-items: center; }
.conn-head h4 { margin: 0; font-size: 1rem; line-height: 1.25; color: var(--navy); overflow-wrap: anywhere; }
.conn-head .pill-row { grid-column: 2; margin: 0; gap: 6px; }
.conn-icon { grid-row: span 2; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, var(--c) 13%, transparent); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent);
  box-shadow: 0 0 14px color-mix(in srgb, var(--c) 18%, transparent); }
.conn-alert { font-size: .84rem; font-weight: 700; color: var(--danger); background: var(--danger-bg);
  border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent); border-radius: 8px; padding: 6px 10px; }
.conn-body { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: center; }
.conn-ring { margin: 0; text-align: center; }
.conn-ring figcaption { font-size: .7rem; color: var(--text-light); margin-top: 2px; }
.conn-facts { display: grid; gap: 12px; min-width: 0; }
.fact { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 10px; align-items: center; }
.fact-icon { display: grid; place-items: center; }
.fact-text { display: grid; min-width: 0; }
.fact-value { font-weight: 800; font-size: 1rem; line-height: 1.2; color: var(--text); overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums; white-space: pre-wrap; }
.fact-value small { font-size: .75rem; font-weight: 600; color: var(--text-muted); }
.fact-label { font-size: .74rem; color: var(--text-muted); overflow-wrap: anywhere; }
.line-icon { fill: none; stroke: var(--c, var(--accent)); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0; }
.signal-bars .bar { fill: var(--border-light); stroke: var(--border); stroke-width: .6; }
.signal-bars .bar.on { fill: var(--c); stroke: none; }
.ring { display: block; }
.ring-track { fill: none; stroke: var(--border-light); stroke-width: 9; }
.ring-fill { fill: none; stroke: var(--c); stroke-width: 9;
  filter: drop-shadow(0 0 4px color-mix(in srgb, var(--c) 45%, transparent)); }
.ring-value { fill: var(--text); font-size: 17px; font-weight: 800; }
.ring-word { fill: var(--text-muted); font-size: 10.5px; }
.conn-days { display: grid; gap: 6px; }
.conn-days-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; font-size: .78rem;
  color: var(--text-muted); }
.conn-days-head span:last-child { font-weight: 700; }
.day-strip { display: block; width: 100%; height: auto; }
.day { fill: var(--c); }
.strip-scale { display: flex; justify-content: space-between; font-size: .68rem; color: var(--text-light); }
.conn-foot { font-size: .76rem; color: var(--text-light); border-top: 1px solid var(--border-light); padding-top: 10px; }
/* Microsoft 365 checks */
.checks { list-style: none; display: grid; gap: 10px; align-content: start; }
.check { display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: start; font-size: .86rem; }
.check-icon { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-weight: 800;
  font-size: .8rem; color: var(--bg); }
.check-ok .check-icon { background: var(--success); } .check-bad .check-icon { background: var(--warning); }
.check-none .check-icon { background: var(--surface-2); color: var(--text-muted); }
.check-text { display: block; font-weight: 600; }
.check-detail { display: block; font-size: .76rem; color: var(--text-muted); }

/* CyberProtection: the plan ladder, what is protecting you, the external check */
.plan-intro { font-size: .9rem; margin: 0 0 12px; max-width: 75ch; }
.plan-intro strong { color: var(--navy); }
.ladder { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 12px; }
.rung { background: rgba(10, 13, 7, .84); border: 1px solid var(--border); border-radius: 12px; padding: 14px;
  display: grid; gap: 8px; align-content: start; min-width: 0; }
.rung-current { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--card));
  box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 16%, transparent); }
.rung-included { background: color-mix(in srgb, var(--accent) 4%, var(--card)); }
.rung-head { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.rung-head h4 { margin: 0; font-size: 1rem; line-height: 1.2; color: var(--navy); }
.rung-above .rung-head h4 { color: var(--text-muted); }
.rung-sub { font-size: .74rem; color: var(--text-muted); }
.rung-tag { font-size: .64rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
  color: var(--bg); background: var(--accent); border-radius: 999px; padding: 2px 8px; }
.rung-lead { font-size: .74rem; color: var(--text-muted); margin: 0; }
.rung-adds { list-style: none; display: grid; gap: 5px; font-size: .82rem; }
.rung-adds li { display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: 6px; }
.rung-adds li::before { content: '+'; font-weight: 800; color: var(--accent); }
.rung-above .rung-adds li { color: var(--text-muted); }
.rung-above .rung-adds li::before { color: var(--text-light); }
.shield { display: block; flex-shrink: 0; }
.shield-body { fill: color-mix(in srgb, var(--accent) 22%, transparent); stroke: var(--accent); stroke-width: 1.5;
  stroke-linejoin: round; }
.shield-tick { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.shield-current .shield-body { fill: var(--accent); }
.shield-current .shield-tick { stroke: var(--bg); }
.shield-above .shield-body { fill: none; stroke: var(--text-light); stroke-dasharray: 2.5 2; }
.guard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 12px; }
.guard { background: rgba(10, 13, 7, .84); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px;
  min-width: 0; }
.guard h4 { margin: 0 0 12px; font-size: .9rem; color: var(--navy); }
.checks.compact { gap: 7px; }
.checks.compact .check { font-size: .84rem; align-items: center; }
.grow { margin-top: 14px; display: grid; gap: 6px; }
.grow-list { display: flex; flex-wrap: wrap; gap: 8px; }
.grow-item { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--text-muted);
  border: 1px dashed var(--border); border-radius: 999px; padding: 3px 12px 3px 6px; }
.grow-item .shield { width: 18px; height: 18px; }
.risk-parts { display: grid; gap: 6px; margin-top: 2px; }
.risk-part { display: grid; grid-template-columns: minmax(0, 1fr) 80px 36px; gap: 8px; align-items: center; font-size: .8rem; }
.risk-part .small { text-align: right; }
.all-clear { flex-direction: row; align-items: center; gap: 14px; }
.all-clear p { margin: 0; }
.reminders { list-style: none; display: grid; gap: 6px; }
.reminders li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 6px 0; border-bottom: 1px solid var(--border-light); font-size: .88rem; }
.reminder-name { overflow-wrap: anywhere; }
.scan-areas { list-style: none; display: grid; gap: 10px; }
.scan-areas li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; font-size: .86rem; }

/* Pop-ups (tickets, devices) */
dialog.modal {
  width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 48px); margin: auto; padding: 0;
  background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .65), 0 0 0 1px rgba(153, 202, 60, .08);
}
dialog.modal[open] { animation: modal-in .16s ease-out; }
dialog.modal::backdrop { background: rgba(2, 3, 1, .72); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  padding: 18px 20px 12px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--card); z-index: 1; }
.modal-head h3 { margin: 0; }
.modal-title { display: grid; gap: 2px; }
.ticket-no { font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.modal-close { background: none; border: 1px solid var(--border); color: var(--text-muted); width: 32px; height: 32px;
  border-radius: 8px; font-size: 1.3rem; line-height: 1; cursor: pointer; flex-shrink: 0; }
.modal-close:hover { color: var(--text); border-color: var(--accent); }
.modal-body { padding: 16px 20px 20px; display: grid; gap: 14px; }
.modal-split { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; }
.detail-grid { display: grid; grid-template-columns: max-content 1fr; gap: 7px 18px; font-size: .88rem; }
.detail-grid dt { color: var(--text-muted); }
.detail-grid dd { margin: 0; overflow-wrap: anywhere; }

/* A section's own pages: tabs at the top of the section (no drop-down menus,
   so every page works the same on a phone) */
.subnav { display: inline-flex; flex-wrap: wrap; gap: 4px; margin: 0 0 16px; padding: 3px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--bg); }
.subnav-item { background: none; border: 0; border-radius: 8px; padding: 7px 16px; font: inherit; font-size: .88rem;
  font-weight: 700; color: var(--text-muted); cursor: pointer; }
.subnav-item:hover { color: var(--accent); background: rgba(153, 202, 60, .08); }
.subnav-item.on { color: var(--bg); background: var(--accent); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 16px; margin: 16px 0; }
td.nowrap { white-space: nowrap; }

/* Overview: Your feedback (CSAT) */
.feedback-panel { margin: 16px 0; }
.feedback-panel .head-row .panel-title { margin: 0; }
.feedback-top { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin: 6px 0 10px; }
.feedback-top > div { flex: 1 1 220px; min-width: 0; }
.feedback-top .muted.small { margin-top: 8px; }
.fb-seg { fill: var(--c); }
.feedback-sub { font-size: .85rem; margin: 12px 0 6px; color: var(--text-muted); font-weight: 700; }
.feedback-list { list-style: none; display: grid; gap: 8px; }
.feedback-list li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 8px 10px;
  background: var(--surface-2); border-radius: 8px; }
.feedback-comment { flex: 1 1 240px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Microsoft 365 licensing */
.sub-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin: 18px 0 8px; }
.tag-muted { background: var(--surface-2); border-color: var(--border); color: var(--text-muted); }
.lic-extras { margin-top: 12px; }

/* Sales pages (a service the client does not have yet) */
.sales { display: grid; gap: 18px; }
.sales-hero {
  border: 1px solid rgba(153, 202, 60, .35); border-radius: 16px; padding: 28px 28px 24px;
  background: radial-gradient(120% 140% at 0% 0%, rgba(153, 202, 60, .16), rgba(79, 179, 217, .06) 45%, rgba(10, 13, 7, .9) 80%);
}
.sales-hero h3 { font-size: 1.6rem; margin: 6px 0 10px; }
.sales-hero p { max-width: 70ch; color: var(--text); line-height: 1.6; }
.eyebrow { font-size: .74rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
a.cta { display: inline-block; text-decoration: none; padding: 10px 18px; }
a.cta:hover { text-decoration: none; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; }
.feature { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; padding: 14px 16px;
  background: rgba(10, 13, 7, .84); border: 1px solid var(--border); border-radius: 12px; }
.feature h4 { font-size: .95rem; color: var(--navy); margin: 0 0 4px; }
.feature p { font-size: .86rem; color: var(--text-muted); margin: 0; }
.feature-mark { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 800;
  color: var(--bg); background: var(--accent); box-shadow: 0 0 12px rgba(153, 202, 60, .35); }

/* Device pop-up: live state, then cards of details */
dialog.modal.modal-wide { width: min(980px, calc(100vw - 32px)); }
.detail-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.dcard { background: var(--bg); border: 1px solid var(--border-light); border-radius: 12px; padding: 12px 14px; display: grid;
  gap: 8px; align-content: start; min-width: 0; }
.dcard h4 { font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); margin: 0; }
.dcard .detail-grid { font-size: .84rem; gap: 5px 14px; }
.live-card { background: linear-gradient(135deg, rgba(79, 179, 217, .08), rgba(10, 13, 7, 0) 70%); border-color: rgba(79, 179, 217, .3); }
.live-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.live-grid { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; }
.live-meter, .disk { display: grid; grid-template-columns: minmax(90px, auto) 160px auto; align-items: center; gap: 10px; font-size: .84rem; }
.disk-list { display: grid; gap: 6px; }
.disk-name { font-weight: 600; overflow-wrap: anywhere; }
.block { display: block; }
.chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-list .block { flex-basis: 100%; }
.tag { font-size: .74rem; padding: 2px 8px; border-radius: 6px; background: rgba(153, 202, 60, .10);
  border: 1px solid rgba(153, 202, 60, .25); color: var(--text); }
.update-list { list-style: none; display: grid; gap: 6px; margin-top: 4px; }
.update-list li { display: flex; justify-content: space-between; gap: 10px; font-size: .82rem; align-items: baseline; }
.update-title { overflow-wrap: anywhere; }
.update-meta { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.warranty-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dcard .cell-meter { white-space: normal; flex-wrap: wrap; }
.dcard-wide { grid-column: 1 / -1; }

/* Progress steps in the ticket pop-up */
.steps { display: flex; list-style: none; margin: 4px 0; }
.steps li { flex: 1; position: relative; padding-top: 24px; font-size: .78rem; text-align: center; color: var(--text-light); }
.steps li::after { content: ''; position: absolute; top: 11px; left: -50%; width: 100%; height: 2px; background: var(--border); }
.steps li:first-child::after { display: none; }
.steps li::before { content: ''; position: absolute; top: 5px; left: 50%; width: 14px; height: 14px; margin-left: -7px;
  border-radius: 50%; background: var(--surface-2); border: 2px solid var(--border); box-sizing: border-box; z-index: 1; }
.steps li.done { color: var(--text); }
.steps li.done::before { background: var(--accent); border-color: var(--accent); }
.steps li.done::after, .steps li.current::after { background: var(--accent); }
.steps li.current { color: var(--accent); font-weight: 700; }
.steps li.current::before { background: var(--bg); border-color: var(--accent); box-shadow: 0 0 0 4px rgba(153, 202, 60, .2); }

/* AI summary at the top of the ticket pop-up */
.ai-summary {
  border: 1px solid rgba(153, 202, 60, .35); border-radius: 12px; padding: 12px 14px 10px;
  background: linear-gradient(135deg, rgba(153, 202, 60, .10), rgba(79, 179, 217, .06) 60%, rgba(10, 13, 7, 0) 100%);
}
.ai-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.ai-badge { display: inline-flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.ai-spark { font-size: .9rem; text-shadow: 0 0 8px rgba(153, 202, 60, .6); }
.ai-text { font-size: .93rem; line-height: 1.55; color: var(--text); margin: 0; }
.ai-text.muted { color: var(--text-muted); }
.ai-foot { font-size: .7rem; color: var(--text-light); margin: 8px 0 0; }
.ai-skeleton { display: grid; gap: 8px; padding: 4px 0 6px; }
.ai-skeleton span { display: block; height: 11px; border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-2) 0%, rgba(153, 202, 60, .22) 50%, var(--surface-2) 100%);
  background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.ai-skeleton span:nth-child(2) { width: 92%; } .ai-skeleton span:nth-child(3) { width: 64%; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* All notes on the ticket (under the AI summary) */
.history-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.btn-secondary {
  background: none; color: var(--accent); border: 1px solid rgba(153, 202, 60, .45); border-radius: 8px;
  padding: 7px 14px; font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer;
}
.btn-secondary:hover { background: rgba(153, 202, 60, .10); border-color: var(--accent); }
.btn-secondary[aria-expanded="true"] { background: rgba(153, 202, 60, .14); }
.history:empty { display: none; }
.history { display: grid; gap: 8px; border-left: 2px solid rgba(153, 202, 60, .35); padding-left: 14px; }
.history-list { list-style: none; display: grid; gap: 10px; }
.history-item { background: var(--bg); border: 1px solid var(--border-light); border-radius: 10px; padding: 10px 12px; }
.history-item.from-client { border-color: rgba(255, 181, 71, .35); }
.history-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; font-size: .84rem; }
.history-meta .pill { margin-left: auto; }
.history-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .88rem; margin: 0; line-height: 1.5; }
.history-body.clamped { max-height: 12.5em; overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.link-button { background: none; border: 0; padding: 4px 0 0; font: inherit; font-size: .8rem; font-weight: 700;
  color: var(--blue-light); cursor: pointer; }
.link-button:hover { color: var(--accent); text-decoration: underline; }
.history-status { color: var(--accent); }

/* Notes and the note box */
.note-section { border-top: 1px solid var(--border); padding-top: 14px; display: grid; gap: 10px; }
.note-section h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin: 0; }
.note-list { list-style: none; display: grid; gap: 10px; }
.note-item { background: var(--bg); border: 1px solid var(--border-light); border-radius: 10px; padding: 10px 12px; }
.note-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; font-size: .84rem; }
.note-meta .pill { margin-left: auto; }
.note-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .88rem; margin: 0; }
.note-form { display: grid; gap: 8px; }
.note-form textarea {
  width: 100%; min-height: 96px; resize: vertical; padding: 10px 12px; font: inherit; font-size: .9rem;
  background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 10px;
}
.note-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(153, 202, 60, .18); }
.note-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.btn-primary {
  background: var(--accent); color: #0b1004; border: 0; border-radius: 8px; padding: 8px 18px;
  font: inherit; font-size: .88rem; font-weight: 800; cursor: pointer;
}
.btn-primary:hover { background: var(--blue-light); }
.btn-primary:disabled { opacity: .55; cursor: default; }
.form-msg { font-size: .84rem; color: var(--accent); margin: 0; min-height: 1em; }
.form-msg:empty { display: none; }

@media (prefers-reduced-motion: reduce) {
  dialog.modal[open] { animation: none; }
  .donut-seg { transition: none; }
  .ai-skeleton span { animation: none; }
}

@media (max-width: 760px) {
  .top { flex-wrap: wrap; gap: 10px 16px; padding: 10px 16px; }
  .brand-logo { width: 44px; height: 44px; }
  .topnav { order: 3; flex-basis: 100%; overflow-x: auto; }
  .who-text { display: none; }
  main { padding: 20px 16px 40px; }
  .grid-3 { grid-template-columns: 1fr; }
  .modal-split { grid-template-columns: 1fr; }
  .live-meter, .disk { grid-template-columns: 1fr; gap: 3px; }
  .detail-cards { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; gap: 2px; }
  .detail-grid dd { margin-bottom: 8px; }
  .gauge { min-width: 120px; }
}
@media (max-width: 360px) {
  .conn-body { grid-template-columns: 1fr; justify-items: center; }
  .conn-facts { justify-self: stretch; }
}

/* ─── Quotes ─────────────────────────────────────────────────────────────────
   The list follows the portal's dark cards; an open quote is a light "paper"
   document that reads (and prints) like a quote. */
.head-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.head-row h2 { margin: 0; }
.lede { font-size: 1rem; color: var(--text); margin: 6px 0 0; }
.help-q { width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--accent-dim); background: none;
  color: var(--accent); font: inherit; font-size: .8rem; font-weight: 800; cursor: pointer; line-height: 1; flex: none; }
.help-q:hover, .help-q[aria-expanded="true"] { background: var(--accent); color: var(--bg); }
.help-text { flex-basis: 100%; margin: 4px 0 8px; padding: 10px 12px; border-left: 3px solid var(--accent);
  background: var(--surface-2); border-radius: 6px; font-size: .86rem; color: var(--text); }

.quote-card { display: flex; justify-content: space-between; align-items: center; gap: 16px; width: 100%;
  text-align: left; font: inherit; color: inherit; cursor: pointer; transition: border-color .14s ease; }
.quote-card:hover, .quote-card:focus-visible { border-color: var(--accent); outline: none; }
.quote-card.is-waiting { border-left: 4px solid var(--warning); }
.quote-card-main { min-width: 0; display: grid; gap: 2px; }
.quote-card-num { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.quote-card-title { font-size: 1.05rem; font-weight: 700; color: var(--navy); }
.quote-card-side { display: grid; justify-items: end; gap: 6px; flex: none; }
.quote-card-total { font-size: 1.3rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.quote-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .76rem; font-weight: 700;
  border: 1px solid var(--c, var(--border)); color: var(--c, var(--text-muted)); white-space: nowrap; }
.tone-bg-none { background: var(--surface-2); }

.qd-banner { padding: 12px 16px; border-radius: 10px; margin: 12px 0; color: #0b1004; font-size: .92rem; }
.qd-banner.tone-bg-none { color: var(--text); border: 1px solid var(--border); }
.qd-banner-note { margin-top: 4px; font-style: italic; white-space: pre-wrap; }

.quote-doc { background: #ffffff; color: #1d2a10; border-radius: 14px; padding: 32px; margin: 16px 0;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .35); line-height: 1.5; }
.qd-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap;
  border-bottom: 3px solid #99ca3c; padding-bottom: 16px; }
.qd-eyebrow { font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: #5f8a1e; font-weight: 800; }
.quote-doc h1.qd-title { font-size: 1.6rem; color: #1d2a10; margin: 2px 0 4px; }
.qd-for { color: #56664a; font-size: .9rem; }
.qd-total-box { text-align: right; }
.qd-total { font-size: 2rem; font-weight: 800; color: #1d2a10; font-variant-numeric: tabular-nums; line-height: 1.1; }
.qd-intro { margin: 18px 0 6px; white-space: pre-wrap; font-size: .98rem; }
.quote-doc h3.qd-heading { color: #1d2a10; font-size: 1.05rem; margin: 22px 0 4px; padding-bottom: 4px; border-bottom: 2px solid #99ca3c; }
.qd-note { margin: 10px 0; padding: 10px 14px; background: #f3f8ea; border-radius: 8px; color: #33452a; font-size: .9rem; }
.qd-line { display: grid; grid-template-columns: 72px 1fr auto; gap: 14px; align-items: start; padding: 14px 0;
  border-bottom: 1px solid #e6ecdd; }
.qd-img { width: 72px; height: 72px; object-fit: contain; background: #fff; border: 1px solid #e6ecdd; border-radius: 10px; }
.qd-img-none { display: flex; align-items: center; justify-content: center; font-size: 1.6rem; background: #f3f8ea; }
.qd-line-title { font-weight: 700; color: #1d2a10; }
.qd-line-desc { font-size: .84rem; color: #56664a; margin-top: 2px; white-space: pre-wrap; }
.qd-line-pn { font-size: .74rem; color: #8a977a; margin-top: 2px; }
.qd-line-price { text-align: right; white-space: nowrap; }
.qd-qty { font-size: .84rem; color: #56664a; }
.qd-ext { font-weight: 800; font-size: 1.02rem; font-variant-numeric: tabular-nums; }
.qd-totals { margin: 18px 0 0 auto; max-width: 320px; display: grid; gap: 4px; font-size: .95rem; }
.qd-totals > div { display: flex; justify-content: space-between; gap: 16px; font-variant-numeric: tabular-nums; }
.qd-totals .qd-grand { font-weight: 800; font-size: 1.15rem; border-top: 2px solid #1d2a10; margin-top: 6px; padding-top: 8px; }
/* Recurring lines: a period tag under the title, "/ month" after prices, and a
   totals block per billing period (one-time, monthly, annual). */
.qd-period { display: inline-block; margin-top: 4px; padding: 1px 8px; border-radius: 999px; font-size: .72rem;
  font-weight: 700; background: #e8f1d6; color: #3f6212; }
.qd-period.is-annual { background: #e3eef9; color: #1e4f86; }
.qd-per { font-size: .78rem; font-weight: 600; color: #56664a; }
.qd-total-sub { font-size: 1.05rem; font-weight: 800; color: #1d2a10; font-variant-numeric: tabular-nums; }
.qd-totals-groups { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 14px 28px; margin-top: 18px; }
.qd-totals-groups .qd-totals { margin: 0; min-width: 240px; flex: 0 1 300px; }
.qd-totals-head { font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: #5f8a1e; font-weight: 800; }
/* Video lines (16:9 YouTube player) and the attachments list. */
.qd-video { margin: 16px 0; }
.qd-video-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden;
  background: #0f1408; box-shadow: 0 6px 18px rgba(0, 0, 0, .18); }
.qd-video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.qd-video figcaption { margin-top: 8px; font-weight: 700; color: #1d2a10; }
.qd-video-print { display: none; font-size: .84rem; color: #56664a; }
.qd-files { margin-top: 22px; }
.qd-file { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-top: 8px; border: 1px solid #e6ecdd;
  border-radius: 10px; color: #1d2a10; text-decoration: none; background: #fbfdf7; }
.qd-file:hover, .qd-file:focus-visible { border-color: #99ca3c; background: #f3f8ea; }
.qd-file-icon { flex: none; width: 42px; height: 42px; border-radius: 8px; background: #e8f1d6; color: #3f6212;
  display: flex; align-items: center; justify-content: center; font-size: .72rem; font-weight: 800; letter-spacing: .04em; }
.qd-file-name { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.qd-file-size { flex: none; font-size: .78rem; color: #66755a; }
@media print {
  .qd-video-frame { display: none; }
  .qd-video-print { display: block; }
}
.qd-terms { margin-top: 22px; padding-top: 12px; border-top: 1px solid #e6ecdd; font-size: .8rem; color: #66755a; white-space: pre-wrap; }
.qd-foot { margin-top: 14px; font-size: .74rem; color: #8a977a; text-align: center; }
.qd-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 24px; }
.qd-spacer { flex: 1; }
.qd-actions .btn-primary { padding: 11px 22px; font-size: .95rem; }

.field { display: grid; gap: 4px; font-size: .86rem; color: var(--text-muted); }
.field input, .field textarea { font: inherit; font-size: .95rem; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; width: 100%; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.field-check { display: flex; gap: 8px; align-items: flex-start; font-size: .88rem; color: var(--text); }
.field-check input { width: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--accent); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

@media (max-width: 760px) {
  .quote-doc { padding: 20px 16px; border-radius: 10px; }
  .qd-head { flex-direction: column; }
  .qd-total-box { text-align: left; }
  .qd-line { grid-template-columns: 56px 1fr; }
  .qd-img { width: 56px; height: 56px; }
  .qd-line-price { grid-column: 2; text-align: left; display: flex; gap: 2px 12px; align-items: baseline;
    flex-wrap: wrap; white-space: normal; min-width: 0; }
  .qd-line-price > div { white-space: nowrap; }
  .qd-line-main { min-width: 0; }
  .qd-totals { max-width: none; }
  .qd-totals-groups { justify-content: stretch; }
  .qd-totals-groups .qd-totals { flex: 1 1 100%; min-width: 0; }
  .quote-card { flex-direction: column; align-items: stretch; }
  .quote-card-side { justify-items: start; grid-auto-flow: column; align-items: center; justify-content: space-between; }
  .qd-actions .qd-spacer { display: none; }
  .qd-actions button { flex: 1 1 auto; }
}

/* Printing a quote: just the document, black on white. */
@media print {
  body { background: #fff; }
  header.top, footer.foot, .no-print, .qd-actions, .qd-banner, .help-text { display: none !important; }
  .quote-doc { box-shadow: none; margin: 0; padding: 0; }
}

/* ─── Device locations (Devices page map, device pop-up mini map) ───────────
   Leaflet draws the map; OpenStreetMap's light tiles are darkened to sit on
   the dark cards. Pin colours say where a location came from, and the
   legend and every caption say it in words too. */
/* isolation: Leaflet stacks its panes at z-index 400-1000; keep that inside the map so it never covers the sticky header. */
.geo-map, .geo-mini { position: relative; isolation: isolate; z-index: 0; }
.geo-map { height: 380px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border-light); background: #0e1410; }
.geo-mini { height: 240px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border-light); background: #0e1410; }
.geo-map .leaflet-tile-pane, .geo-mini .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.9) saturate(.6); }
.geo-map .leaflet-control-attribution, .geo-mini .leaflet-control-attribution { background: rgba(5, 7, 3, .78); color: var(--text-muted); }
.geo-map .leaflet-control-attribution a, .geo-mini .leaflet-control-attribution a { color: var(--text); }
.geo-map .leaflet-popup-content-wrapper, .geo-map .leaflet-popup-tip { background: var(--card); color: var(--text); }
.geo-map .leaflet-popup-content { margin: 10px 12px; font-size: .82rem; line-height: 1.45; }
.geo-map .marker-cluster { background: rgba(153, 202, 60, .3); }
.geo-map .marker-cluster div { background: rgba(153, 202, 60, .9); color: #050703; font-weight: 700; }
.geo-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: .78rem; color: var(--text-muted); }
.geo-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; border: 1px solid #050703; }
.geo-precise { background: #4aa8ff; } .geo-area { background: #b48cff; } .geo-office { background: #ffb020; }
@media (max-width: 760px) { .geo-map { height: 300px; } .geo-mini { height: 210px; } }

/* ─── Workday Activity ─────────────────────────────────────────────────────── */
.act-tl-wrap { overflow-x: auto; }
.act-timeline { display: block; width: 100%; height: auto; min-width: 560px; }
.act-work { fill: rgba(153, 202, 60, .05); }
.act-grid { stroke: var(--border-light); stroke-width: 1; }
.act-axis { fill: var(--text-muted); font-size: 11px; }
.act-day { fill: var(--text); font-size: 12px; }
.act-daysub { fill: var(--text-light); font-size: 10px; }
.act-rowbg { fill: #10150c; }
.act-A { fill: var(--accent); background: var(--accent); }
.act-C { fill: #5aa9e6; background: #5aa9e6; }
.act-H { fill: #9bd0f0; background: #9bd0f0; }
.act-F { fill: var(--warning); background: var(--warning); }
.act-I { fill: rgba(153, 202, 60, .4); background: rgba(153, 202, 60, .4); }
.act-L { fill: var(--text-light); background: var(--text-light); }
.act-N { fill: none; stroke: var(--danger); stroke-width: 1.2; stroke-dasharray: 3 2; }
.act-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: .78rem; color: var(--text-muted); }
.act-legend span { display: inline-flex; align-items: center; gap: 6px; }
.act-sw { display: inline-block; width: 16px; height: 10px; border-radius: 2px; }
.act-sw.act-I { height: 5px; }
.act-sw.act-L { height: 4px; }
.act-sw.act-N { background: none; border: 1px dashed var(--danger); }
.act-note { font-size: .78rem; color: var(--text-muted); margin-top: 12px; line-height: 1.5; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ─── Account Reviews (/reviews) ──────────────────────────────────────────── */
.review-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin: 16px 0; }
.review-am { font-size: 1.1rem; font-weight: 700; color: var(--navy); margin: 6px 0 2px; }
.review-when { font-size: 1.15rem; font-weight: 700; color: var(--navy); margin: 8px 0 2px; }
.review-sub { margin: 14px 0 6px; font-size: .9rem; color: var(--navy); }
.review-agenda { margin: 0; padding-left: 22px; }
.review-agenda li { margin: 0 0 8px; }
.review-item { font-weight: 600; }
.review-outcome { margin-top: 3px; font-size: .88rem; color: var(--success); }
.review-actions { list-style: none; margin: 0; padding: 0; }
.review-action { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 8px 0;
                 border-bottom: 1px solid var(--border); }
.review-action.is-done > div:first-child { color: var(--text-muted); text-decoration: line-through; }
.review-past { border-top: 1px solid var(--border); padding: 10px 0; }
.review-past summary { cursor: pointer; }
.review-recap { white-space: pre-wrap; margin: 10px 0; padding: 12px; background: var(--bg); border-radius: 8px; font-size: .92rem; }
@media (max-width: 760px) { .review-grid { grid-template-columns: 1fr; } .review-action { flex-wrap: wrap; } }
