:root {
            --primary-color: #0f172a;
            --secondary-color: #2563eb;
            
            --accent-color: #10b981;
            
            --danger-color: #ef4444;
            
            --bg-color: #f1f5f9;
            
            --card-bg: #ffffff;
            
            --text-main: #334155;
            
            --text-light: #64748b;
            
            --border-color: #e2e8f0;
            
            --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
            --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
            --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
            --radius-md: 12px;
            --radius-lg: 20px;
        }

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

        body {
            font-family: 'Tajawal', sans-serif;
            background-color: var(--bg-color);
            background-image: radial-gradient(circle at top right, #e0e7ff, transparent 40%),
                radial-gradient(circle at bottom left, #dcfce7, transparent 40%);
            background-attachment: fixed;
            color: var(--text-main);
            min-height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 20px;
        }

        .container {
            background: var(--card-bg);
            border-radius: var(--radius-lg);
            box-shadow: var(--shadow-lg);
            width: 100%;
            max-width: 1000px;
            overflow: hidden;
            position: relative;
            min-height: 500px;
        }

        .view {
            display: none;
            padding: 40px;
            animation: fadeIn 0.4s ease-out forwards;
        }

        .view.active {
            display: block;
        }

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

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        
        .logos-bar {
            position: absolute;
            top: 1px;
            left: 0;
            right: 0;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 2px;
            pointer-events: none;
            z-index: 100;
            transition: opacity 0.3s ease;
        }

        .logos-bar img {
            height: 44px;
            object-fit: contain;
            opacity: 0.18;
            filter: grayscale(20%);
            transition: opacity 0.3s;
        }

        .logos-bar img:hover {
            opacity: 0.6;
            pointer-events: auto;
        }

        
        .home-logos {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 200px;
            margin-bottom: 22px;
        }

        .home-logos img {
            height: 68px;
            object-fit: contain;
            opacity: 0.88;
            filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.07));
            transition: transform 0.25s, opacity 0.25s;
        }

        .home-logos img:hover {
            transform: scale(1.15);
            opacity: 1;
        }

        .header-section {
            text-align: center;
            margin-bottom: 40px;
        }

        .header-section i {
            color: var(--secondary-color);
            margin-bottom: 15px;
        }

        .header-section h2 {
            color: var(--primary-color);
            font-weight: 800;
            font-size: 28px;
            letter-spacing: -0.5px;
        }

        .header-section p {
            color: var(--text-light);
            font-size: 16px;
            margin-top: 5px;
        }

        .home-options {
            display: flex;
            gap: 20px;
            justify-content: center;
            flex-wrap: wrap;
            margin-top: 30px;
        }

        .home-card {
            background: #f8fafc;
            border: 2px solid var(--border-color);
            border-radius: var(--radius-md);
            padding: 40px 30px;
            text-align: center;
            cursor: pointer;
            transition: all 0.3s ease;
            width: calc(50% - 10px);
            max-width: 300px;
        }

        .home-card:hover {
            border-color: var(--secondary-color);
            background: white;
            box-shadow: var(--shadow-md);
            transform: translateY(-5px);
        }

        .home-card i {
            font-size: 40px;
            color: var(--primary-color);
            margin-bottom: 15px;
            transition: color 0.3s;
        }

        .home-card:hover i {
            color: var(--secondary-color);
        }

        .home-card h3 {
            font-size: 20px;
            font-weight: 700;
            color: var(--primary-color);
        }

        .login-form {
            max-width: 400px;
            margin: 0 auto;
            background: white;
            padding: 30px;
            border-radius: var(--radius-md);
            border: 1px solid var(--border-color);
            box-shadow: var(--shadow-sm);
        }

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

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

        .input-group input,
        .input-group select {
            width: 100%;
            padding: 14px 16px;
            border: 1px solid var(--border-color);
            border-radius: 8px;
            font-size: 15px;
            font-family: 'Tajawal', sans-serif;
            transition: all 0.2s;
            background: #f8fafc;
        }

        .input-group input:focus,
        .input-group select:focus {
            outline: none;
            border-color: var(--secondary-color);
            background: white;
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
        }

        .btn-primary {
            background: var(--secondary-color);
            color: white;
            border: none;
            border-radius: 8px;
            padding: 14px 24px;
            font-size: 16px;
            font-weight: 700;
            font-family: 'Tajawal', sans-serif;
            cursor: pointer;
            width: 100%;
            transition: all 0.3s;
        }

        .btn-primary:hover {
            background: #1d4ed8;
            box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
        }

        .back-btn {
            background: none;
            border: none;
            color: var(--text-light);
            font-family: 'Tajawal', sans-serif;
            font-size: 15px;
            font-weight: 600;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 20px;
        }

        .forgot-link {
            display: block;
            text-align: center;
            margin-top: 15px;
            color: var(--secondary-color);
            text-decoration: none;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
        }

        .dashboard-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: var(--primary-color);
            color: white;
            padding: 20px 25px;
            border-radius: var(--radius-md);
            margin-bottom: 25px;
        }

        .logout-btn {
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.2);
            color: white;
            padding: 8px 16px;
            border-radius: 6px;
            cursor: pointer;
            font-family: 'Tajawal', sans-serif;
            font-size: 13px;
        }

        .service-selector {
            display: flex;
            gap: 15px;
            margin-bottom: 30px;
        }

        .service-selector .input-group {
            margin-bottom: 0;
            flex: 1;
        }

        .service-selector button {
            width: auto;
            padding: 0 30px;
            align-self: flex-end;
            height: 50px;
        }

        table {
            width: 100%;
            border-collapse: separate;
            border-spacing: 0;
            margin-top: 10px;
            border-radius: 8px;
            overflow: hidden;
            border: 1px solid var(--border-color);
        }

        th,
        td {
            padding: 14px;
            text-align: center;
            border-bottom: 1px solid var(--border-color);
        }

        th {
            background-color: #f8fafc;
            font-weight: 700;
            color: var(--primary-color);
        }

        td {
            background-color: white;
        }

        .course-name {
            font-weight: bold;
            color: var(--primary-color);
        }

        .day-cell {
            font-weight: bold;
            width: 100px;
            background: #fafafa;
        }

        .alert {
            padding: 12px 16px;
            border-radius: 8px;
            margin-top: 15px;
            font-size: 14px;
            font-weight: 600;
            text-align: center;
            display: none;
        }

        .alert-error {
            background: #fef2f2;
            color: var(--danger-color);
            border: 1px solid #fecaca;
        }

        .info-card {
            background: white;
            border: 1px solid var(--border-color);
            border-radius: var(--radius-md);
            padding: 30px;
            text-align: center;
            box-shadow: var(--shadow-sm);
        }

        .info-card h4 {
            color: var(--primary-color);
            font-size: 18px;
            margin-bottom: 15px;
        }

        .info-card .val {
            font-size: 42px;
            font-weight: 800;
            color: var(--secondary-color);
            direction: ltr;
        }

        .admin-tabs {
            display: flex;
            gap: 10px;
            margin-bottom: 20px;
            border-bottom: 2px solid var(--border-color);
            padding-bottom: 10px;
        }

        .admin-tab {
            padding: 10px 20px;
            color: var(--text-light);
            font-weight: 600;
            cursor: pointer;
            border-radius: 8px;
        }

        .admin-tab.active {
            color: white;
            background: var(--primary-color);
        }

        .admin-page-content {
            display: none;
            animation: fadeIn 0.3s;
        }

        .admin-page-content.active {
            display: block;
        }

        .admin-card {
            background: white;
            border-radius: var(--radius-md);
            border: 1px solid var(--border-color);
            overflow: hidden;
            box-shadow: var(--shadow-sm);
            margin-bottom: 20px;
        }

        .admin-card-title {
            font-size: 16px;
            font-weight: 700;
            color: var(--primary-color);
            background: #f8fafc;
            padding: 15px 20px;
            border-bottom: 1px solid var(--border-color);
        }

        .admin-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 14px;
        }

        .admin-table th {
            background: #f8fafc;
            color: var(--primary-color);
            padding: 12px;
            text-align: center;
            border-bottom: 1px solid var(--border-color);
        }

        .admin-table td {
            padding: 12px;
            text-align: center;
            border-bottom: 1px solid var(--border-color);
        }

        .admin-table tr:hover td {
            background: #f1f5f9;
        }

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

        .badge {
            display: inline-block;
            padding: 5px 12px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 700;
        }

        .badge-green {
            background: #dcfce7;
            color: #166534;
        }

        .badge-red {
            background: #fee2e2;
            color: #991b1b;
        }

        .badge-blue {
            background: #dbeafe;
            color: #1e40af;
        }

        .action-btn {
            padding: 8px 16px;
            border: none;
            border-radius: 6px;
            font-size: 13px;
            font-weight: bold;
            cursor: pointer;
            font-family: 'Tajawal', sans-serif;
            transition: opacity 0.2s;
        }

        .action-btn:hover {
            opacity: 0.8;
        }

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

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

        .course-link {
            color: var(--secondary-color);
            text-decoration: none;
            font-weight: bold;
        }

        .course-link:hover {
            text-decoration: underline;
        }

        .add-row {
            display: flex;
            gap: 15px;
            align-items: flex-end;
            background: #f8fafc;
            padding: 20px;
            border-radius: var(--radius-md);
            border: 1px solid var(--border-color);
            margin-bottom: 25px;
            flex-wrap: wrap;
        }

        .add-row .input-group {
            margin-bottom: 0;
            flex: 1;
            min-width: 150px;
        }

        .loader-container {
            text-align: center;
            padding: 40px;
            color: var(--text-light);
        }

        #forgotModal {
            display: none;
            background: #f8fafc;
            border: 1px solid var(--border-color);
            border-radius: var(--radius-md);
            padding: 20px;
            margin-top: 20px;
        }

        /* ===== Google Sidebar Styles ===== */

        .admin-dashboard-view {
            padding: 0 !important;
        }

        .admin-dashboard-view .dashboard-header {
            border-radius: 0;
            margin-bottom: 0;
        }

        .admin-layout {
            display: flex;
            min-height: 500px;
        }

        .google-sidebar {
            width: 240px;
            min-width: 240px;
            background: #f8fafc;
            border-left: 1px solid var(--border-color);
            padding: 18px 14px;
            display: flex;
            flex-direction: column;
            gap: 14px;
            order: 2;
            overflow-y: auto;
            max-height: calc(100vh - 200px);
        }

        .admin-main {
            flex: 1;
            padding: 25px;
            order: 1;
            overflow: hidden;
        }

        .gs-header {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 14px;
            font-weight: 800;
            color: var(--primary-color);
            padding-bottom: 12px;
            border-bottom: 2px solid var(--border-color);
        }

        .gs-header i { font-size: 18px; }

        .gs-state { display: flex; flex-direction: column; gap: 12px; }

        .gs-empty-icon {
            text-align: center;
            font-size: 40px;
            color: #cbd5e1;
            margin: 8px 0;
        }

        .gs-empty-text {
            text-align: center;
            font-size: 13px;
            color: var(--text-light);
        }

        .gs-connect-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            background: white;
            border: 1.5px solid #dadce0;
            border-radius: 8px;
            padding: 10px 14px;
            font-size: 13px;
            font-weight: 700;
            font-family: 'Tajawal', sans-serif;
            cursor: pointer;
            color: #3c4043;
            transition: all 0.2s;
            box-shadow: 0 1px 3px rgba(0,0,0,0.08);
            width: 100%;
        }

        .gs-connect-btn:hover {
            background: #f8f9fa;
            box-shadow: 0 2px 6px rgba(0,0,0,0.12);
            border-color: #bdc1c6;
        }

        .gs-user-card {
            display: flex;
            align-items: center;
            gap: 10px;
            background: white;
            border: 1px solid var(--border-color);
            border-radius: 10px;
            padding: 10px 12px;
            box-shadow: var(--shadow-sm);
        }

        .gs-avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            object-fit: cover;
            border: 2px solid #e2e8f0;
            flex-shrink: 0;
        }

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

        .gs-user-info strong {
            font-size: 13px;
            color: var(--primary-color);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .gs-user-info span {
            font-size: 11px;
            color: var(--text-light);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .gs-actions { display: flex; gap: 6px; }

        .gs-switch-btn, .gs-disconnect-btn {
            flex: 1;
            border: none;
            border-radius: 7px;
            padding: 8px 6px;
            font-size: 11.5px;
            font-weight: 700;
            font-family: 'Tajawal', sans-serif;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 5px;
            transition: all 0.2s;
        }

        .gs-switch-btn { background: #dbeafe; color: #1e40af; }
        .gs-switch-btn:hover { background: #bfdbfe; }
        .gs-disconnect-btn { background: #fee2e2; color: #991b1b; }
        .gs-disconnect-btn:hover { background: #fecaca; }

        .gs-files-section {
            background: white;
            border: 1px solid var(--border-color);
            border-radius: 10px;
            overflow: hidden;
            box-shadow: var(--shadow-sm);
        }

        .gs-files-header {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 10px 12px;
            background: #f8fafc;
            border-bottom: 1px solid var(--border-color);
            font-size: 13px;
            font-weight: 700;
            color: var(--primary-color);
        }

        .gs-files-header span { flex: 1; }

        .gs-refresh-btn {
            background: none;
            border: none;
            cursor: pointer;
            color: var(--text-light);
            font-size: 12px;
            padding: 2px 5px;
            border-radius: 4px;
            transition: all 0.2s;
        }

        .gs-refresh-btn:hover { background: #e2e8f0; color: var(--primary-color); }

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

        .gs-refresh-btn.spinning i { animation: spin 0.8s linear infinite; }

        .gs-files-list {
            padding: 8px;
            max-height: 280px;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 5px;
        }

        .gs-loading {
            text-align: center;
            padding: 16px;
            color: var(--text-light);
            font-size: 16px;
        }

        .gs-file-item {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 10px;
            border-radius: 7px;
            cursor: pointer;
            transition: background 0.15s;
            text-decoration: none;
            color: inherit;
        }

        .gs-file-item:hover { background: #f1f5f9; }
        .gs-file-item i { color: #0F9D58; font-size: 14px; flex-shrink: 0; }

        .gs-file-name {
            font-size: 12px;
            color: var(--primary-color);
            font-weight: 600;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            flex: 1;
        }

        .gs-file-empty {
            text-align: center;
            padding: 14px;
            font-size: 12px;
            color: var(--text-light);
        }

        .gs-scope-notice {
            background: #fef3c7;
            border: 1px solid #fcd34d;
            border-radius: 8px;
            padding: 10px 12px;
            font-size: 12px;
            color: #92400e;
            line-height: 1.5;
            text-align: center;
        }

        /* ===== End Google Sidebar ===== */

        @media (max-width: 600px) {
            .admin-layout { flex-direction: column; }
            .google-sidebar { width: 100%; min-width: unset; order: 2; border-left: none; border-top: 1px solid var(--border-color); max-height: none; }
            .admin-main { order: 1; padding: 15px; }
        }

        @media (max-width: 600px) {
            .view {
                padding: 20px;
            }

            .home-card {
                width: 100%;
                max-width: none;
            }

            .add-row,
            .service-selector {
                flex-direction: column;
            }

            .service-selector button,
            .add-row button {
                width: 100%;
            }
        }