/* ec2-admin console. No inline styles anywhere (strict CSP). */
:root {
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 8px;
  --radius-lg: 12px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0a0c;
  --surface: #111114;
  --surface-2: #18181c;
  --surface-3: #1f1f24;
  --border: #232329;
  --border-strong: #303038;
  --text: #ededef;
  --text-2: #a0a0ab;
  --text-3: #6e6e78;
  --accent: #7c85ff;
  --ok: #3ecf8e;
  --warn: #f5a524;
  --error: #f3615d;
  --primary-bg: #ededef;
  --primary-fg: #0a0a0c;
  --primary-hover: #ffffff;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 8px 24px rgba(0, 0, 0, .35);
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px #7c85ffb3;
}
[data-theme="light"] {
  color-scheme: light;
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-2: #f5f5f6;
  --surface-3: #ececee;
  --border: #e6e6e9;
  --border-strong: #d4d4d8;
  --text: #18181b;
  --text-2: #55555f;
  --text-3: #8a8a94;
  --accent: #4f57d9;
  --ok: #138a55;
  --warn: #b26b00;
  --error: #d43c3c;
  --primary-bg: #18181b;
  --primary-fg: #ffffff;
  --primary-hover: #000000;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .06);
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px #4f57d9a6;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.5 var(--font); font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased; min-height: 100vh;
}
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 22px; line-height: 1.25; letter-spacing: -.02em; }
h2 { font-size: 14px; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
code, .mono { font-family: var(--mono); font-size: .92em; }
[hidden] { display: none !important; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }

.muted { color: var(--text-2); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.truncate { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -40px; z-index: 100; background: var(--primary-bg); color: var(--primary-fg); padding: 6px 10px; border-radius: 6px; }
.skip:focus { top: 12px; }
.eyebrow { font-size: 12px; font-weight: 500; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 14px; }

/* ------------------------------------------------ icons (CSS masks, see bottom) */
.i { display: inline-block; width: 16px; height: 16px; flex: none; background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }

/* ------------------------------------------------ top bar */
.topbar { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(180%) blur(12px); }
.topbar-inner { max-width: 1240px; margin: 0 auto; padding: 0 24px; height: 56px; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; }
.brand-mark { width: 22px; height: 22px; border-radius: 6px; flex: none;
  background: linear-gradient(135deg, var(--text) 0%, var(--text-2) 100%);
  -webkit-mask: var(--logo) center / contain no-repeat; mask: var(--logo) center / contain no-repeat; }
.brand-mark-lg { width: 36px; height: 36px; }
.nav { display: flex; gap: 2px; }
.nav a { white-space: nowrap; padding: 6px 10px; border-radius: 6px; color: var(--text-2); font-weight: 500; transition: color .15s, background .15s; }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--text); background: var(--surface-3); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.menu { position: relative; }
.menu-trigger { list-style: none; display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border-radius: 999px;
  cursor: pointer; border: 1px solid var(--border); color: var(--text-2); transition: border-color .15s, background .15s; }
.menu-trigger::-webkit-details-marker { display: none; }
.menu-trigger:hover, .menu[open] .menu-trigger { border-color: var(--border-strong); background: var(--surface-2); color: var(--text); }
.menu-name { font-weight: 500; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; padding: 6px; z-index: 30;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow);
  animation: pop .14s var(--ease); }
.menu-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px 10px;
  border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.menu-user { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 6px; border: 0;
  background: none; color: var(--text-2); font: inherit; cursor: pointer; text-align: left; }
.menu-item:hover { background: var(--surface-2); color: var(--text); }
.avatar { width: 26px; height: 26px; border-radius: 999px; display: grid; place-items: center; flex: none;
  font-size: 12px; font-weight: 600; color: var(--text); background: var(--surface-3); border: 1px solid var(--border-strong); }
.avatar-sm { width: 24px; height: 24px; font-size: 11px; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }

/* ------------------------------------------------ layout */
.container { max-width: 1240px; margin: 0 auto; padding: 28px 24px 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .muted { margin-top: 4px; }
.page-actions { display: flex; align-items: center; gap: 12px; }
.meta-row { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 8px 0 0; color: var(--text-2); font-size: 13px; }
.meta-row div { display: flex; gap: 6px; align-items: center; }
.meta-row dt { color: var(--text-3); }
.meta-row dd { margin: 0; color: var(--text); }
.section { margin-top: 24px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 24px; align-items: start; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; min-height: 28px; }
.card-highlight { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.card > .muted + * { margin-top: 14px; }
.card:has(> .table-wrap) { padding-bottom: 6px; }

/* ------------------------------------------------ status bits */
.updated { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 999px; flex: none; background: var(--text-3); }
.dot-ok { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent); }
.dot-warn { background: var(--warn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 20%, transparent); }
.dot-error { background: var(--error); box-shadow: 0 0 0 3px color-mix(in srgb, var(--error) 20%, transparent); }
.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px;
  font-weight: 500; white-space: nowrap; border: 1px solid transparent; vertical-align: middle; }
.badge .dot { width: 6px; height: 6px; box-shadow: none; }
.badge-neutral { background: var(--surface-2); color: var(--text-2); border-color: var(--border); }
.badge-accent { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 28%, transparent); }
.badge-ok { background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 24%, transparent); }
.badge-warn { background: color-mix(in srgb, var(--warn) 12%, transparent); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 26%, transparent); }
.badge-error { background: color-mix(in srgb, var(--error) 12%, transparent); color: var(--error); border-color: color-mix(in srgb, var(--error) 26%, transparent); }

.alert { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: var(--radius); font-size: 13px;
  border: 1px solid var(--border); background: var(--surface-2); margin-bottom: 16px; }
.alert .i { margin-top: 2px; }
.alert-ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, transparent); background: color-mix(in srgb, var(--ok) 8%, var(--surface)); }
.alert-warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); background: color-mix(in srgb, var(--warn) 8%, var(--surface)); }
.alert-error { color: var(--error); border-color: color-mix(in srgb, var(--error) 30%, transparent); background: color-mix(in srgb, var(--error) 8%, var(--surface)); }
.stack > .alert, .card .alert { margin-bottom: 0; }

/* ------------------------------------------------ summary tiles */
.summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; min-height: 104px;
  display: flex; flex-direction: column; gap: 6px; }
.tile-label { color: var(--text-2); font-size: 12px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.tile-value { font-size: 22px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.tile-value small { font-size: 13px; font-weight: 500; color: var(--text-3); letter-spacing: 0; margin-left: 4px; }
.tile-sub { color: var(--text-3); font-size: 12px; margin-top: auto; }
.tile-ok .tile-value { color: var(--ok); }
.tile-warn .tile-value { color: var(--warn); }
.tile-error .tile-value { color: var(--error); }
.meter { height: 4px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: auto; }
.meter > span { display: block; height: 100%; border-radius: inherit; background: var(--text-2); transition: width .4s var(--ease); }
.meter-ok > span { background: var(--ok); }
.meter-warn > span { background: var(--warn); }
.meter-error > span { background: var(--error); }
.skeleton { position: relative; overflow: hidden; }
.skeleton::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, var(--surface-2), transparent);
  animation: shimmer 1.4s infinite; }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ------------------------------------------------ apps */
.apps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.app { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; display: flex; flex-direction: column; gap: 12px;
  transition: border-color .15s; }
.app:hover { border-color: var(--border-strong); }
.app-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.app-name { font-weight: 600; font-size: 15px; }
.app-desc { color: var(--text-2); font-size: 13px; }
.app-urls { display: flex; flex-direction: column; gap: 4px; }
.url-row { display: flex; align-items: center; gap: 4px; padding: 4px 4px 4px 10px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); }
.url-row > a:first-child { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.url-row > a:first-child:hover .url-text { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
.url-label { font-size: 11px; color: var(--text-3); font-weight: 500; }
.url-text { font-family: var(--mono); font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 12px; padding-top: 10px; border-top: 1px solid var(--border); margin-top: auto; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; font-family: var(--mono); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* ------------------------------------------------ tables */
.table-wrap { overflow-x: auto; margin: 0 -20px; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th:first-child, .table td:first-child { padding-left: 20px; }
.table th:last-child, .table td:last-child { padding-right: 20px; }
.table tbody tr:last-child td { border-bottom: 0; }
.table th { font-size: 12px; font-weight: 500; color: var(--text-3); white-space: nowrap; border-bottom-color: var(--border); }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions { text-align: right; width: 1%; white-space: nowrap; }
.table .empty { text-align: center; color: var(--text-3); padding: 28px; }
.table th button { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; border-radius: 4px; }
.table th button:hover { color: var(--text); }
.table th button:focus-visible { box-shadow: var(--focus); }
.table th button::after { content: ""; width: 10px; height: 10px; opacity: 0; background: currentColor;
  -webkit-mask: var(--i-chevron) center / contain no-repeat; mask: var(--i-chevron) center / contain no-repeat; }
.table th[aria-sort] button { color: var(--text); }
.table th[aria-sort] button::after { opacity: 1; }
.table th[aria-sort="ascending"] button::after { transform: rotate(180deg); }
.table td.num.hot { color: var(--warn); }
.cell-name { font-weight: 500; overflow-wrap: anywhere; min-width: 0; }
.cell-sub { color: var(--text-3); font-size: 12px; }
.ua { max-width: 340px; }
.user-cell { display: flex; align-items: center; gap: 10px; font-weight: 500; }

/* ------------------------------------------------ lists */
.link-list, .cmd-list, .codes, .steps { list-style: none; margin: 0; padding: 0; }
.link-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-weight: 500; }
.link-list li:last-child .link-row { border-bottom: 0; }
.link-row .muted { text-align: right; font-weight: 400; }
.link-row .i { color: var(--text-3); width: 14px; height: 14px; }
.link-row:hover .i, .link-row:hover > span:first-child { color: var(--text); }
.link-row:hover > span:first-child { text-decoration: underline; text-underline-offset: 2px; }
.cmd { padding: 8px 0; }
.cmd + .cmd { border-top: 1px solid var(--border); }
.cmd-row { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.cmd-row code, .secret { flex: 1; min-width: 0; padding: 6px 10px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font-size: 12px; }
.secret-row { display: flex; align-items: center; gap: 6px; }
.secret { letter-spacing: .06em; word-break: break-all; font-size: 13px; }
.codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 14px; }
.codes li { padding: 8px 10px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); text-align: center; font-size: 13px; letter-spacing: .05em; }
.steps { counter-reset: s; display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; color: var(--text-2); }
.steps li { counter-increment: s; display: flex; gap: 10px; }
.steps li::before { content: counter(s); flex: none; width: 20px; height: 20px; border-radius: 999px; display: grid; place-items: center;
  background: var(--surface-3); color: var(--text); font-size: 11px; font-weight: 600; margin-top: 1px; }
.enrol { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: start; }
.qr { background: #fff; border-radius: var(--radius); padding: 6px; line-height: 0; border: 1px solid var(--border); }
.qr svg { display: block; width: 168px; height: 168px; }
.qr path { stroke: #0a0a0c; }
.disclosure { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 12px; }
.disclosure summary { cursor: pointer; color: var(--text-2); font-weight: 500; width: fit-content; border-radius: 4px; }
.disclosure summary:hover { color: var(--text); }
.disclosure[open] summary { margin-bottom: 14px; }
.inline-form { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.inline-form .field { flex: 1; min-width: 140px; }
.inline-form .alert { flex-basis: 100%; }

/* ------------------------------------------------ forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label { font-size: 13px; font-weight: 500; color: var(--text); }
.hint { font-size: 12px; color: var(--text-3); margin: 0; }
.card > .hint { margin-top: 12px; }
.input { width: 100%; height: 36px; padding: 0 12px; border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--bg);
  color: var(--text); font: inherit; transition: border-color .15s, box-shadow .15s; }
.input::placeholder { color: var(--text-3); }
.input:hover { border-color: var(--text-3); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
select.input { appearance: none; padding-right: 32px; cursor: pointer;
  background: var(--bg) var(--i-chevron-dark) no-repeat right 10px center / 14px; }
[data-theme="light"] select.input { background-image: var(--i-chevron-light); }
.input-sm { height: 30px; font-size: 13px; width: auto; min-width: 120px; }
.input-code { height: 44px; font-size: 20px; letter-spacing: .3em; text-align: center; }
.input:disabled, .btn:disabled { opacity: .5; cursor: not-allowed; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: var(--radius);
  border: 1px solid transparent; font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .05s; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--primary-bg); color: var(--primary-fg); }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); border-color: var(--text-3); }
.btn-ghost { background: none; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn-danger { background: color-mix(in srgb, var(--error) 12%, transparent); color: var(--error); border-color: color-mix(in srgb, var(--error) 35%, transparent); }
.btn-danger:hover:not(:disabled) { background: color-mix(in srgb, var(--error) 20%, transparent); }
.btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.btn.spinning .i { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--radius); border: 1px solid transparent;
  background: none; color: var(--text-2); cursor: pointer; flex: none; transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn-sm { width: 28px; height: 28px; }
.icon-btn-sm .i { width: 14px; height: 14px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--text); font: inherit; font-weight: 500; cursor: pointer; text-decoration: underline;
  text-underline-offset: 3px; text-decoration-color: var(--border-strong); }
.link-btn:hover { text-decoration-color: currentColor; }

.filters { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.filters .field { min-width: 200px; }
.filters .grow { flex: 1; }
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 16px; }

/* ------------------------------------------------ dialog */
.dialog { width: min(480px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  background: var(--surface); color: var(--text); box-shadow: 0 24px 64px rgba(0, 0, 0, .45); }
.dialog[open] { animation: pop .16s var(--ease); }
.dialog::backdrop { background: rgba(0, 0, 0, .55); backdrop-filter: blur(2px); }
.dialog > form, .dialog > .dialog-head, .dialog-body { padding: 20px; }
.dialog > .dialog-head { padding-bottom: 0; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-head h2 { font-size: 16px; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.dialog-body { display: flex; flex-direction: column; }
.dialog-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--border); }
.dialog-row:first-child { border-top: 0; padding-top: 4px; }
.row-title { font-weight: 500; font-size: 13px; }

/* ------------------------------------------------ toasts */
.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 50; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: var(--radius); background: var(--primary-bg); color: var(--primary-fg);
  font-weight: 500; font-size: 13px; box-shadow: var(--shadow); animation: pop .16s var(--ease); }

/* ------------------------------------------------ auth pages */
.auth-body { display: flex; min-height: 100vh;
  background: radial-gradient(1200px 600px at 50% -10%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 60%), var(--bg); }
.auth-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 16px; gap: 16px; }
.auth-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 32px 28px 28px; box-shadow: var(--shadow); }
.auth-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; margin-bottom: 24px; }
.auth-head .brand-mark { margin-bottom: 10px; }
.auth-head h1 { font-size: 20px; }
.auth-head .muted { font-size: 13px; }
.auth-card form + form { margin-top: 0; }
.auth-foot { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 13px; }
.auth-note { font-size: 12px; color: var(--text-3); }
.auth-theme { position: fixed; top: 16px; right: 16px; }
.auth-card .alert { margin-bottom: 16px; }

/* ------------------------------------------------ responsive */
@media (max-width: 1100px) {
  .summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .menu-name { display: none; }
}
@media (max-width: 640px) {
  .topbar-inner { padding: 0 14px; gap: 12px; }
  .brand-name { display: none; }
  .nav a { padding: 6px 8px; font-size: 13px; }
  .container { padding: 20px 14px 48px; }
  .card { padding: 16px 14px; }
  .table-wrap { margin: 0 -14px; }
  .table th:first-child, .table td:first-child { padding-left: 14px; }
  .table th:last-child, .table td:last-child { padding-right: 14px; }
  .hide-sm { display: none; }
  .page-actions { width: 100%; justify-content: space-between; }
  .summary .tile:first-child { grid-column: 1 / -1; min-height: 0; }
  .enrol { grid-template-columns: 1fr; justify-items: start; }
  .dialog-row { flex-direction: column; align-items: stretch; }
  .account-grid { grid-template-columns: minmax(0, 1fr); }
  .toasts { left: 14px; right: 14px; bottom: 14px; }
  .auth-card { padding: 28px 20px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ------------------------------------------------ icon set (generated SVG masks) */
:root {
  --i-copy: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='14' height='14' x='8' y='8' rx='2'/%3E%3Cpath d='M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2'/%3E%3C/svg%3E");
  --i-external: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 3h6v6'/%3E%3Cpath d='M10 14 21 3'/%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3C/svg%3E");
  --i-refresh: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8'/%3E%3Cpath d='M21 3v5h-5'/%3E%3Cpath d='M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16'/%3E%3Cpath d='M8 16H3v5'/%3E%3C/svg%3E");
  --i-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  --i-user: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='5'/%3E%3Cpath d='M20 21a8 8 0 0 0-16 0'/%3E%3C/svg%3E");
  --i-logout: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/%3E%3Cpath d='m16 17 5-5-5-5'/%3E%3Cpath d='M21 12H9'/%3E%3C/svg%3E");
  --i-lock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='18' height='11' x='3' y='11' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E");
  --i-alert: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 8v4'/%3E%3Cpath d='M12 16h.01'/%3E%3C/svg%3E");
  --i-shield: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E");
  --i-plus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3Cpath d='M12 5v14'/%3E%3C/svg%3E");
  --i-x: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18'/%3E%3Cpath d='m6 6 12 12'/%3E%3C/svg%3E");
  --i-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  --i-sun: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41'/%3E%3C/svg%3E");
  --i-moon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z'/%3E%3C/svg%3E");
  --i-chevron-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a0a0ab' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  --i-chevron-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2355555f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  --logo: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath fill='%23000' stroke='none' fill-rule='evenodd' d='M6 0h12a6 6 0 0 1 6 6v12a6 6 0 0 1-6 6H6a6 6 0 0 1-6-6V6a6 6 0 0 1 6-6zM12 6.5 6.5 17h11z'/%3E%3C/svg%3E");
}
.i-copy { --icon: var(--i-copy); }
.i-external { --icon: var(--i-external); }
.i-refresh { --icon: var(--i-refresh); }
.i-chevron { --icon: var(--i-chevron); }
.i-user { --icon: var(--i-user); }
.i-logout { --icon: var(--i-logout); }
.i-lock { --icon: var(--i-lock); }
.i-alert { --icon: var(--i-alert); }
.i-shield { --icon: var(--i-shield); }
.i-plus { --icon: var(--i-plus); }
.i-x { --icon: var(--i-x); }
.i-check { --icon: var(--i-check); }
[data-theme="dark"] .i-theme { --icon: var(--i-sun); }
[data-theme="light"] .i-theme { --icon: var(--i-moon); }
