* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #2ecc71;
    --danger-color: #e74c3c;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --gray-color: #95a5a6;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 25px 30px;
    border-bottom: 5px solid var(--accent-color);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stats {
    display: flex;
    gap: 30px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 15px;
    border-radius: 20px;
}

/* Buttons */
.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--accent-color);
    color: white;
}

.btn-primary:hover {
    background: #27ae60;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.3);
}

.btn-secondary {
    background: var(--gray-color);
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

/* Main Content */
.main-content {
    padding: 30px;
}

/* Filters Section */
.filters-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    gap: 20px;
}

.search-box {
    flex: 1;
    position: relative;
    max-width: 400px;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-color);
}

.search-box input {
    width: 100%;
    padding: 12px 20px 12px 45px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.filters {
    display: flex;
    gap: 15px;
    align-items: center;
}

.filters select {
    padding: 12px 20px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    min-width: 200px;
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    border-left: 5px solid var(--secondary-color);
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.card h3 {
    color: var(--dark-color);
    font-size: 1rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card p {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* Table */
.table-container {
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

#payrollTable {
    width: 100%;
    border-collapse: collapse;
    min-width: 1200px;
}

#payrollTable thead {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

#payrollTable th {
    padding: 18px 15px;
    text-align: left;
    font-weight: 600;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

#payrollTable th:last-child {
    border-right: none;
}

#payrollTable tbody tr {
    border-bottom: 1px solid #eee;
    transition: background-color 0.3s;
}

#payrollTable tbody tr:hover {
    background-color: #f8f9fa;
}

#payrollTable td {
    padding: 15px;
    color: #333;
}

#payrollTable td:first-child {
    font-weight: 600;
    color: var(--primary-color);
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s;
}

.action-btn.edit {
    background: #3498db;
    color: white;
}

.action-btn.delete {
    background: #e74c3c;
    color: white;
}

.action-btn:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
}

.pagination button {
    padding: 10px 25px;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
}

.pagination button:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

.pagination button:not(:disabled):hover {
    background: #2980b9;
}

#pageInfo {
    font-weight: 600;
    color: var(--dark-color);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 50px auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: modalSlide 0.3s ease;
}

@keyframes modalSlide {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 25px 30px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: #ffdddd;
}

/* Form */
#employeeForm {
    padding: 30px;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    flex: 1;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.modal-footer {
    padding: 20px 30px 30px;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

/* Calculation Summary */
.calc-summary {
    padding: 30px;
}

.calc-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
    font-size: 1.1rem;
}

.calc-item:last-child {
    border-bottom: none;
}

.calc-item.total {
    font-weight: bold;
    font-size: 1.3rem;
    color: var(--primary-color);
    padding-top: 20px;
    margin-top: 10px;
    border-top: 2px solid var(--accent-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-info {
        flex-direction: column;
        gap: 20px;
    }
    
    .filters-section {
        flex-direction: column;
    }
    
    .search-box {
        max-width: 100%;
    }
    
    .form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .summary-cards {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: 20px auto;
        width: 95%;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 2rem;
    }
    
    .stats {
        flex-direction: column;
        gap: 10px;
    }
    
    .filters {
        flex-direction: column;
        width: 100%;
    }
    
    .filters select {
        width: 100%;
    }
}