/* Professional Dashboard Modal Styles */
.dashboard-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.dashboard-modal-container {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 1200px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 2px solid var(--border-color);
}

.dashboard-modal-header {
    background: linear-gradient(135deg, #0052CC 0%, #003D99 100%);
    color: white;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #DC143C;
}

.modal-title-section {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-title-section i {
    font-size: 1.75rem;
}

.modal-title-section h5 {
    margin: 0;
    color: white;
}

.modal-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.date-filter-section {
    min-width: 150px;
}

.date-filter-section .form-select {
    background-color: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
}

.date-filter-section .form-select option {
    background: #1a1a1a;
    color: white;
}

.rows-per-page-section {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: 0.9rem;
}

.rows-per-page-section label {
    margin: 0;
    white-space: nowrap;
}

.rows-per-page-section .form-select {
    background-color: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
}

.rows-per-page-section .form-select option {
    background: #1a1a1a;
    color: white;
}

.export-buttons {
    display: flex;
    gap: 8px;
}

.export-btn {
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    color: white;
}

.export-btn:hover {
    transform: translateY(-2px);
}

.excel-btn {
    background: linear-gradient(135deg, #2ECC71 0%, #27AE60 100%);
    border: 1px solid #27AE60;
}

.excel-btn:hover {
    background: linear-gradient(135deg, #27AE60 0%, #1E8449 100%);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.4);
    border-color: #1E8449;
}

.pdf-btn {
    background: linear-gradient(135deg, #FF6B6B 0%, #E55039 100%);
    border: 1px solid #E55039;
}

.pdf-btn:hover {
    background: linear-gradient(135deg, #E55039 0%, #C13832 100%);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
    border-color: #C13832;
}

.close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: white;
    width: 35px;
    height: 35px;
    padding: 0;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: rgba(255, 107, 107, 0.3);
    border-color: #FF6B6B;
}

.dashboard-modal-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    display: block;
    position: relative;
    min-height: 0;
}

.table-wrapper {
    position: relative;
    display: block;
    width: 100%;
    overflow: visible;
}

.dashboard-modal-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--card-bg);
}

.dashboard-modal-table thead {
    background: linear-gradient(135deg, #0052CC 0%, #003D99 100%);
    position: sticky;
    top: 0;
    z-index: 10;
}

.dashboard-modal-table thead th {
    color: white;
    padding: 14px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #DC143C;
    white-space: nowrap;
    font-size: 0.95rem;
}

.dashboard-modal-table tbody {
    display: table-row-group;
}

.dashboard-modal-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: all 0.2s ease;
    cursor: pointer;
    display: table-row;
}

.dashboard-modal-table tbody tr:hover {
    background-color: var(--secondary-bg);
    box-shadow: inset 0 0 0 2px var(--border-color);
}

.dashboard-modal-table tbody tr.expanded {
    background: rgba(0, 82, 204, 0.1);
}

.dashboard-modal-table tbody td {
    padding: 12px 14px;
    color: var(--primary-text);
    font-size: 0.95rem;
    display: table-cell;
    border-right: 1px solid var(--border-color);
}

.dashboard-modal-table tbody td:last-child {
    border-right: none;
}

.dashboard-modal-footer {
    background: var(--secondary-bg);
    padding: 15px 25px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.record-count {
    margin: 0;
    color: var(--primary-text);
    font-size: 0.95rem;
}

/* Light Mode Adjustments */
[data-theme="light"] .dashboard-modal-container {
    background: #ffffff;
    border-color: #dee2e6;
}

[data-theme="light"] .dashboard-modal-table tbody td {
    color: #212529;
}

[data-theme="light"] .dashboard-modal-body {
    background: #ffffff;
}

[data-theme="light"] .dashboard-modal-footer {
    background: #f8f9fa;
    border-top-color: #dee2e6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-modal-container {
        width: 95%;
        max-height: 90vh;
    }

    .modal-actions {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .date-filter-section,
    .export-buttons {
        width: 100%;
    }

    .export-buttons {
        justify-content: space-between;
    }

    .dashboard-modal-table thead th {
        padding: 10px 8px;
        font-size: 0.85rem;
    }

    .dashboard-modal-table tbody td {
        padding: 8px;
        font-size: 0.85rem;
    }

    .close-btn {
        width: 30px;
        height: 30px;
    }
}

/* Date Range Custom Input */
.custom-date-range {
    background: white;
    padding: 20px;
    border-radius: 8px;
    display: none;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.custom-date-range.active {
    display: block;
}

.custom-date-range input[type="date"] {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--primary-text);
    margin-right: 10px;
}

.custom-date-range button {
    padding: 8px 16px;
    background: linear-gradient(135deg, #0052CC 0%, #003D99 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.custom-date-range button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Scrollbar Styling */
.dashboard-modal-body::-webkit-scrollbar {
    width: 8px;
}

.dashboard-modal-body::-webkit-scrollbar-track {
    background: var(--secondary-bg);
}

.dashboard-modal-body::-webkit-scrollbar-thumb {
    background: #0052CC;
    border-radius: 4px;
}

.dashboard-modal-body::-webkit-scrollbar-thumb:hover {
    background: #DC143C;
}

/* Pagination Controls */
.pagination-controls-top,
.pagination-controls-bottom {
    background: var(--secondary-bg);
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.pagination-controls-top {
    border-top: none;
    padding: 12px 20px;
}

.pagination-controls-bottom {
    border-bottom: none;
    padding: 12px 20px;
}

.pagination-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

.pagination {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.pagination-btn {
    min-width: 36px;
    height: 36px;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.pagination-btn:hover:not(:disabled):not(.pagination-ellipsis) {
    background: linear-gradient(135deg, #0052CC 0%, #003D99 100%);
    color: white;
    border-color: #0052CC;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 82, 204, 0.3);
}

.pagination-btn.active {
    background: linear-gradient(135deg, #0052CC 0%, #003D99 100%);
    color: white;
    border-color: #003D99;
    box-shadow: 0 4px 12px rgba(0, 82, 204, 0.4);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--secondary-bg);
}

.pagination-ellipsis {
    padding: 6px 8px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Responsive pagination */
@media (max-width: 768px) {
    .pagination-btn {
        min-width: 32px;
        height: 32px;
        padding: 4px 8px;
        font-size: 13px;
    }

    .pagination {
        gap: 2px;
    }
}

@media (max-width: 480px) {
    .pagination-btn:not(.active):not(:disabled) {
        display: none;
    }

    .pagination-btn.active,
    .pagination-btn:first-child,
    .pagination-btn:last-child,
    .pagination-ellipsis {
        display: inline-flex;
    }
}

