:root {
    /* Color Palette */
    --bg-dark: #0f111a;
    --bg-darker: #090a0f;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    
    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --secondary: #14b8a6;
    --accent: #f59e0b;
    --danger: #ef4444;
    
    --gradient-purple: linear-gradient(135deg, #8b5cf6, #c084fc);
    --gradient-teal: linear-gradient(135deg, #14b8a6, #2dd4bf);
    --gradient-orange: linear-gradient(135deg, #f59e0b, #fbbf24);
    
    /* Typography */
    --font-main: 'Outfit', sans-serif;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    overflow: hidden;
    /* Soft ambient background glow */
    background-image: radial-gradient(circle at 15% 50%, rgba(139, 92, 246, 0.15), transparent 25%),
                      radial-gradient(circle at 85% 30%, rgba(20, 184, 166, 0.15), transparent 25%);
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 10px 40px -5px rgba(0, 0, 0, 0.4);
    transition: box-shadow 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
}

.app-container {
    display: flex;
    width: 100%;
    height: 100vh;
    padding: 20px;
    gap: 20px;
}

/* Sidebar */
.sidebar {
    width: 280px;
    display: flex;
    flex-direction: column;
    padding: 30px 20px;
    flex-shrink: 0;
    transition: width 0.3s cubic-bezier(0.4, 0.0, 0.2, 1), padding 0.3s ease;
    position: relative;
    z-index: 50;
}

.sidebar.collapsed {
    width: 90px;
    padding: 30px 15px;
}

.sidebar.collapsed .logo h2,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .user-info,
.sidebar.collapsed .btn-logout span {
    display: none;
}

.sidebar.collapsed .logo {
    justify-content: center;
    margin-bottom: 50px;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 15px;
}

.sidebar.collapsed .user-profile {
    justify-content: center;
    padding: 20px 0 0 0;
}

.sidebar.collapsed .user-profile img {
    margin: 0 auto;
}

.sidebar.collapsed .btn-logout {
    justify-content: center;
    padding: 15px;
}

/* Sidebar Toggle Button */
.btn-sidebar-toggle {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    margin-left: auto;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.btn-sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.sidebar.collapsed .btn-sidebar-toggle {
    position: absolute;
    top: 35px;
    right: -16px;
    background: var(--bg-dark);
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    border-radius: 50%;
}

.sidebar.collapsed .btn-sidebar-toggle i {
    transform: rotate(180deg);
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 50px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-purple);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
}

.logo h2 {
    font-weight: 700;
    letter-spacing: 0.5px;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-item i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

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

.nav-item.active {
    background: var(--gradient-purple);
    color: #fff;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-top: 20px;
    border-top: 1px solid var(--glass-border);
}

.user-profile img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid var(--primary);
}

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

.user-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.user-role {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.btn-logout {
    margin-top: 15px;
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

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

/* Main Content */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 10px 20px;
}

/* Custom Scrollbar for Main Content */
.main-content::-webkit-scrollbar {
    width: 8px;
}
.main-content::-webkit-scrollbar-track {
    background: transparent;
}
.main-content::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 10px;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding-top: 10px;
}

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

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

.btn-primary {
    background: var(--gradient-purple);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.btn-danger-outline {
    background: transparent;
    color: var(--danger);
    border: 1px solid var(--danger);
    padding: 12px 24px;
    border-radius: 10px;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
}

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

.notification-icon {
    position: relative;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.notification-icon:hover {
    background: rgba(255, 255, 255, 0.1);
}

.badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-dark);
}

/* Page Sections */
.page-section {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.page-section.active {
    display: block;
}

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

/* Dashboard Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-bottom: 30px;
}

.stat-card {
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px -10px rgba(0,0,0,0.5);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
}

.purple-gradient { background: var(--gradient-purple); box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3); }
.teal-gradient { background: var(--gradient-teal); box-shadow: 0 4px 15px rgba(20, 184, 166, 0.3); }
.orange-gradient { background: var(--gradient-orange); box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3); }

.stat-details h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
}

.dashboard-bottom {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 25px;
    align-items: start;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 25px 25px 0 25px;
}

.panel-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
}

.btn-text {
    background: none;
    border: none;
    color: var(--primary);
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-text:hover {
    text-decoration: underline;
}

/* Leave List */
.leave-list {
    padding: 0 25px 25px 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.leave-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s ease;
}

.leave-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.leave-info h4 {
    font-size: 1rem;
    margin-bottom: 4px;
}

.leave-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.status-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-approved { background: rgba(20, 184, 166, 0.15); color: #2dd4bf; }
.status-pending { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.status-rejected { background: rgba(239, 68, 68, 0.15); color: #f87171; }

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    overflow: hidden;
    margin-top: 5px;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-teal);
    transition: width 0.4s ease;
}

/* Refined Documents List */
.documents-grid {
    padding: 0 25px 25px 25px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.vault-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    padding: 0;
}

.document-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    transition: all 0.2s;
}

.document-card:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-2px);
}

.doc-icon {
    font-size: 2rem;
    color: var(--accent);
}

.doc-content {
    flex-grow: 1;
}

.doc-content h4 {
    font-size: 0.95rem;
    margin-bottom: 3px;
}

.doc-content p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.doc-due {
    font-size: 0.75rem;
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    padding: 3px 8px;
    border-radius: 10px;
}

.doc-completed .doc-due {
    background: transparent;
    padding: 0;
}

.btn-upload-icon {
    background: rgba(255,255,255,0.08);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-upload-icon:hover {
    background: var(--primary);
}

/* Form Styles */
.form-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px;
}

.form-container h2 {
    margin-bottom: 30px;
    font-size: 1.8rem;
}

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

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

label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
}

input[type="text"],
input[type="password"],
input[type="date"],
textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 14px 16px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

/* Custom Date Picker Indicator */
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.6;
    cursor: pointer;
}

.upload-area {
    border: 2px dashed var(--glass-border);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: rgba(0, 0, 0, 0.1);
}

.upload-area:hover {
    border-color: var(--primary);
    background: rgba(139, 92, 246, 0.05);
}

.upload-area i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 15px;
}

.upload-area p span {
    color: var(--primary);
    font-weight: 600;
}

.file-names-list {
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--secondary);
}

.form-actions {
    margin-top: 40px;
    display: flex;
    justify-content: flex-end;
}

/* Login Page Specific */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 450px;
    padding: 40px;
    display: flex;
    flex-direction: column;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header .logo-icon {
    width: 60px;
    height: 60px;
    font-size: 1.8rem;
    margin: 0 auto 20px auto;
}

.login-header h2 {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.login-header p {
    color: var(--text-secondary);
}

.role-toggle {
    display: flex;
    background: rgba(0,0,0,0.3);
    padding: 5px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.toggle-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 10px;
    border-radius: 8px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.toggle-btn.active {
    background: var(--glass-bg);
    color: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.login-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Admin Dashboard Specific */
.admin-leaves-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 900px;
}

.admin-leave-card {
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.admin-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 15px;
}

.admin-card-header h3 {
    font-size: 1.3rem;
    margin-bottom: 5px;
}

.admin-card-header h3 span {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.admin-card-meta {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.admin-card-body {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.action-buttons {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

/* Subject Approvals Grid */
.subject-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.subject-chip {
    padding: 8px 16px;
    border-radius: 20px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    border: 1px solid;
}

.subject-chip.pending {
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.3);
}

.subject-chip.pending:hover {
    background: rgba(245, 158, 11, 0.2);
}

.subject-chip.approved {
    background: rgba(20, 184, 166, 0.15);
    color: #2dd4bf;
    border-color: #2dd4bf;
}

.subject-chip.approved:hover {
    background: rgba(20, 184, 166, 0.25);
}

/* Responsive */
@media (max-width: 1024px) {
    .dashboard-bottom {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
        padding: 0;
        height: 100vh;
        overflow: hidden;
    }
    
    .sidebar {
        width: 100%;
        padding: 10px 15px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 0;
        border-radius: 0;
        border: none;
        border-bottom: 1px solid var(--glass-border);
        flex-shrink: 0;
    }
    
    .logo {
        margin-bottom: 0;
        gap: 10px;
    }
    
    .logo h2, .btn-sidebar-toggle {
        display: none !important;
    }
    
    .nav-menu {
        flex-direction: row;
        justify-content: center;
        gap: 15px;
        flex-grow: 1;
    }
    
    .nav-item {
        padding: 8px 12px;
        font-size: 0; /* Hide text */
    }
    
    .nav-item i {
        font-size: 1.3rem;
        width: auto;
        margin: 0;
    }
    
    .user-profile {
        display: none;
    }
    
    .btn-logout {
        margin-top: 0;
        padding: 8px 12px;
        font-size: 0;
    }
    
    .btn-logout i {
        font-size: 1.3rem;
        margin: 0;
    }
    
    .main-content {
        padding: 15px;
    }
    
    .top-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        margin-bottom: 25px;
    }
    
    .top-header h1 {
        font-size: 1.6rem;
    }
    
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-container {
        padding: 20px;
    }
    
    .leave-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .subject-chips {
        justify-content: flex-start;
    }
    
    /* Login Page */
    .login-container {
        padding: 25px 20px;
    }
    
    /* Admin Page */
    .admin-card-header {
        flex-direction: column;
        gap: 5px;
    }
    
    .action-buttons {
        flex-wrap: wrap;
    }
    
    .action-buttons button {
        flex-grow: 1;
        justify-content: center;
    }
}
