/* ═══════════════════════════════════════════════════════
   MSDE Document Accessibility Remediation Tool
   ═══════════════════════════════════════════════════════ */

:root {
    --navy: #1B2A4A;
    --blue: #2E75B6;
    --green: #2D8B4E;
    --orange: #E57200;
    --red: #D32F2F;
    --dark-gray: #333333;
    --med-gray: #666666;
    --light-gray: #F2F4F7;
    --border: #E0E4E8;
    --white: #FFFFFF;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --radius: 8px;
    --radius-sm: 4px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--light-gray);
    color: var(--dark-gray);
    line-height: 1.5;
}

/* ─── Navbar ──────────────────────────────────────────── */
.navbar {
    background: var(--navy);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 56px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-brand a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--white);
}
.nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--blue);
    border-radius: 6px;
    font-weight: 700;
    font-size: 18px;
    color: white;
}
.nav-title { font-weight: 600; font-size: 15px; }
.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-link {
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: all 0.15s;
}
.nav-link:hover, .nav-link.active { color: white; background: rgba(255,255,255,0.1); }
.btn-upload {
    background: var(--blue) !important;
    color: white !important;
    font-weight: 500;
}
.btn-upload:hover { background: #2563a0 !important; }

/* User dropdown */
.nav-user { position: relative; }
.nav-user-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 4px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    min-width: 180px;
    overflow: hidden;
    z-index: 200;
}
.dropdown-menu.show { display: block; }
.dropdown-menu a {
    display: block;
    padding: 10px 16px;
    color: var(--dark-gray);
    text-decoration: none;
    font-size: 14px;
}
.dropdown-menu a:hover { background: var(--light-gray); }
.dropdown-divider { border-top: 1px solid var(--border); margin: 4px 0; }

/* ─── Container ───────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 24px; }

/* ─── Page Header ─────────────────────────────────────── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}
.page-header h1 { font-size: 24px; color: var(--navy); margin-bottom: 2px; }
.subtitle { color: var(--med-gray); font-size: 14px; }
.back-link {
    color: var(--blue);
    text-decoration: none;
    font-size: 13px;
    display: inline-block;
    margin-bottom: 8px;
}
.back-link:hover { text-decoration: underline; }
.header-badges { display: flex; gap: 8px; align-items: center; }

/* ─── Buttons ─────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--dark-gray);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
}
.btn:hover { background: var(--light-gray); }
.btn-primary { background: var(--blue); color: white; border-color: var(--blue); }
.btn-primary:hover { background: #2563a0; }
.btn-full { width: 100%; justify-content: center; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-xs { padding: 4px 10px; font-size: 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ─── Stats Row ───────────────────────────────────────── */
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow);
}
.stat-number { font-size: 32px; font-weight: 700; color: var(--navy); }
.stat-label { font-size: 13px; color: var(--med-gray); margin-top: 4px; }

/* ─── Filters ─────────────────────────────────────────── */
.filters-bar {
    background: white;
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}
.filters-form { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.filter-group select, .filter-group input {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: white;
    color: var(--dark-gray);
    min-width: 140px;
}
.search-group { flex: 1; min-width: 200px; }
.search-group input { width: 100%; }

/* ─── Document Grid ───────────────────────────────────── */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.doc-card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: inherit;
    transition: all 0.15s;
    display: flex;
    flex-direction: column;
    border: 2px solid transparent;
}
.doc-card:hover { border-color: var(--blue); box-shadow: var(--shadow-md); }
.doc-card-header { display: flex; justify-content: space-between; margin-bottom: 12px; }
.doc-card-title { font-size: 16px; font-weight: 600; color: var(--navy); margin-bottom: 4px; }
.doc-card-meta { font-size: 12px; color: var(--med-gray); flex: 1; }
.doc-card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.doc-date { font-size: 12px; color: var(--med-gray); }

/* Badges */
.file-type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge-docx { background: #E8F0FE; color: #1967D2; }
.badge-pptx { background: #FDE8E0; color: #C4402F; }
.badge-pdf { background: #FCE4EC; color: #C62828; }
.branch-badge { font-size: 11px; color: var(--med-gray); background: var(--light-gray); padding: 2px 8px; border-radius: 3px; }
.status-badge { font-size: 12px; padding: 3px 10px; border-radius: 12px; font-weight: 500; }
.status-completed { background: #E8F5E9; color: var(--green); }
.status-processing { background: #E3F2FD; color: var(--blue); }
.status-failed { background: #FFEBEE; color: var(--red); }

/* Score bar */
.score-indicator { display: flex; align-items: center; gap: 8px; flex: 1; }
.score-bar { flex: 1; height: 6px; background: var(--light-gray); border-radius: 3px; overflow: hidden; }
.score-fill { height: 100%; border-radius: 3px; transition: width 0.3s; }
.score-value { font-size: 14px; font-weight: 700; min-width: 40px; }

/* ─── Score Section (Document Detail) ─────────────────── */
.score-section {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}
.score-main { display: flex; align-items: center; gap: 32px; }
.score-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 6px solid var(--score-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.score-number { font-size: 28px; font-weight: 700; color: var(--score-color); }
.score-details h2 { margin-bottom: 12px; }
.score-stats { display: flex; gap: 32px; }
.score-stat { display: flex; flex-direction: column; }
.stat-val { font-size: 24px; font-weight: 700; }
.stat-lbl { font-size: 12px; color: var(--med-gray); }

/* ─── Documents Section ───────────────────────────────── */
.section-title { font-size: 18px; color: var(--navy); margin-bottom: 16px; }
.documents-section { margin-bottom: 24px; }
.doc-files-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.doc-file-card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 12px;
    border: 2px solid var(--border);
}
.doc-file-card .doc-file-top {
    display: flex;
    align-items: center;
    gap: 16px;
}
.doc-file-primary { border-color: var(--green); background: #F8FFF8; }
.doc-file-icon { flex-shrink: 0; }
.doc-file-info { flex: 1; }
.doc-file-info h4 { font-size: 14px; color: var(--navy); margin-bottom: 2px; }
.doc-file-info p { font-size: 12px; color: var(--med-gray); }
.file-size { font-size: 11px; color: var(--med-gray); }
.doc-file-card .btn { align-self: stretch; justify-content: center; }

/* ─── Findings Section ────────────────────────────────── */
.findings-section { margin-bottom: 24px; }
.finding-group {
    background: white;
    border-radius: var(--radius);
    margin-bottom: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.finding-group-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--navy);
    text-align: left;
}
.finding-group-header:hover { background: var(--light-gray); }
.finding-group-title { display: flex; align-items: center; gap: 10px; }
.finding-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    background: var(--light-gray);
    border-radius: 11px;
    font-size: 12px;
    font-weight: 600;
    color: var(--med-gray);
    padding: 0 6px;
}
.chevron { transition: transform 0.2s; color: var(--med-gray); }
.finding-group-header.open .chevron { transform: rotate(180deg); }

.finding-group-body { padding: 0 20px 16px; }
.finding-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.finding-item:last-child { border-bottom: none; }
.finding-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.finding-criterion {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 12px;
    background: var(--light-gray);
    padding: 2px 6px;
    border-radius: 3px;
    color: var(--med-gray);
}
.finding-name { font-size: 13px; font-weight: 600; color: var(--navy); }
.severity-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}
.severity-critical, .severity-dot.severity-critical { background: var(--red); }
.severity-major, .severity-dot.severity-major { background: var(--orange); }
.severity-minor, .severity-dot.severity-minor { background: #FFC107; }
.severity-badge {
    font-size: 11px;
    padding: 1px 8px;
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
}
.severity-badge.severity-critical { background: #FFEBEE; color: var(--red); }
.severity-badge.severity-major { background: #FFF3E0; color: var(--orange); }
.severity-badge.severity-minor { background: #FFFDE7; color: #F57F17; }
.remediated-badge { font-size: 11px; padding: 1px 8px; border-radius: 3px; background: #E8F5E9; color: var(--green); font-weight: 600; }
.finding-desc { font-size: 13px; color: var(--dark-gray); margin-bottom: 4px; }
.finding-location { font-size: 12px; color: var(--med-gray); font-style: italic; }
.finding-action { font-size: 12px; color: var(--blue); margin-top: 4px; }

/* ─── Upload Page ─────────────────────────────────────── */
.upload-container { max-width: 640px; margin: 0 auto; }
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 48px 24px;
    text-align: center;
    background: white;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.upload-zone:hover, .upload-zone.drag-over { border-color: var(--blue); background: #F0F7FF; }
.upload-icon { margin-bottom: 4px; }
.upload-text { font-size: 15px; color: var(--dark-gray); }
.upload-browse { color: var(--blue); font-weight: 500; }
.upload-hint { font-size: 12px; color: var(--med-gray); }

.file-preview {
    background: white;
    border: 2px solid var(--blue);
    border-radius: var(--radius);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.file-preview-info { display: flex; align-items: center; gap: 12px; }
.file-preview-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 12px;
    color: white;
}
.icon-docx { background: #1967D2; }
.icon-pptx { background: #C4402F; }
.icon-pdf { background: #C62828; }
.file-preview-name { font-weight: 600; font-size: 14px; }
.file-preview-size { font-size: 12px; color: var(--med-gray); }
.file-preview-remove {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--med-gray);
    cursor: pointer;
    padding: 4px 8px;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 20px 0; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 13px; font-weight: 600; color: var(--dark-gray); }
.required { color: var(--red); }
.optional { color: var(--med-gray); font-weight: 400; }
.form-group input, .form-group select {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
}
.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(46,117,182,0.15);
}

/* Processing overlay */
.processing-overlay {
    position: fixed;
    inset: 0;
    background: rgba(27,42,74,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.processing-card {
    background: white;
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
    max-width: 400px;
    width: 90%;
}
.processing-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--light-gray);
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.processing-card h3 { color: var(--navy); margin-bottom: 20px; }
.processing-steps { text-align: left; margin: 0 auto; max-width: 250px; }
.step { display: flex; align-items: center; gap: 10px; padding: 8px 0; color: var(--med-gray); font-size: 14px; }
.step.active { color: var(--navy); font-weight: 500; }
.step-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border);
    flex-shrink: 0;
}
.step.active .step-dot { background: var(--blue); }
.processing-note { font-size: 12px; color: var(--med-gray); margin-top: 20px; }

/* ─── Empty State ─────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 60px 24px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: var(--light-gray);
    border-radius: 50%;
    font-size: 28px;
    font-weight: 700;
    color: var(--blue);
    margin-bottom: 16px;
}
.empty-state h2 { color: var(--navy); margin-bottom: 8px; }
.empty-state p { color: var(--med-gray); margin-bottom: 20px; }

/* ─── Login Page ──────────────────────────────────────── */
.login-body {
    background: linear-gradient(135deg, var(--navy) 0%, #2E4A6E 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-container {
    background: white;
    border-radius: 12px;
    padding: 40px;
    width: 400px;
    max-width: 90vw;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}
.login-header { text-align: center; margin-bottom: 28px; }
.login-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: var(--navy);
    border-radius: 12px;
    font-size: 28px;
    font-weight: 700;
    color: white;
    margin-bottom: 16px;
}
.login-header h1 { font-size: 22px; color: var(--navy); margin-bottom: 4px; }
.login-header p { font-size: 13px; color: var(--med-gray); }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-footer { text-align: center; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }
.login-footer p { font-size: 12px; color: var(--med-gray); }

/* ─── Admin ───────────────────────────────────────────── */
.admin-card {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}
.admin-card h3 { color: var(--navy); margin-bottom: 16px; }
.card-desc { font-size: 13px; color: var(--med-gray); margin-bottom: 16px; }
.current-value { font-size: 12px; color: var(--med-gray); margin-bottom: 4px; font-family: monospace; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th { text-align: left; padding: 10px 12px; background: var(--light-gray); color: var(--navy); font-weight: 600; border-bottom: 2px solid var(--border); }
.admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.admin-table tr:hover td { background: #FAFBFC; }
.actions-cell { white-space: nowrap; }
.role-badge { font-size: 11px; padding: 2px 8px; border-radius: 3px; font-weight: 600; text-transform: uppercase; }
.role-admin { background: #E8F0FE; color: #1967D2; }
.role-user { background: var(--light-gray); color: var(--med-gray); }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.status-dot.active { background: var(--green); }
.status-dot.inactive { background: var(--red); }
.checkbox-group { display: flex; flex-wrap: wrap; gap: 12px; }
.checkbox-label { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.empty-text { color: var(--med-gray); font-size: 14px; }

/* ─── Error Card ──────────────────────────────────────── */
.error-card {
    background: #FFEBEE;
    border: 1px solid #FFCDD2;
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 24px;
}
.error-card h3 { color: var(--red); margin-bottom: 8px; }
.error-card p { color: #B71C1C; font-size: 14px; }

/* ─── Flash Messages ──────────────────────────────────── */
.flash-messages { margin-bottom: 16px; }
.flash {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.flash-success { background: #E8F5E9; color: #1B5E20; border: 1px solid #C8E6C9; }
.flash-error { background: #FFEBEE; color: #B71C1C; border: 1px solid #FFCDD2; }
.flash-info { background: #E3F2FD; color: #0D47A1; border: 1px solid #BBDEFB; }
.flash-close { background: none; border: none; font-size: 18px; cursor: pointer; color: inherit; opacity: 0.6; }

/* ─── Responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
    .stats-row { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .doc-grid { grid-template-columns: 1fr; }
    .score-main { flex-direction: column; text-align: center; }
    .score-stats { flex-wrap: wrap; justify-content: center; }
    .filters-form { flex-direction: column; }
    .filter-group { width: 100%; }
    .filter-group select, .filter-group input { width: 100%; }
    .page-header { flex-direction: column; gap: 12px; }
}

/* Before/After Score Pair */
.score-pair {
    display: flex;
    align-items: center;
    gap: 16px;
}
.score-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.score-box-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
}
.score-box-sublabel {
    font-size: 13px;
    font-weight: 600;
}
.score-arrow {
    font-size: 28px;
    color: #999;
    margin: 12px 4px 0;
}
.score-arrow-sm {
    font-size: 12px;
    color: #999;
    margin: 0 2px;
}
.score-pre, .score-post {
    font-weight: 600;
    font-size: 13px;
}

/* ─── Document Table ──────────────────────────────────── */
.doc-table-wrap {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.doc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.doc-table thead th {
    text-align: left;
    padding: 12px 16px;
    background: var(--navy);
    color: white;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
}
.doc-table thead th.col-score {
    text-align: center;
}
.doc-table tbody tr {
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.1s;
}
.doc-table tbody tr:hover {
    background: #F0F4F8;
}
.doc-table tbody tr:last-child {
    border-bottom: none;
}
.doc-table td {
    padding: 12px 16px;
    vertical-align: middle;
}
.doc-table td.col-score {
    text-align: center;
}
.doc-table-title {
    font-weight: 600;
    color: var(--navy);
    font-size: 14px;
    margin-bottom: 1px;
}
.doc-table-filename {
    font-size: 12px;
    color: var(--med-gray);
}
.doc-table-date {
    white-space: nowrap;
    color: var(--med-gray);
    font-size: 13px;
}
.table-score {
    font-weight: 700;
    font-size: 15px;
}
.table-score-na {
    color: var(--med-gray);
    font-size: 13px;
}
.table-issues {
    font-weight: 600;
    color: var(--dark-gray);
}

@media (max-width: 768px) {
    .doc-table-wrap { overflow-x: auto; }
    .doc-table { min-width: 700px; }
}

/* ─── Danger Button ───────────────────────────────────── */
.btn-danger { background: #D32F2F; color: white; border-color: #D32F2F; }
.btn-danger:hover { background: #B71C1C; color: white; }

/* ─── Trash Page ──────────────────────────────────────── */
.trash-actions { display: flex; gap: 6px; }
.col-actions { text-align: right; }
.doc-table thead th.col-actions { text-align: right; }

/* ─── Profile Page ────────────────────────────────────── */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}
.input-disabled {
    background: var(--light-gray) !important;
    color: var(--med-gray) !important;
    cursor: not-allowed;
}
.form-hint {
    font-size: 12px;
    color: var(--med-gray);
    margin-top: 2px;
}
.branch-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.branch-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.branch-item:last-child { border-bottom: none; }
.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.detail-row:last-child { border-bottom: none; }
.detail-label {
    font-weight: 600;
    color: var(--navy);
}

@media (max-width: 768px) {
    .profile-grid { grid-template-columns: 1fr; }
}

/* ─── Resolution Workflow ─────────────────────────────── */
.rescan-section {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--blue);
}
.rescan-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 16px;
}
.resolution-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.progress-bar-wrap {
    width: 140px;
    height: 8px;
    background: var(--light-gray);
    border-radius: 4px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background: var(--green);
    border-radius: 4px;
    transition: width 0.3s;
}
.progress-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--navy);
    white-space: nowrap;
}
.rescan-upload {
    background: var(--light-gray);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
}
.rescan-form-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.rescan-file-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    flex: 1;
}
.rescan-file-input {
    display: none;
}
.rescan-filename {
    font-size: 13px;
    color: var(--med-gray);
}

/* Issue resolution */
.finding-resolved {
    opacity: 0.65;
    background: #F8FFF8;
    border-radius: var(--radius-sm);
    padding: 12px;
    margin: -12px 0;
}
.resolve-area {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--border);
}
.resolve-form {
    display: flex;
    align-items: center;
    gap: 8px;
}
.resolve-input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
}
.resolve-input:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 2px rgba(46,117,182,0.15);
}
.btn-resolve {
    background: var(--green);
    color: white;
    border-color: var(--green);
    white-space: nowrap;
}
.btn-resolve:hover {
    background: #247040;
    color: white;
}
.resolved-badge {
    font-size: 11px;
    padding: 1px 8px;
    border-radius: 3px;
    background: #E0F2E9;
    color: var(--green);
    font-weight: 600;
}
.resolve-done {
    display: flex;
    align-items: center;
    gap: 10px;
}
.resolve-note {
    font-size: 12px;
    color: var(--green);
    font-style: italic;
    flex: 1;
}

@media (max-width: 768px) {
    .rescan-header { flex-direction: column; }
    .rescan-form-row { flex-direction: column; align-items: stretch; }
    .resolve-form { flex-direction: column; }
}


/* ─── Inline Fix Controls ─────────────────────────────── */
.inline-fix-area {
    margin-top: 8px;
    padding: 10px 12px;
    background: #F0F7FF;
    border: 1px solid #D0E3F7;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.inline-fix-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.inline-fix-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--blue);
}
.inline-fix-saved {
    font-size: 11px;
    font-weight: 600;
    color: var(--green);
    background: #E0F2E9;
    padding: 1px 8px;
    border-radius: 3px;
}
.fix-input, .fix-textarea, .fix-select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    background: white;
}
.fix-textarea {
    min-height: 60px;
    resize: vertical;
}
.fix-input:focus, .fix-textarea:focus, .fix-select:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 2px rgba(46,117,182,0.15);
}
.btn-fix-save {
    align-self: flex-end;
    background: var(--blue);
    color: white;
    border-color: var(--blue);
    margin-top: 2px;
}
.btn-fix-save:hover {
    background: #2563a0;
    color: white;
}
.btn-fix-saved {
    background: var(--green) !important;
    border-color: var(--green) !important;
}

@media (max-width: 768px) {
    .inline-fix-area { padding: 8px; }
}


/* ─── Screen Reader Simulation ────────────────────────── */
.sr-summary {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
    border-left: 4px solid var(--blue);
}
.sr-summary-icon { flex-shrink: 0; }
.sr-summary-text { font-size: 15px; font-weight: 600; color: var(--navy); margin-bottom: 4px; }
.sr-summary-hint { font-size: 13px; color: var(--med-gray); }

.sr-issues-card {
    background: #FFF8F0;
    border: 1px solid #FFCC80;
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 24px;
}
.sr-issues-list { list-style: none; padding: 0; margin: 0; }
.sr-issue-item {
    padding: 8px 0;
    border-bottom: 1px solid #FFE0B2;
    font-size: 13px;
    color: #E65100;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.sr-issue-item:last-child { border-bottom: none; }
.sr-issue-item::before { content: "\26A0"; flex-shrink: 0; }

.sr-sequence {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}
.sr-nodes { display: flex; flex-direction: column; gap: 2px; }
.sr-node {
    display: flex;
    gap: 12px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: background 0.1s;
}
.sr-node:hover { background: var(--light-gray); }
.sr-node-issue { background: #FFF3E0; border-left: 3px solid var(--orange); }
.sr-node-issue:hover { background: #FFECB3; }

.sr-node-type {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    color: white;
    background: var(--med-gray);
}
.sr-node-metadata .sr-node-type { background: var(--blue); }
.sr-node-heading .sr-node-type { background: var(--navy); }
.sr-node-image .sr-node-type { background: #7B1FA2; font-size: 16px; }
.sr-node-link .sr-node-type { background: #0277BD; font-size: 14px; }
.sr-node-table .sr-node-type { background: #00695C; }
.sr-node-slide .sr-node-type, .sr-node-page .sr-node-type { background: var(--orange); font-size: 14px; }
.sr-node-paragraph .sr-node-type { background: #BDBDBD; font-size: 16px; }

.sr-node-body { flex: 1; min-width: 0; }
.sr-node-content { font-size: 14px; color: var(--dark-gray); display: block; word-break: break-word; }
.sr-node-location { font-size: 11px; color: var(--med-gray); display: block; margin-top: 2px; }
.sr-node-issue-text {
    font-size: 12px;
    color: var(--orange);
    font-weight: 600;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

@media (max-width: 768px) {
    .sr-summary { flex-direction: column; text-align: center; }
    .sr-node { padding: 8px; }
}


/* ─── Version History ─────────────────────────────────── */
.version-history {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.version-history-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 12px;
}
.version-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-left: 8px;
}
.version-item {
    display: flex;
    gap: 14px;
    padding: 10px 0;
    position: relative;
}
.version-item:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 28px;
    bottom: -2px;
    width: 2px;
    background: var(--border);
}
.version-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border);
    flex-shrink: 0;
    margin-top: 4px;
    position: relative;
    z-index: 1;
}
.version-current .version-dot {
    background: var(--green);
    box-shadow: 0 0 0 3px rgba(45,139,78,0.2);
}
.version-info { flex: 1; min-width: 0; }
.version-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.version-num {
    font-size: 13px;
    font-weight: 700;
    color: var(--navy);
}
.version-current-badge {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--green);
    background: #E0F2E9;
    padding: 1px 6px;
    border-radius: 3px;
}
.version-date {
    font-size: 12px;
    color: var(--med-gray);
}
.version-desc {
    font-size: 12px;
    color: var(--med-gray);
    margin-top: 2px;
}
.version-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}
.version-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    color: var(--blue);
    background: #E8F0FE;
    padding: 1px 6px;
    border-radius: 3px;
    margin-left: 4px;
    vertical-align: middle;
}
.version-label-text {
    display: block;
    font-size: 11px;
    color: var(--blue);
    margin-top: 2px;
}
.file-date {
    display: block;
    font-size: 11px;
    color: var(--med-gray);
    margin-top: 2px;
}

/* Screen Reader Version Selector */
.sr-version-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding: 10px 16px;
    background: #F5F7FA;
    border-radius: 8px;
    border: 1px solid #E0E0E0;
}
.sr-version-selector label {
    font-weight: 600;
    color: #1B2A4A;
    font-size: 14px;
    white-space: nowrap;
}
.sr-version-selector select {
    padding: 6px 12px;
    border: 1px solid #CCCCCC;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    color: #333;
    cursor: pointer;
    min-width: 200px;
}
.sr-version-selector select:focus {
    outline: none;
    border-color: #2E75B6;
    box-shadow: 0 0 0 2px rgba(46, 117, 182, 0.2);
}
.sr-version-label {
    font-size: 14px;
    color: #666;
}
.header-actions-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
