/**
 * DOCAC Dashboard Layout v1.0.0 — stylesheet
 * Generated from the proven PDF Checker dashboard CSS (prefix pdfac→docac),
 * plus Document-specific additions at the bottom (format banner, AI Row, bottom nav).
 * Load AFTER doc-style.css. Fully reversible.
 */
/**
 * DOCAC Dashboard Layout v1.0.0
 *
 * Mirror of acp-dashboard-layout.css from Web Checker, adapted for PDF Checker.
 *
 * This stylesheet ADDS new layout wrappers and styling. It does NOT modify
 * any existing classes or selectors. All existing functionality (PDF.js preview,
 * tabs, AI handoff, AI explain, PDF export, structure panel) continues to work.
 *
 * Structure (from outside in):
 *   .docac-dashboard                  — root wrapper (added to #docac-results)
 *   .docac-dashboard-sticky-header    — filename + score + compliance + actions
 *   .docac-dashboard-pdfua-banner     — PDF/UA Validation banner (replaces fw-banner)
 *   .docac-dashboard-filter-bar       — All / Critical / Warning filter buttons
 *   .docac-dashboard-grid             — 2-column layout (main / sidebar)
 *     .docac-dashboard-main           — preview + issues
 *     .docac-dashboard-sidebar        — Quick Nav + Page Nav + AI Handoff
 *
 * @version 1.0.0
 * @package PDFAccessibilityChecker
 */

/* ============================================================================
 * 1. ROOT — Activate dashboard layout
 * ============================================================================ */

.doc-report.docac-dashboard {
    background: #0f172a;
    color: rgba(255, 255, 255, 0.85);
    border-radius: 12px;
    overflow: visible;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}

/* Hide ORIGINAL sections we're replacing or moving.
 * We never delete them — that breaks JS hooks. We hide visually. */
.docac-dashboard .docac-compliance-inline,
.docac-dashboard .docac-ci-standard,
.docac-dashboard .score-section,
.docac-dashboard .stat-box-container,
.docac-dashboard .docac-pdfua-stats-label,
.docac-dashboard .docac-quick-summary,
.docac-dashboard .docac-country-note {
    display: none !important;
}

/* The score hero (#docac-score-hero) lives outside #docac-results — hide separately */
#docac-score-hero.doc-report:has(+ #docac-results.docac-dashboard) {
    display: none !important;
}
/* Fallback for browsers without :has() — hidden via JS */
#docac-score-hero.acp-dash-hidden { display: none !important; }

/* ============================================================================
 * 2. STICKY HEADER — filename + score + compliance + actions
 * ============================================================================ */

.docac-dashboard-sticky-header {
    background: linear-gradient(180deg, #1a2234, #131c2e);
    border-bottom: 1px solid #1e5f99;
    padding: 12px 18px;
    position: sticky;
    top: 0;
    z-index: 100;
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) auto auto auto;
    gap: 18px;
    align-items: center;
}

.docac-dashboard-sticky-header .docac-h-meta {
    min-width: 0;
}
.docac-dashboard-sticky-header .docac-h-row1 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    flex-wrap: wrap;
}
.docac-dashboard-sticky-header .docac-h-doc-icon {
    width: 18px;
    height: 18px;
    color: #93c5fd;
    flex-shrink: 0;
}
.docac-dashboard-sticky-header .docac-h-filename {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 320px;
}

/* "New scan" — prominent back link */
.docac-dashboard-sticky-header .docac-back-to-input {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(124, 58, 237, 0.15);
    border: 1px solid rgba(124, 58, 237, 0.4);
    color: #c4b5fd;
    padding: 5px 12px;
    border-radius: 5px;
    font-size: 11px;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.15s ease;
}
.docac-dashboard-sticky-header .docac-back-to-input:hover {
    background: rgba(124, 58, 237, 0.25);
    border-color: rgba(124, 58, 237, 0.6);
    color: #fff;
    text-decoration: none;
}
.docac-dashboard-sticky-header .docac-h-row2 {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.55);
    margin-top: 3px;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.docac-dashboard-sticky-header .docac-h-flag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.55);
    margin-top: 4px;
}

/* Stats compacted */
.docac-dashboard-sticky-header .docac-h-stats {
    display: flex;
    gap: 14px;
    align-items: center;
    padding-right: 4px;
}
.docac-dashboard-sticky-header .docac-h-stat {
    display: flex;
    flex-direction: column;
}
.docac-dashboard-sticky-header .docac-h-stat-n {
    font-size: 18px;
    font-weight: 500;
    line-height: 1;
    color: #fff;
}
.docac-dashboard-sticky-header .docac-h-stat-l {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-top: 2px;
}
.docac-dashboard-sticky-header .docac-h-stat-n.crit { color: #f87171; }
.docac-dashboard-sticky-header .docac-h-stat-n.warn { color: #fbbf24; }
.docac-dashboard-sticky-header .docac-h-stat-n.ok { color: #34d399; }

/* Score ring + compliance */
.docac-dashboard-sticky-header .docac-h-score {
    display: flex;
    align-items: center;
    gap: 8px;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    padding-left: 14px;
}
.docac-dashboard-sticky-header .docac-h-ring {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: conic-gradient(var(--docac-score-color, #f59e0b) 0% var(--docac-score-pct, 54%), rgba(255, 255, 255, 0.1) var(--docac-score-pct, 54%) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}
.docac-dashboard-sticky-header .docac-h-ring-inner {
    width: 30px;
    height: 30px;
    background: #1a2234;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 500;
    color: #fff;
}
.docac-dashboard-sticky-header .docac-h-score-meta {
    display: flex;
    flex-direction: column;
}
.docac-dashboard-sticky-header .docac-h-score-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.docac-dashboard-sticky-header .docac-h-compliance {
    background: #f59e0b;
    color: #1a1100;
    padding: 4px 9px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 4px;
}
.docac-dashboard-sticky-header .docac-h-compliance.compliant {
    background: #10b981;
    color: #fff;
}
.docac-dashboard-sticky-header .docac-h-compliance.fail {
    background: #dc2626;
    color: #fff;
}

/* Action buttons */
.docac-dashboard-sticky-header .docac-h-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}
.docac-dashboard-sticky-header .docac-h-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    padding: 6px 11px;
    border-radius: 5px;
    font-size: 11px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: inherit;
    text-decoration: none;
    transition: background 0.15s ease;
}
.docac-dashboard-sticky-header .docac-h-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    text-decoration: none;
}
.docac-dashboard-sticky-header .docac-h-btn.primary {
    background: #1e5f99;
    border-color: #1e5f99;
}
.docac-dashboard-sticky-header .docac-h-btn.primary:hover {
    background: #2563eb;
}

/* ============================================================================
 * 3. PDF/UA VALIDATION BANNER — replaces "framework banner" of Web Checker
 * Specific to PDF — shows ISO 14289-1 / Matterhorn validation
 * ============================================================================ */

.docac-dashboard-pdfua-banner {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(124, 58, 237, 0.08));
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px 18px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 18px;
    align-items: center;
}
.docac-dashboard-pdfua-banner.docac-pua-empty {
    display: none;
}
.docac-dashboard-pdfua-banner .docac-pua-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.75);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}
.docac-dashboard-pdfua-banner .docac-pua-label-iso {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: none;
    letter-spacing: 0;
}
.docac-dashboard-pdfua-banner .docac-pua-stats {
    display: flex;
    gap: 18px;
    align-items: center;
}
.docac-dashboard-pdfua-banner .docac-pua-stat {
    display: flex;
    flex-direction: column;
}
.docac-dashboard-pdfua-banner .docac-pua-stat-n {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    line-height: 1;
}
.docac-dashboard-pdfua-banner .docac-pua-stat-n.fail { color: #f87171; }
.docac-dashboard-pdfua-banner .docac-pua-stat-n.ok { color: #34d399; }
.docac-dashboard-pdfua-banner .docac-pua-stat-l {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.55);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-top: 2px;
}
.docac-dashboard-pdfua-banner .docac-pua-status {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #fbbf24;
    padding: 6px 12px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 600;
}
.docac-dashboard-pdfua-banner .docac-pua-status.compliant {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.4);
    color: #34d399;
}
.docac-dashboard-pdfua-banner .docac-pua-status.fail {
    background: rgba(220, 38, 38, 0.15);
    border-color: rgba(220, 38, 38, 0.4);
    color: #f87171;
}

/* ============================================================================
 * 4. AI SUMMARY — compact button
 * Hide original AI summary widget; if pdf-app.js renders an AI summary,
 * we make it inline-compact to match Web Checker pattern.
 * ============================================================================ */

.docac-dashboard .docac-ai-summary-wrap,
.docac-dashboard .acp-ai-summary-wrap {
    margin: 8px 18px !important;
    max-width: 100%;
}
.docac-dashboard .docac-ai-summary-btn,
.docac-dashboard .acp-ai-summary-btn {
    padding: 8px 14px !important;
    border-radius: 8px !important;
    background: rgba(124, 58, 237, 0.08) !important;
    border: 1px solid rgba(124, 58, 237, 0.3) !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    width: auto !important;
    min-width: 0 !important;
    font-size: 13px !important;
    cursor: pointer !important;
    flex-wrap: wrap !important;
}
.docac-dashboard .docac-ai-summary-btn-sub,
.docac-dashboard .acp-ai-summary-btn-sub {
    display: none !important;
}
.docac-dashboard .docac-ai-summary-box,
.docac-dashboard .acp-ai-summary-box {
    max-width: 100% !important;
    box-sizing: border-box;
    overflow: hidden;
    word-wrap: break-word;
}

/* ============================================================================
 * 5. FILTER BAR — All / Critical / Warning — same style as Web Checker
 * ============================================================================ */

.docac-dashboard-filter-bar {
    padding: 14px 18px 8px;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.docac-dashboard-filter-bar .docac-filter-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 4px;
}

.docac-dashboard .severity-filter-btn,
.docac-dashboard-filter-bar .severity-filter-btn {
    border-radius: 6px;
    font-weight: 600;
    padding: 7px 14px;
    font-size: 12px;
    border: 1px solid;
    transition: all 0.15s ease;
    cursor: pointer;
    background: transparent;
    font-family: inherit;
}

/* ALL — blue translucent */
.docac-dashboard .severity-filter-btn.filter-all {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.4);
    color: #93c5fd;
}
.docac-dashboard .severity-filter-btn.filter-all:hover:not(.active) {
    background: rgba(59, 130, 246, 0.18);
}
.docac-dashboard .severity-filter-btn.filter-all.active {
    background: rgba(59, 130, 246, 0.25);
    border-color: #3b82f6;
    color: #fff;
}

/* CRITICAL — red translucent */
.docac-dashboard .severity-filter-btn.filter-critical {
    background: rgba(220, 38, 38, 0.12);
    border-color: rgba(220, 38, 38, 0.4);
    color: #f87171;
}
.docac-dashboard .severity-filter-btn.filter-critical:hover:not(.active) {
    background: rgba(220, 38, 38, 0.18);
}
.docac-dashboard .severity-filter-btn.filter-critical.active {
    background: rgba(220, 38, 38, 0.25);
    border-color: #dc2626;
    color: #fca5a5;
}

/* WARNING — orange translucent */
.docac-dashboard .severity-filter-btn.filter-warning {
    background: rgba(251, 146, 60, 0.12);
    border-color: rgba(251, 146, 60, 0.4);
    color: #fb923c;
}
.docac-dashboard .severity-filter-btn.filter-warning:hover:not(.active) {
    background: rgba(251, 146, 60, 0.18);
}
.docac-dashboard .severity-filter-btn.filter-warning.active {
    background: rgba(251, 146, 60, 0.25);
    border-color: #fb923c;
    color: #fdba74;
}

/* Filter applied — hide non-matching issues */
.docac-dashboard .issue-item.docac-filtered-out {
    display: none !important;
}

/* ============================================================================
 * 6. ISSUE CARD HEADER — single-row metadata (mirrors Web Checker 15.4)
 * #N + severity + title + WCAG + page badge + Matterhorn all on one flex row
 * ============================================================================ */

.docac-dashboard .issue-item .issue-header {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 10px 12px !important;
}
.docac-dashboard .issue-item .issue-header > h5,
.docac-dashboard .issue-item .issue-header h5.issue-title {
    font-size: 14px !important;
    margin: 0 !important;
    flex: 1 1 200px !important;
    min-width: 0 !important;
    order: 3 !important;
}

/* Number badge (added by JS) */
.docac-dashboard .issue-item .issue-number-badge {
    order: 1 !important;
    flex-shrink: 0 !important;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.6);
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
}

/* PDF Checker uses .issue-header-left wrapper around badges -
 * we let it stay but remove its visual styling */
.docac-dashboard .issue-item .issue-header .issue-header-left {
    display: contents;  /* let children participate in parent flex */
}

.docac-dashboard .issue-item .severity-badge {
    order: 2 !important;
    flex-shrink: 0 !important;
}
.docac-dashboard .issue-item .wcag-badge {
    order: 4 !important;
    flex-shrink: 0 !important;
}
.docac-dashboard .issue-item .issue-page-badge {
    order: 5 !important;
    flex-shrink: 0 !important;
}
.docac-dashboard .issue-item .docac-matterhorn-badge {
    order: 6 !important;
    flex-shrink: 0 !important;
}

/* ============================================================================
 * 7. DASHBOARD GRID — main + sidebar
 * ============================================================================ */

.docac-dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 0;
    align-items: stretch;
}
.docac-dashboard-main {
    padding: 16px 18px;
    min-width: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}
.docac-dashboard-sidebar {
    padding: 16px 14px;
    background: rgba(0, 0, 0, 0.15);
    overflow-y: auto;
    max-height: calc(100vh - 200px);
    position: sticky;
    top: 110px;
}

/* ============================================================================
 * 8. SIDEBAR sections + Page Navigator (PDF-specific!)
 * ============================================================================ */

.docac-dashboard-sidebar .docac-sidebar-section {
    margin-bottom: 16px;
}
.docac-dashboard-sidebar .docac-sidebar-title {
    font-size: 10px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 10px;
    padding: 0 4px;
}

/* Page Navigator (PDF-specific) */
.docac-page-navigator {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 10px;
}
.docac-page-navigator .docac-page-nav-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
}
.docac-page-navigator .docac-page-nav-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    padding: 6px 0;
    border-radius: 4px;
    font-size: 11px;
    text-align: center;
    cursor: pointer;
    position: relative;
    font-family: inherit;
    transition: background 0.15s ease;
}
.docac-page-navigator .docac-page-nav-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}
.docac-page-navigator .docac-page-nav-btn.active {
    background: #1e5f99;
    color: #fff;
    border-color: #1e5f99;
}
.docac-page-navigator .docac-page-nav-btn.has-issues::after {
    content: '';
    position: absolute;
    top: 3px;
    right: 3px;
    width: 5px;
    height: 5px;
    background: #dc2626;
    border-radius: 50%;
}
.docac-page-navigator .docac-page-nav-btn.has-issues.warning-only::after {
    background: #fb923c;
}
.docac-page-navigator .docac-pages-summary {
    text-align: center;
    margin-top: 8px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
}

/* AI Handoff — already exists, just ensure proper wrapping in sidebar */
.docac-dashboard-sidebar .docac-aih {
    width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
}

/* ============================================================================
 * 9. SCROLLBAR styling for sidebar
 * ============================================================================ */

.docac-dashboard-sidebar::-webkit-scrollbar { width: 6px; }
.docac-dashboard-sidebar::-webkit-scrollbar-track { background: transparent; }
.docac-dashboard-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}
.docac-dashboard-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ============================================================================
 * 10. MOBILE — stack sidebar below main; sticky header rows
 * ============================================================================ */

@media (max-width: 1024px) {
    .docac-dashboard-grid {
        grid-template-columns: 1fr;
    }
    .docac-dashboard-sidebar {
        max-height: none;
        position: static;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
        border-right: none;
    }
    .docac-dashboard-main {
        border-right: none;
    }
}

@media (max-width: 1300px) {
    .docac-dashboard-sticky-header {
        grid-template-columns: 1fr auto auto;
        grid-template-areas:
            'meta score actions'
            'stats stats stats';
    }
    .docac-dashboard-sticky-header .docac-h-meta { grid-area: meta; }
    .docac-dashboard-sticky-header .docac-h-stats {
        grid-area: stats;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
        padding-top: 8px;
        margin-top: 4px;
        justify-content: flex-start;
    }
    .docac-dashboard-sticky-header .docac-h-score {
        grid-area: score;
        border-left: none;
        padding-left: 0;
    }
    .docac-dashboard-sticky-header .docac-h-actions { grid-area: actions; }
}

/* ============================================================================
 * DOC-SPECIFIC ADDITIONS (v1.0.0)
 * Format banner, header format chip, AI Row, mobile bottom nav
 * ============================================================================ */

/* ── Header format chip (replaces PDF doc icon) ── */
.docac-dashboard-sticky-header .docac-h-fmt-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 20px;
    padding: 0 7px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #fff;
    margin-right: 8px;
}

/* ── Format banner (mirror of PDF/UA banner) ── */
.docac-dashboard-format-banner {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(124, 58, 237, 0.08));
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px 18px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 18px;
    align-items: center;
}
.docac-dashboard-format-banner .docac-fmt-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.75);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}
.docac-dashboard-format-banner .docac-fmt-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
}
.docac-dashboard-format-banner .docac-fmt-pills {
    display: flex;
    gap: 6px;
    align-items: center;
}
.docac-dashboard-format-banner .docac-fmt-pill {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.6);
}
.docac-dashboard-format-banner .docac-fmt-pill.active {
    background: #1e5f99;
    color: #fff;
}
.docac-dashboard-format-banner .docac-fmt-note {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.55);
    text-align: right;
}

/* ── AI Row — AI Summary + AI Handoff side-by-side (desktop), stacked (mobile) ── */
.docac-dashboard .docac-ai-row {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    align-items: stretch !important;
    margin: 8px 0 12px 0 !important;
    padding: 0 !important;
}
.docac-dashboard .docac-ai-row > .docac-ai-summary-wrap,
.docac-dashboard .docac-ai-row > .docac-aih {
    flex: 1 1 280px !important;
    max-width: none !important;
    margin: 0 !important;
    width: auto !important;
    display: block !important;
}
@media (max-width: 1024px) {
    .docac-dashboard .docac-ai-row > .docac-ai-summary-wrap,
    .docac-dashboard .docac-ai-row > .docac-aih {
        flex: 1 1 100% !important;
    }
}

/* ── Empty-sidebar helper ── */
.docac-dashboard-grid.has-empty-sidebar {
    grid-template-columns: 1fr !important;
}
.docac-dashboard-grid.has-empty-sidebar .docac-dashboard-sidebar {
    display: none !important;
}

/* ── Mobile bottom navigation ── */
.docac-dashboard-bottom-nav {
    display: none;
    background: #0a0f1c;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding: 4px 2px 6px;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    position: sticky;
    bottom: 0;
    z-index: 50;
}
.docac-dashboard-bottom-nav .docac-btm-i {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 0;
    font-size: 9px;
    color: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    background: none;
    border: none;
    text-decoration: none;
    font-family: inherit;
}
.docac-dashboard-bottom-nav .docac-btm-i.active { color: #93c5fd; }
.docac-dashboard-bottom-nav .docac-btm-icon { font-size: 16px; }

@media (max-width: 1024px) {
    .docac-dashboard-bottom-nav { display: grid; }
    .docac-dashboard-format-banner {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .docac-dashboard-format-banner .docac-fmt-note { text-align: left; }
}
@media (min-width: 1025px) {
    .docac-dashboard-bottom-nav { display: none !important; }
}

/* ============================================================================
 * VERDICT BAR (v1.1.0) — plain-language "what's wrong / what to do", top of main
 * ============================================================================ */
.docac-dashboard .docac-verdict {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    margin: 0 0 14px 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.docac-dashboard .docac-verdict.crit {
    background: rgba(220, 38, 38, 0.12);
    border-color: rgba(248, 113, 113, 0.45);
}
.docac-dashboard .docac-verdict.warn {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(251, 191, 36, 0.4);
}
.docac-dashboard .docac-verdict.ok {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(52, 211, 153, 0.4);
}
.docac-dashboard .docac-verdict-icon {
    font-size: 20px;
    line-height: 1.3;
    flex: 0 0 auto;
}
.docac-dashboard .docac-verdict.crit .docac-verdict-icon { color: #f87171; }
.docac-dashboard .docac-verdict.warn .docac-verdict-icon { color: #fbbf24; }
.docac-dashboard .docac-verdict.ok   .docac-verdict-icon { color: #34d399; }
.docac-dashboard .docac-verdict-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.docac-dashboard .docac-verdict-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    line-height: 1.3;
}
.docac-dashboard .docac-verdict-sub {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.45;
}

/* ============================================================================
 * PHONE HEADER (v1.1.0) — ≤640px: stack the sticky header cleanly.
 * The 1300px two-row grid cramps on phones (filename squeezed, meta wraps
 * word-per-word, score/actions collide). Stack into a single column.
 * ============================================================================ */
@media (max-width: 640px) {
    .docac-dashboard .docac-dashboard-sticky-header {
        grid-template-columns: 1fr;
        grid-template-areas:
            'meta'
            'stats'
            'score'
            'actions';
        gap: 12px;
        align-items: stretch;
    }
    .docac-dashboard .docac-h-meta { grid-area: meta; }
    .docac-dashboard .docac-h-row1 { flex-wrap: wrap; }
    .docac-dashboard .docac-h-filename {
        flex: 1 1 auto;
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    /* "New scan" also exists as a button in the actions row — hide the duplicate link */
    .docac-dashboard .docac-back-to-input { display: none; }
    .docac-dashboard .docac-h-stats {
        grid-area: stats;
        justify-content: space-between;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
        padding-top: 10px;
        margin-top: 0;
    }
    .docac-dashboard .docac-h-score {
        grid-area: score;
        flex-direction: row;
        align-items: center;
        gap: 12px;
        border-left: none;
        padding-left: 0;
    }
    .docac-dashboard .docac-h-actions {
        grid-area: actions;
        display: flex;
        gap: 8px;
    }
    .docac-dashboard .docac-h-actions .docac-h-btn {
        flex: 1 1 0;
        justify-content: center;
    }
}

/* Hide the inline "← New scan" link next to the filename — it duplicates the
 * "New scan" button in the header actions. Keep a single, prominent action. */
.docac-dashboard .docac-back-to-input { display: none; }