:root {
  /* Planet IT brand */
  --brand-blue: #00546e;   /* logo + links — used on light surfaces */
  --yellow: #f6ec3e;
  --yellow-dark: #e2d92e;
  --navy: #14283a;
  --teal: #34a8c6;         /* secondary accent */

  /* Dark page (frame) */
  --bg: #0e1f2b;
  --page-text: #e8eef2;    /* text directly on the dark page */
  --page-muted: #9fb1bd;
  --page-line: #20323f;

  /* Light surfaces (header, cards) */
  --surface: #ffffff;
  --surface-2: #eef3f7;    /* inner chips / hovers */
  --ink: #14283a;          /* text on light surfaces */
  --ink-muted: #5a6b78;
  --line: #e2e8ed;         /* borders on light surfaces */

  --btn: #15708a;          /* primary button fill */
  --btn-h: #1b86a3;
  --danger: #c0392b;
  --danger-tint: #fdecea;

  /* One amber family for "partial / warn": a fill for large graphics (donut
     meters, big score numerals, tally segments), an AA-contrast text/border
     shade for small type, and a tint. Brand yellow stays brand-only. */
  --warn-fill: #ef7d18;
  --warn-text: #a35b00;
  --warn-tint: #fff8e0;

  --radius: 14px;
  --shadow: 0 8px 26px rgba(0, 0, 0, .28);
  --shadow-hover: 0 14px 34px rgba(0, 0, 0, .42);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

/* Visible keyboard focus everywhere — the browser default ring disappears
   against the dark page. Teal reads on both the dark frame and white cards. */
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 520px at 82% -12%, #18394a 0%, transparent 58%),
    var(--bg);
  color: var(--page-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Top bar (light) */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.brand-group { display: flex; align-items: center; gap: 11px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-name { font-weight: 800; font-size: 21px; letter-spacing: .2px; color: var(--brand-blue); }
.brand-logo { height: 26px; width: auto; display: block; }
.topnav { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }

/* Top-right chips */
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 13px; font-size: 13px; cursor: default;
  text-decoration: none; color: var(--ink); transition: .15s; white-space: nowrap;
}
.chip-label { color: var(--ink-muted); }
.chip-val { color: var(--ink); max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.chip-val.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.chip-link { font-weight: 600; cursor: pointer; }
.chip-link:hover { border-color: var(--brand-blue); color: var(--brand-blue); }
.chip-refresh { font-family: inherit; }
.chip-refresh:disabled { opacity: .5; cursor: not-allowed; }
.chip-refresh:disabled:hover { border-color: var(--line); color: var(--ink); }
.refresh-icon { font-size: 15px; line-height: 1; }
.tenant { cursor: default; }
.tenant-full { display: none; }
.tenant:hover .tenant-mask, .tenant:focus-visible .tenant-mask { display: none; }
.tenant:hover .tenant-full, .tenant:focus-visible .tenant-full { display: inline; }

/* Layout */
.container { width: 100%; max-width: 1040px; margin: 0 auto; padding: 30px 24px; flex: 1; }
/* Data-dense pages (e.g. the admin panel) opt into the full width. */
.container-wide { max-width: 1500px; }
/* The dashboard opts into a mid width so its 4-across hub tiles breathe. */
.container-dash { max-width: 1240px; }
.footer {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  color: var(--page-muted); font-size: 13px; padding: 22px; border-top: 1px solid var(--page-line);
}
.footer-logo { height: 36px; width: auto; display: block; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 11px 20px; border-radius: 10px; font-size: 15px; font-weight: 600;
  text-decoration: none; cursor: pointer; border: 1px solid transparent; transition: .15s;
}
.btn-primary { background: var(--btn); color: #fff; }
.btn-primary:hover { background: var(--btn-h); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--brand-blue); color: var(--brand-blue); }

/* Microsoft-branded sign-in button (per MS guidelines: white, grey border) */
.btn-ms { background: #fff; color: #3c4043; border: 1px solid #8c8c8c; font-weight: 600; padding: 12px 22px; vertical-align: middle; }
.btn-ms:hover { background: #f3f4f6; }
.btn-ms .ms-logo { display: grid; grid-template-columns: 9px 9px; grid-gap: 2px; }
.btn-ms .ms-logo span { width: 9px; height: 9px; display: block; }
.btn-ms .ms-logo span:nth-child(1) { background: #f25022; }
.btn-ms .ms-logo span:nth-child(2) { background: #7fba00; }
.btn-ms .ms-logo span:nth-child(3) { background: #00a4ef; }
.btn-ms .ms-logo span:nth-child(4) { background: #ffb900; }

/* Demo entry (dark hero) + the banner shown on every /demo page.
   Same padding as .btn-ms and middle-aligned, so the pair sit level. */
.btn-demo {
  background: transparent; color: var(--page-text);
  border-color: var(--teal); margin-left: 10px;
  padding: 12px 22px; vertical-align: middle;
}
.btn-demo:hover { background: var(--teal); color: #fff; }

.demo-banner {
  background: var(--yellow); color: var(--navy);
  padding: 9px 24px; font-size: 14px; text-align: center;
}
.demo-banner a { color: var(--brand-blue); font-weight: 600; }

/* PDF export button beside the dashboard welcome (dark page background) */
.page-head-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.btn-export { background: transparent; color: var(--page-text); border-color: var(--teal); font-size: 13.5px; padding: 9px 16px; }
.btn-export:hover { background: var(--teal); color: #fff; }
.btn-export.is-busy { opacity: .65; pointer-events: none; }

/* Hero / landing (text on dark page, point cards light) */
.hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; align-items: center; margin-top: 16px; }
.hero h1 { font-size: 42px; line-height: 1.12; margin: 0 0 16px; color: var(--page-text); }
.hero h1 .hl { box-shadow: inset 0 -.42em 0 rgba(246, 236, 62, .85); color: #fff; }
.lead { color: var(--page-muted); font-size: 18px; line-height: 1.6; margin-bottom: 28px; }
.fineprint { color: var(--page-muted); font-size: 13px; margin-top: 16px; }
.hero-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.hero-points li { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--yellow); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.hero-points strong { display: block; margin-bottom: 4px; color: var(--brand-blue); }
.hero-points span { color: var(--ink-muted); font-size: 14px; }

/* Tab bar on the How-it-works page — white chips like the topbar's, with a
   filled active state so the current tab is unmissable. */
.page-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 24px; }
.page-tab { font: inherit; font-size: 14px; font-weight: 700; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 9px 20px; cursor: pointer; transition: .15s; box-shadow: var(--shadow); }
.page-tab:hover { border-color: var(--brand-blue); color: var(--brand-blue); }
.page-tab.is-active { color: #fff; background: var(--brand-blue); border-color: var(--brand-blue); }

/* Headings (on dark page) */
.page-head { margin-bottom: 20px; }
.page-head h1 { margin: 6px 0; font-size: 30px; color: var(--page-text); }
.muted { color: var(--page-muted); }
.back { color: var(--page-muted); text-decoration: none; font-size: 14px; }
.back:hover { color: var(--page-text); }

/* Cards (light) */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
/* Hub score grids: equal-height rows so every card is the same size. */
.grid-hub { grid-auto-rows: 1fr; }
/* Odd report counts: the orphan card spans the row instead of leaving a hole. */
.grid-hub > .card-action:last-child:nth-child(odd) { grid-column: 1 / -1; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); color: var(--ink); }
.card h2 { margin: 0 0 8px; font-size: 19px; color: var(--ink); }
.card p { color: var(--ink-muted); margin: 0 0 14px; line-height: 1.55; }
.card-action { text-decoration: none; color: var(--ink); display: flex; flex-direction: column; transition: .15s; }
.card-action:hover { border-color: var(--brand-blue); transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.card-action.is-disabled { opacity: .55; pointer-events: none; }
.card-cta { color: var(--brand-blue); font-weight: 700; margin-top: auto; align-self: flex-start; }
.card-warn { display: flex; align-items: center; justify-content: space-between; gap: 20px; background: var(--warn-tint); border-color: var(--yellow-dark); margin: 24px 0; }
.card-warn h2 { color: var(--ink); }
.card-warn p { color: var(--ink-muted); }
/* Trust facts on the consent card — the promise restated at the moment of the ask. */
.trust-facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.trust-fact { display: inline-flex; align-items: center; font-size: 12px; font-weight: 700; color: var(--brand-blue); background: var(--surface); border: 1px solid var(--yellow-dark); border-radius: 999px; padding: 4px 12px; text-decoration: none; }
a.trust-fact:hover { border-color: var(--brand-blue); }
.card-error { border-color: var(--danger); background: var(--danger-tint); }
.card-error h2 { color: var(--danger); }
.card-error p { color: var(--ink); word-break: break-word; }
.card-soon { opacity: .95; }
.badge { display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; line-height: 1; font-size: 12px; font-weight: 700; color: var(--navy); background: var(--yellow); border-radius: 999px; padding: 5px 11px; }


/* Product cards */
.product-card h2 { margin: 4px 0 0; font-size: 18px; }
.product-head { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 12px; }
.product-logo { width: 44px; height: 44px; object-fit: contain; flex: none; }

/* Dashboard report tiles: icon + title vertically centred, kept to one line */
.grid-3 .product-head, .grid-4 .product-head { align-items: center; }
.grid-3 .product-head > div, .grid-4 .product-head > div { min-width: 0; }
.grid-3 .product-logo, .grid-4 .product-logo { width: 40px; height: 40px; }
.grid-3 .product-card h2, .grid-4 .product-card h2 { margin: 0; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Uniform card size across the Microsoft 365 + Services grids. Tall enough to
   contain the bottom-pinned posture badge on scored tiles, so scored and
   unscored tiles stay exactly the same height. */
.grid-3 .card, .grid-4 .card { min-height: 172px; }
.grid-3 .card p, .grid-4 .card p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }

/* Text link + prose */
.text-link { color: var(--brand-blue); text-decoration: none; font-weight: 600; border-bottom: 1px solid transparent; }
.text-link:hover { border-bottom-color: var(--brand-blue); }
/* On the dark page (not on a card), use a lighter tint so links stay legible */
.text-link.on-dark { color: var(--teal); }
.text-link.on-dark:hover { border-bottom-color: var(--teal); }
.prose { color: var(--page-text); line-height: 1.7; max-width: 760px; font-size: 15px; }
.prose-list { color: var(--page-text); line-height: 1.7; max-width: 760px; font-size: 15px; padding-left: 20px; }
.prose-list li { margin-bottom: 10px; }
.prose-list strong, .prose strong { color: var(--page-text); }

/* Dashboard status strip (light cards) */
.status-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 0; }
.status-item { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.status-item strong { display: block; font-size: 15px; color: var(--ink); }
.status-item .muted { font-size: 13px; color: var(--ink-muted); }
/* Paired links on a status card (Permissions · How it works). Wraps between
   the links, never inside one. */
.status-links { display: block; font-size: 13px; color: var(--ink-muted); }
.status-links a { white-space: nowrap; }
.status-dot { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.status-dot.ok { background: #1aa86f; box-shadow: 0 0 0 4px rgba(26, 168, 111, .15); }
.status-dot.pending { background: var(--yellow-dark); box-shadow: 0 0 0 4px rgba(246, 236, 62, .25); }
.status-pill { font-size: 12px; font-weight: 700; color: #fff; background: var(--brand-blue); border-radius: 999px; padding: 4px 11px; flex: none; }

/* Section titles + card tags */
/* Equal gap above and below every section title for a consistent rhythm */
.section-title { font-size: 15px; text-transform: uppercase; letter-spacing: .08em; color: var(--page-muted); margin: 24px 0; }
.card-tag { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--brand-blue); margin-bottom: 8px; }

/* Score chips on the Entra ID hub card — stacked on the right */
.card-with-scores { flex-direction: row; align-items: stretch; }
.card-with-scores .product-main { flex: 3; min-width: 0; display: flex; flex-direction: column; }
/* No line-clamp: let hub-card descriptions wrap fully. grid-hub's equal rows
   keep every card the same height as the tallest, so none get truncated. */
.card-scores { display: flex; flex-direction: column; gap: 16px; justify-content: center; align-items: center; flex: 1; padding-left: 22px; border-left: 1px solid var(--line); }
.card-score { display: flex; align-items: baseline; flex-wrap: wrap; justify-content: center; gap: 2px; text-align: center; }
.card-score .cs-num { font-size: 36px; font-weight: 800; line-height: 1; }
.card-score .cs-den { font-size: 12px; font-weight: 700; opacity: .6; color: var(--ink-muted); }
.card-score .cs-label { flex-basis: 100%; font-size: 12px; color: var(--ink-muted); margin-top: 2px; }
/* Aggregate posture % on the dashboard product tiles — absolutely placed in the
   bottom-right so it adds no height (every tile keeps the same size) and reads as
   a colour-coded score using Orbit's standard good/warn/bad palette. */
.product-card { position: relative; }
.tile-score { position: absolute; right: 22px; bottom: 16px; font-size: 17px; font-weight: 800; line-height: 1.2; }
/* Tile numbers are small text — use the darker, AA-contrast band colours. */
.tile-score.score-good { color: #157a4f; }
.tile-score.score-warn { color: var(--warn-text); }
.tile-band { font-size: 12px; font-weight: 700; }
/* Pre-consent tiles say how they unlock instead of sitting silently greyed. */
.tile-unlock { position: absolute; right: 22px; bottom: 16px; font-size: 12px; font-weight: 600; color: var(--ink-muted); }
/* Locked hubs (trial/suspended): the score is there, but it's a teaser. */
.tile-blur { filter: blur(7px); pointer-events: none; user-select: none; }

/* Tenant overall score — sits in the Tenant Overview status strip */
.overall-num { flex: none; display: flex; align-items: baseline; line-height: 1; }
.overall-num .os-num { font-size: 32px; font-weight: 800; line-height: 1; }
.overall-num .os-den { font-size: 13px; font-weight: 700; opacity: .6; color: var(--ink-muted); margin-left: 2px; }
/* Orbit's score leads; Secure Score is the smaller comparison beside it. */
.status-item-primary { border-left: 4px solid var(--btn); }
.status-item-primary .os-num { font-size: 38px; }
.status-item-secondary .os-num { font-size: 22px; }
.cs-loading { display: inline-block; width: 38px; height: 38px; border-radius: 8px; background: var(--surface-2); animation: cs-pulse 1.2s ease-in-out infinite; }
@keyframes cs-pulse { 0%, 100% { opacity: .35; } 50% { opacity: .85; } }
.report-loading { display: flex; align-items: center; gap: 14px; padding: 28px 4px; color: var(--ink-muted); font-size: 14px; }

/* Sign-in warm-up screen (sits on the dark page — use the on-dark palette) */
.warming { position: relative; min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; text-align: center; padding: 24px; }
.warming-logo { position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%); height: 24px; width: auto; opacity: .85; }
.warming #warmLoading:not([hidden]), .warming #warmError:not([hidden]) { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.warming-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.warming-brand .brand-name { font-size: 26px; color: var(--teal); }
.warming-brand-logo { height: 32px; }
.warming-spinner { width: 46px; height: 46px; border-radius: 50%; border: 4px solid var(--page-line); border-top-color: var(--teal); animation: warm-spin .9s linear infinite; }
@keyframes warm-spin { to { transform: rotate(360deg); } }
/* Determinate warm-up progress: one tick per completed fetch. */
.warming-progress { width: 300px; height: 8px; border-radius: 999px; background: var(--page-line); overflow: hidden; }
.warming-progress-fill { width: 0%; height: 100%; border-radius: 999px; background: var(--teal); transition: width .25s ease; }
@media (max-width: 360px) { .warming-progress { width: 240px; } }
.warming-msg { font-size: 18px; font-weight: 700; color: var(--page-text); margin: 4px 0 0; min-height: 24px; }
.warming-msg-error { color: #ff9a8d; }
.warming-sub { font-size: 13px; color: var(--page-muted); margin: 0; max-width: 460px; }
.warming-actions { display: flex; gap: 12px; justify-content: center; margin-top: 18px; }

/* Conditional Access score panel */
.score-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-bottom: 26px; }
.score-cards { display: block; }
.score-card { display: flex; align-items: center; gap: 20px; }
.score-ring { flex: none; display: flex; align-items: baseline; gap: 2px; }
.score-ring .score-num { font-size: 46px; font-weight: 800; line-height: 1; }
.score-ring .score-den { font-size: 15px; font-weight: 700; color: var(--ink-muted); }
.score-good { color: #1aa86f; }
.score-warn { color: var(--warn-fill); }
.score-bad { color: #c0392b; }
.score-meta strong { display: block; font-size: 16px; color: var(--ink); }
.score-meta .muted { font-size: 13px; color: var(--ink-muted); }
.score-breakdown { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 14px; }
.score-breakdown summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--ink); }
.tally-pass { color: #1aa86f; font-weight: 700; }
.tally-partial { color: var(--warn-text); font-weight: 700; }
.tally-absent { color: #c0392b; font-weight: 700; }
.tally-unlicensed { color: var(--ink-muted); font-weight: 700; }
.score-note { font-size: 13px; margin: 10px 0 4px; }
.score-phase { margin-top: 16px; }
.score-phase h4 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-muted); }
.score-check { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 8px; background: var(--surface-2); margin-bottom: 6px; border-left: 3px solid var(--line); }
.check-name { font-size: 14px; color: var(--ink); }
.check-note { display: block; font-size: 12px; font-weight: 400; color: var(--ink-muted); margin-top: 2px; }
.check-badge { font-size: 10px; font-weight: 700; background: var(--brand-blue); color: #fff; border-radius: 4px; padding: 1px 5px; vertical-align: middle; }
.check-status { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.score-check-pass { border-left-color: #1aa86f; }
.score-check-pass .check-status { color: #1aa86f; }
.score-check-partial { border-left-color: var(--warn-text); }
.score-check-partial .check-status { color: var(--warn-text); }
.score-check-absent { border-left-color: #c0392b; }
.score-check-absent .check-status { color: #c0392b; }
/* Not licensed for this check: shown for reference, never scored. */
.score-check-unlicensed { border-left-color: var(--line); opacity: .7; }
.score-check-unlicensed .check-status { color: var(--ink-muted); }

/* SVG donut score ring (report hero + hub banners) */
.donut { width: 112px; height: 112px; flex: none; }
.donut-track { fill: none; stroke: var(--surface-2); stroke-width: 11; }
.donut-meter { fill: none; stroke-width: 11; stroke-linecap: round; transition: stroke-dashoffset .9s cubic-bezier(.22, 1, .36, 1); }
.donut-num { font-size: 33px; font-weight: 800; text-anchor: middle; dominant-baseline: middle; }
/* Posture word under the donut number — the band, spelled out. */
.donut-band { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; text-anchor: middle; fill: var(--ink-muted); }
.donut-good .donut-meter { stroke: #1aa86f; } .donut-good .donut-num { fill: #1aa86f; }
.donut-warn .donut-meter { stroke: var(--warn-fill); } .donut-warn .donut-num { fill: var(--warn-fill); }
.donut-bad .donut-meter { stroke: #c0392b; } .donut-bad .donut-num { fill: #c0392b; }
/* Neutral "no score yet" donut — grey ring with a dash, no meter. */
.donut-none .donut-num { fill: var(--ink-muted); font-size: 30px; }
/* Blank score on a hub card (no data / no consent). */
.cs-none { color: var(--ink-muted); }

/* Report score hero (donut + posture + tally bar) */
.score-hero { display: flex; align-items: center; gap: 26px; }
.score-hero-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.score-hero-meta strong { font-size: 17px; color: var(--ink); }
.score-hero-meta .muted { font-size: 13px; }

/* Proportional met/partial/missing bar */
.tally-bar { display: flex; height: 9px; border-radius: 999px; overflow: hidden; background: var(--surface-2); margin: 13px 0 6px; max-width: 460px; }
.tb-seg { display: block; height: 100%; }
.tb-pass { background: #1aa86f; }
.tb-partial { background: var(--warn-fill); }
.tb-absent { background: #c0392b; }

/* The breakdown now lives in its own panel, so drop the divider it used to need */
.score-breakdown-bare { margin-top: 0; border-top: none; padding-top: 0; }
.score-breakdown-bare .score-phase:first-child { margin-top: 0; }

/* Priority fixes panel */
.priorities { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--yellow); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 22px; margin-bottom: 26px; }
.priorities-title { margin: 0 0 13px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-muted); }
.priorities-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; }
.priority { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; }
/* display:grid above would defeat the hidden attribute (the Top Risks
   "Show more" collapse relies on it), so restate it explicitly. */
.priority[hidden] { display: none; }
.priority-rank { width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); color: var(--ink-muted); font-size: 13px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex: none; }
.priority-absent .priority-rank { background: #fdecea; color: #c0392b; }
.priority-partial .priority-rank { background: var(--warn-tint); color: var(--warn-text); }
.priority-body { min-width: 0; }
.priority-name { display: block; font-size: 14px; font-weight: 600; color: var(--ink); }
.priority-fix-link { color: inherit; text-decoration: none; border-bottom: 1px dashed var(--line); }
.priority-fix-link:hover { color: var(--teal); border-bottom-color: var(--teal); }
.ext-arrow { font-size: 11px; margin-left: 3px; color: var(--ink-muted); }
.priority-fix-link:hover .ext-arrow { color: var(--teal); }
.priority-note { display: block; font-size: 12px; color: var(--ink-muted); margin-top: 1px; }
/* 12px text: the darker AA-contrast green, not the fill green. */
.priority-gain { font-size: 12px; font-weight: 800; color: #157a4f; white-space: nowrap; flex: none; }

/* Dashboard Top Risks panel (reuses the .priority row styles) */
.risks-panel { margin-bottom: 0; }
.risk-report-link { color: inherit; text-decoration: none; border-bottom: 1px dashed var(--line); }
.risk-report-link:hover { color: var(--teal); border-bottom-color: var(--teal); }
.risk-hub { display: inline-block; font-size: 11px; font-weight: 700; color: var(--brand-blue); background: var(--surface-2); border-radius: 999px; padding: 2px 9px; margin-left: 8px; vertical-align: 1px; white-space: nowrap; }
.risk-side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; }
.risk-fix { font-size: 12px; font-weight: 700; color: var(--brand-blue); text-decoration: none; white-space: nowrap; }
.risk-fix:hover { color: var(--teal); }
.risks-empty { margin: 0; font-size: 14px; }
.risks-toggle { display: block; margin: 12px auto 0; background: none; border: none; padding: 4px 10px; font: inherit; font-size: 13px; font-weight: 700; color: var(--brand-blue); cursor: pointer; }
.risks-toggle:hover { color: var(--teal); }

/* Severity / effort / framework-reference chips (reports, priorities, Top Risks) */
.sev-chip { display: inline-block; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; border-radius: 4px; padding: 1px 6px; vertical-align: 1px; }
.sev-critical { background: #fdecea; color: #c0392b; }
.sev-high { background: #fdf3e7; color: #b3591b; }
.sev-medium { background: var(--warn-tint); color: var(--warn-text); }
.sev-low { background: var(--surface-2); color: var(--ink-muted); }
.ref-chip { display: inline-block; font-size: 10px; font-weight: 700; border-radius: 4px; padding: 1px 6px; background: var(--surface-2); color: var(--ink-muted); vertical-align: 1px; }
.fix-effort { font-size: 11px; font-weight: 700; color: var(--ink-muted); white-space: nowrap; }
.fix-effort-S { color: #157a4f; }
.fix-effort-L { color: #b3591b; }

/* Hub overview banner (aggregate posture across a hub's reports) */
.hub-banner { display: flex; align-items: center; gap: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 26px; margin-bottom: 22px; min-height: 112px; }
.hub-banner-main { display: flex; align-items: center; gap: 24px; flex: 1; min-width: 0; }
.hub-banner-logo { width: 56px; height: 56px; object-fit: contain; flex: none; margin-left: 20px; }
.hub-banner-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hub-banner-meta strong { font-size: 18px; color: var(--ink); }
.hub-banner-meta .muted { font-size: 13px; }
.hub-banner-loading { width: 84px; height: 84px; border-radius: 50%; }

/* Expandable drill-down checks (users / groups / apps) */
details.score-check { display: block; padding: 0; }
details.score-check > summary { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 8px 12px; cursor: pointer; list-style: none; }
details.score-check > summary::-webkit-details-marker { display: none; }
details.score-check > summary:hover { background: rgba(0, 0, 0, .03); }
.ci-chev { display: inline-block; margin-left: 7px; font-size: 10px; color: var(--ink-muted); transition: transform .15s ease; }
.ci-chev::before { content: "\25B8"; }
details.score-check[open] .ci-chev { transform: rotate(90deg); }
.check-items { margin: 0; padding: 2px 12px 8px; list-style: none; border-top: 1px solid var(--line); }
.check-items li { font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.check-items li:last-child { border-bottom: none; }
.ci-label { display: block; color: var(--ink); font-weight: 600; word-break: break-word; }
.ci-sub { display: block; color: var(--ink-muted); font-size: 12px; margin-top: 2px; word-break: break-word; }
.ci-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.ci-tag { font-size: 11px; font-weight: 600; color: var(--brand-blue); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 1px 9px; }

/* Conditional Access policy cards */
.ca-overview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 26px; }
.bubble { border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 3px solid; cursor: pointer; font: inherit; transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease; }
.bubble:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0, 0, 0, .12); }
.bubble:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: 2px; }
.bubble.is-active { box-shadow: 0 0 0 3px rgba(0, 0, 0, .08), var(--shadow); transform: translateY(-2px); }
.ca-overview:has(.is-active) .bubble:not(.is-active) { opacity: .5; }
.bubble-num { font-size: 38px; font-weight: 800; line-height: 1; }
.bubble-label { margin-top: 8px; font-size: 13px; font-weight: 700; letter-spacing: .02em; }
.bubble-on { background: #e6f6ef; border-color: #1aa86f; color: #1aa86f; }
.bubble-off { background: #eef1f4; border-color: #6b7a85; color: #6b7a85; }
.bubble-report { background: var(--warn-tint); border-color: var(--warn-text); color: var(--warn-text); }

.ca-list { column-count: 2; column-gap: 18px; }
.ca-card { break-inside: avoid; margin-bottom: 18px; }

/* Collapsible card */
.ca-summary { cursor: pointer; list-style: none; }
.ca-summary::-webkit-details-marker { display: none; }
.ca-summary .ca-head { margin-bottom: 12px; }
.ca-summary .ca-flags { margin-bottom: 0; }
/* Tags aren't clickable, so don't imply it with the pointer cursor */
.ca-summary .flag { cursor: default; }
/* Collapsed: show the count chip; Expanded: show individual good chips */
.ca-card:not([open]) .ca-good-chip { display: none; }
.ca-card[open] .ca-good-count { display: none; }
.ca-card .ca-fields { margin-top: 16px; }
.ca-head { display: flex; align-items: center; justify-content: flex-start; gap: 10px; margin-bottom: 10px; }
.ca-head h2 { margin: 0; font-size: 18px; color: var(--ink); }
.ca-flags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.flag { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 3px 11px; }
.flag-ok { background: #e6f6ef; color: #1aa86f; }
.flag-alert { background: #fdecea; color: #c0392b; }
.flag-warn { background: var(--warn-tint); color: var(--warn-text); }
.flag-neutral { background: #eef1f4; color: #6b7a85; }
.ca-fields { display: grid; grid-template-columns: 150px 1fr; gap: 9px 16px; font-size: 14px; align-items: start; }
.ca-val > div { margin-bottom: 2px; }
.ca-label { color: var(--ink-muted); font-weight: 600; }
.ca-val { color: var(--ink); word-break: break-word; }
.ca-val em { color: var(--ink-muted); font-style: normal; }

/* Admin panel forms */
.admin-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.admin-form input[type="text"] { flex: 1; min-width: 200px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; color: var(--ink); background: var(--surface); }
.admin-form input[type="text"]:focus { outline: none; border-color: var(--brand-blue); }
.admin-danger { color: var(--danger); }

/* Admin customer search toolbar */
.admin-toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.admin-search { flex: 1; min-width: 220px; max-width: 380px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; font: inherit; color: var(--ink); background: var(--surface); }
.admin-search:focus { outline: none; border-color: var(--brand-blue); }
.admin-count { font-size: 13px; white-space: nowrap; }

/* Admin customer table (scoped so report .data tables are unaffected) */
.table-wrap { overflow-x: auto; }
.admin-table th, .admin-table td { vertical-align: top; }
.admin-table .col-domain { min-width: 150px; overflow-wrap: anywhere; }
.admin-table .col-tenant { width: 170px; }
.admin-table .col-tenant code { font-size: 12px; overflow-wrap: anywhere; color: var(--ink-muted); }
.admin-table .col-seen { white-space: nowrap; color: var(--ink-muted); }
.admin-table .col-actions { width: 1%; white-space: nowrap; }
.admin-table .col-actions form { display: inline; }
.admin-table .text-link { background: none; border: none; padding: 0; cursor: pointer; font: inherit; }
/* Status cell: a badge-styled select — clicking it changes the lifecycle. */
.status-form { display: inline; }
.status-select { appearance: none; -webkit-appearance: none; font: inherit; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 4px 26px 4px 12px; border: 1px solid transparent; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%235a6b78'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.status-select:focus { outline: 2px solid var(--brand-blue); outline-offset: 1px; }
.status-select.status-trial { background-color: #e7f4fa; color: #15708a; border-color: #bfe2ef; }
.status-select.status-active { background-color: #e6f6ef; color: #1aa86f; border-color: #b9e6d2; }
.status-select.status-suspended { background-color: #fdecea; color: #c0392b; border-color: #f3c9c4; }

/* Lifecycle badge in the top bar (Pretrial / Trial / Paid / Suspended) */
.chip-plan { font-weight: 700; cursor: default; }
.chip-plan-trial { background: var(--warn-tint); border-color: #e7d9a0; color: var(--warn-text); }
.chip-plan-active { background: #e6f6ef; border-color: #b9e6d2; color: #1aa86f; }
.chip-plan-suspended { background: #fdecea; border-color: #f3c9c4; color: #c0392b; }

/* Score history page */
.history-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 22px; }
.history-stat { display: flex; align-items: center; gap: 14px; }
.history-stat .hs-num { font-size: 30px; font-weight: 800; line-height: 1; white-space: nowrap; }
.history-stat .hs-den { font-size: 14px; font-weight: 700; opacity: .6; margin-left: 2px; }
.history-stat strong { display: block; font-size: 15px; color: var(--ink); }
.history-stat .muted { font-size: 13px; }
.chart-wrap svg { width: 100%; height: auto; display: block; }
/* Faint posture-band backgrounds behind the trend line. */
.ch-band-good { fill: rgba(26, 168, 111, .055); }
.ch-band-warn { fill: rgba(239, 125, 24, .05); }
.ch-band-bad { fill: rgba(192, 57, 43, .05); }
/* Headline delta annotation beside the chart title. */
.ch-delta { font-size: 14px; font-weight: 800; margin-left: 12px; white-space: nowrap; }
.ch-grid { stroke: var(--line); stroke-width: 1; }
.ch-area { fill: rgba(21, 112, 138, .08); }
.ch-line { fill: none; stroke: var(--btn); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ch-dot { fill: var(--btn); stroke: var(--surface); stroke-width: 2; }
.ch-dot-last { fill: var(--brand-blue); }
.ch-hit { fill: transparent; }
.ch-ylabel { font-size: 11px; fill: var(--ink-muted); text-anchor: end; }
.ch-xlabel { font-size: 11px; fill: var(--ink-muted); text-anchor: middle; }
.ch-vlabel { font-size: 12px; font-weight: 700; fill: var(--ink); text-anchor: middle; }
.history-table .col-date { white-space: nowrap; }

/* Report sections (trust page) */
.report-section { margin-bottom: 32px; }
.report-section h2 { font-size: 20px; color: var(--page-text); border-bottom: 2px solid var(--page-line); padding-bottom: 8px; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
table.data th { text-align: left; color: var(--ink-muted); font-weight: 600; padding: 11px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
table.data td { padding: 11px 14px; border-bottom: 1px solid var(--line); color: var(--ink); }
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: var(--surface-2); }
code { background: var(--surface-2); padding: 2px 6px; border-radius: 6px; font-size: 12px; color: var(--brand-blue); }

@media (max-width: 1024px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 800px) {
  .hero { grid-template-columns: 1fr; }
  .hero h1 { font-size: 32px; }
  .grid, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .ca-list { column-count: 1; }
  .score-cards { grid-template-columns: 1fr; }
  .score-hero { gap: 18px; }
  .donut { width: 92px; height: 92px; }
  .tenant { display: none; }
}

@media (max-width: 480px) {
  /* Risk rows: the points/effort/fix column drops under the body instead of
     squeezing beside it. */
  .priority { grid-template-columns: auto 1fr; }
  .priority .risk-side { grid-column: 2; flex-direction: row; align-items: center; gap: 12px; margin-top: 4px; }
}

/* ---- Microsoft Solutions Partner credentials (landing + trust) ---------- */
.partner-strip { margin: 44px 0 10px; text-align: center; }
.partner-strip-label { color: var(--page-muted); font-size: 13px; margin: 0 0 14px; }
.partner-badges { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; }
.partner-badges img { width: 190px; max-width: 30%; height: auto; border-radius: 10px; box-shadow: var(--shadow); }
/* Compact left-aligned variant (trust page, above the tabs). */
.partner-strip-inline { margin: 4px 0 24px; text-align: left; }
.partner-strip-inline .partner-badges { justify-content: flex-start; }
.partner-strip-inline .partner-badges img { width: 150px; }
@media (max-width: 640px) {
  .partner-badges img { max-width: 46%; }
}
