/* Shared theme: all application pages, forms, dialogs and authentication. */
:root[data-theme="dark"]{color-scheme:dark;--bg:#101318;--surface:#181d25;--surface-raised:#202733;--surface-hover:#252e3c;--border:#303a49;--border-soft:#262f3c;--text:#e6edf7;--text-secondary:#b9c5d6;--muted:#91a1b8;--accent:#86aeff;--accent-fill:#416ee6;--accent-wash:#253653;--success:#7ed9b4;--success-wash:#1d3831;--warning:#f1cd7e;--warning-wash:#403723;--danger:#ff9caa;--danger-wash:#412a34;--chart-total:#e4ebf5;--chart-grid:#303a49;--heatmap-base:#181f2c;--heatmap-grid:#303c50;background:var(--bg);color:var(--text);font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
[data-theme="dark"] body{background:var(--bg);color:var(--text)}
[data-theme="dark"] :is(button,input,select,textarea){color:var(--text);background:var(--surface-raised);border-color:var(--border);border-radius:7px;accent-color:var(--accent-fill)}
[data-theme="dark"] :is(input,textarea)::placeholder{color:var(--muted);opacity:1}
[data-theme="dark"] input:read-only{color:var(--text-secondary)}
[data-theme="dark"] button:hover{background:var(--surface-hover);border-color:#536882}
[data-theme="dark"] :is(button,a,input,select,textarea,summary):focus-visible{outline:2px solid var(--accent);outline-offset:3px}
[data-theme="dark"] button:disabled{opacity:.5;cursor:not-allowed}
[data-theme="dark"] :is(.primary,.rp-primary){background:var(--accent-fill);border-color:var(--accent-fill);color:#fff;box-shadow:none}
[data-theme="dark"] :is(.primary,.rp-primary):hover{background:#507ef5;border-color:#507ef5}
[data-theme="dark"] :is(.danger,.rp-danger){background:var(--danger-wash);border-color:#775061;color:var(--danger)}
[data-theme="dark"] .ghost{background:transparent}
[data-theme="dark"] :is(a,.bot-name){color:var(--accent)}
[data-theme="dark"] .bot-name{color:var(--accent)!important}
[data-theme="dark"] :is(.muted,.empty,td small,.stat span,.toolbar p,.insight span,.integration-status,.session-full-id,.session-pagination){color:var(--muted)}
[data-theme="dark"] .topbar{height:68px;background:#141920;border-bottom:1px solid var(--border);color:var(--text);gap:28px;box-shadow:none}
[data-theme="dark"] .brand-mark{background:#365cca;color:#fff;box-shadow:none;border:1px solid #6584df;border-radius:8px;font-size:22px}
[data-theme="dark"] .brand-mark.small{width:34px;height:34px;font-size:17px}
[data-theme="dark"] .brand strong{font-size:17px;letter-spacing:-.025em;line-height:1.15}
[data-theme="dark"] .brand small{display:block;font-size:10px;font-weight:500;letter-spacing:.03em;color:var(--muted);margin-top:4px}
[data-theme="dark"] .topbar :is(.nav,.ghost){color:var(--text-secondary);border-color:var(--border);font-size:13px}
[data-theme="dark"] .topbar :is(.nav.active,.nav:hover){color:var(--accent);background:var(--accent-wash)}
[data-theme="dark"] .user{color:var(--muted);font-size:12px}
[data-theme="dark"] :is(.panel,.stat,.login-card,dialog){background:var(--surface);color:var(--text);border:1px solid var(--border);box-shadow:none;border-radius:10px}
[data-theme="dark"] main:not(.login-card){max-width:1680px}
[data-theme="dark"] :is(.toolbar h1,.detail-head h1){letter-spacing:-.025em;font-weight:650}
[data-theme="dark"] .toolbar p{font-size:13px;line-height:1.6}
[data-theme="dark"] :is(.stat-filter,.project-item){background:var(--surface);color:var(--text);border-color:var(--border)}
[data-theme="dark"] :is(.stat-filter.active,.project-item.active,.bot-chip.active,#bots tbody tr.active){background:var(--accent-wash);border-color:#617fae;box-shadow:none}
[data-theme="dark"] .stat-filter:hover{background:var(--surface-raised)}
[data-theme="dark"] :is(.stat strong,.insight strong){font-size:24px;letter-spacing:-.03em}
[data-theme="dark"] .stat{padding:18px 20px}
[data-theme="dark"] :is(table th,table td){border-color:var(--border-soft)}
[data-theme="dark"] th{background:#1d2430;color:var(--muted)}
[data-theme="dark"] tbody tr:hover{background:var(--surface-raised)}
[data-theme="dark"] .insight{background:var(--surface-raised);border-color:var(--border-soft);border-radius:7px}
[data-theme="dark"] .insight.alert{background:var(--danger-wash);border-color:#6a4553;color:var(--danger)}
[data-theme="dark"] :is(.form-grid label,.integration-fields label,.integration-test>label,.integration-toggle,.traffic-controls>label:not(.integration-toggle),.login-card label){color:var(--text-secondary)}
[data-theme="dark"] :is(.form-grid input,.form-grid select,.form-grid textarea,.integration-fields input,.integration-test input,.filters select,.traffic-controls input:not([type=checkbox]),.traffic-controls select,.replay-toolbar select,.login-card input,#access-link input,.api-secret input){background:var(--bg);color:var(--text);border-color:var(--border)}
[data-theme="dark"] :is(.project-item small,.detail-head p,.kv span,.reasons small,.login-card p){color:var(--muted)}
[data-theme="dark"] :is(.integration-section,.integration-test,.kv,.reasons>div,.outcome-row,hr){border-color:var(--border-soft)}
[data-theme="dark"] :is(.snippet,canvas){background:var(--bg);border-color:var(--border);border-radius:7px}
[data-theme="dark"] .snippet{color:#c6d9f7;padding:16px;line-height:1.6}
[data-theme="dark"] :is(.detail-grid section,.definition-step,.funnel-result){border-color:var(--border);background:var(--surface)}
[data-theme="dark"] dialog{box-shadow:0 24px 90px #0009}
[data-theme="dark"] dialog::backdrop{background:#070b12c9;backdrop-filter:blur(3px)}
[data-theme="dark"] .dialog-close{background:var(--surface-raised);color:var(--text-secondary)}
[data-theme="dark"] :is(.badge,.badge.known_bot){background:#2b3547;color:#bbcbee}
[data-theme="dark"] :is(.badge.human,.risk.low){background:var(--success-wash);color:var(--success)}
[data-theme="dark"] :is(.badge.suspicious,.risk.medium){background:var(--warning-wash);color:var(--warning)}
[data-theme="dark"] :is(.badge.bot,.risk.high){background:var(--danger-wash);color:var(--danger)}
[data-theme="dark"] .bot-filter{color:var(--accent);background:var(--accent-wash)}
[data-theme="dark"] :is(.toast,.notice){background:var(--surface-raised);color:var(--text);border:1px solid #53637a;box-shadow:0 8px 30px #0005}
[data-theme="dark"] :is(.toast.error,.notice.error){background:var(--danger-wash);color:var(--danger);border-color:#88505e}
[data-theme="dark"] .login-body{background:var(--bg)}
[data-theme="dark"] .login-card{padding:32px;width:min(420px,92vw);box-shadow:0 18px 70px #0004}
[data-theme="dark"] .login-card .brand-mark{width:48px;height:48px}
[data-theme="dark"] .login-card h1{font-size:24px;letter-spacing:-.03em}
[data-theme="dark"] .login-card button{margin-top:6px}
[data-theme="dark"] #replay-frame{background:var(--bg)}
[data-theme="dark"] ::selection{background:#4266a9;color:#fff}
[data-theme="dark"] *{scrollbar-color:#46556b #151a22;scrollbar-width:thin}
@media(max-width:900px){[data-theme="dark"] .toolbar{align-items:stretch;flex-direction:column}[data-theme="dark"] .filters{width:100%}}
@media(max-width:650px){[data-theme="dark"] .topbar{padding:0 10px;gap:8px}[data-theme="dark"] .topbar nav{min-width:0;overflow:auto;scrollbar-width:none;white-space:nowrap;flex:1}[data-theme="dark"] .brand strong{display:none}[data-theme="dark"] .topbar .nav{padding:9px 8px;flex:none}[data-theme="dark"] .topbar .ghost{padding:8px}[data-theme="dark"] .stats{grid-template-columns:repeat(2,minmax(0,1fr))}}
[data-theme="dark"] .topbar .nav{background:transparent;border-color:transparent}
[data-theme="dark"] .topbar .nav.active,[data-theme="dark"] .topbar .nav:hover{background:var(--accent-wash)}
