:root {
    --primary-color: #2740cc;
    --primary-dark: #1e30a0;
    --secondary-color: #4f46e5;
    --accent-color: #8b5cf6;
    --text-main: #1e293b;
    --text-dim: #64748b;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shine: rgba(255, 255, 255, 0.8);
    --sidebar-bg: rgba(255, 255, 255, 0.85);
}

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

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

/* Dynamic Background */
.background-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background: radial-gradient(circle at 10% 20%, rgba(39, 64, 204, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(39, 64, 204, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, #ffffff 0%, #f1f5f9 100%);
    filter: blur(60px);
}

.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* Glassmorphism Common Class */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
    border-radius: 20px;
}

/* Sidebar */
/* Sidebar - Responsive Logic */
.sidebar {
    width: 280px;
    height: 100vh;
    position: fixed;
    top: 0;
    right: 0;
    /* RTL default */
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    padding: 30px 20px;
    z-index: 1000;
    transform: translateX(100%);
    /* Hidden on Mobile by default */
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.1);
}

/* Desktop: Always Show Sidebar */
/* Desktop: Always Show Sidebar */
@media (min-width: 900px) {
    .sidebar {
        position: sticky;
        /* Or static in a flex container */
        transform: none !important;
        /* Force visibility */
        box-shadow: none;
        border-left: 1px solid rgba(0, 0, 0, 0.05);
        /* Separator */
        height: 100vh;
        z-index: 1000;
        width: 280px;
        display: flex !important;
    }
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 40px;
}

.logo i {
    color: var(--secondary-color);
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex-grow: 1;
}

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

.nav-item:hover,
.nav-item.active {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transform: translateX(-5px);
}

.nav-item i {
    width: 25px;
}

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

.avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

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

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

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

/* Main Content */
.main-content {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.header {
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
}

.welcome-text h1 {
    font-size: 1.8rem;
    margin-bottom: 5px;
    color: var(--text-main);
}

.welcome-text p {
    color: var(--text-dim);
}

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

.shift-badge {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.logout-btn {
    background: transparent;
    border: 1px solid #fee2e2;
    color: #ef4444;
    padding: 8px 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.3s;
    font-family: 'Cairo', sans-serif;
    text-decoration: none;
    display: inline-block;
}

.logout-btn:hover {
    background: #fef2f2;
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.card {
    padding: 30px;
    border-radius: 24px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    background: white;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(39, 64, 204, 0.1);
}

.icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    background: rgba(39, 64, 204, 0.1);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.icon-wrapper.secondary {
    background: rgba(236, 72, 153, 0.1);
    color: #ec4899;
}

.icon-wrapper.accent {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.card h3 {
    font-size: 1.4rem;
    color: var(--text-main);
}

.card p {
    color: var(--text-dim);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Primary Card Special */
.card.primary {
    background: linear-gradient(135deg, white, #f8fafc);
    border: 1px solid rgba(39, 64, 204, 0.2);
}

.btn {
    padding: 10px 25px;
    border-radius: 12px;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.3s;
    font-weight: 600;
    font-family: 'Cairo', sans-serif;
    text-align: center;
    display: inline-block;
    text-decoration: none;
}

.btn-glow {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 5px 15px rgba(39, 64, 204, 0.3);
    margin-top: auto;
    width: 100%;
}

.btn-glow:hover {
    box-shadow: 0 8px 25px rgba(39, 64, 204, 0.4);
    transform: scale(1.02);
}

.btn-outline {
    background: white;
    border: 1px solid var(--text-dim);
    color: var(--text-main);
}

.btn-outline:hover {
    background: #f1f5f9;
}

/* Info Panel */
.info-panel {
    grid-column: 1 / -1;
    padding: 25px;
    margin-top: 20px;
    background: white;
}

.info-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    color: #10b981;
}

.info-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.info-body p {
    color: var(--text-dim);
    max-width: 600px;
}

.actions-row {
    display: flex;
    gap: 10px;
}

/* Auth Pages & Forms */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 450px;
    padding: 40px;
    text-align: center;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
}

.auth-card h1 {
    margin-bottom: 10px;
    color: var(--primary-color);
}

.auth-card .lead {
    margin-bottom: 30px;
    color: var(--text-dim);
}

.form-group {
    margin-bottom: 20px;
    text-align: right;
}

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

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
    transition: 0.3s;
}

.form-group input:focus {
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(39, 64, 204, 0.1);
}

.form-actions {
    margin-top: 30px;
}

.platform-btn {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: none;
    background: var(--primary-color);
    color: white;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.platform-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(39, 64, 204, 0.2);
}

/* Activity Page */
.activity-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 30px;
    text-align: right;
}

.activity-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 15px;
    border-radius: 15px;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.activity-card:hover {
    background: white;
    border-color: var(--primary-color);
}

.activity-card.selected {
    background: rgba(39, 64, 204, 0.05);
    border-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: bold;
}

.activity-card input {
    accent-color: var(--primary-color);
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.alert.error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.alert.success {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

/* Simple Nav */
.simple-nav {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 15px;
    font-size: 0.9rem;
}

.simple-nav a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

/* Responsiveness */
/* Responsiveness */
/* Responsiveness */
/* Responsiveness */
@media (max-width: 1024px) {

    /* Strictly below desktop breakpoint */
    .dashboard-container {
        flex-direction: column;
    }

    /* Mobile Sidebar Logic */
    .sidebar {
        width: 280px;
        height: 100vh;
        position: fixed;
        top: 0;
        right: 0;
        /* RTL default */
        background: var(--sidebar-bg);
        display: flex;
        flex-direction: column;
        padding: 30px 20px;
        z-index: 2000;
        transform: translateX(100%);
        /* Hidden */
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .sidebar.active {
        transform: translateX(0);
        /* Show on toggle */
    }

    .nav-links {
        display: flex;
        /* Always flex in column mode inside sidebar */
        overflow-x: visible;
        width: 100%;
        position: static;
        padding: 0;
        background: transparent;
        box-shadow: none;
    }

    .logo {
        margin-bottom: 20px;
    }

    .main-content {
        padding: 15px;
        padding-bottom: 80px;
    }

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

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100000 !important;
    /* Higher than brute-force mobile cart (99999) */
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    opacity: 1;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal.show .modal-content {
    transform: translateY(0);
}

/* Status Badges */
.shift-badge.success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.shift-badge.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.badge-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    position: absolute;
    top: 10px;
    left: 10px;
    box-shadow: 0 0 0 2px white;
}

.active-shift {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

/* Action Buttons Grid (Equal Sizing) */
.action-buttons-grid {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.big-btn.primary-btn {
    flex: 1;
    background: white;
    color: var(--primary-color);
    text-align: center;
    justify-content: center;
}

.big-btn.secondary-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-align: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.big-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Menu Toggle Button (Hamburger) */
.menu-toggle {
    background: white;
    border: 1px solid #e2e8f0;
    font-size: 2.2rem;
    /* Thicker/Wider Lines */
    color: var(--primary-color);
    /* Blue Color */
    cursor: pointer;
    padding: 5px 12px;
    border-radius: 12px;
    transition: 0.3s;
    display: none;
    /* Hidden on Desktop */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.menu-toggle:hover {
    background: #f8fafc;
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

@media (max-width: 1024px) {
    .menu-toggle {
        display: block;
        /* Show on Tablet/Mobile */
    }

    /* Ensure Sidebar has Backdrop when active */
    .sidebar.active::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        /* Full screen width to cover right side */
        height: 100vh;
        background: rgba(0, 0, 0, 0.3);
        z-index: -1;
        backdrop-filter: blur(4px);
    }
}