:root {
  color-scheme: light dark;
  --text: #18202a;
  --muted: #5e6875;
  --canvas: #e9edf2;
  --surface: #fff;
  --subtle: #f4f6f8;
  --border: #c5ced8;
  --accent: #245a91;
  --danger: #9c2f2d;
  --danger-bg: #fbe9e8;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--text); background: var(--canvas); font-size: 15px; line-height: 1.4; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-panel { width: min(100%, 420px); padding: 28px; background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--accent); }
.eyebrow { margin: 0 0 4px; color: var(--accent); font-size: .75rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
h1 { margin: 0; font-size: 1.4rem; letter-spacing: -.02em; }
header > p:last-child, .security-note, .audit-intro { color: var(--muted); }
form { display: grid; gap: 14px; margin-top: 22px; }
label { display: grid; gap: 5px; font-weight: 700; }
input { width: 100%; min-height: 44px; padding: 8px 10px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 2px; font: inherit; }
input:focus-visible, button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 3px solid #0b6fde; outline-offset: 2px; }
button { min-height: 44px; padding: 9px 16px; color: #fff; background: var(--accent); border: 1px solid var(--accent); border-radius: 2px; font: inherit; font-weight: 800; cursor: pointer; }
.form-error { padding: 10px 12px; margin: 18px 0 -6px; color: var(--danger); background: var(--danger-bg); border-left: 3px solid var(--danger); font-weight: 700; }
.security-note { margin: 18px 0 0; font-size: .85rem; }
.message-page { width: min(100% - 32px, 620px); margin: 80px auto; padding: 24px; background: var(--surface); border: 1px solid var(--border); }
a { color: var(--accent); font-weight: 700; }
.audit-page { min-width: 320px; }
.audit-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 20px; background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: inset 0 3px var(--accent); }
.audit-header nav { display: flex; align-items: center; gap: 18px; }
.audit-page main { padding: 20px; }
.table-scroll { overflow: auto; background: var(--surface); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border); }
th { position: sticky; top: 0; background: var(--subtle); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
code { font-size: .82rem; }
details summary { color: var(--accent); font-weight: 700; cursor: pointer; }
.audit-change { position: absolute; z-index: 2; width: min(520px, calc(100vw - 48px)); padding: 12px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 10px 24px rgb(20 30 40 / 22%); white-space: normal; }
.audit-change pre { max-height: 160px; margin: 4px 0 10px; overflow: auto; color: var(--text); font-size: .78rem; white-space: pre-wrap; word-break: break-word; }

@media (prefers-color-scheme: dark) {
  :root { --text: #eef2f6; --muted: #aeb8c5; --canvas: #121821; --surface: #1b232d; --subtle: #222c37; --border: #465260; --accent: #73a8dc; --danger: #f28b82; --danger-bg: #3e2221; }
}

@media (max-width: 600px) {
  .login-shell { align-items: start; padding: max(16px, env(safe-area-inset-top)) 16px; }
  .login-panel { padding: 22px 18px; }
  .audit-header { align-items: flex-start; padding: 12px 16px; }
  .audit-header nav { flex-direction: column; align-items: flex-end; gap: 4px; }
  .audit-page main { padding: 16px; }
}
