* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #6B46C1 0%, #553C9A 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #6B46C1 0%, #553C9A 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.header h1 {
    font-size: 32px;
    margin-bottom: 10px;
}

.header p {
    font-size: 16px;
    opacity: 0.9;
}

.toolbar {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.file-section {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.file-input {
    display: none;
}

.file-btn, .action-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.file-btn {
    background: #6B46C1;
    color: white;
}

.file-btn:hover {
    background: #553C9A;
    transform: translateY(-1px);
}

.restore-btn {
    background: #E9D5FF;
    color: #6B46C1;
}

.restore-btn:hover {
    background: #DDD6FE;
}

.export-btn {
    background: #8B5CF6;
    color: white;
}

.export-btn:hover {
    background: #7C3AED;
}

.add-btn {
    background: #6B46C1;
    color: white;
}

.add-btn:hover {
    background: #553C9A;
}

.controls {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.control-group {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 250px;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
}

.filter-select {
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    min-width: 150px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    padding: 20px;
    background: #f8f9fa;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-number {
    font-size: 26px;
    font-weight: 700;
    color: #6B46C1;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 13px;
    color: #666;
    font-weight: 600;
}

.content {
    padding: 20px;
}

.employees-container {
    border: 1px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.employees-header {
    background: linear-gradient(135deg, #6B46C1 0%, #553C9A 100%);
    color: white;
    padding: 15px 20px;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.employees-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 14px;
}

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

.employees-table th,
.employees-table td {
    padding: 12px 8px;
    text-align: right;
    border-bottom: 1px solid #e9ecef;
    font-size: 13px;
}

.employees-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    position: sticky;
    top: 0;
    z-index: 10;
}

.employees-table tbody tr {
    background: #ffffff;
}

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

.employees-table tbody tr:hover {
    background: #e3f2fd !important;
}

.parking-status {
    padding: 6px 10px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

.has-parking {
    background: #E9D5FF;
    color: #6B46C1;
}

.no-parking {
    background: #FEE2E2;
    color: #991B1B;
}

.permit-only {
    background: #FEF3C7;
    color: #92400E;
}

.service-years {
    font-weight: 600;
    color: #6B46C1;
    white-space: nowrap;
}

.employee-rank {
    background: #6B46C1;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    min-width: 30px;
    display: inline-block;
    text-align: center;
}

.grade-badge {
    background: #8B5CF6;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.action-buttons {
    display: flex;
    gap: 3px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    min-width: 50px;
}

.btn-assign {
    background: #6B46C1;
    color: white;
}

.btn-assign:hover {
    background: #553C9A;
}

.btn-edit {
    background: #E9D5FF;
    color: #6B46C1;
}

.btn-edit:hover {
    background: #DDD6FE;
}

.btn-delete {
    background: #dc3545;
    color: white;
}

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

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 2% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
}

.modal-body {
    margin-bottom: 20px;
    line-height: 1.6;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
}

.form-input {
    width: 100%;
    padding: 10px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 14px;
}

.form-input:focus {
    outline: none;
    border-color: #6B46C1;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-primary {
    background: #6B46C1;
    color: white;
}

.delete-options {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.option-btn {
    flex: 1;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.option-btn.final-delete {
    border-color: #dc3545;
    color: #dc3545;
}

.option-btn.final-delete:hover,
.option-btn.final-delete.selected {
    background: #dc3545;
    color: white;
}

.option-btn.move-to-waiting {
    border-color: #ffc107;
    color: #856404;
}

.option-btn.move-to-waiting:hover,
.option-btn.move-to-waiting.selected {
    background: #ffc107;
    color: #212529;
}

.next-in-line {
    background: linear-gradient(90deg, #e8f5e8 0%, #f8fff8 100%) !important;
    border-right: 4px solid #28a745;
    font-weight: 600;
}

.no-results {
    text-align: center;
    padding: 60px;
    color: #666;
    font-size: 16px;
}

.notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 15px 25px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s;
}

.notification.show {
    opacity: 1;
}

.notification.success {
    background: #28a745;
}

.notification.error {
    background: #dc3545;
}

.notification.info {
    background: #17a2b8;
}

.history-section {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.history-item {
    padding: 8px 0;
    border-bottom: 1px solid #ddd;
    font-size: 13px;
}

.history-item:last-child {
    border-bottom: none;
}

.validation-status {
    display: inline-block;
    transition: transform 0.2s;
    position: relative;
    cursor: help;
}

.validation-status:hover {
    transform: scale(1.2);
}

.validation-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 13px;
    white-space: normal;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 1000;
    margin-bottom: 8px;
    min-width: 200px;
    max-width: 300px;
    text-align: center;
    line-height: 1.4;
    direction: rtl;
}

.validation-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
}

.validation-status:hover .validation-tooltip {
    opacity: 1;
}

@media (max-width: 768px) {
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .file-section {
        justify-content: center;
    }

    .control-group {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box,
    .filter-select {
        min-width: unset;
    }

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

    .employees-table {
        font-size: 11px;
    }

    .employees-table th,
    .employees-table td {
        padding: 6px 4px;
    }
}