:root { 
            --primary: #3b82f6; 
            --primary-dark: #2563eb; 
            --bg: #0f172a; 
            --card: #1e293b; 
            --input-bg: #334155; 
            --text: #f8fafc; 
            --text-muted: #94a3b8; 
            --nav-bg: rgba(30, 41, 59, 0.95); 
            --nav-bg-solid: #1e293b; 
            --border-color: rgba(255,255,255,0.05); 
            --warning: #fbbf24; 
            --success: #10b981; 
            --danger: #ef4444; 
            --danger-hover: #dc2626;
            --purple: #a855f7; 
            
            /* Palette colors for employee avatars and charts */
            --palette-15: #ef4444;
            --palette-1: #f97316;
            --palette-2: #f59e0b;
            --palette-3: #84cc16;
            --palette-4: #10b981;
            --palette-5: #14b8a6;
            --palette-6: #06b6d4;
            --palette-7: #0ea5e9;
            --palette-8: #3b82f6;
            --palette-9: #6366f1;
            --palette-10: #8b5cf6;
            --palette-11: #a855f7;
            --palette-12: #d946ef;
            --palette-13: #ec4899;
            --palette-14: #f43f5e;
        }
        * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
        
        /* Global Scrollbar Styling */
        ::-webkit-scrollbar {
            width: 8px;
            height: 8px;
        }
        ::-webkit-scrollbar-track {
            background: transparent; 
        }
        ::-webkit-scrollbar-thumb {
            background: var(--input-bg); 
            border-radius: 10px;
        }
        ::-webkit-scrollbar-thumb:hover {
            background: var(--primary); 
        }

        html { background-color: var(--nav-bg-solid); overflow: hidden; height: 100%; width: 100%; position: fixed; overscroll-behavior: none; }
        body { font-family: 'Inter', sans-serif; background-color: var(--nav-bg-solid); color: var(--text); margin: 0; height: 100%; width: 100%; position: fixed; overflow: hidden; overscroll-behavior: none; display: flex; flex-direction: column; }
        
        /* HEADER & PROFILE */
        .app-header { 
            padding: env(safe-area-inset-top) 1.5rem 0 1.5rem; 
            background: var(--nav-bg); 
            backdrop-filter: blur(10px);
            display: flex; 
            justify-content: space-between; 
            align-items: center; 
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: calc(70px + env(safe-area-inset-top));
            z-index: 1000;
            border-bottom: 1px solid var(--border-color);
        }
        
        .profile-section { display: flex; align-items: center; gap: 12px; }
        .profile-img { 
            width: 45px; height: 45px; 
            border-radius: 50%; 
            background: linear-gradient(135deg, #6366f1, #3b82f6); 
            display: flex; align-items: center; justify-content: center;
            font-weight: 700; font-size: 1.1rem; color: white;
            border: 2px solid rgba(255,255,255,0.2);
            overflow: hidden;
        }
        .profile-img img { width: 100%; height: 100%; object-fit: cover; }

        .user-welcome h1 { margin: 0; font-size: 1.1rem; font-weight: 700; line-height: 1.2; }
        .user-welcome p { margin: 0; color: var(--text-muted); font-size: 0.8rem; }

        .actions-section { display: flex; align-items: center; gap: 10px; }
        .action-btn { position: relative; background: rgba(255,255,255,0.05); border: none; width: 40px; height: 40px; border-radius: 12px; color: var(--text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
        .action-btn:active { transform: scale(0.95); background: rgba(255,255,255,0.1); }
        .badge-count { position: absolute; top: -5px; right: -5px; background: #ef4444; color: white; font-size: 0.7rem; font-weight: bold; width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 2px solid var(--bg); display: none; transition: opacity 0.3s; }
        .badge-count.visible { display: block; }

        /* SERVER ICON INDICATOR */
        .server-icon-indicator {
            padding: 0 10px;
            height: 38px;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.95rem;
            margin-right: 2px;
            border: 1px solid currentColor;
            cursor: pointer;
            gap: 6px;
            transition: transform 0.2s;
        }

        /* BOTTOM NAVIGATION */
        .bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 60px;
            background: var(--nav-bg);
            backdrop-filter: blur(10px);
            border-top: 1px solid var(--border-color);
            display: flex;
            align-items: center;
            justify-content: space-around;
            z-index: 1000;
        }
        .nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-decoration: none;
            color: var(--text-muted);
            font-size: 0.75rem;
            gap: 4px;
            height: 100%;
            transition: color 0.2s;
            transform: translateY(calc(env(safe-area-inset-bottom, 0px) * 0.4));
        }
        .nav-item.active { color: var(--primary); }
        .nav-icon { font-size: 1.25rem; }
        
        @keyframes spin {
            from { transform: rotate(0deg); }
            to { transform: rotate(360deg); }
        }
        .spin-animation {
            animation: spin 1s linear infinite;
        }
        
        .main-content {
            position: absolute;
            top: calc(70px + env(safe-area-inset-top));
            bottom: 60px;
            left: 0;
            right: 0;
            width: 100%;
            background-color: var(--bg);
            display: flex;
            flex-direction: column;
            overflow-y: auto;
            overflow-x: hidden;
            -webkit-overflow-scrolling: touch;
            overscroll-behavior-y: none;
            transition: opacity 0.3s ease, transform 0.3s ease;
            display: block;
            transform: none;
        }
        .main-content.fade-out {
            opacity: 0;
            transform: translateY(10px);
            pointer-events: none;
        }

        /* SLIDING DRAWER */
        .drawer-overlay {
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.5);
            backdrop-filter: blur(4px);
            z-index: 1001;
            display: none;
            
            transition: opacity 0.3s ease;
            will-change: opacity;
        }
        .drawer-overlay.open {
            display: block;
            
        }
        .sliding-drawer {
            position: fixed;
            bottom: 0;
            left: 0; right: 0;
            background: var(--nav-bg);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border-top-left-radius: 24px;
            border-top-right-radius: 24px;
            padding: 1.5rem;
            z-index: 1002;
            transform: translateY(100%);
            transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
            will-change: transform;
            max-height: 80vh;
            overflow-y: auto;
            border-top: 1px solid var(--border-color);
        }
        .sliding-drawer.open {
            transform: translateY(0);
        }
        .drawer-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
        }
        .drawer-title {
            font-size: 1.2rem;
            font-weight: 700;
            margin: 0;
        }
        .close-drawer {
            background: var(--input-bg);
            border: none;
            color: var(--text-muted);
            width: 32px; height: 32px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: background 0.2s;
        }
        .close-drawer:active { background: var(--border-color); }
        .drawer-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 1rem;
        }
        .drawer-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            text-decoration: none;
            color: var(--text);
            gap: 8px;
            transition: opacity 0.2s;
        }
        .drawer-item:active { opacity: 0.7; }
        .drawer-item.active { color: var(--primary); }
        .drawer-item.active .drawer-icon { 
            background: var(--primary); 
            color: white; 
            box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 40%, transparent);
        }
        .drawer-icon {
            width: 48px; height: 48px;
            border-radius: 14px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.25rem;
            color: var(--primary);
            background: color-mix(in srgb, var(--primary) 15%, transparent);
            border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent);
        }
        .drawer-item span {
            font-size: 0.7rem;
            text-align: center;
            font-weight: 500;
        }

        @media (max-width: 400px) {
            .app-header { padding: 0.75rem 1rem; }
            .profile-img { width: 38px; height: 38px; font-size: 0.9rem; }
            .user-welcome h1 { font-size: 1rem; }
            .drawer-icon { width: 42px; height: 42px; font-size: 1.1rem; }
            .drawer-grid { gap: 0.8rem; }
            .drawer-item span { font-size: 0.65rem; }
        }

/* Notification Scrollbar Styles */
#notif-list::-webkit-scrollbar {
    width: 6px;
}
#notif-list::-webkit-scrollbar-track {
    background: transparent;
}
#notif-list::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 10px;
}
#notif-list::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-muted);
}
#notif-list {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

/* =========================================
   Global Toast Notification System
   ========================================= */
#global-toast-container {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    
}
.global-toast {
    background: var(--card);
    color: var(--text);
    padding: 14px 22px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    transform: translateX(120%);
    display: none;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
}
.global-toast.show {
    transform: translateX(0);
    display: block;
}

/* iOS/iPadOS specific optimizations */
@supports (-webkit-touch-callout: none) {
    .nav-item span {
        display: none;
    }
    .bottom-nav {
        height: 48px;
    }
    .main-content {
        bottom: 48px;
    }
}

.schedule-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--card);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

/* Drawer Accordion Styles */
.drawer-accordion {
    padding: 1rem;
    overflow-y: auto;
    max-height: calc(100vh - 80px);
}
.drawer-group {
    background: color-mix(in srgb, var(--card) 50%, transparent);
    border-radius: 12px;
    margin-bottom: 1rem;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.05);
}
.drawer-group-header {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
    color: var(--text);
    background: var(--card);
    transition: background 0.3s ease;
}
.drawer-group-header:hover {
    background: color-mix(in srgb, var(--primary) 15%, var(--card));
}
.drawer-group-header span i {
    margin-right: 8px;
    color: var(--primary);
}
.drawer-group-header .arrow {
    transition: transform 0.3s ease;
    font-size: 0.9em;
    color: var(--text-muted);
}
.drawer-group.active .drawer-group-header .arrow {
    transform: rotate(90deg);
}
.drawer-group-content {
    display: none;
    padding: 1rem;
    background: rgba(0,0,0,0.2);
}
.drawer-group.active .drawer-group-content {
    display: block;
    animation: slideDown 0.3s ease forwards;
}
@keyframes slideDown {
    from { display: none; transform: translateY(-10px); }
    to { display: block; transform: translateY(0); }
}


/* Drawer Tabs Styles */
.drawer-tabs {
    display: flex;
    justify-content: space-around;
    padding: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.drawer-tab {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    color: var(--text-muted);
    background: color-mix(in srgb, var(--card) 50%, transparent);
    cursor: pointer;
    transition: all 0.3s ease;
}
.drawer-tab.active {
    color: #fff;
    background: var(--primary);
    box-shadow: 0 4px 15px color-mix(in srgb, var(--primary) 40%, transparent);
    transform: scale(1.1);
}
    to { display: block; transform: scale(1) translateY(0); }
}


.drawer-tabs-wrapper {
    display: block;
    
    padding: 0;
}

.drawer-tab {
    flex-direction: column;
    width: 60px;
    height: 60px;
    border-radius: 12px;
}
.drawer-tab .tab-label {
    font-size: 0.6rem;
    margin-top: 4px;
    font-weight: 600;
}

.drawer-tab-content {
    display: none;
    padding: 1rem;
    animation: zoomInContent 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
.drawer-tab-content.active {
    display: block;
}

@keyframes zoomInContent {
    from { opacity: 0; transform: scale(0.95) translateY(-10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
