.reportsOverlay {
    position: fixed;
    inset: 0;
    z-index: 5000;

    display: none;
    align-items: center;
    justify-content: center;

    padding: 24px;
    box-sizing: border-box;

    background: rgba(0,0,0,0.48);
    backdrop-filter: blur(8px);
}

.reportsOverlay.open {
    display: flex;
}

.reportsPanel {
    width: min(1160px, 96vw);
    max-height: 92vh;
    overflow: auto;

    background: #d8d8d8;
    color: #161616;

    border-radius: 18px;

    box-shadow:
        0 24px 80px rgba(0,0,0,0.34);

    padding: 26px;
    box-sizing: border-box;
}

.darkTheme .reportsPanel {
    background: #151515;
    color: #f4f4f4;
}

.reportsHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 24px;
}

.reportsTitle {
    font-size: 26px;
    font-weight: 700;
}

.reportsClose {
    width: 38px;
    height: 38px;

    border: 0;
    border-radius: 50%;

    font-size: 22px;
    line-height: 38px;

    cursor: pointer;

    background: #c2c2c2;
    color: inherit;
}

.darkTheme .reportsClose {
    background: rgba(255,255,255,0.10);
}

.reportsFilters {
    display: grid;

    grid-template-columns:
        minmax(170px, 1.2fr)
        minmax(170px, 1.2fr)
        minmax(170px, 1.2fr)
        minmax(145px, 1fr)
        minmax(145px, 1fr)
        auto;

    gap: 14px;
    align-items: end;

    padding: 18px;

    border-radius: 14px;

    background: #c8c8c8;
}

.darkTheme .reportsFilters {
    background: rgba(255,255,255,0.055);
}

.reportsField {
    display: flex;
    flex-direction: column;
    gap: 7px;

    min-width: 0;

    font-size: 12px;
    font-weight: 600;
}

.reportsField select,
.reportsField input {
    width: 100%;
    height: 42px;

    box-sizing: border-box;

    border: 1px solid rgba(0,0,0,0.22);
    border-radius: 9px;

    padding: 0 11px;

    font-size: 14px;

    background: #e4e4e4;
    color: #111;
}

.darkTheme .reportsField select,
.darkTheme .reportsField input {
    border-color: rgba(255,255,255,0.16);

    background: #242424;
    color: white;
}

.reportsGenerate {
    height: 42px;

    padding: 0 20px;

    border: 0;
    border-radius: 9px;

    font-weight: 700;
    font-size: 14px;

    cursor: pointer;

    background: #222;
    color: white;
}

.darkTheme .reportsGenerate {
    background: #f0f0f0;
    color: #111;
}

.reportsStatus {
    min-height: 20px;

    margin-top: 12px;

    font-size: 13px;
    opacity: 0.72;
}

.reportsCards {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(140px, 1fr));

    gap: 14px;

    margin-top: 18px;
}

.reportCard {
    padding: 18px;

    border-radius: 14px;

    background: #e4e4e4;

    box-shadow:
        0 2px 12px rgba(0,0,0,0.06);
}

.darkTheme .reportCard {
    background: #202020;
}

.reportCardLabel {
    font-size: 12px;
    opacity: 0.65;

    margin-bottom: 8px;
}

.reportCardValue {
    font-size: 28px;
    font-weight: 700;
}

.reportsResultHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-top: 28px;
    margin-bottom: 10px;
}

.reportsResultTitle {
    font-size: 17px;
    font-weight: 700;
}

.reportsTableWrap {
    overflow-x: auto;

    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.18);
}

.darkTheme .reportsTableWrap {
    border-color: rgba(255,255,255,0.10);
}

.reportsTable {
    width: 100%;
    border-collapse: collapse;

    font-size: 14px;
}

.reportsTable th,
.reportsTable td {
    padding: 13px 14px;

    border-bottom:
        1px solid rgba(0,0,0,0.08);

    text-align: right;
    white-space: nowrap;
}

.darkTheme .reportsTable th,
.darkTheme .reportsTable td {
    border-bottom-color:
        rgba(255,255,255,0.08);
}

.reportsTable th:first-child,
.reportsTable td:first-child {
    text-align: left;
}

.reportsTable tr:last-child td {
    border-bottom: 0;
}

.reportSort {
    border: 0;
    padding: 0;

    background: transparent;
    color: inherit;

    font: inherit;
    font-weight: 700;

    cursor: pointer;
}

.reportSort.active::after {
    margin-left: 6px;
}

.reportSort.asc::after {
    content: "↓";
}

.reportSort.desc::after {
    content: "↑";
}

.reportsEmpty {
    padding: 32px !important;

    text-align: center !important;

    opacity: 0.6;
}

@media (max-width: 950px) {

    .reportsFilters {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .reportsGenerate {
        width: 100%;
    }

    .reportsCards {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}







/* ===== REPORTS ADMIN THEME START ===== */

.reportsOverlay {
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(8px);
}

.reportsOverlay .reportsPanel {
    background: #111827;
    color: white;

    border:
        1px solid #1e293b;

    box-shadow:
        0 24px 80px rgba(0,0,0,0.55);
}

.reportsOverlay .reportsTitle {
    color: white;
}

.reportsOverlay .reportsClose {
    background: #1e293b;
    color: #94a3b8;
}

.reportsOverlay .reportsClose:hover {
    background: #334155;
    color: white;
}

.reportsOverlay .reportsFilters {
    background: #1e293b;
}

.reportsOverlay .reportsField {
    color: white;
}

.reportsOverlay .reportsField select,
.reportsOverlay .reportsField input {
    background: white;
    color: #111827;

    border: none;
}

.reportsOverlay .reportsGenerate {
    background: #2563eb;
    color: white;

    box-shadow:
        0 2px 6px rgba(0,0,0,0.25);
}

.reportsOverlay .reportsGenerate:hover {
    background: #1d4ed8;
}

.reportsOverlay .reportsStatus {
    color: #94a3b8;
    opacity: 1;
}

.reportsOverlay .reportCard {
    background: #1e293b;
    color: white;

    border:
        1px solid rgba(255,255,255,0.03);

    box-shadow:
        none;
}

.reportsOverlay .reportCardLabel {
    color: #94a3b8;
    opacity: 1;
}

.reportsOverlay .reportCardValue {
    color: white;
}

.reportsOverlay .reportsResultTitle {
    color: white;
}

.reportsOverlay .reportsTableWrap {
    background: #1e293b;

    border:
        1px solid #334155;
}

.reportsOverlay .reportsTable {
    color: white;
}

.reportsOverlay .reportsTable th {
    background: #0f172a;
    color: white;

    border-bottom:
        1px solid #334155;
}

.reportsOverlay .reportsTable td {
    background: #1e293b;
    color: white;

    border-bottom:
        1px solid #334155;
}

.reportsOverlay .reportSort {
    color: white;
}

.reportsOverlay .reportsEmpty {
    color: #94a3b8;
}

/* ===== REPORTS ADMIN THEME END ===== */

/* ===== FLEET REPORT LAYOUT ===== */

.reportsFilters.fleetMode {
    grid-template-columns:
        minmax(170px, 1.2fr)
        minmax(170px, 1.2fr)
        minmax(170px, 1.2fr)
        minmax(170px, 1fr)
        auto;
}

/* ===== USER ACCESS REPORT LAYOUT ===== */

.reportsFilters.userAccessMode {
    grid-template-columns:
        minmax(220px, 1.3fr)
        minmax(220px, 1.3fr)
        minmax(220px, 1fr)
        auto;
}

.reportsFilters.userAccessMode.noCompany {
    grid-template-columns:
        minmax(220px, 1.4fr)
        minmax(220px, 1fr)
        auto;
}

/* ===== INCIDENT REPORTS ===== */

.reportsFilters.incidentMode {
    grid-template-columns:
        minmax(150px, 1.15fr)
        minmax(150px, 1.15fr)
        minmax(150px, 1.1fr)
        minmax(150px, 1fr)
        minmax(145px, 1fr)
        minmax(145px, 1fr)
        auto;
}

.reportPdfActions {
    display: flex;
    gap: 7px;
    align-items: center;
}

.reportPdfButton {
    border: 0;
    border-radius: 8px;
    padding: 6px 10px;
    background: #2563eb;
    color: white;
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
}

.reportPdfButton:hover {
    background: #1d4ed8;
}

.reportPdfButton.secondary {
    background: #334155;
}

.reportPdfButton.secondary:hover {
    background: #475569;
}

.reportPdfMissing {
    color: #94a3b8;
    font-size: 12px;
}

/* ===== REPORT EXPORT BUTTONS ===== */

.reportsExportButton {
    border: 0;
    border-radius: 10px;
    padding: 10px 16px;
    background: #2563eb;
    color: white;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
}

.reportsExportButton:hover {
    background: #1d4ed8;
}

.reportsExportButton.secondary {
    background: #334155;
}

.reportsExportButton.secondary:hover {
    background: #475569;
}

.reportsExportButton:disabled {
    opacity: 0.45;
    cursor: default;
}

/* ===== REPORT ACTIONS COMPACT ===== */

.reportsFilters .reportsActions {
    grid-column: 1 / -1;

    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;

    margin-top: 2px;
}

.reportsFilters .reportsActions #reportsGenerate,
.reportsFilters .reportsActions .reportsExportButton {
    width: auto;
    min-width: 0;
    height: 38px;

    padding: 0 14px;

    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
}

.reportsFilters .reportsActions #reportsGenerate {
    min-width: 118px;
}

.reportsFilters .reportsActions .reportsExportButton {
    min-width: 96px;
}

.reportsFilters .reportsActions .reportsExportButton.secondary {
    min-width: 104px;
}
