/* ── Accident Overview — FEAT-595 ───────────────────────────────────────── */
/* Prefix: acc- */

.acc-page {
    padding: 16px 20px;
    max-width: 1400px;
}

/* ── Header ────────────────────────────────────────────────────────────── */
.acc-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.acc-page-title {
    font-size: 1.3rem;
    font-weight: 700;
    white-space: nowrap;
}

.acc-filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1;
}

.acc-load-btn {
    padding: 6px 14px;
    border-radius: 6px;
    border: none;
    background: var(--hi-accent, #4a9eff);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.acc-load-btn:hover { background: #3a8eef; }

.acc-filter-bar-label {
    font-size: 0.82rem;
    color: var(--hi-muted, #8899aa);
}

.acc-caveat {
    font-size: 0.8rem;
    color: var(--hi-muted, #8899aa);
    margin: 0 0 14px;
    font-style: italic;
}

/* ── Summary strip ─────────────────────────────────────────────────────── */
.acc-summary-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.acc-tile {
    background: var(--hi-card-bg, #22253a);
    border: 1px solid var(--hi-border, #3a3d47);
    border-radius: 8px;
    padding: 10px 16px;
    min-width: 120px;
    flex: 1 1 140px;
}

.acc-tile-btn {
    cursor: pointer;
    text-align: left;
    font: inherit;
    color: inherit;
}

.acc-tile-btn:hover {
    border-color: var(--hi-accent, #4a9eff);
    background: var(--hi-card-hover, #2a2e48);
}

.acc-tile-label {
    font-size: 0.74rem;
    color: var(--hi-muted, #8899aa);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.acc-tile-value {
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.1;
}

.acc-tile-hint {
    font-size: 0.7rem;
    color: var(--hi-muted, #8899aa);
    margin-top: 2px;
    white-space: normal;
}

/* ── Layout helpers ────────────────────────────────────────────────────── */
.acc-row-2col {
    display: flex;
    gap: 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.acc-col-wide  { flex: 3 1 400px; min-width: 0; }
.acc-col-narrow { flex: 1 1 200px; min-width: 0; }

.acc-section-card {
    background: var(--hi-card-bg, #22253a);
    border: 1px solid var(--hi-border, #3a3d47);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 18px;
}

.acc-section-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--hi-muted, #8899aa);
    margin-bottom: 8px;
}

.acc-trend-chart { width: 100%; }
.acc-themes-chart { width: 100%; }

/* ── Plain table ────────────────────────────────────────────────────────── */
.acc-plain-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
}

.acc-plain-table th {
    text-align: left;
    padding: 6px 8px;
    border-bottom: 1px solid var(--hi-border, #3a3d47);
    color: var(--hi-muted, #8899aa);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.acc-plain-table td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--hi-border-faint, #2a2d3a);
    vertical-align: middle;
}

.acc-plain-table tr:last-child td { border-bottom: none; }

.acc-plain-table tr:hover td {
    background: var(--hi-row-hover, rgba(74,158,255,0.05));
}

/* ── Concentration sub-tables ────────────────────────────────────────── */
.acc-conc-row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.acc-conc-sub { flex: 1 1 220px; min-width: 0; }

.acc-conc-sub-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--hi-muted, #8899aa);
    margin-bottom: 6px;
}

.acc-conc-table th, .acc-conc-table td { font-size: 0.82rem; }

/* ── Repeat buses ────────────────────────────────────────────────────── */
.acc-repeat-table { overflow-x: auto; }

/* ── Case list ────────────────────────────────────────────────────────── */
.acc-cases-section { overflow-x: auto; }

.acc-cases-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.acc-cases-toolbar {
    display: flex;
    gap: 6px;
    margin-left: auto;
}

.acc-filter-label {
    font-size: 0.82rem;
    color: var(--hi-accent, #4a9eff);
}

.acc-filter-active { color: var(--hi-accent, #4a9eff); font-weight: 600; }

.acc-clear-btn {
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--hi-border, #3a3d47);
    background: transparent;
    color: var(--hi-muted, #8899aa);
    cursor: pointer;
    font-size: 0.82rem;
}

.acc-clear-btn:hover { border-color: var(--hi-accent, #4a9eff); color: var(--hi-accent, #4a9eff); }

.acc-case-table { font-size: 0.82rem; white-space: nowrap; }

.acc-count-btn {
    background: none;
    border: none;
    padding: 0;
    color: var(--hi-accent, #4a9eff);
    font: inherit;
    cursor: pointer;
    font-weight: 600;
    text-decoration: underline dotted;
}

.acc-count-btn:hover { color: #3a8eef; }

.acc-view-btn {
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid var(--hi-border, #3a3d47);
    background: transparent;
    color: var(--hi-accent, #4a9eff);
    cursor: pointer;
    font-size: 0.78rem;
}

.acc-view-btn:hover { background: rgba(74,158,255,0.1); }

.acc-link { color: var(--hi-accent, #4a9eff); text-decoration: none; }
.acc-link:hover { text-decoration: underline; }

.acc-no-driver { color: var(--hi-muted, #8899aa); font-style: italic; }
.acc-muted     { color: var(--hi-muted, #8899aa); }

/* ── States ──────────────────────────────────────────────────────────── */
.acc-empty-state { padding: 24px 0; text-align: center; color: var(--hi-muted, #8899aa); }
.acc-error-state {
    padding: 12px 16px;
    background: rgba(220,53,69,0.1);
    border: 1px solid rgba(220,53,69,0.3);
    border-radius: 6px;
    color: #dc3545;
    margin: 8px 0;
}

/* ── Modal ────────────────────────────────────────────────────────────── */
.acc-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 1050;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 60px;
    overflow-y: auto;
}

.acc-modal-hidden { display: none !important; }
.acc-modal-open   { display: flex; }

.acc-modal {
    background: var(--hi-card-bg, #22253a);
    border: 1px solid var(--hi-border, #3a3d47);
    border-radius: 10px;
    width: 700px;
    max-width: calc(100vw - 32px);
    max-height: 80vh;
    overflow-y: auto;
    padding: 0;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

.acc-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--hi-border, #3a3d47);
    position: sticky;
    top: 0;
    background: var(--hi-card-bg, #22253a);
    z-index: 1;
}

.acc-modal-title { font-weight: 700; font-size: 1rem; }

.acc-modal-close {
    background: none;
    border: none;
    color: var(--hi-muted, #8899aa);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
}

.acc-modal-close:hover { background: rgba(255,255,255,0.08); color: inherit; }

.acc-modal-body { padding: 16px 18px; }

.acc-modal-inner { display: flex; flex-direction: column; gap: 14px; }

.acc-modal-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    font-size: 0.9rem;
}

.acc-modal-case-no { font-weight: 700; font-size: 1rem; }
.acc-modal-date    { color: var(--hi-muted, #8899aa); }
.acc-modal-desc    { font-size: 0.88rem; line-height: 1.5; }
.acc-modal-section { font-size: 0.88rem; }

/* ── Sort button (breakdown table headers) ─────────────────────────── */
.acc-sort-btn {
    background: none;
    border: none;
    padding: 0 2px;
    color: var(--hi-muted, #8899aa);
    font-size: 0.78rem;
    cursor: pointer;
    vertical-align: middle;
    line-height: 1;
}

.acc-sort-btn:hover { color: var(--hi-accent, #4a9eff); }

.acc-themes-table { margin-top: 12px; }

/* ── Light theme overrides ────────────────────────────────────────────── */
body[data-theme="light"] .acc-tile          { background: #f7f8fc; border-color: #dce0ea; }
body[data-theme="light"] .acc-tile-btn:hover { background: #eef2ff; }
body[data-theme="light"] .acc-section-card  { background: #f7f8fc; border-color: #dce0ea; }
body[data-theme="light"] .acc-modal         { background: #f7f8fc; border-color: #dce0ea; }
body[data-theme="light"] .acc-modal-header  { background: #f7f8fc; }
body[data-theme="light"] .acc-tile-label    { color: #6b7a99; }
body[data-theme="light"] .acc-section-label { color: #6b7a99; }
body[data-theme="light"] .acc-empty-state   { color: #6b7a99; }
body[data-theme="light"] .acc-muted         { color: #6b7a99; }
body[data-theme="light"] .acc-no-driver     { color: #6b7a99; }
body[data-theme="light"] .acc-caveat        { color: #6b7a99; }
body[data-theme="light"] .acc-filter-bar-label { color: #6b7a99; }

/* ── 390 px responsive ───────────────────────────────────────────────── */
@media (max-width: 480px) {
    .acc-row-2col   { flex-direction: column; }
    .acc-conc-row   { flex-direction: column; }
    .acc-summary-strip { gap: 8px; }
    .acc-tile       { flex: 1 1 44%; }
    .acc-cases-header { flex-direction: column; align-items: flex-start; }
    .acc-cases-toolbar { margin-left: 0; }
    .acc-modal      { max-height: 90vh; }
}
