/* Table styling for data display */

/* Totals section */
.totals-section {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 15px;
    max-height: 200px;
    overflow-y: auto;
    overflow-x: auto;
    width: 100%;
}

.totals-table {
    width: max(100%, 10in);
    border-collapse: collapse;
    font-size: 12px;
}

.totals-table th {
    background: #2196F3;
    color: white;
    padding: 6px;
    text-align: left;
    font-weight: bold;
    position: sticky;
    top: 0;
    z-index: 5;
}

.totals-table td {
    padding: 5px 6px;
    border-bottom: 1px solid #eee;
}

.totals-table tr:hover {
    background: #f5f5f5;
}

.totals-table .total-cell {
    text-align: center;
    font-weight: 500;
}

.totals-table .weekly-total {
    background: #e8f5e9;
    font-weight: bold;
}

.totals-table .summary-total {
    background: #e3f2fd;
    font-weight: bold;
    font-size: 13px;
    border-left: 2px solid #2196F3;
}

/* Grid container and timesheet grid */
.grid-container {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 805px;
    position: relative;
    width: 100%;
}

#timesheet-grid {
    display: grid;
    border: 1px solid #000;
    user-select: none;
    font-size: 12px;
    width: fit-content;
    grid-template-columns: 73px repeat(14, 72px);
}

.grid-header {
    background: #2196F3;
    color: white;
    padding: 6px;
    text-align: center;
    font-weight: bold;
    border: 1px solid #000;
    position: sticky;
    top: 0;
    z-index: 20;
    font-size: 10px;
}

.grid-header.corner {
    background: #2196F3;
    position: sticky;
    left: 0;
    top: 0;
    z-index: 30;
}

.day-header {
    background: #2196F3;
    color: white;
    padding: 6px;
    text-align: center;
    font-weight: bold;
    border: 1px solid #000;
    font-size: 10px;
    position: sticky;
    top: 0;
    z-index: 15;
}

.column-label {
    background: #64B5F6;
    color: white;
    padding: 4px;
    text-align: center;
    font-weight: bold;
    border: 1px solid #000;
    font-size: 9px;
    position: sticky;
    top: 32px;
    z-index: 15;
}

.time-label {
    background: #f5f5f5;
    padding: 4px;
    font-weight: bold;
    border: 1px solid #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    position: sticky;
    left: 0;
    z-index: 10;
}

.data-cell {
    border: 1px solid #000;
    cursor: pointer;
    transition: background 0.1s;
    padding: 2px;
    min-height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.data-cell:hover {
    background: #e8f5e9;
}

.data-cell.filled {
    background: #64B5F6;
    color: white;
    font-weight: 500;
}

.caregiver-cell {
    border-right: none;
}

.client-cell {
    border-left: 1px solid #ccc;
}

/* Timesheet Tables */
.timesheet-tables {
    margin-top: 30px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.timesheet-table-container {
    margin-bottom: 30px;
}

.timesheet-table-header {
    font-size: 18px;
    font-weight: bold;
    color: #2196F3;
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 4px solid #2196F3;
}

.timesheet-table {
    width: 100%;
    max-width: 10in;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 14px;
}

.timesheet-table th,
.timesheet-table td {
    border: 1px solid #ddd;
    padding: 6px;
    text-align: center;
    vertical-align: middle;
    height: 32px;
}

.timesheet-table th {
    background-color: #f8f9fa;
    font-weight: bold;
    color: #495057;
    width: 12%;
}

.timesheet-table .row-label {
    background-color: #e9ecef;
    font-weight: bold;
    text-align: left;
    padding-left: 12px;
    color: #495057;
    width: 16%;
}

.timesheet-table .blank-cell {
    border: none;
    background: transparent;
    width: 16%;
}

.timesheet-table .date-cell {
    background-color: #2196F3;
    font-weight: bold;
    color: white;
    width: 12%;
}

.timesheet-table .time-cell {
    background-color: white;
    color: #333;
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 500;
    width: 12%;
}

.timesheet-table .empty-time-cell {
    background-color: white;
    color: #6c757d;
    font-style: italic;
    width: 12%;
}

/* Step 3: Payroll Processing Styles */
.payroll-periods-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 30px;
    margin-top: 20px;
}

.payroll-periods-table {
    width: 100%;
    max-width: 10in;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 14px;
    border: 1px solid #ddd;
}

.payroll-periods-table th,
.payroll-periods-table td {
    padding: 15px 12px;
    text-align: left;
    border: 1px solid #ddd;
    vertical-align: middle;
}

.payroll-periods-table th {
    background-color: #2196F3;
    color: white;
    font-weight: bold;
    position: sticky;
    top: 0;
    text-align: center;
    font-size: 14px;
}

.payroll-periods-table tbody tr:hover {
    background-color: #f8f9fa;
}

.payroll-periods-table tbody tr:nth-child(even) {
    background-color: #fafafa;
}

.payroll-periods-table tbody tr:nth-child(even):hover {
    background-color: #f0f0f0;
}

.payroll-periods-table .checkbox-cell {
    width: 80px;
    text-align: center;
    padding: 15px 8px;
}

.payroll-periods-table .checkbox-cell input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    transform: scale(1.2);
}

.payroll-periods-table .period-id-cell {
    font-weight: bold;
    color: #2196F3;
    text-align: center;
    width: 100px;
    font-size: 16px;
}

.payroll-periods-table .date-cell {
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 500;
    text-align: center;
    width: 140px;
    color: #333;
    white-space: nowrap;
}

.payroll-periods-table .count-cell {
    text-align: center;
    font-weight: bold;
    color: #28a745;
    width: 100px;
    font-size: 16px;
}

.payroll-periods-empty {
    text-align: center;
    padding: 60px 40px;
    color: #666;
    font-style: italic;
}

.payroll-periods-empty h3 {
    color: #2196F3;
    margin-bottom: 15px;
    font-size: 20px;
}

.payroll-periods-empty p {
    margin-bottom: 10px;
    font-size: 16px;
    line-height: 1.5;
}

.payroll-periods-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #2196F3;
}

.payroll-periods-header h3 {
    color: #2196F3;
    margin: 0;
    font-size: 20px;
    font-weight: bold;
}

/* Garnishment Management Styles */
.garnishments-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.garnishments-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.garnishments-table th,
.garnishments-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.garnishments-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.garnishments-table tr:hover {
    background-color: #f8f9fa;
}

.garnishment-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.garnishment-status.active {
    background-color: #d4edda;
    color: #155724;
}

.garnishment-status.inactive {
    background-color: #f8d7da;
    color: #721c24;
}

.garnishment-actions {
    display: flex;
    gap: 8px;
}

.garnishment-actions button {
    padding: 4px 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.btn-edit {
    background-color: #007bff;
    color: white;
}

.btn-edit:hover {
    background-color: #0056b3;
}

.btn-delete {
    background-color: #dc3545;
    color: white;
}

.btn-delete:hover {
    background-color: #c82333;
}

/* Tax Rate Management Styles */
.tax-rates-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tax-rates-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.tax-rates-table th,
.tax-rates-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.tax-rates-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.tax-rates-table tr:hover {
    background-color: #f8f9fa;
}

.tax-rate-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.tax-rate-status.current {
    background-color: #d4edda;
    color: #155724;
}

.tax-rate-status.historical {
    background-color: #f8d7da;
    color: #721c24;
}

.tax-rate-status.future {
    background-color: #d1ecf1;
    color: #0c5460;
}

.tax-rate-actions {
    display: flex;
    gap: 8px;
}

.tax-rate-actions button {
    padding: 4px 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.btn-edit-rate {
    background-color: #007bff;
    color: white;
}

.btn-edit-rate:hover {
    background-color: #0056b3;
}

.btn-history {
    background-color: #6c757d;
    color: white;
}

.btn-history:hover {
    background-color: #5a6268;
}

/* Empty states */
.garnishments-empty,
.tax-rates-empty {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.garnishments-empty h3,
.tax-rates-empty h3 {
    margin-bottom: 10px;
    color: #495057;
}

/* Mobile responsiveness for tables */
@media (max-width: 768px) {
    .timesheet-table {
        font-size: 12px;
    }
    
    .timesheet-table th,
    .timesheet-table td {
        padding: 4px 2px;
        height: 28px;
    }
    
    .timesheet-table .row-label,
    .timesheet-table .blank-cell {
        width: 18%;
        padding-left: 6px;
    }
    
    .timesheet-table th,
    .timesheet-table .date-cell,
    .timesheet-table .time-cell,
    .timesheet-table .empty-time-cell {
        width: 11.7%;
    }
    
    .payroll-periods-container {
        padding: 20px 15px;
        margin-top: 15px;
    }
    
    .payroll-periods-table {
        font-size: 12px;
    }
    
    .payroll-periods-table th,
    .payroll-periods-table td {
        padding: 10px 8px;
    }
    
    .payroll-periods-table .checkbox-cell {
        width: 60px;
        padding: 10px 4px;
    }
    
    .payroll-periods-table .period-id-cell {
        width: 80px;
        font-size: 14px;
    }
    
    .payroll-periods-table .date-cell {
        width: 110px;
        font-size: 12px;
    }
    
    .payroll-periods-table .count-cell {
        width: 80px;
        font-size: 14px;
    }
    
    .payroll-periods-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .select-all-container {
        justify-content: center;
    }
    
    .garnishments-table,
    .tax-rates-table {
        font-size: 14px;
    }
    
    .garnishments-table th,
    .garnishments-table td,
    .tax-rates-table th,
    .tax-rates-table td {
        padding: 8px;
    }
}