:root {
    --bg: #f8fafc;
    --surface-light: #f8fafc;
    --surface: #f1f5f9;
    --surface-alt: #ffffff;
    --surface-strong: #0f172a;
    --text: #111827;
    --text-muted: #475569;
    --text-soft: #64748b;
    --accent: #2563eb;
    --accent2: #1d4ed8;
    --accent-soft: rgba(37, 99, 235, 0.1);
    --success: #15803d;
    --warning: #b45309;
    --danger: #dc2626;
    --border: rgba(15, 23, 42, 0.08);
    --border-strong: rgba(15, 23, 42, 0.14);
    --border-width: 1px;
    --glass: rgba(255, 255, 255, 0.34);
    --glass-border: rgba(255, 255, 255, 0.46);
    --shadow: rgba(15, 23, 42, 0.06);
    --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.06);
    --shadow-card: 0 12px 32px rgba(15, 23, 42, 0.07);
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 24px;
}

.snapshot-iss-block .info-value {
    font-size: 1.7rem !important;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.07), transparent 24%),
        linear-gradient(180deg, #ffffff 0%, var(--bg) 42%, #f8fafc 100%);
    color: var(--text);
    font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-weight: 400;
    overflow-x: hidden;
    min-height: 100vh;
    line-height: 1.5;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.06) 0%, rgba(248,250,252,0.14) 40%, rgba(244,247,251,0.2) 100%),
        radial-gradient(circle at 15% 20%, rgba(37, 99, 235, 0.025), transparent 30%),
        radial-gradient(circle at 85% 18%, rgba(15, 23, 42, 0.015), transparent 28%);
    z-index: -4;
    pointer-events: none;
}

.truck-background {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: -3;
}

.truck-sprite {
    position: absolute;
    width: clamp(220px, 18vw, 360px);
    aspect-ratio: 2.8 / 1;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.1;
    filter: none;
    will-change: transform;
}

.truck-left {
    background-image: var(--truck-left-image);
    animation: truck-drift-left var(--truck-duration, 30s) linear infinite;
}

.truck-right {
    background-image: var(--truck-right-image);
    animation: truck-drift-right var(--truck-duration, 34s) linear infinite;
}

.truck-left-1 {
    --truck-left-image: url('/truck-assets/left1.png');
    --truck-duration: 34s;
    top: 8%;
    animation-delay: -10s;
}

.truck-left-2 {
    --truck-left-image: url('/truck-assets/left2.png');
    --truck-duration: 28s;
    top: 32%;
    animation-delay: -18s;
}

.truck-left-3 {
    --truck-left-image: url('/truck-assets/left1.png');
    --truck-duration: 38s;
    top: 58%;
    animation-delay: -6s;
}

.truck-left-4 {
    --truck-left-image: url('/truck-assets/left2.png');
    --truck-duration: 31s;
    top: 80%;
    animation-delay: -22s;
}

.truck-right-1 {
    --truck-right-image: url('/truck-assets/right1.png');
    --truck-duration: 36s;
    top: 16%;
    animation-delay: -15s;
}

.truck-right-2 {
    --truck-right-image: url('/truck-assets/right2.png');
    --truck-duration: 27s;
    top: 44%;
    animation-delay: -5s;
}

.truck-right-3 {
    --truck-right-image: url('/truck-assets/right1.png');
    --truck-duration: 40s;
    top: 68%;
    animation-delay: -20s;
}

.truck-right-4 {
    --truck-right-image: url('/truck-assets/right2.png');
    --truck-duration: 33s;
    top: 88%;
    animation-delay: -12s;
}

@keyframes truck-drift-left {
    from {
        transform: translate3d(115vw, 0, 0);
    }
    to {
        transform: translate3d(-32vw, 0, 0);
    }
}

@keyframes truck-drift-right {
    from {
        transform: translate3d(-35vw, 0, 0);
    }
    to {
        transform: translate3d(118vw, 0, 0);
    }
}

/* Collapsible sections */
.collapsible-section {
    margin-bottom: 1.5rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background-color: #f1f5f9;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    transition: background-color 0.2s;
    margin-bottom: 0.5rem;
}

    .section-header:hover {
        background-color: #e2e8f0;
    }

    .section-header .section-title {
        font-size: 1.2rem;
        font-weight: 600;
        color: var(--text);
        margin: 0;
        border-bottom: none;
        padding: 0;
    }

.toggle-arrow {
    font-size: 1.2rem;
    transition: transform 0.2s;
}

.section-content {
    padding: 0;
    background: transparent;
    border: none;
}

.collapsible-section.collapsed .section-content {
    display: none;
}

.collapsible-section.collapsed .toggle-arrow {
    transform: rotate(-90deg);
}

/* Report sections – remove borders and extra padding */
.report-section,
.collapsible-section {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 0;
}

/* Two-column grid — stretch edge-to-edge */
.two-column-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
    width: 100vw;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    padding-left: 2rem;
    padding-right: 2rem;
}

.subpanel-card {
    background: var(--glass);
    border: var(--border-width) solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 2px 10px var(--shadow);
}

.subpanel-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.subpanel-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.subpanel-title-row .subpanel-title {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.card-refresh-btn {
    min-width: 112px;
    border: 1px solid rgba(40, 92, 243, 0.18);
    border-radius: 999px;
    background: #eef2ff;
    color: #285cf3;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.45rem 0.8rem;
    white-space: nowrap;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
}

.card-refresh-btn:hover:not(:disabled) {
    background: #dbe7ff;
}

.card-refresh-btn:disabled {
    cursor: default;
    opacity: 0.7;
}

.card-refresh-btn-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.card-refresh-btn-spinner {
    width: 16px;
    height: 16px;
    border-radius: 999px;
    border: 2px solid rgba(37, 99, 235, 0.22);
    border-top-color: #2563eb;
    animation: report-update-spin 0.8s linear infinite;
}

.deferred-top-action.hidden,
.deferred-card-empty-action.hidden {
    display: none !important;
}

.deferred-card-empty-action {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 140px;
    padding: 0.5rem 0 0.75rem;
}

.deferred-center-action {
    min-width: 132px;
    justify-content: center;
}

/* ?? Deferred section "Load" wrapper (Revocations & OOS Orders) ???????? */
.deferred-section-load-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 1.5rem 1rem;
    text-align: center;
    width: 100%;
}

.deferred-section-load-wrap.hidden {
    display: none !important;
}

.deferred-section-load-btn {
    min-width: 132px;
    border: 1px solid rgba(40, 92, 243, 0.18);
    border-radius: 999px;
    background: #eef2ff;
    color: #285cf3;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.55rem 1.4rem;
    cursor: pointer;
    transition: background 120ms ease, color 120ms ease, box-shadow 120ms ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.deferred-section-load-btn:hover {
    background: #dbeafe;
    box-shadow: 0 2px 8px rgba(40, 92, 243, 0.18);
}

.deferred-section-load-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.deferred-section-load-hint {
    color: #64748b;
    font-size: 0.82rem;
}

/* ?? Revocations & OOS card (fixed height, scrollable inner area) ??? */
.revocations-oos-card {
    /* Keep the card a predictable size so the inner table is the scrollable
       region instead of pushing the page height. */
    max-height: 420px;
    display: flex;
    flex-direction: column;
}

.revocations-oos-content {
    flex: 1 1 auto;
    min-height: 0;          /* allow the flex child to actually shrink */
    overflow-y: auto;
    padding-right: 0.25rem; /* breathing room for the scrollbar */
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.revocations-oos-banner:empty {
    display: none !important;
}

/* Authority history table lives inside the Revocations & OOS card. The
   parent already provides the scroll context, so the table wrap just needs
   to allow horizontal overflow for narrow viewports. */
.revocations-oos-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.revocations-oos-table-wrap:empty {
    display: none !important;
}

.revocations-oos-table-wrap .authority-history-table {
    margin-bottom: 0;
}

/* Tighten the nested cards rendered by renderRevocationBanner so they
   don't double-pad inside the parent card. */
.revocations-oos-content .revocation-card,
.revocations-oos-content .subpanel-card {
    margin: 0;
    padding: 0.85rem 1rem !important;
    box-shadow: none;
}

.tool-intro-card {
    margin-top: 1rem;
    margin-bottom: 1.5rem;
    padding: 1.5rem;
}

.admin-panel-section {
    margin-top: 1rem;
}

.admin-panel-section-spaced {
    padding: 1.5rem !important;
}

.admin-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
}

.admin-summary-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    padding: 0.85rem 1rem;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.admin-summary-label {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.admin-summary-value {
    margin-top: 0.2rem;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text);
}

.admin-panel-title {
    margin-bottom: 0.75rem;
}

.admin-panel-notice {
    margin-bottom: 0.7rem;
    padding: 0.55rem 0.7rem;
    border: 1px solid rgba(37, 99, 235, 0.22);
    border-radius: 8px;
    background: rgba(37, 99, 235, 0.08);
    color: #1d4ed8;
    font-size: 0.86rem;
    font-weight: 500;
}

.admin-users-table-wrap {
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: auto;
}

.admin-users-table {
    margin-bottom: 0;
}

.admin-users-table thead th {
    background: #f8fafc;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.admin-users-empty {
    text-align: center;
    color: var(--text-soft);
    font-style: italic;
    padding: 1rem 0.75rem !important;
}

.admin-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 82px;
    border-radius: 999px;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
}

.admin-status-active {
    background: rgba(22, 163, 74, 0.14);
    color: #15803d;
}

.admin-status-disabled {
    background: rgba(220, 38, 38, 0.12);
    color: #b91c1c;
}

.admin-create-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.admin-create-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.admin-create-field label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}

.admin-create-field input,
.admin-create-field select {
    width: 100%;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    padding: 0.5rem 0.6rem;
    font-size: 0.86rem;
    background: #fff;
}

.admin-create-actions {
    margin-top: 0.9rem;
    display: flex;
    justify-content: flex-end;
}

@media (max-width: 1080px) {
    .admin-create-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .admin-summary-grid,
    .admin-create-grid {
        grid-template-columns: 1fr;
    }

    .admin-create-actions {
        justify-content: flex-start;
    }
}

.page-content-surface {
    display: grid;
    gap: 1.25rem;
    animation: page-fade-in 0.32s ease;
}

@keyframes page-fade-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tool-intro-points {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 1rem;
    max-width: 920px;
}

.tool-intro-point {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 1rem 1.05rem;
    background-color: rgba(255,255,255,0.1);
    background-image: linear-gradient(135deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0.04) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
}

.tool-intro-point strong {
    color: var(--text);
}

.tool-intro-point span {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.tool-intro-note {
    margin-top: 1rem;
    color: var(--accent);
    font-weight: 600;
}

@media (max-width: 900px) {
    .tool-intro-points {
        grid-template-columns: 1fr;
    }

    .tool-intro-card {
        min-height: auto;
        display: block;
    }
}

.map-shell {
    background: #fff;
    border: var(--border-width) solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 2px 10px var(--shadow);
}

.map-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.85rem;
    flex-wrap: wrap;
}

.map-toolbar-title {
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--text);
}

.map-legend {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.legend-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    border: 1px solid var(--border);
    background: var(--surface-light);
    cursor: pointer;
}

button.legend-chip {
    font-family: inherit;
}

.legend-chip.active {
    box-shadow: inset 0 0 0 2px rgba(255,255,255,0.35);
}

.legend-chip.inactive {
    opacity: 0.45;
}

.legend-inspection::before,
.legend-crash::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.legend-inspection::before {
    background: #2563eb;
}

.legend-crash::before {
    background: #dc2626;
}

.incident-map-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(320px, 0.95fr);
    gap: 1rem;
    align-items: start;
}

.incident-state-marker-wrap {
    background: transparent;
    border: none;
}

.incident-state-marker {
    position: relative;
    width: 34px;
    height: 42px;
    border-radius: 18px 18px 18px 4px;
    transform: rotate(-45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.92);
}

.incident-state-marker span {
    transform: rotate(45deg);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1;
}

.incident-state-marker.crash {
    background: #dc2626;
}

.incident-state-marker.inspection {
    background: #2563eb;
}

.incident-state-panel {
    min-height: 620px;
    height: 620px;
    display: flex;
    flex-direction: column;
}

.incident-section-title {
    font-size: 1.35rem;
    font-weight: 800;
    padding: 1.35rem 1.4rem 0.85rem;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.incident-title-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.1rem;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    background: #eef2ff;
    color: #285cf3;
    font-size: 0.9rem;
    font-weight: 800;
}

.fixed-scroll-card {
    height: 620px;
    display: flex;
    flex-direction: column;
    padding: 1.1rem !important;
}

.fixed-scroll-card .section-content {
    flex: 1;
    display: flex;
    min-height: 0;
    overflow: hidden;
    padding: 0.35rem;
}

#inspectionHistory,
#crashHistory {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.incident-history-table-wrap {
    height: 100%;
    flex: 1;
    overflow: auto;
    min-height: 0;
    width: 100%;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.incident-history-table-wrap::-webkit-scrollbar {
    display: none;
}

.incident-history-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.incident-history-table th,
.incident-history-table td {
    border: 1px solid rgba(121, 135, 161, 0.3);
    padding: 0.85rem 0.95rem;
    text-align: left;
    vertical-align: top;
}

.incident-history-table thead th {
    position: sticky;
    top: 0;
    background: #eef2ff;
    z-index: 1;
}

.incident-empty-state {
    padding: 0.85rem 0;
    color: var(--text-muted);
}

/* Crash not-preventable styling */
.crash-np-banner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    font-size: 0.75rem;
}

.crash-np-badge {
    flex-shrink: 0;
    font-weight: 700;
    color: #16a34a;
    background: #dcfce7;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.crash-np-note {
    color: #334155;
}

.crash-row-np {
    opacity: 0.55;
    background: #f0fdf4;
}

.crash-np-cell-badge {
    display: inline-block;
    font-size: 0.58rem;
    font-weight: 700;
    color: #16a34a;
    background: #dcfce7;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.state-incident-item {
    margin-bottom: 0.75rem;
}

.incident-state-content {
    font-size: 0.92rem;
    color: var(--text-muted);
    flex: 1;
    min-height: 0;
    overflow: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.incident-state-content::-webkit-scrollbar {
    display: none;
}

.state-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.9rem;
}

.state-count-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.state-count-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.32rem 0.65rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}

.state-count-badge.inspection {
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
}

.state-count-badge.crash {
    background: rgba(220, 38, 38, 0.12);
    color: #b91c1c;
}

.incident-group-title {
    margin: 0.85rem 0 0.5rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
}

.incident-report-item {
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 0.6rem;
    overflow: hidden;
    background: var(--surface-light);
}

.incident-report-header {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: center;
    padding: 0.75rem 0.9rem;
}

.incident-report-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.85rem;
    align-items: center;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.incident-report-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
}

.incident-report-link:hover {
    text-decoration: underline;
}

.incident-detail-panel {
    display: none;
    padding: 0.85rem 0.9rem 1rem;
    background: #fff;
    border-top: 1px solid var(--border);
}

.incident-report-item.open .incident-detail-panel {
    display: block;
}

.map-canvas-placeholder,
#incidentMap {
    min-height: 620px;
    width: 100%;
    border-radius: 14px;
}

.floating-notice {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 2100;
    max-width: 360px;
    padding: 0.95rem 1.1rem;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.96);
    color: #fff;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.22);
    transform: translateY(120%);
    opacity: 0;
    transition: transform 0.35s ease, opacity 0.35s ease;
}

.floating-notice.visible {
    transform: translateY(0);
    opacity: 1;
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(15, 23, 42, 0.62);
    padding: 2rem;
    overflow-y: auto;
}

.modal-content {
    position: relative;
    width: min(1200px, 96vw);
    min-height: min(780px, calc(100vh - 4rem));
    margin: 0 auto;
    background: #fff;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 25px 80px rgba(15, 23, 42, 0.25);
}

#modalContent {
    max-height: calc(100vh - 10rem) !important;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.close {
    position: sticky;
    top: 0;
    float: right;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-left: auto;
    border-radius: 999px;
    background: #f1f5f9;
    color: #0f172a;
    font-size: 1.6rem;
    cursor: pointer;
    z-index: 2;
}

.report-card {
    display: grid;
    gap: 1rem;
}

.report-card .report-section {
    background: #f8fafc;
    border: 1px solid rgba(121, 135, 161, 0.18);
    border-radius: 14px;
    padding: 1rem 1.1rem;
}

@media (max-width: 1100px) {
    .incident-map-layout {
        grid-template-columns: 1fr;
    }

    .fixed-scroll-card {
        height: auto;
    }

    .incident-history-table-wrap {
        max-height: 480px;
    }
}

    .two-column-grid > * {
        min-width: 0; /* prevent overflow */
    }

/* Company snapshot card remains visible with border */
#companyInfoSection {
    background-color: rgba(255,255,255,0.08);
    background-image: linear-gradient(135deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0.04) 100%);
    border: var(--border-width) solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    width: 100vw;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    padding-left: 2rem;
    padding-right: 2rem;
}

/* ISS + Crash Summary inline header row inside Company Snapshot */
.snapshot-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    background: var(--surface-light);
    border-radius: 8px;
    border-left: 4px solid var(--accent);
}

.snapshot-header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    flex: 1;
}

.snapshot-header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.snapshot-header-item {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.snapshot-header-item .info-label {
    margin-bottom: 0.15rem;
}

.snapshot-header-item .info-value {
    font-size: 1.1rem;
}

.snapshot-header-alerts {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

/* Full-width cards (break out of max-width container) */
.full-width-card {
    width: 100vw;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    padding-left: 2rem;
    padding-right: 2rem;
    border-radius: 12px;
}

/* Snapshot summary: plain ISS text, no blue card treatment */
.snapshot-header-row {
    align-items: flex-start;
    background: transparent;
    border: none;
    padding: 0;
    margin-bottom: 0;
}

.snapshot-iss-plain {
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

.snapshot-iss-plain .info-label {
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.snapshot-iss-plain .info-value {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    font-size: 1.9rem !important;
    line-height: 1.05;
    font-weight: 800;
}

.iss-score-value {
    font-size: 1.9rem;
    font-weight: 800;
}

.iss-score-recommendation {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.snapshot-alerts-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 68px;
    flex: 1;
    text-align: center;
}

.snapshot-alerts-text {
    font-size: 1.08rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.snapshot-alerts-text strong {
    color: var(--text);
    margin-right: 0.35rem;
}

.snapshot-risk-card {
    min-height: auto !important;
}

.snapshot-risk-row {
    align-items: stretch;
}

.snapshot-risk-left,
.snapshot-risk-right {
    align-items: stretch;
}

.snapshot-risk-score-block .info-value {
    font-size: 1.85rem !important;
    font-weight: 800;
    color: #1c273c;
}

.snapshot-risk-tier {
    font-size: 1.15rem !important;
    font-weight: 800;
}

.snapshot-risk-tier.tier-low {
    color: #15803d;
}

.snapshot-risk-tier.tier-medium {
    color: #b45309;
}

.snapshot-risk-tier.tier-high {
    color: #dc2626;
}

.snapshot-risk-reasons-block {
    min-width: min(100%, 540px);
}

.snapshot-risk-reasons {
    font-size: 0.98rem !important;
    line-height: 1.45;
    color: var(--text-muted);
    white-space: normal;
}

.score-info-label-row {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.score-info-button {
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 999px;
    background: #2563eb;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.18);
}

.score-info-bubble {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    width: min(280px, 72vw);
    padding: 0.75rem 0.85rem;
    border-radius: 12px;
    background: #fff;
    border: 1px solid rgba(121, 135, 161, 0.18);
    box-shadow: 0 14px 28px rgba(28, 39, 60, 0.12);
    color: #596882;
    font-size: 0.83rem;
    font-weight: 500;
    line-height: 1.45;
    z-index: 20;
}

.score-info-bubble.hidden {
    display: none !important;
}

.score-info-bubble-close {
    position: absolute;
    top: 0.35rem;
    right: 0.45rem;
    border: none;
    background: transparent;
    color: #7987a1;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
}

/* Elevate the side-item card when its info bubble is open so
   the bubble renders above sibling cards */
.ov-side-item.score-info-elevated {
    position: relative;
    z-index: 30;
    overflow: visible !important;
}

.snapshot-risk-trends {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
    margin-top: 1rem;
}

.snapshot-risk-trend-item {
    padding: 0.95rem 1rem;
    border: 1px solid rgba(121, 135, 161, 0.18);
    border-radius: 14px;
    background: #f8fafc;
}

.snapshot-risk-trend-item .info-value {
    font-size: 0.92rem !important;
    line-height: 1.45;
    color: #1c273c;
}

.carrier-timeline-card {
    padding: 1rem !important;
}

.carrier-timeline-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.carrier-timeline-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.carrier-timeline-filter {
    border: 1px solid rgba(121, 135, 161, 0.22);
    border-radius: 999px;
    background: #eef2ff;
    padding: 0.5rem 0.85rem;
    font-weight: 700;
    cursor: pointer;
}

#timelineFilterCrash {
    color: #dc2626;
    border-color: rgba(220, 38, 38, 0.22);
    background: rgba(220, 38, 38, 0.1);
}

#timelineFilterInspection {
    color: #2563eb;
    border-color: rgba(37, 99, 235, 0.22);
    background: rgba(37, 99, 235, 0.1);
}

.carrier-timeline-filter.inactive {
    background: #f8fafc;
    color: #7987a1;
}

.carrier-timeline-shell {
    position: relative;
    display: flex;
    overflow-x: auto;
    flex: 1;
    min-height: 0;
    padding: 0.75rem;
}

.carrier-timeline-track {
    flex: 1;
    min-width: 980px;
}

.carrier-timeline-histogram {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 1rem;
    min-height: 100%;
}

.carrier-timeline-y-axis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
    color: #7987a1;
    font-size: 0.78rem;
    padding: 0.25rem 0;
}

.carrier-timeline-bars-wrap {
    position: relative;
    height: 100%;
    min-height: 100%;
}

.carrier-timeline-grid-lines {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none;
}

.carrier-timeline-grid-lines span {
    display: block;
    height: 1px;
    background: rgba(121, 135, 161, 0.18);
}

.carrier-timeline-bars {
    position: relative;
    z-index: 1;
    height: 100%;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(90px, 1fr);
    gap: 1rem;
    align-items: end;
    padding-top: 0.5rem;
}

.carrier-timeline-bucket {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 0.6rem;
    min-height: 100%;
}

.carrier-timeline-bar-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
    align-items: end;
    align-self: stretch;
    height: 100%;
    min-height: 0;
}

.carrier-timeline-bar-wrap {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    height: 100%;
    min-height: 0;
    gap: 0.3rem;
}

.carrier-timeline-bar {
    border-radius: 10px 10px 0 0;
    min-height: 4px;
    width: 100%;
    align-self: end;
}

.carrier-timeline-bar.crash {
    background: #dc2626;
}

.carrier-timeline-bar.inspection {
    background: #2563eb;
}

.carrier-timeline-bucket-label {
    color: #596882;
    font-size: 0.8rem;
    text-align: center;
}

.carrier-timeline-bar-value {
    color: #1c273c;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
    text-align: center;
}

.carrier-timeline-empty {
    padding: 1rem 0;
}

.report-update-changes-card {
    margin-bottom: 1.25rem;
    padding: 1.25rem 1.4rem !important;
}

.report-update-changes-list {
    margin: 0;
    padding-left: 1.2rem;
    color: #1c273c;
}

.report-update-changes-list li {
    margin: 0.35rem 0;
    color: #596882;
}

/* ===== Restore styled layout while keeping latest content changes ===== */
.dashboard-shell {
    position: relative;
}

.dashboard-sidebar {
    position: fixed !important;
    top: 1.25rem !important;
    left: 1.25rem !important;
    width: 280px !important;
    height: calc(100vh - 2.5rem) !important;
    z-index: 120 !important;
    display: flex !important;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem !important;
    overflow-y: auto;
    background: #ffffff !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-card) !important;
}

.dashboard-main {
    position: relative;
    margin-left: calc(280px + 2.5rem) !important;
    margin-right: 1.25rem !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0;
}

/* Styled sidebar sections */
.sidebar-nav {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.55rem !important;
}

.sidebar-nav-link,
.sidebar-anchor-link {
    display: block !important;
    width: 100% !important;
    background: #fff !important;
    border: 1px solid var(--border-strong) !important;
    border-radius: 12px !important;
    padding: 0.72rem 0.8rem !important;
}

.sidebar-nav-link.active,
.sidebar-anchor-link.active {
    background: linear-gradient(135deg, #eff6ff 0%, #eef2ff 100%) !important;
    color: var(--surface-strong) !important;
    border-color: rgba(37, 99, 235, 0.16) !important;
}

/* Search + signed in styling */
.sidebar-search-card {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 0.65rem !important;
    align-items: center;
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
}

.sidebar-search-card input {
    width: 100%;
    border: 1px solid var(--border) !important;
    border-radius: 999px !important;
    padding: 0.8rem 1rem !important;
    background: #fff !important;
}

.sidebar-search-card button {
    width: auto;
    min-width: 112px;
    border: 1px solid var(--surface-strong) !important;
    border-radius: 999px !important;
    padding: 0.8rem 1rem !important;
    background: var(--surface-strong) !important;
    color: #fff !important;
}

/* Restore cards */
.card,
.info-panel,
.subpanel-card,
.violation-card,
.basics-chart-container,
.map-shell {
    background: var(--glass) !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1) !important;
    backdrop-filter: blur(9.3px) !important;
    -webkit-backdrop-filter: blur(9.3px) !important;
    border: 1px solid var(--glass-border) !important;
}

/* Snapshot wrapper stays borderless; individual cards keep styling */
#companyInfoSection.company-snapshot-grid-wrap {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.dashboard-main .company-snapshot-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 1.25rem !important;
    width: 100% !important;
}

.dashboard-main .company-snapshot-grid > .card,
.dashboard-main .company-snapshot-grid > .info-panel {
    width: 100%;
    min-width: 0;
    margin: 0;
    min-height: auto;
    padding: 0.85rem 1rem !important;
}

/* BASIC cards remain separate and styled */
.basics-two-column {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 1.25rem !important;
    align-items: stretch;
}

.basics-table-container,
.basics-chart-container {
    min-height: 520px;
    display: flex;
    flex-direction: column;
}

@media (max-width: 1200px) {
    .dashboard-sidebar {
        position: static !important;
        width: 100% !important;
        height: auto !important;
    }

    .dashboard-main {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
    }

    .dashboard-main .company-snapshot-grid,
    .basics-two-column {
        grid-template-columns: 1fr !important;
    }
}

/* ===== Azia integration overrides ===== */
body.az-dashboard-page {
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.07), transparent 24%),
        linear-gradient(180deg, #ffffff 0%, var(--bg) 42%, #f8fafc 100%);
    color: var(--text);
    font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

#appContent {
    min-height: 100vh;
}

.auth-container {
    min-height: 100vh;
    padding: 2rem 1rem;
}

.auth-page-shell {
    max-width: 1140px;
    margin: 0 auto;
}

.auth-page-card {
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(121, 135, 161, 0.18) !important;
    border-radius: 20px !important;
    box-shadow: 0 20px 50px rgba(28, 39, 60, 0.12) !important;
}

.auth-page-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
    min-height: 680px;
}

.auth-brand-panel {
    padding: 3.5rem;
    background: linear-gradient(135deg, #1c273c 0%, #33415c 100%);
    color: #fff;
}

.auth-brand-panel h1 {
    color: #fff;
    font-size: clamp(1.7rem, 3vw, 2.5rem);
    line-height: 1.05;
    margin-bottom: 1.25rem;
}

.auth-brand-panel .subtitle,
.auth-brand-panel .auth-brand-point span {
    color: rgba(255, 255, 255, 0.78);
}

.auth-brand-points {
    display: grid;
    gap: 1rem;
    margin-top: 2rem;
}

.auth-brand-point {
    padding: 1rem 1.1rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.auth-brand-point strong {
    display: block;
    margin-bottom: 0.35rem;
    color: #fff;
}

.auth-form-panel {
    padding: 3rem;
    background: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-form-panel h2 {
    font-size: 1.9rem;
    font-weight: 700;
    color: #1c273c;
    margin-bottom: 0.75rem;
}

.auth-form-stack {
    display: grid;
    gap: 1rem;
    margin-top: 1.5rem;
}

.error-message {
    min-height: 1.25rem;
    color: #b91c1c;
    font-size: 0.9rem;
    font-weight: 600;
}

.auth-input-grid {
    display: grid;
    gap: 0.9rem;
}

.auth-input-grid input,
.sidebar-search-card input {
    height: 48px;
    border-radius: 10px !important;
    border: 1px solid rgba(121, 135, 161, 0.24) !important;
    padding: 0.75rem 0.95rem !important;
    box-shadow: none !important;
}

.auth-action-button,
.sidebar-search-card button,
.app-logout-button {
    border: none !important;
    border-radius: 10px !important;
    background: #285cf3 !important;
    color: #fff !important;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.auth-action-button {
    padding: 0.9rem 1rem !important;
}

.auth-switch a {
    color: #285cf3;
    font-weight: 600;
    cursor: pointer;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: auto;
    background: rgba(244, 245, 251, 0.94);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(121, 135, 161, 0.18);
    overflow: visible;
}

.app-header .container {
    max-width: 100%;
    width: 100%;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    gap: 0;
    padding: 0.5rem 1.5rem;
    overflow: visible;
}

.app-header-top-row {
    display: contents;
}

.app-logo {
    white-space: nowrap;
}

.app-logo .logo-roi {
    color: #08306b;
}

.app-logo .logo-sight {
    color: #000;
}

.app-header-copy {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-left: 1rem;
}

.app-header-copy strong {
    color: #1c273c;
    font-size: 1rem;
}

.app-header-copy span {
    color: #7987a1;
    font-size: 0.8rem;
}

.app-header-menu {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    margin: 0;
    padding: 0;
    flex-wrap: nowrap;
    overflow: visible;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.app-header-menu::-webkit-scrollbar {
    display: none;
}

.nav-tab {
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: #596882;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.55rem 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-tab:hover,
.nav-tab.active {
    background: #fff;
    color: #285cf3;
    border-color: rgba(40, 92, 243, 0.15);
    box-shadow: 0 8px 20px rgba(40, 92, 243, 0.08);
}

.app-header-right {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.app-header-search {
    min-width: 300px;
    background: transparent !important;
}

.app-header-right {
    position: relative;
}

.carrier-search-results {
    position: absolute;
    top: calc(100% + 0.45rem);
    left: 0;
    width: min(480px, calc(100vw - 2rem));
    display: grid;
    gap: 0.45rem;
    padding: 0.6rem;
    max-height: 360px;
    overflow-y: auto;
    border: 1px solid rgba(121, 135, 161, 0.18);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 16px 36px rgba(28, 39, 60, 0.12);
    z-index: 1100;
}

.carrier-search-result-item {
    gap: 0.2rem;
}

.carrier-search-result-item:hover {
    background: #eef2ff;
    border-color: rgba(40, 92, 243, 0.2);
}

.carrier-search-result-name {
    color: #1c273c;
    font-weight: 700;
}

.carrier-search-result-meta {
    color: #596882;
    font-size: 0.84rem;
}

.app-header-search input {
    min-width: 180px;
    background: #fff !important;
}

.app-header-search button {
    min-width: 48px;
    width: 48px;
    height: 48px;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.search-button-icon {
    font-size: 1.15rem;
    line-height: 1;
}

.app-header-search button.is-loading {
    position: relative;
    min-width: 48px;
    width: 48px;
    color: transparent !important;
    pointer-events: none;
}

.app-header-search button.is-loading::after {
    content: '';
    position: absolute;
    inset: 11px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-right-color: transparent;
    animation: button-spinner 0.8s linear infinite;
}

@keyframes button-spinner {
    to {
        transform: rotate(360deg);
    }
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    background: #fff;
    border: 1px solid rgba(121, 135, 161, 0.2);
}

.nav-user-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.nav-user-meta span {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #7987a1;
}

.nav-user-meta strong {
    color: #1c273c;
    font-size: 0.9rem;
}

.nav-logout-btn {
    margin-left: 0.65rem;
    padding: 0.35rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #fff;
    background: #5b6b88;
    border: 1px solid #4a597a;
    border-radius: 999px;
    cursor: pointer;
    line-height: 1.1;
    transition: background 0.15s ease, transform 0.15s ease;
}

.nav-logout-btn:hover {
    background: #4a597a;
}

.nav-logout-btn:active {
    transform: translateY(1px);
}

.app-logout-button {
    padding: 0.72rem 1rem !important;
}

.app-dashboard-content {
    padding-top: 1.5rem;
    padding-bottom: 2rem;
}

.app-dashboard-content .container {
    max-width: none;
    width: 100%;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

.app-dashboard-body {
    display: block;
}

.dashboard-shell {
    position: relative;
}

.dashboard-sidebar {
    display: none !important;
}

.dashboard-main {
    margin: 0 !important;
    width: 100% !important;
    max-width: none !important;
}

.dashboard-section-header,
.tool-intro-card,
.app-state-card,
.card,
.subpanel-card,
.info-panel,
.basics-chart-container,
.map-shell,
.violation-card {
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

body.az-dashboard-page .card,
body.az-dashboard-page .subpanel-card,
body.az-dashboard-page .info-panel,
body.az-dashboard-page .basics-chart-container,
body.az-dashboard-page .map-shell,
body.az-dashboard-page .violation-card,
body.az-dashboard-page .dashboard-section-header,
body.az-dashboard-page .tool-intro-card,
body.az-dashboard-page .app-state-card {
    background: var(--glass) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-card) !important;
    backdrop-filter: blur(9.3px);
    -webkit-backdrop-filter: blur(9.3px);
}

.card:hover,
.subpanel-card:hover,
.info-panel:hover,
.basics-chart-container:hover,
.map-shell:hover,
.violation-card:hover,
.dashboard-section-header:hover,
.tool-intro-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.08) !important;
    border-color: rgba(37, 99, 235, 0.18) !important;
}

.dashboard-section-header {
    margin-bottom: 0.75rem;
    padding: 1rem 1.25rem !important;
}

.dashboard-section-header .section-label,
.tool-intro-card .section-label,
.auth-brand-panel .section-label,
.auth-form-panel .section-label {
    color: #285cf3;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.dashboard-section-header .az-dashboard-title,
.tool-intro-card h1 {
    margin-bottom: 0.55rem;
    color: #1c273c;
}

.dashboard-section-header .az-dashboard-title,
.tool-intro-card h1 {
    font-size: clamp(1.6rem, 2vw, 2.1rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.dashboard-section-header .az-dashboard-text,
.tool-intro-card .subtitle,
.az-dashboard-text {
    font-size: 0.95rem;
    line-height: 1.65;
}

.dashboard-section-header .az-dashboard-text,
.tool-intro-card .subtitle {
    color: var(--text-soft);
    margin-bottom: 0;
    max-width: 72ch;
}

.tool-intro-card {
    padding: 1.75rem !important;
}

.tool-intro-hero {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.tool-intro-points {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tool-intro-point {
    background: #f9fafc;
    border-radius: 14px;
}

.tool-intro-note {
    margin-top: 1.25rem;
}

.sidebar-nav-link,
.sidebar-anchor-link {
    text-align: left;
    transition: all 0.2s ease;
}

.sidebar-nav-link.active,
.sidebar-anchor-link.active {
    box-shadow: 0 10px 20px rgba(40, 92, 243, 0.09) !important;
}

.app-search-error {
    margin-bottom: 1rem;
}

.insurance-layout {
    display: grid;
    gap: 1.5rem;
}

.profile-history-card {
    padding: 1.5rem !important;
}

.revocation-section {
    margin-top: 1rem;
    margin-bottom: 1rem;
    width: 100%;
}

.profile-history-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.profile-history-title {
    margin-bottom: 0;
}

.profile-history-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.profile-history-filter-select {
    min-width: 130px;
    border: 1px solid rgba(121, 135, 161, 0.24);
    border-radius: 12px;
    background: #fff;
    color: #1c273c;
    font-weight: 600;
    padding: 0.6rem 0.8rem;
}

.profile-history-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.profile-history-toolbar-status {
    color: #596882;
    font-size: 0.85rem;
    font-weight: 600;
}

.report-history-update-all-btn {
    min-width: 118px;
    padding: 0.82rem 1rem;
    border: 1px solid rgba(40, 92, 243, 0.22);
    border-radius: 14px;
    background: #285cf3;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.report-history-update-all-btn:hover:not(:disabled) {
    background: #1d4ed8;
    border-color: rgba(29, 78, 216, 0.3);
}

.report-history-update-all-btn:disabled {
    cursor: default;
    opacity: 0.7;
}

.report-history-update-all-btn.is-loading {
    min-width: 132px;
}

.report-history-list {
    display: grid;
    gap: 0.9rem;
}

.report-history-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: stretch;
    transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.report-history-drag-handle {
    width: 38px;
    min-width: 38px;
    border: 1px solid rgba(121, 135, 161, 0.2);
    border-radius: 14px;
    background: #fff;
    color: #7987a1;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.32rem;
    cursor: grab;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.report-history-drag-handle span {
    display: block;
    width: 14px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.report-history-drag-handle:hover:not(:disabled) {
    background-color: rgba(255,255,255,0.12);
    background-image: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0.06) 100%);
    border-color: rgba(40, 92, 243, 0.2);
}

.report-history-drag-handle:disabled {
    cursor: default;
    opacity: 0.65;
}

.report-history-placeholder {
    border: 1px dashed rgba(40, 92, 243, 0.26);
    border-radius: 16px;
    background: rgba(40, 92, 243, 0.05);
    transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.report-history-row.is-dragging {
    z-index: 1200;
    cursor: grabbing;
}

.report-history-row.is-dragging .report-history-drag-handle {
    cursor: grabbing;
}

body.report-history-dragging-body {
    user-select: none;
}

body.report-history-dragging-body .report-history-row:not(.is-dragging) {
    transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.report-history-actions {
    display: flex;
    gap: 0.45rem;
    align-items: stretch;
}

.report-history-item {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-rows: 1fr;
    width: 100%;
    min-height: 52px;
    padding: 0.3rem 0.7rem;
    border: 1px solid rgba(121, 135, 161, 0.2);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.73);
    text-align: left;
    cursor: pointer;
    align-items: center;
    backdrop-filter: blur(9.3px);
    -webkit-backdrop-filter: blur(9.3px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 1);
    border-radius: 16px;
}

.report-history-item:disabled {
    cursor: default;
    opacity: 1;
}

.report-history-item:hover {
    background-color: rgba(238,242,255,0.16);
    background-image: linear-gradient(135deg, rgba(238,242,255,0.28) 0%, rgba(219,234,254,0.1) 100%);
    border-color: rgba(40, 92, 243, 0.2);
}

.report-history-item > * {
    position: relative;
    z-index: 1;
}

.report-history-item-loading::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--report-update-progress, 0%);
    background: linear-gradient(90deg, rgba(40, 92, 243, 0.16) 0%, rgba(96, 165, 250, 0.28) 100%);
    transition: width 0.35s ease;
    z-index: 0;
}

.report-history-item-loading {
    border-color: rgba(40, 92, 243, 0.22);
}

.report-history-item-client {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.12) 0%, rgba(255,255,255,0.04) 100%);
    border-color: rgba(21, 128, 61, 0.18);
}

.report-history-item-client:hover {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(21, 128, 61, 0.26);
}

.report-history-item-prospect {
    background: linear-gradient(135deg, rgba(250, 204, 21, 0.14) 0%, rgba(255,255,255,0.04) 100%);
    border-color: rgba(180, 83, 9, 0.18);
}

.report-history-item-prospect:hover {
    background: rgba(250, 204, 21, 0.17);
    border-color: rgba(180, 83, 9, 0.26);
}

/* Locked state during bulk update — gray tint, non-interactive */
.report-history-row-locked {
    pointer-events: none;
}

.report-history-item-locked {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(60%);
}

.report-history-item-locked:hover {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    box-shadow: none !important;
}

.report-history-row-locked .report-history-actions {
    opacity: 0.4;
    pointer-events: none;
}

.report-history-row-locked .report-history-drag-handle {
    opacity: 0.3;
    pointer-events: none;
}

/* — The currently-updating card during bulk keeps normal pointer-events */
.report-history-row-locked:has(.report-history-item-loading) {
    pointer-events: auto;
    opacity: 1;
}

.report-history-row-locked .report-history-item-loading {
    opacity: 1;
    filter: none;
}

/* Confirmation dialog */
.confirm-dialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0);
    backdrop-filter: blur(0);
    transition: background 0.2s ease, backdrop-filter 0.2s ease;
    opacity: 0;
}

.confirm-dialog-overlay.visible {
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    opacity: 1;
}

.confirm-dialog {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    padding: 1.75rem 2rem;
    max-width: 420px;
    width: 90%;
    transform: scale(0.92);
    transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.confirm-dialog-overlay.visible .confirm-dialog {
    transform: scale(1);
}

.carrier-load-progress-modal {
    position: fixed;
    inset: 0;
    z-index: 10010;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
}

.carrier-load-progress-dialog {
    width: min(420px, 100%);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.35rem;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.22);
}

.carrier-load-progress-spinner {
    width: 2.35rem;
    height: 2.35rem;
    border: 3px solid rgba(37, 99, 235, 0.16);
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: ntab-spin 0.7s linear infinite;
    flex-shrink: 0;
}

.carrier-load-progress-copy {
    min-width: 0;
}

.carrier-load-progress-dot {
    font-size: 0.88rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.2rem;
}

.carrier-load-progress-status {
    font-size: 0.82rem;
    color: #475569;
    line-height: 1.5;
}

.carrier-load-progress-modal.is-error .carrier-load-progress-spinner {
    border-color: rgba(185, 28, 28, 0.14);
    border-top-color: #b91c1c;
}

.carrier-load-progress-modal.is-error .carrier-load-progress-status {
    color: #991b1b;
}

/* ?? FMCSA outage modal (closable, dismisses to profile) ????????????????? */
.fmcsa-outage-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.fmcsa-outage-dialog {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.22);
    max-width: 440px;
    width: 100%;
    padding: 1.6rem 1.6rem 1.4rem;
    text-align: center;
}

.fmcsa-outage-close {
    position: absolute;
    top: 0.5rem;
    right: 0.7rem;
    background: none;
    border: 0;
    font-size: 1.5rem;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    padding: 0.2rem 0.45rem;
    border-radius: 6px;
}

.fmcsa-outage-close:hover {
    background: rgba(15, 23, 42, 0.06);
    color: #0f172a;
}

.fmcsa-outage-icon {
    font-size: 2rem;
    color: #b45309;
    margin-bottom: 0.4rem;
}

.fmcsa-outage-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.5rem;
}

.fmcsa-outage-message {
    font-size: 0.9rem;
    color: #334155;
    margin: 0 0 1.1rem;
    line-height: 1.45;
}

.fmcsa-outage-actions {
    display: flex;
    justify-content: center;
}

.fmcsa-outage-btn {
    background: #1d4ed8;
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 0.55rem 1.4rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

.fmcsa-outage-btn:hover {
    background: #1e40af;
}

.confirm-dialog-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1c273c;
    margin-bottom: 0.6rem;
}

.confirm-dialog-message {
    font-size: 0.85rem;
    color: #475569;
    line-height: 1.55;
    margin-bottom: 1.5rem;
}

.confirm-dialog-actions {
    display: flex;
    gap: 0.6rem;
    justify-content: flex-end;
}

.confirm-dialog-btn {
    border: none;
    border-radius: 8px;
    padding: 0.55rem 1.4rem;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.confirm-dialog-btn-no {
    background: #f1f5f9;
    color: #475569;
}

.confirm-dialog-btn-no:hover {
    background: #e2e8f0;
}

.confirm-dialog-btn-yes {
    background: #285cf3;
    color: #fff;
}

.confirm-dialog-btn-yes:hover {
    background: #1d4ed8;
}

.report-history-company {
    color: #1c273c;
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.05;
}

.report-history-main-grid,
.report-history-footer-row {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(220px, 1.35fr) repeat(4, minmax(88px, 0.8fr));
    column-gap: 0.45rem;
    align-items: center;
}

.report-history-main-cell {
    min-width: 0;
    display: grid;
    gap: 0.12rem;
    align-content: center;
    min-height: 100%;
}

.report-history-primary-cell {
    justify-items: start;
}

.report-history-main-cell strong {
    color: #596882;
    font-size: 0.82rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-weight: 600;
    line-height: 1;
}

.report-history-main-cell span {
    color: #1c273c;
    font-size: 1rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.05;
}

.report-history-dot {
    color: #596882;
    font-size: 0.98rem;
}

.report-history-iss {
    color: #285cf3;
    font-size: 1.02rem;
    font-weight: 600;
    white-space: nowrap;
}

.report-history-iss-cell,
.report-history-alerts-cell,
.report-history-insurance-cell,
.report-history-updated-cell {
    justify-items: start;
}

.report-history-loading-status {
    color: #1d4ed8;
    font-size: 0.84rem;
    font-weight: 600;
    min-height: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    text-align: right;
}

.report-history-loading-placeholder {
    visibility: hidden;
}

.report-history-empty {
    color: #7987a1;
    padding: 0.5rem 0;
}

.report-history-footer-row {
    position: absolute;
    right: 0.7rem;
    bottom: 0.22rem;
    width: auto;
    grid-template-columns: auto;
    gap: 0;
}

.report-history-footer-spacer {
    display: none;
}

.report-history-tag-select {
    min-width: 148px;
    border: 1px solid rgba(121, 135, 161, 0.24);
    border-radius: 14px;
    background: #fff;
    color: #1c273c;
    font-weight: 600;
    padding: 0.85rem 0.9rem;
}

.report-history-update-btn {
    min-width: 96px;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(40, 92, 243, 0.22);
    border-radius: 14px;
    background: #eef2ff;
    color: #285cf3;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.report-history-update-btn:hover:not(:disabled) {
    background: #dbe7ff;
    border-color: rgba(40, 92, 243, 0.35);
}

.report-history-update-btn:disabled {
    cursor: default;
    opacity: 1;
}

.report-history-update-btn.is-success {
    background: #dcfce7;
    border-color: rgba(22, 163, 74, 0.28);
    color: #15803d;
}

.report-update-spinner {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    border: 3px solid rgba(37, 99, 235, 0.22);
    border-top-color: #2563eb;
    animation: report-update-spin 0.8s linear infinite;
}

.report-update-checkmark {
    font-size: 1rem;
    line-height: 1;
}

@keyframes report-update-spin {
    to {
        transform: rotate(360deg);
    }
}

.report-history-remove-btn {
    padding: 0.5rem 0.65rem;
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.06);
    color: #94a3b8;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.report-history-remove-btn:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.35);
    color: #dc2626;
}

.report-history-remove-btn:disabled {
    cursor: default;
    opacity: 0.4;
}

.responsive-panel-row {
    display: grid;
    grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.6fr);
    gap: 1.5rem;
    align-items: stretch;
}

.insurance-card {
    padding: 0.95rem 1.1rem !important;
}

.insurance-wide-card {
    width: 100%;
}

.authority-card {
    min-height: 0;
}

.authority-history-layout,
.insurance-history-layout {
    width: 100%;
}

.authority-history-panel {
    width: 100%;
}

.revocation-full-card {
    width: 100%;
}

.chameleon-summary-grid {
    margin-bottom: 1rem;
}

.overview-analytics-row {
    display: contents;
}

.overview-analytics-row > * {
    min-width: 0;
}

.overview-analytics-row .carrier-timeline-card,
.overview-analytics-row .basics-chart-row,
.overview-analytics-row .basics-chart-container {
    height: 100%;
    margin: 0;
}

.overview-analytics-row .carrier-timeline-card {
    display: flex;
    flex-direction: column;
}

.overview-analytics-row .carrier-timeline-shell,
.overview-analytics-row .carrier-timeline-track {
    flex: 1;
}

.chameleon-table-wrap {
    max-height: 260px;
    overflow: auto;
    padding-bottom: 0.6rem;
    margin-top: 0.2rem;
}

.chameleon-grouped-wrap {
    margin-top: 0.6rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    height: 380px;
    max-height: 380px;
}
.chameleon-column {
    display: flex;
    flex-direction: column;
    min-height: 0;
    border: 1px solid rgba(148, 163, 184, 0.4);
    border-radius: 8px;
    background: #fff;
    padding: 0.55rem 0.65rem;
    overflow: hidden;
}
.chameleon-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
    margin-bottom: 0.5rem;
    flex-shrink: 0;
}
.chameleon-section-count { color: #64748b; font-weight: 600; margin-left: 0.25rem; }
.chameleon-vin-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
    padding-right: 0.25rem;
}
.chameleon-column-empty {
    color: #64748b;
    font-size: 0.85rem;
    text-align: center;
    padding: 1.25rem 0.5rem;
}
@media (max-width: 720px) {
    .chameleon-grouped-wrap {
        grid-template-columns: 1fr;
        height: auto;
        max-height: 600px;
    }
    .chameleon-column { max-height: 280px; }
}
.chameleon-vin-card {
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 8px;
    background: #fff;
    padding: 0.55rem 0.75rem;
}
.chameleon-vin-card[open] { background: #fafbfc; }
.chameleon-vin-header {
    list-style: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
}
.chameleon-vin-header::-webkit-details-marker { display: none; }
.chameleon-vin-value code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.85rem;
    font-weight: 700;
    color: #0f172a;
}
.chameleon-vin-badge {
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
    border-radius: 999px;
    padding: 0.15rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}
.chameleon-carrier-list {
    list-style: none;
    margin: 0.55rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}
.chameleon-carrier-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.35rem 0;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
    font-size: 0.83rem;
}
.chameleon-carrier-row:first-child { border-top: none; }
.chameleon-carrier-main { display: flex; flex-direction: column; min-width: 0; }
.chameleon-carrier-name { font-weight: 600; color: #0f172a; }
.chameleon-carrier-dot { font-size: 0.74rem; color: #64748b; }
.chameleon-carrier-side { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.chameleon-carrier-loc { font-size: 0.74rem; color: #64748b; }
.chameleon-carrier-empty { justify-content: flex-start; color: #64748b; }
.chameleon-status-badge {
    display: inline-block;
    border-radius: 999px;
    padding: 0.15rem 0.55rem;
    font-size: 0.7rem;
    font-weight: 700;
}
.chameleon-status-active { background: rgba(22, 163, 74, 0.14); color: #15803d; }
.chameleon-status-inactive { background: rgba(220, 38, 38, 0.12); color: #b91c1c; }
.chameleon-status-unknown { background: rgba(148, 163, 184, 0.18); color: #475569; }

.violations-sort-btn {
    border: none;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.violations-sort-btn::after {
    content: '?';
    color: #94a3b8;
    font-size: 0.78em;
    line-height: 1;
}

.violations-sort-btn:hover {
    color: #285cf3;
}

.violations-sort-btn:hover::after,
.violations-sort-btn:focus-visible::after {
    color: #285cf3;
}

.boc3-history-list {
    display: grid;
    gap: 0.75rem;
}

.boc3-history-item {
    /* Render directly inside the parent card — no nested white block. The
       parent .subpanel-card already provides the translucent surface. */
    border: 1px solid rgba(121, 135, 161, 0.18);
    border-radius: 12px;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: 0.85rem 1rem;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem 1rem;
    font-size: 0.88rem;
    color: var(--text);
}

.insurance-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid rgba(121, 135, 161, 0.3);
}

.insurance-table th,
.insurance-table td {
    border: 1px solid rgba(121, 135, 161, 0.3);
    padding: 0.85rem 0.95rem;
    vertical-align: top;
}

.insurance-table thead th {
    background: #eef2ff;
}

.oos-rates-table {
    font-size: 1rem !important;
}

.oos-rates-table th,
.oos-rates-table td {
    font-size: 1rem;
    padding: 1rem 1.1rem;
}

.authority-history-table th,
.authority-history-table td {
    font-size: 0.95rem;
}

.authority-history-alert {
    margin-bottom: 0.85rem;
    color: #b91c1c;
    font-weight: 700;
}

.revocation-card {
    background: #fef2f2 !important;
    border-left: 4px solid #b91c1c !important;
    padding: 1.2rem !important;
}

.revocation-card-title {
    margin-bottom: 0.55rem;
    color: #111827;
    font-size: 1rem;
    font-weight: 800;
}

.revocation-card-alert {
    color: #b91c1c;
    font-weight: 700;
}

.revocation-card-item {
    margin: 0.4rem 0 0;
    font-size: 0.95rem;
}

#companyInfoSection,
.full-width-card,
.two-column-grid {
    width: 100% !important;
    position: static !important;
    left: auto !important;
    transform: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.full-width-card,
#companyInfoSection {
    margin-bottom: 0.75rem;
}

.two-column-grid {
    gap: 1.25rem;
}

.company-snapshot-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.company-card-span-2 {
    grid-column: span 2;
}

.company-card-span-3 {
    grid-column: 1 / -1;
}

.dashboard-main .company-snapshot-grid > .card,
.dashboard-main .company-snapshot-grid > .info-panel {
    min-height: auto;
    padding: 0.85rem 1rem !important;
}

#companyColIdentity,
#companyColAddresses,
#companyColContact,
#companyColFleetMetrics,
#companyColComplianceStatus {
    display: flex;
    flex-direction: column;
}

#companyColIdentity h3 {
    font-size: 1.3rem;
    line-height: 1.2;
    margin-bottom: 0.65rem;
}

#companyColIdentity .company-field-grid,
#companyColFleetMetrics .company-field-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem 0.9rem;
}

#companyColAddresses,
#companyColContact,
#companyColComplianceStatus {
    gap: 0.55rem;
}

#companyColAddresses,
#companyColContact,
#companyColComplianceStatus {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
}

#companyColAddresses .subpanel-title,
#companyColContact .subpanel-title,
#companyColComplianceStatus .subpanel-title {
    grid-column: 1 / -1;
}

#companyColIdentity p,
#companyColAddresses p,
#companyColContact p,
#companyColFleetMetrics p,
#companyColComplianceStatus p {
    font-size: 0.92rem;
    line-height: 1.45;
    margin: 0;
}

#companyColIdentity p strong,
#companyColAddresses p strong,
#companyColContact p strong,
#companyColFleetMetrics p strong,
#companyColComplianceStatus p strong {
    display: inline-block;
    font-size: 0.92rem;
    margin-right: 0.2rem;
}

#companyColIdentity span,
#companyColAddresses span,
#companyColContact span,
#companyColFleetMetrics span,
#companyColComplianceStatus span {
    font-size: 0.9rem;
}

#companyColFleetMetrics .warning-item {
    font-size: 1.05rem;
    line-height: 1.4;
}

.basics-table-snapshot {
    min-height: 0;
    overflow-y: auto;
}

.basics-chart-row {
    width: 100%;
}

.basics-chart-container {
    min-height: 200px;
    padding: 1rem !important;
}

.basics-chart-layout {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 1rem;
    align-items: stretch;
    flex: 1;
}

.basics-chart-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chart-controls-label {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #596882;
}

#basicsChartControls,
.chart-toggle-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* When #basicsChartControls is used inline, override column layout */
.ov-chart-controls-bar #basicsChartControls,
.ov-chart-controls-bar .chart-toggle-group {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 0.2rem !important;
}

.chart-toggle-btn {
    width: 100%;
    text-align: left;
    padding: 0.9rem 1rem;
    border: 1px solid transparent;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
}

.ov-chart-controls-bar .chart-toggle-btn {
    width: auto !important;
    padding: 0.15rem 0.4rem !important;
    font-size: 0.62rem !important;
    border-radius: 4px !important;
    white-space: nowrap !important;
    line-height: 1.3 !important;
}

.chart-range-panel {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.chart-range-select {
    width: 100%;
    min-height: 46px;
    padding: 0.75rem 0.9rem;
    border: 1px solid rgba(121, 135, 161, 0.24);
    border-radius: 12px;
    background-color: rgba(255,255,255,0.14);
    background-image: linear-gradient(135deg, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0.07) 100%);
    color: #1c273c;
}

.basics-chart-canvas-wrap {
    position: relative;
    min-height: 200px;
}

.basics-chart-canvas-wrap canvas {
    width: 100% !important;
    height: 100% !important;
}

#basicsSummaryTable .violations-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid rgba(121, 135, 161, 0.28);
}

#basicsSummaryTable .violations-table th,
#basicsSummaryTable .violations-table td {
    border: 1px solid rgba(121, 135, 161, 0.28);
    padding: 0.8rem 0.85rem;
    text-align: left;
}

#basicsSummaryTable .violations-table thead th {
    background: #eef2ff;
}

#basicsSummaryTable .violations-table tbody tr:nth-child(even) {
    background: #f8faff;
}

.basic-score-est {
    font-size: 0.72em;
    font-weight: 600;
    opacity: 0.7;
    font-style: italic;
}

.violations-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    align-items: stretch;
    grid-auto-rows: minmax(0, 1fr);
}

.violations-grid .violation-card {
    display: flex;
    flex-direction: column;
    height: 620px;
    min-height: 620px;
    padding: 1.1rem;
    background: rgba(255, 255, 255, 0.73) !important;
    border: 1px solid rgba(255, 255, 255, 1);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1) !important;
    backdrop-filter: blur(9.3px);
    -webkit-backdrop-filter: blur(9.3px);
}

.violations-grid .violation-card-title {
    padding: 0.25rem 0.3rem 1rem;
    margin: 0;
}

.violations-grid .scrollable-table {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 0.35rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.violations-grid .scrollable-table::-webkit-scrollbar {
    display: none;
}

.violations-board {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.snapshot-summary-card {
    min-height: auto !important;
}

.snapshot-summary-card .subpanel-title {
    margin-bottom: 0.35rem;
}

.fixed-scroll-card .section-title {
    padding: 0 0 1rem;
    margin: 0;
}

.violations-grid .violations-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid rgba(121, 135, 161, 0.28);
}

.violations-grid .violations-table th,
.violations-grid .violations-table td {
    border: 1px solid rgba(121, 135, 161, 0.28);
    padding: 0.8rem 0.85rem;
    text-align: left;
    vertical-align: top;
}

.violations-grid .violations-table thead th {
    background: #eef2ff;
}

.violation-library-card {
    padding: 1.1rem !important;
    height: 620px;
    display: flex;
    flex-direction: column;
    margin-top: 1.5rem;
}

.violation-library-controls {
    display: block;
    margin: 0.35rem 0 1rem;
}

.violation-library-controls input {
    width: 100%;
    border: 1px solid rgba(121, 135, 161, 0.24);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    background-color: rgba(255,255,255,0.12);
    background-image: linear-gradient(135deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0.04) 100%);
}

.violation-library-results {
    display: grid;
    gap: 0.85rem;
    flex: 1;
    min-height: 0;
    overflow: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.violation-library-results::-webkit-scrollbar {
    display: none;
}

.violation-library-item {
    border: 1px solid rgba(255, 255, 255, 1);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.73);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(9.3px);
    -webkit-backdrop-filter: blur(9.3px);
    padding: 0.95rem 1rem;
}

.violation-library-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
    margin-bottom: 0.35rem;
}

.violation-library-meta strong {
    color: #1c273c;
}

.violation-library-meta span,
.violation-library-description,
.violation-library-empty {
    color: #596882;
}

.section-title,
.subpanel-title {
    color: #1c273c;
}

.loading.app-state-card,
#errorCard.app-state-card {
    padding: 2rem;
    text-align: center;
}

/* ---------------------------------------------------------------
   Overview Dashboard — Compact Admin-Panel Grid System
   --------------------------------------------------------------- */

/* -- Master grid -- */
.ov-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.6rem;
    width: 100%;
}

.ov-grid#companyInfoGrid {
    display: grid;
    grid-template-columns: 1fr;
}

/* -- Base card -- */
.ov-card {
    background: rgba(248, 250, 255, 0.32) !important;
    border: 1.5px solid rgba(37, 99, 235, 0.14) !important;
    border-radius: 10px !important;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04) !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    padding: 0.7rem 0.85rem !important;
    min-height: 0;
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.ov-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.07) !important;
    border-color: rgba(37, 99, 235, 0.26) !important;
}

/* Force basics-table-container to match .ov-card when used as one */
.ov-card.basics-table-container {
    background: rgba(248, 250, 255, 0.32) !important;
    border: 1.5px solid rgba(37, 99, 235, 0.14) !important;
    border-radius: 10px !important;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04) !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
}

.ov-card.basics-table-container:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.07) !important;
    border-color: rgba(37, 99, 235, 0.26) !important;
}

/* -- Shared typography -- */
.ov-card-label {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: #475569;
    margin-bottom: 0.15rem;
    line-height: 1.2;
}

.ov-card-val {
    font-size: 0.92rem;
    font-weight: 600;
    color: #1c273c;
    line-height: 1.35;
}

/* ------------------------------------------
   Side-stack items (ISS, Risk, Crashes, etc.)
   ------------------------------------------ */
.ov-side-stack {
    display: flex;
    flex-direction: column;
    gap: 0;
    justify-content: stretch;
}

.ov-side-stack .ov-side-item {
    flex: 1;
}

.ov-side-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.7rem !important;
    min-height: 0;
    border-radius: 0 !important;
    border-left: 1.5px solid rgba(37, 99, 235, 0.14) !important;
    border-right: 1.5px solid rgba(37, 99, 235, 0.14) !important;
    border-top: none !important;
    border-bottom: 1px solid rgba(37, 99, 235, 0.08) !important;
    box-shadow: none !important;
}

.ov-side-stack .ov-side-item:first-child {
    border-top: 1.5px solid rgba(37, 99, 235, 0.14) !important;
    border-radius: 10px 10px 0 0 !important;
}

.ov-side-stack .ov-side-item:last-child {
    border-bottom: 1.5px solid rgba(37, 99, 235, 0.14) !important;
    border-radius: 0 0 10px 10px !important;
}

.ov-side-label {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
    line-height: 1.15;
    flex: 1;
    min-width: 0;
}

.ov-side-value {
    font-size: 1.15rem;
    font-weight: 800;
    color: #1c273c;
    line-height: 1.1;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.ov-side-value-accent {
    color: #2563eb;
}

.ov-side-value-sm {
    font-size: 0.88rem;
}

.ov-side-sub {
    font-size: 0.72rem;
    font-weight: 700;
    color: #475569;
    white-space: nowrap;
}

.ov-side-sub-label {
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #94a3b8;
    margin-right: 0.15rem;
}

/* ISS / Risk — use base card style, accent only on value color */
.ov-kpi-iss,
.ov-kpi-risk {
    /* inherits .ov-card background and border */
}

/* Alerts inside side-stack */
.ov-side-item-alerts .snapshot-alerts-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    justify-content: flex-end;
    min-height: 0;
}

/* ------------------------------------------
   Row-triple layout — chart + table + side stack
   ------------------------------------------ */
.ov-row-triple {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.6rem;
    align-items: stretch;
}

/* ------------------------------------------
   Row-even layout — equal 50/50 split
   ------------------------------------------ */
.ov-row-even {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.6rem;
    align-items: stretch;
}

/* Prevent risk-section inside row-even from spanning full width */
.ov-row-even > .ov-risk-section {
    grid-column: auto;
}

/* ------------------------------------------
   Risk Analysis Section
   ------------------------------------------ */
.ov-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ov-section-label {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #64748b;
    padding-left: 0.15rem;
}

.ov-risk-section {
    background: rgba(248, 250, 255, 0.45);
    border: 1.5px solid rgba(37, 99, 235, 0.12);
    border-radius: 12px;
    padding: 0.6rem;
}

.ov-risk-top {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 0.5rem;
}

/* When risk section is inside a 50/50 split, stack the top row */
.ov-row-even .ov-risk-top {
    grid-template-columns: 1fr;
}

/* When risk section is inside a 50/50 split, stack trends to 2 cols */
.ov-row-even .ov-trends-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ov-risk-cell {
    min-height: 0;
}

.ov-risk-alerts .snapshot-alerts-inline {
    min-height: 28px;
    justify-content: flex-start;
    flex: none;
}

.ov-risk-reasons .snapshot-risk-reasons {
    font-size: 0.85rem !important;
    line-height: 1.4;
    white-space: normal;
}

.ov-risk-trends-card {
    padding: 0.55rem 0.8rem !important;
}

.ov-trends-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.4rem;
    margin-top: 0.25rem;
}

.ov-trend-item {
    display: flex;
    flex-direction: column;
    padding: 0.35rem 0.5rem;
    border-radius: 7px;
    background: rgba(37, 99, 235, 0.04);
    border: 1.5px solid rgba(37, 99, 235, 0.10);
}

.ov-trend-label {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #94a3b8;
    line-height: 1.2;
}

.ov-trend-val {
    font-size: 0.88rem;
    font-weight: 700;
    color: #1c273c;
    line-height: 1.25;
}

/* ------------------------------------------
   ROW 3–4 — Detail Cards (Company, Fleet, etc.)
   ------------------------------------------ */
.ov-detail {
    padding: 0.7rem 0.85rem !important;
}

.ov-detail-title {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #1e3a5f;
    margin-bottom: 0.4rem;
    padding-bottom: 0.3rem;
    border-bottom: 1.5px solid rgba(37, 99, 235, 0.14);
}

.ov-company-name {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5rem;
    color: #1c273c;
}

/* Field grids */
.ov-field-grid {
    display: grid;
    gap: 0.35rem 0.7rem;
}

.ov-field-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ov-field-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ov-field-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Compact field text */
.ov-detail p {
    font-size: 0.85rem;
    line-height: 1.4;
    margin: 0;
}

.ov-detail p strong {
    font-size: 0.82rem;
    font-weight: 700;
    color: #475569;
    margin-right: 0.15rem;
}

.ov-detail p span {
    font-size: 0.85rem;
    color: #1c273c;
}

.ov-detail .warning-item {
    font-size: 0.82rem;
    line-height: 1.3;
}

/* Row 0: Identity + Contact + Addresses (equal 3-col at desktop) */
.ov-detail-identity { grid-column: 1 / -1; }
.ov-detail-contact { grid-column: 1 / -1; }
.ov-detail-addresses { grid-column: 1 / -1; }

/* Compliance */
.ov-detail-compliance { grid-column: 1 / -1; }

/* Fleet */
.ov-detail-fleet { grid-column: 1 / -1; }

/* Full-width cards */
.ov-full { grid-column: 1 / -1; }

/* Half-width cards */
.ov-half { grid-column: 1 / -1; }

/* Compact BASIC chart card */
.ov-chart-compact {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.ov-chart-compact .basics-chart-canvas-wrap {
    min-height: 140px !important;
    flex: 1;
}

/* Chart controls bar — single horizontal line above the chart */
.ov-chart-controls-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
    margin-bottom: 0.35rem;
    overflow-x: auto;
}

.ov-chart-controls-inline {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap;
    gap: 0.25rem;
}

.ov-chart-controls-inline .chart-toggle-btn {
    width: auto;
    padding: 0.2rem 0.45rem;
    font-size: 0.68rem;
    border-radius: 5px;
    white-space: nowrap;
}

.ov-chart-range-inline {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-left: auto;
    flex-shrink: 0;
}

.ov-chart-range-inline .chart-controls-label {
    font-size: 0.65rem;
    margin: 0;
}

.ov-chart-range-inline .chart-range-select {
    min-height: 24px;
    padding: 0.15rem 0.4rem;
    font-size: 0.72rem;
    border-radius: 5px;
}

/* Compact carrier timeline card */
.ov-timeline-compact {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.ov-timeline-compact .carrier-timeline-shell,
.ov-timeline-compact .carrier-timeline-track {
    flex: 1;
    min-height: 140px;
}

.ov-timeline-compact .carrier-timeline-toolbar {
    margin-bottom: 0.4rem;
}

/* Switch to 12-col grid at desktop widths */
@media (min-width: 992px) {
    .ov-grid {
        grid-template-columns: repeat(12, minmax(0, 1fr));
        gap: 0.6rem;
    }

    .ov-grid#companyInfoGrid {
        grid-template-columns: repeat(12, minmax(0, 1fr));
    }

    .ov-kpi-strip {
        grid-column: 1 / -1;
    }

    .ov-risk-section {
        grid-column: 1 / -1;
    }

    /* Chart (left, wider) + BASIC Table (center) + side stack (right, narrow) */
    .ov-row-triple {
        grid-column: 1 / -1;
        grid-template-columns: 3fr 2fr minmax(120px, 1fr);
        align-items: stretch;
    }

    /* Timeline + Risk Analysis — equal 50/50 */
    .ov-row-even {
        grid-column: 1 / -1;
        grid-template-columns: 1fr 1fr;
        align-items: stretch;
    }

    .ov-row-even > .ov-risk-section {
        grid-column: auto;
    }

    /* Row 0: Identity + Contact + Addresses — equal thirds */
    .ov-detail-identity { grid-column: span 4; }
    .ov-detail-contact { grid-column: span 4; }
    .ov-detail-addresses { grid-column: span 4; }

    .ov-detail-compliance { grid-column: span 4; }
    .ov-detail-fleet { grid-column: span 8; }

    /* Full-width */
    .ov-full { grid-column: 1 / -1; }

    /* Half-width */
    .ov-half { grid-column: span 6; }
}

/* Medium screens */
@media (min-width: 992px) and (max-width: 1279px) {
    .ov-kpi-strip {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .ov-risk-top {
        grid-template-columns: 1fr 1fr;
    }

    .ov-risk-reasons {
        grid-column: 1 / -1;
    }

    .ov-detail-identity { grid-column: span 4; }
    .ov-detail-contact { grid-column: span 4; }
    .ov-detail-addresses { grid-column: span 4; }

    .ov-detail-compliance { grid-column: span 5; }
    .ov-detail-fleet { grid-column: span 7; }

    .ov-field-grid-4 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .ov-row-triple {
        grid-template-columns: 2.5fr 2fr minmax(110px, 1fr);
    }

    .ov-row-even {
        grid-template-columns: 1fr 1fr;
    }
}

/* Small screens */
@media (max-width: 991px) {
    .ov-kpi-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ov-risk-top {
        grid-template-columns: 1fr;
    }

    .ov-trends-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ov-field-grid-3,
    .ov-field-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ov-field-grid-2 {
        grid-template-columns: 1fr;
    }

    .ov-row-triple {
        grid-template-columns: 1fr;
    }

    .ov-row-even {
        grid-template-columns: 1fr;
    }

    /* On mobile, side stack goes horizontal in two rows */
    .ov-side-stack {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.35rem;
    }
}

@media (max-width: 600px) {
    .ov-kpi-strip {
        grid-template-columns: 1fr 1fr;
    }

    .ov-kpi {
        min-height: 66px;
    }

    .ov-kpi-value {
        font-size: 1.2rem;
    }

    .ov-trends-grid {
        grid-template-columns: 1fr 1fr;
    }

    .ov-field-grid-2,
    .ov-field-grid-3,
    .ov-field-grid-4 {
        grid-template-columns: 1fr;
    }
}

/* Remove old analytics-row wrapper behavior */
.overview-analytics-row {
    display: contents;
}

/* --- end Overview Dashboard --- */

/* ---------------------------------------------------------------
   Global card restyling — apply .ov-card look to all tab cards
   (except profile saved-report cards)
   --------------------------------------------------------------- */
#pageContent .card:not(.profile-history-card),
#pageContent .subpanel-card,
#pageContent .map-shell,
#pageContent .violation-card,
#pageContent .dashboard-section-header {
    background: rgba(248, 250, 255, 0.32) !important;
    border: 1.5px solid rgba(37, 99, 235, 0.14) !important;
    border-radius: 10px !important;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04) !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
}

#pageContent .card:not(.profile-history-card):hover,
#pageContent .subpanel-card:hover,
#pageContent .map-shell:hover,
#pageContent .violation-card:hover,
#pageContent .dashboard-section-header:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.07) !important;
    border-color: rgba(37, 99, 235, 0.26) !important;
}

/* ---------------------------------------------------------------
   Analytics Tools
   --------------------------------------------------------------- */
.analytics-tool-card {
    padding: 1rem 1.25rem !important;
    margin-bottom: 0.5rem;
}

.analytics-tool-header {
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1.5px solid rgba(37, 99, 235, 0.12);
}

.analytics-tool-title {
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #1e3a5f;
    margin-bottom: 0.2rem;
}

.analytics-tool-desc {
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.4;
    margin: 0;
}

.analytics-tool-body {
    min-height: 0;
}

.analytics-chart-wrap {
    position: relative;
    min-height: 200px;
}

.analytics-chart-wrap canvas {
    width: 100% !important;
    max-height: 320px;
}

.analytics-empty {
    display: block;
    padding: 1.5rem;
    text-align: center;
    color: #94a3b8;
    font-size: 0.85rem;
    font-style: italic;
}

/* Summary strips */
.analytics-summary-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.6rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(37, 99, 235, 0.08);
}

.analytics-alert-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.78rem;
    line-height: 1.3;
}

.analytics-alert-ok {
    background: rgba(34, 197, 94, 0.08);
    color: #16a34a;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.analytics-alert-warn {
    background: rgba(245, 158, 11, 0.08);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.analytics-alert-active {
    background: rgba(239, 68, 68, 0.08);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Heatmap */
.analytics-heatmap-scroll {
    overflow-x: auto;
}

.analytics-heatmap-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}

.analytics-heatmap-table th,
.analytics-heatmap-table td {
    padding: 0.35rem 0.5rem;
    text-align: center;
    border: 1px solid rgba(37, 99, 235, 0.08);
    white-space: nowrap;
}

.analytics-heatmap-corner {
    text-align: left !important;
    font-weight: 800;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.analytics-heatmap-col-header {
    font-weight: 700;
    color: #475569;
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.analytics-heatmap-row-header {
    text-align: left !important;
    font-weight: 700;
    color: #1e3a5f;
    font-size: 0.75rem;
}

.analytics-heatmap-cell {
    font-weight: 600;
    font-size: 0.72rem;
    min-width: 55px;
    transition: transform 0.1s ease;
}

.analytics-heatmap-cell:hover {
    transform: scale(1.08);
    z-index: 1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.analytics-heatmap-empty {
    color: #cbd5e1;
    background: #f8fafc !important;
}

/* Funnel */
.analytics-funnel-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.analytics-funnel-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.analytics-funnel-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
    border-radius: 8px;
    background: rgba(37, 99, 235, 0.04);
    border: 1px solid rgba(37, 99, 235, 0.08);
}

.analytics-funnel-stat-val {
    font-size: 1.3rem;
    font-weight: 800;
    line-height: 1.1;
}

.analytics-funnel-stat-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    margin-top: 0.15rem;
}

.analytics-funnel-breakdown {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.78rem;
    color: #475569;
}

/* Insurance gap */
.analytics-gap-bars {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.analytics-gap-row {
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    border: 1.5px solid rgba(37, 99, 235, 0.1);
    background: rgba(248, 250, 255, 0.5);
}

.analytics-gap-type {
    font-weight: 700;
    font-size: 0.78rem;
    color: #1e3a5f;
    margin-bottom: 0.3rem;
}

.analytics-gap-bar-track {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.3rem;
}

.analytics-gap-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}

.analytics-gap-active .analytics-gap-bar-fill { background: #22c55e; width: 100%; }
.analytics-gap-caution .analytics-gap-bar-fill { background: #f59e0b; width: 75%; }
.analytics-gap-warning .analytics-gap-bar-fill { background: #fb923c; width: 50%; }
.analytics-gap-critical .analytics-gap-bar-fill { background: #ef4444; width: 25%; }
.analytics-gap-expired .analytics-gap-bar-fill { background: #94a3b8; width: 100%; }

.analytics-gap-dates {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.72rem;
    color: #64748b;
}

.analytics-gap-status-badge {
    font-weight: 700;
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
}

.analytics-gap-active .analytics-gap-status-badge { background: rgba(34,197,94,0.12); color: #16a34a; }
.analytics-gap-caution .analytics-gap-status-badge { background: rgba(245,158,11,0.12); color: #d97706; }
.analytics-gap-warning .analytics-gap-status-badge { background: rgba(251,146,60,0.12); color: #ea580c; }
.analytics-gap-critical .analytics-gap-status-badge { background: rgba(239,68,68,0.12); color: #dc2626; }
.analytics-gap-expired .analytics-gap-status-badge { background: rgba(148,163,184,0.12); color: #64748b; }

.analytics-gap-amount {
    font-size: 0.72rem;
    color: #475569;
    font-weight: 600;
    margin-top: 0.15rem;
}

/* Top Violations by Category */
.analytics-top-violations-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.analytics-top-viol-category {
    border: 1.5px solid rgba(37, 99, 235, 0.10);
    border-radius: 8px;
    padding: 0.6rem 0.7rem;
    background: rgba(248, 250, 255, 0.35);
}

.analytics-top-viol-category-name {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #1e3a5f;
    margin-bottom: 0.35rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid rgba(37, 99, 235, 0.08);
}

.analytics-top-viol-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}

.analytics-top-viol-table th {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    padding: 0.2rem 0.35rem;
    text-align: center;
    border-bottom: 1px solid rgba(37, 99, 235, 0.08);
}

.analytics-top-viol-table th:first-child {
    text-align: left;
}

.analytics-top-viol-table td {
    padding: 0.3rem 0.35rem;
    border-bottom: 1px solid rgba(0,0,0,0.03);
}

.analytics-top-viol-num {
    text-align: center;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.analytics-viol-code-btn {
    background: none;
    border: none;
    color: #2563eb;
    font-weight: 700;
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-decoration-color: rgba(37, 99, 235, 0.3);
    text-underline-offset: 2px;
    transition: color 0.12s ease;
}

.analytics-viol-code-btn:hover {
    color: #1d4ed8;
    text-decoration-color: #1d4ed8;
}

/* Violation description popup */
.analytics-viol-popup {
    position: absolute;
    z-index: 9999;
    width: 320px;
    max-width: calc(100vw - 16px);
    background: #fff;
    border: 1.5px solid rgba(37, 99, 235, 0.18);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.14);
    animation: analytics-popup-in 0.15s ease;
}

@keyframes analytics-popup-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.analytics-viol-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid rgba(37, 99, 235, 0.1);
    font-size: 0.82rem;
    color: #1e3a5f;
}

.analytics-viol-popup-close {
    background: none;
    border: none;
    font-size: 1rem;
    color: #94a3b8;
    cursor: pointer;
    padding: 0 0.2rem;
    line-height: 1;
}

.analytics-viol-popup-close:hover {
    color: #ef4444;
}

.analytics-viol-popup-body {
    padding: 0.6rem 0.75rem;
    font-size: 0.78rem;
    color: #475569;
    line-height: 1.5;
}

/* BASIC Category History Charts */
.analytics-basic-history-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.analytics-basic-history-item {
    border: 1.5px solid rgba(37, 99, 235, 0.10);
    border-radius: 8px;
    padding: 0.6rem 0.7rem;
    background: rgba(248, 250, 255, 0.35);
}

.analytics-basic-history-title {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #1e3a5f;
    margin-bottom: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.analytics-basic-history-score {
    font-weight: 700;
    font-size: 0.7rem;
    color: #1e3a5f;
    text-transform: none;
    letter-spacing: 0;
}

.analytics-basic-history-threshold-label {
    font-weight: 600;
    font-size: 0.65rem;
    color: #ef4444;
    margin-left: auto;
    text-transform: none;
    letter-spacing: 0;
}

.analytics-basic-history-canvas-wrap {
    position: relative;
    height: 160px;
}

.analytics-basic-history-canvas-wrap canvas {
    width: 100% !important;
}

@media (max-width: 768px) {
    .analytics-top-violations-grid,
    .analytics-basic-history-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 768px) {
    .analytics-funnel-layout {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .analytics-funnel-stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1279px) {
    .company-snapshot-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .responsive-panel-row {
        grid-template-columns: 1fr;
    }

    .company-card-span-3 {
        grid-column: 1 / -1;
    }

    .basics-chart-layout {
        grid-template-columns: 220px minmax(0, 1fr);
    }
}

@media (max-width: 991px) {
    .app-header .container {
        flex-wrap: wrap;
        padding: 0.5rem 1rem 0.25rem;
    }

    .app-header-top-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        gap: 1rem;
    }

    .app-header-menu {
        position: static;
        transform: none;
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 0.35rem;
    }

    .app-header-right {
        width: 100%;
        flex-wrap: wrap;
    }

    .app-header-search {
        min-width: 100%;
        width: 100%;
    }

    .nav-user {
        width: 100%;
        justify-content: space-between;
        border-radius: 16px;
    }

    .tool-intro-hero,
    .auth-page-grid {
        display: grid;
        grid-template-columns: 1fr;
    }

    .tool-intro-stats,
    .tool-intro-points,
    .company-snapshot-grid,
    .overview-analytics-row,
    .violations-grid,
    .basics-two-column,
    .two-column-grid {
        grid-template-columns: 1fr !important;
    }

    .company-card-span-2,
    .company-card-span-3 {
        grid-column: auto;
    }

    .basics-chart-layout {
        grid-template-columns: 1fr;
    }

    .basics-chart-container,
    .basics-table-snapshot,
    .dashboard-main .company-snapshot-grid > .card,
    .dashboard-main .company-snapshot-grid > .info-panel {
        min-height: auto;
    }

    .snapshot-risk-trends {
        grid-template-columns: 1fr;
    }

    .carrier-timeline-track {
        min-width: 720px;
    }

    .auth-brand-panel,
    .auth-form-panel {
        padding: 2rem;
    }
}

/* -------------------------------------------------------
   PREDICTIVE MODEL — ISS Score Simulator
   ------------------------------------------------------- */

.predictive-score-header {
    padding: 1.25rem 1.5rem;
    position: sticky;
    top: 5.25rem;
    z-index: 120;
    background: transparent;
    backdrop-filter: none;
    box-shadow: none;
    transition: background-color 0.18s ease, box-shadow 0.18s ease, backdrop-filter 0.18s ease;
}

.predictive-score-header.predictive-score-header-scrolled {
    background: rgba(255, 255, 255, 1);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 24px -20px rgba(15, 23, 42, 0.45);
}

.predictive-score-header.predictive-score-header-compact {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.predictive-score-header.predictive-score-header-compact .pred-header-split {
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

.predictive-score-header.predictive-score-header-compact .pred-header-right,
.predictive-score-header.predictive-score-header-compact .pred-chart-title,
.predictive-score-header.predictive-score-header-compact .pred-chart-wrap {
    display: none;
}

.predictive-score-header.predictive-score-header-compact .predictive-score-comparison {
    margin-bottom: 0.6rem;
    gap: 0.85rem;
}

.predictive-score-header.predictive-score-header-compact .predictive-score-box {
    min-width: 88px;
}

.predictive-score-header.predictive-score-header-compact .predictive-score-label,
.predictive-score-header.predictive-score-header-compact .predictive-score-rec,
.predictive-score-header.predictive-score-header-compact #predDeltaLabel {
    font-size: 0.62rem;
}

.predictive-score-header.predictive-score-header-compact .predictive-score-value {
    font-size: 1.55rem;
    margin-bottom: 0.05rem;
}

.predictive-score-header.predictive-score-header-compact .predictive-score-arrow {
    font-size: 1rem;
}

.predictive-score-header.predictive-score-header-compact .predictive-score-bar-wrap {
    margin-bottom: 0.55rem;
}

.predictive-score-header.predictive-score-header-compact .pred-path-indicator {
    padding: 0.45rem 0.6rem;
}

.predictive-score-header.predictive-score-header-compact .pred-path-desc,
.predictive-score-header.predictive-score-header-compact .predictive-actions-row,
.predictive-score-header.predictive-score-header-compact .pred-violations-status {
    display: none;
}

@media (max-width: 900px) {
    .predictive-score-header {
        top: 4.75rem;
    }
}

/* 50/50 horizontal split: ISS scores | Trend chart */
.pred-header-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 900px) {
    .pred-header-split {
        grid-template-columns: 1fr;
    }
}

.pred-header-left {
    min-width: 0;
}

.pred-header-right {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.pred-chart-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.pred-chart-wrap {
    position: relative;
    width: 100%;
    height: 220px;
}

.pred-chart-wrap canvas {
    width: 100% !important;
    height: 100% !important;
}

.predictive-score-comparison {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.predictive-score-box {
    text-align: center;
    min-width: 120px;
}

.predictive-score-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.predictive-score-value {
    font-size: 2.2rem;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 0.15rem;
}

.predictive-score-rec {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pred-score-red { color: #dc2626; }
.pred-score-orange { color: #d97706; }
.pred-score-green { color: #16a34a; }

.pred-delta-worse { color: #dc2626; }
.pred-delta-better { color: #16a34a; }
.pred-delta-same { color: #94a3b8; }

.predictive-score-arrow {
    font-size: 1.8rem;
    color: #94a3b8;
    font-weight: 300;
}

/* Score bar */
.predictive-score-bar-wrap {
    margin: 0.75rem 0 0.5rem;
}

.predictive-score-bar {
    position: relative;
    display: flex;
    height: 28px;
    border-radius: 6px;
    overflow: visible;
}

.predictive-bar-zone {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.62rem;
    font-weight: 700;
    color: rgba(255,255,255,0.9);
    letter-spacing: 0.03em;
}

.predictive-bar-pass { background: #16a34a; border-radius: 6px 0 0 6px; }
.predictive-bar-optional { background: #d97706; }
.predictive-bar-inspect { background: #dc2626; border-radius: 0 6px 6px 0; }

.predictive-bar-marker {
    position: absolute;
    top: -6px;
    width: 3px;
    height: 40px;
    border-radius: 2px;
    transform: translateX(-50%);
    transition: left 0.3s ease;
    z-index: 2;
}

.predictive-bar-current {
    background: #1e293b;
    box-shadow: 0 0 0 2px #fff;
}

.predictive-bar-sim {
    background: #3b82f6;
    box-shadow: 0 0 0 2px #fff;
}

.predictive-actions-row {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.predictive-reset-btn {
    background: none;
    border: 1px solid #cbd5e1;
    color: #475569;
    padding: 0.35rem 1rem;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.predictive-reset-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.predictive-update-btn {
    background: none;
    border: 1px solid #93c5fd;
    color: #2563eb;
    padding: 0.35rem 1rem;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.predictive-update-btn:hover {
    background: #eff6ff;
    border-color: #3b82f6;
}

.predictive-update-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pred-violations-status {
    text-align: center;
    margin-top: 0.35rem;
    font-size: 0.68rem;
    min-height: 1em;
}

.pred-status-ok {
    color: #16a34a;
    font-weight: 600;
}

.pred-status-date {
    color: #94a3b8;
}

.pred-status-updated {
    color: #2563eb;
    font-weight: 600;
}

.pred-status-empty {
    color: #94a3b8;
    font-style: italic;
}

.pred-status-error {
    color: #dc2626;
    font-weight: 600;
}

/* BASIC cards grid — 5 public categories, wider cards */
.predictive-basics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
    gap: 0.85rem;
}

.predictive-basic-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem 0.85rem;
    transition: all 0.15s ease;
}

.predictive-basic-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.predictive-basic-disabled {
    opacity: 0.45;
    background: #f8fafc;
}

.predictive-basic-alert {
    border-color: #fca5a5;
    background: #fef2f2;
}

.predictive-basic-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.45rem;
}

.predictive-basic-name {
    font-weight: 700;
    font-size: 0.82rem;
    flex: 1;
}

.predictive-basic-diff {
    font-size: 0.72rem;
    font-weight: 700;
}

.pred-diff-up { color: #dc2626; }
.pred-diff-down { color: #16a34a; }
.pred-diff-same { color: #94a3b8; }

/* Violation score display */
.pred-viol-score-row {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    margin-bottom: 0.4rem;
}

.pred-viol-score {
    font-size: 1.5rem;
    font-weight: 900;
    color: #1e293b;
    line-height: 1;
}

.pred-viol-score-alert {
    color: #dc2626;
}

.pred-viol-score-label {
    font-size: 0.68rem;
    color: #94a3b8;
    font-weight: 600;
}

/* Measure display */
.pred-viol-measure-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.68rem;
    color: #64748b;
    margin-bottom: 0.35rem;
}

.pred-viol-measure-label {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
}

.pred-viol-measure-value {
    font-weight: 600;
    color: #475569;
}

.pred-viol-measure-base {
    color: #94a3b8;
    font-weight: 400;
}

/* Violation list header */
.pred-viol-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.45rem;
    padding-top: 0.4rem;
    border-top: 1px solid #e2e8f0;
    font-size: 0.68rem;
    color: #64748b;
    font-weight: 600;
}

.pred-viol-add-btn {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #3b82f6;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.1s ease;
}

.pred-viol-add-btn:hover {
    background: #dbeafe;
    border-color: #93c5fd;
}

/* Violation list */
.pred-viol-list {
    max-height: 260px;
    overflow-y: auto;
    margin-top: 0.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.pred-viol-item {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    padding: 0.35rem 0.45rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.68rem;
    transition: all 0.1s ease;
}

.pred-viol-item.pred-viol-disabled {
    opacity: 0.45;
    background: #f1f5f9;
}

.pred-viol-item.pred-viol-added {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.pred-viol-toggle {
    flex-shrink: 0;
    margin-top: 1px;
}

.pred-viol-toggle input {
    width: 14px;
    height: 14px;
    cursor: pointer;
}

.pred-viol-item-body {
    flex: 1;
    min-width: 0;
}

.pred-viol-item-desc {
    color: #1e293b;
    line-height: 1.35;
    word-break: break-word;
}

.pred-viol-item-desc strong {
    color: #475569;
}

.pred-viol-oos {
    background: #dc2626;
    color: #fff;
    font-size: 0.56rem;
    font-weight: 800;
    padding: 0.08rem 0.3rem;
    border-radius: 3px;
    vertical-align: middle;
}

.pred-viol-item-meta {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.15rem;
    font-size: 0.6rem;
    color: #94a3b8;
    font-weight: 600;
}

.pred-tw-high { color: #dc2626; }
.pred-tw-mid { color: #f59e0b; }
.pred-tw-low { color: #94a3b8; }

.pred-viol-remove-btn {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #dc2626;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.1rem;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.1s;
}

.pred-viol-remove-btn:hover {
    opacity: 1;
}

.pred-viol-empty {
    font-size: 0.68rem;
    color: #94a3b8;
    font-style: italic;
    padding: 0.4rem 0;
}

/* Inspection simulation elements */
.pred-insp-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0;
    font-size: 0.78rem;
    color: #64748b;
}

.pred-insp-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: pred-spin 0.6s linear infinite;
}

@keyframes pred-spin {
    to { transform: rotate(360deg); }
}

.pred-insp-totw-label {
    font-weight: 700;
    color: #475569;
    font-size: 0.66rem;
}

.pred-insp-total-note {
    color: #94a3b8;
    font-weight: 400;
    font-size: 0.62rem;
}

.pred-insp-item-header {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.pred-insp-date {
    font-weight: 700;
    color: #1e293b;
    font-size: 0.72rem;
}

.pred-insp-report {
    font-size: 0.64rem;
    color: #94a3b8;
    font-weight: 600;
}

.pred-insp-report-link {
    font-size: 0.64rem;
    color: #3b82f6;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.pred-insp-report-link:hover {
    text-decoration: underline;
    color: #2563eb;
}

.pred-viol-item.pred-insp-clickable {
    cursor: default;
}

.pred-viol-item.pred-insp-clickable .pred-insp-item-header {
    cursor: default;
}

.pred-insp-viols {
    margin-top: 0.2rem;
    padding-left: 0.15rem;
    border-left: 2px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.pred-insp-viol-row {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    font-size: 0.62rem;
    color: #64748b;
    padding: 0.08rem 0 0.08rem 0.35rem;
}

.pred-insp-viol-code {
    font-weight: 700;
    color: #3b82f6;
    flex-shrink: 0;
    min-width: 52px;
}

.pred-insp-viol-desc {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pred-insp-viol-wt {
    flex-shrink: 0;
    font-weight: 700;
    color: #475569;
    min-width: 18px;
    text-align: right;
}

.pred-insp-viol-toggle-btn {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0 0.1rem;
    line-height: 1;
    color: #94a3b8;
    opacity: 0.7;
    transition: opacity 0.1s, color 0.1s;
    margin-left: auto;
}

.pred-insp-viol-toggle-btn:hover {
    opacity: 1;
    color: #dc2626;
}

.pred-insp-viol-row.pred-insp-viol-removed {
    opacity: 0.38;
    text-decoration: line-through;
}

.pred-insp-viol-row.pred-insp-viol-removed .pred-insp-viol-toggle-btn {
    color: #3b82f6;
    text-decoration: none;
    opacity: 0.8;
}

.pred-insp-viol-row.pred-insp-viol-removed .pred-insp-viol-toggle-btn:hover {
    color: #2563eb;
    opacity: 1;
}

/* -- Score Improvement Strategy card -- */
.pred-suggestions-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pred-suggestions-loading {
    font-size: 0.75rem;
    color: #94a3b8;
    font-style: italic;
    padding: 0.5rem 0;
}

.pred-sug-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pred-sug-badge {
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
}

.pred-sug-badge-alert {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fca5a5;
}

.pred-sug-badge-warn {
    background: #fffbeb;
    color: #d97706;
    border: 1px solid #fde68a;
}

.pred-sug-badge-ok {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.pred-sug-card {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem 0.85rem;
    background: #fff;
}

.pred-sug-card-alert {
    border-color: #fca5a5;
    background: #fef2f2;
}

.pred-sug-card-warn {
    border-color: #fde68a;
    background: #fffbeb;
}

.pred-sug-card-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.pred-sug-card-name {
    font-size: 0.82rem;
    font-weight: 800;
}

.pred-sug-card-status {
    font-size: 0.64rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

.pred-sug-impact-title {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #475569;
    margin-bottom: 0.3rem;
}

.pred-sug-impact-list {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-bottom: 0.5rem;
}

.pred-sug-impact-item {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    font-size: 0.66rem;
    color: #475569;
    padding: 0.2rem 0.3rem;
    border-radius: 4px;
    background: rgba(255,255,255,0.6);
}

.pred-sug-impact-rank {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #3b82f6;
    color: #fff;
    font-size: 0.56rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pred-sug-impact-code {
    font-weight: 700;
    color: #3b82f6;
    flex-shrink: 0;
    min-width: 52px;
}

.pred-sug-impact-desc {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pred-sug-impact-wt {
    flex-shrink: 0;
    font-weight: 700;
    color: #64748b;
    min-width: 36px;
    text-align: right;
}

.pred-sug-recs {
    margin-top: 0.25rem;
}

.pred-sug-recs-title {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #16a34a;
    margin-bottom: 0.2rem;
}

.pred-sug-recs ul {
    margin: 0;
    padding: 0 0 0 1.1rem;
    list-style: disc;
}

.pred-sug-recs li {
    font-size: 0.72rem;
    color: #334155;
    line-height: 1.5;
    margin-bottom: 0.3rem;
}

.pred-sug-all-clear {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 8px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.pred-sug-all-clear-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #16a34a;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pred-sug-all-clear-text {
    font-size: 0.75rem;
    color: #334155;
    line-height: 1.5;
}

/* Add violation modal */
.pred-add-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.35);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pred-add-modal-content {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    width: 380px;
    max-width: 92vw;
    overflow: hidden;
}

.pred-add-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.85rem;
    gap: 0.5rem;
}

.pred-add-modal-basic {
    font-weight: 700;
    font-size: 0.75rem;
    flex: 1;
    text-align: right;
}

.pred-add-modal-close {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: #94a3b8;
    padding: 0.2rem;
    flex-shrink: 0;
}

.pred-add-modal-body {
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

/* Live search */
.pred-add-search-wrap {
    position: relative;
}

.pred-add-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 220px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 10;
}

.pred-search-item {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    padding: 0.4rem 0.55rem;
    cursor: pointer;
    font-size: 0.72rem;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.08s;
}

.pred-search-item:hover {
    background: #eff6ff;
}

.pred-search-item strong {
    color: #3b82f6;
    font-size: 0.68rem;
    flex-shrink: 0;
    min-width: 60px;
}

.pred-search-item-desc {
    flex: 1;
    color: #1e293b;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pred-search-item-type {
    flex-shrink: 0;
    font-size: 0.6rem;
    color: #94a3b8;
    font-weight: 600;
}

.pred-search-item-sev {
    flex-shrink: 0;
    font-size: 0.6rem;
    color: #475569;
    font-weight: 700;
}

.pred-search-empty {
    padding: 0.55rem;
    font-size: 0.72rem;
    color: #94a3b8;
    font-style: italic;
    text-align: center;
}

/* Selected violation chip */
.pred-add-selected {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.55rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
}

.pred-add-selected-info {
    flex: 1;
    min-width: 0;
    font-size: 0.72rem;
    line-height: 1.4;
}

.pred-add-selected-info strong {
    color: #3b82f6;
    margin-right: 0.3rem;
}

.pred-add-selected-info span {
    color: #1e293b;
}

.pred-add-sel-type {
    display: block;
    font-size: 0.62rem;
    color: #64748b !important;
    font-weight: 600;
}

.pred-add-sel-clear {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.1rem;
    flex-shrink: 0;
}

.pred-add-sel-clear:hover {
    color: #dc2626;
}

/* Row layout for severity + date */
.pred-add-row {
    display: flex;
    gap: 0.75rem;
}

.pred-add-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.pred-add-cancel-btn {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #475569;
    padding: 0.45rem 0.85rem;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    margin-right: 0.4rem;
}

.pred-add-cancel-btn:hover {
    background: #e2e8f0;
}

.pred-add-field-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: #475569;
    margin-top: 0.15rem;
}

.pred-add-input {
    width: 100%;
    padding: 0.4rem 0.55rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #1e293b;
    box-sizing: border-box;
}

.pred-add-input-sm {
    width: 120px;
}

.pred-add-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.15);
}

.pred-add-modal-footer {
    padding: 0.65rem 1rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
}

.pred-add-submit-btn {
    background: #3b82f6;
    color: #fff;
    border: none;
    padding: 0.45rem 1rem;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.1s;
}

.pred-add-submit-btn:hover {
    background: #2563eb;
}

/* Instructional hint inside add-violation modal */
.pred-add-hint {
    font-size: 0.68rem;
    color: #94a3b8;
    margin: 0;
    line-height: 1.4;
}

/* Time-weight section */
.pred-add-tw-section {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.pred-add-tw-group {
    display: flex;
    gap: 0.4rem;
}

.pred-add-tw-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    padding: 0.45rem 0.35rem;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.68rem;
    color: #475569;
    transition: border-color 0.1s, background 0.1s, color 0.1s;
    line-height: 1.25;
}

.pred-add-tw-btn:hover {
    border-color: #93c5fd;
    background: #eff6ff;
}

.pred-add-tw-btn.pred-add-tw-active {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #1d4ed8;
}

.pred-add-tw-mult {
    font-size: 0.88rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.pred-add-tw-active .pred-add-tw-mult {
    color: #2563eb;
}

.pred-add-tw-range {
    font-size: 0.6rem;
    font-weight: 500;
    color: inherit;
    text-align: center;
}

/* Adj buttons (shared) */
.pred-adj-btn {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #475569;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.1s ease;
    flex-shrink: 0;
}

.pred-adj-btn:hover:not(:disabled) {
    background: #e2e8f0;
    border-color: #94a3b8;
}

.pred-adj-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Percentile bar under each BASIC */
.predictive-basic-bar-wrap {
    position: relative;
    height: 6px;
    background: #f1f5f9;
    border-radius: 3px;
    margin-bottom: 0.35rem;
}

.predictive-basic-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.2s ease, background 0.2s ease;
}

.predictive-basic-threshold {
    position: absolute;
    top: -3px;
    width: 2px;
    height: 12px;
    background: #ef4444;
    border-radius: 1px;
}

/* Fleet fields grid */
.predictive-fleet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.predictive-fleet-field {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.65rem 0.75rem;
}

.predictive-fleet-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #1e3a5f;
    margin-bottom: 0.35rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
}

.pred-field-reset-btn {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    border: 1px solid #dbe3ee;
    background: #f8fafc;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.16s ease;
}

.pred-field-reset-btn:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #2563eb;
    transform: rotate(-20deg);
}

.pred-field-reset-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.18);
}

.predictive-fleet-controls {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-bottom: 0.25rem;
}

.pred-fleet-input {
    width: 80px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 700;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.3rem;
    flex: 1;
    color: #1e293b;
    background: #fff;
    appearance: textfield;
    -moz-appearance: textfield;
}

.pred-fleet-input::-webkit-outer-spin-button,
.pred-fleet-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.pred-fleet-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.15);
}

.predictive-fleet-baseline {
    font-size: 0.62rem;
    color: #94a3b8;
    font-weight: 600;
}

/* Breakdown */
.predictive-breakdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.5rem;
}

.predictive-breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.45rem 0.65rem;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid transparent;
}

.predictive-breakdown-item.pred-bk-changed {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.predictive-breakdown-item.pred-bk-alert {
    background: #fef2f2;
    border-color: #fca5a5;
}

.predictive-breakdown-group {
    grid-column: 1 / -1;
    background: #f0f9ff;
    border-color: #bae6fd;
}

.pred-bk-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
}

.pred-bk-value {
    font-size: 0.78rem;
    font-weight: 800;
    color: #1e293b;
}

/* Predictive section card title spacing */
.predictive-section {
    padding: 1rem 1.25rem !important;
    margin-bottom: 0.5rem;
}

.predictive-section .analytics-tool-title {
    font-weight: 900;
    margin-top: 0.15rem;
}

.predictive-section .analytics-tool-header {
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
}

/* Fleet path label */
.predictive-fleet-path-label {
    grid-column: 1 / -1;
    font-size: 0.72rem;
    font-weight: 700;
    color: #3b82f6;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: 0.4rem 0.65rem;
    margin-bottom: 0.15rem;
}

/* Path indicator */
.pred-path-indicator {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    margin-bottom: 0.35rem;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}

.pred-path-indicator.pred-path-safety {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.pred-path-indicator.pred-path-oneAway {
    background: #fffbeb;
    border-color: #fde68a;
}

.pred-path-indicator.pred-path-zeroInsp {
    background: #fef2f2;
    border-color: #fecaca;
}

.pred-path-indicator.pred-path-someInsp {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.pred-path-icon {
    font-size: 1.25rem;
    line-height: 1;
    flex-shrink: 0;
}

.pred-path-text {
    flex: 1;
    min-width: 0;
}

.pred-path-text strong {
    font-size: 0.82rem;
    color: #1e293b;
}

.pred-path-range {
    font-size: 0.68rem;
    color: #64748b;
    font-weight: 600;
}

.pred-path-desc {
    font-size: 0.68rem;
    color: #64748b;
    margin-top: 0.15rem;
    line-height: 1.4;
}

/* Fleet derived ratios */
.pred-fleet-ratios {
    grid-column: 1 / -1;
    display: flex;
    gap: 1.5rem;
    font-size: 0.72rem;
    color: #475569;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 6px;
    padding: 0.4rem 0.65rem;
}

.pred-fleet-ratios strong {
    color: #1e293b;
}

/* Breakdown why section */
.pred-breakdown-why {
    margin-bottom: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.pred-why-item {
    font-size: 0.75rem;
    color: #475569;
    line-height: 1.5;
    padding: 0.35rem 0.55rem;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.pred-why-item.pred-why-primary {
    background: #f0f9ff;
    border-color: #bae6fd;
}

.pred-why-basic {
    font-weight: 700;
    font-size: 0.72rem;
    white-space: nowrap;
}

.pred-why-basic em {
    font-weight: 400;
    color: #64748b;
}

.pred-bk-flag {
    font-size: 0.62rem;
    color: #dc2626;
    font-weight: 700;
}

/* Explainer section */
.pred-explainer {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.pred-explainer-block {
    padding: 0;
}

.pred-explainer-heading {
    font-size: 0.78rem;
    font-weight: 800;
    color: #1e3a5f;
    margin-bottom: 0.3rem;
}

.pred-explainer p {
    font-size: 0.75rem;
    color: #475569;
    line-height: 1.5;
    margin: 0 0 0.3rem;
}

.pred-explainer-note {
    font-style: italic;
    color: #64748b !important;
    font-size: 0.7rem !important;
}

.pred-explainer-zones {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.pred-zone-tag {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    color: #fff;
}

.pred-zone-pass { background: #16a34a; }
.pred-zone-optional { background: #d97706; }
.pred-zone-inspect { background: #dc2626; }
.pred-zone-oos { background: #1e293b; }

.pred-explainer-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.72rem;
    margin: 0.4rem 0;
}

.pred-explainer-table th,
.pred-explainer-table td {
    padding: 0.3rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.pred-explainer-table th {
    font-weight: 700;
    color: #64748b;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pred-explainer-table td {
    color: #1e293b;
}

.pred-explainer-list {
    font-size: 0.72rem;
    color: #475569;
    line-height: 1.6;
    padding-left: 1.2rem;
    margin: 0.3rem 0;
}

.pred-explainer-list li {
    margin-bottom: 0.15rem;
}

/* Responsive */
@media (max-width: 640px) {
    .predictive-score-comparison {
        flex-direction: column;
        gap: 0.75rem;
    }
    .predictive-score-arrow {
        transform: rotate(90deg);
    }
    .predictive-basics-grid {
        grid-template-columns: 1fr;
    }
    .predictive-fleet-grid {
        grid-template-columns: 1fr;
    }
}

/* ?? New-tab search workflow ?????????????????????????????????????????????? */

/* Shared spinner used in the loading shell and search-results loading state */
.ntab-spinner {
    display: inline-block;
    width: 1em;
    height: 1em;
    border: 2px solid rgba(37, 99, 235, 0.2);
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: ntab-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 0.45em;
    flex-shrink: 0;
}

@keyframes ntab-spin {
    to { transform: rotate(360deg); }
}

/* ?? Loading shell ?? */
.ntab-loading-shell {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.ntab-shell-header {
    padding: 1rem 1.25rem !important;
}

.ntab-shell-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ntab-shell-dot {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.ntab-shell-status {
    display: flex;
    align-items: center;
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* 2-column card grid matching the Overview layout rhythm */
.ntab-shell-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
}

@media (max-width: 700px) {
    .ntab-shell-grid { grid-template-columns: 1fr; }
}

.ntab-shell-card {
    padding: 1rem 1.1rem !important;
    min-height: 110px;
}

/* Skeleton shimmer lines */
.ntab-skel-block {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding-top: 0.25rem;
}

.ntab-skel-line {
    height: 0.72rem;
    border-radius: 4px;
    background: linear-gradient(
        90deg,
        rgba(15, 23, 42, 0.06) 0%,
        rgba(15, 23, 42, 0.11) 50%,
        rgba(15, 23, 42, 0.06) 100%
    );
    background-size: 200% 100%;
    animation: ntab-shimmer 1.4s ease-in-out infinite;
}

@keyframes ntab-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ?? Search results page ?? */
.ntab-results-shell {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.ntab-results-header {
    padding: 1rem 1.25rem !important;
}

.ntab-results-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ntab-results-loading {
    display: flex;
    align-items: center;
    padding: 1.25rem;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.ntab-results-empty {
    padding: 1.25rem;
    color: var(--text-muted);
    font-size: 0.88rem;
    text-align: center;
}

.ntab-result-row {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.8rem 1rem !important;
    text-align: left;
    cursor: pointer;
    background: var(--glass) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
    width: 100%;
}

.ntab-result-row:hover {
    border-color: rgba(37, 99, 235, 0.3) !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.1) !important;
    transform: translateY(-1px);
}

.ntab-result-name {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text);
}

.ntab-result-meta {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.ntab-result-dot {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
}

.ntab-result-state {
    font-size: 0.78rem;
    color: var(--text-muted);
}
/* ?? End new-tab search workflow ???????????????????????????????????????????? */
/* Clean inspection ratio placeholder */
#cleanInspectionRatio.clean-ratio-placeholder { font-style: italic; opacity: 0.75; font-size: 0.85em; }



/* --- SAFER section option lists (Operation Classification, Carrier Operation, Cargo Carried) --- */
.safer-option-list { display:flex; flex-direction:column; gap:0.18rem; max-height:280px; overflow-y:auto; padding-right:0.25rem; font-size:0.82rem; }
.safer-option-row { display:flex; align-items:flex-start; gap:0.5rem; padding:0.18rem 0.35rem; border-radius:4px; line-height:1.25; }
.safer-option-row.is-selected { background:rgba(37,99,235,0.06); }
.safer-option-mark { display:inline-block; width:1.05rem; flex:0 0 1.05rem; text-align:center; font-weight:700; font-family:'Segoe UI',Arial,sans-serif; }
.safer-option-mark-on { color:#1e3a5f; }
.safer-option-mark-off { color:#cbd5e1; }
.safer-option-label { color:#334155; }
.safer-option-label-on { color:#0f172a; font-weight:600; }
.safer-option-empty { color:#94a3b8; font-style:italic; font-size:0.85rem; padding:0.4rem 0; }

