* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f5f5;
}

.navbar {
    background-color: #2c3e50;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-links a {
    color: white;
    text-decoration: none;
    margin-left: 2rem;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    background-color: #34495e;
}

.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.dashboard {
    margin-bottom: 3rem;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.stat-card {
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.fade-in { animation: fadeIn 0.35s ease both; }
.fade-in-up { animation: fadeInUp 0.45s cubic-bezier(.22,.9,.32,1) both; }

.stat-card { animation: fadeInUp 0.45s ease both; }

.modal.show { display: block; }
.modal-content { animation: fadeInUp 0.35s ease both; }

.stat-card h3 {
    color: #7f8c8d;
    margin-bottom: 0.5rem;
}

.stat-card p {
    font-size: 2rem;
    color: #2c3e50;
    font-weight: bold;
}

.btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #2980b9;
}

.btn.cancel {
    background-color: #e74c3c;
}

.btn.cancel:hover {
    background-color: #c0392b;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    margin: 2rem auto;
}

.modal-content h3 {
    margin-bottom: 1rem;
}

form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

input, select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #f8f9fa;
    font-weight: 600;
}

tr:hover {
    background-color: #f8f9fa;
}

/* subtle row entrance */
tbody tr { transition: background-color 0.18s, transform 0.18s; }

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.edit-btn, .delete-btn {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    border: none;
    color: white;
}

.edit-btn {
    background-color: #f39c12;
}

.delete-btn {
    background-color: #e74c3c;
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .stat-card {
        min-width: 100%;
    }
    
    table {
        display: block;
        overflow-x: auto;
    }
}

/* Employee table - mobile stacked cards */
@media (max-width: 720px) {
    table.responsive, table {
        width: 100%;
    }
    table thead { display: none; }
    table tbody tr { display: block; border: 1px solid #f0f0f4; margin-bottom: 0.6rem; padding: 0.5rem; border-radius: 6px; background: #fff; }
    table tbody td { display: flex; justify-content: space-between; padding: 0.4rem 0; border: none; }
    table tbody td:before { content: attr(data-label); font-weight: 600; color: #333; margin-right: 8px; }
    .modal-content { width: 95%; margin: 1rem auto; padding: 1rem; }
    .action-buttons { justify-content: flex-end; gap: 0.4rem; }
}

/* Button loading spinner */
.btn.loading { opacity: 0.9; pointer-events: none; }
.btn.loading .spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 8px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #ffffff;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Modal title change styling */
#employeeModalTitle { font-size: 1.25rem; margin-bottom: 0.25rem; }

/* Modern theme overrides + responsiveness improvements */
.navbar {
        background: linear-gradient(90deg,#0f172a,#0b1220);
        padding: 0.75rem 1rem;
        box-shadow: 0 6px 24px rgba(10,15,30,0.18);
}
.logo { font-size: 1.1rem; font-weight: 700; letter-spacing: 0.4px; }
.nav-links a { margin-left: 0.8rem; padding: 0.45rem 0.75rem; border-radius: 8px; color: rgba(255,255,255,0.92); }
.nav-links a:hover, .nav-links a.active { background-color: rgba(255,255,255,0.04); transform: translateY(-1px); }

.stat-card { border-radius: 12px; box-shadow: 0 8px 30px rgba(11,20,40,0.06); padding: 1rem; }
input, select, textarea { transition: box-shadow .15s ease, border-color .15s ease; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #7c3aed; box-shadow: 0 8px 30px rgba(124,58,237,0.06); }

.btn { border-radius: 10px; padding: 0.5rem 0.9rem; box-shadow: 0 10px 24px rgba(37,99,235,0.08); }
.btn.cancel { border-radius: 10px; }

/* Table polish */
table th { text-transform: uppercase; font-size: 0.78rem; color: #475569; letter-spacing: 0.6px; }
table td { font-size: 0.95rem; color: #0f172a; }
tbody tr { transition: transform .12s ease, box-shadow .12s ease; }
tbody tr:hover { transform: translateY(-4px); box-shadow: 0 10px 30px rgba(12,18,40,0.06); }

/* Small screens: tighten paddings and use stacked cards where applicable */
@media (max-width: 560px) {
    .container { padding: 0 0.6rem; }
    .stat-card { padding: 0.85rem; }
    th, td { padding: 0.6rem; }
    .logo { font-size: 1rem; }
}

/* subtle entrance for cards */
@keyframes floatIn { from { opacity: 0; transform: translateY(8px) scale(.995);} to { opacity: 1; transform: none; } }
.stat-card, .modal-content, table tbody tr { animation: floatIn .32s ease both; }