/* ============================================================
   WM CSAT portal - design system
   Matches WM ConfigHub / CMDB: lavender sidebar, teal accent,
   dark navy header. Login is its own dark navy split-screen.
   ============================================================ */

:root {
  --brand: #0d9488;
  --brand-600: #0f766e;
  --brand-700: #115e56;
  --brand-soft: #d8f2ee;
  --brand-ring: rgba(13, 148, 136, 0.24);

  --violet: #5b3df5;
  --violet-soft: #ede9ff;
  --gold: #ffc72c;

  --ok: #0f9d58;
  --ok-soft: #e4f6ec;
  --warn: #c07f00;
  --warn-soft: #fbf1d9;
  --bad: #d92d20;
  --bad-soft: #fdecea;
  --info: #1570ef;

  --bg: #f3f0fb;
  --surface: #ffffff;
  --surface-2: #f7f7fc;
  --surface-3: #eeecf7;
  --border: #e6e2f2;
  --border-strong: #d4cde8;

  --ink: #0f1729;
  --ink-2: #3a4256;
  --ink-3: #6b7186;
  --ink-inv: #ffffff;

  --sidebar-bg-1: #ece6fb;
  --sidebar-bg-2: #e2d9f7;
  --header-bg: #0f1e3d;
  --header-ink: #eef2fb;
  --header-ink-soft: #9fb0cf;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 18px 48px rgba(15, 23, 42, 0.16);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, monospace;

  --sidebar-w: 248px;
}

/* ---- Dark theme ---- toggled via [data-theme] on <html>; also follows the OS
   unless the user has explicitly chosen light. Only the role tokens are
   redefined — brand/status hues stay the same and are tuned to read on dark. */
:root { color-scheme: light; }

/* Dark palette — applied when the user toggles it, or (via the media query)
   when the OS is dark and the user has not explicitly chosen light. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --brand: #2dd4bf; --brand-600: #14b8a6; --brand-700: #0d9488;
  --brand-soft: #123b39; --brand-ring: rgba(45, 212, 191, 0.28);
  --violet: #a78bfa; --violet-soft: #2a2545;
  --ok: #34d399; --ok-soft: #123a2c;
  --warn: #fbbf24; --warn-soft: #3a2f12;
  --bad: #f87171; --bad-soft: #3d1f1f;
  --info: #60a5fa;
  --bg: #0e1420; --surface: #161d2b; --surface-2: #1c2536; --surface-3: #222c40;
  --border: #2a3448; --border-strong: #3a4762;
  --ink: #e7ecf4; --ink-2: #b7c1d4; --ink-3: #8a96ac; --ink-inv: #0e1420;
  --sidebar-bg-1: #141b28; --sidebar-bg-2: #1a2231;
  --header-bg: #0b1018; --header-ink: #e7ecf4; --header-ink-soft: #7f8ba3;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow: 0 4px 16px rgba(0,0,0,0.45);
  --shadow-lg: 0 18px 48px rgba(0,0,0,0.6);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --brand: #2dd4bf; --brand-600: #14b8a6; --brand-700: #0d9488;
    --brand-soft: #123b39; --brand-ring: rgba(45, 212, 191, 0.28);
    --violet: #a78bfa; --violet-soft: #2a2545;
    --ok: #34d399; --ok-soft: #123a2c;
    --warn: #fbbf24; --warn-soft: #3a2f12;
    --bad: #f87171; --bad-soft: #3d1f1f;
    --info: #60a5fa;
    --bg: #0e1420; --surface: #161d2b; --surface-2: #1c2536; --surface-3: #222c40;
    --border: #2a3448; --border-strong: #3a4762;
    --ink: #e7ecf4; --ink-2: #b7c1d4; --ink-3: #8a96ac; --ink-inv: #0e1420;
    --sidebar-bg-1: #141b28; --sidebar-bg-2: #1a2231;
    --header-bg: #0b1018; --header-ink: #e7ecf4; --header-ink-soft: #7f8ba3;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
    --shadow: 0 4px 16px rgba(0,0,0,0.45);
    --shadow-lg: 0 18px 48px rgba(0,0,0,0.6);
  }
}
/* Report + login: force the light palette regardless of theme — these are
   customer-facing / print artefacts and must be consistent. */
.report-page, .login-page { color-scheme: light; }

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { color: var(--ink); font-weight: 650; line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }

.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }

/* ---------- App shell ---------- */

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(190deg, var(--sidebar-bg-1), var(--sidebar-bg-2));
  border-right: 1px solid var(--border);
  padding: 16px 12px 14px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 8px 16px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(255,255,255,0.55);
}
.brand-mark {
  background: #fff; border-radius: 10px; padding: 7px 10px;
  display: inline-flex; box-shadow: var(--shadow-sm); flex-shrink: 0;
}
.brand-mark img { height: 34px; display: block; width: auto; }
.brand-name { font-weight: 750; font-size: 13.5px; letter-spacing: -0.01em; color: var(--ink); }
.brand-sub { font-size: 9px; text-transform: uppercase; letter-spacing: 0.15em; color: var(--ink-3); font-weight: 600; }

.sidebar-nav { flex: 1; overflow-y: auto; margin: 0 -4px; padding: 4px; }
.nav-group { margin-top: 14px; }
.nav-group:first-child { margin-top: 6px; }
.nav-group-label {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.13em;
  color: var(--ink-3); padding: 0 12px; margin-bottom: 4px; font-weight: 700;
}
.nav-link {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 12px; border-radius: 9px;
  color: var(--ink-2); font-weight: 550; font-size: 13px;
  margin-bottom: 1px; position: relative;
  transition: background .12s, color .12s;
}
.nav-link:hover { background: rgba(255,255,255,0.55); text-decoration: none; color: var(--ink); }
.nav-link.active { background: #fff; color: var(--brand-700); box-shadow: var(--shadow-sm); font-weight: 650; }
.nav-link.active::before {
  content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--brand);
}
.nav-link .ic { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.62; }
.nav-link:hover .ic, .nav-link.active .ic { opacity: 1; }
.nav-link .badge { margin-left: auto; }

.sidebar-foot { margin-top: 8px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.55); }
.sidebar-user { display: flex; align-items: center; gap: 9px; padding: 4px 6px; }
.avatar-sm { width: 30px; height: 30px; font-size: 11px; flex-shrink: 0; }
.icon-btn {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  border: 1px solid var(--border); background: rgba(255,255,255,0.6); color: var(--ink-3);
  cursor: pointer; flex-shrink: 0;
}
.icon-btn:hover { background: #fff; color: var(--bad); border-color: var(--border-strong); }
.icon-btn svg { width: 15px; height: 15px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); }

.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 0 32px; height: 58px;
  background: var(--header-bg);
  color: var(--header-ink);
  position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 17px; color: var(--header-ink); font-weight: 650; }
.topbar .spacer { flex: 1; }

.content { padding: 24px 32px 72px; max-width: 1760px; width: 100%; margin: 0 auto; }

/* ---------- User menu ---------- */

.usermenu { position: relative; }
.usermenu-btn {
  display: flex; align-items: center; gap: 9px;
  padding: 5px 12px 5px 5px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18); background: rgba(255,255,255,0.08);
  cursor: pointer; color: var(--header-ink); font: inherit;
}
.usermenu-btn:hover { background: rgba(255,255,255,0.14); }
.topbar .menu-toggle { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.18); color: var(--header-ink); }
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-600));
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12px;
}
.usermenu-pop {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  min-width: 220px; padding: 8px; display: none;
}
.usermenu-pop.open { display: block; }
.usermenu-pop .who { padding: 8px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.usermenu-pop a, .usermenu-pop button {
  display: flex; width: 100%; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 8px; color: var(--ink-2);
  background: none; border: none; font: inherit; cursor: pointer; text-align: left;
}
.usermenu-pop a:hover, .usermenu-pop button:hover { background: var(--surface-3); color: var(--ink); text-decoration: none; }

/* ---------- Cards ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 20px; }
.card-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.card-head h2 { font-size: 15px; }
.card-head .spacer { flex: 1; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }

/* Filter bars: keep selects/inputs inline, not full-width */
form.row select, form.row input[type=text], form.row input[type=email], form.row input[type=date],
form.row input[type=number], form.row input[type=search] {
  width: auto; min-width: 150px; max-width: 260px;
}
form.row select { padding-right: 30px; }

/* ---------- KPI tiles ---------- */

.kpi {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
  display: flex; flex-direction: column; gap: 6px;
  box-shadow: var(--shadow-sm);
}
.kpi-label { font-size: 12px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.kpi-value { font-size: 30px; font-weight: 720; letter-spacing: -0.02em; line-height: 1; }
.kpi-value small { font-size: 15px; font-weight: 600; color: var(--ink-3); }
.kpi-foot { font-size: 12px; color: var(--ink-3); }
.kpi.accent { border-color: var(--brand-ring); background: linear-gradient(180deg, var(--brand-soft), var(--surface) 80%); }
.kpi .delta.up { color: var(--ok); }
.kpi .delta.down { color: var(--bad); }

/* ---------- Badges / pills ---------- */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 650; letter-spacing: 0.02em;
  background: var(--surface-3); color: var(--ink-2);
  border: 1px solid var(--border);
}
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.badge.brand { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.badge.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; border-radius: var(--radius-sm);
  font: inherit; font-weight: 600; font-size: 13px;
  cursor: pointer; border: 1px solid transparent; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-600); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--border-strong); background: var(--surface-3); }
.btn-danger { background: var(--bad-soft); color: var(--bad); }
.btn-danger:hover { background: var(--bad); color: #fff; }
.btn-sm { padding: 6px 11px; font-size: 12px; }
.btn-lg { padding: 13px 22px; font-size: 15px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn-block { width: 100%; }

/* ---------- Forms ---------- */

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12px; font-weight: 650; color: var(--ink-2); }
.field .hint { font-size: 11px; color: var(--ink-3); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date],
select, textarea {
  width: 100%; padding: 9px 11px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 13px;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring);
}
textarea { min-height: 84px; resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .field-row { grid-template-columns: 1fr; } }
.checkbox { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; color: var(--ink-2); }
.checkbox input { width: auto; margin-top: 2px; }

/* ---------- Tables ---------- */

.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; padding: 11px 14px; font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--ink-3); font-weight: 700;
  border-bottom: 1px solid var(--border); background: var(--surface-2); position: sticky; top: 0;
}
table.data td { padding: 11px 14px; border-bottom: 1px solid var(--border); color: var(--ink-2); vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: var(--surface-2); }
table.data td.strong { color: var(--ink); font-weight: 600; }

/* ---------- Score visuals ---------- */

.gauge { display: flex; align-items: center; gap: 14px; }
.gauge svg { flex-shrink: 0; }
.score-big { font-size: 34px; font-weight: 750; letter-spacing: -0.02em; }

.meter { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 999px; background: var(--brand); }
.meter.ok > span { background: var(--ok); }
.meter.warn > span { background: var(--warn); }
.meter.bad > span { background: var(--bad); }

.bar-row { display: grid; grid-template-columns: 160px 1fr 46px; align-items: center; gap: 12px; padding: 7px 0; }
.bar-row .bar-label { font-size: 12px; color: var(--ink-2); }
.bar-row .bar-val { font-size: 12px; font-weight: 700; text-align: right; }

/* Dual-metric trend (CSAT + NPS) */
.trend2 {
  display: flex; align-items: flex-end; gap: 18px; height: 200px;
  padding: 8px 4px 0; border-bottom: 1px solid var(--border);
  background:
    linear-gradient(to top, transparent 0, transparent calc(15% - 1px), var(--border) 15%, transparent calc(15% + 1px)) no-repeat;
}
.trend2-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.trend2-bars { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 6px; width: 100%; }
.trend2-bars .tb {
  width: 38%; max-width: 42px; border-radius: 5px 5px 0 0; position: relative; min-height: 3px;
  display: flex; justify-content: center;
}
.trend2-bars .tb span {
  position: absolute; top: -18px; font-size: 10px; font-weight: 700; color: var(--ink-2); white-space: nowrap;
}
.tb-csat { background: linear-gradient(180deg, var(--brand-soft), var(--brand)); }
.tb-nps { background: linear-gradient(180deg, #ffe6a8, var(--gold)); }
.trend2-x { font-size: 11px; font-weight: 600; text-align: center; margin-top: 8px; color: var(--ink-2); line-height: 1.3; }
.trend2-x .muted { font-weight: 400; font-size: 10px; }
.trend2-baseline { margin-top: 8px; font-size: 11px; color: var(--ink-3); }

.trend { display: flex; align-items: flex-end; gap: 10px; height: 140px; padding-top: 8px; }
.trend .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.trend .col .bar { width: 100%; max-width: 46px; border-radius: 6px 6px 0 0; background: linear-gradient(180deg, var(--brand), var(--brand-600)); min-height: 3px; }
.trend .col .t { font-size: 10px; color: var(--ink-3); }
.trend .col .v { font-size: 11px; font-weight: 700; }

.pill-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11px; color: var(--ink-3); }
.pill-legend span::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }
.pill-legend .prom::before { background: var(--ok); }
.pill-legend .pass::before { background: var(--warn); }
.pill-legend .det::before { background: var(--bad); }

.nps-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; }
.nps-bar .prom { background: var(--ok); }
.nps-bar .pass { background: var(--warn); }
.nps-bar .det { background: var(--bad); }

/* ---------- Flash ---------- */

.flash {
  padding: 11px 16px; border-radius: var(--radius-sm); margin-bottom: 18px;
  font-size: 13px; font-weight: 550; border: 1px solid transparent;
}
.flash.success { background: var(--ok-soft); color: var(--ok); }
.flash.error { background: var(--bad-soft); color: var(--bad); }
.flash.info { background: var(--brand-soft); color: var(--brand); }

/* ---------- Misc ---------- */

.divider { height: 1px; background: var(--border); margin: 16px 0; }
.empty { padding: 44px 20px; text-align: center; color: var(--ink-3); }
.empty .big { font-size: 15px; color: var(--ink-2); margin-bottom: 4px; }

.breadcrumb { font-size: 12px; color: var(--ink-3); margin-bottom: 6px; }
.breadcrumb a { color: var(--ink-3); }

.tag-list { display: flex; gap: 6px; flex-wrap: wrap; }

.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 16px; font-size: 13px; }
.kv dt { color: var(--ink-3); }
.kv dd { color: var(--ink); }

details.inline-form { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0; }
details.inline-form > summary {
  padding: 10px 14px; cursor: pointer; font-weight: 600; font-size: 13px; list-style: none;
}
details.inline-form > summary::-webkit-details-marker { display: none; }
details.inline-form[open] > summary { border-bottom: 1px solid var(--border); }
details.inline-form .body { padding: 16px; }

.timeline { list-style: none; position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.timeline li { position: relative; padding: 8px 0; }
.timeline li::before { content: ""; position: absolute; left: -19px; top: 13px; width: 9px; height: 9px; border-radius: 50%; background: var(--brand); border: 2px solid var(--surface); }
.timeline .meta { font-size: 11px; color: var(--ink-3); }

/* ---------- Public survey ---------- */

.survey-page {
  min-height: 100vh; background: var(--bg);
  display: flex; flex-direction: column; align-items: center;
  padding: 40px 18px 80px;
}
.survey-card {
  width: 100%; max-width: 640px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.survey-hero {
  background: linear-gradient(150deg, #0f1e3d 0%, #124f57 55%, #0d9488 100%);
  color: #fff; padding: 30px 34px 26px; text-align: center;
}
.survey-logo {
  display: inline-flex; background: #fff; border-radius: 12px; padding: 8px 14px;
  box-shadow: 0 8px 26px rgba(0,0,0,0.25); margin-bottom: 14px;
}
.survey-logo img { height: 24px; display: block; }
.survey-hero .eyebrow { font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; opacity: 0.8; }
.survey-hero h1 { color: #fff; font-size: 22px; margin-top: 8px; line-height: 1.25; }
.survey-hero p { color: rgba(255,255,255,0.86); font-size: 13.5px; margin-top: 10px; line-height: 1.6; }
.survey-meta {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px;
  margin-top: 16px; font-size: 11.5px; color: rgba(255,255,255,0.82);
}

.survey-progress { height: 4px; background: var(--surface-3); }
.survey-progress > span { display: block; height: 100%; background: var(--brand); transition: width .35s var(--ease-slow, ease); border-radius: 0 3px 3px 0; }

.survey-body { padding: 24px 34px 30px; }
.q { padding: 20px 0; border-bottom: 1px solid var(--border); }
.q:last-of-type { border-bottom: none; }
.q .q-label { font-weight: 650; font-size: 14.5px; color: var(--ink); line-height: 1.45; }
.q .q-help { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.q .q-req { color: var(--bad); margin-left: 3px; }

.scale { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.scale.wide { gap: 5px; }
.scale label {
  flex: 1; min-width: 38px; text-align: center; cursor: pointer;
  border: 1.5px solid var(--border-strong); border-radius: 9px;
  padding: 12px 2px; font-weight: 700; font-size: 14px; color: var(--ink-2);
  background: var(--surface); transition: all .12s; position: relative;
}
.scale label:hover { border-color: var(--brand); color: var(--brand-700); }
.scale input { position: absolute; opacity: 0; pointer-events: none; }
.scale label.checked { background: var(--brand); border-color: var(--brand); color: #fff; }
.scale.nps label.checked[data-v="0"], .scale.nps label.checked[data-v="1"], .scale.nps label.checked[data-v="2"],
.scale.nps label.checked[data-v="3"], .scale.nps label.checked[data-v="4"], .scale.nps label.checked[data-v="5"],
.scale.nps label.checked[data-v="6"] { background: var(--bad); border-color: var(--bad); }
.scale.nps label.checked[data-v="7"], .scale.nps label.checked[data-v="8"] { background: var(--warn); border-color: var(--warn); }
.scale-ends { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-3); margin-top: 7px; }

.faces { display: flex; gap: 8px; margin-top: 14px; }
.faces label {
  flex: 1; text-align: center; cursor: pointer; padding: 12px 4px;
  border: 1.5px solid var(--border-strong); border-radius: 10px;
  background: var(--surface); transition: all .12s; position: relative;
}
.faces label .face { font-size: 26px; display: block; filter: grayscale(0.45); }
.faces label .fl { font-size: 10px; color: var(--ink-3); margin-top: 4px; display: block; }
.faces label:hover { border-color: var(--brand); }
.faces label.checked { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.faces label.checked .face { filter: none; }
.faces label.checked .fl { color: var(--brand-700); font-weight: 700; }
.faces input { position: absolute; opacity: 0; pointer-events: none; }

/* Grouped service-dimension ratings */
.q-group {
  margin: 8px 0; padding: 18px 18px 6px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface-2);
}
.q-group-head { font-weight: 700; font-size: 14px; color: var(--ink); }
.q-group-sub { font-size: 11.5px; color: var(--ink-3); margin: 2px 0 10px; }
.dim-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 11px 0; border-top: 1px solid var(--border);
}
.dim-row:first-of-type { border-top: none; }
.dim-label { font-size: 13px; color: var(--ink-2); font-weight: 550; flex: 1; }
.dim-scale { display: flex; gap: 5px; flex-shrink: 0; }
.dim-scale label {
  width: 34px; text-align: center; cursor: pointer; padding: 8px 0;
  border: 1.5px solid var(--border-strong); border-radius: 8px;
  font-weight: 700; font-size: 13px; color: var(--ink-2); background: var(--surface);
  transition: all .12s; position: relative;
}
.dim-scale label:hover { border-color: var(--brand); }
.dim-scale input { position: absolute; opacity: 0; pointer-events: none; }
.dim-scale label.checked { background: var(--brand); border-color: var(--brand); color: #fff; }
@media (max-width: 520px) {
  .dim-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .dim-scale label { width: 40px; }
}

.consent-box {
  display: flex; gap: 10px; align-items: flex-start; margin-top: 14px;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface-2); font-size: 13px; color: var(--ink-2); line-height: 1.5;
}
.consent-box input { width: auto; margin-top: 2px; flex-shrink: 0; }

.survey-foot { padding: 18px 34px 24px; background: var(--surface-2); border-top: 1px solid var(--border); }
.autosave-note { font-size: 11px; color: var(--ink-3); margin-top: 12px; text-align: center; }

/* ---------- Login (navy -> teal brand panel, light form panel) ---------- */

.login-page {
  position: relative; min-height: 100vh; min-height: 100dvh;
  overflow-x: hidden; overflow-y: auto;
  background: var(--bg); color: var(--ink);
  --ease-slow: cubic-bezier(0.22, 1, 0.36, 1);
}

.login-ambient { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.login-orb { position: absolute; border-radius: 50%; filter: blur(52px); opacity: 0.5;
  animation: loginOrbFloat 15s var(--ease-slow) infinite alternate; }
.login-orb-a { width: 360px; height: 360px; left: -90px; top: 14%;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.55), transparent 68%); }
.login-orb-b { width: 440px; height: 440px; left: 22%; top: -60px; animation-delay: -4s;
  background: radial-gradient(circle, rgba(255, 199, 44, 0.28), transparent 70%); }
.login-orb-c { width: 320px; height: 320px; left: 8%; bottom: -90px; animation-delay: -7s;
  background: radial-gradient(circle, rgba(91, 61, 245, 0.3), transparent 70%); }
@keyframes loginOrbFloat { 0% { transform: translate3d(0,0,0) scale(1); } 100% { transform: translate3d(24px,-28px,0) scale(1.08); } }

.login-shell {
  position: relative; z-index: 1; min-height: 100vh; min-height: 100dvh;
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(380px, 0.82fr);
}

.login-brand {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 1.2rem;
  padding: clamp(1.6rem, 4vw, 3rem) clamp(1.6rem, 4.5vw, 3.6rem); color: #eef7f5;
  background: linear-gradient(158deg, #0f1e3d 0%, #124f57 52%, #0d9488 100%);
  overflow: hidden;
}
.login-brand::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: radial-gradient(ellipse 78% 68% at 26% 16%, #000 0%, transparent 78%);
  animation: loginGridDrift 24s linear infinite;
}
@keyframes loginGridDrift { from { background-position: 0 0, 0 0; } to { background-position: 38px 38px, 38px 38px; } }
.login-brand > * { position: relative; z-index: 1; }

.login-brand-top { display: flex; align-items: center; gap: 0.9rem; }
.login-brand-logo {
  height: 30px; width: auto; display: block; padding: 7px 11px;
  background: #fff; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,0.28);
}
.login-brand-divider { width: 1px; height: 26px; background: rgba(255,255,255,0.24); }
.brand-wordmark {
  font-weight: 800; font-size: 1.3rem; letter-spacing: 0.05em;
  background: linear-gradient(90deg, #ffffff 0%, #d7f5f0 45%, #ffc72c 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.login-brand-body { max-width: 640px; margin: auto 0; padding: clamp(1rem, 3vh, 2.6rem) 0; }
.login-brand-body h1 { font-size: clamp(1.5rem, 2.6vw, 2.15rem); line-height: 1.15; }
.login-brand-body h1 {
  margin: 0 0 1rem; font-size: clamp(1.9rem, 2.5vw, 2.5rem); line-height: 1.2;
  color: #ffffff; font-weight: 760; letter-spacing: -0.015em; max-width: 20ch;
}
.login-brand-body > p { margin: 0 0 2rem; color: rgba(255, 255, 255, 0.78); line-height: 1.7; font-size: 1rem; max-width: 52ch; }

.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #ffd97a; flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(255,217,122,0.7); animation: livePing 2s ease-out infinite; }
@keyframes livePing { 0% { box-shadow: 0 0 0 0 rgba(255,217,122,0.55); } 70%,100% { box-shadow: 0 0 0 8px rgba(255,217,122,0); } }

/* Live programme snapshot panel */
.brand-metrics {
  margin: 0.2rem 0 1.7rem; max-width: 380px;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.16);
  border-radius: 16px; padding: 1rem 1.15rem 1.1rem; backdrop-filter: blur(8px);
  box-shadow: 0 20px 46px rgba(6, 20, 28, 0.34);
  animation: bmIn 0.7s var(--ease-slow) both;
}
@keyframes bmIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.bm-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.9rem; }
.bm-head-label { font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: rgba(255,255,255,0.7); }
.bm-period { margin-left: auto; font-size: 0.64rem; font-weight: 700; padding: 0.2rem 0.5rem; border-radius: 999px; background: rgba(255,255,255,0.14); color: rgba(255,255,255,0.85); }
.bm-grid { display: flex; align-items: center; gap: 1.1rem; }
.bm-gauge { position: relative; flex-shrink: 0; }
.bm-gauge svg { display: block; }
.bm-arc { animation: bmArc 2s var(--ease-slow) 0.3s both; }
@keyframes bmArc { from { stroke-dashoffset: 289; } to { stroke-dashoffset: 43; } }
.bm-gauge-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 0 12px; }
.bm-gauge-c strong { font-size: 1.35rem; font-weight: 800; line-height: 1; color: #fff; }
.bm-gauge-c span { font-size: 0.56rem; letter-spacing: 0.04em; text-transform: uppercase; color: rgba(255,255,255,0.68); margin-top: 0.3rem; line-height: 1.25; }
.bm-side { flex: 1; display: flex; flex-direction: column; gap: 0.55rem; }
.bm-stat { display: flex; align-items: baseline; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 0.5rem; }
.bm-side .bm-stat:last-child { border-bottom: none; padding-bottom: 0; }
.bm-k { font-size: 0.72rem; color: rgba(255,255,255,0.62); }
.bm-v { font-size: 1rem; font-weight: 750; color: #fff; }
.bm-v i { font-size: 0.68rem; font-weight: 600; font-style: normal; color: rgba(255,255,255,0.55); }
.bm-nps { display: flex; height: 8px; border-radius: 999px; overflow: hidden; margin: 0.95rem 0 0.5rem; background: rgba(255,255,255,0.1); }
.bm-nps-seg { display: block; height: 100%; animation: bmSeg 1.1s var(--ease-slow) 0.5s both; transform-origin: left; }
@keyframes bmSeg { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.bm-prom { background: #39d8a6; } .bm-pass { background: #ffc72c; } .bm-det { background: #ff7a70; }
.bm-legend { display: flex; gap: 0.9rem; font-size: 0.62rem; color: rgba(255,255,255,0.6); }
.bm-legend .bm-l::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 2px; margin-right: 0.32rem; vertical-align: middle; }
.bm-legend .bm-prom::before { background: #39d8a6; } .bm-legend .bm-pass::before { background: #ffc72c; } .bm-legend .bm-det::before { background: #ff7a70; }
.bm-foot { display: flex; align-items: center; gap: 0.5rem; font-size: 0.7rem; color: rgba(255,255,255,0.62); margin-top: 0.85rem; padding-top: 0.75rem; border-top: 1px solid rgba(255,255,255,0.1); }
.bm-foot-dot { width: 6px; height: 6px; border-radius: 50%; background: #39d8a6; box-shadow: 0 0 8px rgba(57,216,166,0.8); }

.login-stats { display: flex; gap: 1.4rem; margin: 1.4rem 0; flex-wrap: wrap; }
.login-stats > div { display: flex; flex-direction: column; }
.login-stats strong { font-size: 1.55rem; font-weight: 800; color: #fff; line-height: 1; }
.login-stats span { font-size: 0.72rem; color: rgba(255,255,255,0.7); margin-top: 4px; max-width: 130px; }
.login-feature-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.7rem; }
.login-feature-list li {
  position: relative; padding-left: 1.5rem; color: rgba(255,255,255,0.85);
  font-size: 0.92rem; line-height: 1.5;
}
.login-feature-list li::before {
  content: ''; position: absolute; left: 0; top: 0.42rem; width: 8px; height: 8px; border-radius: 2px;
  background: #ffc72c; box-shadow: 0 0 10px rgba(255,199,44,0.6);
}

.login-brand-footer { color: rgba(255,255,255,0.55); font-size: 0.8rem; }

.login-form-panel {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 2.5rem; overflow: hidden; background: var(--surface);
}
.login-form-panel::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(15,23,41,0.05) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(ellipse 65% 55% at 72% 82%, #000 0%, transparent 75%);
}
.login-card {
  position: relative; z-index: 1; width: 100%; max-width: 424px;
  padding: 2rem 1.9rem 1.7rem; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}
.login-card-head { margin-bottom: 1.6rem; }
.login-card-head h2 { margin: 0 0 0.35rem; color: var(--ink); font-size: 1.4rem; font-weight: 750; }
.login-card-head p { margin: 0; color: var(--ink-3); font-size: 0.9rem; }

.role-toggle {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.3rem; padding: 0.3rem;
  border-radius: 10px; background: var(--surface-3); border: 1px solid var(--border);
  margin-bottom: 1.4rem;
}
.role-toggle-3 { grid-template-columns: 1fr 1fr 1fr; }
.role-option {
  display: flex; align-items: center; justify-content: center; gap: 0.4rem;
  border: none; border-radius: 7px; padding: 0.62rem 0.7rem; background: transparent;
  color: var(--ink-3); font-size: 0.85rem; font-weight: 600; cursor: pointer;
  transition: background .2s, color .2s, box-shadow .2s;
}
.role-option svg { width: 15px; height: 15px; flex-shrink: 0; }
.role-option:hover { color: var(--ink); }
.role-option.active {
  background: var(--surface); color: var(--brand-700);
  box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--brand-ring);
}

.login-form label {
  display: flex; flex-direction: column; gap: 0.42rem; margin-bottom: 1rem;
  color: var(--ink-2); font-size: 0.82rem; font-weight: 600;
}
.login-form input {
  width: 100%; padding: 0.72rem 0.8rem; border-radius: 9px;
  border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--ink); font: inherit; font-size: 0.9rem;
}
.login-form input::placeholder { color: var(--ink-3); opacity: 0.7; }
.login-form input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }

.login-form .primary {
  width: 100%; margin-top: 0.6rem; padding: 0.82rem 1.1rem; font-size: 0.95rem; font-weight: 650;
  border: none; border-radius: 9px; cursor: pointer; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-600));
  transition: transform .1s, box-shadow .3s, background .2s;
}
.login-form .primary:hover { background: var(--brand-600); box-shadow: 0 10px 26px rgba(13, 148, 136, 0.35); }
.login-form .primary:active { transform: translateY(1px); }

.btn-sso {
  display: flex; align-items: center; justify-content: center; gap: 0.6rem;
  width: 100%; padding: 0.8rem 1.1rem; font-size: 0.92rem; font-weight: 600;
  border: 1px solid var(--border); border-radius: 9px; cursor: pointer;
  color: var(--ink); background: #fff; text-decoration: none;
  transition: border-color .15s, box-shadow .15s;
}
.btn-sso:hover { border-color: var(--brand); box-shadow: 0 4px 14px rgba(13,148,136,0.12); }
.sso-divider { display: flex; align-items: center; gap: 0.8rem; margin: 1rem 0; color: var(--ink-3); font-size: 0.75rem; }
.sso-divider::before, .sso-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.login-legal { margin: 1.3rem 0 0; padding-top: 1rem; border-top: 1px solid var(--border); font-size: 0.72rem; color: var(--ink-3); }

.alert {
  background: var(--bad-soft); color: var(--bad); border: 1px solid transparent;
  border-radius: 8px; padding: 0.7rem 0.9rem; margin-bottom: 1rem; font-size: 0.86rem; font-weight: 550;
}

@media (prefers-reduced-motion: reduce) {
  .login-orb, .login-brand::before, .live-dot, .flow-runner { animation: none; }
}
@media (max-width: 1060px) {
  .login-shell { grid-template-columns: 1fr; min-height: auto; }
  .login-page { align-items: stretch; }
  .login-brand { padding: 2rem 1.8rem; }
  .login-brand-body { padding: 1.2rem 0; margin: 1rem 0; }
  .flow-viz:nth-of-type(2) { display: none; }
  .login-form-panel { padding: 2rem 1.4rem 3rem; min-height: auto; }
  .login-stats { gap: 1rem; }
}
@media (max-width: 560px) {
  .flow-viz { display: none; }
  .brand-wordmark { font-size: 1.05rem; }
  .login-brand-top { flex-wrap: wrap; }
  .login-stats > div { min-width: 90px; }
}
/* short viewports: don't clip the brand column */
@media (max-height: 760px) and (min-width: 1061px) {
  .login-brand { justify-content: center; }
  .login-brand-top { position: absolute; top: 1.6rem; left: clamp(1.6rem,4.5vw,3.6rem); }
  .login-brand-footer { position: absolute; bottom: 1.4rem; }
}

.status-page {
  min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg);
}
.status-box {
  max-width: 460px; text-align: center; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 44px 36px; box-shadow: var(--shadow);
}
.status-box .icon { font-size: 40px; }
.status-box h1 { margin: 14px 0 8px; }
.status-box p { color: var(--ink-3); font-size: 14px; }

@media (max-width: 860px) {
  .sidebar { position: fixed; left: -100%; z-index: 100; transition: left .2s; box-shadow: var(--shadow-lg); }
  .sidebar.open { left: 0; }
  .menu-toggle { display: inline-flex !important; }
  .content { padding: 18px 16px 60px; }
  .topbar { padding: 12px 16px; }
}
.menu-toggle { display: none; }

/* ============================================================
   CloudScope portal — additions
   ============================================================ */

.region-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px 14px; margin: 8px 0; }

/* maturity posture pill (replaces the A-F letter grade) */
.posture-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px;
  border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--ink-1); }
.posture-pill .posture-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.posture-pill .posture-score { font-variant-numeric: tabular-nums; opacity: .7; font-weight: 700; }
.posture-strong   { color: #0f7a4f; border-color: #9ad9be; background: #e8f7f0; }
.posture-good     { color: #1f7a3d; border-color: #a9dcb8; background: #eaf7ee; }
.posture-moderate { color: #9a6a00; border-color: #e9cf8f; background: #fbf2dc; }
.posture-weak     { color: #a4531b; border-color: #efc09a; background: #fbecdf; }
.posture-critical { color: #a12d2d; border-color: #eaa9a9; background: #fbe9e9; }
.posture-muted    { color: var(--ink-3); }
.posture-lg { font-size: 15px; padding: 6px 16px 6px 12px; }
.posture-lg .posture-dot { width: 10px; height: 10px; }

/* ===== Settings page (enterprise layout) ===== */
.settings-status {
  display: flex; flex-wrap: wrap; gap: 8px 28px; padding: 14px 18px; margin-bottom: 18px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.settings-status .st-item { display: flex; align-items: center; gap: 9px; }
.settings-status .st-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); flex: none; }
.settings-status .st-dot.ok { background: var(--ok); }
.settings-status .st-dot.warn { background: var(--warn); }
.settings-status .st-dot.bad { background: var(--bad); }
.settings-status .st-k { display: block; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.settings-status .st-v { display: block; font-size: 13px; font-weight: 600; }

.settings-layout { display: grid; grid-template-columns: 190px 1fr; gap: 28px; align-items: start; }
.settings-nav { position: sticky; top: 18px; display: flex; flex-direction: column; gap: 2px; }
.settings-nav a {
  padding: 8px 12px; border-radius: 8px; font-size: 13px; font-weight: 500;
  color: var(--ink-2); text-decoration: none; border-left: 2px solid transparent;
}
.settings-nav a:hover { background: var(--surface-2); }
.settings-nav a.active { background: var(--brand-soft); color: var(--brand-700); border-left-color: var(--brand); font-weight: 600; }

.settings-body { min-width: 0; }
.settings-section { margin-bottom: 26px; }
.settings-section.tab-hidden { display: none; }
.settings-section > header { margin-bottom: 12px; }
.settings-section > header h2 { font-size: 16px; font-weight: 700; }
.settings-section > header p { font-size: 13px; color: var(--ink-3); margin-top: 3px; max-width: 620px; line-height: 1.5; }
.settings-section .card-head h3 { font-size: 13px; font-weight: 650; }

.weight-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 14px; }
.weight-grid .field { margin: 0; }

.status-line { font-size: 12.5px; line-height: 1.6; padding: 10px 12px; border-radius: 9px; }
.status-line.ok { background: var(--ok-soft); color: #0b6b3d; }
.status-line.bad { background: var(--bad-soft); color: var(--bad); }

.callout { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; font-size: 13px; line-height: 1.55; }
.copybox { background: var(--surface); border: 1px solid var(--border); border-radius: 7px; padding: 7px 10px; font-size: 12px; word-break: break-all; }

.settings-savebar {
  position: sticky; bottom: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px 18px; margin: 0 -4px;
  background: rgba(255,255,255,0.92); backdrop-filter: blur(6px);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}

@media (max-width: 900px) {
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { position: static; flex-direction: row; flex-wrap: wrap; margin-bottom: 8px; }
  .settings-nav a { border-left: 0; border-bottom: 2px solid transparent; }
  .settings-nav a.active { border-left: 0; border-bottom-color: var(--brand); }
  .weight-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Dashboard — pillar bars */
.pillar-bars { display: flex; flex-direction: column; gap: 9px; }
.pillar-bar-row { display: grid; grid-template-columns: 130px 1fr 120px; align-items: center; gap: 12px; }
.pillar-bar-label { font-size: 13px; font-weight: 500; }
.pillar-bar-track { height: 9px; border-radius: 5px; background: var(--border); overflow: hidden; }
.pillar-bar-fill { height: 100%; border-radius: 5px; background: currentColor; transition: width .3s; }
.pillar-bar-val { font-size: 13px; font-variant-numeric: tabular-nums; text-align: right; }

/* AWS connection picker (customer add / edit) */
.conn-fieldset { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin: 14px 0; background: var(--surface-2); }
.conn-fieldset > legend { padding: 0 8px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.conn-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.conn-opt:last-of-type { border-bottom: 0; }
.conn-opt input[type="radio"] { margin-top: 3px; flex: none; }
.conn-opt > span { font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.conn-key-fields, .conn-pane { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.conn-key-fields[hidden], .conn-pane[hidden] { display: none; }
.conn-tabs { display: flex; flex-direction: column; gap: 4px; }
.conn-steps { margin: 0 0 12px 18px; padding: 0; line-height: 1.9; }
.conn-steps li { margin-bottom: 2px; }

/* Users page — user edit rows */
.user-edit-grid { display: flex; flex-direction: column; gap: 8px; max-width: 640px; }
.user-edit-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.user-edit-form .field { margin: 0; flex: 1 1 200px; }
.user-edit-form .field input, .user-edit-form .field select { width: 100%; }

a.card-link { display: block; color: inherit; text-decoration: none; transition: border-color .12s, box-shadow .12s; }
a.card-link:hover { border-color: var(--brand); box-shadow: 0 2px 10px rgba(13,148,136,.12); }

/* maturity ladder (assessment header / report) */
.maturity-ladder { display: flex; gap: 4px; margin-top: 8px; }
.maturity-ladder .rung { flex: 1; height: 6px; border-radius: 3px; background: var(--border); }
.maturity-ladder .rung.on { background: var(--brand); }

/* collection progress */
.progress-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 18px; }
.prog-item { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.prog-item .prog-state { margin-left: auto; font-size: 11px; color: var(--ink-3); text-transform: capitalize; }
.prog-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--border-strong); flex-shrink: 0; }
.prog-dot.running { background: var(--brand); animation: pulse 1s ease-in-out infinite; }
.prog-dot.done { background: var(--ok); }
.prog-dot.partial { background: var(--warn); }
.prog-dot.error { background: var(--bad); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

/* gauge */
.gauge-wrap { position: relative; display: inline-block; }
.gauge-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.gauge-c strong { font-size: 20px; font-weight: 780; line-height: 1; color: var(--ink); }
.gauge-c span { font-size: 9px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); margin-top: 3px; text-align: center; }

.scorecard-row { display: flex; flex-wrap: wrap; gap: 20px 28px; justify-content: space-around; }
.score-cell { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }

.row-muted td { opacity: 0.5; }

/* ---- customer report (standalone) ---- */
.report-page { background: var(--bg); color: var(--ink); }
.report { max-width: 900px; margin: 0 auto; padding: 32px 24px 80px; }
.report-cover { text-align: center; padding: 28px 0 32px; border-bottom: 3px solid var(--brand); margin-bottom: 28px; }
.report-logo { height: 34px; margin-bottom: 12px; }
.report-wordmark { font-size: 13px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--brand); margin-bottom: 6px; }
.ai-briefing { margin-top: 16px; padding: 14px 16px; border: 1px solid var(--brand-ring); border-left: 3px solid var(--brand); border-radius: 10px; background: var(--brand-soft); }
.ai-briefing-head { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-bottom: 8px; }
.ai-briefing p { margin: 0 0 8px; }
.ai-briefing ol { margin: 4px 0 0 18px; }
tr.sev-warn td { background: var(--warn-soft); }
.report-cover h1 { font-size: 28px; letter-spacing: -0.01em; }
.report-cover-meta { display: flex; flex-wrap: wrap; gap: 14px 40px; justify-content: center; margin-top: 20px; }
.report-cover-meta > div { display: flex; flex-direction: column; }
.report-cover-meta span { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.report-cover-meta strong { font-size: 14px; margin-top: 2px; }
.report-actions { margin-top: 22px; display: flex; gap: 8px; justify-content: center; }

.report-section { margin-bottom: 28px; }
.report-section > h2 { font-size: 18px; padding-bottom: 6px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.report-section > h3 { font-size: 13px; margin: 16px 0 6px; color: var(--ink-2); }

.exec-grid { display: grid; grid-template-columns: auto 1.4fr 1fr; gap: 20px; align-items: center; }
.exec-grade { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 130px; height: 130px; border-radius: 16px; border: 2px solid var(--border); text-align: center; }
.exec-grade.grade-ok { border-color: var(--ok); background: var(--ok-soft); }
.exec-grade.grade-warn { border-color: var(--warn); background: var(--warn-soft); }
.exec-grade.grade-bad { border-color: var(--bad); background: var(--bad-soft); }
.exec-grade-letter { font-size: 48px; font-weight: 800; line-height: 1; }
.exec-savings-big { font-size: 30px; font-weight: 780; letter-spacing: -0.02em; margin: 4px 0; }
.exec-savings-big span { font-size: 15px; font-weight: 600; color: var(--ink-3); }

.report-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin: 6px 0 4px; }
.report-table th { text-align: left; padding: 8px 10px; background: var(--surface-2); border-bottom: 2px solid var(--border); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-3); }
.report-table td { padding: 7px 10px; border-bottom: 1px solid var(--border); }
.report-table .right, .right { text-align: right; }
.report-table .total-row td { border-top: 2px solid var(--border-strong); border-bottom: none; }

.finding-block { border-left: 3px solid var(--border-strong); padding: 8px 0 8px 14px; margin-bottom: 12px; }
.finding-block.sev-bad { border-color: var(--bad); }
.finding-block.sev-warn { border-color: var(--warn); }
.finding-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.finding-block p { margin-top: 4px; color: var(--ink-2); line-height: 1.55; }
.finding-block .rec { color: var(--ink); }

.report-footer { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 11px; color: var(--ink-3); }

@media print {
  .no-print { display: none !important; }
  .report { max-width: none; padding: 0; }
  .report-section { page-break-inside: avoid; }
  .page-break { page-break-before: always; }
  body { background: #fff; }
}
