body {
    font-size: 14px;
    color: var(--text-primary);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--bg-raised);
    margin: 2% auto;
    padding: 30px;
    border-radius: 12px;
    width: 85%;
    max-width: 1000px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.close-modal {
    position: absolute;
    right: 25px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: var(--text-muted);
    cursor: pointer;
}

.close-modal:hover { color: var(--text-primary); }

/* Form Layout Improvements */
.form-group-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-section {
    background: #fcfcfc;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border);
    margin-bottom: 20px;
}

.form-section h3 {
    font-size: 14px;
    color: var(--accent);
    margin-bottom: 15px;
    border-bottom: 2px solid var(--accent);
    display: inline-block;
}

/* Table Controls */
.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    gap: 15px;
}

/* Table Scrolling & Sticky Logic */
.table-wrapper {
    overflow: auto;
    max-height: calc(100vh - 260px);
    position: relative;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-raised);
}

.hrms-table {
    width: 100%;
    border-collapse: separate; /* Required for sticky borders to work correctly */
    border-spacing: 0;
}

.hrms-table th, 
.hrms-table td {
    white-space: nowrap; /* Prevents text wrapping to keep table rows aligned */
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 12px; /* Slightly smaller for professional density */
}

/* Sticky Column Base */
.sticky-col {
    position: sticky;
    background-color: var(--bg-raised) !important; /* Must be opaque to hide scrolling data */
    z-index: 5; /* Base level for sticky body cells */
}

/* Column Offsets - Adjust these widths based on your content */
.col-1 { left: 0; min-width: 60px; max-width: 60px; } /* Photo */
.col-2 { 
    left: 60px; 
    min-width: 180px; /* Increased to fit "EMPLOYEE ID" heading comfortably */
}
.col-3 { 
    left: 240px; /* Offset = Width of Col 1 (60) + Col 2 (180) */
    min-width: 280px; /* Ensures "FULL NAME" and longer names fit */
    padding-right: 40px !important; /* Extra space before the shadow separator */
    border-right: 2px solid #e0e0e0; /* Stronger visual edge */
    box-shadow: 5px 0 5px -3px rgba(0,0,0,0.1); 
}

/* General Header Sticky (Vertical) */
.hrms-table thead th {
    position: sticky;
    top: 0;
    background: var(--bg-base);
    z-index: 10; /* Above regular body cells */
    border-bottom: 2px solid #dee2e6;
}

/* Corner Sticky Headers (Photo, ID, Name) */
.hrms-table thead th.sticky-col {
    z-index: 20 !important; /* Highest priority: stays above scrolling headers and body */
    background-color: var(--bg-base) !important;
}

.search-input {
    padding: 10px 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 300px;
    font-family: inherit;
}

.emp-photo-circle {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    overflow: hidden;
    background-color: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.emp-photo-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
