/* Dependency-free Material You presentation using local CSS and system fonts. */
:root {
  color-scheme: light;
  --bg: #fff; --surface: #fff; --surface-soft: #f8f9fa;
  --ink: #202124; --muted: #5f6368; --faint: #747775; --line: #dadce0;
  --primary: #1a73e8; --primary-hover: #1558b0; --primary-soft: #e8f0fe;
  --success: #188038; --success-soft: #e6f4ea; --danger: #d93025; --danger-soft: #fce8e6;
  --hero: #f8fbff; --hero-line: #d2e3fc; --hero-ink: #202124;
  --sidebar-width: 264px; --shadow: 0 1px 3px #2021241f, 0 4px 12px #2021240d;
  font-synthesis: none;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101828; --surface: #182230; --surface-soft: #202c3d;
  --ink: #f2f4f7; --muted: #98a2b3; --faint: #76849a; --line: #2b3648;
  --primary: #8192ff; --primary-hover: #a1adff; --primary-soft: #27315b;
  --success: #75e0a7; --success-soft: #15392c; --danger: #fda29b; --danger-soft: #442728;
  --hero: #202d51; --hero-line: #354575; --hero-ink: #d0d8ff;
  --shadow: 0 8px 24px #00000018;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--bg); font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: not-allowed; }
button, a, input, select, summary { outline-offset: 4px; }
:focus-visible { outline: 2px solid var(--primary); }
button, input, select { -webkit-tap-highlight-color: transparent; }
input, select { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 11px 13px; color: var(--ink); background: var(--surface); transition: border-color .15s, box-shadow .15s; }
input::placeholder { color: var(--faint); }
input:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent); }
input[type="checkbox"] { accent-color: var(--primary); }
.icon { flex-shrink: 0; vertical-align: middle; }
.button, .button-secondary { display: inline-flex; justify-content: center; align-items: center; gap: 10px; min-height: 43px; padding: 10px 17px; border: 1px solid transparent; border-radius: 8px; font-size: 13px; font-weight: 600; line-height: 1.5; background: #465fff; color: #fff; text-decoration: none; }
.button:hover { background: #3641e8; text-decoration: none; }
.button-secondary { background: var(--surface); border-color: var(--line); color: var(--ink); }
.button-secondary:hover { background: var(--surface-soft); text-decoration: none; }
.button .icon { width: 17px; height: 17px; }
.icon-button { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--muted); flex-shrink: 0; }
.icon-button:hover { color: var(--primary); background: var(--primary-soft); }
.icon-button .icon { width: 19px; height: 19px; }
.theme-toggle { border-radius: 50%; }
.theme-sun { display: none; }
[data-theme="dark"] .theme-moon { display: none; }
[data-theme="dark"] .theme-sun { display: inline-flex; }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 200; background: var(--primary); color: #fff; border-radius: 8px; padding: 10px 18px; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; flex-shrink: 0; border-radius: 11px; background: #465fff; color: #fff; }
.brand-name { font-size: 24px; font-weight: 750; letter-spacing: -.9px; }
.brand-name strong { font-weight: 450; }
.sidebar { width: var(--sidebar-width); position: fixed; inset: 0 auto 0 0; z-index: 60; display: flex; flex-direction: column; padding: 28px 18px 19px; background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; transition: width .2s, transform .2s; }
.sidebar-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 8px; min-height: 40px; }
.sidebar-close { display: none; }
.sidebar-caption { font-size: 10px; color: var(--faint); font-weight: 600; letter-spacing: 1px; margin: 37px 14px 14px; }
.main-nav { display: grid; gap: 6px; }
.nav-link { display: flex; gap: 13px; align-items: center; min-height: 46px; padding: 11px 14px; color: var(--muted); border-radius: 8px; font-size: 13px; font-weight: 500; }
.nav-link > .icon { width: 20px; height: 20px; }
.nav-link:hover { background: var(--surface-soft); color: var(--ink); text-decoration: none; }
.nav-link.selected { color: var(--primary); background: var(--primary-soft); font-weight: 600; }
.nav-indicator { margin-left: auto; width: 5px; height: 5px; border-radius: 50%; background: currentColor; visibility: hidden; }
.nav-link.selected .nav-indicator { visibility: visible; }
.nav-group { display: block; font-size: 11px; font-weight: 600; padding: 12px 14px 3px; color: var(--faint); }
.nav-children { padding-left: 15px; display: grid; gap: 4px; }
.sidebar-footer { margin-top: auto; display: flex; align-items: center; gap: 7px; padding: 17px 10px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; white-space: nowrap; }
.sidebar-edition { font-size: 8px; color: var(--faint); margin-left: auto; letter-spacing: .6px; }
.connection-dot { display: inline-block; flex-shrink: 0; width: 6px; height: 6px; background: #12b76a; border-radius: 50%; }
.sidebar-backdrop { display: none; }
.workspace { margin-left: var(--sidebar-width); min-height: 100vh; display: flex; flex-direction: column; transition: margin-left .2s; }
.topbar { min-height: 82px; padding: 14px 29px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.topbar-start, .topbar-actions { display: flex; align-items: center; gap: 19px; min-width: 0; }
.workspace-label { color: var(--muted); font-size: 11px; white-space: nowrap; }
.workspace-label strong { font-weight: 500; color: var(--ink); }
.workspace-divider { color: var(--line); padding: 0 10px; }
.topbar-actions { gap: 15px; }
.topbar-divider { height: 30px; width: 1px; background: var(--line); }
.role-switcher { display: flex; align-items: center; gap: 9px; }
.role-switcher label { color: var(--faint); display: block; font-size: 8px; letter-spacing: .8px; font-weight: 600; line-height: 1; margin-bottom: 4px; }
.role-switcher select { padding: 1px 21px 1px 0; border: 0; border-radius: 3px; font-size: 11px; font-weight: 600; max-width: 190px; min-height: 20px; background-color: transparent; }
.role-submit { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 7px; padding: 7px; }
.role-submit:hover { color: var(--primary); border-color: var(--primary); }
.role-submit .icon { width: 15px; height: 15px; }
.account-menu { position: relative; }
.account-menu summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; border-radius: 8px; }
.account-menu summary::-webkit-details-marker { display: none; }
.account-menu summary > .icon { width: 15px; height: 15px; color: var(--muted); }
.avatar { width: 38px; height: 38px; flex-shrink: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--primary-soft); color: var(--primary); font-weight: 650; font-size: 14px; border: 1px solid color-mix(in srgb, var(--primary) 10%, transparent); }
.account-name { max-width: 160px; }
.account-name strong { display: block; color: var(--ink); font-size: 11px; font-weight: 600; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.account-name small { display: block; color: var(--muted); font-size: 10px; }
.account-dropdown { position: absolute; top: calc(100% + 17px); right: 0; width: 245px; z-index: 65; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 8px; }
.account-heading { display: grid; gap: 3px; padding: 10px 9px 14px; margin-bottom: 5px; border-bottom: 1px solid var(--line); }
.account-heading strong { font-size: 12px; }
.account-heading span { font-size: 10px; color: var(--muted); }
.account-dropdown > a, .account-dropdown button { display: flex; gap: 10px; align-items: center; width: 100%; padding: 10px 9px; border-radius: 7px; font-size: 12px; color: var(--muted); background: transparent; border: 0; text-align: left; }
.account-dropdown > a:hover, .account-dropdown button:hover { background: var(--surface-soft); color: var(--ink); text-decoration: none; }
.account-dropdown .icon { width: 17px; height: 17px; }
.workspace main { flex: 1; padding: 29px 30px 45px; width: 100%; max-width: 1600px; margin: 0 auto; }
h1 { font-size: 26px; letter-spacing: -.75px; line-height: 1.3; font-weight: 650; margin: 0; }
h2 { font-size: 16px; letter-spacing: -.3px; line-height: 1.4; font-weight: 600; margin: 0; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 22px; margin-bottom: 23px; }
.eyebrow { display: block; color: var(--faint); font-size: 9px; font-weight: 600; letter-spacing: 1.1px; margin-bottom: 5px; }
.breadcrumb { display: flex; align-items: center; flex-shrink: 0; gap: 9px; color: var(--muted); font-size: 11px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb .icon { width: 13px; height: 13px; color: var(--faint); }
.breadcrumb span { max-width: 210px; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; color: var(--ink); }
.intro { font-size: 12px; line-height: 1.8; color: var(--muted); max-width: 820px; margin: -5px 0 24px; }
.intro strong { color: var(--ink); font-weight: 500; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; margin: 0 0 24px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 21px 23px; }
.stat-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 19px; }
.stat-icon { display: inline-flex; align-items: center; justify-content: center; width: 43px; height: 43px; background: var(--surface-soft); color: var(--ink); border-radius: 11px; }
.stat-icon .icon { width: 22px; height: 22px; }
.stat-indicator { display: inline-flex; align-items: center; justify-content: center; width: 21px; height: 21px; border-radius: 50%; background: var(--success-soft); color: var(--success); }
.stat-indicator .icon { width: 12px; height: 12px; }
.stat-label { display: block; font-size: 12px; color: var(--muted); }
.stat-value { font-size: 29px; font-weight: 650; line-height: 1.4; letter-spacing: -.6px; margin: 3px 0 7px; }
.stat small { display: block; color: var(--faint); font-size: 10px; }
.dashboard-grid { display: grid; grid-template-columns: 1.65fr 1fr; gap: 23px; align-items: stretch; }
.welcome-card { border: 1px solid var(--hero-line); border-radius: 13px; background: var(--hero); padding: 29px; position: relative; overflow: hidden; }
.hero-tag { display: inline-flex; align-items: center; gap: 6px; color: var(--primary); font-size: 8px; letter-spacing: 1px; font-weight: 650; margin-bottom: 15px; }
.hero-tag .icon { width: 13px; height: 13px; }
.welcome-card h2 { font-size: 25px; letter-spacing: -.8px; line-height: 1.3; position: relative; z-index: 1; }
.welcome-card p { color: var(--hero-ink); font-size: 11px; line-height: 1.8; max-width: 300px; margin: 12px 0 22px; position: relative; z-index: 1; }
.welcome-card .button { position: relative; z-index: 1; font-size: 11px; padding: 9px 13px; min-height: 38px; }
.hero-art { position: absolute; width: 240px; height: 240px; right: -48px; top: 30px; color: #465fff; opacity: .65; }
.hero-ring { position: absolute; border: 1px dashed color-mix(in srgb, var(--primary) 27%, transparent); border-radius: 50%; }
.ring-one { inset: 0; }
.ring-two { inset: 34px; }
.hero-lock { position: absolute; inset: 82px; border-radius: 20px; background: var(--surface); display: grid; place-items: center; transform: rotate(-10deg); box-shadow: 0 10px 30px #465fff13; border: 1px solid var(--hero-line); }
.hero-lock .icon { width: 34px; height: 34px; }
.hero-node { position: absolute; background: var(--surface); border: 1px solid var(--hero-line); box-shadow: var(--shadow); border-radius: 11px; padding: 10px; display: inline-flex; }
.node-one { top: 10px; left: 50px; transform: rotate(10deg); }
.node-two { bottom: 8px; left: 45px; transform: rotate(-10deg); }
.node-three { top: 70px; right: -5px; color: var(--success); }
.context-card { border: 1px solid var(--line); border-radius: 13px; background: var(--surface); padding: 24px; }
.card-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.context-role { display: flex; align-items: center; gap: 12px; margin: 25px 0 17px; }
.context-icon { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); }
.context-role span:not(.context-icon) { display: block; font-size: 10px; color: var(--muted); }
.context-role strong { display: block; font-size: 13px; font-weight: 600; margin-top: 2px; }
.context-card > p { font-size: 11px; line-height: 1.8; color: var(--muted); margin: 0 0 21px; }
.context-note { display: flex; align-items: flex-start; gap: 8px; padding-top: 17px; border-top: 1px solid var(--line); font-size: 10px; color: var(--muted); }
.context-note .icon { width: 15px; height: 15px; color: var(--primary); margin-top: 2px; }
.quick-section { margin-top: 30px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 17px; }
.section-heading p { color: var(--muted); font-size: 11px; margin: 4px 0 0; }
.section-counter { font-size: 10px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; background: var(--surface); padding: 4px 9px; white-space: nowrap; }
.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.quick-card { display: flex; align-items: center; gap: 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--ink); padding: 18px; }
.quick-card:hover { text-decoration: none; border-color: var(--primary); background: var(--primary-soft); }
.quick-icon { width: 39px; height: 39px; flex-shrink: 0; background: var(--surface-soft); color: var(--muted); border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; }
.quick-copy { min-width: 0; }
.quick-copy strong { display: block; font-size: 12px; font-weight: 600; }
.quick-copy small { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; }
.quick-card > .icon { margin-left: auto; width: 16px; height: 16px; color: var(--faint); }
.actions { margin: 0 0 20px; display: flex; justify-content: flex-end; gap: 12px; }
.search { display: flex; align-items: center; gap: 10px; margin: 0 0 20px; max-width: 440px; }
.search input { font-size: 12px; }
.table-card { border: 1px solid var(--line); border-radius: 13px; background: var(--surface); overflow-x: auto; }
.table-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 21px 23px; }
.table-heading h2 { font-size: 14px; }
.table-heading > span { color: var(--faint); font-size: 10px; white-space: nowrap; }
table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; }
th, td { padding: 15px 23px; border-bottom: 1px solid var(--line); font-size: 12px; }
th { background: var(--bg); font-size: 10px; color: var(--muted); font-weight: 500; border-top: 1px solid var(--line); }
td { color: var(--muted); }
td:first-child { color: var(--ink); font-weight: 500; }
tr:last-child td { border-bottom: 0; }
.row-actions { display: flex; align-items: center; gap: 12px; }
.row-actions a, .inline-button { color: var(--primary); font-size: 10px; font-weight: 600; }
.inline-button { border: 0; background: none; padding: 0; }
.inline-button:hover { text-decoration: underline; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 500; line-height: 1.5; padding: 3px 8px; border-radius: 20px; white-space: nowrap; }
.badge-primary { background: var(--primary-soft); color: var(--primary); }
.badge-neutral { background: var(--surface-soft); color: var(--muted); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge .connection-dot { width: 5px; height: 5px; }
.empty { text-align: center; padding: 45px 20px; color: var(--faint); }
.pagination { display: flex; align-items: center; gap: 17px; margin-top: 22px; color: var(--muted); font-size: 11px; }
.forms-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 365px), 1fr)); gap: 23px; align-items: start; }
.forms-grid:empty { display: none; }
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 25px; }
.form-heading { padding-bottom: 19px; margin-bottom: 23px; border-bottom: 1px solid var(--line); }
.form-heading h2 { font-size: 15px; }
.field { margin-bottom: 20px; }
.field label { display: block; font-size: 12px; font-weight: 500; margin-bottom: 7px; }
.field input, .field select { font-size: 12px; }
.form-card .button { margin-top: 5px; }
fieldset { border: 0; padding: 0; margin: 0 0 24px; min-width: 0; }
legend { font-size: 12px; font-weight: 500; margin-bottom: 12px; }
.check-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px; }
.check { display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 7px; padding: 10px 11px; font-size: 11px; overflow-wrap: anywhere; }
.check:has(input:checked) { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 40%, var(--line)); }
.check input { width: 15px; height: 15px; flex-shrink: 0; }
.notice { display: flex; align-items: flex-start; gap: 9px; border-radius: 8px; padding: 13px 15px; margin: 0 0 22px; font-size: 12px; }
.notice .icon { width: 17px; height: 17px; margin-top: 2px; }
.success { background: var(--success-soft); color: var(--success); }
.error { background: var(--danger-soft); color: var(--danger); }
footer { display: flex; justify-content: space-between; gap: 15px; padding: 20px 30px; color: var(--faint); font-size: 10px; border-top: 1px solid var(--line); }
footer > span:last-child { display: flex; align-items: center; gap: 5px; }
footer .icon { width: 13px; height: 13px; }
.footer-dot { margin: 0 5px; }
.guest-main { max-width: 700px; margin: 80px auto; padding: 20px; }
.guest-main .form-card h2 { margin: 15px 0; }
.guest-main .button-secondary { margin-top: 15px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
/* Login uses the same local tokens as the authenticated shell. */
.login-body { min-height: 100vh; background: var(--surface); }
.login-theme { position: absolute; z-index: 2; top: 25px; right: 28px; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-story { grid-column: 1; grid-row: 1; background: #101a40; color: #fff; display: flex; flex-direction: column; justify-content: space-between; padding: 50px 55px 35px; position: relative; overflow: hidden; }
.login-story:before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(#ffffff06 1px, transparent 1px), linear-gradient(90deg, #ffffff06 1px, transparent 1px); background-size: 48px 48px; mask-image: radial-gradient(ellipse at center, #000, transparent 75%); }
.login-story > * { position: relative; }
.login-story .brand { color: #fff; }
.login-story .brand-mark { background: #465fff; }
.login-story .eyebrow { color: #a4b0ff; font-size: 10px; letter-spacing: 1.8px; margin-bottom: 18px; }
.login-story h1 { font-size: clamp(32px, 3.2vw, 46px); line-height: 1.2; letter-spacing: -1.5px; max-width: 500px; margin: 0 0 20px; }
.login-story p { color: #a7b3cf; font-size: 13px; line-height: 1.9; max-width: 350px; margin: 0; }
.login-story > small { color: #6e7f9f; font-size: 10px; }
.login-grid-art { width: 240px; height: 200px; position: relative; margin: 33px auto 0; }
.login-grid-art:before { content: ""; position: absolute; inset: 0 20px; border: 1px solid #8b9aff30; transform: rotate(45deg); border-radius: 26px; }
.login-grid-art:after { content: ""; position: absolute; inset: 22px 42px; border: 1px dashed #8b9aff30; transform: rotate(45deg); border-radius: 20px; }
.login-art-center { position: absolute; inset: 48px 68px; display: grid; place-items: center; background: linear-gradient(135deg, #5367ff, #3548bb); border: 1px solid #a2b0ff55; border-radius: 25px; box-shadow: 0 25px 60px #030c2633; z-index: 1; }
.login-art-center .icon { width: 48px; height: 48px; stroke-width: 1.3; }
.login-art-node { position: absolute; display: inline-flex; border: 1px solid #7485c455; background: #1b2a54; padding: 15px; border-radius: 15px; z-index: 2; color: #aab8f7; }
.login-art-node.first { top: 0; left: 0; transform: rotate(-10deg); }
.login-art-node.second { right: 0; bottom: 0; transform: rotate(10deg); }
.login-form { grid-column: 2; grid-row: 1; width: 100%; max-width: 520px; margin: auto; padding: 48px 40px; }
.login-form .eyebrow { color: var(--primary); margin-bottom: 8px; font-size: 9px; }
.login-form h2 { font-size: 30px; font-weight: 650; letter-spacing: -1px; margin: 0 0 7px; }
.login-form > p { color: var(--muted); font-size: 12px; margin: 0 0 28px; }
.login-form .button { width: 100%; margin-top: 7px; justify-content: space-between; }
.login-help { font-size: 10px; color: var(--faint); text-align: center; margin-top: 25px; }
.captcha-panel { padding: 14px 15px; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; margin: 3px 0 18px; }
.captcha-panel > label { display: block; font-size: 11px; font-weight: 500; margin-bottom: 9px; }
.captcha-image-row { display: flex; align-items: center; gap: 13px; flex-wrap: wrap; margin-bottom: 11px; }
.captcha-image-row img { display: block; width: min(100%, 260px); height: auto; border: 1px solid var(--line); border-radius: 6px; }
.captcha-image-row img[hidden] { display: none; }
.captcha-image-row button { border: 0; background: none; color: var(--primary); font-size: 10px; font-weight: 600; padding: 5px 0; text-decoration: underline; }
.captcha-panel > input { font-size: 12px; }
.captcha-panel p { font-size: 10px; color: var(--muted); margin: 9px 0 0; line-height: 1.6; }
.captcha-panel noscript { display: block; color: var(--danger); font-size: 11px; margin-top: 10px; }
.captcha-audio { font-size: 10px; margin-top: 9px; color: var(--muted); }
.captcha-audio summary { cursor: pointer; color: var(--primary); }
.captcha-audio audio { display: block; width: 100%; max-width: 280px; height: 32px; margin-top: 10px; }
.captcha-panel[aria-busy="true"] { opacity: .7; }
@media (min-width: 1024px) {
  .sidebar-collapsed { --sidebar-width: 86px; }
  .sidebar-collapsed .sidebar { padding-inline: 12px; }
  .sidebar-collapsed .sidebar-heading { padding: 0 11px; }
  .sidebar-collapsed .brand-name, .sidebar-collapsed .nav-label, .sidebar-collapsed .nav-group,
  .sidebar-collapsed .sidebar-caption, .sidebar-collapsed .sidebar-edition,
  .sidebar-collapsed .nav-indicator { display: none; }
  .sidebar-collapsed .main-nav { margin-top: 36px; }
  .sidebar-collapsed .nav-link { justify-content: center; padding: 13px; }
  .sidebar-collapsed .nav-children { padding-left: 0; }
  .sidebar-collapsed .sidebar-footer { justify-content: center; }
}
@media (max-width: 1250px) {
  .workspace-label { display: none; }
  .topbar { padding-inline: 24px; }
  .hero-art { right: -90px; opacity: .35; }
  .welcome-card p { max-width: 270px; }
}
@media (max-width: 1023px) {
  .workspace { margin-left: 0; }
  .sidebar { position: relative; width: 100%; border-right: 0; }
  .js .sidebar { position: fixed; width: 268px; transform: translateX(-100%); border-right: 1px solid var(--line); }
  .js .sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-close { display: inline-flex; width: 30px; height: 30px; }
  .sidebar-open { overflow: hidden; }
  .sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 55; background: #10182877; border: 0; cursor: default; }
  .workspace-label { display: inline; }
  .topbar { gap: 12px; }
  .login-story { padding-inline: 35px; }
  .login-form { padding-inline: 35px; }
  .login-story h1 { font-size: 34px; }
}
@media (max-width: 767px) {
  .topbar { padding: 12px 18px; flex-wrap: wrap; }
  .topbar-start { gap: 12px; }
  .topbar-actions { gap: 11px; }
  .workspace-label { display: none; }
  .account-name { display: none; }
  .account-menu summary { gap: 5px; }
  .account-menu summary > .icon { display: none; }
  .avatar { width: 34px; height: 34px; }
  .icon-button { width: 35px; height: 35px; }
  .topbar-divider { display: none; }
  .role-switcher { gap: 5px; }
  .role-switcher select { max-width: 145px; font-size: 10px; }
  .role-submit { padding: 5px; }
  .role-submit .icon { width: 13px; height: 13px; }
  .workspace main { padding: 24px 18px 35px; }
  .page-heading { gap: 10px; margin-bottom: 20px; align-items: flex-start; }
  h1 { font-size: 24px; }
  .breadcrumb { display: none; }
  .intro { font-size: 11px; }
  .stats { gap: 12px; }
  .stat { padding: 16px; }
  .stat-top { margin-bottom: 13px; }
  .stat small { display: none; }
  .stat-value { font-size: 25px; }
  .stat-label { font-size: 10px; }
  .stat-icon { width: 35px; height: 35px; border-radius: 9px; }
  .stat-icon .icon { width: 18px; height: 18px; }
  .stat-indicator { display: none; }
  .dashboard-grid { grid-template-columns: 1fr; gap: 17px; }
  .hero-art { right: -25px; opacity: .5; }
  .quick-grid { gap: 11px; }
  .quick-card { padding: 14px; }
  .quick-copy small { display: none; }
  .quick-card > .icon { display: none; }
  .actions .button { font-size: 12px; }
  .table-heading { padding: 17px; }
  .table-heading > span { font-size: 9px; }
  th, td { padding: 14px 17px; }
  .form-card { padding: 22px; }
  footer { padding: 18px; font-size: 9px; }
  .footer-dot { margin-inline: 3px; }
  .login-shell { display: flex; flex-direction: column; }
  .login-story { padding: 23px 25px; order: 0; background: var(--surface); color: var(--ink); border-bottom: 1px solid var(--line); }
  .login-story .brand { color: var(--ink); }
  .login-story > div, .login-story > small, .login-story:before { display: none; }
  .login-story .brand-name { font-size: 22px; }
  .login-story .brand-mark { width: 33px; height: 33px; border-radius: 9px; }
  .login-theme { top: 23px; right: 25px; }
  .login-form { padding: 38px 25px; margin: auto; order: 1; }
  .login-form h2 { font-size: 27px; }
}
@media (max-width: 420px) {
  .stats { gap: 8px; }
  .stat { padding: 13px 11px; }
  .stat-value { font-size: 24px; }
  .hero-art { right: -80px; opacity: .3; }
  .welcome-card { padding: 23px; }
  .welcome-card h2 { font-size: 23px; }
  .welcome-card p { max-width: 235px; }
  .quick-grid { grid-template-columns: 1fr; }
  .quick-copy small { display: block; }
  .quick-card > .icon { display: block; }
  footer > span:last-child { display: none; }
  .topbar { padding-inline: 13px; }
  .topbar-actions { gap: 7px; }
  .role-switcher select { max-width: 135px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { transition: none !important; scroll-behavior: auto !important; }
}
/* Account profile: available to every authenticated user, independent of the menu catalog. */
.avatar img{width:100%;height:100%;object-fit:cover;border-radius:50%}.profile-summary{display:flex;align-items:center;gap:22px;margin-bottom:23px}.profile-avatar{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:88px;height:88px;border-radius:50%;background:var(--primary-soft);color:var(--primary);font-size:32px;font-weight:650;overflow:hidden}.profile-avatar img{width:100%;height:100%;object-fit:cover}.profile-identity{min-width:0}.profile-identity h2{font-size:21px;overflow-wrap:anywhere}.profile-identity>p{font-size:12px;color:var(--muted);margin:3px 0 8px}.profile-email-line{display:flex;align-items:center;flex-wrap:wrap;gap:10px;font-size:12px;color:var(--muted);overflow-wrap:anywhere}.profile-grid{display:grid;grid-template-columns:minmax(270px,.85fr) minmax(0,1.35fr);gap:23px;align-items:start}.profile-details{display:grid;gap:23px}.form-heading p,.field-help,.field small{display:block;font-size:11px;color:var(--muted);line-height:1.7;margin:7px 0 0}.field-help{margin:12px 0 16px}.photo-editor[hidden]{display:none}.crop-preview{padding:16px;background:var(--bg);border:1px solid var(--line);border-radius:10px;margin-bottom:18px}.crop-preview canvas{display:block;width:100%;max-width:320px;height:auto;border-radius:50%;touch-action:none;cursor:grab;margin:auto}.crop-preview canvas:active{cursor:grabbing}.crop-controls{display:grid;gap:7px}.crop-controls label{font-size:11px;color:var(--muted)}.crop-controls input{padding:0;accent-color:var(--primary);box-shadow:none;border:0}.photo-remove{margin-top:12px}.profile-mail-notice{background:var(--surface-soft);color:var(--muted)}.pending-email{display:grid;gap:4px;background:var(--primary-soft);padding:14px 16px;border-radius:8px;margin-bottom:18px;overflow-wrap:anywhere}.pending-email strong{font-size:12px;color:var(--primary)}.pending-email span{font-size:12px}.pending-email small{font-size:10px;color:var(--muted)}.verification-form{padding-bottom:23px;margin-bottom:23px;border-bottom:1px solid var(--line)}@media(max-width:767px){.profile-grid{grid-template-columns:1fr}.profile-summary{align-items:flex-start;gap:15px}.profile-avatar{width:64px;height:64px;font-size:25px}.profile-identity h2{font-size:18px}.profile-email-line{font-size:11px}.profile-grid .form-card{min-width:0}}

.security-shell{width:min(100% - 32px,520px);margin:48px auto;padding:32px}.security-shell h1{font-size:1.6rem;margin:28px 0 16px}.security-shell p{margin:16px 0}.security-shell .brand{margin-bottom:24px}.recovery-code-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:12px;margin:24px 0}.recovery-code-list code{padding:12px;background:var(--surface-soft);border:1px solid var(--line);border-radius:8px;user-select:all;overflow-wrap:anywhere}
.code-reference strong{display:inline-block;font-family:monospace;font-size:1.25em;letter-spacing:.12em;color:var(--primary)}.resend-form{margin-top:20px;display:grid;gap:12px}
.settings-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,400px),1fr));gap:24px;align-items:start}.settings-grid fieldset{min-width:0;margin:0;border:1px solid var(--line)}.branding-preview{display:block;object-fit:contain;background:var(--surface-soft);border:1px solid var(--line);border-radius:10px;padding:6px;margin-bottom:10px}.brand-custom{object-fit:contain;flex-shrink:0}.brand-name{overflow-wrap:anywhere}.live-avatar-preview{display:flex;gap:16px;align-items:center;margin:16px 0}.live-avatar-preview canvas{border-radius:50%;width:88px;height:88px;border:1px solid var(--line)}.email-verified .icon{width:14px;height:14px}.email-verified{display:inline-flex;gap:5px;align-items:center}.email-correction{border-top:1px solid var(--line);padding-top:16px;margin-top:16px}
.sidebar-edition{max-width:90px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.workspace footer>span:first-child{min-width:0;overflow-wrap:anywhere}.workspace-label{max-width:34ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.brand{min-width:0}
.profile-email-line>span:first-child,.pending-email>span{overflow-wrap:anywhere;max-width:100%}
.settings-check{display:flex!important;align-items:center;gap:8px}.settings-check input[type=checkbox]{width:auto;min-width:0;flex:none;margin:0}.workspace-label{max-width:clamp(100px,30vw,480px)}

/* Access management pages */
.muted { color: var(--muted); font-size: 11px; margin: 2px 0 0; }
.guide { background: var(--primary-soft); border: 1px solid var(--hero-line); border-radius: 13px; padding: 20px 24px; margin: 0 0 22px; }
.guide h2 { font-size: 14px; margin: 0 0 10px; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 12px; color: var(--hero-ink); }
.feature-card { margin: 0 0 18px; }
.feature-card td, .feature-card th { white-space: normal; }
.person { display: grid; gap: 2px; }
.person strong { color: var(--ink); font-weight: 600; }
.person small { color: var(--muted); font-size: 11px; font-weight: 400; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { display: inline-block; background: var(--primary-soft); color: var(--primary); border-radius: 20px; padding: 2px 9px; font-size: 10px; font-weight: 500; white-space: nowrap; }
.chip-off { background: var(--surface-soft); color: var(--faint); text-decoration: line-through; }
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; margin: 0 0 20px; }
.filters .field { margin: 0; min-width: 160px; }
.filters .field:first-child { flex: 1 1 240px; }
.filter-reset { font-size: 11px; align-self: center; }
.tree-indent { display: inline-block; }
.tree-indent.depth-1 { margin-left: 18px; }
.tree-indent.depth-2 { margin-left: 36px; }
.tree-indent.depth-3 { margin-left: 54px; }
.selection-bar { position: sticky; top: 0; z-index: 3; display: flex; justify-content: space-between; align-items: center; gap: 15px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 11px 16px; margin: 0 0 18px; font-size: 12px; box-shadow: var(--shadow); }
.perm-group { background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 20px 24px; }
.perm-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.perm-head h2 { font-size: 14px; margin: 0; }
.check-all { white-space: nowrap; }
.perm-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 10px; }
.perm-item { display: flex; gap: 11px; align-items: flex-start; border: 1px solid var(--line); border-radius: 9px; padding: 12px 13px; cursor: pointer; font-size: 12px; }
.perm-item:has(input:checked) { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 40%, var(--line)); }
.perm-item input { width: 16px; height: 16px; margin-top: 2px; flex-shrink: 0; }
.perm-item strong { display: block; font-weight: 600; }
.perm-item small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.confirm-card { max-width: 440px; }
.email-state { color: var(--faint); }
.email-state.is-verified { color: var(--success); }
.role-assignment { margin-bottom: 20px; }
.role-toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; padding: 15px 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.role-toolbar .field { margin: 0; flex: 1 1 290px; }
.role-selected-filter { padding-bottom: 9px; white-space: nowrap; }
.selected-role-summary { display: flex; flex-wrap: wrap; gap: 5px; min-height: 28px; padding: 10px 18px; background: var(--surface-soft); border-bottom: 1px solid var(--line); }
.role-choice-list { display: grid; gap: 0; }
.role-choice { display: grid; grid-template-columns: 18px minmax(0,1fr); align-items: start; gap: 9px; min-height: 58px; padding: 11px 18px; border-bottom: 1px solid var(--line); cursor: pointer; }
.js .role-choice { grid-template-columns: 18px 22px minmax(0,1fr); }
.role-choice:last-child { border-bottom: 0; }
.js .role-choice input { position: absolute; opacity: 0; }
.role-choice-mark { display: none; }
.js .role-choice-mark { display: grid; place-items: center; width: 18px; height: 18px; border: 1px solid var(--line); border-radius: 5px; color: transparent; font-size: 12px; font-weight: 700; }
.role-choice.is-selected { background: var(--primary-soft); }
.role-choice.is-selected .role-choice-mark { background: var(--primary); border-color: var(--primary); color: #fff; }
.role-choice strong,.role-choice small { display: block; }
.role-choice strong { font-size: 12px; }
.role-choice small { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* Menu layout editor */
.inline-create form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; }
.inline-create .field { margin: 0; min-width: 200px; flex: 1 1 200px; }
.inline-create .muted { margin-top: 12px; }
.bar-actions { display: flex; align-items: center; gap: 14px; }
.menu-controls { display: none; gap: 3px; }
.js .menu-controls { display: inline-flex; }
.menu-controls button { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 6px; width: 28px; height: 28px; padding: 0; font-size: 10px; line-height: 1; }
.menu-controls button:hover:not(:disabled) { background: var(--primary-soft); border-color: var(--primary); }
.switch input { width: 36px; height: 20px; accent-color: var(--primary); cursor: pointer; }
.danger-link { color: var(--danger); }
.tree-indent[class*="depth-"]:not(.depth-0)::before { content: "└ "; color: var(--faint); }

/* Role page: sidebar preview and anchored features */
.role-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 20px; align-items: start; }
.menu-preview { position: sticky; top: 76px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 18px 20px; }
.menu-preview h2 { font-size: 13px; margin: 0; }
.menu-preview ul { list-style: none; margin: 10px 0 0; padding: 0; font-size: 12px; }
.menu-preview li { padding: 5px 0; color: var(--ink); }
.menu-preview li ul { margin: 2px 0 0 14px; border-left: 1px solid var(--line); padding-left: 10px; }
.preview-group { font-weight: 600; }
.preview-empty { color: var(--danger); }
.perm-group:target { outline: 2px solid var(--primary); outline-offset: 3px; }
.small-link { font-size: 10px; font-weight: 600; margin-top: 6px; display: inline-block; }
a.chip:hover { text-decoration: underline; }
@media (max-width: 1023px) { .role-layout { grid-template-columns: 1fr; } .menu-preview { position: static; order: -1; } }

/* Role permissions: hierarchical navigator (enhanced only with JavaScript) */
.perm-nav { display: none; }
.has-perm-tree .perm-nav { display: block; position: sticky; top: 76px; max-height: calc(100vh - 100px); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 14px; }
.has-perm-tree .role-layout { grid-template-columns: 300px minmax(0, 1fr) 240px; }
.perm-nav .field { margin: 0 0 10px; }
.perm-nav input[type="search"] { font-size: 12px; }
.perm-filters { display: flex; gap: 6px; margin: 0 0 10px; }
.chip-button { border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 20px; padding: 3px 11px; font-size: 11px; }
.chip-button.is-on { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }
.perm-tree, .perm-tree ul { list-style: none; margin: 0; padding: 0; }
.perm-tree ul { margin-left: 14px; border-left: 1px solid var(--line); padding-left: 6px; }
.perm-tree li[hidden], .perm-tree ul[hidden] { display: none; }
.node-row { display: flex; align-items: center; gap: 5px; padding: 3px 4px; border-radius: 7px; }
.node-row.is-current { background: var(--primary-soft); }
.node-row input { width: 14px; height: 14px; flex-shrink: 0; }
.caret, .caret-space { width: 18px; flex-shrink: 0; }
.caret { border: 0; background: none; color: var(--muted); padding: 0; font-size: 12px; }
.node-label { flex: 1; min-width: 0; border: 0; background: none; text-align: left; padding: 3px 2px; font-size: 12px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node-label.is-hidden-menu { color: var(--faint); font-style: italic; }
.node-count { font-size: 10px; color: var(--muted); flex-shrink: 0; }
.menu-preview ul { max-height: 50vh; overflow: auto; }
@media (max-width: 1279px) { .has-perm-tree .role-layout { grid-template-columns: 1fr; } .has-perm-tree .perm-nav { position: static; max-height: 50vh; } }

/* Foldable trees */
.fold-bar { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--faint); margin: 0 0 8px; }
.link-button { border: 0; background: none; padding: 0; color: var(--primary); font-size: 11px; font-weight: 600; }
.link-button:hover { text-decoration: underline; }
.bar-actions .fold-bar { margin: 0; }
tr[hidden] { display: none; }
.caret[hidden] { display: none; }
[data-menu-table] .caret { margin-right: 4px; }

/* Sidebar: many menus (foldable groups, search, scrolling) */
.main-nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; align-content: start; scrollbar-gutter: stable; }
.nav-empty { padding: 10px 14px; margin: 0; }
.nav-tools { display: none; margin: -4px 4px 10px; }
.js .nav-tools { display: block; }
.nav-tools input[type="search"] { font-size: 12px; margin-bottom: 6px; }
.nav-section { display: grid; gap: 4px; }
.nav-group-toggle { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; padding: 10px 14px; font-size: 11px; font-weight: 600; letter-spacing: .3px; text-align: left; color: var(--faint); border-radius: 8px; }
.nav-group-toggle:hover { background: var(--surface-soft); color: var(--ink); }
.nav-section.has-selected > .nav-group-toggle { color: var(--primary); }
.nav-group-toggle .icon { margin-left: auto; width: 14px; height: 14px; transition: transform .15s; transform: rotate(90deg); }
.nav-group-toggle[aria-expanded="false"] .icon { transform: rotate(0); }
.js .nav-section:not(.is-open) > .nav-children { display: none; }
.nav-searching .nav-section > .nav-children { display: grid !important; }
.nav-link[hidden], .nav-section[hidden], .nav-children[hidden] { display: none !important; }
.sidebar-collapsed .nav-group-toggle, .sidebar-collapsed .nav-tools, .sidebar-collapsed .nav-empty { display: none; }
.sidebar-collapsed .nav-children { display: grid !important; padding-left: 0; }

/* Sessions and devices */
.tabs { display: flex; gap: 6px; margin: 0 0 18px; border-bottom: 1px solid var(--line); }
.tab { padding: 9px 16px; font-size: 12px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { text-decoration: none; color: var(--ink); }
.tab.is-on { color: var(--primary); border-bottom-color: var(--primary); }
.confirm-card { margin-bottom: 18px; }
form > .table-card, form > .actions { margin-bottom: 20px; }

/* Checkbox with label and help text, aligned on the first line */
.check-line { display: flex; align-items: flex-start; gap: 11px; margin: 0 0 22px; cursor: pointer; }
.check-line input[type="checkbox"] { width: 17px; height: 17px; min-width: 17px; margin: 1px 0 0; padding: 0; flex: none; }
.check-line strong { display: block; font-size: 12px; font-weight: 500; line-height: 1.5; }
.check-line small { display: block; margin-top: 2px; font-size: 11px; line-height: 1.6; color: var(--muted); }

/* De Stijl refinement. The DOM and all IAM interactions deliberately remain unchanged. */
body { font-family: Arial, Helvetica, sans-serif; }
.sidebar { padding: 25px 14px 17px; border-right: 2px solid var(--ink); }
.sidebar-heading { padding: 0 7px; }
.brand { gap: 10px; }
.brand-mark { border-radius: 0; background: var(--primary); border-right: 6px solid #f1c53e; border-bottom: 5px solid #cf2924; }
.brand-name { font-size: 21px; font-weight: 750; letter-spacing: -.5px; }
.sidebar-caption { margin: 32px 11px 10px; color: var(--ink); font-size: 9px; letter-spacing: 1.3px; }
.main-nav { gap: 2px; }
.nav-link { min-height: 43px; padding: 10px 12px; border-radius: 0; border-left: 3px solid transparent; color: var(--muted); }
.nav-link:hover { background: var(--surface-soft); color: var(--ink); text-decoration: none; }
.nav-link.selected { color: var(--primary); background: var(--primary-soft); border-left-color: #cf2924; }
.nav-indicator { border-radius: 0; width: 6px; height: 6px; }
.nav-group-toggle { border-radius: 0; padding: 9px 12px; color: var(--ink); }
.nav-group-toggle:hover { background: var(--surface-soft); }
.nav-section.has-selected > .nav-group-toggle { color: var(--primary); }
.nav-tools { margin-inline: 0; }
.nav-tools input[type="search"] { border-radius: 0; }
.sidebar-footer { padding-inline: 7px; border-top: 2px solid var(--ink); }
.workspace { background: var(--bg); }
.topbar { min-height: 70px; padding: 12px 27px; border-bottom: 2px solid var(--ink); }
.icon-button, .role-submit, .account-menu summary { border-radius: 0; }
.icon-button { border-color: var(--ink); }
.icon-button:hover { background: #f1c53e; color: var(--ink); border-color: var(--ink); }
.theme-toggle { border-radius: 0; }
.account-dropdown { border-radius: 0; border-color: var(--ink); box-shadow: 5px 5px 0 #cf2924; }
.workspace main { max-width: 1540px; padding: 28px 32px 45px; }
h1 { font-weight: 750; letter-spacing: -.55px; }
.eyebrow { color: #cf2924; font-weight: 700; }
.breadcrumb { font-size: 10px; }
input, select { border-radius: 0; border-color: var(--ink); padding: 10px 12px; }
input:focus, select:focus { box-shadow: 3px 3px 0 #f1c53e; border-color: var(--primary); }
.button, .button-secondary { border-radius: 0; min-height: 41px; font-weight: 700; }
.button { background: var(--primary); border-color: var(--primary); box-shadow: 3px 3px 0 #cf2924; }
.button:hover { background: var(--primary-hover); box-shadow: 2px 2px 0 #cf2924; transform: translate(1px,1px); }
.button-secondary { border-color: var(--ink); }
.button-secondary:hover { background: #f1c53e; border-color: var(--ink); }
.stat, .context-card, .welcome-card, .quick-card, .table-card, .form-card, .guide, .perm-group, .menu-preview, .has-perm-tree .perm-nav, .selection-bar { border-radius: 0; box-shadow: none; }
.stat, .context-card, .quick-card, .table-card, .form-card, .perm-group, .menu-preview, .has-perm-tree .perm-nav { border-color: var(--ink); }
.stat { border-top-width: 5px; }
.stat:nth-child(3n+1) { border-top-color: var(--primary); }
.stat:nth-child(3n+2) { border-top-color: #cf2924; }
.stat:nth-child(3n) { border-top-color: #f1c53e; }
.stat-icon, .quick-icon { border-radius: 0; background: var(--primary-soft); color: var(--primary); }
.welcome-card { background: var(--hero); border: 2px solid var(--ink); }
.hero-tag { color: #cf2924; }
.hero-art { color: var(--primary); opacity: .32; }
.hero-lock, .hero-node { border-radius: 0; box-shadow: none; border-color: var(--ink); }
.context-icon { border-radius: 0; background: #f1c53e; color: var(--ink); }
.quick-card:hover { border-color: var(--ink); background: #f1c53e; }
.table-heading { border-bottom: 2px solid var(--ink); }
th { background: var(--surface-soft); }
.badge, .chip, .chip-button { border-radius: 0; }
.guide { background: #fff7d9; border: 2px solid #f1c53e; }
.selection-bar { border-color: var(--ink); }
.check, .perm-item, .role-choice { border-radius: 0; }
.role-choice.is-selected, .perm-item:has(input:checked), .check:has(input:checked) { background: var(--primary-soft); }
.tabs { border-bottom: 2px solid var(--ink); }
.tab.is-on { border-bottom-color: #cf2924; color: var(--primary); }

/* Login composition: plain planes of cobalt, red and yellow replace the previous product illustration. */
.login-body { background: var(--bg); }
.login-story { background: var(--hero); color: var(--ink); border-right: 2px solid var(--ink); }
.login-story:before { inset: auto 48px 52px auto; width: 180px; height: 180px; background: linear-gradient(90deg, var(--primary) 0 58%, #f1c53e 58% 100%); mask-image: none; }
.login-story:after { content: ""; position: absolute; width: 76px; height: 76px; right: 192px; bottom: 52px; background: #cf2924; }
.login-story .brand { color: var(--ink); }
.login-story .brand-mark { background: var(--primary); }
.login-story .eyebrow { color: #cf2924; }
.login-story h1 { color: var(--ink); max-width: 430px; }
.login-story p, .login-story > small { color: var(--muted); }
.login-grid-art { display: none; }
.login-form { max-width: 500px; }
.login-form .eyebrow { color: #cf2924; }
.captcha-panel { border-radius: 0; border-color: var(--ink); background: #faf9f5; }
.captcha-image-row img, .notice { border-radius: 0; }

@media (max-width: 767px) {
  .workspace main { padding-inline: 18px; }
  .login-story { border-right: 0; border-bottom: 2px solid var(--ink); }
  .login-story:before, .login-story:after { display: none; }
  .login-story .brand-mark { border-right-width: 5px; border-bottom-width: 4px; }
  .topbar { border-bottom-width: 2px; }
}

/* Material You / Material Design 3: tonal surfaces, generous shapes and quiet elevation. */
:root[data-theme="dark"] {
  --bg: #111318; --surface: #1a1b20; --surface-soft: #22242b;
  --ink: #e2e2e9; --muted: #c3c6d2; --faint: #8d919c; --line: #42464f;
  --primary: #aac7ff; --primary-hover: #d6e3ff; --primary-soft: #294777;
  --success: #8bdaad; --success-soft: #005233; --danger: #ffb4ab; --danger-soft: #93000a;
  --hero: #263550; --hero-line: #3d4c68; --hero-ink: #d6e3ff; --shadow: 0 2px 8px #00000033;
}
body { font-family: Roboto, "Segoe UI", Arial, sans-serif; }
.sidebar { padding: 22px 12px 16px; background: var(--surface-soft); border-right: 0; }
.sidebar-heading { padding: 0 12px; }
.brand { gap: 10px; }
.brand-mark { border: 0; border-radius: 12px; width: 40px; height: 40px; background: var(--primary); }
.brand-name { font-size: 20px; font-weight: 700; letter-spacing: -.3px; }
.sidebar-caption { margin: 34px 16px 10px; color: var(--muted); font-size: 10px; letter-spacing: 1px; }
.main-nav { gap: 3px; }
.nav-link { min-height: 44px; padding: 10px 16px; border: 0; border-radius: 22px; color: var(--muted); }
.nav-link:hover { background: color-mix(in srgb, var(--primary-soft) 55%, var(--surface-soft)); color: var(--ink); }
.nav-link.selected { background: var(--primary-soft); color: var(--primary); border: 0; font-weight: 700; }
.nav-indicator { width: 5px; height: 5px; border-radius: 50%; }
.nav-group-toggle { border-radius: 18px; padding: 9px 16px; color: var(--muted); }
.nav-group-toggle:hover { background: color-mix(in srgb, var(--primary-soft) 55%, var(--surface-soft)); }
.nav-section.has-selected > .nav-group-toggle { color: var(--primary); }
.nav-tools { margin-inline: 4px; }
.nav-tools input[type="search"] { border-radius: 8px; }
.sidebar-footer { padding: 16px 12px 0; border-top: 0; }
.workspace { background: var(--bg); }
.topbar { min-height: 72px; padding: 12px 28px; background: var(--surface); border-bottom: 0; box-shadow: 0 1px 2px #1a1b200f; }
.icon-button, .role-submit { border-radius: 50%; border-color: transparent; background: transparent; }
.icon-button:hover { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.theme-toggle { border-radius: 50%; }
.account-menu summary { border-radius: 22px; padding: 3px 7px 3px 3px; }
.account-menu summary:hover { background: var(--surface-soft); }
.account-dropdown { border-radius: 16px; border-color: transparent; box-shadow: 0 7px 18px #1a1b2033; }
.workspace main { max-width: 1540px; padding: 28px 32px 45px; }
h1 { font-weight: 650; letter-spacing: -.6px; }
.eyebrow { color: var(--primary); font-weight: 700; }
.breadcrumb { font-size: 10px; }
input, select { border-radius: 5px; border-color: var(--faint); padding: 11px 12px; }
input:focus, select:focus { box-shadow: 0 0 0 1px var(--primary); border-color: var(--primary); }
.button, .button-secondary { border-radius: 22px; min-height: 40px; font-weight: 650; }
.button { background: var(--primary); border-color: var(--primary); box-shadow: none; }
.button:hover { background: var(--primary-hover); box-shadow: none; transform: none; }
.button-secondary { border-color: transparent; background: var(--surface-soft); }
.button-secondary:hover { background: var(--primary-soft); border-color: transparent; }
.stat, .context-card, .welcome-card, .quick-card, .table-card, .form-card, .guide, .perm-group, .menu-preview, .has-perm-tree .perm-nav, .selection-bar { border-radius: 20px; box-shadow: var(--shadow); }
.stat, .context-card, .quick-card, .table-card, .form-card, .perm-group, .menu-preview, .has-perm-tree .perm-nav { border-color: transparent; }
.stat { border-top-width: 1px; background: var(--surface); }
.stat:nth-child(3n+1), .stat:nth-child(3n+2), .stat:nth-child(3n) { border-top-color: transparent; }
.stat-icon, .quick-icon { border-radius: 12px; background: var(--primary-soft); color: var(--primary); }
.welcome-card { background: var(--hero); border: 0; }
.hero-tag { color: var(--primary); }
.hero-art { color: var(--primary); opacity: .38; }
.hero-lock, .hero-node { border-radius: 18px; box-shadow: var(--shadow); border-color: var(--hero-line); }
.context-icon { border-radius: 14px; background: var(--primary-soft); color: var(--primary); }
.quick-card:hover { border-color: transparent; background: var(--primary-soft); }
.table-heading { border-bottom: 0; }
th { background: var(--surface-soft); }
.badge, .chip, .chip-button { border-radius: 12px; }
.guide { background: var(--primary-soft); border: 0; }
.selection-bar { border-color: transparent; }
.check, .perm-item, .role-choice { border-radius: 12px; }
.role-choice.is-selected, .perm-item:has(input:checked), .check:has(input:checked) { background: var(--primary-soft); }
.tabs { border-bottom: 1px solid var(--line); }
.tab.is-on { border-bottom-color: var(--primary); color: var(--primary); }

/* Friendly Material You login scene; the form remains on the right. */
.login-body { background: var(--bg); }
.login-story { background: var(--hero); color: var(--ink); border-right: 0; }
.login-story:before { inset: auto -52px -40px auto; width: 295px; height: 295px; border-radius: 50%; background: #b9c8f7; mask-image: none; }
.login-story:after { width: 155px; height: 155px; right: 145px; bottom: 92px; border-radius: 50%; background: #d8e2ff; }
.login-story .brand { color: var(--ink); }
.login-story .brand-mark { background: var(--primary); }
.login-story .eyebrow { color: var(--primary); }
.login-story h1 { color: var(--ink); max-width: 430px; }
.login-story p, .login-story > small { color: var(--muted); }
.login-grid-art { display: block; position: absolute; right: 72px; bottom: 60px; z-index: 1; transform: scale(.72); }
.login-grid-art:before, .login-grid-art:after { border-color: #8fa7d8; }
.login-art-center { border-radius: 28px; background: var(--primary); box-shadow: 0 10px 30px #405f9040; }
.login-art-node { border-radius: 18px; background: var(--surface); color: var(--primary); border-color: #c2c9d8; }
.login-form { max-width: 500px; }
.login-form .eyebrow { color: var(--primary); }
.captcha-panel { border-radius: 14px; border-color: transparent; background: var(--surface-soft); }
.captcha-image-row img, .notice { border-radius: 10px; }

@media (max-width: 767px) {
  .workspace main { padding-inline: 18px; }
  .login-story { border-bottom: 0; }
  .login-story:before, .login-story:after, .login-grid-art { display: none; }
  .login-story .brand-mark { border: 0; }
  .topbar { border-bottom: 0; }
}

/* Higher-contrast Google workspace tuning: larger type, modest corners and vivid accents. */
body { font-size: 15px; }
.brand-name { font-size: 22px; }
.workspace-label { font-size: 12px; }
.sidebar-caption, .eyebrow { font-size: 10px; }
.nav-link { min-height: 46px; padding: 11px 16px; border-radius: 10px; font-size: 14px; }
.nav-group-toggle { border-radius: 8px; font-size: 12px; }
.topbar { background: #fff; box-shadow: 0 1px 3px #20212418; }
.icon-button, .role-submit, .theme-toggle { border-radius: 10px; }
.account-menu summary { border-radius: 10px; }
.account-dropdown { border-radius: 12px; }
h1 { font-size: 29px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 650; }
.intro { font-size: 13px; }
input, select, .field input, .field select { font-size: 14px; }
.field label { font-size: 13px; }
.button, .button-secondary { border-radius: 8px; min-height: 44px; font-size: 14px; }
.stat, .context-card, .welcome-card, .quick-card, .table-card, .form-card, .guide, .perm-group, .menu-preview, .has-perm-tree .perm-nav, .selection-bar { border-radius: 12px; }
.stat { border: 1px solid var(--line); border-top: 5px solid var(--primary); box-shadow: var(--shadow); }
.stat:nth-child(3n+1) { border-top-color: #1a73e8; }
.stat:nth-child(3n+2) { border-top-color: #ea4335; }
.stat:nth-child(3n) { border-top-color: #fbbc04; }
.stat-icon, .quick-icon { border-radius: 8px; }
.stat:nth-child(3n+1) .stat-icon { background: #e8f0fe; color: #1a73e8; }
.stat:nth-child(3n+2) .stat-icon { background: #fce8e6; color: #ea4335; }
.stat:nth-child(3n) .stat-icon { background: #fef7e0; color: #b06000; }
.welcome-card { border: 1px solid #d2e3fc; border-left: 5px solid #1a73e8; background: #f8fbff; }
.context-card { border: 1px solid #ceead6; border-left: 5px solid #34a853; }
.context-icon { border-radius: 8px; background: #e6f4ea; color: #188038; }
.hero-tag { color: #1a73e8; }
.quick-card { border: 1px solid var(--line); }
.quick-card:hover { background: #fff; border-color: #1a73e8; box-shadow: 0 2px 7px #1a73e830; }
.quick-card:nth-child(4n+1) .quick-icon { background: #e8f0fe; color: #1a73e8; }
.quick-card:nth-child(4n+2) .quick-icon { background: #e6f4ea; color: #188038; }
.quick-card:nth-child(4n+3) .quick-icon { background: #fce8e6; color: #d93025; }
.quick-card:nth-child(4n) .quick-icon { background: #fef7e0; color: #b06000; }
.table-card, .form-card, .perm-group, .menu-preview, .has-perm-tree .perm-nav { border: 1px solid var(--line); }
.table-heading { border-bottom: 1px solid var(--line); }
th { font-size: 11px; }
td { font-size: 13px; }
.badge, .chip, .chip-button { border-radius: 7px; font-size: 11px; }
.guide { background: #f8fbff; border: 1px solid #d2e3fc; }
.check, .perm-item, .role-choice { border-radius: 8px; }
.login-story { background: #f8fbff; }
.login-story:before { width: 330px; height: 330px; right: -70px; bottom: -65px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #4285f4 0 24%, #34a853 25% 42%, #fbbc04 43% 59%, #ea4335 60% 76%, transparent 77%); opacity: .92; }
.login-story:after { width: 135px; height: 135px; right: 180px; bottom: 130px; border-radius: 50%; background: #e8f0fe; }
.login-art-center { background: #1a73e8; }
.login-art-node { border-radius: 12px; }
.captcha-panel { border-radius: 10px; background: #f8f9fa; }
@media (max-width: 767px) { h1 { font-size: 25px; } .nav-link { border-radius: 10px; } }

/* Keep dark mode token-driven: no light surfaces or pastel dashboard panels leak in. */
:root[data-theme="dark"] .topbar { background: var(--surface); box-shadow: 0 1px 3px #00000040; }
:root[data-theme="dark"] .stat { border-color: var(--line); border-top-color: var(--primary); background: var(--surface); }
:root[data-theme="dark"] .stat:nth-child(3n+1) { border-top-color: #8ab4f8; }
:root[data-theme="dark"] .stat:nth-child(3n+2) { border-top-color: #f28b82; }
:root[data-theme="dark"] .stat:nth-child(3n) { border-top-color: #fdd663; }
:root[data-theme="dark"] .stat:nth-child(3n+1) .stat-icon { background: #294777; color: #aac7ff; }
:root[data-theme="dark"] .stat:nth-child(3n+2) .stat-icon { background: #5b2928; color: #f28b82; }
:root[data-theme="dark"] .stat:nth-child(3n) .stat-icon { background: #514600; color: #fdd663; }
:root[data-theme="dark"] .welcome-card { background: var(--hero); border-color: var(--hero-line); border-left-color: #8ab4f8; }
:root[data-theme="dark"] .context-card { background: var(--surface); border-color: #285d3a; border-left-color: #81c995; }
:root[data-theme="dark"] .context-icon { background: #153f2a; color: #81c995; }
:root[data-theme="dark"] .hero-tag { color: #aac7ff; }
:root[data-theme="dark"] .quick-card { background: var(--surface); border-color: var(--line); }
:root[data-theme="dark"] .quick-card:hover { background: var(--surface-soft); border-color: #8ab4f8; box-shadow: 0 2px 7px #00000045; }
:root[data-theme="dark"] .quick-card:nth-child(4n+1) .quick-icon { background: #294777; color: #aac7ff; }
:root[data-theme="dark"] .quick-card:nth-child(4n+2) .quick-icon { background: #153f2a; color: #81c995; }
:root[data-theme="dark"] .quick-card:nth-child(4n+3) .quick-icon { background: #5b2928; color: #f28b82; }
:root[data-theme="dark"] .quick-card:nth-child(4n) .quick-icon { background: #514600; color: #fdd663; }
:root[data-theme="dark"] .guide { background: var(--surface-soft); border-color: var(--hero-line); }
:root[data-theme="dark"] .login-body { background: var(--bg); }
:root[data-theme="dark"] .login-story { background: var(--hero); }
:root[data-theme="dark"] .login-story:before { background: radial-gradient(circle at 35% 35%, #4f7cac 0 24%, #367654 25% 42%, #8b6e19 43% 59%, #934744 60% 76%, transparent 77%); opacity: .7; }
:root[data-theme="dark"] .login-story:after { background: #263a5f; }
:root[data-theme="dark"] .captcha-panel { background: var(--surface-soft); }

/* Readability pass for dense administration screens and supporting text. */
body { font-size: 16px; }
.sidebar-caption, .eyebrow { font-size: 11px; }
.nav-link { font-size: 15px; }
.nav-group, .nav-group-toggle { font-size: 13px; }
.sidebar-footer, .sidebar-edition, .workspace-label { font-size: 12px; }
.role-switcher label { font-size: 10px; }
.role-switcher select, .account-name strong, .account-heading strong { font-size: 13px; }
.account-name small, .account-heading span, .account-dropdown > a, .account-dropdown button { font-size: 12px; }
.breadcrumb, .intro { font-size: 13px; }
.stat-label, .stat small, .context-role span:not(.context-icon), .context-note, .section-heading p, .section-counter { font-size: 12px; }
.hero-tag { font-size: 10px; }
.welcome-card p, .context-card > p { font-size: 14px; }
.welcome-card .button { font-size: 13px; }
.quick-copy strong, .quick-copy small, .table-heading > span, .row-actions a, .inline-button { font-size: 12px; }
th { font-size: 12px; }
td { font-size: 14px; }
.badge, .chip, .chip-button { font-size: 12px; }
.field label, legend, .field input, .field select, .check, .notice { font-size: 14px; }
.form-heading p, .field-help, .field small, .muted, .steps, .person small, .perm-item small, .role-choice small, .check-line small { font-size: 13px; }
.login-story .eyebrow, .login-form .eyebrow { font-size: 11px; }
.login-story > small, .login-form > p, .login-help, .captcha-panel > label, .captcha-image-row button, .captcha-panel p, .captcha-audio { font-size: 12px; }
.captcha-panel > input { font-size: 14px; }

/* Compact left navigation so longer menu trees remain visible on one screen. */
.sidebar { padding: 18px 10px 13px; }
.sidebar-caption { margin: 25px 12px 7px; font-size: 10px; }
.main-nav { gap: 1px; }
.nav-link { min-height: 40px; padding: 8px 12px; gap: 11px; font-size: 14px; }
.nav-link > .icon { width: 18px; height: 18px; }
.nav-group { padding: 8px 12px 2px; font-size: 12px; }
.nav-group-toggle { padding: 7px 12px; font-size: 12px; }
.nav-children { padding-left: 11px; gap: 1px; }
.nav-tools { margin-inline: 2px; }
.sidebar-footer { padding: 12px 8px 0; font-size: 11px; }

/* Dense administration data views: compact rows while retaining readable content. */
.table-heading { padding: 14px 17px; gap: 14px; }
.table-heading h2 { font-size: 15px; }
.table-heading > span { font-size: 12px; }
th, td { padding: 10px 14px; vertical-align: top; }
th { padding-top: 9px; padding-bottom: 9px; }
.row-actions { align-items: flex-start; gap: 8px 11px; }
.feature-card { margin-bottom: 14px; }
.feature-card .table-heading { padding-block: 12px; }
.feature-card .muted { margin-bottom: 0; }
@media (max-width: 767px) {
  th, td { padding: 9px 12px; }
  .table-heading { padding: 12px 14px; }
}

/* The global header holds controls only; page breadcrumbs carry navigation context. */
.topbar { min-height: 62px; padding-block: 9px; }
.topbar-start { gap: 0; }
.page-heading { display: block; margin-bottom: 22px; }
.page-heading .breadcrumb { margin: 0 0 7px; font-size: 12px; }
.page-heading .breadcrumb a:last-of-type { color: var(--muted); }
.page-heading .breadcrumb span[aria-current="page"] { color: var(--ink); }
@media (max-width: 767px) {
  .page-heading .breadcrumb { display: flex; max-width: 100%; overflow: hidden; gap: 6px; white-space: nowrap; }
  .page-heading .breadcrumb a, .page-heading .breadcrumb span { overflow: hidden; text-overflow: ellipsis; }
}

/* Keep sign-in focused on authentication and reserve footers for ownership details. */
@media (min-width: 768px) {
  .login-story { justify-content: center; }
  .login-story .brand { position: absolute; top: 50px; left: 55px; }
  .login-story h1 { margin: 0; }
}
.login-form h2 { margin-bottom: 28px; }
.app-footer { justify-content: center; align-items: center; flex-wrap: wrap; padding-block: 16px; font-size: 12px; }
.footer-information { white-space: pre-line; }
.login-message { white-space: pre-line; }
textarea { width: 100%; min-width: 0; resize: vertical; border: 1px solid var(--line); border-radius: 8px; padding: 11px 13px; color: var(--ink); background: var(--surface); font: inherit; }
textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent); }

/* User directory: stable columns and top-aligned multi-line identity/role details. */
.users-table { table-layout: fixed; }
.users-table .user-col-identity { width: 36%; white-space: normal; }
.users-table .user-col-roles { width: 27%; white-space: normal; }
.users-table .user-col-status { width: 12%; text-align: center; }
.users-table .user-col-actions { width: 25%; text-align: right; }
.users-table td { vertical-align: top; }
.users-table .row-actions { justify-content: flex-end; flex-wrap: wrap; }
.users-table .person small, .users-table .email-state { overflow-wrap: anywhere; }
.users-table .row-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px; }
.users-table .row-actions form { display: block; }
.table-action { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 29px; padding: 4px 6px; border: 1px solid #d2e3fc; border-radius: 6px; background: #f8fbff; color: #1a73e8; font-size: 12px; font-weight: 600; text-decoration: none; }
.table-action:hover { background: #e8f0fe; border-color: #1a73e8; text-decoration: none; }
button.table-action { cursor: pointer; }
.table-action-secondary { border-color: var(--line); background: var(--surface); color: var(--muted); }
.table-action-danger { border-color: #f5c2be; background: #fff8f7; color: #b3261e; }
.table-action-danger:hover { background: #fce8e6; border-color: #d93025; }
.delete-user { position: relative; grid-column: 1 / -1; }
.delete-user summary { list-style: none; }
.delete-user summary::-webkit-details-marker { display: none; }
.delete-user[open] > summary { margin-bottom: 6px; }
.delete-user form { display: grid; gap: 6px; padding: 9px; border: 1px solid #f5c2be; border-radius: 6px; background: #fff8f7; }
.delete-user label { font-size: 11px; color: var(--muted); text-align: left; }
.delete-user input { padding: 7px 8px; font-size: 12px; }

/* Login notice: supporting information should be as readable as the form. */
.login-story h1 { font-size: clamp(28px,2.6vw,36px); line-height: 1.22; letter-spacing: -.8px; }
.login-story .login-message { max-width: 420px; margin: 16px 0 0; color: var(--muted); font-size: 16px; line-height: 1.7; }
.login-form .login-recovery { margin: 16px 0 0; font-size: 14px; line-height: 1.4; text-align: center; }
/* Keep the numeric challenge readable without letting it dominate the login form. */
.captcha-image-row img { width: min(100%, 200px); }
@media (max-width: 767px) {
  .users-table { table-layout: auto; }
  .users-table .user-col-identity, .users-table .user-col-roles, .users-table .user-col-status, .users-table .user-col-actions { width: auto; }
  .users-table .user-col-actions { min-width: 164px; }
  .users-table .row-actions { grid-template-columns: minmax(150px,1fr); }
}
