:root {
    --bg-color: #f3f4f6;
    --text-color: #1f2937;
    --card-bg: rgba(255, 255, 255, 0.8);
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --secondary: #e5e7eb;
    --border: #e5e7eb;
    --glass-border: rgba(255, 255, 255, 0.5);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

body.dark-mode {
    --bg-color: #111827;
    --text-color: #f9fafb;
    --card-bg: rgba(31, 41, 55, 0.7);
    --primary: #6366f1;
    --primary-hover: #818cf8;
    --secondary: #374151;
    --border: #374151;
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
    transition: background-color 0.3s, color 0.3s;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Glassmorphism */
.glass-effect {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

/* Utility */
.hidden {
    display: none !important;
}

input {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-color);
    color: var(--text-color);
    margin-top: 8px;
    outline: none;
}

input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

button {
    cursor: pointer;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    padding: 10px 20px;
}

.primary-btn {
    background: var(--primary);
    color: white;
    width: 100%;
    margin-top: 20px;
    padding: 12px;
}

.primary-btn:hover {
    background: var(--primary-hover);
}

.secondary-btn {
    background: var(--secondary);
    color: var(--text-color);
}

.icon-btn {
    background: transparent;
    font-size: 1.5rem;
    padding: 5px;
}

/* Auth Section */
#auth-section {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at top right, var(--primary), transparent 40%),
        radial-gradient(circle at bottom left, var(--secondary), transparent 40%);
}

.login-card {
    padding: 40px;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-card h1 {
    margin-bottom: 10px;
}

.login-card p {
    margin-bottom: 30px;
    opacity: 0.8;
}

.input-group {
    text-align: left;
    margin-bottom: 16px;
}

.error {
    color: #ef4444;
    font-size: 0.9rem;
    margin-top: 10px;
}

/* Dashboard Layout */
#dashboard-section {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: 260px;
    margin: 16px;
    display: flex;
    flex-direction: column;
    padding: 20px;
    z-index: 10;
    overflow-y: auto;
    max-height: calc(100vh - 32px);
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

.logo-area {
    margin-bottom: 40px;
    text-align: center;
}

.sidebar nav ul {
    list-style: none;
}

.sidebar nav li {
    padding: 12px 16px;
    margin-bottom: 8px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0.7;
}

.sidebar nav li:hover,
.sidebar nav li.active {
    background: var(--primary);
    color: white;
    opacity: 1;
}

.nav-section-header {
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.nav-section-header .nav-section-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-section-header:hover {
    background: var(--secondary) !important;
    color: var(--text-color) !important;
}

.expand-icon {
    transition: transform 0.3s ease;
    font-size: 0.8rem;
    margin-left: auto;
}

.expand-icon.expanded {
    transform: rotate(180deg);
}

.nav-section {
    list-style: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out;
    padding-left: 0;
}

.nav-section.expanded {
    max-height: 1000px;
    overflow-y: auto;
}

.nav-section.expanded::-webkit-scrollbar {
    width: 4px;
}

.nav-section.expanded::-webkit-scrollbar-track {
    background: transparent;
}

.nav-section.expanded::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 10px;
}

.nav-section.expanded::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.5);
}

.nav-section li {
    padding-left: 40px !important;
    font-size: 0.9rem;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-color);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
}

.user-area {
    margin-top: auto;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px 16px 16px 0;
    position: relative;
    overflow-y: auto;
}

.top-bar {
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.content-area {
    flex: 1;
}

.welcome-card {
    padding: 40px;
    text-align: center;
}

.manager-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* Mobile Navigation Elements (Hidden by default on Desktop) */
.bottom-nav,
.bottom-sheet,
.bottom-sheet-overlay {
    display: none !important;
}

/* Responsive */
@media (max-width: 992px) {
    .sidebar {
        display: none !important;
    }

    .main-content {
        padding: 20px;
        padding-bottom: 90px;
    }

    .mobile-menu-btn {
        display: none !important;
    }

    .input-row {
        grid-template-columns: 1fr !important;
    }

    /* Mobile Bottom Navigation */
    .bottom-nav {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 70px;
        background: var(--card-bg);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid var(--glass-border);
        display: flex;
        justify-content: space-around;
        align-items: center;
        z-index: 1000;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        color: var(--text-color);
        opacity: 0.6;
        transition: all 0.3s;
        flex: 1;
        cursor: pointer;
    }

    .bottom-nav-item.active {
        opacity: 1;
        color: var(--primary);
    }

    .bottom-nav-item .icon {
        font-size: 1.5rem;
    }

    .bottom-nav-item span:not(.icon) {
        font-size: 0.75rem;
        font-weight: 600;
    }

    /* Bottom Sheet */
    .bottom-sheet-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;
    }

    .bottom-sheet-overlay.active {
        display: block !important;
    }

    .bottom-sheet {
        display: flex !important;
        flex-direction: column;
        position: fixed;
        bottom: -100%;
        left: 0;
        right: 0;
        background: #111827;
        /* Darker background like English Grammar */
        border-radius: 24px 24px 0 0;
        padding: 24px;
        /* More padding */
        z-index: 1002;
        transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        max-height: 85vh;
        /* Slightly taller */
        overflow-y: auto;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .bottom-sheet.active {
        bottom: 0;
    }

    .bottom-sheet-drag-handle {
        width: 40px;
        height: 4px;
        background: var(--secondary);
        border-radius: 2px;
        margin: 0 auto 20px;
    }

    .bottom-sheet-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 24px;
        width: 100%;
    }

    .bottom-sheet-header h4 {
        font-size: 1.5rem;
        /* Larger title */
        font-weight: 700;
        color: white;
        margin: 0;
    }

    .close-btn {
        width: 40px;
        height: 40px;
        border-radius: 8px;
        /* Rounded square */
        background: white;
        color: #333;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.2rem;
        cursor: pointer;
        transition: all 0.2s;
        border: none;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        flex-shrink: 0;
    }

    .close-btn:active {
        transform: scale(0.95);
        background: #f0f0f0;
    }

    .bottom-sheet-label {
        padding: 8px 0;
        font-size: 0.8rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 1.5px;
        color: var(--primary);
        opacity: 0.9;
        margin-top: 8px;
    }

    .bottom-sheet-list {
        list-style: none;
        padding: 0;
    }

    .bottom-sheet-list li {
        padding: 16px;
        border-radius: 12px;
        display: flex;
        align-items: center;
        gap: 12px;
        cursor: pointer;
        transition: background 0.2s;
    }

    .bottom-sheet-list li:active {
        background: var(--secondary);
    }

    .bottom-sheet-list li .icon {
        font-size: 1.2rem;
    }
}