/* Access admin. Product UI: restrained palette (tinted neutrals + one moss-green accent for primary actions and the current selection), one system sans family,
   a tight type scale, dense tables, inline forms. Dialogs only for destructive confirmations. */
/* The rf IDEAS website's own design tokens (--color--* in its styles.css): charcoal #282829, indigo #4A4986 (main), dark indigo #151537, light indigo #E3E3FF, red #ED2024, blue #0071a2,
   grays #58595B #F5F5F5 #DCDCDC, and the Rubik typeface. Departures, each for WCAG AA contrast (checked with real numbers, see central-auth/README.md):
   - red text and destructive buttons use #C8141A, one step darker than the brand red #ED2024 (white on #ED2024 is 4.35:1, on #C8141A 5.9:1); the logo keeps the exact brand red;
   - hover goes to dark indigo, not the site's light indigo (white on #9997FF is 2.55:1);
   - input borders use #86878A, not the site's form gray #A7A9AC (2.36:1 against white; a control's edge needs 3:1). */
@font-face { font-family: "Rubik"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/rubik-400.woff2") format("woff2"); }
@font-face { font-family: "Rubik"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/rubik-500.woff2") format("woff2"); }
@font-face { font-family: "Rubik"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/rubik-700.woff2") format("woff2"); }

:root {
  color-scheme: light dark;
  --brand-charcoal: #282829;
  --bg: #f5f5f5;
  --panel: #ffffff;
  --side: #ffffff;
  --hover: #f1f1f8;
  --ink: #282829;
  --muted: #58595b;
  --line: #dcdcdc;
  --line-strong: #86878a;
  --accent: #4a4986;
  --accent-hover: #151537;
  --accent-ink: #ffffff;
  --accent-soft: #e3e3ff;
  --accent-text: #4a4986;
  --nav-current-ink: #151537;
  --danger: #c8141a;
  --danger-soft: #fdeaea;
  --warn-text: #5c4100;
  --warn-soft: #fff3d0;
  --info-text: #00506f;
  --info-soft: #eef4f8;
  --ok-text: #0071a2;
  --header-bg: #282829;
  --header-ink: #dcdcdc;
  --header-ink-strong: #ffffff;
  --font: "Rubik", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --z-sticky: 10; --z-toast: 40;
  --ease: cubic-bezier(0.25, 1, 0.5, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161617; --panel: #222224; --side: #1c1c1e; --hover: #2a2a30;
    --ink: #ececee; --muted: #a9aaad; --line: #38383b; --line-strong: #85868a;
    --accent: #9997ff; --accent-hover: #b3b2ff; --accent-ink: #151537; --accent-soft: #2b2a4f; --accent-text: #c9c8ff; --nav-current-ink: #e3e3ff;
    --danger: #ff6b6b; --danger-soft: #3a1d1f; --warn-text: #ffd884; --warn-soft: #3a2f12;
    --info-text: #9fd6ee; --info-soft: #1d2a33; --ok-text: #4fb6e6;
  }
}

* { box-sizing: border-box; }
html { font-size: 15px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 1rem/1.5 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { line-height: 1.25; margin: 0; text-wrap: balance; }
h1 { font-size: 1.6rem; font-weight: 500; }
h1:focus { outline: none; }
h2 { font-size: 1.1rem; font-weight: 500; }
p { margin: 0 0 0.75rem; max-width: 70ch; text-wrap: pretty; }
a { color: var(--accent-text); text-underline-offset: 0.18em; }
a:hover { color: var(--accent); }
code, .mono { font-family: var(--mono); font-size: 0.875em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 8px; top: -48px; background: var(--panel); padding: 8px 12px; border-radius: 8px; z-index: var(--z-toast); }
.skip:focus { top: 8px; }
.sub { color: var(--muted); font-size: 0.875rem; font-weight: 400; }
.hint { color: var(--muted); font-size: 0.875rem; margin: 0.4rem 0 0; }
.lede { color: var(--muted); margin: 0.25rem 0 1.25rem; }
.nowrap { white-space: nowrap; }
.foot { margin-top: 2rem; }

/* shell */
.top { position: sticky; top: 0; z-index: var(--z-sticky); display: flex; align-items: center; gap: 14px; height: 56px; padding: 0 20px; background: var(--header-bg); color: var(--header-ink); }
.top :focus-visible { outline-color: var(--header-ink-strong); }
.brand { display: flex; align-items: center; gap: 14px; color: var(--header-ink-strong); text-decoration: none; }
.brand .logo { display: block; height: 28px; width: auto; }
.brand-name { font-weight: 500; white-space: nowrap; padding-left: 14px; border-left: 1px solid rgb(255 255 255 / 0.28); line-height: 1.2; }
.env { font-size: 0.8125rem; font-weight: 500; padding: 1px 10px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); }
.env-prod { background: var(--danger); color: #ffffff; }
.spacer { flex: 1; }
.who { color: var(--header-ink); font-size: 0.875rem; max-width: 32ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layout { display: grid; grid-template-columns: 216px minmax(0, 1fr); min-height: calc(100vh - 56px); }
.side { background: var(--side); border-right: 1px solid var(--line); padding: 20px 12px; display: flex; flex-direction: column; gap: 2px; }
.side a { padding: 9px 14px; border-radius: 999px; color: var(--ink); font-weight: 500; text-decoration: none; transition: background-color 150ms var(--ease); }
.side a:hover { background: var(--hover); }
.side a[aria-current="page"] { background: var(--accent-soft); color: var(--nav-current-ink); }
.content { padding: 28px 32px 72px; max-width: 1160px; width: 100%; }
.content:focus { outline: none; }
.fatal { max-width: 34rem; margin: 12vh auto 0; padding: 0 24px; }
.fatal h1 { margin-bottom: 0.75rem; }
@media (max-width: 760px) {
  /* minmax(0, 1fr), not 1fr: a bare 1fr column grows to its widest content (a table) and the whole page scrolls sideways */
  .layout { grid-template-columns: minmax(0, 1fr); grid-auto-rows: min-content; align-content: start; }
  .side { flex-direction: row; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px 12px; overflow-x: auto; }
  .side a { white-space: nowrap; }
  .page-head h1 { font-size: 1.35rem; }
  .top { padding: 0 14px; gap: 10px; }
  .content { padding: 20px 16px 56px; }
  .who { display: none; }
}

/* page structure */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 1rem; flex-wrap: wrap; }
.page-actions { display: flex; gap: 8px; }
.crumbs { display: flex; gap: 8px; font-size: 0.875rem; color: var(--muted); margin-bottom: 0.5rem; }
.crumbs a { color: var(--muted); }
.block { margin-top: 2rem; }
.block.first { margin-top: 1.25rem; }
details.settings { margin-top: 2rem; }
details.settings > summary { cursor: pointer; font-weight: 500; font-size: 1.1rem; list-style-position: outside; }
details.settings[open] > summary { margin-bottom: 1rem; }
details.settings summary .sub { font-weight: 400; }
.block > h2 { margin-bottom: 0.75rem; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin-bottom: 1.5rem; }
.form-grid { display: grid; gap: 16px; max-width: 640px; }
.form-grid > h2 { margin-bottom: 0; }
.field label { display: block; font-weight: 500; margin-bottom: 4px; }
.field.check { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: start; }
.field.check label { margin: 0; }
.field.check .hint { grid-column: 2; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.add-form { display: grid; gap: 14px; max-width: 640px; margin-bottom: 1.5rem; }
input, select, textarea { width: 100%; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--panel); color: var(--ink); font: inherit; transition: border-color 150ms var(--ease); }
input[type="checkbox"] { width: 1.1rem; height: 1.1rem; margin-top: 0.2rem; accent-color: var(--accent); }
textarea { resize: vertical; min-height: 5rem; }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--muted); }
.filter { max-width: 22rem; margin-bottom: 0.75rem; }
.filter.wide { max-width: 30rem; margin-bottom: 1rem; }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
table.data { width: 100%; border-collapse: collapse; }
.data th, .data td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.data tbody tr:last-child > * { border-bottom: 0; }
.data thead th { background: var(--side); color: var(--muted); font-size: 0.8125rem; font-weight: 500; }
.data tbody th { font-weight: 500; }
.data a { text-decoration: none; }
.data a:hover, .data a:focus-visible { text-decoration: underline; }
.data tbody tr:hover { background: var(--hover); }
.data .num { text-align: right; font-variant-numeric: tabular-nums; }
.data .actions { text-align: right; white-space: nowrap; }
.row-muted { color: var(--muted); }
.chip { display: inline-block; padding: 1px 8px; margin: 0 6px 4px 0; border: 1px solid var(--line); border-radius: 6px; background: var(--side); color: var(--ink); font-size: 0.875rem; text-decoration: none; }
.chip:hover { border-color: var(--line-strong); }
.status-on { color: var(--ok-text); }
.status-off { color: var(--muted); }
.plain-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.plain-list li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* badges, notices, empty, skeleton */
.badge { display: inline-block; font-size: 0.8125rem; padding: 1px 9px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--panel); white-space: nowrap; }
.badge-all_employees { background: var(--accent-soft); color: var(--nav-current-ink); border-color: transparent; }
.badge-self_service { background: var(--info-soft); color: var(--info-text); border-color: transparent; }
.notice { padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); margin: 0.75rem 0; }
.notice p { margin: 0; }
.notice p + button { margin-top: 10px; }
.notice-info { background: var(--info-soft); color: var(--info-text); }
.notice-warn { background: var(--warn-soft); color: var(--warn-text); }
.notice-error { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
.status:empty { display: none; }
.empty { background: var(--panel); border: 1px dashed var(--line-strong); border-radius: 12px; padding: 32px 24px; max-width: 36rem; }
.empty h2 { margin-bottom: 0.5rem; }
.empty.compact { padding: 16px 20px; }
.empty.compact p { margin: 0; color: var(--muted); }
.skeleton-row { height: 42px; margin-bottom: 8px; border-radius: 8px; background: linear-gradient(90deg, var(--side), var(--line), var(--side)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.facts { display: grid; grid-template-columns: 9rem 1fr; gap: 6px 16px; margin: 0.5rem 0 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.danger-zone .action-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding: 14px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.danger-zone .action-row:first-of-type { border-top: 0; }
.danger-zone .action-row .hint { max-width: 60ch; }

/* buttons */
.btn { white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 22px; border: 1px solid transparent; border-radius: 999px; font: inherit; font-weight: 500; cursor: pointer; text-decoration: none; transition: background-color 150ms var(--ease), border-color 150ms var(--ease), color 150ms var(--ease); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); color: var(--accent-ink); }
/* the site's "inverted" button: white with a dark-indigo outline */
.btn-secondary { background: var(--panel); border-color: var(--accent-hover); color: var(--accent-hover); }
.btn-secondary:hover:not(:disabled) { background: var(--hover); }
.btn-quiet { background: transparent; color: var(--ink); }
.btn-quiet:hover:not(:disabled) { background: var(--hover); }
.top .btn-quiet { color: var(--header-ink-strong); }
.top .btn-quiet:hover:not(:disabled) { background: rgb(255 255 255 / 0.14); }
.btn-danger { background: var(--danger); color: #ffffff; }
@media (prefers-color-scheme: dark) { .btn-danger { color: #1a0a0a; } }
.btn-danger:hover:not(:disabled) { filter: brightness(0.9); }
.btn-quiet-danger { background: transparent; color: var(--danger); }
.btn-quiet-danger:hover:not(:disabled) { background: var(--danger-soft); }
.btn-small { height: 30px; padding: 0 14px; font-size: 0.875rem; }

/* feedback */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: var(--z-toast); display: grid; gap: 8px; max-width: min(26rem, calc(100vw - 40px)); }
.toast { padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--panel); box-shadow: 0 4px 16px oklch(0.2 0.02 150 / 0.18); animation: toast-in 180ms var(--ease); }
.toast-warn { background: var(--warn-soft); color: var(--warn-text); }
.toast-error { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
dialog.confirm { max-width: 28rem; width: calc(100vw - 32px); padding: 22px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--panel); color: var(--ink); }
dialog.confirm::backdrop { background: oklch(0.2 0.02 150 / 0.5); }
dialog.confirm h2 { margin-bottom: 0.5rem; }
dialog.confirm .form-actions { margin-top: 1.25rem; justify-content: flex-end; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
}
@media (max-width: 560px) {
  /* the logo already says whose tool this is; the text label would wrap */
  .brand-name { display: none; }
}
