/* PoolSense app shell — brand tokens from pool-sense.com.
   Dark brand chrome (header, login) over light work surfaces so checklists
   and reports stay readable in full sun. Aqua is the accent, never the
   text color on white. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&family=Manrope:wght@600;700;800&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
  /* brand */
  --bg-deep: #03080d;
  --brand-navy: #061018;       /* website background — chrome only */
  --ink: #0a1a26;              /* headings / primary text on light */
  --navy: #102233;             /* primary buttons & surfaces */
  --aqua: #4ec5e8;
  --aqua-glow: #6ed9f5;
  --aqua-electric: #8fe8ff;
  --aqua-deep: #1a5d77;
  --aqua-pale: #d4ebf2;
  /* semantics — palette sampled from the approved reference mockup
     (PoolCopilot-style screen, 2026-07-25): navy #21355b headers/pills,
     pastel mint icon badges, slate accents, soft zone colors. */
  --crit: #b5593e; --now: #b5593e;
  --warn: #d7a041;
  --ok: #2f9e6e;
  --navy2: #21355b;            /* section headers, device pills, active nav */
  --mint: #e2f9e5;             /* icon badge fill */
  --mint-ink: #3fbf7f;         /* icon stroke on mint */
  --slate: #8c9ab3;            /* standby dots, quiet accents */
  --spark-orange: #f0a35c;
  --spark-navy: #485979;
  --zone-amber: #d7a041; --zone-blue: #d7e6ed; --zone-red: #b5593e;
  --muted: #6e7480;
  --line: #e3e5ea;
  --bg: #f4f5f8;                /* desktop dashboard mockups: near-white canvas */
  --blue: #0442bc;              /* primary action blue (sampled from mockups) */
  --side: #001935;              /* sidebar navy (sampled) */
  --font: 'Inter', -apple-system, system-ui, 'Segoe UI', sans-serif;
  /* DS v1.0 (7/30, James's reference — 2nd pass: JetBrains Mono read
     "robotic"): numbers use Manrope, a rounded humanist bold, with
     TABULAR digit spacing for alignment. Mono stays only for --mono. */
  --font-num: 'Manrope', 'Inter', -apple-system, system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  background: var(--bg); color: var(--ink); min-height: 100dvh;
  padding-top: 54px;
}
body.has-tabs { padding-bottom: 66px; }

.appbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50; height: 54px;
  background: var(--brand-navy); color: #fff; display: flex; align-items: center;
  justify-content: space-between; padding: 0 14px;
  padding-top: env(safe-area-inset-top);
  border-bottom: 1px solid rgba(110, 217, 245, 0.22);
}
.appbar .brand { display: flex; align-items: center; gap: 9px;
  font-size: 16.5px; font-weight: 800; letter-spacing: -.02em; }
.appbar .brand img { height: 34px; width: 34px; border-radius: 8px; display: block; }
.appbar .brand span { color: var(--aqua-glow); }
.appbar .ctx { font-size: 12.5px; color: #a4b6c2; text-align: right; line-height: 1.3;
  display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.appbar .ctx a { color: var(--aqua-glow); text-decoration: none; font-weight: 600;
  padding: 7px 12px; border-radius: 9px; background: rgba(110, 217, 245, 0.12);
  border: 1px solid rgba(110, 217, 245, 0.25); }
.appbar .ctx a:active { background: rgba(110, 217, 245, 0.28); }

.tabs {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50; height: 66px;
  background: #fff; border-top: 1px solid var(--line); display: flex;
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs a {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 2px; text-decoration: none;
  color: var(--muted); font-size: 11px; font-weight: 600;
}
.tabs a .ico { font-size: 20px; line-height: 1; display: flex; }
.tabs a .ico svg { width: 21px; height: 21px; }
.tabs a .lbl-d { display: none; }
@media (min-width: 1000px) {
  .tabs a .lbl-m { display: none; }
  .tabs a .lbl-d { display: inline; }
}
.tabs a.active { color: var(--aqua-deep); }
.tabs a.active .ico { transform: scale(1.12); }

/* Sidebar pieces exist in the tabs nav but only show on wide screens. */
.tabs .side-brand, .tabs .side-user { display: none; }

/* Wide screens (mockup redesign 2026-07-25): the tab bar becomes a fixed
   LEFT SIDEBAR — brand on top, nav in the middle, user + logout pinned to
   the bottom. The mobile appbar disappears for staff; ambassadors (no
   tabs) keep the plain appbar everywhere. */
@media (min-width: 1000px) {
  body.has-tabs { padding-bottom: 0; padding-top: 0; padding-left: 232px; }
  body.has-tabs .appbar { display: none; }
  .tabs {
    top: 0; bottom: 0; left: 0; right: auto; width: 232px; height: auto;
    flex-direction: column; align-items: stretch; justify-content: flex-start;
    background: var(--side); border-top: 0;
    padding: 18px 14px 14px; gap: 4px;
  }
  .tabs .side-brand {
    display: flex; align-items: center; gap: 11px; color: #fff;
    padding: 2px 6px 18px; margin-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,.10);
  }
  .tabs .side-brand img { height: 38px; width: 38px; border-radius: 9px; }
  .tabs .side-brand .wm { line-height: 1.15; }
  .tabs .side-brand .wm b { display: block; font-size: 16px; font-weight: 800;
    letter-spacing: .02em; }
  .tabs .side-brand .wm i { display: block; font-style: normal; font-size: 9.5px;
    font-weight: 600; letter-spacing: .28em; color: #9fb3cc; }
  .tabs a {
    flex: 0 0 auto; flex-direction: row; justify-content: flex-start;
    gap: 12px; color: #b9c6d8; padding: 11px 14px; border-radius: 10px;
    font-size: 14px; font-weight: 600;
  }
  .tabs a .ico { font-size: 16px; }
  .tabs a .ico svg { width: 18px; height: 18px; }
  .tabs a:hover { background: rgba(255,255,255,.07); color: #fff; }
  .tabs a.active { background: var(--blue); color: #fff; }
  .tabs a.active .ico { transform: none; }
  .tabs .side-user {
    display: flex; align-items: center; gap: 10px; margin-top: auto;
    padding: 14px 6px 4px; border-top: 1px solid rgba(255,255,255,.10);
    font-size: 12px; color: #9fb3cc;
  }
  .tabs .side-user .avatar { width: 36px; height: 36px; border-radius: 50%;
    background: rgba(255,255,255,.14); color: #fff; display: flex; align-items: center;
    justify-content: center; font-weight: 800; font-size: 15px; flex: 0 0 auto; }
  .tabs .side-user .who { flex: 1; min-width: 0; }
  .tabs .side-user b { display: block; color: #fff; font-size: 13.5px; }
  .tabs .side-user a { color: #9fb3cc; text-decoration: none; font-weight: 700;
    font-size: 11.5px; }
  .tabs .side-user a:hover { color: #fff; }
}

/* ===== Design system (mockup redesign, 2026-07-25) =====
   White cards on a cool light canvas. Numbers in mono. Status is always
   a labeled chip, never a gauge. pool-detail.html follows this system;
   every page should. */

main.wrap { max-width: 1240px; margin: 0 auto; padding: 14px 16px 28px; }
.page-title { font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin: 8px 0 2px; }
.page-sub { font-size: 12.5px; color: var(--muted); margin: 0 0 14px; }

.grid { display: grid; gap: 12px; grid-template-columns: repeat(12, 1fr); }
.grid > * { min-width: 0; }
.span3 { grid-column: span 3; } .span4 { grid-column: span 4; }
.span5 { grid-column: span 5; } .span7 { grid-column: span 7; }
.span6 { grid-column: span 6; } .span8 { grid-column: span 8; }
.span12 { grid-column: span 12; }
@media (max-width: 999px) {
  .grid { grid-template-columns: 1fr; }
  .span3, .span4, .span5, .span6, .span7, .span8, .span12 { grid-column: span 1; }
}

.card { background: #fff; border: 1px solid var(--line); border-radius: 18px;
  padding: 16px 18px; }
.card h3 { margin: 0 0 10px; font-size: 12.5px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); font-weight: 700; }

.big { font-family: var(--mono); font-size: 34px; font-weight: 700; line-height: 1; }
.big small { font-size: 14px; color: var(--muted); font-weight: 500; font-family: var(--font); }
.sub { font-size: 12.5px; color: var(--muted); margin-top: 6px; line-height: 1.45; }
.empty { color: var(--muted); font-size: 13px; }

/* Status chips — the four target tiers plus a no-data face. */
.chip { display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.chip.excellent { background: #e4f5ea; color: var(--ok); }
.chip.good { background: var(--aqua-pale); color: var(--aqua-deep); }
.chip.monitor { background: #fdf3e0; color: var(--warn); }
.chip.action { background: #fdeceb; color: var(--crit); }
.chip.none { background: #eef1f4; color: var(--muted); }
.chip.ideal { background: #e5edfb; color: var(--blue); } /* LSI blue tier */

/* Soft pills for higher-level states (health, clarity, level, tanks). */
.pill { display: inline-block; padding: 4px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 700; }
.pill.good { background: #e4f5ea; color: var(--ok); }
.pill.info { background: var(--aqua-pale); color: var(--aqua-deep); }
.pill.warn { background: #fdf3e0; color: var(--warn); }
.pill.bad { background: #fdeceb; color: var(--crit); }
.pill.na { background: #eef1f4; color: var(--muted); }
.pillrow { display: flex; gap: 8px; flex-wrap: wrap; }

/* Metric cells: label / mono value / chip. */
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); gap: 10px; }
.kv .cell { background: #f6f9fa; border-radius: 10px; padding: 9px 11px; }
.kv .cell .lab { font-size: 11px; color: var(--muted); font-weight: 600; }
.kv .cell .val { font-family: var(--mono); font-size: 19px; font-weight: 700; margin: 2px 0; }
.kv .cell .val small { font-size: 11px; color: var(--muted); font-weight: 500; }

table.cmp { width: 100%; border-collapse: collapse; font-size: 13px; }
table.cmp th { text-align: left; font-size: 11px; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted); padding: 7px 8px;
  border-bottom: 2px solid var(--line); }
table.cmp td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.cmp td .v { font-family: var(--mono); font-weight: 700; }
table.cmp td .src { display: block; font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.tblwrap { overflow-x: auto; }

.btn { display: inline-block; border: 0; border-radius: 10px; cursor: pointer;
  background: var(--navy); color: #fff; font: 600 13px var(--font);
  padding: 8px 14px; text-decoration: none; }
.btn:active { opacity: .85; }
.btn.ghost { background: #fff; color: var(--navy); border: 1px solid var(--line); }
.btn.danger { background: var(--crit); }
.btn.small { padding: 6px 11px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: default; }

.scorebar { height: 7px; border-radius: 4px; background: #edf1f4; overflow: hidden; }
.scorebar i { display: block; height: 100%; border-radius: 4px; }

input.field, select.field, textarea.field {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font: 400 14px var(--font); color: var(--ink); background: #fff;
}
input.field:focus, select.field:focus, textarea.field:focus {
  outline: 2px solid var(--aqua); border-color: var(--aqua); }


/* ===== Reference-mockup components (2026-07-25 exact-match pass) ===== */

/* Section header: navy, bold, leading icon — "Pool data" style. */
.section-h { display: flex; align-items: center; gap: 10px; margin: 0 0 6px;
  font-size: 21px; font-weight: 800; color: var(--navy2); letter-spacing: -.01em; }
.section-h svg { width: 24px; height: 24px; flex: 0 0 auto; }
.section-h + .hr { border: 0; border-top: 1px solid var(--line); margin: 8px 0 12px; }
.section-h.sm { font-size: 15.5px; gap: 8px; margin-bottom: 10px; }
.section-h.sm svg { width: 19px; height: 19px; }

/* Navy pill with a leading icon — "Device #5109: …" style. */
.pill.navy { background: var(--navy2); color: #fff; display: inline-flex;
  align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px;
  font-size: 13.5px; }
.pill.navy svg { width: 16px; height: 16px; }

/* Pastel circular icon badge. */
.icon-badge { width: 52px; height: 52px; border-radius: 50%; flex: 0 0 auto;
  background: var(--mint); color: var(--mint-ink);
  display: flex; align-items: center; justify-content: center; }
.icon-badge svg { width: 26px; height: 26px; }
.icon-badge.amber { background: #fdf3e0; color: var(--warn); }
.icon-badge.red { background: #fbe9e4; color: var(--crit); }
.icon-badge.slate { background: #eceff5; color: var(--slate); }
.icon-badge.navy { background: #e4eaf5; color: var(--navy2); }

/* Metric row: badge | label + big number | visual (sparkline / zone bar). */
.metric-row { display: grid; grid-template-columns: 64px 1fr; gap: 4px 12px;
  padding: 16px 0 10px; border-top: 1px solid var(--line); align-items: center; }
.metric-row:first-of-type { border-top: 0; }
.metric-row .mr-main { min-width: 0; }
.metric-row .mr-label { font-size: 15px; color: var(--muted); }
.metric-row .mr-value { font-size: 30px; font-weight: 800; color: #1c1e21;
  letter-spacing: -.01em; line-height: 1.15; }
.metric-row .mr-value small { font-size: 14px; font-weight: 600; color: var(--muted); }
.metric-row .mr-visual { grid-column: 1 / -1; min-width: 0; }
.metric-row .mr-status { grid-column: 1 / -1; display: flex; align-items: center;
  gap: 12px; font-size: 15px; color: #565a63; padding: 8px 0 0; }
.metric-row .mr-status .dot { width: 20px; height: 20px; border-radius: 50%;
  background: var(--slate); flex: 0 0 auto; margin-left: 16px; }
.metric-row .mr-status .dot.on { background: var(--mint-ink); }
.metric-row .mr-status .chip { margin-left: auto; }
@media (min-width: 620px) {
  .metric-row { grid-template-columns: 64px minmax(150px, 220px) 1fr; }
  .metric-row .mr-visual { grid-column: auto; }
}
.mr-spark svg { width: 100%; height: 62px; display: block; }

/* Zone bar (pH style): colored segments, current-value marker, tick labels. */
.rangebar { position: relative; padding-top: 16px; }
.rangebar .rb-track { display: flex; height: 12px; border-radius: 999px; overflow: hidden; position: relative; }
.rangebar .rb-track i { display: block; height: 100%; }
.rangebar .rb-marker { position: absolute; top: 2px; width: 0; height: 0;
  border-left: 9px solid transparent; border-right: 9px solid transparent;
  border-top: 12px solid #a6adbe; transform: translateX(-50%); }
/* Today's observed low–high, drawn on the zone bar (resets midnight ET). */
.rb-range { position: absolute; top: 50%; transform: translateY(-50%); height: 5px;
  background: rgba(10, 26, 38, .78); border-radius: 3px; pointer-events: auto; z-index: 2;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .85); }
.rb-range::before, .rb-range::after { content: ''; position: absolute; top: -3px;
  width: 2.5px; height: 11px; background: #0a1a26; border-radius: 1px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .85); }
.rb-range::before { left: 0; } .rb-range::after { right: 0; }
.rangebar .rb-ticks { display: flex; justify-content: space-between;
  font-size: 12.5px; color: #9aa0ab; margin-top: 5px; }

/* Hero header: photo, dark gradient, huge name, health + temps overlay. */
.hero { position: relative; border-radius: 18px; overflow: hidden;
  background: linear-gradient(160deg, #14293e 0%, #0a1826 70%);
  color: #fff; min-height: 210px; display: flex; flex-direction: column;
  justify-content: flex-start; }
.hero img.hero-photo { position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; }
.hero .hero-shade { position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(5,10,16,.72) 0%, rgba(5,10,16,.38) 55%, rgba(5,10,16,.55) 100%); }
.hero .hero-body { position: relative; padding: 18px 22px 20px; display: flex;
  flex-direction: column; gap: 14px; flex: 1; }
.hero h1, .hero h2 { margin: 0; font-size: 40px; font-weight: 800;
  letter-spacing: -.02em; line-height: 1.05;
  text-shadow: 0 2px 12px rgba(0,0,0,.45); }
.hero .hero-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-top: auto; }
.hero .hero-health { display: flex; align-items: center; gap: 14px; }
.hero .hero-health .icon-badge { background: rgba(216,243,221,.92); }
.hero .hero-kicker { font-size: 16px; color: rgba(255,255,255,.75); }
.hero .hero-stat { font-size: 26px; font-weight: 800; line-height: 1.1; }
.hero .hero-temps { margin-left: auto; text-align: right; }
.hero .hero-temps .hero-stat small { font-size: 14px; font-weight: 500;
  color: rgba(255,255,255,.72); }
@media (max-width: 620px) {
  .hero h1, .hero h2 { font-size: 31px; }
  .hero .hero-stat { font-size: 20px; }
  .hero .hero-temps { margin-left: 0; text-align: left; }
}

/* Card headline chips row under hero */
.subline { font-size: 12.5px; color: var(--muted); }


/* ===== Dashboard-mockup components (2026-07-26) ===== */

/* KPI stat cards (Total / Healthy / Attention / At Risk / Offline). */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px; margin: 0 0 14px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
.kpi .kv-main { flex: 1; min-width: 0; }
.kpi .kl { font-size: 10.5px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); }
.kpi .kn { font-size: 26px; font-weight: 800; line-height: 1.15; color: #0e1524; }
.kpi .ks { font-size: 11px; color: var(--muted); }
.kpi .icon-badge { width: 42px; height: 42px; }
.kpi .icon-badge svg { width: 21px; height: 21px; }
/* Contact card popover (James 7/29) */
a.person, span.person { color: var(--blue); cursor: pointer; text-decoration: none; font-weight: inherit; }
a.person:hover, span.person:hover { text-decoration: underline; }
.contact-back { position: fixed; inset: 0; z-index: 500; background: rgba(6,16,24,.45);
  display: flex; align-items: center; justify-content: center; padding: 16px; }
.contact-card { background: #fff; border-radius: 16px; padding: 18px 20px; width: 320px; max-width: 100%; }
.cc-top { display: flex; align-items: center; gap: 12px; }
.cc-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--navy, #001935);
  color: #fff; font: 800 19px var(--font); display: inline-flex; align-items: center;
  justify-content: center; flex: 0 0 auto; }
.cc-name { font-size: 17px; font-weight: 800; }
.cc-role { font-size: 12px; color: var(--muted); }
.cc-x { margin-left: auto; border: 0; background: none; color: var(--muted); font-size: 15px; cursor: pointer; }
.cc-stats { font-size: 12px; color: var(--muted); margin: 10px 0 4px; }
.cc-actions { display: flex; gap: 8px; margin: 10px 0; flex-wrap: wrap; }
.cc-btn { flex: 1; min-width: 84px; text-align: center; border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 10px; font: 700 13px var(--font); color: var(--blue);
  text-decoration: none; }
.cc-btn:hover { border-color: var(--blue); }
.cc-lines { font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.cc-lines a { color: var(--blue); }

/* KPI cards as filters (Pools page, James 7/28) */
.kpi-btn { cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.kpi-btn:hover { border-color: var(--blue); }
.kpi-on { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(4, 66, 188, .18); }
.icon-badge.blue { background: #e3edff; color: var(--blue); }

/* Card header bars (LIVE NOW navy / COMPARATOR green / SPINTOUCH purple). */
.card.headed { padding: 0; overflow: hidden; }
.card.headed .ch { display: flex; justify-content: space-between; align-items: center;
  padding: 9px 15px; color: #fff; font-size: 12.5px; font-weight: 800;
  letter-spacing: .05em; text-transform: uppercase; }
.card.headed .ch small { font-weight: 600; text-transform: none; letter-spacing: 0;
  opacity: .85; }
.ch.navy { background: var(--navy2); }
.ch.green { background: #1c5c3f; }
.ch.purple { background: #4b2d83; }
.card.headed .cb { padding: 13px 15px 14px; }

/* Blue link-buttons ("View details →") and primary blue button. */
.linkbtn { display: inline-flex; align-items: center; gap: 6px; color: var(--blue);
  font-size: 13px; font-weight: 700; text-decoration: none; cursor: pointer;
  background: none; border: 0; padding: 0; font-family: var(--font); }
.btn.blue { background: var(--blue); }
.btn.outline-blue { background: #fff; color: var(--blue); border: 1.5px solid var(--blue); }

/* Numbered map pins. */
.pin-num { display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%; color: #fff; font: 800 13px var(--font);
  border: 3px solid #fff; box-shadow: 0 1px 6px rgba(0,0,0,.35); }
/* Blue = good (James 7/27); yellow fades to red as it worsens. */
.pin-num.t-exc { background: #0442bc; }
.pin-num.t-good { background: #4f83e8; }
.pin-num.t-attn { background: #f39739; }
.pin-num.t-risk { background: #cc2d28; }
.pin-num.t-off { background: #8c96a5; }

/* Read-only demo banner (nav.js adds it for users.demo accounts). */
.demo-banner { background: #21355b; color: #fff; text-align: center;
  font: 600 12.5px var(--font); padding: 7px 12px; letter-spacing: .01em; }

/* Accounting sub-links in the desktop sidebar; hidden on the mobile
   bottom bar (the page's own tabs cover it there). */
.tabs .subnav { display: none; }
.tabs a .chev { display: none; }
@media (min-width: 1000px) {
  .tabs a .chev { display: inline-block; margin-left: auto; font-size: 11px;
    color: #93a5bd; padding: 2px 6px; border-radius: 6px;
    transform: rotate(-90deg); transition: transform .15s; }
  .tabs a .chev.open { transform: rotate(0deg); }
  .tabs a .chev:hover { background: rgba(255,255,255,.12); color: #fff; }
  .tabs .subnav { display: none; flex-direction: column; gap: 1px; margin: 0 0 3px; }
  .tabs .subnav.open { display: flex; }
  .tabs .subnav a.sub.subactive { color: #fff; background: rgba(255,255,255,.10); }
  .tabs .subnav a.sub { display: block; padding: 6px 14px 6px 44px; border-radius: 8px;
    color: #93a5bd; font-size: 12.5px; font-weight: 600; text-decoration: none; }
  .tabs .subnav a.sub:hover { background: rgba(255,255,255,.07); color: #fff; }
}

/* "View trend" footer link on pool-profile cards -> Trends explorer. */
.trendlink { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px;
  font: 700 12px var(--font); color: var(--blue); text-decoration: none; }
.trendlink svg { width: 14px; height: 14px; }
.trendlink:hover { text-decoration: underline; }

/* ---- PoolSense Design System v1.0 (7/30) ---------------------------------
   Shared components used by Pool Detail V2 + Trends V2 (and every page
   after them). Documented in docs/DESIGN-SYSTEM.md — change it there
   and here together. */

/* Section wrappers: thin accent line + 2-3% tinted background. */
.sec-wrap { border-radius: 16px; padding: 14px 14px 10px; margin-bottom: 0;
  border: 1px solid var(--line); border-top: 3px solid var(--sec-accent, var(--blue));
  background: var(--sec-tint, #fff); }
.sec-wrap > .sec-band { margin: 2px 0 10px; }
.sec-chem { --sec-accent: #0442bc; --sec-tint: #f7faff; }
.sec-intel { --sec-accent: #7c3aed; --sec-tint: #faf8ff; }
.sec-ops { --sec-accent: #0e8944; --sec-tint: #f7fbf8; }
.sec-hist { --sec-accent: #f39739; --sec-tint: #fffbf5; }

/* Cards elevate slightly on hover (V2 UX). */
.card, .chartbox { transition: box-shadow .15s ease, transform .15s ease; }
.card:hover, .chartbox:hover { box-shadow: 0 4px 16px rgba(6, 16, 24, .07); }

/* AI/insight surface — one look for PoolSense Insights, Trends Insight,
   the profile teaser, and future recommendation panels. */
.ai-card { background: linear-gradient(135deg, #f2f6ff 0%, #f7f3ff 100%);
  border: 1px solid #dfe7fb; border-radius: 12px; padding: 11px 13px; }
.ai-card .ai-h { display: flex; gap: 7px; align-items: center; font: 700 11px var(--font);
  text-transform: uppercase; letter-spacing: .05em; color: var(--blue); margin-bottom: 6px; }
.ai-card .ai-h svg { width: 14px; height: 14px; }

/* Verification badge (comparator AI cross-check etc.). */
.badge-ai { display: inline-flex; gap: 5px; align-items: center; border-radius: 99px;
  padding: 3px 10px; font: 700 10.5px var(--font); }
.badge-ai svg { width: 12px; height: 12px; }
.badge-ai.ok { background: #e4f5ea; color: var(--ok); }
.badge-ai.warn { background: #fdf3e4; color: #b45309; }
.badge-ai.na { background: #f1f5f9; color: #64748b; }

/* Zebra data tables (equipment registry etc.). */
table.zebra { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.zebra th { text-align: left; font: 700 10.5px var(--font); text-transform: uppercase;
  letter-spacing: .04em; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); }
table.zebra td { padding: 7px 8px; }
table.zebra tbody tr:nth-child(even) { background: #f7f9fc; }

/* Persistent footer status chips (shared timestamp formatting lives in
   each page's stamp()/ago() helpers — same wording everywhere). */
.status-chip { display: inline-flex; gap: 7px; align-items: center; font: 600 12px var(--font);
  border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 6px 12px; }
.status-chip svg { width: 13px; height: 13px; color: var(--blue); }

/* Numbers read in mono everywhere (James's 7/30 reference card). One
   selector list = one place to grow it. */
.score-big .n, .fac-blue, .kpi6 .val, .stat7 .sv, .mc .v, .est-box .v,
.kv .cell .val, .rail b, .pt-rows .rl b, table.feedh td, table.zebra td,
.days, .money, .nba .rv .v, .kc2-row .v, .strow .vv, .evsum .ei,
table.banded td {
  font-family: var(--font-num); font-variant-numeric: tabular-nums; }

/* Icon-beside-label pattern (metric labels, table headers): blue
   outline icon + navy label. */
.lab-ico { display: inline-flex; gap: 7px; align-items: center; }
.lab-ico svg { width: 15px; height: 15px; color: var(--blue); flex: 0 0 auto; }

/* Banded data table (feed history reference): light header band,
   roomy zebra rows. */
table.banded { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.banded thead th { background: #eef2f9; font: 700 11px var(--font); text-transform: uppercase;
  letter-spacing: .04em; color: var(--navy2); padding: 9px 10px; text-align: left; }
table.banded thead th:first-child { border-radius: 10px 0 0 10px; }
table.banded thead th:last-child { border-radius: 0 10px 10px 0; }
table.banded thead th .lab-ico svg { width: 13px; height: 13px; }
table.banded td { padding: 10px; border-bottom: 1px solid var(--line); }
table.banded tbody tr:nth-child(even) { background: #f8fafc; }
table.banded td.good { color: var(--ok); font-weight: 700; }

/* Modal + weekly-schedule editor (promoted from tech.html 8/12 — the
   Dispatch and Visits editors rendered unstyled without these). */
.modal-back { position: fixed; inset: 0; z-index: 1200; background: rgba(6,16,24,.45);
  display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: #fff; border-radius: 16px; padding: 20px 22px; width: 420px;
  max-width: 100%; max-height: 92dvh; overflow-y: auto; }
.sch-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 0; border-top: 1px solid var(--line); }
.sch-name { flex: 0 0 130px; font-size: 13.5px; }
.sch-days { display: flex; gap: 4px; }
.sch-day { border: 1px solid var(--line); background: #fff; border-radius: 7px;
  font: 700 10.5px var(--font); color: var(--muted); padding: 5px 6px; cursor: pointer; }
.sch-day.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.sch-who { margin-left: auto; font-size: 12.5px; padding: 6px 8px; }
