:root {
  --background: #f3f6fb;
  --surface: #ffffff;
  --sidebar: #101c2e;
  --primary: #1768cf;
  --primary-hover: #1154ab;
  --text: #202733;
  --secondary: #596575;
  --muted: #647082;
  --focus: #8fbcf7;
  --border: #e3e8ef;
  --success: #157f4b;
  --danger: #c9363e;
  --warning: #a66b00;
  --radius: 6px;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--text); background: var(--background); font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; letter-spacing: 0; }
button, input, select { font: inherit; letter-spacing: 0; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
h1, h2, p { margin: 0; }
h1 { font-size: 21px; line-height: 1.5; font-weight: 600; }
h2 { font-size: 16px; font-weight: 600; }
small { font-size: 12px; }
.app { display: flex; min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 208px; display: flex; flex-direction: column; background: var(--sidebar); color: #b5c0cd; z-index: 20; }
.brand { min-height: 64px; flex-shrink: 0; padding: 12px 20px; display: flex; align-items: center; gap: 10px; color: #fff; font-size: 23px; font-weight: 650; border-bottom: 1px solid #ffffff16; }
.brand:hover { text-decoration: none; }
.brand img { flex-shrink: 0; }
.brand span { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; min-width: 0; line-height: 1; }
.brand small { font-size: 11px; line-height: 1.4; font-weight: 400; color: #bdc8d5; white-space: nowrap; }
/* The two "local" layers travel with the content and cover the edge glows once the list is scrolled to that end. */
.sidebar nav { --nav-scrollbar-thumb: #65758b66; padding: 12px 10px; min-height: 0; overflow-y: auto; scrollbar-gutter: stable; overscroll-behavior-y: contain; color-scheme: dark;
  background:
    linear-gradient(var(--sidebar) 40%, transparent) top / 100% 32px no-repeat local,
    linear-gradient(transparent, var(--sidebar) 60%) bottom / 100% 32px no-repeat local,
    linear-gradient(#ffffff2e, transparent) top / 100% 12px no-repeat scroll,
    linear-gradient(transparent, #ffffff2e) bottom / 100% 12px no-repeat scroll; }
.sidebar nav:hover, .sidebar nav:has(:focus-visible) { --nav-scrollbar-thumb: #8d9fb5b3; }
.sidebar nav::-webkit-scrollbar { width: 6px; height: 6px; }
.sidebar nav::-webkit-scrollbar-track { background: transparent; }
.sidebar nav::-webkit-scrollbar-thumb { background: var(--nav-scrollbar-thumb); border-radius: 999px; }
.sidebar nav::-webkit-scrollbar-thumb:hover { background: #a7b7cc; }
.sidebar nav::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
.sidebar nav::-webkit-scrollbar-corner { background: transparent; }
.nav { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 7px 12px; margin-bottom: 2px; border-radius: 4px; color: #bdc8d5; transition: background-color 180ms ease, color 180ms ease, transform 180ms ease; }
.nav:hover, .nav:focus-visible { background: #ffffff0d; color: white; text-decoration: none; }
.nav:focus-visible, .nav-group-label:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.nav.active { background: var(--primary); color: white; }
.nav.active:hover { background: var(--primary-hover); }
.nav:active { transform: translateX(1px); }
.nav-separator { height: 1px; background: #ffffff14; margin: 16px 12px; }
.nav-group-label { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 12px 12px 4px; border: 0; border-radius: 4px; background: transparent; font-size: 11px; color: #7d91b0; text-align: left; transition: color 180ms ease; }
.nav-group-label:hover { color: #c3cfdd; }
.nav-group-label .ui-icon { width: 12px; height: 12px; flex-basis: 12px; opacity: 0; transition: transform 180ms ease, opacity 180ms ease; }
.sidebar nav:hover .nav-group-label .ui-icon, .nav-group-label:focus-visible .ui-icon, .nav-group.closed .nav-group-label .ui-icon { opacity: 1; }
.nav-group.closed .nav-group-label .ui-icon { transform: rotate(-90deg); }
/* A folded group still shows the page the user is on. */
.nav-group.closed .nav:not(.active) { display: none; }
.ui-icon { display: inline-block; width: 18px; height: 18px; flex: 0 0 18px; vertical-align: middle; }
.nav.active .ui-icon { color: #c8e0ff; }
.breadcrumb-navigation { display: flex; align-items: center; gap: 12px; min-width: 0; }
.navigation-toggle { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 4px; background: transparent; color: #6c7f9b; }
.navigation-toggle:hover { background: #edf2f9; color: var(--primary); }
.sidebar-footer { margin-top: auto; flex-shrink: 0; border-top: 1px solid #ffffff16; padding: 12px 22px; color: #8999aa; font-size: 12px; }
.sidebar-backdrop { display: none; }
.workspace { margin-left: 208px; width: calc(100% - 208px); min-width: 0; }
.topbar { height: 64px; position: sticky; top: 0; z-index: 10; background: white; border-bottom: 1px solid var(--border); padding: 0 28px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
#breadcrumb { font-size: 13px; color: var(--secondary); }
.account { display: flex; align-items: center; gap: 10px; min-width: 0; }
.account-trigger { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 40px; padding: 4px 10px 4px 5px; border: 1px solid transparent; border-radius: 999px; background: transparent; color: var(--text); transition: background-color 160ms ease, border-color 160ms ease; }
.account-trigger:hover, .account-trigger[aria-expanded="true"] { background: #f3f5f8; border-color: var(--border); }
.account-trigger .ui-icon { width: 15px; height: 15px; flex-basis: 15px; color: var(--muted); transition: transform 160ms ease; }
.account-trigger[aria-expanded="true"] .ui-icon { transform: rotate(180deg); }
#current-user { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu { position: fixed; inset: auto; margin: 0; min-width: 168px; max-width: min(280px, calc(100vw - 16px)); padding: 6px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); box-shadow: 0 12px 32px #17212d24; }
.menu-header { display: grid; gap: 2px; padding: 6px 12px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.menu-header strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.menu-header span { font-size: 12px; color: var(--muted); }
.menu-item { display: flex; align-items: center; width: 100%; min-height: 36px; padding: 6px 12px; border: 0; border-radius: 5px; background: transparent; color: var(--text); text-align: left; white-space: nowrap; }
.menu-item:hover, .menu-item:focus-visible { background: #edf4ff; color: var(--primary); text-decoration: none; outline: none; }
.menu-item.danger { color: var(--danger); }
.menu-item.danger:hover, .menu-item.danger:focus-visible { background: #fff1f1; color: var(--danger); }
.menu-separator { height: 1px; margin: 4px 0; background: var(--border); }
@supports selector(:popover-open) {
  .menu { opacity: 0; transform: translateY(-4px); transition: opacity 120ms ease, transform 120ms ease, overlay 120ms allow-discrete, display 120ms allow-discrete; }
  .menu:popover-open { opacity: 1; transform: none; }
  @starting-style { .menu:popover-open { opacity: 0; transform: translateY(-4px); } }
}
.avatar { width: 29px; height: 29px; border-radius: 50%; display: grid; place-items: center; background: #eaf0ff; color: var(--primary); font-size: 13px; font-weight: 600; flex-shrink: 0; }
main { padding: 28px; max-width: 1600px; margin: 0 auto; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.toolbar, .actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 15px; min-height: 37px; border: 1px solid transparent; border-radius: var(--radius); background: var(--primary); color: #fff; font-weight: 500; white-space: nowrap; }
.button:hover { background: var(--primary-hover); text-decoration: none; }
.button.quiet { background: #fff; color: var(--secondary); border-color: var(--border); }
.button.quiet:hover { background: #f3f5f8; color: var(--text); }
.button.danger { color: var(--danger); background: #fff1f1; }
.button.danger:hover { background: #ffe3e4; }
.button.destructive { background: var(--danger); }
.button.destructive:hover { background: #ad2a32; }
.button.small { font-size: 12px; padding: 5px 10px; min-height: 30px; }
.button.link { border: 0; background: transparent; color: var(--primary); padding: 2px 4px; min-height: 28px; }
.table-scroll { width: 100%; overflow: auto; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface); }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
th { padding: 12px 16px; background: #f8fafc; color: var(--secondary); font-size: 12px; font-weight: 500; white-space: nowrap; }
td { padding: 14px 16px; border-top: 1px solid #edf0f4; vertical-align: middle; }
td .actions { flex-wrap: nowrap; }
/* Keep a destructive button a little apart from its neighbours. */
td .actions .button.danger { margin-left: 6px; }
tbody tr:hover { background: #fafbfe; }
table.has-actions { min-width: 680px; }
table.has-actions th:last-child, table.has-actions td:last-child { position: sticky; right: 0; }
table.has-actions th:last-child { background: #f8fafc; }
table.has-actions td:last-child { background: var(--surface); }
table.has-actions tbody tr:hover td:last-child { background: #fafbfe; }
.cell-primary { font-weight: 550; color: var(--text); min-width: 120px; }
.cell-secondary { font-size: 12px; color: var(--muted); margin-top: 3px; }
.cell-url { min-width: 160px; max-width: 280px; overflow-wrap: break-word; }
button.cell-check { display: block; padding: 2px 4px; margin: -2px -4px; border: 0; border-radius: 4px; background: transparent; color: inherit; text-align: left; }
button.cell-check:hover .badge { box-shadow: 0 0 0 1px currentColor; }
.cell-check .cell-secondary { display: block; }
.cell-path { max-width: 250px; overflow-wrap: anywhere; }
.notification-history table { min-width: 920px; }
.nowrap { white-space: nowrap; }
.badge { display: inline-flex; align-items: center; white-space: nowrap; font-size: 12px; padding: 2px 8px; border-radius: 4px; background: #edf1f6; color: var(--secondary); }
.badge.success { background: #e8f7ee; color: var(--success); }
.badge.danger { background: #fff0f0; color: var(--danger); }
.badge.warning { background: #fff6df; color: var(--warning); }
.empty { padding: 56px 20px; text-align: center; color: var(--muted); background: white; }
.empty strong { display: block; color: var(--secondary); margin-bottom: 14px; font-weight: 500; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: white; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-bottom: 28px; }
.metric { padding: 22px; border-right: 1px solid var(--border); }
.metric:last-child { border-right: 0; }
.metric-label { color: var(--secondary); font-size: 13px; }
.metric-value { margin-top: 6px; font-size: 29px; line-height: 1.4; font-weight: 650; font-variant-numeric: tabular-nums; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin: 26px 0 14px; gap: 12px; }
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 18px; }
.application { background: white; border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; min-width: 0; gap: 14px; }
.application-top { display: flex; gap: 12px; align-items: center; }
.application-icon { width: 40px; height: 40px; flex-shrink: 0; display: grid; place-items: center; background: #eaf0ff; color: var(--primary); border-radius: 6px; font-size: 20px; font-weight: 600; }
.application h2 { overflow-wrap: anywhere; }
.application p { color: var(--secondary); min-height: 44px; overflow-wrap: anywhere; }
.application .button { align-self: flex-start; margin-top: auto; }
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-bottom: 18px; }
.filter-row { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-bottom: 18px; }
.filter-row .filters { margin-bottom: 0; }
.filters .field { min-width: 120px; margin: 0; }
.filters .field.grow { flex: 1; min-width: 180px; }
.field { margin-top: 16px; }
.field label { display: inline-block; font-size: 13px; margin-bottom: 6px; color: var(--secondary); }
.required-mark { margin-left: 4px; color: var(--danger); }
.field-hint { margin-top: 5px; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
input, select { width: 100%; min-width: 0; height: 40px; border: 1px solid #ccd5e0; border-radius: var(--radius); padding: 8px 11px; background: white; color: var(--text); }
input:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px #1768cf24; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); }
.checkbox { display: flex; align-items: center; gap: 9px; margin-top: 18px; }
.checkbox label { cursor: pointer; }
.pagination { container-type: inline-size; display: flex; justify-content: space-between; align-items: center; padding: 16px 0; gap: 12px; color: var(--secondary); font-size: 13px; flex-wrap: wrap; }
.pagination select { width: auto; height: 32px; padding: 4px 8px; }
.pagination-summary { font-variant-numeric: tabular-nums; }
.pagination-controls { display: flex; align-items: center; justify-content: flex-end; gap: 16px; flex-wrap: wrap; max-width: 100%; margin-left: auto; }
.pagination-size, .pagination-navigation, .pagination-pages { display: flex; align-items: center; gap: 4px; }
.pagination-size { gap: 8px; white-space: nowrap; }
.pagination-pages { flex-wrap: wrap; justify-content: center; }
.pagination-navigation .button { min-width: 32px; min-height: 32px; padding: 4px 6px; font-size: 13px; font-variant-numeric: tabular-nums; transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease; }
.pagination-navigation [data-previous], .pagination-navigation [data-next] { font-size: 21px; line-height: 1; }
.pagination-navigation .button[aria-current="page"] { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.pagination-navigation .button[aria-current="page"]:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.pagination-navigation .button:disabled { cursor: default; color: var(--muted); background: #f8fafc; }
.pagination-ellipsis { width: 20px; flex-shrink: 0; text-align: center; color: var(--muted); }
@container (max-width: 520px) {
  .pagination-controls { width: 100%; justify-content: space-between; gap: 12px; }
}
@container (max-width: 320px) {
  .pagination-navigation { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: 100%; }
  .pagination-pages { grid-column: 1 / -1; grid-row: 1; justify-content: center; }
}
.nav .badge { margin-left: auto; }
.nav .badge[hidden] { display: none; }
.record-picker { padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.record-picker .actions { margin-top: 10px; }
.record-picker .actions input { flex: 1; min-width: 120px; }
.record-picker .pagination { padding-bottom: 0; }
.authorization-tabs { display: flex; gap: 20px; overflow-x: auto; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.authorization-tabs [role="tab"] { flex-shrink: 0; padding: 10px 2px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--secondary); }
.authorization-tabs [role="tab"]:hover { color: var(--primary); }
.authorization-tabs [aria-selected="true"] { border-bottom-color: var(--primary); color: var(--primary); font-weight: 600; }
.authorization-help { margin: 14px 0 18px; color: var(--secondary); font-size: 13px; overflow-wrap: anywhere; }
.group-context { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 16px; margin-block: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow-wrap: anywhere; }
.group-context > div { min-width: 0; }
.group-context p { color: var(--secondary); margin-top: 4px; }
.multi-picker { margin-top: 16px; }
.multi-picker .actions input { flex: 1; min-width: 100px; }
.multi-picker-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; padding-block: 12px 8px; font-size: 12px; color: var(--secondary); }
.multi-picker-options { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.multi-picker-option { display: flex; align-items: center; gap: 10px; padding: 8px 12px; cursor: pointer; }
.multi-picker-option + .multi-picker-option { border-top: 1px solid var(--border); }
.multi-picker-option:hover, .multi-picker-option:has(input:checked) { background: #edf4ff; }
.multi-picker-option input { flex-shrink: 0; }
.multi-picker-option span { min-width: 0; overflow-wrap: anywhere; }
.multi-picker-empty { padding: 18px 12px; color: var(--secondary); }
.permission-dialog { width: min(820px, calc(100% - 32px)); }
.permissions-view table { min-width: 760px; }
.authorization-dialog[open] { display: flex; flex-direction: column; overflow: hidden; }
.authorization-dialog .dialog-heading, .authorization-dialog .dialog-footer { flex-shrink: 0; }
.authorization-dialog .dialog-body { overflow-y: auto; min-height: 0; }
dialog { width: min(510px, calc(100% - 32px)); max-height: calc(100dvh - 40px); border: 1px solid var(--border); border-radius: 8px; padding: 0; box-shadow: 0 20px 70px #17212d33; }
dialog::backdrop { background: #17212d66; }
dialog { opacity: 0; transform: translateY(8px) scale(.985); transition: opacity 160ms ease, transform 160ms ease, overlay 160ms allow-discrete, display 160ms allow-discrete; }
dialog[open] { opacity: 1; transform: none; }
@starting-style { dialog[open] { opacity: 0; transform: translateY(8px) scale(.985); } }
.confirm-dialog { width: min(430px, calc(100% - 32px)); }
.confirm-dialog .dialog-heading { border-bottom: 0; padding-bottom: 0; }
.confirm-dialog .dialog-body { padding: 10px 24px 22px; color: var(--secondary); overflow-wrap: anywhere; }
.check-summary { display: flex; align-items: center; gap: 10px; padding: 16px 0 14px; color: var(--secondary); font-size: 13px; }
.check-list { list-style: none; margin: 0; padding: 0; }
.check-item { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 2px 12px; align-items: start; padding: 12px 0; border-top: 1px solid var(--border); }
.check-item .badge { justify-self: start; margin-top: 1px; }
.check-item p { grid-column: 2; color: var(--secondary); font-size: 13px; overflow-wrap: anywhere; }
.check-item .check-hint { color: var(--text); }
.dialog-heading { padding: 20px 24px; border-bottom: 1px solid var(--border); }
.dialog-body { padding: 0 24px 22px; }
.dialog-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--border); }
.error { color: var(--danger); font-size: 13px; min-height: 21px; margin-top: 12px; overflow-wrap: anywhere; }
.notice { padding: 12px 16px; border-left: 3px solid var(--warning); background: #fff8e8; margin-bottom: 18px; color: #76501a; overflow-wrap: anywhere; }
.account-section { border-top: 1px solid var(--border); padding-top: 22px; margin-top: 26px; }
.totp-section .section-heading { margin-top: 0; align-items: center; flex-wrap: wrap; }
.totp-section h2 { margin: 0; }
.totp-status { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.password-form { max-width: 430px; }
.password-form .button { margin-top: 18px; }
.security-section { margin-bottom: 28px; }
.security-rules { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.security-rules summary { display: flex; align-items: center; gap: 12px; padding: 16px 20px; cursor: pointer; list-style: none; }
.security-rules summary::-webkit-details-marker { display: none; }
.security-rules summary::after { content: ""; width: 8px; height: 8px; flex-shrink: 0; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); }
.security-rules[open] summary::after { transform: rotate(225deg); }
.security-rules-title { font-size: 16px; font-weight: 600; }
.security-rules summary .badge { margin-left: auto; }
.security-form { padding: 0 20px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.security-rules .security-form { border: 0; border-top: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); }
.security-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 0 20px; }
.security-help { margin-top: 12px; color: var(--secondary); font-size: 13px; }
.security-form textarea, .dialog-body textarea { display: block; width: 100%; resize: vertical; min-height: 110px; border: 1px solid #ccd5e0; border-radius: var(--radius); padding: 8px 11px; font: inherit; color: var(--text); background: white; }
.security-form textarea:focus, .dialog-body textarea:focus { outline: 3px solid var(--focus); outline-offset: 2px; }
.security-submit { margin-top: 20px; }
.profile { display: flex; flex-wrap: wrap; gap: 20px 44px; padding: 18px 0; }
.profile dt { color: var(--muted); font-size: 12px; }
.profile dd { margin: 4px 0 0; overflow-wrap: anywhere; }
.details { margin-bottom: 0; }
.details div { padding: 9px 0; border-bottom: 1px solid var(--border); }
.details dt { font-size: 12px; color: var(--muted); }
.details dd { margin: 3px 0 0; overflow-wrap: anywhere; }
.loading { padding: 70px 20px; text-align: center; color: var(--muted); }
.login-page { position: relative; isolation: isolate; overflow: hidden; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 36px 20px; background: #f3f5f8; }
/* A quiet dot grid; the dots near the pointer light up through a mask that follows --spot-x/--spot-y. */
.login-page::before, .login-page::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background-size: 24px 24px; background-position: center; }
.login-page::before { background-image: radial-gradient(circle, #c3cddb 1px, transparent 1.5px); -webkit-mask-image: radial-gradient(ellipse 75% 70% at 50% 45%, #000 25%, transparent 90%); mask-image: radial-gradient(ellipse 75% 70% at 50% 45%, #000 25%, transparent 90%); }
.login-page::after { background-image: radial-gradient(circle, var(--primary) 1.3px, transparent 1.9px); opacity: 0; transition: opacity 300ms ease; -webkit-mask-image: radial-gradient(190px circle at var(--spot-x, 50%) var(--spot-y, 50%), #000, transparent 78%); mask-image: radial-gradient(190px circle at var(--spot-x, 50%) var(--spot-y, 50%), #000, transparent 78%); }
.login-page.spotlit::after { opacity: .75; }
.login-card { position: relative; width: min(420px, 100%); padding: 32px 32px 26px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 12px 40px #17212d14; animation: login-in 360ms ease both; }
/* The same pointer position paints only the card's 1px edge. */
.login-card::before { content: ""; position: absolute; inset: -1px; padding: 1px; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity 300ms ease; background: radial-gradient(260px circle at var(--card-x, 50%) var(--card-y, 0px), var(--primary), transparent 70%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude; }
.login-page.spotlit .login-card::before { opacity: 1; }
@keyframes login-in { from { opacity: 0; transform: translateY(12px); } }
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; font-size: 27px; font-weight: 650; line-height: 1.2; }
.login-brand span { display: flex; flex-direction: column; }
.login-brand small { font-size: 13px; color: var(--secondary); font-weight: 400; }
.login-mascot { flex-shrink: 0; border-radius: 11px; box-shadow: 0 6px 16px #3a5bf033; }
.mascot-eyes { transform: translate(calc(var(--look-x, 0) * 1.5px), calc(var(--look-y, 0) * 1.1px)); transition: transform 140ms ease-out; }
.mascot-eye { transform-box: fill-box; transform-origin: center; transition: transform 140ms ease; animation: mascot-blink 7s infinite; }
.login-card[data-eyes] .mascot-eye { animation: none; }
.login-card[data-eyes="closed"] .mascot-eye, .login-card[data-eyes="peek"] .mascot-eye:first-child { transform: scaleY(.15); }
@keyframes mascot-blink { 0%, 96%, 100% { transform: none; } 98% { transform: scaleY(.15); } }
.login-form { width: 100%; }
.login-form h1 { margin-bottom: 18px; font-size: 21px; }
.login-form .button[type="submit"], .login-form > .button { width: 100%; margin-top: 24px; min-height: 43px; }
.login-form.shake { animation: login-shake 340ms ease; }
.login-form > .login-restart { margin-top: 0; }
.login-enrollment { display: grid; justify-items: center; gap: 12px; margin-bottom: 18px; }
.login-qr, .login-qr-placeholder { display: block; width: min(220px, 100%); aspect-ratio: 1; }
.login-qr-placeholder { display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.login-secret { width: 100%; font-size: 12px; color: var(--muted); }
.login-secret code { display: block; margin-top: 5px; color: var(--text); font-size: 13px; overflow-wrap: anywhere; user-select: all; }
.login-form [name="OTP"] { font-family: monospace; font-size: 22px; }
.login-form .login-setup-retry { margin: 0 0 16px; }
.login-setup-retry[hidden] { display: none; }
.login-form .button.loading { padding: 8px 15px; color: #fff; }
@keyframes login-shake { 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
.field.has-reveal { position: relative; }
.field.has-reveal input { padding-right: 58px; }
.password-reveal { position: absolute; right: 5px; top: 31px; height: 30px; padding: 0 9px; border: 0; border-radius: 4px; background: transparent; color: var(--secondary); font-size: 12px; }
.password-reveal:hover { background: #edf2f9; color: var(--primary); }
.caps-lock { color: var(--warning); }
.button.loading::before { content: ""; width: 14px; height: 14px; border: 2px solid #ffffff66; border-top-color: #fff; border-radius: 50%; animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.login-footer { color: var(--muted); font-size: 12px; margin-top: 28px; }
@media (max-width: 480px) {
  .login-card { padding: 26px 22px 22px; }
}
.access-error-page { width: min(600px, 100%); padding: 12vh 28px 40px; margin-inline: auto; }
.access-error-brand { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 600; margin-bottom: 44px; }
.access-error-page h1 { margin-top: 15px; font-size: 25px; }
.access-error-page p { margin-top: 14px; color: var(--secondary); }
.access-error-page .details { margin-block: 26px; }
#notifications { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 200; max-width: calc(100% - 32px); }
.toast { padding: 11px 18px; margin-bottom: 8px; color: var(--success); background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 4px 20px #17212d16; overflow-wrap: anywhere; cursor: pointer; animation: toast-in 180ms ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }
.toast.error-toast { color: var(--danger); }
body:not(.authenticated) .sidebar, body:not(.authenticated) .topbar { display: none; }
body:not(.authenticated) .workspace { margin: 0; width: 100%; }
body:not(.authenticated) #root { padding: 0; max-width: none; }
body:not(.auth-ready) .app { visibility: hidden; }
@supports not selector(::-webkit-scrollbar) {
  .sidebar nav { scrollbar-width: thin; scrollbar-color: var(--nav-scrollbar-thumb) transparent; transition: scrollbar-color 180ms ease; }
}
@media (hover: hover) and (pointer: fine) {
  .nav:hover { transform: translateX(2px); }
  .nav:active { transform: translateX(1px); }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar, .sidebar nav, .sidebar-backdrop, .nav, .nav-group-label, .nav-group-label .ui-icon, .account-trigger, .account-trigger .ui-icon, .menu, dialog, .pagination-navigation .button { transition: none; }
  .nav:hover, .nav:active { transform: none; }
  .toast, .login-card, .login-form.shake, .mascot-eye { animation: none; }
  .mascot-eyes, .mascot-eye, .login-page::after, .login-card::before { transition: none; }
}
@media (min-width: 641px) {
  .navigation-collapsed .sidebar { width: 64px; }
  .navigation-collapsed .workspace { margin-left: 64px; width: calc(100% - 64px); }
  .navigation-collapsed .brand { padding-inline: 16px; }
  .navigation-collapsed .brand span, .navigation-collapsed .nav-label, .navigation-collapsed .nav .badge, .navigation-collapsed .sidebar-footer { display: none; }
  .navigation-collapsed .sidebar nav { padding-inline: 8px; }
  .navigation-collapsed .nav { justify-content: center; padding-inline: 6px; }
  /* Icon mode shows every page: group titles shrink to separators and folding is ignored. */
  .navigation-collapsed .nav-group-label { display: none; }
  .navigation-collapsed .nav-group + .nav-group { margin-top: 8px; padding-top: 8px; border-top: 1px solid #ffffff14; }
  .navigation-collapsed .nav-group.closed .nav:not(.active) { display: flex; }
}
@media (max-width: 1000px) {
  .sidebar { width: 176px; }
  .brand { padding-inline: 16px; }
  .brand small { display: none; }
  .workspace { margin-left: 176px; width: calc(100% - 176px); }
  main { padding: 22px; }
  .topbar { padding-inline: 22px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  /* Tables scroll sideways here; a hairline marks where the pinned action column begins. */
  table.has-actions th:last-child, table.has-actions td:last-child:not([colspan]) { box-shadow: -1px 0 0 var(--border); }
}
@media (max-width: 640px) {
  .app { display: block; }
  /* The sidebar becomes a drawer opened from the top bar. */
  .sidebar { width: min(280px, 84vw); transform: translateX(-100%); visibility: hidden; transition: transform 220ms ease, visibility 220ms; }
  .navigation-open .sidebar { transform: none; visibility: visible; box-shadow: 0 0 40px #0b131f66; }
  .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 19; background: #17212d66; opacity: 0; pointer-events: none; transition: opacity 220ms ease; }
  .navigation-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
  body.navigation-open { overflow: hidden; }
  .brand { min-height: 56px; padding: 12px 16px; font-size: 20px; }
  .brand img { width: 28px; height: 28px; }
  .brand small { display: inline; }
  .nav { min-height: 42px; }
  .workspace { margin: 0; width: 100%; }
  .topbar { height: 56px; padding-inline: 10px 12px; }
  .breadcrumb-navigation { gap: 6px; }
  .navigation-toggle { width: 40px; height: 40px; flex-shrink: 0; }
  #breadcrumb { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .account { gap: 7px; flex-shrink: 0; }
  #current-user { max-width: 86px; }
  td .actions .button.link { min-height: 36px; }
  main { padding: 20px 16px; }
  .metric { padding: 16px; }
  .metric-value { font-size: 26px; }
  .page-heading { align-items: flex-start; margin-bottom: 18px; }
  h1 { font-size: 20px; }
  .filters .field { flex: 1; min-width: 135px; }
  td, th { padding-inline: 12px; }
}
