:root {
    --primary: #1a56db;
    --primary-dark: #1042b0;
    --danger: #dc2626;
    --warning: #f59e0b;
    --success: #16a34a;
    --info: #0891b2;
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* Layout */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 250px;
    background: #0f172a;
    color: #e2e8f0;
    padding: 0;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.sidebar-menu-header {
    padding: 16px;
    text-align: center;
    border-bottom: 1px solid #1e293b;
}
.sidebar-menu-header img {
    max-width: 100%;
    max-height: 80px;
    object-fit: contain;
}
.sidebar-logo {
    padding: 20px 24px;
    border-bottom: 1px solid #1e293b;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-logo .logo-icon {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}
.sidebar-logo .logo-icon-img {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: contain;
}

.sidebar-nav { padding: 16px 0; flex: 1; overflow-y: auto; }

.sidebar-nav > a,
.sidebar-nav .nav-parent {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 24px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.15s;
    cursor: pointer;
}

.sidebar-nav > a:hover, .sidebar-nav > a.active,
.sidebar-nav .nav-parent:hover, .sidebar-nav .nav-parent.active {
    color: #fff;
    background: rgba(255,255,255,0.08);
}

.sidebar-nav > a.active,
.sidebar-nav .nav-parent.active { border-left: 3px solid var(--primary); }

/* Nav groups & submenus */
.nav-group { position: relative; }

.nav-arrow {
    margin-left: auto;
    font-size: 10px;
    transition: transform 0.2s;
    opacity: 0.5;
}

.nav-group.open > .nav-parent .nav-arrow {
    transform: rotate(180deg);
    opacity: 0.8;
}

.nav-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
    background: rgba(0,0,0,0.15);
}

.nav-group.open > .nav-submenu {
    max-height: 300px;
}

.nav-submenu a {
    display: block;
    padding: 6px 24px 6px 44px;
    color: #64748b;
    text-decoration: none;
    font-size: 12px;
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-submenu a:hover {
    color: #cbd5e1;
    background: rgba(255,255,255,0.04);
}

.sidebar-separator {
    height: 1px;
    background: rgba(255,255,255,0.12);
    margin: 8px 24px;
}
.sidebar-label {
    padding: 8px 24px 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}

.sidebar-credits {
    padding: 16px 24px;
    border-top: 1px solid rgba(255,255,255,0.12);
    margin-top: auto;
}
.sidebar-credits-title {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 10px;
}
.sidebar-credit-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 4px;
}
.sidebar-credit-bar {
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    margin-bottom: 10px;
    overflow: hidden;
}
.sidebar-credit-bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
    transition: width 0.3s ease;
}
.sidebar-credit-bar-fill.bar-warning { background: var(--warning); }
.sidebar-credit-bar-fill.bar-danger { background: var(--danger); }
.sidebar-buy-more {
    display: block;
    margin-top: 8px;
    padding: 6px 12px;
    background: var(--warning);
    color: #1a1a1a;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    border-radius: 4px;
    text-decoration: none;
    transition: background 0.15s;
}
.sidebar-buy-more:hover {
    background: #eab308;
    color: #1a1a1a;
}
.sidebar-renewal-block {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 10px;
}
.sidebar-renewal-date {
    font-size: 13px;
    font-weight: 600;
    color: #e2e8f0;
    text-align: center;
    margin-bottom: 2px;
}
.sidebar-renewal-detail {
    font-size: 11px;
    color: #94a3b8;
    text-align: center;
}
.sidebar-account-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.sidebar-tier-badge {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 2px 8px;
    border-radius: 3px;
    background: rgba(255,255,255,0.1);
    color: #94a3b8;
}
.sidebar-tier-badge.tier-basic { background: rgba(59,130,246,0.2); color: #60a5fa; }
.sidebar-tier-badge.tier-advanced { background: rgba(139,92,246,0.2); color: #a78bfa; }
.sidebar-tier-badge.tier-enterprise { background: rgba(245,158,11,0.2); color: #fbbf24; }
.sidebar-tier-badge.tier-free_plus { background: rgba(16,185,129,0.2); color: #34d399; }
.sidebar-tier-badge.tier-basic_plus { background: rgba(59,130,246,0.3); color: #93c5fd; }
.sidebar-tier-badge.tier-advanced_plus { background: rgba(139,92,246,0.3); color: #c4b5fd; }
.sidebar-tier-badge.tier-enterprise_plus { background: rgba(245,158,11,0.3); color: #fcd34d; }
.sidebar-member-since {
    font-size: 10px;
    color: #64748b;
}

.main-content {
    margin-left: 250px;
    flex: 1;
    padding: 32px 32px 72px;
}

/* Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 700;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.card-header h2 { font-size: 16px; font-weight: 600; }

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.stat-card .stat-label {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    margin-top: 4px;
}

/* Compact stat card (for inline metrics) */
.stat-card.stat-compact { padding: 12px; }
.stat-card.stat-compact .stat-value { font-size: 20px; }

/* Monitoring pills */
.monitor-pill {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 14px;
    flex-wrap: wrap;
}
.monitor-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #9ca3af;
    flex-shrink: 0;
}
.monitor-dot.ok { background: #16a34a; }
.monitor-dot.warning { background: #f59e0b; }
.monitor-dot.error { background: #dc2626; }
.monitor-detail {
    width: 100%;
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Monitoring charts (pure CSS bar charts) */
.monitor-chart { padding: 16px; min-height: 120px; }
.bar-chart { display: flex; align-items: flex-end; gap: 4px; height: 100px; }
.bar-chart .bar {
    flex: 1;
    background: var(--primary);
    border-radius: 3px 3px 0 0;
    min-width: 12px;
    position: relative;
    transition: height 0.3s;
}
.bar-chart .bar:hover { opacity: 0.8; }
.bar-chart .bar-label {
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    color: var(--text-muted);
    white-space: nowrap;
}
.bar-chart .bar-value {
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

/* Horizontal severity bars */
.severity-bars { display: flex; flex-direction: column; gap: 10px; }
.severity-bar-row { display: flex; align-items: center; gap: 10px; }
.severity-bar-label { width: 70px; font-size: 13px; font-weight: 600; text-transform: capitalize; }
.severity-bar-track { flex: 1; height: 24px; background: #f1f5f9; border-radius: 4px; overflow: hidden; }
.severity-bar-fill { height: 100%; border-radius: 4px; transition: width 0.3s; display: flex; align-items: center; justify-content: flex-end; padding-right: 8px; font-size: 11px; font-weight: 600; color: #fff; }
.severity-bar-count { width: 50px; text-align: right; font-size: 13px; font-weight: 600; }

/* Status dots for scan status chart */
.status-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.status-item { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: #f8fafc; border-radius: 8px; }
.status-item .status-count { font-size: 20px; font-weight: 700; }
.status-item .status-name { font-size: 12px; color: var(--text-muted); text-transform: capitalize; }

/* Alert banners */
.monitor-alert { padding: 10px 16px; border-radius: 8px; margin-bottom: 8px; font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.monitor-alert.alert-critical { background: #fef2f2; border: 1px solid #dc2626; color: #991b1b; }
.monitor-alert.alert-warning { background: #fef3c7; border: 1px solid #f59e0b; color: #92400e; }
.monitor-alert.alert-info { background: #eff6ff; border: 1px solid #3b82f6; color: #1e40af; }

/* Score badge */
.score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}

.score-badge.critical { background: var(--danger); }
.score-badge.high { background: #ea580c; }
.score-badge.medium { background: var(--warning); color: #000; }
.score-badge.low { background: var(--success); }
.score-badge.pass { background: var(--success); }

/* Severity labels */
.severity {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.severity.critical { background: #fef2f2; color: #dc2626; }
.severity.high { background: #fff7ed; color: #ea580c; }
.severity.medium { background: #fffbeb; color: #d97706; }
.severity.low { background: #f0fdf4; color: #16a34a; }
.severity.pass { background: #f0fdf4; color: #16a34a; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn:disabled, .btn[disabled] { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg); }
.btn-sm { padding: 4px 12px; font-size: 12px; }

/* Forms */
.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
    max-width: 100%;
}

.form-group textarea {
    resize: vertical;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,86,219,0.1);
}

/* Password toggle */
.password-wrap { position: relative; }
.password-wrap input { padding-right: 40px; }
.password-toggle {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer; padding: 4px;
    color: var(--text-muted); display: flex; align-items: center;
}
.password-toggle:hover { color: var(--text); }
.password-toggle svg { width: 18px; height: 18px; }

/* Tables */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

th, td {
    padding: 10px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

th { font-weight: 600; color: var(--text-muted); font-size: 12px; text-transform: uppercase; }
th.sortable-th { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable-th:hover { color: var(--primary); }
th.sortable-th .sort-arrow { font-size: 10px; margin-left: 2px; opacity: 0.4; }
th.sortable-th.sort-asc .sort-arrow::after { content: '\25B2'; opacity: 1; }
th.sortable-th.sort-desc .sort-arrow::after { content: '\25BC'; opacity: 1; }
tr:hover { background: #f8fafc; }

/* Reschedule link */
a.reschedule-link { text-decoration: none; border-bottom: 1px dashed var(--text-muted); cursor: pointer; }
a.reschedule-link:hover { color: var(--primary); border-bottom-color: var(--primary); }

/* Doc provider cards */
.doc-provider-cards {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.doc-provider-card {
    flex: 1;
    min-width: 200px;
    max-width: 320px;
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    background: #fff;
}
.doc-provider-card:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(26, 86, 219, 0.1);
}
.doc-provider-card.selected {
    border-color: var(--primary);
    background: #f0f5ff;
    box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.15);
}
.doc-provider-card .provider-name {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}
.doc-provider-card .provider-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 14px;
}
.doc-provider-card .provider-costs {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.doc-provider-card .cost-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    padding: 4px 0;
    border-top: 1px solid var(--border);
}
.doc-provider-card .cost-line:first-child {
    border-top: none;
}
.doc-provider-card .cost-label {
    color: var(--text);
}
.doc-provider-card .cost-credits {
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
}

/* Drop zone */
.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--primary);
    background: rgba(26,86,219,0.04);
}

.drop-zone .drop-icon { font-size: 36px; margin-bottom: 8px; }
.drop-zone .drop-text { font-size: 14px; }
.drop-zone .drop-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* Issue cards */
.issue-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    border-left: 4px solid;
}

.issue-card.critical { border-left-color: var(--danger); }
.issue-card.high { border-left-color: #ea580c; }
.issue-card.medium { border-left-color: var(--warning); }
.issue-card.low { border-left-color: var(--success); }

.issue-card .issue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.issue-card .issue-title { font-weight: 600; font-size: 14px; }
.issue-card .issue-rule { font-size: 12px; color: var(--text-muted); }
.issue-card .issue-excerpt {
    background: #f8fafc;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-style: italic;
    margin: 8px 0;
}
.issue-card .issue-explanation { font-size: 13px; margin-bottom: 8px; }
.issue-card .issue-recommendation {
    font-size: 13px;
    color: var(--primary);
    font-weight: 500;
}

/* Login page */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.login-box {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-lg);
}

.login-box h1 {
    font-size: 24px;
    margin-bottom: 4px;
    text-align: center;
}

.login-box .subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 24px;
}

.login-box .error-msg {
    background: #fef2f2;
    color: #dc2626;
    padding: 8px 12px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 16px;
    display: none;
}

.login-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border);
}

.login-tabs button {
    flex: 1;
    padding: 10px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.login-tabs button.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Status */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-dot.pending { background: var(--text-muted); }
.status-dot.crawling, .status-dot.analysing, .status-dot.processing { background: var(--warning); animation: pulse 1.5s infinite; }
.status-dot.completed { background: var(--success); }
.status-dot.failed { background: var(--danger); }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Toast notifications */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: var(--radius);
    color: #fff;
    font-size: 14px;
    z-index: 1000;
    max-width: 420px;
    animation: slideIn 0.3s ease;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

@keyframes slideIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.modal {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    width: 480px;
    max-width: 90vw;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal h2 { font-size: 18px; margin-bottom: 16px; }
.modal .modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }

/* Login page additions */
.login-logo-wrap { text-align: center; margin-bottom: 8px; }
.login-logo-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 48px; height: 48px; background: #1a56db; border-radius: 10px;
    color: #fff; font-size: 22px; font-weight: 700;
}
.login-logo-img {
    width: 48px; height: 48px; border-radius: 10px; object-fit: contain;
}
.login-disclaimer { text-align: center; font-size: 12px; color: var(--text-muted); margin-top: 20px; }
.btn-full { width: 100%; justify-content: center; padding: 10px; }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }
.signup-paused-msg {
    background: #fef3c7; color: #92400e; padding: 14px 16px; border-radius: var(--radius);
    font-size: 14px; text-align: center; margin-bottom: 8px; line-height: 1.5;
}
.disclaimer-check { display: flex; align-items: flex-start; gap: 10px; margin: 16px 0 4px; }
.disclaimer-check input[type="checkbox"] { margin-top: 3px; flex-shrink: 0; width: 16px; height: 16px; }
.disclaimer-check label { font-size: 12px; color: var(--text-muted); line-height: 1.5; cursor: pointer; }

/* Scan source badges */
.badge-manual { background: var(--bg); color: var(--text-muted); padding: 2px 8px; border-radius: 4px; font-size: 11px; white-space: nowrap; }
.badge-scheduled { background: #e8f4fd; color: #0369a1; padding: 2px 8px; border-radius: 4px; font-size: 11px; white-space: nowrap; }

/* General badges */
.badge { padding: 2px 8px; border-radius: 4px; font-size: 11px; white-space: nowrap; font-weight: 600; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info { background: #e0f2fe; color: #075985; }
.badge-secondary { background: #f1f5f9; color: #475569; }
.badge-muted { background: #f1f5f9; color: #94a3b8; }

/* Compact table for differential summaries */
.table-compact { width: 100%; border-collapse: collapse; font-size: 13px; }
.table-compact th, .table-compact td { padding: 4px 8px; border-bottom: 1px solid var(--border); text-align: left; }
.table-compact th { font-weight: 600; color: var(--text-muted); }

/* Button group for scan mode toggle */
.btn-group { display: inline-flex; gap: 2px; }

/* Report page */
.report-container { max-width: 900px; margin: 0 auto; padding: 32px; }
.report-header { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }

/* Utility classes (replace inline styles) */
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-sm { font-size: 14px; }
.text-xs { font-size: 13px; }
.text-bold { font-weight: 600; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mt-16 { margin-top: 16px; }

/* Form narrow variant */
.form-group-narrow { max-width: 300px; }

/* Harvest / scan actions row */
.harvest-actions { display: flex; align-items: center; gap: 12px; }

/* Progress panel (used by harvest + scan) */
.progress-panel {
    background: var(--bg);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 8px;
}
.progress-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}
.progress-track {
    background: var(--border);
    border-radius: 4px;
    height: 8px;
    overflow: hidden;
    margin-bottom: 12px;
}
.progress-fill {
    background: var(--primary);
    height: 100%;
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 4px;
}
.progress-fill-danger { background: var(--danger); }

/* 4-column stat cells (for progress panels) */
.stats-grid-4 { grid-template-columns: repeat(4, 1fr); }
.stat-cell { text-align: center; }
.stat-cell-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; }
.stat-cell-value { font-size: 16px; font-weight: 700; }

/* Recent activity row */
.recent-activity-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

/* Issue detail (nested under issue-card) */
.issue-detail {
    margin-left: 12px;
    padding: 10px 12px;
    border-left: 3px solid var(--border);
    margin-bottom: 8px;
    background: var(--bg);
    border-radius: 0 6px 6px 0;
}
.issue-detail-header { font-size: 13px; margin-bottom: 4px; }
.issue-detail-header strong { font-weight: 600; }

/* Scan page result sections */
.scan-page-score { flex-shrink: 0; }
.scan-page-summary {
    font-size: 14px;
    line-height: 1.6;
    padding: 10px 12px;
    background: var(--bg);
    border-radius: 6px;
    margin-bottom: 12px;
}
.scan-page-issues { margin-bottom: 8px; }
.scan-page-pass {
    font-size: 13px;
    color: var(--success);
    padding: 8px 12px;
    background: #f0fdf4;
    border-radius: 6px;
    margin-bottom: 8px;
}
.scan-page-positive {
    font-size: 13px;
    padding: 8px 12px;
    background: #f0fdf4;
    border-radius: 6px;
    margin-top: 8px;
}

/* Positive notes list */
.positive-notes-list { padding-left: 20px; font-size: 13px; }

/* Disclaimer */
.disclaimer { font-size: 11px; color: var(--text-muted); margin-top: 16px; font-style: italic; }

/* Knowledge map */
.km-source-block {
    background: var(--bg);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}
.km-source-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.km-source-title { font-size: 15px; margin: 0; }
.km-category {
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 8px;
    overflow: hidden;
}
.km-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    cursor: pointer;
    background: var(--bg-card);
}
.km-category-label { font-size: 14px; font-weight: 500; }
.km-category-body {
    padding: 8px 14px;
    font-size: 13px;
    max-height: 300px;
    overflow-y: auto;
}
.km-page-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid var(--border);
}
.km-page-chunks { white-space: nowrap; margin-left: 12px; }

/* === Scan Report: split-panel layout === */
.report-layout { display: flex; min-height: 100vh; max-height: 100vh; }

/* Left tree panel */
.report-tree-panel {
    width: 280px; min-width: 280px;
    background: #0f172a; color: #e2e8f0;
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh;
}
.report-tree-header { padding: 16px 20px; border-bottom: 1px solid #1e293b; }
.report-tree-header h2 { font-size: 16px; font-weight: 700; color: #fff; margin-top: 12px; line-height: 1.3; }
.report-tree-header .btn-outline { color: #94a3b8; border-color: #334155; font-size: 12px; padding: 4px 10px; }
.report-tree-actions { padding: 12px 20px; border-bottom: 1px solid #1e293b; }
.report-tree-stats {
    padding: 12px 20px; border-bottom: 1px solid #1e293b;
    display: flex; align-items: center; gap: 12px;
}
.report-tree-score {
    width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.report-tree-stat-text { font-size: 12px; color: #94a3b8; line-height: 1.5; }

/* Tree navigation */
.report-tree { flex: 1; overflow-y: auto; padding: 8px 0; }
.report-tree-group { margin-bottom: 2px; }
.report-tree-group-label {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 20px; font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.5px; color: #64748b; cursor: pointer;
}
.report-tree-group-label .tree-count {
    font-weight: 400; color: #475569; margin-left: auto; font-size: 10px;
}
.report-tree-item {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 20px 7px 32px; cursor: pointer; font-size: 13px;
    color: #94a3b8; transition: all 0.15s; text-decoration: none;
    border-left: 3px solid transparent;
}
.report-tree-item:hover { color: #fff; background: rgba(255,255,255,0.06); }
.report-tree-item.active { color: #fff; background: rgba(255,255,255,0.08); border-left-color: #1a56db; }
.report-tree-item-dot {
    width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.report-tree-item-dot.critical { background: #dc2626; }
.report-tree-item-dot.high { background: #ea580c; }
.report-tree-item-dot.medium { background: #f59e0b; }
.report-tree-item-dot.low { background: #16a34a; }
.report-tree-item-dot.pass { background: #16a34a; }
.report-tree-item-dot.skipped { background: #475569; }
.report-tree-item-title {
    flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.report-tree-item-score {
    font-size: 11px; font-weight: 600; flex-shrink: 0; min-width: 24px; text-align: right;
}

/* Right content panel */
.report-content-panel { flex: 1; overflow-y: auto; padding: 32px 32px 72px; max-height: 100vh; }
.report-content-header { margin-bottom: 24px; }
.report-page-section { scroll-margin-top: 16px; }

/* Report disclaimer */
.report-disclaimer {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    color: #92400e;
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 24px;
}

/* Export button state */
.btn-exporting { opacity: 0.7; pointer-events: none; }

/* Site footer */
.site-footer {
    position: fixed;
    bottom: 0;
    left: 250px;
    right: 0;
    background: #0f172a;
    color: #94a3b8;
    padding: 16px 32px;
    font-size: 13px;
    line-height: 1.6;
    z-index: 90;
}
.site-footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}
.site-footer a { color: #cbd5e1; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer-links { display: flex; gap: 20px; }

/* Footer on login page (no sidebar offset) */
.login-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(15,23,42,0.85);
    color: #94a3b8;
    padding: 12px 32px;
    font-size: 12px;
    text-align: center;
    z-index: 50;
}
.login-footer a { color: #cbd5e1; text-decoration: none; }
.login-footer a:hover { color: #fff; text-decoration: underline; }

/* Legal page layout */
.legal-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 32px 80px;
    min-height: 100vh;
}
.legal-page h1 { font-size: 28px; font-weight: 700; margin-bottom: 8px; }
.legal-page .legal-updated { font-size: 13px; color: var(--text-muted); margin-bottom: 32px; }
.legal-page h2 { font-size: 18px; font-weight: 600; margin-top: 28px; margin-bottom: 8px; }
.legal-page p, .legal-page li { font-size: 14px; line-height: 1.7; margin-bottom: 12px; }
.legal-page ul { padding-left: 24px; margin-bottom: 16px; }
.legal-page .legal-nav { margin-bottom: 24px; }
.legal-page .legal-nav a { color: var(--primary); text-decoration: none; font-size: 14px; }
.legal-page .legal-nav a:hover { text-decoration: underline; }

/* Legal page footer (no sidebar) */
.legal-footer {
    background: #0f172a;
    color: #94a3b8;
    padding: 24px 32px;
    font-size: 13px;
    line-height: 1.6;
}
.legal-footer a { color: #cbd5e1; text-decoration: none; }
.legal-footer a:hover { color: #fff; text-decoration: underline; }
.legal-footer .site-footer-inner { max-width: 800px; margin: 0 auto; }

/* Responsive */
/* Settings form */
.settings-form { padding: 20px 24px; }
.settings-form .form-group { margin-bottom: 16px; }
.settings-form label { display: block; font-size: 13px; font-weight: 500; color: var(--text-muted); margin-bottom: 4px; }
.settings-form input[type="text"] {
    width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius);
    font-size: 14px; background: var(--bg-card); color: var(--text);
}
.settings-form input:disabled { background: var(--bg); cursor: not-allowed; }
.settings-form .form-row { display: flex; gap: 16px; }
.settings-form .form-row .form-group { flex: 1; }
.settings-form .form-actions { padding-top: 8px; }

/* === Compliance Checklist === */
.compliance-checklist {
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 24px;
    background: var(--bg-card);
}
.checklist-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text);
}
.checklist-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}
.checklist-section { margin-bottom: 16px; }
.checklist-section:last-child { margin-bottom: 0; }
.checklist-section-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border);
}
.checklist-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 4px;
    font-size: 14px;
    transition: background 0.15s;
}
.checklist-item:hover { background: var(--bg); }
.checklist-item.found { }
.checklist-item.missing { background: #fef2f2; }
.checklist-item.not-found { background: #fffbeb; }
.checklist-icon { flex-shrink: 0; display: flex; align-items: center; }
.checklist-label { flex: 1; font-weight: 500; }
.checklist-link {
    font-size: 12px;
    color: var(--primary);
    text-decoration: none;
    white-space: nowrap;
}
.checklist-link:hover { text-decoration: underline; }
.checklist-score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 24px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}
.checklist-score.pass, .checklist-score.low { background: var(--success); }
.checklist-score.medium { background: var(--warning); color: #000; }
.checklist-score.high { background: #ea580c; }
.checklist-score.critical { background: var(--danger); }
.checklist-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}
.checklist-badge.critical { background: #fef2f2; color: #dc2626; }
.checklist-badge.warning { background: #fffbeb; color: #d97706; }

/* Artefact badges in page results */
.artefact-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 2px 8px;
    border-radius: 4px;
    background: #e8f4fd;
    color: #0369a1;
    margin-left: 6px;
    vertical-align: middle;
}

/* Artefact group label in tree */
.report-tree-group-label.artefact-group {
    color: #60a5fa;
    font-weight: 700;
}

/* Mobile menu toggle */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 150;
    background: #0f172a;
    color: #fff;
    border: none;
    border-radius: 6px;
    width: 40px;
    height: 40px;
    font-size: 22px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
}

.sidebar-close-btn {
    display: none;
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 24px;
    cursor: pointer;
    z-index: 101;
}
.sidebar-close-btn:hover { color: #fff; }

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}

/* Settings cards — full width on desktop, stack on mobile */
.settings-profile-card { }
.settings-plan-card { margin-top: 20px; }

/* Cost cards row (quotas page) */
.cost-cards-row { display: flex; gap: 20px; margin-top: 20px; flex-wrap: wrap; }
.cost-card { flex: 1; min-width: 280px; }

/* Admin search inputs — fluid */
.admin-search-input {
    width: 100%;
    max-width: 320px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
}

/* ── Tablet breakpoint ── */
@media (max-width: 1024px) {
    .sidebar { width: 220px; }
    .main-content { margin-left: 220px; padding: 24px 20px 72px; }
    .site-footer { left: 220px; }
    .report-tree-panel { width: 240px; min-width: 240px; }
}

/* ── Mobile breakpoint ── */
@media (max-width: 768px) {
    .mobile-menu-btn { display: flex; }
    .sidebar-close-btn { display: block; }
    .sidebar {
        display: flex;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        width: 280px;
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.open { display: block; }
    .main-content { margin-left: 0; padding: 60px 16px 72px; }
    .site-footer { left: 0; padding: 12px 16px; }
    .site-footer-inner { flex-direction: column; text-align: center; gap: 6px; }
    .site-footer-links { flex-wrap: wrap; justify-content: center; gap: 12px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .stats-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .report-layout { flex-direction: column; max-height: none; }
    .report-tree-panel { width: 100%; min-width: 100%; height: auto; max-height: 40vh; position: relative; }
    .report-content-panel { max-height: none; padding: 16px; }
    .settings-form .form-row { flex-direction: column; gap: 0; }
    .settings-profile-card,
    .settings-plan-card { max-width: 100%; }
    .admin-search-input { max-width: 100%; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
    .page-header h1 { font-size: 20px; }
    .login-box { padding: 24px 20px; }
    .login-footer { padding: 10px 16px; }
    .form-row { flex-direction: column; gap: 0; }
    .card { padding: 16px; }
    .card-header { flex-direction: column; align-items: flex-start; gap: 8px; }
    .modal { width: 95vw; padding: 20px; }
    th, td { padding: 8px 10px; font-size: 13px; }
    .harvest-actions { flex-wrap: wrap; }
}

/* ── Small mobile ── */
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .stat-card .stat-value { font-size: 22px; }
    .page-header h1 { font-size: 18px; }
    .btn { padding: 6px 12px; font-size: 13px; }
    .login-box { margin: 0 12px; }
}

/* Server load indicator */
.server-load-card { padding: 16px 24px; }
.server-load-indicator { display: flex; align-items: center; gap: 8px; }
.server-load-dot {
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--border);
    display: inline-block;
}
.server-load-dot.load-low { background: #22c55e; }
.server-load-dot.load-medium { background: var(--warning); }
.server-load-dot.load-high { background: var(--danger); }
.server-load-label { font-weight: 600; font-size: 16px; }

/* Paused website row */
.paused-row { opacity: 0.55; }
.paused-row:hover { opacity: 0.8; }
.pause-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--warning);
    color: #fff;
    padding: 1px 7px;
    border-radius: 10px;
    vertical-align: middle;
    margin-left: 6px;
}

/* Questionnaire styling */
.qa-question {
    padding: 14px 16px;
    border-radius: var(--radius);
    margin-bottom: 2px;
}
.qa-question:nth-child(odd) { background: var(--bg); }
.qa-question:nth-child(even) { background: var(--bg-card); }
.qa-question-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}
.qa-question-help {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.qa-category-header {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 10px 16px 4px;
    margin-top: 8px;
}
.qa-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 0;
    cursor: pointer;
    font-size: 13px;
    font-weight: normal;
}
.qa-option input[type="checkbox"],
.qa-option input[type="radio"] {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
}
.qa-textarea {
    width: 100%;
    resize: vertical;
    font-size: 13px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: inherit;
}

/* ── Credit Packages Grid ── */
.credit-packages-grid {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.credit-package-card {
    position: relative;
    flex: 1;
    min-width: 160px;
    max-width: 220px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px 16px;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}
.credit-package-card:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(26, 86, 219, .12);
}
.package-badge {
    position: absolute;
    top: -10px;
    right: 12px;
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}
.package-credits {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}
.package-price {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 2px;
}
.package-name {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
}
.package-desc {
    margin-bottom: 10px;
}

/* ── Spending Chart ── */
.spending-chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 180px;
    padding-bottom: 24px;
}
.spending-bar-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
}
.spending-bar {
    width: 100%;
    max-width: 40px;
    background: var(--primary);
    border-radius: 4px 4px 0 0;
    min-height: 2px;
    position: relative;
    transition: height .3s;
}
.spending-bar-value {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}
.spending-bar-label {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 4px;
    white-space: nowrap;
}

/* Template editor */
.template-var-tag {
    display: inline-block;
    background: #eff6ff;
    color: #1d4ed8;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    border: 1px solid #bfdbfe;
}
.template-var-tag:hover { background: #dbeafe; }
.template-editor-body img { max-width: 100%; height: auto; }
.template-editor-body a { color: #2563eb; }
.template-toolbar .btn { min-width: 32px; padding: 4px 8px; font-size: 13px; }
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid #e5e7eb;
}
.modal-header h3 { margin: 0; font-size: 16px; }
.modal-close {
    background: none; border: none; font-size: 24px; cursor: pointer;
    color: #6b7280; line-height: 1;
}
.modal-body { padding: 16px 20px; }

/* Branding grid */
.branding-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}
.branding-slot {
    border: 2px dashed #d1d5db;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    transition: border-color 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
}
.branding-slot:hover { border-color: var(--primary); }
.branding-slot.has-image { border-style: solid; border-color: #e5e7eb; }
.branding-slot-label {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}
.branding-slot-preview {
    width: 100%;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}
.branding-slot-preview img {
    max-width: 100%;
    max-height: 80px;
    object-fit: contain;
}
.branding-slot-placeholder {
    color: #9ca3af;
    font-size: 12px;
}
.branding-slot-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: auto;
    padding-top: 12px;
}

/* ── Cookie Consent Banner ── */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: var(--card, #1e293b);
    border-top: 1px solid var(--border, #334155);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
    padding: 16px 24px;
}
.cookie-banner-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.cookie-banner-inner p {
    flex: 1;
    margin: 0;
    font-size: 0.9em;
    color: var(--text-muted, #94a3b8);
    min-width: 280px;
}
.cookie-banner-inner p a {
    color: var(--primary, #3b82f6);
}
.cookie-banner-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* ── Audit Logs ── */
.audit-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    align-items: center;
}
.audit-filters select,
.audit-filters input[type="text"],
.audit-filters input[type="date"] {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card);
    color: var(--text);
    font-size: 0.85em;
}
.audit-filters select { min-width: 130px; }
.audit-filters input[type="text"] { min-width: 160px; }
.audit-sev-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    color: #fff;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
}
.audit-pagination {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    justify-content: flex-end;
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}
.form-grid label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.85em;
    color: var(--text-muted);
}
.form-grid label input,
.form-grid label select {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card);
    color: var(--text);
}
.form-grid label:first-child {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

/* ── Prompt Version Timeline ── */
.prompt-timeline {
    display: flex;
    gap: 0;
    overflow-x: auto;
    padding: 8px 0;
    position: relative;
}
.prompt-timeline::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--border, #334155);
    z-index: 0;
}
.prompt-tv {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.15s;
}
.prompt-tv:hover { background: rgba(59,130,246,0.1); }
.prompt-tv .tv-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--border, #334155);
    border: 2px solid var(--card, #1e293b);
    margin-bottom: 4px;
}
.prompt-tv.active .tv-dot { background: var(--primary, #3b82f6); box-shadow: 0 0 0 3px rgba(59,130,246,0.3); }
.prompt-tv.selected .tv-dot { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,0.3); }
.prompt-tv .tv-ver { font-size: 0.75em; font-weight: 600; color: var(--text-muted); }
.prompt-tv.active .tv-ver { color: var(--primary, #3b82f6); }
.prompt-tv .tv-date { font-size: 0.65em; color: var(--text-muted); white-space: nowrap; }
.prompt-tv .tv-by { font-size: 0.6em; color: var(--text-muted); }
.prompt-tv .tv-actions { display: flex; gap: 4px; margin-top: 4px; }
.prompt-tv .tv-actions button { font-size: 0.65em; padding: 1px 6px; }

/* ── Prompt Diff ── */
.prompt-diff {
    font-family: monospace;
    font-size: 0.82em;
    line-height: 1.6;
    max-height: 500px;
    overflow-y: auto;
    background: var(--bg, #0f172a);
    border-radius: 6px;
    padding: 12px;
}
.prompt-diff .diff-add { background: rgba(34,197,94,0.15); color: #4ade80; }
.prompt-diff .diff-remove { background: rgba(239,68,68,0.15); color: #f87171; }
.prompt-diff .diff-range { color: #60a5fa; font-weight: 600; }
.prompt-diff .diff-context { color: var(--text-muted); }

/* ── Prompt card list ── */
.prompt-card {
    padding: 12px 16px;
    border: 1px solid var(--border, #334155);
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.prompt-card:hover { border-color: var(--primary, #3b82f6); background: rgba(59,130,246,0.05); }
