/* HR Report Specific Styling */

.hr-report-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Report Header */
.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #007acc;
}

.report-header h2 {
    color: #333;
    font-size: 28px;
    margin: 0;
}

.header-controls {
    display: flex;
    gap: 10px;
}

.export-btn, .print-btn, .save-btn {
    background: #007acc;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.3s ease;
}

.export-btn:hover, .print-btn:hover, .save-btn:hover {
    background: #005999;
}

/* Store Information Grid */
.store-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #007acc;
}

.info-field {
    display: flex;
    flex-direction: column;
}

.info-field label {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    font-size: 14px;
}

.info-field input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
}

.info-field input:focus {
    outline: none;
    border-color: #007acc;
    box-shadow: 0 0 0 2px rgba(0, 122, 204, 0.2);
}

/* HR Form Container */
.hr-form-container {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* Section Blocks */
.section-block {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.section-block h3 {
    background: linear-gradient(135deg, #007acc, #005999);
    color: white;
    margin: 0;
    padding: 15px 20px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.section-number {
    background: rgba(255,255,255,0.2);
    padding: 4px 8px;
    border-radius: 20px;
    margin-right: 10px;
    font-size: 14px;
    font-weight: 700;
    min-width: 24px;
    text-align: center;
}

/* Table Controls */
.table-controls {
    padding: 10px 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #e1e5e9;
    text-align: right;
}

.add-row-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: background 0.3s ease;
}

.add-row-btn:hover {
    background: #218838;
}

.delete-row-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.3s ease;
    min-width: 30px;
}

.delete-row-btn:hover {
    background: #c82333;
}

/* Actions column styling */
.hr-table th:last-child,
.hr-table td:last-child {
    width: 60px;
    text-align: center;
    min-width: 60px;
}

/* HR Tables */
.hr-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 13px;
}

.hr-table thead {
    background: #f8f9fa;
}

.hr-table thead th {
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #dee2e6;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hr-table tbody td {
    padding: 8px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: top;
}

.hr-table tbody tr:hover {
    background: #f8f9fa;
}

/* Input Fields in Tables */
.hr-table input[type="text"],
.hr-table input[type="date"],
.hr-table input[type="number"],
.hr-table input[type="datetime-local"],
.hr-table select,
.hr-table textarea {
    width: 100%;
    border: 1px solid #ced4da;
    border-radius: 3px;
    padding: 6px 8px;
    font-size: 13px;
    background: white;
    box-sizing: border-box;
}

.hr-table input:focus,
.hr-table select:focus,
.hr-table textarea:focus {
    outline: none;
    border-color: #007acc;
    box-shadow: 0 0 0 1px rgba(0, 122, 204, 0.3);
}

.hr-table textarea {
    min-height: 60px;
    resize: vertical;
    font-family: inherit;
}

.hr-table select {
    cursor: pointer;
    padding-right: 25px;
    background-image: url("data:image/svg+xml;charset=US-ASCII,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'><path fill='%23666' d='M2 0L0 2h4zm0 5L0 3h4z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
    appearance: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hr-report-section {
        padding: 15px;
        margin: 10px;
    }
    
    .report-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .header-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .store-info-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .section-block h3 {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .table-controls {
        text-align: center;
        padding: 8px;
    }
    
    .add-row-btn {
        font-size: 11px;
        padding: 5px 10px;
    }
    
    .delete-row-btn {
        font-size: 10px;
        padding: 3px 6px;
        min-width: 25px;
    }
    
    .hr-table {
        font-size: 12px;
    }
    
    .hr-table thead th,
    .hr-table tbody td {
        padding: 6px 4px;
    }
    
    /* Hide action column header on mobile and show it as tooltip */
    .hr-table th:last-child {
        display: none;
    }
    
    .hr-table td:last-child {
        position: relative;
        padding: 4px;
    }
    
    /* Stack table cells vertically on very small screens */
    @media (max-width: 480px) {
        .table-controls {
            position: sticky;
            top: 0;
            z-index: 10;
            background: white;
            border-bottom: 2px solid #007acc;
        }
        
        .hr-table {
            display: block;
            overflow-x: auto;
            white-space: nowrap;
        }
        
        .hr-table thead,
        .hr-table tbody,
        .hr-table tr {
            display: block;
        }
        
        .hr-table tr {
            border: 1px solid #ccc;
            margin-bottom: 10px;
            padding: 10px;
            border-radius: 5px;
            background: white;
            display: flex;
            flex-direction: column;
            white-space: normal;
        }
        
        .hr-table thead {
            display: none;
        }
        
        .hr-table td {
            border: none;
            position: relative;
            padding: 8px 0;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .hr-table td:before {
            content: attr(data-label) ": ";
            font-weight: bold;
            color: #333;
            min-width: 30%;
            flex-shrink: 0;
        }
        
        .hr-table td:last-child {
            justify-content: center;
            margin-top: 10px;
            padding-top: 10px;
            border-top: 1px solid #eee;
        }
        
        .hr-table td:last-child:before {
            content: "";
        }
        
        .hr-table input,
        .hr-table textarea,
        .hr-table select {
            flex: 1;
            min-width: 0;
        }
    }
}

/* Print Styles */
@media print {
    .header-controls {
        display: none;
    }
    
    .section-block {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    .hr-table {
        font-size: 11px;
    }
    
    .section-block h3 {
        background: #333 !important;
        color: white !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* Additional Form Enhancements */
.hr-table tbody tr:nth-child(even) {
    background: #fbfbfb;
}

.hr-table tbody tr:nth-child(even):hover {
    background: #f0f0f0;
}

/* Special styling for day rows in absenteeism section */
.hr-table tbody tr td:first-child strong {
    color: #007acc;
    font-weight: 600;
}

/* Input validation states */
.hr-table input:invalid,
.hr-table textarea:invalid {
    border-color: #dc3545;
}

.hr-table input:valid,
.hr-table textarea:valid {
    border-color: #28a745;
}
