/* ==========================================================================
   PageSpeed Monitor — LevelUp Leads design system
   Minimalist / clean UI + Bento grid. Inter (primary), Open Sans (secondary).
   ========================================================================== */

@font-face { font-family: "Inter"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/inter-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Open Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/open-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Open Sans"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/open-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Open Sans"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/open-sans-latin-700-normal.woff2") format("woff2"); }

:root {
  /* Defaults; the theme engine overrides these per request (ThemeService::css). */
  --navy: #03141E; --navy-2: #0A2433; --navy-3: #12344A;
  --cyan: #17B4EA; --cyan-hover: #3CC1EE; --accent-ink: #03141E;
  --ocean: #047BA8; --light-cyan: #CDEEFC; --pale-aqua: #E3FFFF;
  --gray: #494745; --yellow: #FCC135; --pink: #E73A6F;
  --bg: #ECF1F8; --surface: #FFFFFF; --surface-2: #F5F8FC; --field: #E3ECFE;
  --border: #DCE4EE; --border-strong: #C6D2E0; --ink: #03141E; --ink-2: #3F4F5C; --muted: #6F7F8D;
  --good: #0B8A55; --good-bg: #E3F6EC; --avg: #9A6200; --avg-bg: #FFF3D6; --poor: #C8322F; --poor-bg: #FDE7E6;
  --series-1: #047BA8; --series-2: #E73A6F; --series-3: #17B4EA; --series-4: #C98A00; --series-5: #494745; --series-6: #0B8A55;
  --radius-lg: 22px; --radius: 16px; --radius-sm: 12px;
  --gap: 16px; --card-pad-y: 20px; --card-pad-x: 22px; --cell-pad: 11px 12px;
  --shadow: 0 1px 2px rgba(3, 20, 30, .04), 0 8px 24px rgba(3, 20, 30, .05);
  --sidebar: 260px; --base-size: 14px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-2: "Open Sans", "Inter", system-ui, sans-serif;
  --side-bg: var(--navy); --side-ink: #C9D6E0; --side-ink-strong: #fff; --side-muted: #6E8798;
  --side-hover: var(--navy-2); --side-line: rgba(255,255,255,.07); --side-field: var(--navy-2);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 var(--base-size)/1.5 var(--font); font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ocean); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 24px; line-height: 1.2; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.ink-2 { color: var(--ink-2); }
.help { font-family: var(--font-2); color: var(--muted); font-size: 13px; line-height: 1.55; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ocean); }
.ico { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: middle; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- App shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; background: linear-gradient(90deg, var(--side-bg) var(--sidebar), var(--bg) var(--sidebar)); }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--side-bg); color: var(--side-ink); display: flex; flex-direction: column; padding: 22px 16px 16px; border-right: 1px solid var(--side-line);
}
.sidebar__brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 18px; }
.sidebar__brand img { height: 34px; width: auto; }
.sidebar__product { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--cyan); padding: 0 8px 14px; }
.sidebar__group { margin-top: 18px; }
.sidebar__label { font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--side-muted); padding: 0 10px 8px; }
.sidebar a.nav-link {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 11px;
  color: var(--side-ink); font-weight: 500; text-decoration: none; transition: background .15s, color .15s;
}
.sidebar a.nav-link:hover { background: var(--side-hover); color: var(--side-ink-strong); text-decoration: none; }
.sidebar a.nav-link.is-active { background: color-mix(in srgb, var(--cyan) 16%, transparent); color: var(--side-ink-strong); box-shadow: inset 2px 0 0 var(--cyan); }
.sidebar a.nav-link.is-active .ico { color: var(--cyan); }
.sidebar__foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--side-line); }
.usercard { display: flex; align-items: center; gap: 10px; padding: 8px; }
.avatar { width: 34px; height: 34px; border-radius: 11px; background: var(--navy-3); color: var(--cyan); text-decoration: none !important; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.usercard__name { color: var(--side-ink-strong); font-weight: 600; font-size: 13px; line-height: 1.2; }
.usercard__role { font-size: 11.5px; color: var(--side-muted); }
.usercard form { margin-left: auto; }
.icon-btn { background: transparent; border: 0; color: var(--side-muted); padding: 7px; border-radius: 9px; cursor: pointer; display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--side-hover); color: var(--side-ink-strong); }

.client-switch { margin: 4px 0 6px; }
.client-switch label { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--side-muted); padding: 0 10px 6px; }
.client-switch select {
  width: 100%; appearance: none; background: var(--side-field) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2317B4EA' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 6 3-3 3 3M5 10l3 3 3-3'/%3E%3C/svg%3E") no-repeat right 12px center;
  color: var(--side-ink-strong); border: 1px solid var(--side-line); border-radius: 12px; padding: 10px 36px 10px 12px; font: 500 13.5px var(--font); cursor: pointer;
}
.client-switch select:focus { outline: 2px solid var(--cyan); outline-offset: 1px; }
.client-fixed { margin: 2px 0 6px; padding: 12px; border-radius: 14px; background: var(--side-field); }
.client-fixed small { display: block; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--side-muted); font-weight: 700; }
.client-fixed strong { color: var(--side-ink-strong); font-weight: 600; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 16px; padding: 22px 32px 6px; flex-wrap: wrap;
}
.topbar__titles { min-width: 0; flex: 1; }
.crumbs { display: flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.topbar__actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.content { padding: 18px 32px 48px; }
.menu-toggle { display: none; }

/* ---------- Flash ---------- */
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 14px; margin-bottom: 16px; font-weight: 500; white-space: pre-line; border: 1px solid transparent; }
.flash--success { background: var(--good-bg); color: #075C39; border-color: #BFE8D2; }
.flash--error { background: var(--poor-bg); color: #8E1F1C; border-color: #F6C7C4; }
.flash--warning { background: var(--avg-bg); color: #6E4600; border-color: #F5DDA2; }
.flash--info { background: var(--light-cyan); color: #044F6B; border-color: #A9DDF3; }

/* ---------- Bento grid & cards ---------- */
.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); }
.span-12 { grid-column: span 12; } .span-9 { grid-column: span 9; } .span-8 { grid-column: span 8; }
.span-7 { grid-column: span 7; } .span-6 { grid-column: span 6; } .span-5 { grid-column: span 5; }
.span-4 { grid-column: span 4; } .span-3 { grid-column: span 3; } .span-2 { grid-column: span 2; }
.row-2 { grid-row: span 2; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: var(--card-pad-y) var(--card-pad-x); box-shadow: var(--shadow); min-width: 0; position: relative;
}
.card--flush { padding: 0; overflow: hidden; }
.card--soft { background: var(--surface-2); box-shadow: none; }
.card--navy {
  background: var(--navy); color: #DDE7EE; border-color: var(--navy); overflow: hidden;
}
.card--navy::after {
  content: ""; position: absolute; right: -150px; bottom: -170px; width: 340px; height: 340px;
  background: url("../img/halftone-cyan.svg") center / contain no-repeat; opacity: .22; pointer-events: none;
}
.card--navy > * { position: relative; z-index: 1; }
.card--cyan { background: var(--cyan); border-color: var(--cyan); color: var(--accent-ink); }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card__title { display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 600; }
.card__title .ico { color: var(--ocean); }
.card--navy .card__title .ico { color: var(--cyan); }
.card__sub { font-size: 12.5px; color: var(--muted); }
.card--navy .card__sub { color: #8FA6B5; }

/* KPI tiles */
.kpi__label { font-size: 12.5px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 7px; }
.kpi__value { font-size: 32px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; margin-top: 8px; font-variant-numeric: tabular-nums; }
.kpi__value small { font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.kpi__foot { margin-top: 8px; font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card--navy .kpi__label, .card--navy .kpi__foot { color: #8FA6B5; }
.card--navy .kpi__value { color: #fff; }

/* Device pair (Mobile | Desktop) */
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pair__cell { background: var(--surface-2); border-radius: 14px; padding: 12px 14px; }
.pair__cell .kpi__label { font-size: 12px; }
.pair__val { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 4px; display: flex; align-items: center; gap: 8px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.dot--good { background: var(--good); } .dot--avg { background: #D89400; } .dot--poor { background: var(--poor); } .dot--none { background: var(--border-strong); }

/* Score rings */
.rings { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.ring { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ring svg { display: block; }
.ring__track { stroke: rgba(255,255,255,.12); }
.card:not(.card--navy) .ring__track { stroke: #E6EDF5; }
.ring__arc--good { stroke: #29C48A; } .ring__arc--avg { stroke: var(--yellow); } .ring__arc--poor { stroke: #FF6B5E; } .ring__arc--none { stroke: transparent; }
.card:not(.card--navy) .ring__arc--good { stroke: var(--good); }
.card:not(.card--navy) .ring__arc--avg { stroke: #D89400; }
.card:not(.card--navy) .ring__arc--poor { stroke: var(--poor); }
.ring__num { font: 600 26px var(--font); fill: currentColor; font-variant-numeric: tabular-nums; }
.ring__cap { font-size: 12.5px; font-weight: 500; display: flex; gap: 6px; align-items: center; }

/* Score chips */
.score {
  display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 24px; padding: 0 7px;
  border-radius: 8px; font-weight: 600; font-size: 12.5px; font-variant-numeric: tabular-nums;
}
.score--good { background: var(--good-bg); color: var(--good); }
.score--avg { background: var(--avg-bg); color: var(--avg); }
.score--poor { background: var(--poor-bg); color: var(--poor); }
.score--none { background: #EEF2F6; color: var(--muted); }
.score--fail { background: var(--poor-bg); color: var(--poor); font-weight: 600; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge .ico { width: 14px; height: 14px; stroke-width: 2; }
.badge--good { background: var(--good-bg); color: var(--good); }
.badge--warn { background: var(--avg-bg); color: var(--avg); }
.badge--bad { background: var(--poor-bg); color: var(--poor); }
.badge--info { background: var(--light-cyan); color: #045E80; }
.badge--muted { background: #EEF2F6; color: var(--ink-2); }
.badge--navy { background: var(--navy); color: #fff; }
.tag { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 7px; font-size: 11.5px; font-weight: 600; background: #EEF2F6; color: var(--ink-2); }
.tag--live { background: var(--light-cyan); color: #045E80; }
.tag--staging, .tag--qa { background: #FFF3D6; color: #7A4E00; }

/* Trend */
.trend { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.trend .ico { width: 16px; height: 16px; stroke-width: 2; }
.trend--improving { color: var(--good); }
.trend--declining { color: var(--poor); }
.trend--stable { color: var(--ink-2); }
.trend--none { color: var(--muted); font-weight: 500; }
.card--navy .trend--improving { color: #4FD9A2; } .card--navy .trend--declining { color: #FF8A7F; } .card--navy .trend--stable { color: #C9D6E0; }
.spark { display: block; }
.spark path { fill: none; stroke: var(--ocean); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.spark--declining path { stroke: var(--poor); } .spark--improving path { stroke: var(--good); }

/* ---------- Buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px;
  border-radius: var(--radius-sm); border: 1px solid transparent; font: 600 13.5px var(--font); cursor: pointer; text-decoration: none !important;
  transition: background .15s, border-color .15s, color .15s; white-space: nowrap;
}
.btn .ico { width: 17px; height: 17px; stroke-width: 1.8; }
.btn--primary { background: var(--cyan); color: var(--accent-ink); }
.btn--primary:hover { background: var(--cyan-hover); }
.btn--dark { background: var(--navy); color: #fff; }
.btn--dark:hover { background: var(--navy-3); }
.btn--ghost { background: var(--surface); border-color: var(--border); color: var(--ink); }
.btn--ghost:hover { border-color: var(--border-strong); background: var(--surface-2); }
.btn--danger { background: var(--poor); color: #fff; }
.btn--danger:hover { background: #A92623; }
.btn--danger-ghost { background: var(--surface); border-color: #F2C3C1; color: var(--poor); }
.btn--sm { height: 32px; padding: 0 11px; border-radius: 10px; font-size: 12.5px; }
.btn--xs { height: 28px; padding: 0 9px; border-radius: 9px; font-size: 12px; gap: 5px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field label, .label { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.field .help { font-size: 12px; }
.input, .select, textarea.input {
  width: 100%; height: 42px; padding: 0 13px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--field); color: var(--ink); font: 500 14px var(--font); transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea.input { height: auto; padding: 10px 13px; min-height: 90px; }
.select { appearance: none; padding-right: 36px; background: var(--field) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2303141E' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E") no-repeat right 12px center; cursor: pointer; }
.input:focus, .select:focus { outline: none; border-color: var(--cyan); background-color: #fff; box-shadow: 0 0 0 3px rgba(23, 180, 234, .2); }
.input--sm, .select--sm { height: 34px; border-radius: 10px; font-size: 13px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; padding: 6px 0; }
.check input { width: 18px; height: 18px; accent-color: var(--ocean); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
.inline-form { display: inline; }

/* Segmented control */
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button, .seg a {
  border: 0; background: transparent; color: var(--ink-2); font: 600 12.5px var(--font); padding: 6px 11px; border-radius: 9px; cursor: pointer;
  text-decoration: none !important; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.seg button:hover, .seg a:hover { color: var(--ink); }
.seg .is-on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(3,20,30,.1), 0 0 0 1px var(--border); }
.seg--dark { background: var(--navy-2); border-color: var(--navy-3); }
.seg--dark button { color: #9FB3C1; } .seg--dark .is-on { background: var(--cyan); color: var(--accent-ink); box-shadow: none; }

/* Filter bar */
.filters { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; }
.filters .fgroup { display: flex; flex-direction: column; gap: 6px; }
.filters .fgroup > span { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.filters .select { height: 36px; border-radius: 10px; font-size: 13px; min-width: 170px; }
.filters .input { height: 36px; border-radius: 10px; font-size: 13px; }

/* ---------- Tables ---------- */
.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.table th {
  text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  padding: var(--cell-pad); border-bottom: 1px solid var(--border); background: var(--surface); white-space: nowrap;
}
.table td { padding: var(--cell-pad); border-bottom: 1px solid #EDF1F6; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #FAFCFE; }
.table .c { text-align: center; } .table .r { text-align: right; }
.table th.grp { text-align: center; border-bottom: 0; padding-bottom: 2px; color: var(--ink-2); }
.table th.sub { text-align: center; padding-top: 4px; font-size: 10.5px; }
.table .sep { border-left: 1px solid #EDF1F6; }
.table--compact td { padding: 8px 10px; } .table--compact th { padding: 9px 10px; }
.cell-main { font-weight: 600; color: var(--ink); }
.cell-sub { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.nowrap { white-space: nowrap; }
.row-link { color: inherit; text-decoration: none !important; }
.row-link:hover .cell-main { color: var(--ocean); }
tr.is-inactive td { opacity: .6; }

/* Scrollable raw table with sticky headers (mandatory behaviour) */
.table-scroll { max-height: 460px; overflow: auto; border-top: 1px solid var(--border); }
.table-scroll .table thead th { position: sticky; top: 0; z-index: 2; box-shadow: 0 1px 0 var(--border); }
.table-scroll .table thead tr:nth-child(2) th { top: 30px; }
.table-scroll .table thead tr:first-child th { height: 30px; }

/* Chart */
.chart-box { position: relative; height: 360px; }
.chart-box--sm { height: 220px; }
.chart-box--xs { height: 150px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.swatch { width: 18px; height: 3px; border-radius: 2px; display: inline-block; }
.swatch--dash { background: none !important; border-top: 2px dashed; height: 0; width: 18px; }
.swatch--1 { background: var(--series-1); border-color: var(--series-1); }
.swatch--2 { background: var(--series-2); border-color: var(--series-2); }
.chart-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 10px; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--muted); }

/* Indicators strip */
.ind { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 10px; }
.ind__cell { background: var(--surface-2); border-radius: 14px; padding: 12px 14px; }
.ind__cell span { font-size: 11.5px; color: var(--muted); font-weight: 600; display: block; }
.ind__cell strong { display: block; margin-top: 4px; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ind__cell--dir strong { margin-top: 6px; }
.ind__cell--dir .trend { font-size: 17px; } .ind__cell--dir .trend .ico { width: 20px; height: 20px; }

/* Drivers list */
.drivers { display: flex; flex-direction: column; gap: 4px; max-height: 420px; overflow: auto; }
.driver { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; cursor: pointer; border: 1px solid transparent; background: transparent; text-align: left; font: inherit; color: inherit; width: 100%; }
.driver:hover { background: var(--surface-2); border-color: var(--border); }
.driver.is-driver { background: var(--poor-bg); border-color: #F6C7C4; }
.driver__delta { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 52px; text-align: right; }
.delta--up { color: var(--good); } .delta--down { color: var(--poor); } .delta--flat { color: var(--ink-2); }

/* Page list with expandable chart */
.page-row__chart td { background: var(--surface-2) !important; padding: 16px 18px !important; }
.page-chart-controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 10px; }

/* Empty states */
.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty__art { width: 120px; height: 120px; margin: 0 auto 14px; background: url("../img/halftone-navy.svg") center / contain no-repeat; opacity: .18; }
.empty h3 { color: var(--ink); margin-bottom: 6px; }

/* Lists */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 9px 18px; font-size: 13.5px; }
.kv dt { color: var(--muted); font-weight: 500; }
.kv dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.card--navy .kv dt { color: #8FA6B5; } .card--navy .kv dd { color: #fff; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.hstack { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.divider { height: 1px; background: var(--border); margin: 16px 0; border: 0; }
.progress { height: 8px; border-radius: 99px; background: #E6EDF5; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--cyan); border-radius: 99px; }
.pagination { display: flex; gap: 6px; justify-content: flex-end; padding: 14px 18px; align-items: center; }
.pill-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.codebox { display: flex; gap: 8px; align-items: center; background: var(--navy); color: #BFE9FA; border-radius: 12px; padding: 10px 12px; }
.codebox code { flex: 1; overflow-x: auto; white-space: nowrap; }
.codebox .icon-btn { color: var(--cyan); }
.danger-zone { border: 1px solid #F2C3C1; background: #FFFBFB; }
.notice { display: flex; gap: 12px; padding: 14px 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; }
.notice .ico { color: var(--ocean); margin-top: 1px; }
.notice--warn { background: var(--avg-bg); border-color: #F5DDA2; } .notice--warn .ico { color: var(--avg); }
.notice--bad { background: var(--poor-bg); border-color: #F6C7C4; } .notice--bad .ico { color: var(--poor); }
details.disclose summary { cursor: pointer; font-weight: 600; color: var(--ocean); list-style: none; }
details.disclose summary::-webkit-details-marker { display: none; }

/* ---------- Auth (login / setup) ---------- */
.auth {
  min-height: 100vh; display: grid; place-items: center; padding: 32px 16px;
  background:
    radial-gradient(1200px 700px at 50% 45%, #0B3A55 0%, rgba(11, 58, 85, 0) 60%),
    linear-gradient(160deg, #0A3246 0%, #03141E 55%, #082639 100%);
  position: relative; overflow: hidden;
}
.auth::before, .auth::after {
  content: ""; position: absolute; width: 520px; height: 520px; background: url("../img/halftone-cyan.svg") center / contain no-repeat; opacity: .10; pointer-events: none;
}
.auth::before { left: -180px; bottom: -200px; }
.auth::after { right: -160px; top: -220px; opacity: .07; }
.auth-card {
  position: relative; z-index: 1; width: 100%; max-width: 430px; background: #fff; border-radius: 28px; padding: 34px 34px 28px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .35); border: 1px solid rgba(255,255,255,.4);
}
.auth-card--wide { max-width: 560px; }
.auth-logo { width: 190px; height: 82px; margin: 0 auto 22px; border-radius: 18px; border: 1px solid var(--border); box-shadow: 0 10px 24px rgba(3,20,30,.08); display: grid; place-items: center; background: #fff; }
.auth-logo img { width: 142px; height: auto; }
.auth-card h1 { font-size: 24px; font-weight: 700; margin: 8px 0 6px; letter-spacing: -0.02em; }
.auth-card .lead { font-family: var(--font-2); color: var(--muted); margin-bottom: 22px; font-size: 14px; }
.auth-card .field label { font-weight: 700; }
.auth-card .input { height: 46px; border-radius: var(--radius-sm); background: var(--field); border-color: #C9D8EE; }
.auth-card .btn--primary { height: 48px; border-radius: var(--radius-sm); font-size: 14.5px; font-weight: 700; margin-top: 8px; }
.auth-foot { margin-top: 18px; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.auth-foot .ico { width: 14px; height: 14px; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 46px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--muted); padding: 8px; border-radius: 9px; cursor: pointer; }
.pw-toggle:hover { color: var(--ink); background: rgba(3,20,30,.05); }
.checks { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 6px; font-size: 13px; }
.checks li { display: flex; gap: 8px; align-items: center; }
.checks .ok { color: var(--good); } .checks .no { color: var(--poor); }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .span-3 { grid-column: span 6; }
  .ind { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 1080px) {
  .span-9, .span-8, .span-7, .span-6, .span-5, .span-4 { grid-column: span 12; }
}
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; background: var(--bg); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 50; transform: translateX(-100%); transition: transform .2s ease; }
  body.nav-open .sidebar { transform: none; box-shadow: 0 0 0 100vmax rgba(3,20,30,.45); }
  .menu-toggle { display: inline-grid; background: var(--surface); border: 1px solid var(--border); color: var(--ink); border-radius: 11px; padding: 8px; cursor: pointer; }
  .topbar { padding: 16px 16px 4px; }
  .content { padding: 14px 16px 40px; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .span-3, .span-2 { grid-column: span 12; }
  .ind { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .kpi__value { font-size: 28px; }
  .filters .select { min-width: 0; width: 100%; }
  .filters .fgroup { width: 100%; }
  .auth-card { padding: 28px 22px 22px; }
}
@media print {
  .sidebar, .topbar__actions, .filters, .menu-toggle { display: none !important; }
  .shell { display: block; }
  .card { box-shadow: none; break-inside: avoid; }
  .table-scroll { max-height: none; overflow: visible; }
}

/* ==========================================================================
   Marketing Portal additions
   ========================================================================== */

/* Sidebar extras */
.sidebar__brand img { max-width: 170px; object-fit: contain; }
.sidebar[data-nav="light"] .sidebar__brand img { filter: none; }
.sidebar .nav-link .count { margin-left: auto; background: var(--pink); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 1px 7px; }
.ws-switch optgroup { color: #03141E; }
.ws-switch option { color: #03141E; }

/* Topbar tools */
.topbar__tools { display: flex; gap: 8px; align-items: center; }
.bell { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); color: var(--ink); }
.bell:hover { border-color: var(--border-strong); text-decoration: none; }
.bell__n { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--pink); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }

/* Global top-alert slot (platform notice, data issues, Stage 2 billing) */
.banners { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.banner { display: flex; gap: 10px; align-items: center; padding: 11px 14px; border-radius: 14px; border: 1px solid; font-weight: 500; font-size: 13.5px; }
.banner .spacer { flex: 1; }
.banner a { font-weight: 700; white-space: nowrap; }
.banner--info { background: var(--light-cyan); border-color: #A9DDF3; color: #044F6B; }
.banner--warning { background: var(--avg-bg); border-color: #F5DDA2; color: #6E4600; }
.banner--error { background: var(--poor-bg); border-color: #F6C7C4; color: #8E1F1C; }
.ribbon { display: flex; gap: 10px; align-items: center; padding: 9px 14px; border-radius: 12px; background: var(--navy); color: #DDE7EE; margin-bottom: 14px; font-size: 13px; }
.ribbon .ico { color: var(--cyan); }
.ribbon a, .ribbon button { color: var(--cyan); font-weight: 700; background: none; border: 0; cursor: pointer; font: inherit; font-weight: 700; padding: 0; }
.ribbon .spacer { flex: 1; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; flex-wrap: wrap; }
.tabs a { padding: 10px 14px; font-weight: 600; font-size: 13.5px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none !important; display: inline-flex; gap: 7px; align-items: center; }
.tabs a:hover { color: var(--ink); }
.tabs a.is-on { color: var(--ink); border-bottom-color: var(--cyan); }

/* Workspace */
.ws-hero { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.ws-hero__mark { width: 56px; height: 56px; border-radius: 16px; background: color-mix(in srgb, var(--cyan) 18%, transparent); color: var(--cyan); display: grid; place-items: center; font-weight: 700; font-size: 20px; flex: none; }
.ws-hero h2 { font-size: 22px; color: #fff; }
.ws-hero .card__sub a { color: var(--cyan); }
.module-tile { display: flex; flex-direction: column; gap: 10px; text-decoration: none !important; color: inherit; transition: border-color .15s, transform .15s; }
.module-tile:hover { border-color: var(--cyan); transform: translateY(-1px); }
.module-tile__icon { width: 42px; height: 42px; border-radius: 13px; background: var(--light-cyan); color: var(--ocean); display: grid; place-items: center; }
.module-tile__icon .ico { width: 21px; height: 21px; }
.module-tile h3 { font-size: 16px; }
.module-tile .go { margin-top: auto; color: var(--ocean); font-weight: 600; font-size: 13px; display: inline-flex; gap: 6px; align-items: center; }
.src-list { display: flex; flex-direction: column; gap: 6px; }
.src-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.src-row strong { font-size: 13.5px; }
.src-row small { display: block; color: var(--muted); font-size: 12px; }

/* Widgets (module dashboards) */
.widget { display: flex; flex-direction: column; min-height: 180px; }
.widget__body { flex: 1; display: flex; flex-direction: column; }
.widget__note { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--light-cyan); color: #044F6B; font-size: 13px; font-family: var(--font-2); white-space: pre-line; }
.awaiting { flex: 1; display: grid; place-items: center; text-align: center; padding: 18px 10px; border: 1.5px dashed var(--border); border-radius: 14px; background: repeating-linear-gradient(135deg, transparent 0 10px, color-mix(in srgb, var(--surface-2) 70%, transparent) 10px 20px); }
.awaiting .ico { width: 26px; height: 26px; color: var(--muted); margin-bottom: 6px; }
.awaiting strong { display: block; font-size: 13.5px; margin-bottom: 4px; }
.awaiting p { color: var(--muted); font-size: 12.5px; max-width: 360px; font-family: var(--font-2); }
.src-chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 10px; }
.metric-mini { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.metric-mini > div { background: var(--surface-2); border-radius: 14px; padding: 12px 14px; }
.metric-mini span { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.metric-mini strong { display: block; font-size: 22px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }
.spark { display: block; margin-top: 6px; }
.spark path { fill: none; stroke: var(--series-1); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.module-intro { font-family: var(--font-2); color: var(--ink-2); max-width: 820px; margin-bottom: 16px; white-space: pre-line; }
.compact .widget { min-height: 130px; }
.compact .card { padding: 15px 17px; }

/* Forms: extras */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; }
.switch input { appearance: none; width: 38px; height: 22px; border-radius: 999px; background: var(--border-strong); position: relative; cursor: pointer; transition: background .15s; flex: none; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked { background: var(--ocean); }
.switch input:checked::after { transform: translateX(16px); }
.switch input:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.color-field { display: flex; gap: 8px; align-items: center; }
.color-field input[type=color] { width: 42px; height: 42px; padding: 3px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); cursor: pointer; flex: none; }
.color-field .input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; text-transform: uppercase; }
.range-field { display: flex; gap: 12px; align-items: center; }
.range-field input[type=range] { flex: 1; accent-color: var(--ocean); }
.range-field output { min-width: 44px; font-weight: 600; font-variant-numeric: tabular-nums; }
fieldset.group { border: 0; padding: 0; margin: 0 0 6px; }
fieldset.group legend { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ocean); margin-bottom: 12px; padding: 0; }
.inherit-hint { font-size: 11.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.inherit-hint .sw { width: 12px; height: 12px; border-radius: 4px; border: 1px solid var(--border); display: inline-block; }
.logo-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.logo-pick label { border: 1px solid var(--border); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 6px; align-items: center; cursor: pointer; background: var(--surface-2); font-size: 11.5px; text-align: center; }
.logo-pick label.dark { background: var(--navy); color: #C9D6E0; }
.logo-pick img { max-width: 100%; height: 34px; object-fit: contain; }
.logo-pick input { accent-color: var(--ocean); }
.logo-pick label:has(input:checked) { border-color: var(--cyan); box-shadow: 0 0 0 2px color-mix(in srgb, var(--cyan) 35%, transparent); }

/* Theme preview strip */
.theme-preview { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); }
.theme-preview__bar { background: var(--navy); color: #fff; padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 600; }
.theme-preview__body { background: var(--bg); padding: 14px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.theme-preview__body .card { padding: 12px 14px; box-shadow: none; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatches span { width: 26px; height: 26px; border-radius: 8px; border: 1px solid rgba(0,0,0,.06); }

/* Layout editor */
.lay-rows { display: flex; flex-direction: column; gap: 8px; }
.lay-row { display: grid; grid-template-columns: 34px minmax(0, 1.4fr) auto auto 92px; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); }
.lay-row.is-hidden { opacity: .55; }
.lay-row__move { display: flex; flex-direction: column; gap: 2px; }
.lay-row__move button { border: 1px solid var(--border); background: var(--surface-2); border-radius: 7px; width: 28px; height: 22px; display: grid; place-items: center; cursor: pointer; color: var(--ink-2); padding: 0; }
.lay-row__move button:hover { border-color: var(--border-strong); color: var(--ink); }
.lay-row__move .ico { width: 14px; height: 14px; }
.lay-row__name strong { display: block; font-size: 13.5px; }
.lay-row__name small { color: var(--muted); font-size: 12px; }
.lay-row details { grid-column: 2 / -1; }
.lay-row details summary { font-size: 12.5px; }
.lay-row details .form-grid { margin-top: 10px; }
.lay-preview { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; }
.lay-preview div { background: var(--light-cyan); border-radius: 6px; height: 26px; font-size: 10.5px; color: #044F6B; display: grid; place-items: center; overflow: hidden; white-space: nowrap; padding: 0 4px; font-weight: 600; }
.lay-preview div.client-hidden { background: repeating-linear-gradient(135deg, #EEF2F6 0 6px, #E2E8F0 6px 12px); color: var(--muted); }

/* Access grid (client users × websites × modules) */
.access-grid { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.access-grid th, .access-grid td { padding: 9px 10px; border-bottom: 1px solid #EDF1F6; text-align: left; vertical-align: middle; }
.access-grid th { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.check-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 16px; }
.role-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.role-card { border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; cursor: pointer; display: flex; gap: 10px; align-items: flex-start; background: var(--surface); }
.role-card input { margin-top: 3px; accent-color: var(--ocean); }
.role-card strong { display: block; font-size: 13.5px; }
.role-card small { color: var(--muted); font-size: 12px; line-height: 1.45; display: block; margin-top: 2px; }
.role-card:has(input:checked) { border-color: var(--cyan); box-shadow: 0 0 0 2px color-mix(in srgb, var(--cyan) 30%, transparent); }

/* 2FA */
.qr-box { width: 212px; height: 212px; border-radius: 18px; border: 1px solid var(--border); background: #fff; display: grid; place-items: center; margin: 4px auto 14px; padding: 10px; }
.qr-box svg, .qr-box img { width: 100%; height: 100%; }
.secret { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 15px; letter-spacing: .06em; background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: 12px; padding: 10px 12px; text-align: center; word-break: break-all; }
.code-input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important; font-size: 22px !important; letter-spacing: .32em; text-align: center; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 14px 0 18px; padding: 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.codes code { font-size: 15px; letter-spacing: .08em; text-align: center; padding: 6px; background: #fff; border-radius: 8px; border: 1px solid var(--border); }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 10px; }
.steps li { counter-increment: s; display: flex; gap: 10px; font-size: 13.5px; font-family: var(--font-2); color: var(--ink-2); }
.steps li::before { content: counter(s); width: 22px; height: 22px; border-radius: 50%; background: var(--light-cyan); color: var(--ocean); display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; font-family: var(--font); }

/* Misc */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; font-weight: 600; color: var(--ink-2); }
.tag--svc { background: var(--light-cyan); color: #045E80; }
.tag--role-superadmin { background: var(--navy); color: #fff; }
.tag--role-admin { background: var(--light-cyan); color: #045E80; }
.tag--role-client_team, .tag--role-client_user { background: #EEF2F6; color: var(--ink-2); }
.meta-json { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.5px; color: var(--ink-2); max-width: 420px; white-space: pre-wrap; word-break: break-word; }
.stat-big { font-size: 34px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.health-bar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: #E6EDF5; margin: 10px 0 12px; }
.health-bar span { display: block; height: 100%; }
.hb-fresh { background: var(--good); } .hb-delayed { background: #D89400; } .hb-stale { background: var(--yellow); } .hb-failing { background: var(--poor); } .hb-waiting { background: var(--border-strong); } .hb-off { background: #E6EDF5; }
.legend-dots { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 14px; font-size: 12.5px; }
.legend-dots span { display: flex; align-items: center; gap: 7px; }
.legend-dots i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.sev { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.sev--critical { background: var(--poor); } .sev--warning { background: #D89400; } .sev--info { background: var(--ocean); }
.alert-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid #EDF1F6; }
.alert-row:last-child { border-bottom: 0; }
.alert-row .sev { margin-top: 6px; }
.alert-row strong { font-size: 13.5px; display: block; }
.alert-row small { color: var(--muted); font-size: 12px; }
.lock-overlay { position: relative; }
.lock-overlay[data-locked] > form { opacity: .45; pointer-events: none; }
.kv--left dd { text-align: left; }
.sticky-actions { position: sticky; bottom: 0; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(6px); padding: 12px 0; margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; z-index: 5; }
@media (max-width: 960px) {
  .lay-row { grid-template-columns: 34px 1fr; }
  .lay-row > :nth-child(n+3) { grid-column: 2; }
  .theme-preview__body { grid-template-columns: 1fr; }
  .codes { grid-template-columns: 1fr; }
}
.card--navy .awaiting { border-color: rgba(255,255,255,.14); background: repeating-linear-gradient(135deg, transparent 0 10px, rgba(255,255,255,.03) 10px 20px); }
.card--navy .awaiting strong { color: #fff; }
.card--navy .awaiting p, .card--navy .awaiting .ico { color: #8FA6B5; }
.card--navy .widget__note { background: rgba(23,180,234,.14); color: #DDF3FC; }
.card--navy .alert-row { border-color: rgba(255,255,255,.08); }

/* ---------- Site speed (PageSpeed Monitor) ---------- */
.speed-top { display: grid; grid-template-columns: minmax(260px, auto) 1fr; gap: 22px; align-items: start; }
.speed-rings { display: flex; gap: 22px; align-items: center; }
.speed-trend { margin-top: 14px; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); }
.speed-cats { width: 100%; }
.speed-cats td, .speed-cats th { padding: 8px 10px; }
.speed-cats .trend { font-size: 11.5px; margin-left: 6px; }
.speed-chart { margin-top: 20px; }
.speed-chart__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.speed-chart__title { font-weight: 600; font-size: 13.5px; }
.legend { display: inline-flex; gap: 14px; font-size: 12px; color: var(--ink-2); font-weight: 500; }
.legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.legend .l-s1 { background: var(--series-1); } .legend .l-s3 { background: var(--series-3); }
.lchart { width: 100%; height: auto; display: block; }
.lchart__band--good { fill: var(--good-bg); opacity: .55; } .lchart__band--avg { fill: var(--avg-bg); opacity: .45; } .lchart__band--poor { fill: var(--poor-bg); opacity: .45; }
.lchart__grid { stroke: #E3EAF2; stroke-width: 1; }
.lchart__ax { font: 500 11px var(--font); fill: var(--muted); }
.lchart__s path { fill: none; stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
.lchart__s--s1 path { stroke: var(--series-1); } .lchart__s--s1 .lchart__pt { fill: var(--series-1); }
.lchart__s--s3 path { stroke: var(--series-3); } .lchart__s--s3 .lchart__pt { fill: var(--series-3); }
.lchart__pt { opacity: 0; transition: opacity .12s; } .lchart:hover .lchart__pt { opacity: .9; }
.speed-foot { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--muted); }
.speed-foot .spacer { flex: 1; }
.speed-pages td .score { min-width: 30px; }
.speed-pages .dev { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
@media (max-width: 900px) { .speed-top { grid-template-columns: 1fr; } }

/* ---------- KPIs, deltas, ranked tables (GA4 / Search Console) ---------- */
.range-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: -4px 0 16px; }
.range-bar__dates { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.kpi-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { background: var(--surface-2); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kpi__label { font-size: 12px; color: var(--muted); font-weight: 600; display: flex; justify-content: space-between; gap: 8px; }
.kpi__label small { font-weight: 500; opacity: .8; white-space: nowrap; }
.kpi__value { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.kpi__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 26px; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.delta .ico { width: 14px; height: 14px; stroke-width: 2.2; }
.delta--up { color: var(--good); } .delta--down { color: var(--poor); } .delta--flat { color: var(--ink-2); } .delta--none { color: var(--muted); font-weight: 500; }
.chart-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.rank-table .truncate { max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share { display: inline-block; width: 54px; height: 6px; background: #E6EDF5; border-radius: 4px; margin-right: 8px; vertical-align: middle; overflow: hidden; }
.share i { display: block; height: 100%; background: var(--series-1); border-radius: 4px; }
@media (max-width: 900px) { .kpi-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .chart-pair { grid-template-columns: 1fr; } .rank-table .truncate { max-width: 180px; } }
.kpi__thru { font-size: 11px; font-weight: 500; color: var(--muted); margin-left: 6px; vertical-align: middle; }
.rank-table td, .rank-table th { padding-left: 8px; padding-right: 8px; }
.rank-table td:first-child, .rank-table th:first-child { padding-left: 10px; }
.legend .l-s2 { background: var(--series-2); } .legend .l-s4 { background: var(--series-4); } .legend .l-s5 { background: var(--series-5); }
.lchart__s--s2 path { stroke: var(--series-2); } .lchart__s--s2 .lchart__pt { fill: var(--series-2); }
.lchart__s--s4 path { stroke: var(--series-4); } .lchart__s--s4 .lchart__pt { fill: var(--series-4); }
.lchart__s--s5 path { stroke: var(--series-5); } .lchart__s--s5 .lchart__pt { fill: var(--series-5); }
.lchart__s--s2 path, .lchart__s--s4 path, .lchart__s--s5 path { stroke-width: 1.75; opacity: .85; }

/* ---------- Deliverables (ClickUp) ---------- */
tr.is-suggested td { background: #F2FAFE; }
.dl-counters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) 1.4fr; gap: 10px; align-items: stretch; }
.dl-progress { background: var(--surface-2); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.pbar { height: 10px; background: #E6EDF5; border-radius: 6px; overflow: hidden; display: flex; }
.pbar i { display: block; height: 100%; } .pbar .p-done { background: var(--good); } .pbar .p-prog { background: var(--cyan); } .pbar .p-pend { background: #F3C969; }
.pbar--sm { height: 7px; }
.cu-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.cu-status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c, #9AA8B5); }
.cu-prio { font-size: 12px; font-weight: 600; white-space: nowrap; }
.cu-note { font-size: 12.5px; color: var(--ink-2); max-width: 420px; line-height: 1.45; }
.av { display: inline-flex; width: 24px; height: 24px; border-radius: 50%; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 700; color: #fff; background: var(--c, #7A8B99); margin-right: -4px; border: 2px solid var(--surface); }
.due--late { color: var(--poor); font-weight: 600; }
.month-picker { display: flex; align-items: center; gap: 10px; margin: -4px 0 16px; flex-wrap: wrap; }
.tl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.tl-card { background: var(--surface-2); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: inherit; }
.tl-card.is-current { box-shadow: inset 0 0 0 2px var(--cyan); }
.tl-card strong { font-size: 15px; } .tl-card span { font-size: 12px; color: var(--muted); }
@media (max-width: 900px) { .dl-counters { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dl-counters .dl-progress { grid-column: 1 / -1; } }
.cu-prio { display: inline-flex; align-items: center; gap: 4px; color: var(--ink); } .cu-prio .ico { width: 15px; height: 15px; fill: currentColor; }

/* ---------- AI filters + prompts ---------- */
.ai-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: -6px 0 16px; }
.ai-filters .select { width: auto; min-width: 170px; height: 36px; font-size: 13px; }
.ai-filters__label { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.pr-cell { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 24px; border-radius: 8px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pr-yes { background: var(--good-bg); color: var(--good); } .pr-no { background: #F1F4F8; color: #A3B0BC; } .pr-na { color: #C5CED6; }
.pr-cit { font-size: 10px; margin-left: 3px; color: var(--ocean); }
.chip { display: inline-flex; padding: 1px 7px; border-radius: 6px; font-size: 11px; font-weight: 600; background: #EEF2F6; color: var(--ink-2); margin: 2px 4px 0 0; }
.chip--commercial { background: #E7F1FF; color: #1C5FB8; } .chip--informational { background: #F0EAFE; color: #5B3BB5; }
.pr-comp { font-size: 12px; color: var(--muted); max-width: 260px; }

/* ---------- Rankings (Semrush import) ---------- */
.kpi-grid--6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1100px) { .kpi-grid--6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) { .kpi-grid--6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rk-pos { display: inline-flex; min-width: 30px; justify-content: center; padding: 2px 6px; border-radius: 7px; font-weight: 700; font-size: 12.5px; }
.rk-pos--a { background: var(--good-bg); color: var(--good); } .rk-pos--b { background: #E7F1FF; color: #1C5FB8; }
.rk-pos--c { background: var(--avg-bg); color: var(--avg); } .rk-pos--d { background: #F1F4F8; color: var(--ink-2); }
.chip--intent-i { background: #F0EAFE; color: #5B3BB5; } .chip--intent-c { background: #E7F1FF; color: #1C5FB8; }
.chip--intent-t { background: var(--good-bg); color: var(--good); } .chip--intent-n { background: var(--avg-bg); color: var(--avg); }
.rk-movers { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.rk-movers__head { display: flex; align-items: center; gap: 6px; font-weight: 700; margin-bottom: 6px; }
.rk-mover { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.rk-mover__k { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .rk-mover__v { color: var(--muted); font-size: 12px; }
@media (max-width: 700px) { .rk-movers { grid-template-columns: 1fr; } }
.rk-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; }
@media (max-width: 900px) { .rk-grid { grid-template-columns: 1fr; } }
.rk-upload { display: flex; flex-direction: column; gap: 6px; }
.rk-upload input[type=file] { padding: 8px; height: auto; }
.rk-block { border: 2px solid var(--poor); background: var(--poor-bg); color: #6B1512; border-radius: 14px; padding: 14px 16px; margin-bottom: 16px; }
.rk-block__head { display: flex; align-items: center; gap: 8px; font-size: 15px; margin-bottom: 6px; color: var(--poor); }
.rk-block ul { margin: 6px 0 8px 18px; } .rk-block p { margin: 6px 0; }
tr.is-alert td { background: #FFF6F5; }
.rk-kws { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; }

/* Loading state for filters that reload the page */
.is-loading { position: relative; pointer-events: none; }
a.is-loading, select.is-loading { color: transparent !important; }
.is-loading::after { content: ""; position: absolute; top: 50%; left: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%;
  border: 2px solid var(--border-strong, #c5ced6); border-top-color: var(--cyan, #1aa7e0); animation: spin .7s linear infinite; }
select.is-loading { background-image: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .is-loading::after { animation-duration: 2s; } }

/* ---------- Report data export ---------- */
.rp-choice { display: flex; flex-direction: column; gap: 10px; margin: 4px 0 16px; }
.rp-opt { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; cursor: pointer; }
.rp-opt:has(input:checked) { border-color: var(--cyan); box-shadow: inset 0 0 0 1px var(--cyan); background: #F4FBFE; }
.rp-opt input { margin-top: 4px; } .rp-opt strong { display: block; margin-bottom: 2px; } .rp-opt small { color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.rp-opt .ico { width: 14px; height: 14px; vertical-align: -2px; color: var(--good); }
.rp-list { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.7; color: var(--ink-2); }

/* Deliverables: internal ("Hide") tasks — staff only */
.dl-int { display: none; margin-left: 6px; color: var(--muted); vertical-align: -2px; cursor: help; }
.dl-int .ico { width: 14px; height: 14px; }
.is-internal .dl-int { display: inline-flex; }
.is-internal .dl-name { text-decoration: line-through; text-decoration-thickness: 1.5px; text-decoration-color: rgba(16, 24, 40, .35); color: var(--ink-2); }
.dl-vis { display: inline; margin-right: 4px; }
.dl-vis button { color: var(--muted); }

/* ---------- Executive summary (navy card) ---------- */
.es { display: flex; flex-direction: column; gap: 18px; }
.es__label { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--cyan); margin-bottom: 10px; }
.es__label span { text-transform: none; letter-spacing: 0; font-weight: 500; color: #8FA6B5; }
.es__label .ico { width: 15px; height: 15px; }
.es__label .badge { text-transform: none; letter-spacing: 0; }
.es__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.es__item { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; color: #E8F0F5; }
.es__dot { flex: none; width: 22px; height: 22px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; background: rgba(255,255,255,.08); margin-top: 1px; }
.es__dot .ico { width: 13px; height: 13px; }
.es__item--good .es__dot { background: rgba(41,196,138,.18); color: #3DDC9C; }
.es__item--bad .es__dot { background: rgba(255,107,94,.18); color: #FF8A7E; }
.es__item--neutral .es__dot { color: #8FA6B5; }
.es__empty { color: #8FA6B5; font-size: 13px; margin: 0; }
.es__note { border-top: 1px solid rgba(255,255,255,.1); padding-top: 16px; }
.es__body { font-size: 14px; line-height: 1.6; color: #E8F0F5; }
.es__body p { margin: 0 0 8px; }
.es__meta, .es__hint { font-size: 12px; color: #8FA6B5; margin-top: 6px; }
.es__hist, .es__edit { margin-top: 12px; }
.es__hist summary, .es__edit summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--cyan); display: inline-flex; align-items: center; gap: 6px; }
.es__edit summary .ico { width: 14px; height: 14px; }
.es__hitem { margin-top: 10px; font-size: 13px; color: #C9D6DE; } .es__hitem p { margin: 4px 0; }
.es__months { display: flex; gap: 6px; align-items: center; font-size: 12.5px; color: #8FA6B5; margin: 10px 0 8px; flex-wrap: wrap; }
.es__months a { padding: 3px 9px; border-radius: 8px; color: #C9D6DE; text-decoration: none; background: rgba(255,255,255,.06); }
.es__months a.is-on { background: var(--cyan); color: var(--navy); font-weight: 600; }
.es__ta { width: 100%; min-height: 140px; resize: vertical; font-size: 14px; line-height: 1.5; }
.card--navy .btn--ghost { color: #DDE7EE; border-color: rgba(255,255,255,.2); background: transparent; }
.card--navy .btn--ghost:hover { background: rgba(255,255,255,.08); }

/* Client logos for reports */
.cl-logos { display: grid; grid-template-columns: 1fr 1fr auto; gap: 20px; align-items: end; }
.cl-logo { display: flex; gap: 14px; align-items: flex-start; }
.cl-logo__preview { flex: none; width: 160px; height: 72px; border-radius: 12px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border); padding: 10px; }
.cl-logo__preview--dark { background: var(--navy); border-color: var(--navy); }
.cl-logo__preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.cl-logo__preview span { font-size: 12px; color: var(--muted); }
@media (max-width: 1000px) { .cl-logos { grid-template-columns: 1fr; } }

/* ---------- Monthly report editor ---------- */
.mr-h { font-size: 13px; font-weight: 700; margin: 22px 0 10px; color: var(--ink); text-transform: none; }
.mr-h small { font-weight: 500; color: var(--muted); margin-left: 6px; }
.mr .field { margin-bottom: 10px; }
.mr textarea.input { min-height: 0; resize: vertical; }
.mr-row { display: grid; gap: 8px; margin-bottom: 10px; align-items: start; }
.mr-row--finding { grid-template-columns: 110px 100px 1fr; }
.mr-row--finding textarea { grid-column: 1 / -1; }
.mr-row--prio { grid-template-columns: 34px 1fr; }
.mr-row--prio textarea { grid-column: 2; }
.mr-row--closing { grid-template-columns: 1fr 1fr; }
.mr-num { display: inline-flex; align-items: center; justify-content: center; height: 36px; border-radius: 8px; background: var(--navy); color: #fff; font-size: 12px; font-weight: 700; }
.mr-inline { display: grid; grid-template-columns: 150px 1fr; gap: 10px; align-items: center; }
.mr-inline label { margin: 0; }
.mr-side { display: flex; flex-direction: column; gap: 16px; }
.mr-side .btn { justify-content: center; }
.check.is-off { color: var(--muted); }
@media (max-width: 900px) { .mr-row--finding { grid-template-columns: 1fr 1fr; } .mr-inline { grid-template-columns: 1fr; } }

.mr-opps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.mr-opps li { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; line-height: 1.45; }
.mr-opps span { color: var(--muted); }

/* ---- Brand Profile ---- */
.bp-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.bp-status { display: grid; gap: 10px; }
.bp-status__row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.bp-status__row .inline-form { display: inline-flex; gap: 6px; margin-left: auto; }
.bp-progress { height: 8px; border-radius: 99px; background: var(--surface-2, #E3ECFE); overflow: hidden; max-width: 420px; }
.bp-progress span { display: block; height: 100%; background: var(--ocean); border-radius: inherit; }
.bp-missing ul { margin: 6px 0 0; padding-left: 18px; columns: 2; font-size: 12.5px; }
.bp-shown { margin: 0 0 6px; }
.bp-sec { padding: 14px 0 6px; border-top: 1px solid #EDF1F6; }
.bp-sec:first-of-type { border-top: 0; }
.bp-sec__title, .bp-fs legend { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 700; margin: 0 0 8px; color: var(--ink); }
.bp-sec__title span, .bp-fs legend span { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 12px; }
.bp-q { margin: 0 0 14px; }
.bp-q h4 { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ocean); margin: 0 0 6px; }
.bp-dl { display: grid; grid-template-columns: minmax(180px, 30%) 1fr; gap: 6px 18px; margin: 0; font-size: 13.5px; }
.bp-dl dt { color: var(--muted); font-weight: 500; }
.bp-dl dd { margin: 0; white-space: normal; overflow-wrap: anywhere; }
.bp-dl dd.is-empty { color: var(--muted); font-style: italic; }
.bp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.bp-form .req, .bp-dl .req { color: var(--pink, #E73A6F); font-weight: 700; }
.bp-fs { border: 1px solid #E3EAF3; border-radius: 14px; padding: 14px 16px 4px; margin: 0 0 16px; }
.bp-fs legend { padding: 0 6px; margin: 0; }
.bp-actions { position: sticky; bottom: 0; background: var(--surface, #fff); padding: 12px 0 4px; border-top: 1px solid #EDF1F6; display: grid; gap: 4px; }
@media (max-width: 720px) { .bp-dl { grid-template-columns: 1fr; } .bp-dl dd { margin-bottom: 6px; } .bp-missing ul { columns: 1; } }
.bp-save { position: sticky; top: 8px; z-index: 5; display: inline-flex; align-items: center; gap: 8px; margin: 0 0 10px; padding: 6px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 4px 14px rgba(3, 20, 30, .08); font-size: 12.5px; font-weight: 600; color: var(--muted); }
.bp-save__i { display: none; width: 18px; height: 18px; }
.bp-save[data-bp-state="saved"] .bp-save__i--saved { display: block; color: var(--ocean); }
.bp-save[data-bp-state="saving"] .bp-save__i--saving { display: block; color: var(--cyan, #17B4EA); animation: bp-pulse 1s ease-in-out infinite; }
.bp-save[data-bp-state="dirty"] .bp-save__i--dirty { display: block; }
.bp-save[data-bp-state="error"] .bp-save__i--error { display: block; color: var(--pink, #E73A6F); }
.bp-save[data-bp-state="error"] { color: var(--pink, #E73A6F); border-color: color-mix(in srgb, var(--pink, #E73A6F) 40%, transparent); }
@keyframes bp-pulse { 0%, 100% { opacity: 1; transform: translateY(0); } 50% { opacity: .45; transform: translateY(-2px); } }
@media (prefers-reduced-motion: reduce) { .bp-save__i--saving { animation: none; } }
.bp-import { border: 1px dashed var(--border); border-radius: 14px; padding: 10px 14px; margin: 0 0 14px; background: var(--surface-2); }
.bp-import summary { cursor: pointer; font-weight: 600; color: var(--ocean); display: flex; align-items: center; gap: 8px; list-style: none; }
.bp-import summary::-webkit-details-marker { display: none; }
.bp-import__form { margin-top: 12px; }
.bp-import__mode { margin-bottom: 10px; }
