/* CSP auth portal. Brand palette from the Cary Street Partners guidelines. */

@font-face {
  font-family: "Roboto Condensed";
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/roboto-condensed-400.woff2") format("woff2");
}
@font-face {
  font-family: "Roboto Condensed";
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/roboto-condensed-700.woff2") format("woff2");
}

:root {
  --csp-blue: #0065A1; --csp-blue-1: #004872; --csp-blue-2: #375868; --csp-blue-3: #E2E9F1;
  --csp-gray: #888B8D; --csp-gray-1: #474749; --csp-gray-2: #636466; --csp-gray-3: #C7C8CA;
  --red: #C61D23; --orange: #F7901E; --green: #61A60E;

  --bg: #f4f7fa; --surface: #ffffff; --surface-2: #f6f8fb; --text: #000000; --muted: #636466;
  --line: #C7C8CA; --accent: #0065A1; --accent-hover: #004872; --heading: #0065A1;
  --chip-bg: #E2E9F1; --chip-text: #004872; --focus: rgba(0, 101, 161, .35);
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 12px 40px rgba(0, 72, 114, .12);
  --aurora-1: rgba(0, 101, 161, .20); --aurora-2: rgba(55, 88, 104, .16); --aurora-3: rgba(0, 72, 114, .12);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0b1a26; --surface: #151b22; --surface-2: #1d252e; --text: #ffffff; --muted: #C7C8CA;
  --line: #3a434c; --accent: #2a8fcb; --accent-hover: #4aa6dc; --heading: #7fb8dc;
  --chip-bg: #375868; --chip-text: #ffffff; --focus: rgba(74, 166, 220, .45);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 18px 50px rgba(0,0,0,.45);
  --aurora-1: rgba(0, 127, 184, .45); --aurora-2: rgba(55, 88, 104, .55); --aurora-3: rgba(0, 72, 114, .50);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    --bg: #0b1a26; --surface: #151b22; --surface-2: #1d252e; --text: #ffffff; --muted: #C7C8CA;
    --line: #3a434c; --accent: #2a8fcb; --accent-hover: #4aa6dc; --heading: #7fb8dc;
    --chip-bg: #375868; --chip-text: #ffffff; --focus: rgba(74, 166, 220, .45);
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 18px 50px rgba(0,0,0,.45);
    --aurora-1: rgba(0, 127, 184, .45); --aurora-2: rgba(55, 88, 104, .55); --aurora-3: rgba(0, 72, 114, .50);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 16px/1.55 "Roboto Condensed", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86em;
  background: var(--chip-bg); color: var(--chip-text); padding: .08rem .38rem; border-radius: 4px; word-break: break-all; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- theme toggle (brand standard glyphs) ---------------------------- */
.theme-toggle { background: transparent; border: 0; color: var(--muted); cursor: pointer;
  padding: .4rem; border-radius: 8px; line-height: 0; }
.theme-toggle:hover { background: var(--surface-2); color: var(--text); }
.theme-toggle svg { display: none; }
.theme-toggle[data-mode="system"] .t-system,
.theme-toggle[data-mode="light"] .t-light,
.theme-toggle[data-mode="dark"] .t-dark { display: block; }

/* ---- sign-in pages: brand panel + form --------------------------------- */
.auth { min-height: 100vh; }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 980px) { .auth-shell { grid-template-columns: minmax(380px, 44%) 1fr; } }

.auth-hero { display: none; position: relative; overflow: hidden; color: #fff;
  background: linear-gradient(155deg, #0b2a42 0%, #0a3557 38%, #004872 68%, #0065A1 100%); }
@media (min-width: 980px) { .auth-hero { display: block; } }
.auth-hero::before { content: ""; position: absolute; inset: 0; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: radial-gradient(ellipse at 30% 40%, #000 0%, transparent 72%); }
.hero-glow span { position: absolute; border-radius: 50%; filter: blur(60px); }
.hero-glow .g1 { width: 420px; height: 420px; right: -120px; top: -80px; background: rgba(42, 143, 203, .45); animation: drift 26s ease-in-out infinite; }
.hero-glow .g2 { width: 360px; height: 360px; left: -100px; bottom: -120px; background: rgba(169, 212, 238, .18); animation: drift 34s ease-in-out infinite reverse; }
@keyframes drift { 0%, 100% { transform: translate3d(0,0,0) scale(1); } 50% { transform: translate3d(30px, 24px, 0) scale(1.08); } }
.hero-inner { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: space-between; padding: 3rem clamp(2rem, 4vw, 4rem); }
.hero-inner img.logo { width: 200px; height: auto; display: block; }
.hero-eyebrow { margin: 0 0 1rem; font-size: .78rem; letter-spacing: .22em; text-transform: uppercase; color: #a9d4ee; font-weight: 700; }
.hero-title { margin: 0 0 2rem; font-size: clamp(1.7rem, 2.4vw, 2.35rem); line-height: 1.18; font-weight: 700; letter-spacing: -.01em; max-width: 17ch; }
.hero-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; max-width: 30rem; }
.hero-points li { display: flex; gap: .85rem; align-items: flex-start; color: rgba(255,255,255,.86); font-size: 1.02rem; line-height: 1.45; }
.hero-points .dot { flex: none; width: 10px; height: 10px; margin-top: .45rem; border-radius: 50%; background: #a9d4ee; box-shadow: 0 0 0 5px rgba(169, 212, 238, .16); }
.hero-foot { margin: 0; font-size: .8rem; letter-spacing: .08em; color: rgba(255,255,255,.55); }

.auth-side { position: relative; display: flex; flex-direction: column; min-height: 100vh; min-width: 0;
  background: radial-gradient(1200px 600px at 100% 0%, var(--aurora-1), transparent 60%),
              radial-gradient(900px 500px at 0% 100%, var(--aurora-3), transparent 60%), var(--bg); }
.auth-top { display: flex; justify-content: flex-end; padding: 1rem 1.25rem; }
.auth-main { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; align-content: center; padding: .5rem 1rem 2rem; }
.card { width: 100%; max-width: 28rem; background: var(--surface); border: 1px solid var(--line);
  border-radius: 22px; box-shadow: var(--shadow); padding: 2.4rem 2.2rem 2.1rem;
  animation: rise .45s cubic-bezier(.2,.7,.3,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.card .brand { display: flex; justify-content: center; margin-bottom: 1.6rem; }
.card .brand img { width: 186px; height: auto; display: block; }
@media (min-width: 980px) { .card .brand { display: none; } }
/* Blue wordmark on light surfaces, white wordmark in dark mode. */
.logo-on-dark { display: none !important; }
:root[data-theme="dark"] .logo-on-light { display: none !important; }
:root[data-theme="dark"] .logo-on-dark { display: block !important; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] .logo-on-light { display: none !important; }
  :root[data-theme="system"] .logo-on-dark { display: block !important; }
}
.card h1 { margin: 0 0 .4rem; text-align: center; color: var(--heading); font-size: 1.45rem;
  letter-spacing: .16em; text-transform: uppercase; font-weight: 700; }
.card .lede { margin: 0 0 1.7rem; text-align: center; color: var(--muted); }
.auth-foot { text-align: center; color: var(--muted); font-size: .84rem; padding: 0 1rem 1.4rem; }
.auth-foot a { color: inherit; text-decoration-color: var(--line); }

/* ---- forms --------------------------------------------------------------- */
label.field { display: block; margin: 0 0 1rem; }
label.field > span { display: block; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); margin-bottom: .35rem; font-weight: 700; }
input[type="email"], input[type="text"], input[type="password"], input[type="search"], input[type="url"], input[type="date"], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 12px; padding: .8rem .95rem; outline: none;
  transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--focus); }
input.code { text-align: center; font-size: 1.6rem; letter-spacing: .5em; font-variant-numeric: tabular-nums; padding-left: 1.2rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  font: inherit; font-weight: 700; letter-spacing: .02em; border-radius: 12px; padding: .8rem 1.25rem; min-height: 3rem;
  border: 1px solid transparent; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--focus); }
.btn-primary { color: #fff; background: linear-gradient(135deg, #0a7bc2 0%, #0065A1 55%, #004872 100%);
  box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 8px 20px -6px rgba(0, 101, 161, .55); }
.btn-primary:hover { color: #fff; filter: brightness(1.07); transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 12px 26px -8px rgba(0, 101, 161, .6); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: transparent; color: var(--red); border-color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-block { width: 100%; }
.btn-small { padding: .38rem .75rem; font-size: .875rem; border-radius: 8px; }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn svg { width: 20px; height: 20px; flex: none; }

.divider { display: flex; align-items: center; gap: .9rem; margin: 1.4rem 0; color: var(--muted);
  font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.notice { border-radius: 10px; padding: .8rem 1rem; margin: 0 0 1.2rem; font-size: .93rem;
  border: 1px solid var(--line); background: var(--surface-2); }
.notice.error { border-color: rgba(198, 29, 35, .45); background: rgba(198, 29, 35, .07); }
.notice.ok { border-color: rgba(97, 166, 14, .45); background: rgba(97, 166, 14, .08); }
.notice.warn { border-color: rgba(247, 144, 30, .5); background: rgba(247, 144, 30, .08); }
.form-error { color: var(--red); font-size: .9rem; min-height: 1.3em; margin: .6rem 0 0; text-align: center; }

altcha-widget { display: block; max-width: 100%; min-width: 0; margin: 0 0 1rem; --altcha-max-width: 100%; --altcha-border-radius: 10px;
  --altcha-color-base: var(--surface-2); --altcha-color-border: var(--line); --altcha-color-text: var(--text); }

.hint { text-align: center; color: var(--muted); font-size: .875rem; margin: .6rem 0 0; }
.section-label { margin: 1.1rem 0 .4rem; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.key-list { list-style: none; margin: 0 0 1rem; padding: 0; }
.key-list li { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.key-list li form { margin: 0; }
.key-list li.empty { color: var(--muted); font-size: .875rem; border-bottom: 0; }
.links { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.25rem; font-size: .9rem; }
/* A form button that reads as a link (Forgot password? submits the sign-in form elsewhere). */
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; }
.link-button:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--focus); border-radius: 4px; }
.prompt form { display: grid; gap: .75rem; margin-top: .25rem; }
.prompt .check { justify-content: center; }

/* Sign in with Google / Yahoo / Apple: each provider's own button colors. */
.idp-list { display: grid; gap: .6rem; margin: 0 0 1rem; }
.idp-list form { margin: 0; }
.btn-idp { display: flex; align-items: center; justify-content: center; gap: .65rem; font-weight: 600; text-decoration: none; }
.idp-ico { width: 20px; height: 20px; flex: none; }
.idp-google { background: #fff; color: #1f1f1f; border: 1px solid #747775; }
.idp-google:hover { background: #f2f2f2; }
.idp-yahoo { background: #6001d2; color: #fff; border: 1px solid #6001d2; }
.idp-yahoo:hover { background: #4c00a8; }
.idp-apple { background: #000; color: #fff; border: 1px solid #000; }
.idp-apple:hover { background: #1d1d1f; }
:root[data-theme="dark"] .idp-apple { background: #fff; color: #000; border-color: #fff; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] .idp-apple { background: #fff; color: #000; border-color: #fff; }
}
.key-list li > span .idp-ico { vertical-align: -4px; margin-right: .35rem; }
.linked-ok { color: var(--green, #61A60E); font-size: .85rem; font-weight: 600; }

/* ---- admin ------------------------------------------------------------- */
.band { position: sticky; top: 0; z-index: 10; color: #fff;
  background: linear-gradient(115deg, #0b2a42 0%, #004872 55%, #0065A1 100%); box-shadow: 0 6px 24px -12px rgba(11, 42, 66, .6); }
.band .inner { max-width: 76rem; margin: 0 auto; padding: .7rem 1.25rem; display: flex; align-items: center; gap: 1.25rem; }
.band img.logo { width: 132px; height: auto; display: block; }
.band .title { font-weight: 700; letter-spacing: .2em; text-transform: uppercase; font-size: .85rem; }
.band nav { display: flex; gap: .25rem; flex: 1; flex-wrap: wrap; }
.band nav a { color: rgba(255,255,255,.82); text-decoration: none; padding: .45rem .8rem; border-radius: 8px; font-size: .92rem; }
.band nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.band nav a.active { background: rgba(255,255,255,.18); color: #fff; font-weight: 700; }
.band .who { font-size: .85rem; opacity: .9; text-align: right; line-height: 1.25; }
.band .theme-toggle { color: rgba(255,255,255,.8); }
.band .theme-toggle:hover { background: rgba(255,255,255,.12); color: #fff; }
.band form { margin: 0; }
.band .btn-secondary { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.35); min-height: 2.2rem; }
.band .btn-secondary:hover { background: rgba(255,255,255,.18); color: #fff; border-color: rgba(255,255,255,.6); }

.page { max-width: 76rem; margin: 0 auto; padding: 1.75rem 1.25rem 4rem; }
.page h1 { margin: 0 0 .25rem; color: var(--heading); text-transform: uppercase; letter-spacing: .12em; font-size: 1.4rem; }
.page h2 { margin: 2rem 0 .75rem; font-size: .8rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 1.35rem 1.5rem; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.stat { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 1.15rem 1.35rem;
  transition: transform .15s ease, box-shadow .15s ease; }
.stat::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: linear-gradient(180deg, #0a7bc2, #004872); }
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat .n { font-size: 2.3rem; font-weight: 700; color: var(--heading); line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .l { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.04); }
table { border-collapse: collapse; width: 100%; font-size: .94rem; }
th, td { text-align: left; padding: .6rem .9rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
thead th { background: var(--csp-blue); color: #fff; font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; }
tbody tr:nth-child(even) td { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--chip-bg); }
td a { font-weight: 700; text-decoration: none; }
td a:hover { text-decoration: underline; }
td.actions { text-align: right; white-space: nowrap; }

.chip { display: inline-block; font-size: .78rem; padding: .1rem .55rem; border-radius: 99px;
  background: var(--chip-bg); color: var(--chip-text); margin: .1rem .15rem .1rem 0; }
.status { display: inline-flex; align-items: center; gap: .4rem; font-size: .74rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; padding: .18rem .6rem; border-radius: 99px; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status.active { color: #4a8a07; background: rgba(97, 166, 14, .12); }
.status.invited { color: #c26d06; background: rgba(247, 144, 30, .14); }
.status.disabled { color: var(--red); background: rgba(198, 29, 35, .10); }

.form-grid { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: .8rem 1rem; margin: 0 0 1rem; }
legend { font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 0 .4rem; }
.check { display: flex; align-items: flex-start; gap: .55rem; margin: .35rem 0; }
.check input { margin-top: .3rem; }
.row-actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.row-actions form { margin: 0; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.25rem; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; min-width: 0; }

@media (prefers-reduced-motion: reduce) {
  .hero-glow span, .card { animation: none; }
  .btn-primary:hover { transform: none; }
}
@media (max-width: 640px) {
  .card { padding: 1.9rem 1.3rem 1.6rem; border-radius: 18px; }
  .band .inner { flex-wrap: wrap; }
  .band .who { text-align: left; }
}
.stack > * + * { margin-top: 1rem; }
.page .panel h2 { margin-top: 0; }

/* Search bar: field and button on one line. */
form.search { display: flex; gap: .6rem; max-width: 32rem; margin: 0 0 1.1rem; }
form.search input { flex: 1; min-width: 0; }
.chip { font-weight: 700; }
/* Status pills stay readable on dark surfaces. */
:root[data-theme="dark"] .status.active { color: #9bd65a; background: rgba(97, 166, 14, .18); }
:root[data-theme="dark"] .status.invited { color: #ffb562; background: rgba(247, 144, 30, .18); }
:root[data-theme="dark"] .status.disabled { color: #ff7a7f; background: rgba(198, 29, 35, .2); }
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] .status.active { color: #9bd65a; background: rgba(97, 166, 14, .18); }
  :root[data-theme="system"] .status.invited { color: #ffb562; background: rgba(247, 144, 30, .18); }
  :root[data-theme="system"] .status.disabled { color: #ff7a7f; background: rgba(198, 29, 35, .2); }
}

/* ---- overview dashboard -------------------------------------------------- */
:root { --series-ok: #0065A1; --series-fail: #C61D23; --track: #e8eef4; }
:root[data-theme="dark"] { --series-ok: #2a8fcb; --series-fail: #e5484d; --track: #232c36; }
@media (prefers-color-scheme: dark) { :root[data-theme="system"] { --series-ok: #2a8fcb; --series-fail: #e5484d; --track: #232c36; } }

.kpis { grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); margin-bottom: 1.25rem; }
.kpis .stat .l { letter-spacing: .1em; }
.stat .l { margin-top: .25rem; }
.stat .unit { font-size: 1.1rem; margin-left: .1rem; color: var(--muted); }
.stat.warn::before { background: linear-gradient(180deg, #e5484d, #C61D23); }
.stat.warn .n { color: var(--series-fail); }

.dash { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); margin-bottom: 1.5rem; }
@media (min-width: 900px) { .dash { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dash .span-2 { grid-column: 1 / -1; }
.panel-title { margin: 0 0 .9rem !important; font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text) !important; font-weight: 700; display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; }
.panel-title .muted { letter-spacing: .02em; text-transform: none; font-weight: 400; }

.legend { display: flex; gap: 1.1rem; flex-wrap: wrap; font-size: .86rem; color: var(--muted); margin: 0 0 .6rem; }
.legend span { display: inline-flex; align-items: center; gap: .45rem; }
.legend strong { color: var(--text); }
.sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.sw.ok { background: var(--series-ok); }
.sw.fail { background: var(--series-fail); }

svg.chart { width: 100%; height: auto; display: block; overflow: visible; }
svg.chart .grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 4; opacity: .7; }
svg.chart .axis { stroke: var(--line); stroke-width: 1; }
svg.chart .tick { fill: var(--muted); font: 11px "Roboto Condensed", Arial, sans-serif; }
svg.chart .ok { fill: var(--series-ok); }
svg.chart .fail { fill: var(--series-fail); }
svg.chart .hit { fill: transparent; }
svg.chart .bar:hover .hit { fill: var(--chip-bg); opacity: .55; }
.table-view { margin-top: .6rem; font-size: .85rem; color: var(--muted); }
.table-view summary { cursor: pointer; }
.table-view table { margin-top: .5rem; font-size: .85rem; }
.chart-empty { padding: 1.4rem 1rem; text-align: center; color: var(--muted); background: var(--surface-2); border: 1px dashed var(--line); border-radius: 12px; }
.chart-empty.ok { color: #4a8a07; border-style: solid; background: rgba(97, 166, 14, .07); }

.barlist { list-style: none; margin: 0; padding: 0; display: grid; gap: .65rem; }
.barlist li { display: grid; grid-template-columns: minmax(8rem, 42%) 1fr auto; gap: .75rem; align-items: center; font-size: .92rem; }
.bl-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bl-track { width: 100%; height: 10px; display: block; }
.bl-track .bl-bg { fill: var(--track); }
.bl-track .ok { fill: var(--series-ok); }
.bl-track .fail { fill: var(--series-fail); }
.bl-value { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; min-width: 2.5rem; }
.bl-failn { font-weight: 400; color: var(--series-fail); font-size: .8rem; margin-left: .25rem; }
.place-ico { display: inline-block; width: 1.3em; text-align: center; }
.fineprint { margin: .9rem 0 0; font-size: .78rem; color: var(--muted); }
.fineprint a { color: inherit; }

.reasons, .feed { list-style: none; margin: 0; padding: 0; }
.reasons li { display: flex; align-items: center; gap: .6rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.reasons li:last-child, .feed li:last-child { border-bottom: 0; }
.reasons .reason { flex: 1; text-transform: capitalize; }
.feed li { display: grid; gap: .1rem; padding: .55rem 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.feed-when { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.section-head h2 { margin: 1.5rem 0 .75rem; }

/* ---- users list ------------------------------------------------------------ */
.toolbar { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: center; justify-content: space-between; margin: 0 0 1.1rem; }
.toolbar form.search { margin: 0; max-width: 38rem; flex: 1 1 26rem; }
.toolbar form.search select { width: auto; flex: none; }
.segmented { display: inline-flex; padding: 4px; gap: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; }
.seg { display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .9rem; border-radius: 9px; color: var(--text); text-decoration: none; font-weight: 700; font-size: .92rem; }
.seg:hover { background: var(--surface); color: var(--accent); }
.seg.on { background: var(--surface); color: var(--accent); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.seg .count { font-size: .75rem; font-weight: 700; padding: .05rem .45rem; border-radius: 99px; background: var(--chip-bg); color: var(--chip-text); }
.via { display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; font-weight: 700; padding: .18rem .6rem; border-radius: 99px; border: 1px solid; white-space: nowrap; }
.via::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: currentColor; }
.via-portal { color: var(--accent); border-color: rgba(0, 101, 161, .35); background: rgba(0, 101, 161, .07); }
.via-adfs { color: #6b4fa0; border-color: rgba(107, 79, 160, .35); background: rgba(107, 79, 160, .08); }
:root[data-theme="dark"] .via-adfs { color: #b9a3e6; }
@media (prefers-color-scheme: dark) { :root[data-theme="system"] .via-adfs { color: #b9a3e6; } }
.chip.role { background: transparent; border: 1px solid var(--accent); color: var(--accent); }

/* ---- audit ----------------------------------------------------------------- */
.btn-audit { color: #fff; background: linear-gradient(135deg, #375868 0%, #004872 100%);
  box-shadow: 0 8px 20px -8px rgba(0, 72, 114, .6); }
.btn-audit:hover { color: #fff; filter: brightness(1.12); transform: translateY(-1px); }
.filters { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); align-items: end; margin-bottom: 1.1rem; }
.filters .field { margin-bottom: .9rem; }
.filter-actions { display: flex; gap: .5rem; margin-bottom: .9rem; }
.kv { display: inline-flex; gap: .35rem; margin: .1rem .3rem .1rem 0; padding: .1rem .5rem; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); font-size: .8rem; word-break: break-word; }
.kv span { color: var(--muted); }
.action-tag { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82rem; font-weight: 400 !important;
  background: var(--chip-bg); color: var(--chip-text) !important; padding: .12rem .45rem; border-radius: 6px; }
.nowrap { white-space: nowrap; }
.pager { display: flex; justify-content: flex-end; margin-top: 1rem; }
