:root {
    color-scheme: dark;
    --ink: #f5f7f6;
    --muted: #9aa6a1;
    --surface: #111816;
    --surface-2: #17211e;
    --line: rgba(255, 255, 255, 0.1);
    --accent: #7cf3b7;
    --accent-ink: #07120d;
    --warning: #ffcb6b;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #09100e;
    color: var(--ink);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 75% 0%, #17342a 0, transparent 38rem), #09100e; }
a { color: inherit; }
.topbar { min-height: 76px; padding: 0 4vw; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); backdrop-filter: blur(18px); }
.brand { display: inline-flex; gap: 12px; align-items: center; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: var(--accent-ink); background: var(--accent); font-weight: 900; }
.brand strong, .brand small { display: block; }
.brand small { color: var(--muted); font-size: 11px; margin-top: 2px; }
.target-pill { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.035); font-size: 13px; }
.target-pill span { color: var(--muted); }
.shell { width: min(1180px, 92vw); margin: 0 auto; padding: 8vh 0 10vh; }
.hero { min-height: 58vh; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .7fr); gap: 8vw; align-items: center; }
.eyebrow { color: var(--accent); text-transform: uppercase; letter-spacing: .16em; font-size: 12px; font-weight: 800; }
h1 { max-width: 820px; margin: 18px 0; font-size: clamp(48px, 7vw, 94px); letter-spacing: -.065em; line-height: .94; }
.lede { max-width: 700px; color: #c5cec9; font-size: clamp(17px, 2vw, 22px); line-height: 1.55; }
.hero-actions { display: flex; gap: 12px; margin-top: 32px; }
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0 18px; border-radius: 10px; text-decoration: none; font-weight: 750; }
.button.primary { background: var(--accent); color: var(--accent-ink); }
.button.secondary { border: 1px solid var(--line); background: rgba(255,255,255,.04); }
.status-card { display: flex; gap: 14px; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(145deg, rgba(255,255,255,.07), rgba(255,255,255,.025)); box-shadow: 0 24px 80px rgba(0,0,0,.25); }
.status-card p { color: var(--muted); margin: 7px 0 0; line-height: 1.5; }
.status-dot { flex: 0 0 auto; width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; background: var(--warning); box-shadow: 0 0 18px var(--warning); }
.capability-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.capability-grid article { min-height: 210px; padding: 24px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.018); }
.capability-grid article > span { color: var(--accent); font: 700 12px/1 ui-monospace, monospace; }
.capability-grid h2 { margin: 38px 0 10px; font-size: 20px; }
.capability-grid p { margin: 0; color: var(--muted); line-height: 1.55; }
@media (max-width: 820px) {
    .hero { grid-template-columns: 1fr; gap: 28px; padding: 8vh 0; }
    .capability-grid { grid-template-columns: repeat(2, 1fr); }
    .target-pill span { display: none; }
}
@media (max-width: 500px) {
    .topbar { padding: 0 20px; }
    .shell { width: min(100% - 32px, 1180px); }
    .capability-grid { grid-template-columns: 1fr; }
    .hero-actions { flex-direction: column; }
}

button, input { font: inherit; }
button { color: inherit; }
.private-badge, .status { display: inline-flex; align-items: center; gap: 7px; width: fit-content; padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 12px; font-weight: 750; }
.auth-body { background: radial-gradient(circle at 50% -10%, #1b4938 0, transparent 42rem), #09100e; }
.public-topbar { position: relative; z-index: 1; }
.auth-shell { width: min(520px, calc(100% - 32px)); min-height: calc(100vh - 76px); margin: 0 auto; display: grid; place-items: center; padding: 56px 0; }
.auth-card { width: 100%; padding: clamp(28px, 6vw, 48px); border: 1px solid var(--line); border-radius: 24px; background: rgba(17, 24, 22, .86); box-shadow: 0 32px 100px rgba(0,0,0,.35); backdrop-filter: blur(18px); }
.auth-card.wide { width: min(680px, calc(100vw - 32px)); margin-left: 50%; transform: translateX(-50%); }
.auth-card h1 { margin: 12px 0 16px; font-size: clamp(34px, 7vw, 54px); letter-spacing: -.045em; line-height: 1; }
.auth-copy, .fine-print { color: var(--muted); line-height: 1.6; }
.fine-print { margin: 24px 0 0; font-size: 12px; }
.stack-form { display: grid; gap: 18px; margin-top: 30px; }
.stack-form.compact { max-width: 360px; }
.stack-form label { display: grid; gap: 8px; color: #d7dfdb; font-size: 13px; font-weight: 700; }
.stack-form input { min-height: 48px; width: 100%; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: rgba(0,0,0,.22); outline: none; }
.stack-form textarea { width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: rgba(0,0,0,.22); outline: none; resize: vertical; }
.stack-form textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,243,183,.14); }
.stack-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,243,183,.14); }
.stack-form .button { border: 0; cursor: pointer; }
.notice { margin: 18px 0; padding: 13px 15px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.04); line-height: 1.5; }
.notice.error { border-color: rgba(255,112,112,.38); color: #ffd2d2; background: rgba(160,30,30,.15); }
.notice.success { border-color: rgba(124,243,183,.35); }
.secret-panel { display: grid; gap: 8px; margin: 24px 0; padding: 18px; border: 1px solid rgba(124,243,183,.28); border-radius: 14px; background: rgba(124,243,183,.06); }
.secret-panel span { color: var(--muted); font-size: 12px; }
.secret-panel code, .wrap-code { overflow-wrap: anywhere; color: var(--accent); font-size: 15px; letter-spacing: .08em; }
details { color: var(--muted); }
details summary { cursor: pointer; margin-bottom: 10px; }
.recovery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 28px 0; }
.recovery-grid code { padding: 12px; border: 1px solid var(--line); border-radius: 9px; text-align: center; background: rgba(0,0,0,.2); }

.app-body { background: #0a100e; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 238px; display: flex; flex-direction: column; padding: 22px 16px; border-right: 1px solid var(--line); background: #0c1311; overflow-y: auto; }
.sidebar-brand { padding: 0 8px 22px; }
.side-nav { display: grid; gap: 3px; }
.side-nav a { min-height: 42px; display: flex; align-items: center; gap: 11px; padding: 0 10px; border-radius: 9px; color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 680; }
.side-nav a > span { width: 25px; height: 25px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 7px; color: #bac6c0; font: 700 9px/1 ui-monospace, monospace; }
.side-nav a:hover, .side-nav a.active { color: var(--ink); background: rgba(255,255,255,.06); }
.side-nav a.active > span { color: var(--accent-ink); border-color: var(--accent); background: var(--accent); }
.logout-form { margin-top: auto; padding: 22px 10px 4px; }
.text-button { padding: 0; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-weight: 700; }
.text-button:hover { color: var(--ink); }
.app-frame { min-height: 100vh; margin-left: 238px; }
.app-topbar { min-height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 0 30px; border-bottom: 1px solid var(--line); background: rgba(10,16,14,.9); backdrop-filter: blur(18px); }
.app-topbar .eyebrow { margin: 0 0 4px; font-size: 9px; }
.topbar-meta { display: flex; align-items: center; gap: 12px; }
.avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: var(--accent-ink); background: var(--accent); font-weight: 900; }
.app-main { width: min(1380px, 100%); margin: 0 auto; padding: 34px 32px 70px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin-bottom: 28px; }
.page-heading .eyebrow { margin: 0 0 10px; }
.page-heading h1 { margin: 0; max-width: 780px; font-size: clamp(38px, 5vw, 68px); letter-spacing: -.055em; line-height: .98; }
.page-heading > div > p:last-child { max-width: 760px; margin: 16px 0 0; color: var(--muted); font-size: 16px; line-height: 1.6; }
.module-heading { align-items: center; }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.metric-card, .panel { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.metric-card { min-height: 174px; padding: 20px; }
.metric-card > span { color: var(--muted); font-size: 12px; font-weight: 720; }
.metric-card > strong { display: block; margin: 22px 0 9px; font-size: 38px; letter-spacing: -.04em; }
.metric-card p { margin: 0; color: var(--muted); line-height: 1.45; }
.dashboard-grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: 12px; margin-top: 12px; }
.panel { padding: 24px; }
.audit-launch { display: grid; grid-template-columns: minmax(0,1fr) minmax(280px,420px); gap: 36px; align-items: start; }
.table-panel { margin-top: 20px; }
.table-scroll { overflow-x: auto; margin-top: 18px; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
td { color: #dce5e1; font-size: 13px; }
td small { display: block; max-width: 380px; margin-top: 4px; color: var(--muted); overflow-wrap: anywhere; }
.status.danger { color: #ffd2d2; border-color: rgba(255,112,112,.38); background: rgba(160,30,30,.15); }
.muted { color: var(--muted); }
.panel-head { display: flex; justify-content: space-between; gap: 20px; }
.panel h2 { margin: 4px 0 12px; font-size: 24px; letter-spacing: -.025em; }
.status.warning { color: var(--warning); border-color: rgba(255,203,107,.25); }
.check-list { display: grid; gap: 12px; margin: 24px 0 0; padding: 0; list-style: none; }
.check-list li { position: relative; padding-left: 27px; color: var(--muted); }
.check-list li::before { content: ''; position: absolute; left: 0; top: 2px; width: 14px; height: 14px; border: 1px solid var(--line); border-radius: 50%; }
.check-list li.done { color: #d7dfdb; }
.check-list li.done::before { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 3px #111816; }
.accent-panel { background: linear-gradient(145deg, rgba(124,243,183,.12), rgba(17,24,22,.8)); }
.accent-panel > p:not(.eyebrow) { color: var(--muted); line-height: 1.6; }
.accent-panel a { display: inline-block; margin-top: 18px; color: var(--accent); font-weight: 780; }
.empty-state { min-height: 360px; display: grid; place-items: center; align-content: center; text-align: center; }
.empty-state p { max-width: 620px; color: var(--muted); line-height: 1.6; }
.empty-glyph { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 15px; color: var(--accent-ink); background: var(--accent); font-size: 24px; font-weight: 900; }

@media (max-width: 1050px) {
    .sidebar { width: 82px; }
    .sidebar-brand > span:last-child, .side-nav a { font-size: 0; }
    .side-nav a { justify-content: center; padding: 0; }
    .side-nav a > span { font-size: 9px; }
    .app-frame { margin-left: 82px; }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .audit-launch { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
    .sidebar { position: static; width: 100%; height: auto; padding: 10px 12px; flex-direction: row; align-items: center; overflow-x: auto; }
    .sidebar-brand, .logout-form { display: none; }
    .side-nav { display: flex; }
    .side-nav a { flex: 0 0 40px; }
    .app-frame { margin-left: 0; }
    .app-topbar { padding: 0 16px; }
    .target-pill { display: none; }
    .app-main { padding: 28px 16px 60px; }
    .page-heading { align-items: stretch; flex-direction: column; }
    .metric-grid { grid-template-columns: 1fr; }
    .recovery-grid { grid-template-columns: 1fr; }
}
