/* ========================================
   EMPLOYEES PAGE
   ======================================== */

.employees-page {
    padding: 1.5rem 2rem;
}

.employees-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

/* Search */
.search-container {
    position: relative;
    width: 300px;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--rz-gray-400);
    font-size: 1.25rem;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: 1px solid var(--rz-gray-200);
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--rz-primary);
    box-shadow: 0 0 0 3px var(--rz-primary-lighter);
}

.search-input::placeholder {
    color: var(--rz-gray-400);
}

/* Header Layout */
.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Status Filter */
.status-filter {
    display: flex;
    background: var(--rz-gray-100);
    border-radius: 8px;
    padding: 4px;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: var(--rz-gray-600);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s;
}

.filter-btn:hover {
    color: var(--rz-gray-800);
}

.filter-btn.active {
    background: white;
    color: var(--rz-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Table */
.employees-table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.employees-table {
    width: 100%;
    border-collapse: collapse;
}

.employees-table thead {
    background: var(--rz-gray-50);
}

.employees-table th {
    padding: 0.875rem 1.25rem;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--rz-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--rz-gray-200);
}

.employees-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--rz-gray-100);
    font-size: 0.9rem;
    color: var(--rz-gray-700);
}

.employees-table tbody tr:hover {
    background: var(--rz-gray-50);
}

.employees-table tbody tr:last-child td {
    border-bottom: none;
}

/* Employee cell */
.employee-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.employee-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--rz-primary-lighter);
    color: var(--rz-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    flex-shrink: 0;
}

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

.employee-name {
    font-weight: 500;
    color: var(--ns-heading);
}

.employee-cedula {
    font-size: 0.8rem;
    color: var(--rz-gray-500);
}

.salary-cell {
    font-weight: 600;
    color: var(--ns-heading);
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.status-active {
    background: var(--ns-success-bg);
    color: var(--ns-success-text);
}

.status-inactive {
    background: var(--rz-gray-100);
    color: var(--rz-gray-600);
}

.status-terminated {
    background: var(--ns-danger-bg);
    color: var(--ns-danger-text);
}

/* View link */
.view-link {
    color: var(--rz-gray-400);
    transition: color 0.2s;
}

.view-link:hover {
    color: var(--rz-primary);
}

/* ========================================
   WIZARD MODAL
   ======================================== */

.wizard-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.15s ease-out;
}

.wizard-modal {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    animation: slideUp 0.2s ease-out;
}

/* Wizard Header */
.wizard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, var(--ns-heading) 0%, var(--rz-primary-dark) 100%);
    color: white;
}

.wizard-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.wizard-close {
    background: transparent;
    border: none;
    color: white;
    opacity: 0.7;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wizard-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

.wizard-close .rzi {
    font-size: 1.25rem;
}

/* Step Indicator */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem 2rem;
    background: linear-gradient(135deg, var(--rz-primary-dark) 0%, var(--rz-gray-900) 100%);
}

.wizard-step {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.3s;
}

.wizard-step.active {
    background: var(--rz-primary);
    color: white;
}

.wizard-step.completed {
    background: var(--rz-success);
    color: white;
}

.wizard-step.completed .rzi {
    font-size: 1rem;
}

.wizard-step-line {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 0.5rem;
    border-radius: 2px;
    transition: background 0.3s;
}

.wizard-step-line.active {
    background: var(--rz-success);
}

/* Wizard Body */
.wizard-body {
    padding: 1.5rem 2rem;
    overflow-y: auto;
    flex: 1;
}

.wizard-section {
    animation: fadeIn 0.2s ease-out;
}

.wizard-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--rz-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 1.5rem 0;
}

/* Photo Upload */
.photo-upload-section {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--rz-gray-200);
}

.photo-preview-container {
    flex-shrink: 0;
}

.photo-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--rz-gray-100);
    color: var(--rz-gray-400);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--rz-gray-300);
}

.photo-placeholder .rzi {
    font-size: 2.5rem;
}

.photo-preview {
    width: 100px;
    height: 100px;
    position: relative;
}

.photo-preview img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--rz-primary-lighter);
}

.photo-remove-btn {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--rz-danger);
    color: white;
    border: 2px solid white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: transform 0.2s;
}

.photo-remove-btn:hover {
    transform: scale(1.1);
}

.photo-remove-btn .rzi {
    font-size: 0.875rem;
}

.photo-upload-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    justify-content: center;
}

.photo-input {
    display: none;
}

.photo-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: var(--rz-primary-lighter);
    color: var(--rz-primary);
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.photo-upload-btn:hover:not(.disabled) {
    background: var(--rz-primary);
    color: white;
}

.photo-upload-btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.photo-upload-btn .rzi {
    font-size: 1.125rem;
}

.photo-hint {
    font-size: 0.75rem;
    color: var(--rz-gray-500);
}

/* Benefits Info Box */
.benefits-info-box {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--rz-primary-lighter);
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--rz-gray-700);
    line-height: 1.5;
}

.benefits-info-box .rzi {
    font-size: 1.25rem;
    color: var(--rz-primary);
    flex-shrink: 0;
}

.benefits-info-box strong {
    color: var(--ns-heading);
}

.wizard-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.wizard-form-group {
    display: flex;
    flex-direction: column;
}

.wizard-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--rz-gray-600);
    margin-bottom: 0.5rem;
}

.wizard-label .required {
    color: var(--rz-danger);
}

.emergency-label {
    color: var(--rz-danger);
}

.wizard-form-group .rz-textbox,
.wizard-form-group .rz-dropdown,
.wizard-form-group .rz-datepicker,
.wizard-form-group .rz-numeric {
    width: 100%;
}

/* Checkbox group */
.checkbox-group {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-group label {
    font-size: 0.9rem;
    color: var(--rz-gray-700);
    margin: 0;
}

/* Subsection */
.wizard-subsection {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--rz-gray-200);
}

.wizard-subsection-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--rz-danger);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.subsection-icon {
    font-size: 1rem;
}

/* SBU Warning */
.sbu-warning {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--ns-warning-bg);
    border: 1px solid var(--ns-warning-border);
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--ns-warning-text);
}

.sbu-warning .rzi {
    font-size: 1rem;
}

/* Field error */
.field-error {
    font-size: 0.8rem;
    color: var(--rz-danger);
    margin-top: 0.35rem;
}

/* Wizard Error */
.wizard-error {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: var(--ns-danger-bg);
    border: 1px solid var(--ns-danger-border);
    border-radius: 8px;
    color: var(--ns-danger-text);
    font-size: 0.875rem;
}

.wizard-error .rzi {
    font-size: 1.25rem;
}

/* Wizard Footer */
.wizard-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    border-top: 1px solid var(--rz-gray-200);
    background: var(--rz-gray-50);
}

.wizard-btn-back {
    background: transparent;
    border: none;
    color: var(--rz-gray-600);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.2s;
}

.wizard-btn-back:hover {
    background: var(--rz-gray-200);
    color: var(--rz-gray-900);
}

.wizard-btn-next,
.wizard-btn-finish {
    min-width: 140px;
}

.wizard-btn-finish {
    background: var(--rz-secondary) !important;
}

.wizard-btn-finish:hover {
    filter: brightness(0.95);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 640px) {
    .employees-page {
        padding: 1rem;
    }

    .employees-header {
        flex-direction: column;
        align-items: stretch;
    }

    .search-container {
        width: 100%;
    }

    .wizard-form-row {
        grid-template-columns: 1fr;
    }

    .wizard-modal {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }

    .employees-table th:nth-child(2),
    .employees-table td:nth-child(2),
    .employees-table th:nth-child(3),
    .employees-table td:nth-child(3) {
        display: none;
    }
}

/* Loading State */
.employees-page .loading-state {
    display: flex;
    justify-content: center;
    padding: 4rem;
}

/* ========================================
   IMPORT CSV MODAL
   ======================================== */

.import-modal {
    max-width: 1100px;
    width: 95vw;
}

.import-header h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.import-header h2 .rzi {
    font-size: 1.35rem;
    opacity: 0.85;
}

.import-body {
    padding: 1.5rem;
    max-height: 70vh;
    overflow-y: auto;
}

/* Upload Section */
.import-upload-section {
    position: relative;
}

.upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    border: 2px dashed var(--rz-gray-300);
    border-radius: 12px;
    background: var(--rz-gray-50);
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 140px;
}

.upload-area:hover {
    border-color: var(--rz-primary);
    background: var(--rz-primary-lighter);
}

.upload-area.dragging {
    border-color: var(--rz-primary);
    background: var(--rz-primary-lighter);
    transform: scale(1.01);
}

.upload-area.has-file {
    border-color: var(--rz-success);
    border-style: solid;
    background: var(--ns-success-bg);
}

.upload-area input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.upload-area .upload-icon {
    font-size: 2.5rem;
    color: var(--rz-gray-400);
    margin-bottom: 0.5rem;
}

.upload-area:hover .upload-icon {
    color: var(--rz-primary);
}

.upload-area.has-file .upload-icon {
    color: var(--rz-success);
}

.upload-area .upload-icon.success {
    color: var(--rz-success);
}

.upload-area .upload-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--rz-gray-700);
}

.upload-area.has-file .upload-title {
    color: var(--rz-success-darker);
}

.upload-area .upload-subtitle {
    font-size: 0.8rem;
    color: var(--rz-gray-500);
    margin-top: 0.25rem;
}

.btn-clear-file {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: var(--rz-gray-200);
    color: var(--rz-gray-600);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    z-index: 10;
}

.btn-clear-file:hover {
    background: var(--rz-danger);
    color: white;
}

.btn-clear-file .rzi {
    font-size: 1rem;
}

/* Import Actions */
.import-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
}

.btn-template,
.btn-example {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: var(--rz-gray-600);
    text-decoration: none;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    transition: all 0.15s;
}

.btn-template {
    background: var(--rz-gray-100);
    color: var(--rz-gray-700);
}

.btn-template:hover {
    background: var(--rz-primary-lighter);
    color: var(--rz-primary);
}

.btn-example:hover {
    color: var(--rz-primary);
}

.btn-template .rzi,
.btn-example .rzi {
    font-size: 1rem;
}

/* Preview Section */
.import-preview-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--rz-gray-200);
}

.section-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--rz-gray-700);
    margin: 0 0 1rem 0;
}

/* Stats Grid - Horizontal 4 columns */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.stat-card {
    padding: 0.75rem 0.5rem;
    border-radius: 8px;
    text-align: center;
    background: var(--rz-gray-100);
}

.stat-card.total {
    background: var(--rz-primary-lighter);
}

.stat-card.valid {
    background: var(--ns-success-bg);
}

.stat-card.duplicate {
    background: var(--ns-warning-bg);
}

.stat-card.error {
    background: var(--ns-danger-bg);
}

.stat-card .stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: var(--rz-gray-800);
}

.stat-card.total .stat-number {
    color: var(--rz-primary);
}

.stat-card.valid .stat-number {
    color: var(--rz-success);
}

.stat-card.duplicate .stat-number {
    color: var(--ns-warning-text);
}

.stat-card.error .stat-number {
    color: var(--rz-danger);
}

.stat-card .stat-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--rz-gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
}

/* Preview Table */
.preview-table {
    border-radius: 8px;
    overflow: hidden;
}

.preview-table .text-muted {
    color: var(--rz-gray-400);
    font-style: italic;
}

.preview-error-text {
    font-size: 0.8rem;
    color: var(--rz-danger);
    line-height: 1.3;
}

/* Import Badges */
.import-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.import-badge .rzi {
    font-size: 0.8rem;
}

.import-badge.valid {
    background: var(--ns-success-bg);
    color: var(--rz-success);
}

.import-badge.duplicate {
    background: var(--ns-warning-bg);
    color: var(--ns-warning-text);
}

.import-badge.error {
    background: var(--ns-danger-bg);
    color: var(--rz-danger);
}

/* Import Result Section */
.import-result-section {
    text-align: center;
    padding: 2rem 1rem;
}

.import-result-section .result-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.import-result-section.success .result-icon {
    color: var(--rz-success);
}

.import-result-section.warning .result-icon {
    color: var(--ns-warning-text);
}

.import-result-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--ns-heading);
    margin: 0 0 1.5rem 0;
}

.result-summary {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.result-item {
    text-align: center;
}

.result-item .result-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.result-item.imported .result-number {
    color: var(--rz-success);
}

.result-item.skipped .result-number {
    color: var(--ns-warning-text);
}

.result-item.failed .result-number {
    color: var(--rz-danger);
}

.result-item .result-label {
    display: block;
    font-size: 0.75rem;
    color: var(--rz-gray-600);
    margin-top: 0.25rem;
}

.import-result-section .result-errors {
    text-align: left;
    background: var(--ns-danger-bg);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

.import-result-section .result-errors h4 {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--rz-danger);
    margin: 0 0 0.5rem 0;
}

.import-result-section .result-errors ul {
    margin: 0;
    padding-left: 1.25rem;
    max-height: 150px;
    overflow-y: auto;
}

.import-result-section .result-errors li {
    font-size: 0.8rem;
    color: var(--ns-danger-text);
    margin-bottom: 0.25rem;
}

.import-result-section .result-errors li.more-errors {
    font-style: italic;
    color: var(--rz-gray-600);
}

/* Import Footer */
.import-footer .footer-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Responsive */
@media (max-width: 640px) {
    .import-modal {
        margin: 0.5rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .result-summary {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .import-actions {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
}
