:root {
    --bg-app: #090d16;
    --bg-card: #0f172a;
    --bg-card-border: #1e293b;
    --primary: #2563eb;
    --primary-light: #60a5fa;
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-app);
    color: var(--text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 13px;
    line-height: 1.45;
    user-select: none;
    -webkit-font-smoothing: antialiased;
}

.sidebar-wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Header */
.app-header {
    background: #0d1424;
    border-bottom: 1px solid var(--bg-card-border);
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-shield {
    font-size: 18px;
}

.brand-title {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--text-main);
}

.brand-sub {
    font-size: 10px;
    color: var(--primary-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.firm-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 9999px;
    background: rgba(37, 99, 235, 0.15);
    color: var(--primary-light);
    border: 1px solid rgba(59, 130, 246, 0.3);
    cursor: pointer;
    white-space: nowrap;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Action Panel */
.action-panel {
    padding: 12px 14px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--bg-card-border);
}

.action-instructions {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 10px;
    line-height: 1.35;
}

.btn-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    border: 1px solid #3b82f6;
    border-radius: 6px;
    padding: 9px 12px;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-secondary {
    background: #1e293b;
    color: var(--text-main);
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-secondary:hover {
    background: #273549;
}

/* Metrics Panel */
.metrics-panel {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 10px 14px;
    background: #0b1120;
    border-bottom: 1px solid var(--bg-card-border);
}

.metric-chip {
    text-align: center;
    padding: 6px 4px;
    border-radius: 6px;
    border: 1px solid #1e293b;
}

.chip-val {
    display: block;
    font-size: 14px;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
}

.chip-lbl {
    display: block;
    font-size: 9px;
    text-transform: uppercase;
    color: var(--text-dim);
    letter-spacing: 0.04em;
    margin-top: 1px;
}

.chip-total { background: #131b2e; color: var(--text-main); }
.chip-verified { background: rgba(16, 185, 129, 0.1); border-color: rgba(16, 185, 129, 0.3); color: var(--success); }
.chip-rejected { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.3); color: var(--danger); }
.chip-phantom { background: rgba(245, 158, 11, 0.1); border-color: rgba(245, 158, 11, 0.3); color: var(--warning); }

/* Cert Bar */
.cert-bar {
    padding: 8px 14px;
    background: #0d1527;
    border-bottom: 1px solid var(--bg-card-border);
}

.btn-cert {
    width: 100%;
    background: rgba(37, 99, 235, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.35);
    color: #93c5fd;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-cert:hover {
    background: rgba(37, 99, 235, 0.25);
    color: #fff;
}

/* Findings Container */
.findings-container {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px;
}

.findings-empty {
    text-align: center;
    padding: 40px 10px;
    color: var(--text-muted);
}

.empty-icon { font-size: 32px; margin-bottom: 10px; opacity: 0.8; }
.empty-title { font-size: 13px; font-weight: 700; color: var(--text-main); margin-bottom: 4px; }
.empty-desc { font-size: 11px; line-height: 1.4; color: var(--text-dim); }

/* Finding Card */
.finding-card {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.finding-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 6px;
}

.finding-cite {
    font-size: 12px;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-main);
}

.verdict-tag {
    font-size: 10px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tag-verified { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4); box-shadow: 0 0 10px rgba(16, 185, 129, 0.15); }
.tag-rejected { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.4); box-shadow: 0 0 10px rgba(239, 68, 68, 0.15); }
.tag-phantom { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); box-shadow: 0 0 10px rgba(245, 158, 11, 0.15); }
.tag-locked { background: #1e293b; color: #94a3b8; border: 1px solid #334155; }

.finding-meta {
    font-size: 10px;
    color: var(--text-dim);
    margin-bottom: 6px;
}

.finding-prop {
    font-size: 11px;
    font-style: italic;
    color: #cbd5e1;
    background: #090e1c;
    padding: 6px 8px;
    border-radius: 4px;
    margin-bottom: 6px;
    border-left: 2px solid var(--primary-light);
    line-height: 1.35;
}

.finding-holding {
    font-size: 10.5px;
    color: #93c5fd;
    background: rgba(37, 99, 235, 0.08);
    padding: 6px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
    line-height: 1.35;
}

.finding-reason {
    font-size: 10.5px;
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.08);
    padding: 6px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
    border-left: 2px solid var(--danger);
}

.finding-actions {
    display: flex;
    gap: 6px;
}

.btn-locate {
    flex: 1;
    background: #1e293b;
    border: 1px solid #334155;
    color: #e2e8f0;
    border-radius: 4px;
    padding: 5px 8px;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.btn-locate:hover {
    background: #2a384e;
    color: #fff;
}

.btn-reporter {
    flex: 1;
    background: rgba(37, 99, 235, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.35);
    color: #93c5fd;
    border-radius: 4px;
    padding: 5px 8px;
    font-size: 10px;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.15s ease;
}

.btn-reporter:hover {
    background: rgba(37, 99, 235, 0.28);
    color: #fff;
    border-color: #60a5fa;
}

/* Spinner */
.spinner-container {
    padding: 20px 14px;
    text-align: center;
    background: #0d1527;
    border-bottom: 1px solid var(--bg-card-border);
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(59, 130, 246, 0.2);
    border-top-color: var(--primary-light);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 8px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.spinner-text {
    font-size: 11px;
    color: var(--text-muted);
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: 12px;
    padding: 16px;
    width: 100%;
    max-width: 320px;
    position: relative;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
}

.modal-badge {
    font-size: 9px;
    font-weight: 700;
    color: var(--primary-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.modal-title {
    font-size: 14px;
    font-weight: 800;
    margin-bottom: 4px;
}

.modal-desc {
    font-size: 10.5px;
    color: var(--text-muted);
    margin-bottom: 10px;
    line-height: 1.35;
}

.sec-callout {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 10px;
    color: #a7f3d0;
    margin-bottom: 10px;
    line-height: 1.3;
}

.m-input {
    width: 100%;
    background: #090e1c;
    border: 1px solid var(--bg-card-border);
    border-radius: 5px;
    padding: 6px 8px;
    color: var(--text-main);
    font-size: 11px;
    margin-bottom: 8px;
    outline: none;
}

.m-input.mono { font-family: 'JetBrains Mono', monospace; }
.input-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.full-width { width: 100%; }

/* Footer */
.app-footer {
    padding: 8px 14px;
    background: #090d16;
    border-top: 1px solid var(--bg-card-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    color: var(--text-dim);
}

.footer-link {
    color: var(--primary-light);
    text-decoration: none;
}
