:root {
    --primary:       #06b6d4;
    --primary-dark:  #0891b2;
    --brand:         #06b6d4;
    --danger:        #f87171;
    --warning:       #fbbf24;
    --success:       #34d399;
    --info:          #38bdf8;
    --bg:            #070d1a;
    --surface:       #0d1526;
    --surface-2:     #111e33;
    --border:        #1a2a42;
    --glow:          rgba(6,182,212,0.18);

/* ── Score Donut ────────────────────────────────────────────────────────── */
.score-donut-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 24px 0 16px;
}

.score-donut {
    width: 160px;
    height: 160px;
    overflow: visible;
}

.donut-track {
    stroke: var(--border, #e2e8f0);
}

.donut-arc { transition: stroke-dashoffset .6s ease; }
.donut-arc.donut-excellent { stroke: #34d399; }
.donut-arc.donut-good      { stroke: #06b6d4; }
.donut-arc.donut-fair      { stroke: #fbbf24; }
.donut-arc.donut-poor      { stroke: #f87171; }

.donut-score {
    font-size: 26px;
    font-weight: 700;
    font-family: inherit;
    fill: var(--text, #e2e8f0);
}
.donut-score.donut-excellent { fill: #34d399; }
.donut-score.donut-good      { fill: #06b6d4; }
.donut-score.donut-fair      { fill: #fbbf24; }
.donut-score.donut-poor      { fill: #f87171; }

.donut-label {
    font-size: 13px;
    fill: var(--text-muted, #64748b);
    font-family: inherit;
}

.score-donut-caption {
    margin-top: 8px;
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    text-transform: uppercase;
    letter-spacing: .05em;
}

    --text:          #e2e8f0;
    --text-muted:    #4a6080;
    --text-secondary:#8faabf;
    --sidebar-bg:    #050b15;
    --sidebar-text:  #4a6080;
    --sidebar-hover: #0d1526;
}

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

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

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

/* ── Mobile sidebar overlay ────────────────────────────────────────────── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 99;
}
.sidebar-overlay.open { display: block; }

/* ── Hamburger button (mobile only) ────────────────────────────────────── */
.nav-hamburger {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 200;
    background: var(--sidebar-bg);
    border: none;
    border-radius: 8px;
    color: #fff;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.sidebar {
    width: 240px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    padding: 0;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: transform 0.25s ease;
}

.sidebar-brand {
    height: 64px;
    padding: 0 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    flex-shrink: 0;
}

.brand-logo {
    width: 100%;
    max-width: 160px;
    height: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.sidebar-close {
    display: none;
    background: transparent;
    border: none;
    color: var(--sidebar-text);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.15s;
}

.sidebar-close:hover {
    color: var(--text);
}

.sidebar-nav { display: flex; flex-direction: column; padding: 16px 0; gap: 2px; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 0;
    transition: color 0.15s, background 0.15s;
    border-left: 3px solid transparent;
}

.nav-item:hover { background: var(--sidebar-hover); color: #c8daf0; border-left-color: transparent; }
.nav-item.active { background: rgba(6,182,212,0.08); color: var(--primary); border-left-color: var(--primary); font-weight: 600; }

.main-shell {
    margin-left: 240px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.25s ease;
}

/* Collapsed sidebar state */
.app-layout.sidebar-collapsed .sidebar {
    transform: translateX(-100%);
}

.main-shell.sidebar-collapsed {
    margin-left: 0;
}

/* ── Top Bar ────────────────────────────────────────────────────────────── */
.topbar {
    height: 64px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(8px);
    background: rgba(13,21,38,0.85);
    flex-shrink: 0;
}

.topbar-left { 
    display: flex; 
    align-items: center; 
    gap: 16px; 
}

.topbar-hamburger {
    display: none;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    line-height: 1;
    border-radius: 6px;
    transition: background 0.15s;
}

.topbar-hamburger:hover {
    background: var(--sidebar-hover);
}

.topbar-right { display: flex; align-items: center; gap: 6px; }

.topbar-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

.topbar-icon-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.topbar-icon-btn:hover {
    background: var(--surface-2);
    border-color: var(--border);
    color: var(--text);
}

/* ── Topbar User Dropdown ────────────────────────────────────────────── */
.topbar-user { position: relative; }

.topbar-avatar-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 5px 10px 5px 6px;
    cursor: pointer;
    color: var(--text);
    transition: background 0.15s, border-color 0.15s;
}
.topbar-avatar-btn:hover {
    background: var(--surface-2);
    border-color: var(--border);
}
.topbar-user.open .topbar-avatar-btn {
    background: var(--surface-2);
    border-color: var(--primary);
}

.topbar-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #0e7490);
    color: #070d1a;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 0 10px var(--glow);
}

.topbar-username {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-chevron {
    font-size: 0.65rem;
    color: var(--text-muted);
    transition: transform 0.2s;
}
.topbar-user.open .topbar-chevron { transform: rotate(180deg); }

.topbar-user-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 200px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 6px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(6,182,212,0.08);
    z-index: 200;
    animation: dropdown-in 0.15s ease;
}

@keyframes dropdown-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.topbar-user-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 7px;
    font-size: 0.875rem;
    color: var(--text);
    text-decoration: none;
    background: transparent;
    border: none;
    width: 100%;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
}
.topbar-user-item:hover { background: var(--surface-2); color: var(--primary); }
.topbar-user-item.logout:hover { color: var(--danger); }

.topbar-user-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

.topbar-logout-form { display: contents; }

.topbar-user-overlay {
    position: fixed;
    inset: 0;
    z-index: 199;
}

.main-content {
    flex: 1;
}

.content-wrapper { 
    padding: 32px;
    width: 100%;
}

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

.page-header h1 { font-size: 1.75rem; font-weight: 700; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
}

.btn-primary { background: var(--primary); color: #070d1a; font-weight: 600; }
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 0 16px var(--glow); }
.btn-secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface); border-color: rgba(6,182,212,0.4); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

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

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.stat-card:hover {
    border-color: rgba(6,182,212,0.3);
    box-shadow: 0 0 24px rgba(6,182,212,0.08);
}

.stat-card.critical    { border-left: 3px solid var(--danger); }
.stat-card.serious     { border-left: 3px solid var(--warning); }
.stat-card.moderate    { border-left: 3px solid #f59e0b; }
.stat-card.minor       { border-left: 3px solid var(--info); }
.stat-card.score-great { border-left: 3px solid #10b981; }
.stat-card.score-great .stat-value { color: #10b981; }
.stat-card.score-good  { border-left: 3px solid #06b6d4; }
.stat-card.score-good  .stat-value { color: #06b6d4; }
.stat-card.score-fair  { border-left: 3px solid #f59e0b; }
.stat-card.score-fair  .stat-value { color: #f59e0b; }
.stat-card.score-poor  { border-left: 3px solid #ef4444; }
.stat-card.score-poor  .stat-value { color: #ef4444; }

.stat-value { font-size: 2rem; font-weight: 700; color: var(--text); }
.stat-label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 4px; }

/* Score Display */
.score-display {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 28px;
    border: 6px solid var(--border);
}

.score-display.score-great { border-color: var(--success); }
.score-display.score-good  { border-color: #84cc16; }
.score-display.score-fair  { border-color: var(--warning); }
.score-display.score-poor  { border-color: var(--danger); }

.score-number { font-size: 2.5rem; font-weight: 800; }
.score-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; }

/* Score Badge */
.score-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 99px;
    font-weight: 700;
    font-size: 0.85rem;
}

.score-badge.score-great { background: rgba(52,211,153,0.15); color: #34d399; }
.score-badge.score-good  { background: rgba(6,182,212,0.12);  color: #06b6d4; }
.score-badge.score-fair  { background: rgba(251,191,36,0.12); color: #fbbf24; }
.score-badge.score-poor  { background: rgba(248,113,113,0.12); color: #f87171; }

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
}

.status-badge.completed { background: rgba(52,211,153,0.15); color: #34d399; border: 1px solid rgba(52,211,153,0.3); }
.status-badge.pending   { background: rgba(56,189,248,0.12); color: #38bdf8; border: 1px solid rgba(56,189,248,0.3); }
.status-badge.running   { background: rgba(251,191,36,0.12); color: #fbbf24; border: 1px solid rgba(251,191,36,0.3); }
.status-badge.failed    { background: rgba(248,113,113,0.12); color: #f87171; border: 1px solid rgba(248,113,113,0.3); }

/* Severity Badge */
.severity-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
}

.severity-badge.critical { background: rgba(248,113,113,0.15); color: #f87171; border: 1px solid rgba(248,113,113,0.3); }
.severity-badge.serious  { background: rgba(251,146,60,0.15);  color: #fb923c; border: 1px solid rgba(251,146,60,0.3); }
.severity-badge.moderate { background: rgba(251,191,36,0.12);  color: #fbbf24; border: 1px solid rgba(251,191,36,0.3); }
.severity-badge.minor    { background: rgba(56,189,248,0.12);  color: #38bdf8; border: 1px solid rgba(56,189,248,0.3); }

/* Table */
.section-title { font-size: 1.25rem; font-weight: 600; margin-bottom: 16px; }

.table-wrapper { overflow-x: auto; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.data-table th {
    padding: 12px 16px;
    background: var(--surface-2);
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(6,182,212,0.04); }

/* Form */
.form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px;
    max-width: 560px;
}

.form-description { color: var(--text-muted); margin-bottom: 24px; }

.form-group { margin-bottom: 20px; }

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 9px 13px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    background: var(--surface-2);
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(6,182,212,0.15); }

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-success { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }

/* Issues List */
.issues-list { display: flex; flex-direction: column; gap: 16px; }

.issue-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    border-left-width: 4px;
}

.issue-card.severity-critical { border-left-color: var(--danger); }
.issue-card.severity-serious  { border-left-color: var(--warning); }
.issue-card.severity-moderate { border-left-color: #f59e0b; }
.issue-card.severity-minor    { border-left-color: var(--info); }

.issue-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.rule-id { font-weight: 600; font-size: 0.95rem; }

.wcag-badge {
    display: inline-flex; align-items: center;
    font-size: 0.72rem; font-weight: 600; letter-spacing: 0.03em;
    padding: 2px 7px; border-radius: 4px;
    border: 1px solid currentColor; white-space: nowrap;
    cursor: default;
}
.wcag-badge.level-a   { color: #1d4ed8; background: #dbeafe; border-color: #93c5fd; }
.wcag-badge.level-aa  { color: #065f46; background: #d1fae5; border-color: #6ee7b7; }
.wcag-badge.level-aaa { color: #6b21a8; background: #f3e8ff; border-color: #d8b4fe; }

/* ── MaxPages slider ───────────────────────────── */
.maxpages-row { display: flex; align-items: center; gap: 12px; }
.maxpages-slider { flex: 1; accent-color: var(--brand); cursor: pointer; }
.maxpages-value { font-weight: 700; color: var(--brand); min-width: 60px; }
.form-hint { font-size: 0.82rem; color: var(--text-muted); margin-top: 4px; }

/* ── Issue page URL ────────────────────────────── */
.issue-page-url { font-size: 0.82rem; margin-bottom: 8px; }
.issue-page-url a { color: var(--brand); word-break: break-all; }
.issue-description { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 12px; }

.issue-element {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 8px 12px;
    margin-bottom: 10px;
    font-size: 0.85rem;
}

.issue-element code { font-family: monospace; word-break: break-all; }
.issue-fix { font-size: 0.9rem; margin-bottom: 8px; }
.help-link { font-size: 0.85rem; color: var(--primary); text-decoration: none; }
.help-link:hover { text-decoration: underline; }

/* Result Meta */
.result-meta {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 24px;
    font-size: 0.9rem;
}

/* Header actions */
.header-actions { display: flex; gap: 10px; align-items: center; }

/* Loading */
.loading-container { text-align: center; padding: 60px 0; }
.loading-text { font-size: 1.1rem; color: var(--text-muted); }
.loading-sub { margin-top: 8px; font-size: 0.85rem; color: var(--text-muted); }

/* Scan progress card */
.scan-progress-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 32px;
    max-width: 640px;
    margin: 60px auto;
    box-shadow: 0 8px 40px rgba(0,0,0,0.4), 0 0 0 1px rgba(6,182,212,0.08);
}

.scan-progress-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.scan-progress-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(6,182,212,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.spinner {
    width: 22px;
    height: 22px;
    border: 3px solid rgba(6,182,212,0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    display: inline-block;
    animation: spin 0.9s linear infinite;
}

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

.scan-progress-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.scan-progress-url {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 2px;
    word-break: break-all;
}

/* Progress bar */
.progress-bar-track {
    height: 4px;
    background: var(--border);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 28px;
}

.progress-bar-fill {
    height: 100%;
    width: 40%;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--primary), #67e8f9);
    animation: indeterminate 1.6s ease-in-out infinite;
    transform-origin: left;
    box-shadow: 0 0 12px var(--glow);
}

@keyframes indeterminate {
    0%   { transform: translateX(-100%) scaleX(0.5); }
    50%  { transform: translateX(60%)   scaleX(1.2); }
    100% { transform: translateX(300%)  scaleX(0.5); }
}

/* Steps */
.scan-steps {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
}

.scan-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.step-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s, color 0.3s, border-color 0.3s;
    border: 2px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
}

.scan-step.done .step-dot {
    background: #dcfce7;
    border-color: #16a34a;
    color: #16a34a;
}

.scan-step.active .step-dot {
    background: var(--primary);
    border-color: var(--primary);
    color: #070d1a;
    box-shadow: 0 0 0 4px rgba(6,182,212,0.2);
    animation: pulse-dot 1.4s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 0 4px rgba(6,182,212,0.2); }
    50%       { box-shadow: 0 0 0 7px rgba(6,182,212,0.08); }
}

.step-label {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
}

.scan-step.active .step-label { color: var(--primary); font-weight: 600; }
.scan-step.done  .step-label  { color: #16a34a; }

.step-connector {
    flex: 1;
    height: 2px;
    background: var(--border);
    margin: 0 4px;
    margin-bottom: 20px;
    transition: background 0.3s;
}

.step-connector.done { background: #16a34a; }

/* Footer */
.scan-progress-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 0.82rem;
    color: var(--text-muted);
}

.elapsed-label strong { color: var(--text); }

/* ── Re-scan / ghost / outline buttons ───────────────────────────────── */
.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: background 0.15s, color 0.15s;
}
.btn-ghost:hover { background: var(--bg); color: var(--text); }

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.btn-outline:hover { background: var(--primary); color: #fff; }

.btn-link-inline {
    background: none;
    border: none;
    color: var(--primary);
    font-size: inherit;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}
.btn-link-inline.danger { color: var(--danger); }

/* ── Alert variants ───────────────────────────────────────────────────── */
.alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: var(--success);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.875rem;
    margin-top: 16px;
}

/* ── Stat card sub-label ──────────────────────────────────────────────── */
.stat-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}
.stat-sub a { color: var(--primary); text-decoration: none; }

.badge-running {
    background: #fef9c3;
    color: #854d0e;
    border: 1px solid #fde68a;
    border-radius: 99px;
    padding: 1px 8px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ── Dashboard active scan banner ─────────────────────────────────────── */
.alert-info-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(6,182,212,0.08);
    border: 1px solid rgba(6,182,212,0.25);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 24px;
    font-size: 0.9rem;
    color: var(--primary);
}

.spinner-sm {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(6,182,212,0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    display: inline-block;
    animation: spin 0.9s linear infinite;
    flex-shrink: 0;
}

/* ── Screenshot section ───────────────────────────────────────────────── */
.screenshot-section {
    margin-bottom: 24px;
}

.screenshot-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.15s;
}
.screenshot-toggle:hover { background: var(--bg); }

.screenshot-wrap {
    margin-top: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.screenshot-img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 480px;
    object-fit: cover;
    object-position: top;
}

/* ── Issues toolbar (filter bar) ─────────────────────────────────────── */
.issues-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.filter-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-btn {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    border-radius: 99px;
    padding: 4px 12px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.filter-btn:hover   { background: var(--surface-2); color: var(--text); }
.filter-btn.active  { background: var(--primary); color: #070d1a; border-color: var(--primary); font-weight: 600; }
.filter-btn.critical.active { background: var(--danger);  border-color: var(--danger);  color: #fff; }
.filter-btn.serious.active  { background: #fb923c;        border-color: #fb923c;        color: #fff; }
.filter-btn.moderate.active { background: var(--warning); border-color: var(--warning); color: #fff; }
.filter-btn.minor.active    { background: var(--info);    border-color: var(--info);    color: #fff; }

.filter-search {
    margin-left: auto;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.875rem;
    outline: none;
    background: var(--surface-2);
    color: var(--text);
    width: 220px;
    transition: border-color 0.15s;
}
.filter-search:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(6,182,212,0.12); }

.alert-info { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }

/* ── Sparkline ────────────────────────────────────────────────────────── */
.sparkline-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sparkline-trend {
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

/* ── Site detail page ─────────────────────────────────────────────────── */
.site-url-link {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-decoration: none;
}
.site-url-link:hover { text-decoration: underline; }

.detail-section {
    margin-bottom: 28px;
}

/* ── Schedule card ─────────────────────────────── */
.schedule-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 24px;
    overflow: hidden;
}
.schedule-card-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 18px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}
.schedule-card-title { font-weight: 600; font-size: 0.95rem; }
.schedule-next-label { font-size: 0.82rem; color: var(--text-muted); }
.schedule-card-body {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 14px 18px;
}
.schedule-frequency-group { display: flex; gap: 6px; flex-wrap: wrap; }
.schedule-freq-btn {
    padding: 5px 14px; border-radius: 20px; border: 1px solid var(--border);
    background: var(--bg); color: var(--text); font-size: 0.85rem; cursor: pointer;
    transition: all .15s;
}
.schedule-freq-btn:hover { border-color: var(--brand); color: var(--brand); }
.schedule-freq-btn.active { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 600; }
.schedule-saved-msg { color: #16a34a; font-size: 0.85rem; font-weight: 600; }

.schedule-badge {
    display: inline-block; padding: 2px 9px; border-radius: 12px;
    font-size: 0.76rem; font-weight: 600;
    background: #dbeafe; color: #1d4ed8; border: 1px solid #93c5fd;
}

.trend-chart-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.trend-labels {
    display: flex;
    justify-content: space-between;
    padding: 0 4px;
}

.trend-label-item {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ── Light mode (opt-in) ──────────────────────────────────────────────── */
[data-theme="light"] {
    --primary:       #0891b2;
    --primary-dark:  #0e7490;
    --brand:         #0891b2;
    --danger:        #dc2626;
    --warning:       #d97706;
    --success:       #16a34a;
    --info:          #0284c7;
    --bg:            #f0f4f8;
    --surface:       #ffffff;
    --surface-2:     #f8fafc;
    --border:        #e2e8f0;
    --glow:          rgba(8,145,178,0.12);
    --text:          #1e293b;
    --text-muted:    #64748b;
    --text-secondary:#94a3b8;
    --sidebar-bg:    #0f172a;
    --sidebar-text:  #94a3b8;
    --sidebar-hover: #1e293b;
}

[data-theme="light"] .data-table th     { background: #f8fafc; }
[data-theme="light"] .form-input        { background: #fff; color: var(--text); }
[data-theme="light"] .btn-primary       { color: #fff; }
[data-theme="light"] .scan-step.active .step-dot { color: #fff; }
[data-theme="light"] .severity-badge.critical { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
[data-theme="light"] .severity-badge.serious  { background: #ffedd5; color: #9a3412; border-color: #fdba74; }
[data-theme="light"] .severity-badge.moderate { background: #fef9c3; color: #854d0e; border-color: #fde68a; }
[data-theme="light"] .severity-badge.minor    { background: #dbeafe; color: #1d4ed8; border-color: #93c5fd; }
[data-theme="light"] .status-badge.completed  { background: #dcfce7; color: #15803d; border-color: #86efac; }
[data-theme="light"] .status-badge.pending    { background: #dbeafe; color: #1d4ed8; border-color: #93c5fd; }
[data-theme="light"] .status-badge.running    { background: #fef9c3; color: #854d0e; border-color: #fde68a; }
[data-theme="light"] .status-badge.failed     { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }

/* ── Sidebar footer ───────────────────────────────────────────────────── */
.sidebar-footer {
    margin-top: auto;
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.dark-mode-toggle {
    width: 100%;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    color: var(--sidebar-text);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}
.dark-mode-toggle:hover { background: rgba(255,255,255,0.12); }

/* ── NewScan two-column layout ────────────────────────────────────────── */
.new-scan-layout {
    display: grid;
    grid-template-columns: 480px 1fr;
    gap: 28px;
    align-items: start;
}

@media (max-width: 860px) {
    .new-scan-layout { grid-template-columns: 1fr; }
}

.url-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}
.url-input-wrap .form-input { flex: 1; }

.url-status {
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}
.url-status.checking    { color: var(--text-muted); }
.url-status.reachable   { color: var(--success); }
.url-status.unreachable { color: var(--danger); }

.label-optional { font-size: 0.8rem; color: var(--text-muted); font-weight: 400; }

.existing-sites-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
}

.panel-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.existing-sites-list { display: flex; flex-direction: column; gap: 6px; }

.existing-site-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.2s, background 0.2s;
}
.existing-site-btn:hover { border-color: var(--primary); background: rgba(6,182,212,0.06); }

.es-name { font-weight: 600; font-size: 0.9rem; flex: 0 0 auto; }
.es-url  { font-size: 0.8rem; color: var(--text-muted); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.es-arrow { color: var(--primary); font-size: 0.75rem; flex-shrink: 0; }

/* ── Group-by-rule view ───────────────────────────────────────────────── */
.view-toggle-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 5px 12px;
    font-size: 0.8rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.view-toggle-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.rule-group {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    border-left-width: 4px;
}
.rule-group.severity-critical { border-left-color: var(--danger); }
.rule-group.severity-serious  { border-left-color: #ea580c; }
.rule-group.severity-moderate { border-left-color: var(--warning); }
.rule-group.severity-minor    { border-left-color: var(--info); }

.rule-group-header {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}
.rule-group-header:hover { background: var(--bg); }

.rule-group-id   { font-weight: 700; font-size: 0.9rem; flex-shrink: 0; }
.rule-group-desc { font-size: 0.85rem; color: var(--text-muted); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rule-group-count { font-size: 0.78rem; background: var(--bg); border: 1px solid var(--border); border-radius: 99px; padding: 2px 10px; flex-shrink: 0; }
.rule-group-chevron { font-size: 0.7rem; color: var(--text-muted); flex-shrink: 0; }

.rule-group-body {
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.rule-instance {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.rule-instance:last-of-type { border-bottom: none; }

/* ── Delete buttons ───────────────────────────────────────────────────── */
.btn-danger {
    background: var(--danger);
    color: #fff;
    border: 1px solid var(--danger);
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
}
.btn-danger:hover { background: #b91c1c; }

.btn-danger-ghost {
    color: var(--danger);
    border-color: var(--danger);
}
.btn-danger-ghost:hover { background: #fee2e2; }

.delete-confirm-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--danger);
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    padding: 6px 12px;
}

/* ── Scan Comparison ────────────────────────────────────────────────────── */
.compare-score-row {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.compare-score-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 24px;
    min-width: 160px;
    text-align: center;
}
.compare-score-card .label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}
.compare-score-card .score-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.compare-arrow {
    font-size: 1.5rem;
    color: var(--text-muted);
}

.compare-delta {
    font-size: 1.75rem;
    font-weight: 700;
    padding: 12px 20px;
    border-radius: 12px;
}
.compare-delta.positive { color: #15803d; background: #dcfce7; }
.compare-delta.negative { color: #b91c1c; background: #fee2e2; }
.compare-delta.neutral  { color: var(--text-muted); background: var(--surface); border: 1px solid var(--border); }

.compare-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 16px;
}
.compare-tab {
    padding: 8px 16px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    border-radius: 6px 6px 0 0;
    transition: color 0.15s, border-color 0.15s;
}
.compare-tab:hover { color: var(--text-primary); }
.compare-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0 6px;
    margin-left: 6px;
    background: var(--border);
    color: var(--text-muted);
}
.tab-count.positive { background: #dcfce7; color: #15803d; }
.tab-count.negative { background: #fee2e2; color: #b91c1c; }

.compare-pill {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-right: 6px;
}
.compare-pill.fixed     { background: #dcfce7; color: #15803d; }
.compare-pill.regressed { background: #fee2e2; color: #b91c1c; }
.compare-pill.persisting { background: #fef9c3; color: #854d0e; }

.issue-fixed { opacity: 0.7; }
.issue-new   { border-left: 3px solid var(--danger) !important; }

/* ── Login Config Panel ─────────────────────────────────────────────────── */
.login-config-panel {
    border: 1px solid var(--border);
    border-radius: 10px;
    margin: 16px 0;
    overflow: hidden;
}

.login-config-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--surface);
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    text-align: left;
    transition: background 0.15s;
}
.login-config-toggle:hover { background: #f1f5f9; }

.toggle-icon { font-size: 0.7rem; color: var(--text-muted); }

.login-config-set {
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--success);
    background: #dcfce7;
    padding: 2px 8px;
    border-radius: 8px;
}

.login-config-body {
    padding: 16px;
    border-top: 1px solid var(--border);
    background: #f8fafc;
}

.login-config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 600px) {
    .login-config-grid { grid-template-columns: 1fr; }
}

/* ── AI Fix Suggestions ─────────────────────────────────────────────────── */
.issue-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.btn-ai-fix {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    border: 1.5px solid #7c3aed;
    color: #7c3aed;
    background: #faf5ff;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}
.btn-ai-fix:hover:not(:disabled) { background: #7c3aed; color: #fff; }
.btn-ai-fix:disabled { opacity: 0.6; cursor: default; }

.ai-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #7c3aed;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.ai-fix-panel {
    margin-top: 12px;
    border: 1.5px solid #7c3aed;
    border-radius: 10px;
    background: #faf5ff;
    overflow: hidden;
    position: relative;
}
.ai-fix-panel.ai-fix-error {
    border-color: var(--warning);
    background: #fffbeb;
}

.ai-fix-header {
    padding: 8px 14px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #7c3aed;
    border-bottom: 1px solid #ede9fe;
    background: #f5f3ff;
}
.ai-fix-panel.ai-fix-error .ai-fix-header { color: var(--warning); border-color: #fde68a; background: #fefce8; }

.ai-fix-content {
    padding: 12px 14px;
    font-size: 0.85rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text);
    margin: 0;
    background: transparent;
}

.ai-fix-error-msg {
    padding: 10px 14px;
    font-size: 0.85rem;
    color: var(--warning);
}

.ai-fix-dismiss {
    position: absolute;
    top: 7px;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    color: #a78bfa;
    opacity: 0.7;
    padding: 2px 4px;
}
.ai-fix-dismiss:hover { opacity: 1; }

/* ── Site Settings Card ─────────────────────────────────────────────────── */
.settings-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    margin: 0 0 24px 0;
    overflow: hidden;
}

.settings-card-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: var(--surface);
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    transition: background 0.15s;
}
.settings-card-header:hover { background: #f1f5f9; }
.settings-chevron { font-size: 0.7rem; color: var(--text-muted); }

.settings-card-body {
    padding: 20px;
    border-top: 1px solid var(--border);
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.settings-section { display: flex; flex-direction: column; gap: 10px; }

.settings-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.settings-webhook-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.settings-webhook-row .form-input { flex: 1; }

.form-hint-error { color: var(--danger) !important; }

.settings-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

/* ── Dashboard enhancements ─────────────────────────────────────────────── */
.dash-section { margin-bottom: 32px; }

/* Score distribution */
.score-dist-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
@media (max-width: 640px) { .score-dist-row { grid-template-columns: repeat(2, 1fr); } }

.score-dist-card {
    border-radius: 12px;
    padding: 16px 20px;
    text-align: center;
    border: 2px solid transparent;
}
.score-dist-card.score-great { background: #f0fdf4; border-color: #16a34a; }
.score-dist-card.score-good  { background: #eff6ff; border-color: #2563eb; }
.score-dist-card.score-fair  { background: #fffbeb; border-color: #d97706; }
.score-dist-card.score-poor  { background: #fef2f2; border-color: #dc2626; }
.score-dist-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}
.score-dist-card.score-great .score-dist-value { color: #16a34a; }
.score-dist-card.score-good  .score-dist-value { color: #2563eb; }
.score-dist-card.score-fair  .score-dist-value { color: #d97706; }
.score-dist-card.score-poor  .score-dist-value { color: #dc2626; }
.score-dist-label { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }

/* Two-column layout */
.dash-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 32px;
}
@media (max-width: 900px) { .dash-two-col { grid-template-columns: 1fr; } }

.dash-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
}

/* Violations bar chart */
.violations-chart { display: flex; flex-direction: column; gap: 8px; }

.vc-row {
    display: grid;
    grid-template-columns: 160px 1fr 40px;
    align-items: center;
    gap: 8px;
}
.vc-label {
    display: flex;
    align-items: center;
    gap: 5px;
    overflow: hidden;
}
.vc-rule-id {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.vc-bar-wrap {
    background: var(--border);
    border-radius: 4px;
    height: 10px;
    overflow: hidden;
}
.vc-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.4s ease;
}
.vc-count {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-align: right;
}

/* Sites needing attention */
.attention-list { display: flex; flex-direction: column; gap: 8px; }

.attention-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s, border-color 0.15s;
}
.attention-card:hover { background: #f8fafc; border-color: var(--primary); }

.attention-name {
    font-weight: 600;
    font-size: 0.88rem;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.attention-url {
    font-size: 0.75rem;
    color: var(--text-muted);
    flex: 2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.attention-score-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.attention-critical {
    font-size: 0.72rem;
    font-weight: 600;
    color: #dc2626;
    background: #fee2e2;
    padding: 2px 6px;
    border-radius: 6px;
}


/* ── Pagination ──────────────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 20px 0;
}
.pagination-btn {
    padding: 6px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #334155;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.15s;
}
.pagination-btn:hover:not(:disabled) { background: #f1f5f9; }
.pagination-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination-info { font-size: 0.875rem; color: #64748b; }

/* ── Ignored-rule indicators ─────────────────────────────────────── */
.ignored-badge {
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px dashed #cbd5e1;
}
.rule-group-ignored { opacity: 0.6; }
.issue-card-ignored { opacity: 0.6; }

/* ── Status badge: Cancelled ─────────────────────────────────────── */
.status-badge.cancelled { background: #f1f5f9; color: #64748b; }

/* ══════════════════════════════════════════════════════════════════════════
   Auth pages  (Login / Register / ExternalLogin)
   ══════════════════════════════════════════════════════════════════════════ */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    padding: 24px;
}

.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 4px 24px rgba(0,0,0,.06);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
    text-decoration: none;
    color: var(--text);
}
.auth-brand-icon { font-size: 1.6rem; }
.auth-brand-name { font-size: 1.1rem; font-weight: 700; }

.auth-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}
.auth-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 28px;
}

/* OAuth provider buttons */
.auth-providers {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}
.btn-provider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s, border-color .15s;
    text-decoration: none;
}
.btn-provider:hover { background: var(--bg); border-color: #cbd5e1; }
.btn-provider svg { width: 18px; height: 18px; }

.btn-provider-google { }
.btn-provider-github { }

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--text-muted);
    font-size: 0.8rem;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Form fields */
.auth-form .form-group { margin-bottom: 16px; }
.auth-form label { display: block; font-size: 0.85rem; font-weight: 500; color: var(--text); margin-bottom: 6px; }
.auth-form .form-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text);
    background: var(--surface);
    transition: border-color .15s, box-shadow .15s;
}
.auth-form .form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}

.auth-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    cursor: pointer;
}

.auth-submit {
    width: 100%;
    padding: 11px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.auth-submit:hover { background: var(--primary-dark); }
.auth-submit:disabled { opacity: .6; cursor: not-allowed; }

/* Validation */
.auth-form .text-danger { font-size: 0.8rem; color: var(--danger); margin-top: 4px; display: block; }
.auth-form .validation-summary-errors ul { margin: 0; padding: 0 0 0 16px; }
.auth-form .alert-danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--danger);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.875rem;
    margin-bottom: 16px;
}

.auth-options {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}
.auth-options a, .auth-footer a {
    font-size: 0.85rem;
    color: var(--primary);
    text-decoration: none;
}
.auth-options a:hover, .auth-footer a:hover { text-decoration: underline; }

.auth-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ── Sidebar user block ────────────────────────────────────────────────── */
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid rgba(255,255,255,.08);
    margin-top: auto;
}

.sidebar-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}
.sidebar-user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-user-email {
    font-size: 0.75rem;
    color: var(--sidebar-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-logout-form { display: inline; }
.sidebar-logout-btn {
    background: none;
    border: none;
    color: var(--sidebar-text);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
    line-height: 1;
    border-radius: 4px;
    transition: color .15s, background .15s;
}
.sidebar-logout-btn:hover { color: #f1f5f9; background: rgba(255,255,255,.08); }

.sidebar-signin-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid rgba(255,255,255,.08);
    margin-top: auto;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color .15s;
}
.sidebar-signin-link:hover { color: #f1f5f9; }

/* ── Scan quota bar ───────────────────────────────────────────────────────── */
.quota-bar-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}
.quota-bar {
    flex: 1;
    height: 6px;
    background: var(--border);
    border-radius: 99px;
    overflow: hidden;
}
.quota-bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 99px;
    transition: width .3s;
}
.quota-bar-fill.quota-full { background: var(--danger); }
.quota-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
}
.quota-alert { margin-bottom: 16px; }

/* ── Toast notifications ─────────────────────────────────────────────────── */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}
.toast-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    min-width: 280px;
    max-width: 420px;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
    pointer-events: all;
    animation: toast-in 0.25s ease;
}
@keyframes toast-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.toast-success { background: var(--success, #16a34a); }
.toast-error   { background: var(--danger,  #dc2626); }
.toast-warning { background: var(--warning, #d97706); }
.toast-info    { background: var(--info,    #0284c7); }
.toast-message { flex: 1; }
.toast-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    padding: 0 0 0 0.5rem;
    font-size: 1rem;
    line-height: 1;
}
.toast-close:hover { color: #fff; }

/* ── Skeleton loaders ────────────────────────────────────────────────────── */
.skeleton {
    background: linear-gradient(90deg, var(--border) 25%, color-mix(in srgb, var(--border) 60%, var(--surface)) 50%, var(--border) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.4s infinite;
    border-radius: 6px;
}
@keyframes skeleton-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skeleton-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    pointer-events: none;
}
.skeleton-value  { height: 36px; width: 70px;  margin-bottom: 10px; }
.skeleton-label  { height: 14px; width: 100px; margin-bottom: 8px;  }
.skeleton-sub    { height: 12px; width: 60px;  }
.skeleton-title  { height: 28px; }
.skeleton-text-lg { height: 16px; border-radius: 4px; }
.skeleton-text-md { height: 14px; border-radius: 4px; }
.skeleton-text-sm { height: 12px; border-radius: 4px; }
.skeleton-badge  { height: 22px; width: 80px; border-radius: 20px; }
.skeleton-btn    { height: 36px; width: 100px; border-radius: 8px; }
.skeleton-detail-wrap { animation: none; }

/* ── Empty states ────────────────────────────────────────────────────────── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 24px;
    text-align: center;
    color: var(--text-muted);
}
.empty-state-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--primary) 10%, transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    font-size: 2rem;
    color: var(--primary);
}
.empty-state-heading {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}
.empty-state-message {
    font-size: 0.925rem;
    max-width: 380px;
    margin-bottom: 24px;
    line-height: 1.5;
}
.empty-state-cta { min-width: 140px; }

/* ── Responsive breakpoints ──────────────────────────────────────────────── */

/* Desktop: Show hamburger to toggle sidebar */
.topbar-hamburger { 
    display: flex; 
}

/* Sidebar collapsible state */
.sidebar.collapsed {
    transform: translateX(-240px);
}

.main-shell.sidebar-collapsed {
    margin-left: 0;
}

@media (max-width: 768px) {
    .sidebar-close { 
        display: block; 
    }

    .sidebar {
        transform: translateX(-100%);
        box-shadow: 2px 0 8px rgba(0,0,0,0.3);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-shell {
        margin-left: 0;
    }

    .main-content {
        padding-top: 0;
    }

    .content-wrapper { padding: 20px 16px; }

    .page-header { flex-wrap: wrap; gap: 12px; }
    .page-header h1 { font-size: 1.4rem; }

    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }

    .data-table thead { display: none; }
    .data-table tr {
        display: block;
        border: 1px solid var(--border);
        border-radius: 8px;
        margin-bottom: 12px;
        padding: 12px;
    }
    .data-table td {
        display: flex;
        justify-content: space-between;
        padding: 4px 0;
        border: none;
        font-size: 0.875rem;
    }
    .data-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        margin-right: 8px;
        white-space: nowrap;
    }

    .dash-panel, .scan-card { padding: 16px; }

    .score-dist-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .content-wrapper { padding: 16px 12px; }
    .btn { padding: 7px 14px; font-size: 0.85rem; }
}

/* ── Notification Bell ──────────────────────────────────────────────────── */
.notif-bell-wrap { position: relative; }

.notif-bell-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--sidebar-text, #cbd5e1);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background .15s, color .15s;
}
.notif-bell-btn:hover { background: var(--sidebar-hover, #334155); color: #fff; }

.notif-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    background: #ef4444;
    color: #fff;
    border-radius: 99px;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 17px;
    text-align: center;
    pointer-events: none;
}

.notif-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,.15);
    z-index: 1000;
    overflow: hidden;
    animation: dropdownSlide 0.2s ease-out;
}

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.notif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    font-weight: 600;
    font-size: .875rem;
    border-bottom: 1px solid var(--border, #e2e8f0);
    background: var(--bg, #f8fafc);
}

.notif-list { max-height: 320px; overflow-y: auto; }

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text, #1e293b);
    border-bottom: 1px solid var(--border, #e2e8f0);
    transition: background .1s;
}
.notif-item:hover { background: var(--bg, #f8fafc); }
.notif-item.unread { background: #eff6ff; }

.notif-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}
.notif-icon.success { background: #dcfce7; color: #16a34a; }
.notif-icon.error   { background: #fee2e2; color: #dc2626; }

.notif-body { flex: 1; min-width: 0; }
.notif-title { font-size: .85rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-time  { font-size: .75rem; color: var(--text-muted, #64748b); margin-top: 2px; }

.notif-empty { padding: 24px 16px; text-align: center; color: var(--text-muted, #64748b); font-size: .875rem; }
.notif-overlay { position: fixed; inset: 0; z-index: 999; }

/* ── Confirmation Modal ─────────────────────────────────────────────────── */
.confirm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.confirm-modal-box {
    background: var(--surface, #fff);
    border-radius: 16px;
    padding: 32px 28px 24px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    text-align: center;
}

.confirm-modal-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin: 0 auto 16px;
    background: #fef9c3;
    color: #b45309;
}
.confirm-modal-icon.danger { background: #fee2e2; color: #dc2626; }

.confirm-modal-title   { font-size: 1.125rem; font-weight: 700; margin-bottom: 8px; }
.confirm-modal-message { font-size: .9rem; color: var(--text-muted, #64748b); margin-bottom: 24px; }

.confirm-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.spinner-sm {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .6s linear infinite;
    margin-right: 6px;
    vertical-align: middle;
}

/* ── Score Breakdown Panel ──────────────────────────────────────────────── */
.score-breakdown-wrap { margin: 8px 0 24px; }

.score-breakdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 8px;
    padding: 6px 14px;
    font-size: .85rem;
    color: var(--text-muted, #64748b);
    cursor: pointer;
    transition: border-color .15s, color .15s;
}
.score-breakdown-toggle:hover { border-color: var(--primary, #4f46e5); color: var(--primary, #4f46e5); }

.score-breakdown-panel {
    margin-top: 12px;
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    padding: 20px 24px;
}

.score-breakdown-desc { font-size: .9rem; margin-bottom: 16px; color: var(--text-muted, #64748b); }

.score-breakdown-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}
.score-breakdown-table th {
    text-align: left;
    padding: 6px 12px;
    background: var(--bg, #f8fafc);
    font-weight: 600;
    border-bottom: 2px solid var(--border, #e2e8f0);
}
.score-breakdown-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border, #e2e8f0);
}
.score-breakdown-table tfoot td {
    padding: 10px 12px;
    background: var(--bg, #f8fafc);
    font-size: .9rem;
}
.score-breakdown-note { font-size: .78rem; color: var(--text-muted, #64748b); margin-top: 12px; }

/* ── Team / Org pages ───────────────────────────────────────────────────── */
.team-card {
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 16px;
}
.team-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.team-card-title { font-size: 1.05rem; font-weight: 600; }
.team-member-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border, #e2e8f0);
    font-size: .875rem;
}
.team-member-row:last-child { border-bottom: none; }
.team-member-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--primary, #4f46e5);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: .8rem; font-weight: 700;
    flex-shrink: 0;
}
.team-role-badge {
    padding: 2px 8px;
    border-radius: 20px;
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    background: #e0e7ff;
    color: #3730a3;
}
.team-role-badge.owner { background: #fef3c7; color: #b45309; }
.team-role-badge.admin { background: #dcfce7; color: #15803d; }


/* ── Avg score trend chart ───────────────────────────────────────────────── */
.avg-trend-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 20px 12px;
    margin-bottom: 28px;
}
.avg-trend-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 8px;
}
.avg-trend-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}
.avg-trend-delta {
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}
.avg-trend-svg {
    width: 100%;
    height: auto;
    display: block;
    overflow: visible;
}
.avg-trend-single {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
}
.avg-trend-solo {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
}
.avg-trend-solo-label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ── Bulk action toolbar ─────────────────────────────────────────────────── */
.bulk-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--border));
    border-radius: 8px;
    padding: 10px 16px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.bulk-count {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary);
    margin-right: auto;
}
.bulk-check {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}
.row-selected { background: color-mix(in srgb, var(--primary) 6%, var(--surface)); }

/* ── Issue trend chart ───────────────────────────────────────────────────── */
.issue-trend-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 20px 12px;
    margin-bottom: 28px;
}
.issue-trend-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.issue-trend-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}
.issue-trend-legend {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-right: auto;
}
.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}
.issue-trend-delta {
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}
.issue-trend-svg {
    width: 100%;
    height: auto;
    display: block;
    overflow: visible;
}

/* ── WCAG Checklist ──────────────────────────────────────────────────────── */
.wcag-checklist { margin-top: 8px; }
.wcag-checklist-legend {
    display: flex;
    gap: 16px;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    align-items: center;
}
.wcag-legend-pass { color: var(--success); }
.wcag-legend-fail { color: var(--danger); }

.wcag-principle {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 12px;
    overflow: hidden;
}
.wcag-principle-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.wcag-principle-icon {
    font-size: 1.1rem;
    color: var(--primary);
    width: 24px;
    text-align: center;
}
.wcag-principle-name {
    font-weight: 700;
    font-size: 0.95rem;
    flex: 1;
}
.wcag-principle-counts { display: flex; gap: 6px; }
.wcag-chip {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
}
.wcag-chip-fail { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.wcag-chip-pass { background: color-mix(in srgb, var(--success) 12%, transparent); color: var(--success); }

.wcag-criteria-list { padding: 4px 0; }
.wcag-criterion {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border);
    transition: background 0.1s;
}
.wcag-criterion:last-child { border-bottom: none; }
.wcag-criterion.wcag-fail { background: color-mix(in srgb, var(--danger) 4%, transparent); }
.wcag-criterion-status { width: 18px; text-align: center; font-size: 1rem; }
.wcag-criterion-id {
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
    min-width: 38px;
}
.wcag-criterion-title { flex: 1; color: var(--text); }
.wcag-criterion-level { font-size: 0.75rem; font-weight: 700; }
.level-a   { color: var(--info); }
.level-aa  { color: var(--primary); }
.level-aaa { color: var(--text-muted); }
.wcag-criterion-count {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--danger);
    background: color-mix(in srgb, var(--danger) 10%, transparent);
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
}
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }

/* ═══════════════════════════════════════════════════════════════
   DASHBOARD — layout, panels, score distribution, violations chart
   ═══════════════════════════════════════════════════════════════ */

/* ── Section wrapper ─────────────────────────────────────────── */
.dash-section {
    margin-top: 28px;
}

/* ── Two-column grid ─────────────────────────────────────────── */
.dash-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 28px;
}
@media (max-width: 900px) {
    .dash-two-col { grid-template-columns: 1fr; }
}

/* ── Panel card ──────────────────────────────────────────────── */
.dash-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 22px 24px;
    transition: box-shadow .2s;
}
.dash-panel:hover {
    box-shadow: 0 0 0 1px var(--primary), 0 4px 24px var(--glow);
}

/* ── Score Distribution row ──────────────────────────────────── */
.score-dist-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-top: 16px;
}
@media (max-width: 700px) {
    .score-dist-row { grid-template-columns: repeat(2, 1fr); }
}

.score-dist-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px 14px;
    text-align: center;
    border-top-width: 3px;
    transition: transform .15s, box-shadow .15s;
}
.score-dist-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 18px rgba(0,0,0,.3);
}

.score-dist-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 6px;
}
.score-dist-label {
    font-size: .78rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* Color variants — override any legacy light-mode backgrounds */
.score-dist-card.score-great { border-top-color: #10b981; background: var(--surface); border-color: var(--border); border-top-color: #10b981; }
.score-dist-card.score-great .score-dist-value { color: #10b981; }

.score-dist-card.score-good  { border-top-color: #06b6d4; background: var(--surface); border-color: var(--border); border-top-color: #06b6d4; }
.score-dist-card.score-good  .score-dist-value { color: #06b6d4; }

.score-dist-card.score-fair  { border-top-color: #f59e0b; background: var(--surface); border-color: var(--border); border-top-color: #f59e0b; }
.score-dist-card.score-fair  .score-dist-value { color: #f59e0b; }

.score-dist-card.score-poor  { border-top-color: #ef4444; background: var(--surface); border-color: var(--border); border-top-color: #ef4444; }
.score-dist-card.score-poor  .score-dist-value { color: #ef4444; }

/* ── Violations bar chart ────────────────────────────────────── */
.violations-chart {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.vc-row {
    display: grid;
    grid-template-columns: 180px 1fr 44px;
    align-items: center;
    gap: 10px;
}
@media (max-width: 600px) {
    .vc-row { grid-template-columns: 120px 1fr 36px; }
}

.vc-label {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
}

.vc-rule-id {
    font-size: .78rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vc-bar-wrap {
    background: rgba(255,255,255,.06);
    border-radius: 6px;
    height: 10px;
    overflow: hidden;
}

.vc-bar {
    height: 100%;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--primary), #0ea5e9);
    box-shadow: 0 0 8px var(--glow);
    min-width: 4px;
    transition: width .4s ease;
}

.vc-count {
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-align: right;
}

/* ── Sites needing attention ─────────────────────────────────── */
.attention-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.attention-card {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 13px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.attention-card:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary), 0 2px 12px var(--glow);
    background: color-mix(in srgb, var(--primary) 5%, var(--bg));
    color: inherit;
    text-decoration: none;
}

.attention-name {
    font-weight: 600;
    font-size: .9rem;
    color: var(--text);
}
.attention-url {
    font-size: .75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.attention-score-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}
.attention-critical {
    font-size: .72rem;
    font-weight: 600;
    color: #ef4444;
    background: rgba(239,68,68,.12);
    border-radius: 20px;
    padding: 2px 8px;
}

/* ── Alert info banner (active scans) ────────────────────────── */
.alert-info-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: color-mix(in srgb, var(--primary) 10%, var(--surface));
    border: 1px solid var(--primary);
    border-radius: 10px;
    padding: 12px 18px;
    margin-top: 16px;
    font-size: .9rem;
    color: var(--text);
}

.spinner-sm {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Section title ───────────────────────────────────────────── */
.section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 16px;
    letter-spacing: .01em;
}

/* ── Responsive Sidebar ───────────────────────────────────────── */
/* Desktop: sidebar always visible, no overlay ever */
.sidebar-overlay {
    display: none !important;
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

/* Mobile: sidebar hidden by default, overlay when open */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay {
        display: none;
    }

    .sidebar-overlay.open {
        display: block !important;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 99;
        backdrop-filter: blur(2px);
        animation: fadeIn 0.2s ease;
    }

    .sidebar-close {
        display: block;
    }

    .main-shell {
        margin-left: 0 !important;
    }

    .topbar-hamburger {
        display: flex;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
