/* ── Group AI Progress — live admin-tab equivalent of the CEO one-pager ──
   Same design tokens/classes as the one-pager's own light-print theme
   (Miroma/ai-usage-reporting/Group Reports/<period>/onepager.template.html),
   ported to a `.gr-` prefix and a fluid, browser-admin layout instead of a
   fixed A4 print sheet. Values match css/claude-usage.css's `.cu--light`
   tokens (#111/#6B6A64/#C9A21A/#fafafa/#EDECE6…) since that's the same
   palette already used elsewhere in the Hub. */

.gr-root {
  --gr-bg: #fff; --gr-surface: #fafafa; --gr-surface2: #f5f5f2;
  --gr-border: rgba(0,0,0,0.12); --gr-divider: rgba(0,0,0,0.08);
  --gr-text: #111; --gr-muted: #6B6A64; --gr-sub: #6B6A64;
  --gr-track: #EDECE6; --gr-bar: #111; --gr-bar-mut: #9C9A90; --gr-accent: #C9A21A;
  font-family: 'PPNeueMontreal', 'Lato', system-ui, sans-serif;
  color: var(--gr-text);
  max-width: 1200px;
  background: var(--gr-bg);
  border-radius: 12px;
}

/* ── dark theme (opt-in via the light/dark toggle) ──
   Light is the default (the report's designed look); .gr-dark flips the
   tokens to the same dark palette the per-agency usage reports use, and fixes
   the few hardcoded light colours that don't come from a token. */
.gr-dark {
  --gr-bg: #0b0b0b; --gr-surface: #141414; --gr-surface2: #1c1c1c;
  --gr-border: rgba(255,255,255,0.14); --gr-divider: rgba(255,255,255,0.08);
  --gr-text: #fff; --gr-muted: rgba(255,255,255,0.55); --gr-sub: rgba(255,255,255,0.6);
  --gr-track: rgba(255,255,255,0.10); --gr-bar: #fff; --gr-bar-mut: rgba(255,255,255,0.45);
  --gr-accent: #FFE255;
  padding: 24px;
}
.gr-dark .gr-kpi { border-top-color: rgba(255,255,255,0.22); }
.gr-dark .gr-mtx__z { color: rgba(255,255,255,0.25); }
.gr-dark .gr-callout { background: rgba(255,226,85,0.08); border-color: rgba(255,226,85,0.35); color: rgba(255,255,255,0.78); }
.gr-dark .gr-callout b { color: #FFE255; }
.gr-dark .gr-flag { background: rgba(255,226,85,0.08); border-color: rgba(255,226,85,0.35); color: #FFE255; }

.gr-root h2, .gr-root h3 { margin: 0; }

/* ── numbered question sections ──
   Each of the four report sections is headed by a small gold "Section 0N"
   eyebrow (echoing the per-agency usage report's .cu-section-title caption)
   and the plain-English question it answers, with a divider underneath so the
   four blocks read as distinct chapters rather than one long scroll. */
.gr-section { margin-bottom: 32px; }
.gr-section:last-of-type { margin-bottom: 20px; }
.gr-section__head { margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--gr-border); }
.gr-section__num { font-size: 11px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--gr-accent); margin-bottom: 5px; }
.gr-section__q { font-size: 19px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.25; color: var(--gr-text); }
@media (max-width: 600px) { .gr-section__q { font-size: 16px; } }

/* ── header ── */
.gr-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }

/* Glow modifier — same "searchlight glow" as the per-agency report heroes (a soft
   gold radial gradient on a card), applied BEHIND the existing header bar with no
   large headline. Light by default (cream + soft gold), dark under .gr-dark. */
.gr-head--glow { position: relative; overflow: hidden; padding: 20px 22px; border-radius: 8px;
                 background: #f5f5f2; border: 1px solid rgba(0,0,0,0.12); }
.gr-head--glow::after { content: ''; position: absolute; right: -30px; top: -120px;
                 width: 460px; height: 460px; border-radius: 50%; pointer-events: none;
                 background: radial-gradient(circle at 50% 50%, rgba(201,162,26,.34), rgba(201,162,26,0) 68%); }
.gr-head--glow > * { position: relative; z-index: 1; }
.gr-dark .gr-head--glow { background: #141414; border-color: rgba(255,255,255,0.12); }
.gr-dark .gr-head--glow::after {
                 background: radial-gradient(circle at 50% 50%, rgba(255,226,85,.58), rgba(255,226,85,0) 68%); }
.gr-head__actions { display: flex; align-items: center; gap: 8px; }
.gr-eyebrow { font-size: 11px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--gr-muted); margin-bottom: 4px; }
.gr-h1 { font-size: 24px; font-weight: 500; letter-spacing: -0.01em; }
.gr-badge { display: inline-block; font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
            padding: 5px 10px; background: var(--gr-surface2); border: 1px solid var(--gr-border); color: var(--gr-muted); border-radius: 4px; }
.gr-head__meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gr-updated { font-size: 11px; color: var(--gr-muted); }

/* ── KPI cards ── */
.gr-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 20px; }
.gr-kpi { background: var(--gr-surface); border: 1px solid var(--gr-border); border-top: 3px solid rgba(0,0,0,0.2);
          border-radius: 8px; padding: 12px 14px; }
.gr-kpi--hl { border-top-color: var(--gr-accent); }
.gr-kpi__lbl { font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--gr-muted); margin-bottom: 6px; }
.gr-kpi__val { font-size: 22px; font-weight: 500; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.gr-kpi__val small { font-size: 13px; color: var(--gr-muted); font-weight: 400; }
.gr-kpi__sub { font-size: 11px; color: var(--gr-sub); margin-top: 6px; line-height: 1.4; }

/* ── generic card ── */
.gr-card { background: var(--gr-surface); border: 1px solid var(--gr-border); border-radius: 8px; padding: 16px; margin-bottom: 16px; }
.gr-card h3 { font-size: 15px; font-weight: 500; margin-bottom: 2px; }
.gr-csub { font-size: 11px; color: var(--gr-sub); margin-bottom: 12px; }
.gr-flag { display: inline-block; font-size: 10px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
           color: #8a6d00; border: 1px solid #E3CD66; background: #FFFBE8; padding: 2px 8px; margin-left: 8px; border-radius: 3px; vertical-align: 2px; }

/* ── enablement band: "How the AI team drove adoption" ── */
.gr-en__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.gr-en__item { border-left: 2px solid var(--gr-accent); padding-left: 12px; }
.gr-en__val { font-size: 24px; font-weight: 500; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.gr-en__val small { font-size: 12px; color: var(--gr-muted); font-weight: 400; letter-spacing: 0; }
.gr-en__lbl { font-size: 12px; font-weight: 500; margin-top: 5px; }
.gr-en__sub { font-size: 11px; color: var(--gr-sub); margin-top: 4px; line-height: 1.4; }
.gr-en__payoff { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--gr-divider);
                 font-size: 13px; color: var(--gr-text); line-height: 1.5; }
.gr-en__payoff b { font-weight: 600; }

/* ── charts row ── */
.gr-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.gr-chart-note { font-size: 10.5px; color: var(--gr-sub); margin-top: 8px; }

/* Two-fold adoption trend: two stacked single-series line charts */
.gr-trend2 { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.gr-trend2__one .gr-csub { margin-bottom: 0; }
.gr-ln { width: 100%; height: auto; display: block; margin-top: 2px; }
.gr-ln__axis { stroke: var(--gr-divider); stroke-width: 1; }
.gr-ln__grid { stroke: var(--gr-divider); stroke-width: 1; }
.gr-ln__ylabel { fill: var(--gr-muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.gr-ln__band { fill: var(--gr-muted); opacity: 0.07; }
.gr-ln__bandlbl { fill: var(--gr-muted); font-size: 9.5px; letter-spacing: .05em; text-transform: uppercase; }
.gr-ln__line { stroke: var(--gr-bar); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.gr-ln__dot { fill: var(--gr-bar); }
.gr-ln__dot--partial { fill: var(--gr-bg); stroke: var(--gr-bar); stroke-width: 1.5; }
.gr-ln__val { fill: var(--gr-text); font-size: 12px; font-weight: 600; }
.gr-ln__x { fill: var(--gr-muted); font-size: 10px; }

.gr-hbar { margin-bottom: 10px; }
.gr-hbar:last-child { margin-bottom: 0; }
.gr-hbar__top { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 3px; }
.gr-hbar__top span:last-child { color: var(--gr-muted); font-variant-numeric: tabular-nums; }
.gr-hbar__track { height: 6px; background: var(--gr-track); border-radius: 3px; overflow: hidden; }
.gr-hbar__fill { height: 100%; background: var(--gr-bar); }
.gr-hbar__fill--mut { background: var(--gr-bar-mut); }
.gr-hbar__fill--gold { background: var(--gr-accent); }

/* ── middle band: licence matrix + adoption curve ── */
.gr-mid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 900px) { .gr-mid, .gr-charts { grid-template-columns: 1fr; } }

.gr-mtx { width: 100%; border-collapse: collapse; font-size: 12px; }
.gr-mtx th { text-align: right; font-size: 10px; font-weight: 500; letter-spacing: .05em; text-transform: uppercase;
             color: var(--gr-muted); padding: 4px 8px; border-bottom: 1px solid var(--gr-border); }
.gr-mtx th:first-child { text-align: left; padding-left: 0; }
.gr-mtx td { padding: 4px 8px; border-bottom: 1px solid var(--gr-divider); text-align: right; font-variant-numeric: tabular-nums; }
.gr-mtx td:first-child { text-align: left; font-weight: 500; padding-left: 0; }
.gr-mtx__z { color: rgba(0,0,0,0.2); }
.gr-mtx__tot { font-weight: 700; }
.gr-mtx__totrow td { border-top: 2px solid var(--gr-text); border-bottom: none; font-weight: 700; padding-top: 6px; }
.gr-mtx__agcount td { border-bottom: none; color: var(--gr-muted); font-size: 11px; font-weight: 400; padding-top: 2px; }

/* ── adoption curve ── */
.gr-stage { display: grid; grid-template-columns: 22px 1fr; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--gr-divider); }
.gr-stage:last-child { border-bottom: none; }
.gr-stage__num { font-size: 15px; font-weight: 500; color: var(--gr-accent); }
.gr-stage__name { font-size: 13px; font-weight: 500; }
.gr-stage__name span { font-weight: 400; font-size: 11px; color: var(--gr-sub); }
.gr-stage__barrow { display: flex; align-items: center; gap: 8px; margin-top: 5px; }
.gr-stage__track { flex: 1; height: 8px; background: var(--gr-track); border-radius: 3px; overflow: hidden; }
.gr-stage__fill { height: 100%; background: var(--gr-bar); border-radius: 3px; }
.gr-stage__count { font-size: 12px; font-weight: 500; color: var(--gr-text); font-variant-numeric: tabular-nums; min-width: 14px; text-align: right; }
.gr-stage__note { font-size: 11.5px; color: var(--gr-sub); margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--gr-divider); line-height: 1.4; }
.gr-stage__note b { color: var(--gr-text); font-weight: 500; }
.gr-stage__note--opp { margin-top: 12px; padding: 10px 12px; border-top: none; border-radius: 6px;
                       background: #FFFBE8; border: 1px solid #F1E4A6; color: #5a4a00; }
.gr-stage__note--opp b { color: #4a3900; font-weight: 700; }
.gr-stage__who { font-size: 11.5px; color: var(--gr-sub); margin-top: 5px; line-height: 1.4; }
.gr-stage__who b { color: var(--gr-text); font-weight: 500; }

/* ── what we've built (automations) ── */
.gr-builds { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.gr-build { background: var(--gr-surface2); border: 1px solid var(--gr-border); border-top: 3px solid var(--gr-accent); border-radius: 8px; padding: 12px 14px; }
.gr-build__name { font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--gr-muted); margin-bottom: 6px; }
.gr-build__val { font-size: 22px; font-weight: 500; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.gr-build__val small { font-size: 13px; color: var(--gr-muted); font-weight: 400; }
.gr-build__meta { font-size: 11px; color: var(--gr-sub); margin-top: 6px; line-height: 1.4; }
.gr-build__saved { font-size: 11px; color: var(--gr-text); font-weight: 500; margin-top: 3px; }
/* builds with no central usage metric — same card, muted top rule (vs the gold
   accent) to signal there's no headline number; description takes the val slot */
.gr-build--nometric { border-top-color: var(--gr-border); }
.gr-build__desc { font-size: 12px; color: var(--gr-sub); line-height: 1.4; margin-top: 2px; }

/* ── bottom band: time efficiencies + next steps ── */
.gr-bot { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 900px) { .gr-bot { grid-template-columns: 1fr; } }

/* time-saved: combined headline + per-source table */
.gr-eff-hero { padding: 2px 0 14px; margin-bottom: 12px; border-bottom: 1px solid var(--gr-divider); }
.gr-eff-hero__n { font-size: 30px; font-weight: 500; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.gr-eff-hero__n span { font-size: 14px; color: var(--gr-muted); font-weight: 400; letter-spacing: 0; }
.gr-eff-hero__d { font-size: 12px; color: var(--gr-sub); margin-top: 7px; }
.gr-eff-tbl { margin-bottom: 14px; }
.gr-eff-tbl td { vertical-align: top; padding-top: 9px; padding-bottom: 9px; white-space: nowrap; }
.gr-eff-tbl td:first-child { white-space: normal; }
.gr-eff__src { display: block; font-weight: 500; }
.gr-eff__desc { display: block; font-size: 11px; font-weight: 400; color: var(--gr-muted); margin-top: 2px; max-width: 52ch; line-height: 1.35; }
.gr-callout { padding: 10px 12px; border-radius: 6px; background: #FFFBE8; border: 1px solid #F1E4A6; font-size: 11px; line-height: 1.4; color: #5a4a00; }
.gr-callout b { font-weight: 700; }

/* ── next steps ── */
.gr-ns { list-style: none; }
.gr-ns li { font-size: 12px; line-height: 1.4; padding: 7px 0; border-bottom: 1px solid var(--gr-divider); color: #333; }
.gr-ns li:last-child { border-bottom: none; }
.gr-ns li::before { content: '→  '; color: var(--gr-accent); }
.gr-ns li b { color: var(--gr-text); font-weight: 700; }

/* ── footer ── */
.gr-foot { margin-top: 16px; border-top: 1px solid var(--gr-border); padding-top: 10px; font-size: 10.5px; color: var(--gr-sub); line-height: 1.5; }
.gr-foot b { color: var(--gr-text); }

/* ── Print / Export-as-PDF ──
   The shared print sheet in css/claude-usage.css hides the whole page
   (`body * { visibility:hidden }`) and re-reveals ONLY the .cu / .ltx / .au
   reports. This report's container is .gr-root, which that list never covered —
   so without this block it stays hidden and the exported PDF is blank. Reveal
   .gr-root, lift it to the top of the page (as .cu/.ltx/.au do), keep the light
   ink treatment, and drop the on-screen-only controls and decorative glow.
   The print handler already switches the report to light before printing. */
@media print {
  .gr-root, .gr-root * { visibility: visible; }
  .gr-root {
    position: absolute; left: 0; top: 0; width: 100%;
    max-width: none; border-radius: 0;
    background: #fff !important;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .gr-root * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  /* On-screen-only chrome and the decorative glow don't belong in the PDF. */
  .gr-head__actions { display: none !important; }
  .gr-head--glow::after { display: none !important; }
  /* Pagination: keep small blocks whole; let tall sections flow across pages. */
  .gr-kpi, .gr-callout, .gr-section__head { break-inside: avoid; page-break-inside: avoid; }
  .gr-section { break-inside: auto; page-break-inside: auto; }
  .gr-section__head { break-after: avoid; page-break-after: avoid; }
}
