﻿/* Page layout */
.portal-reports-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem;
}

.portal-reports-title {
    margin: 0 0 1rem;
    font-size: 1.5rem;
    font-weight: 600;
}

/* Filters row */
.portal-reports-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
}

    .portal-reports-filters label {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
        font-size: 0.875rem;
        color: #555;
    }

    .portal-reports-filters input[type="date"],
    .portal-reports-filters input[type="text"] {
        padding: 0.4rem 0.6rem;
        border: 1px solid #ccc;
        border-radius: 4px;
        font-size: 0.95rem;
        min-width: 160px;
    }

.btn-search {
    padding: 0.5rem 1rem;
    background: #2c5aa0;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.95rem;
    cursor: pointer;
}

    .btn-search:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

/* Table */
.portal-reports-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}

    .portal-reports-table thead {
        background: #f0f2f5;
    }

    .portal-reports-table th,
    .portal-reports-table td {
        text-align: left;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid #e0e0e0;
    }

    .portal-reports-table th {
        font-weight: 600;
        font-size: 0.85rem;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        color: #555;
    }

    .portal-reports-table tbody tr:last-child td {
        border-bottom: none;
    }

    .portal-reports-table tbody tr:hover {
        background: #fafbfc;
    }

/* Empty state — sits below empty header row */
.portal-reports-empty {
    text-align: center;
    padding: 2rem;
    color: #888;
    font-style: italic;
}

/* View button */
.btn-view {
    padding: 0.35rem 0.9rem;
    background: #2c5aa0;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
}

    .btn-view:disabled {
        background: #b0b0b0;
        cursor: not-allowed;
    }

/* Status badges — remove these blocks if already defined globally */
.pdf-status-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.badge-ready {
    background: #d4edda;
    color: #155724;
}

.badge-pending {
    background: #fff3cd;
    color: #856404;
}

.badge-failed {
    background: #f8d7da;
    color: #721c24;
}

/* PDF container inside modal */
.portal-report-pdf-container {
    width: 100%;
    max-height: 70vh;
    overflow-y: auto;
    padding: 0.5rem;
}

/* Hide the modal's built-in Close button when it wraps the PDF viewer —
   the PDF is tall enough that the button gets cut off, and the overlay
   click already closes cleanly. */
.pdf-modal-scope ~ .btn-modal-close,
.modal-content:has(.pdf-modal-scope) .btn-modal-close {
    display: none;
}
