/* Modern CSS Design System - Glassmorphism & Vibrant */
:root {
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --primary-color: #4F46E5;
    --primary-hover: #4338CA;
    --secondary-color: #10B981;
    --warning-color: #F59E0B;
    --danger-color: #EF4444;
    --text-main: #1F2937;
    --text-muted: #6B7280;
    
    /* Glass Effect Variables */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: var(--bg-gradient);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Base Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: 1px solid var(--glass-border);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 24px rgba(0,0,0,0.02);
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 2.5rem;
}

.brand .logo {
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.brand h2 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary-color);
    transform: translateX(4px);
}

.nav-item.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.user-profile {
    margin-top: auto;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    border: 1px solid var(--glass-border);
}
.user-info { display: flex; flex-direction: column; margin-bottom: 0.5rem; }
.user-info strong { font-size: 0.95rem; }
.user-info span { font-size: 0.8rem; color: var(--text-muted); }

.user-selector {
    width: 100%;
    padding: 6px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    margin-top: 8px;
    font-size: 0.85rem;
    background: white;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.top-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
}

.header-actions {
    display: flex;
    gap: 1rem;
}

/* Buttons */
button {
    cursor: pointer;
    font-family: inherit;
    border: none;
    border-radius: 10px;
    padding: 10px 20px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}
.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
}

.btn-secondary {
    background: white;
    color: var(--text-main);
    border: 1px solid #e5e7eb;
}
.btn-secondary:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    transform: translateY(-2px);
}
.btn-success { background: var(--secondary-color); color: white; padding: 6px 12px; font-size: 0.8rem;}
.btn-danger { background: var(--danger-color); color: white; padding: 6px 12px; font-size: 0.8rem;}

/* Utility Classes */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: var(--glass-shadow);
}

.card { padding: 1.5rem; }

/* Grid Layouts */
.widgets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.widget {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    transition: transform 0.3s ease;
}
.widget:hover {
    transform: translateY(-5px);
}

.widget-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}
.primary-bg { background: linear-gradient(135deg, #4F46E5, #818CF8); }
.warning-bg { background: linear-gradient(135deg, #F59E0B, #FBBF24); }
.success-bg { background: linear-gradient(135deg, #10B981, #34D399); }

.widget-info h3 { font-size: 1.8rem; font-weight: 700; margin-bottom: 2px; }
.widget-info p { font-size: 0.85rem; color: var(--text-muted); font-weight: 500;}

.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.admin-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.card-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

/* Tables */
.table-container {
    overflow-x: auto;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table th {
    text-align: left;
    padding: 12px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    border-bottom: 2px solid rgba(0,0,0,0.05);
}
.data-table td {
    padding: 16px 12px;
    border-bottom: 1px solid rgba(0,0,0,0.03);
    font-size: 0.9rem;
}
.data-table tr:hover td {
    background: rgba(255,255,255,0.4);
}

/* Status Badges */
.badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge.pending { background: #FEF3C7; color: #92400E; }
.badge.approved { background: #D1FAE5; color: #065F46; }
.badge.rejected { background: #FEE2E2; color: #991B1B; }

/* Payroll List items */
.payroll-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: rgba(255,255,255,0.6);
    border-radius: 12px;
    margin-bottom: 10px;
    transition: transform 0.2s;
}
.payroll-item:hover {
    transform: scale(1.02);
    background: white;
}
.payroll-info strong { display: block; font-size: 1rem; color: var(--primary-color);}
.payroll-info span { font-size: 0.8rem; color: var(--text-muted);}

/* Tabs */
.tab-content { display: none; animation: fadeIn 0.4s ease forwards; }
.tab-content.active { display: block; }

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

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}
.modal {
    width: 100%;
    max-width: 500px;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.close-btn {
    background: none; border: none; font-size: 1.5rem; color: var(--text-muted);
}

.form-group { margin-bottom: 1rem; display: flex; flex-direction: column; gap: 6px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group label { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }
.form-group input, .form-group select {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: rgba(255,255,255,0.8);
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}
.form-group input:focus, .form-group select:focus {
    border-color: var(--primary-color);
}
.form-actions { display: flex; justify-content: flex-end; gap: 1rem; margin-top: 1.5rem; }

/* Hidden utility */
.hidden { display: none !important; }

/* Responsive */
@media (max-width: 1024px) {
    .content-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .app-container { flex-direction: column; }
    .sidebar { width: 100%; height: auto; border-right: none; border-bottom: 1px solid var(--glass-border); padding: 1rem; }
    .brand { margin-bottom: 1rem; }
    .nav-menu { flex-direction: row; margin-bottom: 1rem; }
}
