/* ============================================
   CSS Variables
   ============================================ */
:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --success: #10b981;
    --success-dark: #059669;
    --danger: #ef4444;
    --danger-dark: #dc2626;
    --warning: #f59e0b;
    --warning-dark: #d97706;
    --info: #06b6d4;
    
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    --transition: all 0.2s ease;
}

/* ============================================
   Reset & Base
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(-45deg, #1e40af, #3b82f6, #f97316, #fb923c);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ============================================
   Toast Notifications
   ============================================ */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    z-index: 10000;
    display: none;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 500px;
    animation: slideIn 0.3s ease;
}

.toast.show {
    display: flex;
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

.toast.warning {
    border-left: 4px solid var(--warning);
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ============================================
   Login Screen
   ============================================ */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    width: 100%;
    max-width: 440px;
    overflow: hidden;
}

.login-header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 48px 32px;
    text-align: center;
}

.login-logo {
    height: 80px;
    width: auto;
    margin-bottom: 24px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.login-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

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

.login-form {
    padding: 32px;
    background: rgba(255, 255, 255, 0.05);
}

/* Glassmorphism Login Inputs */
.login-form input[type="email"],
.login-form input[type="password"] {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.login-form input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.login-form input:focus {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.login-form label {
    color: white;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.login-form .checkbox-label span {
    color: white;
}

/* Glassmorphism Login Button */
.login-form .btn-primary {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.login-form .btn-primary:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Login Password Toggle */
.login-form .toggle-password {
    color: rgba(255, 255, 255, 0.8);
}

.login-form .toggle-password:hover {
    color: white;
}

/* Login Password Toggle */
.login-form .checkbox-label input[type="checkbox"] {
    accent-color: rgba(255, 255, 255, 0.8);
}

/* Login Error Message */
.login-form .error-message {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: white;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.login-footer {
    padding: 0 32px 32px;
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    margin: 0 32px 32px;
    border-radius: var(--radius);
    padding: 16px;
}

.login-footer p {
    margin: 4px 0;
}

.login-footer strong {
    color: var(--text-primary);
}

/* ============================================
   Form Elements
   ============================================ */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-secondary);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    transition: var(--transition);
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group textarea {
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.password-input {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-tertiary);
    padding: 4px;
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.toggle-password:hover {
    color: var(--text-secondary);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.info-box {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: var(--success-dark);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: var(--danger-dark);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   App Screen
   ============================================ */
.app-screen {
    min-height: 100vh;
    background: var(--bg-primary);
}

/* ============================================
   Header
   ============================================ */
.app-header {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-icon {
    color: var(--primary);
}

.header-left h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.header-left p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 14px;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-details span:first-child {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.user-role {
    font-size: 12px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sync-indicator {
    font-size: 20px;
    padding: 8px 12px;
    border-radius: var(--radius);
    background: var(--bg-tertiary);
    transition: var(--transition);
    cursor: help;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
}

.sync-indicator:hover {
    background: var(--border);
    transform: scale(1.1);
}

/* ============================================
   Navigation
   ============================================ */
.app-nav {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 0 32px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
}

.nav-item {
    padding: 16px 20px;
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    transition: var(--transition);
    position: relative;
}

.nav-item:hover {
    color: var(--text-primary);
    background: var(--bg-primary);
}

.nav-item.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.badge {
    background: var(--danger);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

/* ============================================
   Main Content
   ============================================ */
.app-content {
    padding: 32px;
    max-width: 1400px;
    margin: 0 auto;
}

.view {
    display: none;
}

.view.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.view-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ============================================
   Stats Grid
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: var(--transition);
}

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

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.primary {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
}

.stat-icon.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.stat-icon.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.stat-icon.danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ============================================
   Quick Actions
   ============================================ */
.quick-actions {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.quick-actions h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

/* ============================================
   Filters
   ============================================ */
.filters {
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 24px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 200px;
}

.filter-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group select,
.filter-group input {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    transition: var(--transition);
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ============================================
   Tables
   ============================================ */
.table-container {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

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

.data-table thead {
    background: var(--bg-tertiary);
}

.data-table th {
    padding: 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 16px;
    font-size: 14px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
}

.data-table tbody tr {
    transition: var(--transition);
}

.data-table tbody tr:hover {
    background: var(--bg-primary);
}

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

.no-data {
    text-align: center;
    padding: 64px 24px !important;
}

.no-data svg {
    color: var(--text-tertiary);
    margin-bottom: 16px;
}

.no-data p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ============================================
   Status Badges
   ============================================ */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-badge.pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-dark);
}

.status-badge.approved {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-dark);
}

.status-badge.rejected {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-dark);
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* ============================================
   Leave Type Badges
   ============================================ */
.leave-type {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* ============================================
   Action Buttons in Tables
   ============================================ */
.action-buttons {
    display: flex;
    gap: 8px;
}

.action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.action-btn.view {
    background: rgba(6, 182, 212, 0.1);
    color: var(--info);
}

.action-btn.view:hover {
    background: rgba(6, 182, 212, 0.2);
}

.action-btn.approve {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.action-btn.approve:hover {
    background: rgba(16, 185, 129, 0.2);
}

.action-btn.reject {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.action-btn.reject:hover {
    background: rgba(239, 68, 68, 0.2);
}

.action-btn.edit {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
}

.action-btn.edit:hover {
    background: rgba(59, 130, 246, 0.2);
}

.action-btn.delete {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.action-btn.delete:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* ============================================
   Modal
   ============================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 24px 32px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-tertiary);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body {
    padding: 32px;
}

.modal-footer {
    padding: 24px 32px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ============================================
   Leave Details in Modal
   ============================================ */
.leave-detail-item {
    margin-bottom: 20px;
}

.leave-detail-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.leave-detail-value {
    font-size: 14px;
    color: var(--text-primary);
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
}

/* ============================================
   Error Messages
   ============================================ */
.error-message {
    padding: 12px 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius);
    color: var(--danger-dark);
    font-size: 14px;
    margin-top: 16px;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .app-header {
        padding: 12px 16px;
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .header-left {
        width: 100%;
    }

    .header-right {
        width: 100%;
        justify-content: space-between;
    }

    .app-nav {
        padding: 0 16px;
    }

    .app-content {
        padding: 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

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

    .filters {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }

    .table-container {
        overflow-x: auto;
    }

    .data-table {
        min-width: 800px;
    }

    .modal-content {
        max-width: 100%;
        margin: 0;
    }

    .modal-body,
    .modal-header,
    .modal-footer {
        padding: 20px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .user-details {
        display: none;
    }
}

/* ============================================
   Progress Bars & Leave Balance
   ============================================ */
.leave-balance-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.leave-balance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.leave-balance-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.leave-balance-stats {
    font-size: 12px;
    color: var(--text-tertiary);
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    margin-bottom: 8px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 10px;
    transition: width 0.3s ease;
    position: relative;
}

.progress-bar.success {
    background: linear-gradient(90deg, var(--success), #34d399);
}

.progress-bar.warning {
    background: linear-gradient(90deg, var(--warning), #fbbf24);
}

.progress-bar.danger {
    background: linear-gradient(90deg, var(--danger), #f87171);
}

.progress-label {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
}

.progress-label strong {
    color: var(--text-primary);
}

.balance-summary {
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    padding: 16px;
    margin-top: 16px;
}

.balance-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

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

.balance-item-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.balance-item-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.balance-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius);
    padding: 12px;
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--warning-dark);
}

.balance-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius);
    padding: 12px;
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--danger-dark);
    font-weight: 600;
}

/* ============================================
   Activity Timeline & Recent Activities
   ============================================ */
.activity-timeline {
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.activity-timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.activity-timeline-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.activity-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius);
    background: var(--bg-tertiary);
    transition: var(--transition);
}

.activity-item:hover {
    background: var(--bg-primary);
    transform: translateX(2px);
}

.activity-icon-wrapper {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.activity-icon-wrapper.created {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
}

.activity-icon-wrapper.approved {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.activity-icon-wrapper.rejected {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-text {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.5;
}

.activity-text strong {
    font-weight: 600;
    color: var(--text-primary);
}

.activity-meta {
    font-size: 12px;
    color: var(--text-tertiary);
    display: flex;
    gap: 12px;
    align-items: center;
}

.activity-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.no-activities {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-tertiary);
}

.no-activities svg {
    margin-bottom: 12px;
}

/* Department Stats Cards */
.dept-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.dept-stat-card {
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    padding: 16px;
    border: 1px solid var(--border-light);
    transition: var(--transition);
}

.dept-stat-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.dept-stat-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.dept-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.dept-stat-label {
    font-size: 11px;
    color: var(--text-tertiary);
}

.dept-stat-details {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    font-size: 12px;
}

.dept-stat-details span {
    color: var(--text-secondary);
}

/* ============================================
   Calendar View
   ============================================ */
.calendar-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.current-month-year {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 180px;
    text-align: center;
}

.calendar-legend {
    display: flex;
    gap: 24px;
    padding: 16px 20px;
    background: white;
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    border: 1px solid var(--border-light);
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

.legend-color.weekend {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
}

.calendar-container {
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.calendar-day-header {
    background: var(--bg-tertiary);
    padding: 12px 8px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calendar-day {
    background: white;
    min-height: 100px;
    padding: 8px;
    position: relative;
    cursor: pointer;
    transition: var(--transition);
}

.calendar-day:hover {
    background: var(--bg-primary);
}

.calendar-day.other-month {
    background: var(--bg-tertiary);
    opacity: 0.5;
}

.calendar-day.today {
    background: rgba(59, 130, 246, 0.05);
    border: 2px solid var(--primary) !important;
}

.calendar-day.weekend {
    background: var(--bg-tertiary);
}

.calendar-day.has-leave {
    cursor: pointer;
}

.calendar-day-number {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.calendar-day.other-month .calendar-day-number {
    color: var(--text-tertiary);
}

.calendar-day-leaves {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.calendar-leave-badge {
    font-size: 10px;
    padding: 3px 6px;
    border-radius: 4px;
    font-weight: 600;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    border: 2px solid transparent;
}

.calendar-leave-badge.approved {
    background: rgba(59, 130, 246, 0.2);
    border-color: var(--primary);
    color: var(--primary-dark);
}

.calendar-leave-badge.pending {
    background: rgba(245, 158, 11, 0.2);
    border-color: var(--warning);
    color: var(--warning-dark);
}

.calendar-leave-badge.rejected {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
    color: var(--danger-dark);
}

.calendar-leave-count {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 4px;
    text-align: center;
}

.calendar-warning {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 16px;
    height: 16px;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
}

/* Calendar Sidebar */
.calendar-sidebar {
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    max-height: 600px;
    overflow-y: auto;
}

.calendar-sidebar h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.sidebar-leave-item {
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    margin-bottom: 12px;
    border-left: 4px solid transparent;
}

.sidebar-leave-item.approved {
    border-left-color: var(--primary);
}

.sidebar-leave-item.pending {
    border-left-color: var(--warning);
}

.sidebar-leave-item.rejected {
    border-left-color: var(--danger);
}

.sidebar-leave-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.sidebar-leave-type {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.sidebar-leave-status {
    font-size: 11px;
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    margin-top: 4px;
}

.sidebar-leave-status.approved {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-dark);
}

.sidebar-leave-status.pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-dark);
}

.sidebar-leave-status.rejected {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-dark);
}

/* Responsive Calendar */
@media (max-width: 768px) {
    .calendar-grid {
        gap: 0;
    }
    
    .calendar-day {
        min-height: 80px;
        padding: 4px;
    }
    
    .calendar-day-number {
        font-size: 12px;
    }
    
    .calendar-leave-badge {
        font-size: 9px;
        padding: 2px 4px;
    }
    
    .calendar-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .current-month-year {
        width: 100%;
        margin-bottom: 8px;
    }
    
    .calendar-legend {
        gap: 12px;
    }
}

/* ============================================
   Loading & Skeleton
   ============================================ */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: var(--radius);
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.skeleton-line {
    height: 16px;
    margin-bottom: 12px;
    border-radius: var(--radius);
}

.skeleton-line.title {
    height: 24px;
    width: 60%;
}

.skeleton-line.small {
    width: 40%;
}

.skeleton-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

/* Button Spinner */
.btn-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

/* ============================================
   Utilities
   ============================================ */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.hidden {
    display: none !important;
}
