:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --ink: #132238;
  --muted: #64748b;
  --line: #dbe4ef;
  --primary: #2457d6;
  --primary-dark: #1d46ae;
  --success: #11845b;
  --success-soft: #e8f7f0;
  --warning: #a96700;
  --warning-soft: #fff5df;
  --danger: #c43d4b;
  --danger-soft: #fff0f1;
  --shadow: 0 16px 40px rgba(24, 48, 82, .08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.topbar { background: #10233f; color: #fff; border-bottom: 1px solid rgba(255,255,255,.1); }
.topbar-inner { max-width: 1180px; margin: 0 auto; min-height: 72px; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand, .brand-lockup { font-weight: 800; letter-spacing: .12em; color: #fff; }
.brand { font-size: 18px; }
.brand span, .brand-lockup span { font-weight: 500; letter-spacing: .08em; }
.brand:hover { text-decoration: none; }
.main-nav { display: flex; align-items: center; gap: 18px; }
.main-nav a { color: #d9e5fb; font-size: 14px; }
.inline-form { display: inline; margin: 0; }
.nav-button { border: 0; background: transparent; color: #d9e5fb; padding: 0; font-size: 14px; }
.nav-button:hover { color: #fff; }
.page-shell { max-width: 1180px; margin: 0 auto; padding: 48px 28px 80px; }
.footer { max-width: 1180px; margin: 0 auto; color: #8a99ad; font-size: 12px; padding: 0 28px 32px; }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(28px, 3vw, 40px); line-height: 1.1; letter-spacing: -.035em; margin-bottom: 12px; }
h2 { font-size: 18px; margin-bottom: 8px; }
.muted { color: var(--muted); line-height: 1.6; }
.eyebrow { color: var(--primary); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 12px; }
.auth-layout { max-width: 860px; margin: 32px auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.auth-card, .login-card, .access-overview, .form-card, .reveal-card, .table-card, .empty-state { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.auth-card, .login-card { padding: 36px; }
.wide-card { max-width: 620px; margin: 0 auto; grid-column: 1 / -1; }
.login-layout { align-items: stretch; }
.login-card { background: #10233f; color: #fff; border-color: #10233f; }
.login-card .auth-subtitle { color: #b7c9e5; margin: 12px 0 30px; }
.login-card label { color: #dce7f7; }
.login-card input { background: #1b3559; color: #fff; border-color: #42658f; }
.login-card input:focus { border-color: #91b8ff; box-shadow: 0 0 0 3px rgba(145,184,255,.18); }
.login-card .primary-button { background: #6f9cff; color: #10233f; }
.login-card .primary-button:hover { background: #86adff; }
.brand-lockup { font-size: 28px; }
.auth-subtitle { color: var(--muted); }
.access-overview { padding: 30px; }
.overview-header { margin-bottom: 24px; }
.metric-card { border-radius: 14px; padding: 18px 20px; margin-top: 14px; border: 1px solid var(--line); }
.warning-metric { background: var(--warning-soft); border-color: #f0d69d; }
.success-metric { background: var(--success-soft); border-color: #b8e4d1; }
.metric-label { font-weight: 700; color: var(--ink); font-size: 13px; }
.metric-value { font-weight: 800; font-size: 32px; letter-spacing: -.04em; margin: 6px 0; }
.metric-detail { color: var(--muted); font-size: 12px; line-height: 1.5; }
.stack-form { display: flex; flex-direction: column; gap: 16px; }
label { display: flex; flex-direction: column; gap: 7px; color: var(--ink); font-size: 13px; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid #cbd7e6; border-radius: 10px; background: #fff; color: var(--ink); padding: 12px 13px; outline: none; }
textarea { resize: vertical; min-height: 120px; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(36,87,214,.12); }
.form-help, .field-note { color: var(--muted); font-size: 12px; line-height: 1.5; font-weight: 400; }
.form-divider { border-top: 1px solid var(--line); margin: 6px 0; }
.alert { border-radius: 10px; padding: 12px 14px; font-size: 13px; line-height: 1.5; margin-bottom: 18px; }
.alert.error { background: var(--danger-soft); color: #9d2836; border: 1px solid #f1bbc1; }
.alert.success { background: var(--success-soft); color: #116845; border: 1px solid #b8e4d1; }
.alert.warning { background: var(--warning-soft); color: #815000; border: 1px solid #f0d69d; margin-top: 24px; }
.primary-button, .secondary-button, .danger-button { border-radius: 9px; padding: 11px 16px; font-weight: 700; font-size: 13px; border: 1px solid transparent; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.primary-button { background: var(--primary); color: #fff; }
.primary-button:hover { background: var(--primary-dark); text-decoration: none; }
.secondary-button { background: #fff; color: var(--primary); border-color: #b9c9e4; }
.secondary-button:hover { background: #f3f7ff; text-decoration: none; }
.danger-button { background: var(--danger-soft); color: var(--danger); border-color: #f1bbc1; }
.danger-button:hover { background: #ffe2e5; }
.button-link { text-decoration: none; }
.content-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.compact-header { align-items: center; }
.quick-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 24px; }
.mini-metric { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.mini-metric span { font-size: 12px; color: var(--muted); }
.mini-metric strong { font-size: 24px; }
.search-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; }
.search-bar input { flex: 1; }
.clear-link { font-size: 13px; white-space: nowrap; }
.entry-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.entry-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; box-shadow: 0 8px 24px rgba(24,48,82,.04); }
.entry-card-top { display: flex; justify-content: space-between; gap: 12px; }
.entry-card h2 { margin-bottom: 0; word-break: break-word; }
.entry-type { text-transform: uppercase; letter-spacing: .1em; font-size: 10px; font-weight: 800; color: var(--primary); }
.icon-link { font-size: 12px; white-space: nowrap; }
.entry-details, .reveal-list { margin: 20px 0; }
.entry-details div, .reveal-list div { margin-bottom: 12px; }
dt { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 800; }
dd { margin: 4px 0 0; word-break: break-word; font-size: 13px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.tag { color: #36557e; background: #edf3fb; border-radius: 999px; padding: 5px 9px; font-size: 11px; }
.entry-actions { display: flex; gap: 8px; align-items: center; border-top: 1px solid var(--line); padding-top: 16px; }
.empty-state { text-align: center; padding: 70px 24px; }
.form-card { max-width: 840px; margin: 0 auto; padding: 30px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.full-width { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.reveal-card { max-width: 760px; margin: 0 auto; padding: 30px; }
.secret-value { display: block; background: #142744; color: #a9c9ff; border-radius: 8px; padding: 12px; overflow-wrap: anywhere; font-size: 14px; }
.preformatted { white-space: pre-wrap; }
.audit-summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.table-card { overflow: hidden; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 850px; }
th, td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 12px; vertical-align: top; }
th { background: var(--surface-soft); color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
tr:last-child td { border-bottom: 0; }
.event-action { font-weight: 700; }
.status-pill { border-radius: 999px; padding: 4px 8px; font-weight: 700; font-size: 11px; }
.status-success { color: #116845; background: var(--success-soft); }
.status-failure { color: #9d2836; background: var(--danger-soft); }
.agent-cell { max-width: 230px; word-break: break-word; color: var(--muted); }
.empty-table { text-align: center; padding: 30px; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 860px) {
  .auth-layout, .entry-grid { grid-template-columns: 1fr; }
  .wide-card { grid-column: auto; }
  .quick-metrics, .audit-summary-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .topbar-inner, .page-shell { padding-left: 18px; padding-right: 18px; }
  .topbar-inner { min-height: auto; padding-top: 18px; padding-bottom: 18px; align-items: flex-start; flex-direction: column; }
  .main-nav { flex-wrap: wrap; gap: 10px 16px; }
  .page-shell { padding-top: 28px; }
  .auth-card, .login-card, .access-overview, .form-card, .reveal-card { padding: 24px; }
  .content-header { align-items: flex-start; flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
  .full-width { grid-column: auto; }
  .search-bar { flex-wrap: wrap; }
  .search-bar input { flex-basis: 100%; }
  .entry-actions { flex-wrap: wrap; }
}
