/* RedAuthen management console — design system v4 (matches the product datasheet). */

/* Self-hosted fonts (SIL Open Font License; see assets/fonts/LICENSE-*.txt). */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2-variations"), url("../fonts/inter-latin-wght-normal.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 300 700; font-display: swap; src: url("../fonts/space-grotesk-latin-wght-normal.woff2") format("woff2-variations"), url("../fonts/space-grotesk-latin-wght-normal.woff2") format("woff2"); }

:root {
    --bg: #f4f6f9;
    --surface: #ffffff;
    --surface-2: #f6f7fa;
    --surface-3: #eef1f5;
    --border: #e2e6ed;
    --border-strong: #cfd5df;
    --text: #0f172a;
    --text-2: #475467;
    --text-3: #7a8494;
    --brand: #d42a3c;
    --brand-hover: #b81f30;
    --brand-soft: #fdecee;
    --brand-ink: #b0182a;
    --accent: #1f5fbf;
    --ok: #157f4a;
    --ok-soft: #e7f6ee;
    --warn: #9a5b00;
    --warn-soft: #fff4dc;
    --bad: #c0182b;
    --bad-soft: #fdecee;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .06);
    --shadow-pop: 0 12px 32px rgba(15, 23, 42, .14), 0 2px 6px rgba(15, 23, 42, .08);
    --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-display: "Space Grotesk", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body.ra-console {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.55 var(--font);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: 12.5px; color: var(--text-2); overflow-wrap: anywhere; }
td code { overflow-wrap: normal; }
h1, h2, h3 { color: var(--text); line-height: 1.25; letter-spacing: -.01em; }
h1 { font: 700 24px/1.2 var(--font-display); margin: 0; letter-spacing: -.02em; }
h2 { font: 650 15.5px/1.3 var(--font); margin: 0 0 14px; }
h3 { font-size: 13.5px; font-weight: 650; margin: 0 0 8px; }
p { margin: 0 0 10px; }

.ra-skip { position: absolute; left: -999px; }
.ra-skip:focus { left: 12px; top: 12px; z-index: 10; background: var(--surface); padding: 8px 12px; border-radius: var(--radius); }
.ra-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Shell */
.ra-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.ra-side {
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
    background: var(--surface); border-right: 1px solid var(--border);
    padding: 18px 14px 24px; display: flex; flex-direction: column;
}
.ra-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; margin-bottom: 8px; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none; }
.ra-brand:hover { text-decoration: none; }
.ra-brand .ra-logo-mark { color: var(--brand); flex: none; }
.ra-brand-name { font: 700 18px/1 var(--font-display); letter-spacing: -.01em; }
.ra-brand-sub { display: block; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); margin-top: 4px; font-weight: 600; }
.ra-nav { display: block; flex: 1; }
.ra-nav-section { margin-top: 14px; }
.ra-nav-heading { padding: 6px 10px; font-size: 10.5px; color: var(--text-3); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.ra-nav-item {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 7px 10px; margin: 1px 0; border-radius: var(--radius);
    color: var(--text-2); text-decoration: none; font-size: 13.5px; font-weight: 500;
    position: relative;
}
.ra-nav-item:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.ra-nav-item.is-active { background: var(--brand-soft); color: var(--brand-ink); font-weight: 650; }
.ra-nav-item.is-active::before { content: ""; position: absolute; left: -14px; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.ra-nav-item:focus-visible, .ra-btn:focus-visible, a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ra-nav-badge { min-width: 20px; padding: 1px 7px; border-radius: 10px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; text-align: center; }
.ra-side-foot { margin-top: 18px; padding: 12px 10px 0; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--text-3); }

.ra-main-column { min-width: 0; display: flex; flex-direction: column; }
.ra-top {
    position: sticky; top: 0; z-index: 5;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 10px 32px; min-height: 60px; background: rgba(255, 255, 255, .94); border-bottom: 1px solid var(--border);
    backdrop-filter: saturate(1.4) blur(8px);
}
.ra-org-switch { display: flex; align-items: center; gap: 10px; }
.ra-org-label { font-size: 10.5px; color: var(--text-3); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.ra-org-switch select { min-width: 260px; font-weight: 600; }
.ra-top-actions { display: flex; align-items: center; gap: 18px; }
.ra-admin { display: flex; align-items: center; gap: 10px; line-height: 1.25; }
.ra-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-3); color: var(--text-2); display: grid; place-items: center; font-weight: 700; font-size: 12.5px; }
.ra-admin strong { display: block; font-size: 13px; }
.ra-admin small { font-size: 11.5px; color: var(--text-3); }
.ra-health-pill { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; padding: 5px 11px; border-radius: 20px; border: 1px solid transparent; }
.ra-health-pill:hover { text-decoration: none; }
.ra-health-pill.is-ok { color: var(--ok); background: var(--ok-soft); border-color: #c9ebd8; }
.ra-health-pill.is-bad { color: var(--bad); background: var(--bad-soft); border-color: #f6c9cf; }
.ra-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.ra-content { padding: 28px 32px 56px; max-width: 1320px; width: 100%; }

/* Page header */
.ra-page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.ra-page-head p { margin: 6px 0 0; color: var(--text-2); max-width: 760px; }
.ra-crumbs, .ra-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--brand); margin-bottom: 8px; }
.ra-crumbs a { color: var(--brand); }
.ra-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Cards and grids */
.ra-card, .card, .panel {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 20px 22px; margin-bottom: 18px; box-shadow: var(--shadow);
}
.ra-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.ra-card-head h2 { margin: 0; }
.ra-grid { display: grid; gap: 18px; }
.ra-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ra-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ra-metrics, .cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.ra-metric { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 18px 15px; text-decoration: none; color: inherit; display: block; box-shadow: var(--shadow); position: relative; }
.ra-metric::before { content: ""; display: block; width: 28px; height: 3px; border-radius: 2px; background: var(--brand); margin-bottom: 12px; }
a.ra-metric:hover { border-color: var(--border-strong); text-decoration: none; }
.ra-metric-label { font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.ra-metric-value { font: 700 28px/1.15 var(--font-display); margin-top: 4px; letter-spacing: -.02em; }
.ra-metric-note { font-size: 12px; color: var(--text-3); }

/* Lists */
.ra-list { list-style: none; margin: 0; padding: 0; }
.ra-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--border); }
.ra-list li:first-child { border-top: 0; padding-top: 2px; }
.ra-list .ra-list-main { min-width: 0; }
.ra-list .ra-list-sub { color: var(--text-3); font-size: 12.5px; }

/* Tables */
.ra-table, .ra-content table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.ra-content th { text-align: left; font-weight: 700; color: var(--text-3); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.ra-content th:first-child { border-top-left-radius: var(--radius); }
.ra-content th:last-child { border-top-right-radius: var(--radius); }
.ra-content td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.ra-content tbody tr:hover td { background: #fafbfc; }
.ra-content tr:last-child td { border-bottom: 0; }
.ra-table-wrap { overflow: visible; border: 1px solid var(--border); border-radius: var(--radius); }
.ra-content td a strong { color: var(--text); }

/* Forms */
.ra-content input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=file]),
.ra-content select, .ra-content textarea, .ra-top select {
    background: var(--surface); color: var(--text); border: 1px solid var(--border-strong);
    border-radius: var(--radius); padding: 8px 11px; font: inherit; font-size: 13.5px; min-height: 38px; width: 100%;
    transition: border-color .12s, box-shadow .12s;
}
.ra-content .ra-inline input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=file]), .ra-content .ra-inline select, .ra-top select { width: auto; }
.ra-content input[type=file] { font-size: 13px; }
.ra-content input:focus, .ra-content select:focus, .ra-content textarea:focus, .ra-top select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(212, 42, 60, .14); }
.ra-content input:disabled, .ra-content input[readonly] { background: var(--surface-2); color: var(--text-3); }
.ra-content input::placeholder { color: #a3abb8; }
.ra-content input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--brand); }
.ra-form { display: grid; gap: 14px; }
.ra-form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; align-items: end; }
.ra-field { display: grid; gap: 6px; }
.ra-field label, .ra-label { font-size: 12.5px; color: var(--text); font-weight: 600; }
.ra-help { font-size: 12px; color: var(--text-3); }
.ra-inline { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0; }

/* Buttons */
.ra-btn, .ra-content button {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 36px; padding: 7px 14px; border-radius: var(--radius);
    border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
    font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
    box-shadow: 0 1px 1px rgba(15, 23, 42, .04);
}
.ra-btn:hover, .ra-content button:hover { background: var(--surface-2); text-decoration: none; }
.ra-btn-primary, .ra-content button.ra-btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.ra-btn-primary:hover, .ra-content button.ra-btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.ra-btn-danger, .ra-content button.ra-btn-danger { color: var(--bad); border-color: #f2c2c9; background: var(--surface); }
.ra-btn-danger:hover, .ra-content button.ra-btn-danger:hover { background: var(--bad-soft); }
.ra-btn-ghost, .ra-content button.ra-btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); box-shadow: none; }
.ra-btn-ghost:hover, .ra-content button.ra-btn-ghost:hover { background: var(--surface-3); }
.ra-btn-sm, .ra-content button.ra-btn-sm { min-height: 30px; padding: 4px 11px; font-size: 12.5px; }
.ra-field > button, .ra-field > .ra-btn { justify-self: start; }

/* Badges */
.ra-badge, .badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 650; background: var(--surface-3); color: var(--text-2); white-space: nowrap; border: 1px solid transparent; }
.ra-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.ra-badge-ok { background: var(--ok-soft); color: var(--ok); border-color: #cbebd9; }
.ra-badge-warn { background: var(--warn-soft); color: var(--warn); border-color: #f5e0b0; }
.ra-badge-bad { background: var(--bad-soft); color: var(--bad); border-color: #f6c9cf; }
.ra-badge-plain::before { display: none; }

/* Alerts and empty states */
.ra-alert { padding: 12px 14px; border-radius: var(--radius); margin-bottom: 16px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); box-shadow: var(--shadow); }
.ra-alert-ok { background: var(--ok-soft); border-color: #c9ebd8; color: #0f5e37; }
.ra-alert-warn, .warn { background: var(--warn-soft); border-color: #f2dcaa; color: #7a4800; }
p.warn { padding: 9px 12px; border-radius: var(--radius); }
.ra-alert-bad { background: var(--bad-soft); border-color: #f6c9cf; color: #9d1222; }
.ra-empty { padding: 32px 16px; text-align: center; color: var(--text-3); border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); background: var(--surface-2); }
.ra-empty strong { display: block; color: var(--text); margin-bottom: 4px; font-size: 14px; }

.muted, .ra-muted { color: var(--text-3); }
.note { color: var(--text-2); font-size: 13px; }
.ra-mt { margin-top: 16px; }
.ra-kv { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 8px 16px; margin: 0; }
.ra-kv dt { color: var(--text-3); font-weight: 600; font-size: 13px; }
.ra-kv dd { margin: 0; }

/* Row actions popover (details/summary) */
.ra-content details { position: relative; }
.ra-content details > summary { list-style: none; }
.ra-content details > summary::-webkit-details-marker { display: none; }
.ra-content details[open] > .ra-card { position: absolute; right: 0; z-index: 4; box-shadow: var(--shadow-pop); text-align: left; }

/* Code and diffs */
.ra-code { background: #0f172a; border: 1px solid #0f172a; border-radius: var(--radius); padding: 12px 14px; font: 12.5px/1.6 var(--mono); color: #cbd5e1; overflow-x: auto; white-space: pre; margin: 8px 0 0; max-height: 520px; }
.ra-diff-add { color: #86efac; background: rgba(34, 197, 94, .12); display: block; }
.ra-diff-del { color: #fca5a5; background: rgba(239, 68, 68, .14); display: block; }
.ra-diff-same { display: block; }

/* Pagination from Laravel's default view */
.ra-content nav[role=navigation] { margin-top: 14px; font-size: 13px; color: var(--text-3); }
.ra-content nav[role=navigation] svg { width: 16px; height: 16px; }

/* System health */
.ra-health-banner { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--ok); border-radius: var(--radius-lg); padding: 18px 22px; margin-bottom: 18px; box-shadow: var(--shadow); }
.ra-health-banner.is-warn { border-left-color: #d08a00; }
.ra-health-banner.is-bad { border-left-color: var(--bad); }
.ra-health-banner-main { display: flex; gap: 14px; align-items: center; }
.ra-health-banner h2 { margin: 0 0 2px; font: 700 20px/1.2 var(--font-display); }
.ra-health-banner p { margin: 0; color: var(--text-2); font-size: 13.5px; }
.ra-health-icon { width: 38px; height: 38px; border-radius: 50%; flex: none; background: var(--ok-soft); position: relative; }
.ra-health-icon::after { content: ""; position: absolute; inset: 12px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px rgba(21, 127, 74, .18); }
.is-warn .ra-health-icon { background: var(--warn-soft); } .is-warn .ra-health-icon::after { background: #d08a00; box-shadow: 0 0 0 4px rgba(208, 138, 0, .18); }
.is-bad .ra-health-icon { background: var(--bad-soft); } .is-bad .ra-health-icon::after { background: var(--bad); box-shadow: 0 0 0 4px rgba(192, 24, 43, .18); }
.ra-health-facts { display: flex; gap: 28px; margin: 0; }
.ra-health-facts dt { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); font-weight: 600; }
.ra-health-facts dd { margin: 3px 0 0; font-weight: 600; font-size: 14px; white-space: nowrap; }
.ra-health-facts dd span { color: var(--text-3); font-weight: 500; }
.ra-refresh { font-size: 12px; color: var(--text-3); align-self: flex-end; white-space: nowrap; }
.ra-refresh::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); margin-right: 7px; vertical-align: 1px; }
.ra-health-table td { vertical-align: middle; }
.ra-health-table td.num, .ra-health-table th.num { text-align: right; white-space: nowrap; }
.ra-text-warn { color: var(--warn); } .ra-text-bad { color: var(--bad); }
.ra-strip { display: flex; gap: 2px; align-items: center; height: 22px; min-width: 180px; }
.ra-strip i { flex: 1 1 0; max-width: 5px; height: 100%; border-radius: 1.5px; background: var(--surface-3); }
.ra-strip i.is-healthy { background: #3aa66b; }
.ra-strip i.is-degraded, .ra-strip i.is-unknown { background: #e0a526; }
.ra-strip i.is-down { background: var(--bad); }
.ra-strip i.is-not_configured { background: var(--surface-3); }
.ra-gauge h3 { margin: 0; font-size: 13.5px; }
.ra-gauge-value { font: 700 26px/1.1 var(--font-display); margin-bottom: 10px; }
.ra-gauge-track { position: relative; height: 8px; border-radius: 4px; background: var(--surface-3); }
.ra-gauge-fill { height: 100%; border-radius: 4px; background: #3aa66b; }
.ra-gauge-fill.is-warning { background: #e0a526; } .ra-gauge-fill.is-critical { background: var(--bad); } .ra-gauge-fill.is-unknown { background: var(--border-strong); }
.ra-gauge-mark { position: absolute; top: -3px; bottom: -3px; width: 2px; background: #e0a526; opacity: .7; }
.ra-gauge-mark.is-crit { background: var(--bad); }

/* Administrator organization picker */
.ra-org-pick { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px 12px; margin: 4px 0 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 14px; max-height: 220px; overflow: auto; }
.ra-org-pick legend { font-size: 12.5px; font-weight: 600; color: var(--text-2); padding: 0 6px; }
.ra-org-pick[hidden] { display: none; }

/* Dashboard */
.ra-grid-dash { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.ra-seg { display: inline-flex; background: var(--surface-3); border-radius: var(--radius); padding: 3px; gap: 2px; }
.ra-seg a { padding: 6px 12px; border-radius: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-2); text-decoration: none; white-space: nowrap; }
.ra-seg a:hover { color: var(--text); }
.ra-seg a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.ra-up { color: var(--ok); font-weight: 600; }
.ra-down { color: var(--bad); font-weight: 600; }
.ra-legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-2); }
.ra-legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.ra-key-ok::before { background: #2f6fd6; }
.ra-key-bad::before { background: var(--brand); }
.ra-chart { display: flex; align-items: flex-end; gap: 3px; height: 180px; padding-top: 6px; border-bottom: 1px solid var(--border); background: repeating-linear-gradient(to top, transparent 0, transparent 44px, var(--surface-3) 44px, var(--surface-3) 45px); }
.ra-chart-col { flex: 1 1 0; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
.ra-chart-col:hover { background: var(--surface-2); }
.ra-chart-ok { background: #2f6fd6; border-radius: 2px 2px 0 0; }
.ra-chart-bad { background: var(--brand); border-radius: 2px 2px 0 0; }
.ra-chart-bad + .ra-chart-ok { border-radius: 0; }
.ra-chart-axis { display: flex; gap: 3px; margin-top: 6px; }
.ra-chart-axis span { flex: 1 1 0; min-width: 0; font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: visible; }
.ra-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ra-bars-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 5px; }
.ra-bars-track { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.ra-bars-track div { height: 100%; background: var(--brand); border-radius: 3px; }
.ra-mini { width: 100%; border-collapse: collapse; font-size: 13px; }
.ra-mini td { padding: 8px 0; border-top: 1px solid var(--border); vertical-align: middle; }
.ra-mini tr:first-child td { border-top: 0; padding-top: 0; }
.ra-mini td.num { text-align: right; white-space: nowrap; padding-left: 10px; }
.ra-mini .ra-list-sub { color: var(--text-3); font-size: 12px; }
.ra-list-tight li { padding: 8px 0; font-size: 13px; }
.ra-list .ra-list-main { display: flex; gap: 9px; align-items: baseline; }
.ra-list .ra-list-main > div { min-width: 0; }
.ra-dot-bad { color: var(--bad); flex: none; }
.ra-dot-warn { color: #d08a00; flex: none; }
.ra-dot-info { color: var(--accent); flex: none; }

@media (max-width: 960px) {
    .ra-shell { grid-template-columns: 1fr; }
    .ra-side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
    .ra-brand { border-bottom: 0; margin-bottom: 0; }
    .ra-nav { display: flex; gap: 4px; overflow-x: auto; }
    .ra-nav-section { display: flex; gap: 4px; margin: 0; }
    .ra-nav-heading, .ra-side-foot { display: none; }
    .ra-nav-item { white-space: nowrap; }
    .ra-nav-item.is-active::before { display: none; }
    .ra-grid-2, .ra-grid-3, .ra-grid-dash { grid-template-columns: 1fr; }
    .ra-health-facts { gap: 18px; flex-wrap: wrap; }
    .ra-table-wrap { overflow-x: auto; }
    .ra-content details[open] > .ra-card { position: static; min-width: 0 !important; }
    .ra-top { flex-wrap: wrap; padding: 10px 16px; }
    .ra-content { padding: 18px 16px 40px; }
    .ra-org-switch select { min-width: 0; max-width: 60vw; }
    .ra-kv { grid-template-columns: 1fr; }
}

/* LDAP access apply bar */
.ra-apply-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.ra-apply-bar > div > span + span { margin-left: 8px; }
button:disabled, .ra-btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }

/* Self-service portal (/register, /account/setup) — same design as the console sign-in */
body.ra-portal { min-height: 100vh; margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--bg); color: var(--text); font: 14px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
.ra-portal-brand { background: #0f172a; color: #e2e8f0; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; }
.ra-portal-logo { display: flex; align-items: center; gap: 10px; color: #fff; font: 700 20px/1 var(--font-display); }
.ra-portal-logo .ra-logo-mark { color: var(--brand); }
.ra-portal-logo-img { max-height: 40px; max-width: 180px; object-fit: contain; }
.ra-portal-eyebrow { margin-top: 56px; color: var(--brand); font-size: 11.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; filter: brightness(1.25); }
.ra-portal-brand h1 { color: #fff; font: 700 36px/1.15 var(--font-display); letter-spacing: -.02em; margin: 16px 0 12px; max-width: 520px; }
.ra-portal-desc { color: #94a3b8; max-width: 460px; font-size: 15px; }
.ra-portal-desc a, .ra-portal-foot a { color: #e2e8f0; }
.ra-portal-points { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; }
.ra-portal-points li { display: flex; gap: 10px; color: #cbd5e1; }
.ra-portal-points li::before { content: ""; width: 18px; height: 3px; border-radius: 2px; background: var(--brand); margin-top: 10px; flex: none; }
.ra-portal-foot { color: #64748b; font-size: 12px; }
.ra-portal-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.ra-portal-card { width: 100%; max-width: 420px; }
.ra-portal-card h2 { font: 700 24px/1.2 var(--font-display); margin: 0 0 8px; letter-spacing: -.02em; }
.ra-portal-intro { color: var(--text-2); margin: 0 0 18px; }
.ra-portal-form { display: grid; gap: 6px; }
.ra-portal-form label { font-size: 12.5px; font-weight: 600; margin-top: 8px; }
.ra-portal-optional { color: var(--text-3); font-weight: 500; }
.ra-portal-form input, .ra-portal-form textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 10px 12px; font: inherit; min-height: 42px; background: #fff; color: var(--text); }
.ra-portal-form input:focus, .ra-portal-form textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent); }
.ra-portal-form button { margin-top: 14px; min-height: 42px; border-radius: var(--radius); border: 1px solid var(--brand); background: var(--brand); color: #fff; font: inherit; font-weight: 650; cursor: pointer; }
.ra-portal-form button:hover { background: var(--brand-hover); }
.ra-portal-hint { color: var(--text-3); font-size: 12px; margin: 4px 0 0; }
.ra-portal-alt { margin-top: 18px; color: var(--text-2); font-size: 13px; }
.ra-portal-alt a, .ra-portal-help a { color: var(--brand-ink); font-weight: 600; }
.ra-portal-error { margin: 0 0 14px; padding: 11px 13px; border-radius: var(--radius); background: var(--bad-soft); border: 1px solid #f6c9cf; color: #9d1222; font-size: 13px; }
.ra-portal-ok { margin: 8px 0 14px; padding: 12px 14px; border-radius: var(--radius); background: var(--ok-soft); border: 1px solid #cbebd9; color: var(--ok); }
.ra-portal-help { margin-top: 26px; padding-top: 14px; border-top: 1px solid var(--border); color: var(--text-2); font-size: 13px; }
.ra-portal-help p { margin: 0 0 6px; }
.ra-portal-steps { list-style: none; padding: 0; margin: 4px 0 16px; display: flex; gap: 8px; counter-reset: s; font-size: 12px; }
.ra-portal-steps li { counter-increment: s; display: flex; align-items: center; gap: 6px; color: var(--text-3); }
.ra-portal-steps li::before { content: counter(s); width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--surface-3); font-weight: 700; }
.ra-portal-steps li + li::after { content: none; }
.ra-portal-steps li.current { color: var(--text); font-weight: 600; }
.ra-portal-steps li.current::before { background: var(--brand); color: #fff; }
.ra-portal-steps li.done::before { content: "✓"; background: var(--ok-soft); color: var(--ok); }
.ra-portal-qr { display: flex; justify-content: center; padding: 12px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); margin-bottom: 8px; }
@media (max-width: 860px) {
    body.ra-portal { grid-template-columns: 1fr; }
    .ra-portal-brand { padding: 24px; gap: 12px; }
    .ra-portal-eyebrow { margin-top: 24px; }
    .ra-portal-brand h1 { font-size: 26px; }
    .ra-portal-points { display: none; }
}

/* Portal Appearance editor */
.ra-portal-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 18px; align-items: start; }
.ra-portal-preview { position: sticky; top: 76px; }
.ra-portal-preview iframe { width: 100%; height: 640px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow); }
.ra-logo-preview { background: #0f172a; border-radius: var(--radius); padding: 10px 12px; display: inline-flex; }
.ra-logo-preview img { max-height: 36px; max-width: 160px; }
.ra-code-input { font: 12.5px/1.6 var(--mono); width: 100%; box-sizing: border-box; }
.ra-sticky-actions { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; }
@media (max-width: 1200px) { .ra-portal-editor { grid-template-columns: 1fr; } .ra-portal-preview { position: static; } }

/* Users: filters, tags, bulk action bar */
.ra-filters select { min-width: 150px; }
.ra-tag { display: inline-block; padding: 1px 8px; margin: 1px 4px 1px 0; border-radius: 10px; background: var(--surface-3); color: var(--text-2); font-size: 12px; white-space: nowrap; }
.ra-bulk-bar { position: sticky; top: 64px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 12px; background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 25%, #fff); border-radius: var(--radius); }
.ra-bulk-bar[hidden] { display: none; }
.ra-bulk-bar select { min-width: 140px; }

/* Self-service portal: signed-in page */
.ra-portal-userbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 14px; margin-bottom: 6px; border-bottom: 1px solid var(--border); }
.ra-portal-section { padding: 16px 0 6px; border-bottom: 1px solid var(--border); }
.ra-portal-section:last-of-type { border-bottom: 0; }
.ra-portal-section h3 { margin: 0 0 8px; font: 700 16px/1.3 var(--font-display); }
.ra-portal-warn { margin: 0 0 12px; padding: 11px 13px; border-radius: var(--radius); background: var(--warn-soft); border: 1px solid #f3dca6; color: var(--warn); font-size: 13px; }
.ra-portal-pill { display: inline-block; padding: 1px 8px; border-radius: 10px; background: var(--ok-soft); color: var(--ok); font-size: 11.5px; font-weight: 700; margin-right: 6px; }
.ra-portal-pill.off { background: var(--surface-3); color: var(--text-2); }
.ra-portal-details summary { cursor: pointer; color: var(--brand-ink); font-weight: 600; font-size: 13px; margin: 6px 0; }
.ra-linkbtn { background: none; border: 0; padding: 0; color: var(--brand-ink); font: inherit; font-weight: 600; cursor: pointer; }

/* Dashboard: password expiry */
.ra-pw-counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ra-pw-counts > div { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; display: flex; flex-direction: column; }
.ra-pw-counts strong { font: 700 22px/1.1 var(--font-display); }
.ra-pw-counts span { font-size: 12px; color: var(--text-2); }
.ra-pw-counts .is-bad strong { color: var(--bad); } .ra-pw-counts .is-warn strong { color: var(--warn); } .ra-pw-counts .is-soon strong { color: #b7791f; }
.ra-bulk-bar [hidden] { display: none !important; }
.ra-bulk-bar select, .ra-filters select { width: auto; min-height: 34px; }
.ra-bulk-bar > span { display: inline-flex; align-items: center; gap: 6px; }
.ra-filters input[type=search] { width: auto; }
