/* Caseload Summary Card Styles */

.caseload-summary {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
}

.caseload-header {
    margin-bottom: 1.5rem;
}

.caseload-header h2 {
    color: #333;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

/* Filters Row - School + Date Range */
.caseload-filters-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.filter-group label {
    font-weight: 600;
    color: #555;
    white-space: nowrap;
    font-size: 0.9rem;
}

.caseload-summary .school-dropdown {
    flex: 1;
    padding: 0.6rem;
    border: 2px solid #e1e5e9;
    border-radius: 5px;
    font-size: 0.9rem;
    transition: border-color 0.3s;
}

.caseload-summary .school-dropdown:focus {
    outline: none;
    border-color: #ec5f59;
}

/* Field Selector */
.field-selector {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.field-selector-label {
    display: block;
    font-weight: 600;
    color: #555;
    margin-bottom: 0.75rem;
}

.field-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.field-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #444;
    transition: background 0.2s;
}

.field-checkbox:hover {
    background: #e8ecf1;
}

.field-checkbox input[type="checkbox"] {
    accent-color: #372562;
    width: 16px;
    height: 16px;
}

/* Actions */
.caseload-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.btn-generate {
    padding: 0.65rem 1.5rem;
    background: linear-gradient(135deg, #a8d8ea 0%, #7ec8c8 100%);
    color: #2c3e50;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-generate:hover:not(:disabled) {
    opacity: 0.9;
}

.btn-generate:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-pdf {
    padding: 0.65rem 1.5rem;
    background: linear-gradient(135deg, #D4605A 0%, #6d28d9 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-pdf:hover:not(:disabled) {
    opacity: 0.9;
}

.btn-pdf:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading */
.caseload-summary .loading-indicator {
    text-align: center;
    padding: 2rem;
}

.caseload-summary .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #ec5f59;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

/* Error */
.caseload-summary .error-message {
    background: #fee2e2;
    color: #dc2626;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

/* Empty State */
.caseload-summary .empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #888;
}

.caseload-summary .empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.caseload-summary .empty-state h3 {
    color: #666;
    margin: 0;
}

/* Filter Row */
.filter-row {
    background: #e8ecf1;
}

.filter-cell {
    padding: 4px 6px;
}

.filter-input {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.8rem;
    box-sizing: border-box;
}

.filter-select {
    width: 100%;
    padding: 4px 4px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.75rem;
    box-sizing: border-box;
    background: white;
}

/* Report Table */
.report-table-wrapper {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    background: white;
}

.report-table thead th {
    background: #4a6fa5;
    color: white;
    padding: 0.65rem 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    white-space: normal;
    position: sticky;
    top: 0;
}

.report-table tbody tr {
    border-bottom: 1px solid #e5e7eb;
}

.report-table tbody tr:nth-child(even) {
    background: #f9fafb;
}

.report-table tbody tr:hover {
    background: #f0f4ff;
}

.report-table td {
    padding: 0.5rem 0.75rem;
    vertical-align: top;
    color: #333;
}

.report-table .multi-line-cell {
    min-width: 200px;
}

.target-line, .contact-line {
    padding: 2px 0;
    border-bottom: 1px dotted #e5e7eb;
    font-size: 0.8rem;
    line-height: 1.3;
}

.target-line:last-child, .contact-line:last-child {
    border-bottom: none;
}

.no-data {
    color: #999;
    font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
    .field-checkbox-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .caseload-actions {
        flex-direction: column;
    }
    .caseload-filters-row {
        flex-direction: column;
    }
}


/* Sortable Headers */
.sortable-header {
    white-space: normal;
}

.sort-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #c0d4f0;
    background: white;
    color: #372062;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 0;
    margin-left: 5px;
    opacity: 0.7;
    vertical-align: middle;
    transition: all 0.2s;
}

.sort-btn:hover {
    opacity: 1;
    border-color: #372062;
    background: #372062;
    color: white;
}

.caseload-last-updated {
    font-size: 0.85rem;
    color: #372562;
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    border-radius: 4px;
    padding: 4px 10px;
    margin-left: 12px;
    vertical-align: middle;
}
