:root {
            --primary:          #1a6ff5;
            --primary-dark:     #1558d6;
            --primary-light:    #5a9bff;
            --secondary:        #ff6b1a;
            --secondary-dark:   #e55a0a;
            --accent:           #ff6b1a;
            --accent-dark:      #e55a0a;

            --success:          #10b981;
            --success-light:    #d1fae5;
            --success-dark:     #065f46;
            --danger:           #ef4444;
            --danger-light:     #fee2e2;
            --warning:          #f59e0b;
            --warning-light:    #fef3c7;
            --info:             #3b82f6;

            --white:            #ffffff;
            --bg:               #f5f8ff;
            --card-bg:          #ffffff;
            --border:           #e0eaff;
            --border-focus:     #1a6ff5;
            --text-primary:     #0d1b3e;
            --text-secondary:   #1e3a6e;
            --text-muted:       #6b84aa;
            --text-placeholder: #b0c4de;

            --grad-primary:     #1a6ff5;
            --grad-hero:        #f0f5ff;
            --grad-card-header: #1a6ff5;
            --grad-avatar:      #ff6b1a;
            --grad-stat:        #1a6ff5;

            --shadow-sm:        0 2px 8px rgba(26,111,245,0.08);
            --shadow-md:        0 4px 20px rgba(26,111,245,0.10);
            --shadow-lg:        0 8px 40px rgba(26,111,245,0.13);
            --shadow-primary:   0 6px 20px rgba(26,111,245,0.30);
            --shadow-focus:     0 0 0 3px rgba(26,111,245,0.15);

            --radius-sm:        10px;
            --radius-md:        14px;
            --radius-lg:        18px;
            --radius-xl:        24px;
            --radius-full:      9999px;

            --transition-fast:  all 0.15s ease;
            --transition-base:  all 0.25s ease;
            --transition-slow:  all 0.4s ease;

            --font-base:        'Inter', 'Segoe UI', system-ui, sans-serif;
            --font-size-xs:     0.75rem;
            --font-size-sm:     0.85rem;
            --font-size-base:   1rem;
            --font-size-lg:     1.125rem;
            --font-size-xl:     1.25rem;
        }

        *, *::before, *::after { box-sizing: border-box; }
        html { scroll-behavior: smooth; }

        body {
            background: #f0f5ff;
            min-height: 100vh;
            font-family: var(--font-base);
            font-size: var(--font-size-base);
            color: var(--text-primary);
            line-height: 1.6;
        }

        .portal-navbar {
            background: #ffffff;
            border-bottom: 1.5px solid #e0eaff;
            padding: 0.75rem 0;
            position: sticky;
            top: 0;
            z-index: 1000;
            box-shadow: 0 2px 12px rgba(26,111,245,0.07);
        }

        .portal-navbar .navbar-brand {
            font-weight: 800;
            font-size: 1.35rem;
            letter-spacing: -0.5px;
            color: var(--primary) !important;
            text-decoration: none;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .portal-navbar .navbar-brand .brand-icon {
            width: 36px;
            height: 36px;
            background: #fff0e8;
            border: 1.5px solid #ffd0b0;
            border-radius: var(--radius-sm);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1rem;
            color: var(--accent);
        }

        .portal-navbar .nav-link {
            color: var(--text-secondary) !important;
            font-weight: 500;
            font-size: var(--font-size-sm);
            padding: 0.45rem 0.9rem !important;
            border-radius: var(--radius-full);
            transition: var(--transition-fast);
            text-decoration: none;
        }

        .portal-navbar .nav-link:hover {
            color: var(--primary) !important;
            background: #eef3ff;
        }

        .portal-navbar .nav-link.active {
            background: #eef3ff;
            color: var(--primary) !important;
            font-weight: 600;
        }

        .portal-navbar .nav-link i { margin-right: 5px; font-size: 0.8rem; }

        .navbar-user-pill {
            background: #fff0e8;
            border: 1.5px solid #ffd0b0;
            border-radius: var(--radius-full);
            padding: 0.35rem 0.9rem;
            color: var(--accent);
            font-size: var(--font-size-sm);
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .navbar-user-pill .user-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: var(--success);
            flex-shrink: 0;
        }

        .page-wrapper {
            padding: 2rem 0 4rem;
            min-height: calc(100vh - 70px);
        }

        .main-card {
            background: var(--card-bg);
            border-radius: var(--radius-xl);
            box-shadow: var(--shadow-lg);
            border: 1.5px solid #e0eaff;
            overflow: hidden;
        }

        .card-header-gradient {
            background: #1a6ff5;
            color: #ffffff;
            padding: 2.5rem 2rem;
            text-align: center;
            position: relative;
            overflow: hidden;
        }

        .card-header-gradient::before {
            content: '';
            position: absolute;
            top: -50px; right: -50px;
            width: 140px; height: 140px;
            border-radius: 50%;
            background: rgba(255,255,255,0.07);
        }

        .card-header-gradient::after {
            content: '';
            position: absolute;
            bottom: -40px; left: -40px;
            width: 120px; height: 120px;
            border-radius: 50%;
            background: rgba(255,107,26,0.15);
        }

        .card-header-gradient h2 {
            font-weight: 800;
            margin: 0;
            font-size: 1.6rem;
            position: relative;
            z-index: 1;
        }

        .card-header-gradient p {
            opacity: 0.85;
            margin: 0.4rem 0 0;
            font-size: var(--font-size-sm);
            position: relative;
            z-index: 1;
        }

        .card-body-padded { padding: 2rem; }

        .portal-card {
            background: var(--card-bg);
            border-radius: var(--radius-lg);
            border: 1.5px solid #e0eaff;
            box-shadow: var(--shadow-md);
            transition: var(--transition-base);
        }

        .portal-card:hover {
            transform: translateY(-3px);
            box-shadow: 0 16px 40px rgba(26,111,245,0.13);
            border-color: #c0d4ff;
        }

        .header-icon {
            width: 68px;
            height: 68px;
            background: rgba(255,255,255,0.18);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 1rem;
            font-size: 1.7rem;
            position: relative;
            z-index: 1;
            border: 2.5px solid rgba(255,255,255,0.4);
        }

        label {
            font-weight: 600;
            color: var(--text-secondary);
            font-size: var(--font-size-sm);
            margin-bottom: 0.4rem;
            display: block;
        }

        .form-control, .form-select {
            border-radius: var(--radius-sm);
            border: 2px solid #e0eaff;
            padding: 0.75rem 1rem;
            font-size: var(--font-size-base);
            color: var(--text-primary);
            background: #f8fbff;
            transition: var(--transition-fast);
            width: 100%;
        }

        .form-control:focus, .form-select:focus {
            border-color: #1a6ff5;
            background: #ffffff;
            box-shadow: 0 0 0 3px rgba(26,111,245,0.12);
            outline: none;
        }

        .form-control::placeholder { color: var(--text-placeholder); }

        .form-control[readonly] {
            background: #f0f5ff;
            color: var(--text-muted);
            cursor: not-allowed;
            border-color: #e0eaff;
        }

        .form-control.is-invalid { border-color: var(--danger); }
        .form-control.is-valid   { border-color: var(--success); }

        .form-text {
            color: var(--text-placeholder);
            font-size: var(--font-size-xs);
            margin-top: 0.3rem;
        }

        .field-error {
            color: var(--danger);
            font-size: var(--font-size-xs);
            margin-top: 0.3rem;
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .input-group .input-group-text {
            border: 2px solid #e0eaff;
            border-left: none;
            background: #f0f5ff;
            border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
            color: var(--text-muted);
        }

        .input-group .form-control { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }

        .otp-input {
            font-size: 2.2rem !important;
            text-align: center;
            letter-spacing: 0.6rem;
            font-weight: 800;
            border-radius: var(--radius-md) !important;
            padding: 1rem !important;
            border-color: #c0d4ff;
        }

        .password-strength-bar {
            height: 5px;
            border-radius: 3px;
            background: #e0eaff;
            margin-top: 6px;
            overflow: hidden;
        }

        .password-strength-fill {
            height: 100%;
            border-radius: 3px;
            width: 0%;
            transition: width 0.4s, background 0.4s;
        }

        .btn {
            font-weight: 700;
            border-radius: var(--radius-sm);
            transition: var(--transition-base);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            letter-spacing: 0.2px;
        }

        .btn-primary {
            background: #ff6b1a;
            border: none;
            color: #ffffff;
            padding: 0.8rem 2rem;
        }

        .btn-primary:hover, .btn-primary:focus {
            background: #e55a0a;
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(255,107,26,0.35);
            color: #ffffff;
        }

        .btn-primary:active {
            transform: translateY(0);
            background: #cc4f08;
        }

        .btn-primary:disabled {
            opacity: 0.60;
            transform: none;
            box-shadow: none;
        }

        .btn-outline-secondary {
            border: 2px solid #c0d4ff;
            color: var(--primary);
            background: transparent;
            padding: 0.65rem 1.5rem;
        }

        .btn-outline-secondary:hover {
            background: #eef3ff;
            border-color: #1a6ff5;
            color: var(--primary-dark);
        }

        .btn-outline-danger {
            border: 2px solid var(--danger);
            color: var(--danger);
            background: transparent;
        }

        .btn-outline-danger:hover {
            background: var(--danger-light);
            color: var(--danger);
        }

        .btn-blue {
            background: #1a6ff5;
            border: none;
            color: #ffffff;
            padding: 0.8rem 2rem;
            font-weight: 700;
            border-radius: var(--radius-sm);
            display: inline-flex;
            align-items: center;
            gap: 6px;
            transition: var(--transition-base);
        }

        .btn-blue:hover {
            background: #1558d6;
            transform: translateY(-2px);
            box-shadow: var(--shadow-primary);
            color: #ffffff;
        }

        .btn-sm { padding: 0.4rem 1rem; font-size: var(--font-size-sm); }
        .btn-lg { padding: 0.9rem 2.5rem; font-size: var(--font-size-lg); }

        .alert {
            border-radius: var(--radius-md);
            border: none;
            font-weight: 500;
            font-size: var(--font-size-sm);
            display: flex;
            align-items: flex-start;
            gap: 0.6rem;
            padding: 0.9rem 1.15rem;
        }

        .alert-success  { background: #d1fae5; color: #065f46; border-left: 4px solid #10b981; }
        .alert-danger   { background: #fee2e2; color: #b91c1c; border-left: 4px solid #ef4444; }
        .alert-warning  { background: #fff7ed; color: #c2410c; border-left: 4px solid #ff6b1a; }
        .alert-info     { background: #eef3ff; color: #1a6ff5; border-left: 4px solid #1a6ff5; }

        .alert-dismissible .btn-close { padding: 0.85rem 1.1rem; }

        .step-indicator {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 0;
            margin-bottom: 1.75rem;
        }

        .step-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 6px;
            flex: 1;
            max-width: 80px;
            position: relative;
        }

        .step-item:not(:last-child)::after {
            content: '';
            position: absolute;
            top: 14px; left: 50%;
            width: 100%; height: 2px;
            background: #e0eaff;
            z-index: 0;
        }

        .step-item.done:not(:last-child)::after  { background: var(--success); }
        .step-item.active:not(:last-child)::after { background: #e0eaff; }

        .step-bubble {
            width: 30px; height: 30px;
            border-radius: 50%;
            background: #eef3ff;
            color: var(--text-muted);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.7rem;
            font-weight: 700;
            position: relative;
            z-index: 1;
            transition: var(--transition-base);
            border: 2px solid #c0d4ff;
        }

        .step-item.done   .step-bubble { background: var(--success); border-color: var(--success); color: white; }
        .step-item.active .step-bubble { background: #1a6ff5; border-color: #1a6ff5; color: white; box-shadow: 0 0 0 4px rgba(26,111,245,0.18); }

        .step-label { font-size: 0.65rem; font-weight: 600; color: var(--text-muted); text-align: center; letter-spacing: 0.3px; }
        .step-item.active .step-label { color: var(--primary); }
        .step-item.done   .step-label { color: var(--success-dark); }

        .badge-course {
            background: #ff6b1a;
            color: #ffffff;
            padding: 0.35rem 1rem;
            border-radius: var(--radius-full);
            font-size: var(--font-size-sm);
            font-weight: 700;
            display: inline-block;
        }

        .badge-verified {
            background: #d1fae5;
            color: #065f46;
            padding: 0.3rem 0.8rem;
            border-radius: var(--radius-full);
            font-size: var(--font-size-xs);
            font-weight: 700;
            display: inline-flex;
            align-items: center;
            gap: 4px;
        }

        .badge-pending {
            background: #fff0e8;
            color: #c2410c;
            padding: 0.3rem 0.8rem;
            border-radius: var(--radius-full);
            font-size: var(--font-size-xs);
            font-weight: 700;
        }

        .user-avatar {
            width: 80px; height: 80px;
            background: #ff6b1a;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 2rem;
            color: white;
            font-weight: 800;
            flex-shrink: 0;
            border: 3px solid #ffd0b0;
            box-shadow: 0 4px 16px rgba(255,107,26,0.25);
        }

        .user-avatar-sm { width: 42px; height: 42px; font-size: 1rem; flex-shrink: 0; }

        .stat-card {
            background: #1a6ff5;
            color: white;
            border-radius: var(--radius-lg);
            padding: 1.75rem 1.5rem;
            text-align: center;
            position: relative;
            overflow: hidden;
        }

        .stat-card::before {
            content: '';
            position: absolute;
            top: -20px; right: -20px;
            width: 90px; height: 90px;
            border-radius: 50%;
            background: rgba(255,255,255,0.08);
        }

        .stat-card::after {
            content: '';
            position: absolute;
            bottom: -25px; left: -15px;
            width: 80px; height: 80px;
            border-radius: 50%;
            background: rgba(255,107,26,0.18);
        }

        .stat-number { font-size: 2.8rem; font-weight: 800; line-height: 1; position: relative; z-index: 1; }
        .stat-label  { font-size: var(--font-size-sm); opacity: 0.88; font-weight: 500; position: relative; z-index: 1; }

        .info-row {
            display: flex;
            align-items: center;
            padding: 0.85rem 0;
            border-bottom: 1px solid #f0f5ff;
        }

        .info-row:last-child { border-bottom: none; }

        .info-label {
            min-width: 145px;
            font-weight: 700;
            color: var(--text-muted);
            font-size: var(--font-size-xs);
            text-transform: uppercase;
            letter-spacing: 0.6px;
        }

        .info-value { color: var(--text-primary); font-weight: 500; }

        .welcome-banner {
            background: #ffffff;
            border-radius: var(--radius-xl);
            box-shadow: var(--shadow-lg);
            border: 1.5px solid #e0eaff;
            padding: 1.75rem 2rem;
        }

        .tips-list { list-style: none; padding: 0; margin: 0; }
        .tips-list li {
            padding: 0.5rem 0;
            font-size: var(--font-size-sm);
            color: var(--text-muted);
            display: flex;
            align-items: center;
            gap: 0.6rem;
        }
        .tips-list li i { width: 16px; text-align: center; color: #ff6b1a; }

        .email-chip {
            background: #f0f5ff;
            border: 1.5px solid #c0d4ff;
            border-radius: var(--radius-md);
            padding: 0.85rem 1rem;
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }

        .email-chip-icon {
            width: 38px; height: 38px;
            background: #1a6ff5;
            border-radius: var(--radius-sm);
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 0.9rem;
            flex-shrink: 0;
        }

        .or-divider { position: relative; text-align: center; margin: 1.25rem 0; }
        .or-divider::before {
            content: '';
            position: absolute;
            top: 50%; left: 0; right: 0;
            height: 1px;
            background: #e0eaff;
        }

        .or-divider span {
            background: white;
            padding: 0 0.75rem;
            position: relative;
            font-size: var(--font-size-xs);
            color: var(--text-muted);
            font-weight: 600;
            letter-spacing: 0.5px;
        }

        .btn-spinner {
            display: none;
            width: 16px; height: 16px;
            border: 2px solid rgba(255,255,255,0.4);
            border-top-color: white;
            border-radius: 50%;
            animation: spin 0.7s linear infinite;
        }

        @keyframes spin { to { transform: rotate(360deg); } }

        @media (max-width: 576px) {
            .card-body-padded { padding: 1.5rem; }
            .card-header-gradient { padding: 1.75rem 1.5rem; }
            .card-header-gradient h2 { font-size: 1.3rem; }
            .welcome-banner { padding: 1.25rem; }
            .user-avatar { width: 60px; height: 60px; font-size: 1.5rem; }
            .otp-input { font-size: 1.8rem !important; letter-spacing: 0.4rem; }
            .step-label { display: none; }
        }

        .text-gradient {
            background: linear-gradient(90deg, #1a6ff5, #ff6b1a);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .bg-soft-primary { background: #eef3ff; }
        .bg-soft-success { background: #d1fae5; }
        .bg-soft-orange  { background: #fff0e8; }
        .rounded-portal  { border-radius: var(--radius-lg); }
        .shadow-portal   { box-shadow: var(--shadow-md); }

        .table { width: 100%; border-collapse: collapse; font-size: var(--font-size-sm); }

        .table th {
            font-weight: 700;
            color: var(--text-muted);
            font-size: var(--font-size-xs);
            text-transform: uppercase;
            letter-spacing: 0.6px;
            padding: 0.75rem 1rem;
            border-bottom: 2px solid #e0eaff;
            background: #f8fbff;
        }

        .table td {
            padding: 0.9rem 1rem;
            border-bottom: 1px solid #f0f5ff;
            color: var(--text-primary);
            vertical-align: middle;
        }

        .table tbody tr:last-child td { border-bottom: none; }
        .table tbody tr:hover { background: #f8fbff; }

        @media (max-width: 576px) {
            .table th, .table td { padding: 0.6rem 0.5rem; font-size: var(--font-size-xs); }
            .welcome-banner .d-flex { flex-wrap: wrap; gap: 1rem; }
            .welcome-banner .ms-auto { width: 100%; }
        }

        @media (max-width: 576px) {
            .portal-navbar .nav-link { padding: 0.3rem 0.4rem !important; font-size: 0.7rem; }
            .portal-navbar .nav-link i { margin-right: 2px; font-size: 0.7rem; }
            .portal-navbar .navbar-brand { font-size: 1rem; }
            .portal-navbar .navbar-brand .brand-icon { width: 28px; height: 28px; font-size: 0.8rem; }
        }

        .learn-layout {
            display: grid;
            grid-template-columns: 300px 1fr;
            gap: 0;
            min-height: calc(100vh - 70px);
            margin: 0 -12px;
        }

        .learn-sidebar {
            background: #ffffff;
            border-right: 1.5px solid #e0eaff;
            display: flex;
            flex-direction: column;
            overflow-y: auto;
            max-height: calc(100vh - 70px);
            position: sticky;
            top: 70px;
        }

        .sidebar-header {
            padding: 1.25rem;
            border-bottom: 1.5px solid #e0eaff;
            background: #f8fbff;
        }

        .sidebar-course-badge {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-weight: 700;
            font-size: 0.85rem;
            color: #1a6ff5;
            margin-bottom: 1rem;
        }

        .sp-label {
            display: flex;
            justify-content: space-between;
            font-size: 0.72rem;
            font-weight: 600;
            color: var(--text-muted);
            margin-bottom: 4px;
            text-transform: uppercase;
            letter-spacing: 0.4px;
        }

        .sp-bar { height: 7px; background: #e0eaff; border-radius: 4px; overflow: hidden; }
        .sp-fill { height: 100%; background: #ff6b1a; border-radius: 4px; transition: width 0.5s ease; }

        .sidebar-nav { padding: 0.5rem 0; }

        .sidebar-item {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 0.75rem 1.25rem;
            cursor: pointer;
            transition: background 0.15s;
            text-decoration: none;
            color: inherit;
        }

        .sidebar-item:hover:not(.locked) { background: #f0f5ff; }
        .sidebar-item.active { background: #eef3ff; border-right: 3px solid #1a6ff5; }
        .sidebar-item.locked { opacity: 0.45; cursor: not-allowed; }

        .si-dot {
            width: 32px; height: 32px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.7rem;
            font-weight: 700;
            flex-shrink: 0;
        }

        .si-dot.done    { background: #d1fae5; color: #065f46; }
        .si-dot.playing { background: #1a6ff5; color: white; animation: pulse 1.5s infinite; }
        .si-dot.ready   { background: #f0f5ff; color: var(--text-muted); border: 2px solid #c0d4ff; }
        .si-dot.locked  { background: #f0f5ff; color: #c0d4ff; }

        @keyframes pulse {
            0%,100% { box-shadow: 0 0 0 0 rgba(26,111,245,0.3); }
            50%      { box-shadow: 0 0 0 6px rgba(26,111,245,0); }
        }

        .si-info { flex: 1; min-width: 0; }
        .si-title {
            font-size: 0.82rem;
            font-weight: 600;
            color: var(--text-secondary);
            display: block;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .si-minibar { height: 3px; background: #e0eaff; border-radius: 2px; margin-top: 5px; overflow: hidden; }
        .si-minifill { height: 100%; background: #5a9bff; border-radius: 2px; transition: width 0.4s; }
        .si-minifill.complete { background: var(--success); }

        .sidebar-divider { height: 1px; background: #e0eaff; margin: 0.5rem 1rem; }
        .test-item, .cert-item { text-decoration: none; }

        .learn-main { padding: 1.5rem; background: transparent; }

        .sidebar-toggle {
            display: none;
            background: white;
            border: 1.5px solid #c0d4ff;
            border-radius: var(--radius-sm);
            padding: 0.5rem 1rem;
            font-size: 0.85rem;
            font-weight: 600;
            color: var(--primary);
            gap: 0.5rem;
            margin-bottom: 1rem;
            cursor: pointer;
        }

        .player-card {
            background: #ffffff;
            border-radius: var(--radius-xl);
            box-shadow: var(--shadow-lg);
            border: 1.5px solid #e0eaff;
            overflow: hidden;
        }

        .video-wrap { position: relative; background: #000; user-select: none; }
        .video-wrap video { width: 100%; display: block; max-height: 65vh; object-fit: contain; }
        .video-wrap video::-webkit-media-controls { display: none !important; }

        .video-overlay {
            position: absolute; inset: 0;
            display: flex; align-items: center; justify-content: center;
            pointer-events: none; background: transparent; transition: background 0.2s;
        }

        .video-overlay.paused { background: rgba(0,0,0,0.35); pointer-events: all; }

        .play-icon-big {
            width: 72px; height: 72px;
            background: rgba(255,255,255,0.15);
            backdrop-filter: blur(8px);
            border-radius: 50%;
            display: flex; align-items: center; justify-content: center;
            font-size: 1.8rem; color: white;
            cursor: pointer;
            border: 2px solid rgba(255,255,255,0.3);
            opacity: 0;
            transition: opacity 0.3s, transform 0.15s;
        }

        .video-overlay.paused .play-icon-big { opacity: 1; }
        .play-icon-big:hover { transform: scale(1.08); background: rgba(255,255,255,0.25); }

        .custom-controls {
            position: absolute; bottom: 0; left: 0; right: 0;
            background: linear-gradient(transparent, rgba(0,0,0,0.75));
            padding: 2rem 1rem 0.75rem;
            opacity: 0; transition: opacity 0.2s;
        }

        .video-wrap:hover .custom-controls,
        .video-wrap:focus-within .custom-controls { opacity: 1; }

        .progress-track {
            position: relative; height: 4px;
            background: rgba(255,255,255,0.25);
            border-radius: 2px; cursor: pointer;
            margin-bottom: 0.75rem; transition: height 0.15s;
        }

        .progress-track:hover { height: 6px; }

        .progress-watched {
            position: absolute; left: 0; top: 0; bottom: 0;
            background: #ff6b1a; border-radius: 2px; pointer-events: none;
        }

        .progress-thumb {
            position: absolute; top: 50%;
            transform: translate(-50%, -50%);
            width: 12px; height: 12px;
            background: white; border-radius: 50%;
            pointer-events: none; opacity: 0; transition: opacity 0.15s;
        }

        .progress-track:hover .progress-thumb { opacity: 1; }

        .controls-row { display: flex; align-items: center; justify-content: space-between; }
        .ctrl-left, .ctrl-right { display: flex; align-items: center; gap: 0.5rem; }

        .ctrl-btn {
            background: transparent; border: none;
            color: rgba(255,255,255,0.9);
            font-size: 0.85rem; padding: 0.3rem 0.5rem;
            border-radius: 4px; cursor: pointer;
            display: flex; align-items: center; gap: 4px;
            transition: background 0.15s;
        }

        .ctrl-btn:hover { background: rgba(255,255,255,0.15); color: white; }

        .ctrl-time {
            color: rgba(255,255,255,0.8);
            font-size: 0.78rem; font-weight: 600; letter-spacing: 0.3px;
        }

        .speed-btn {
            background: rgba(255,255,255,0.15) !important;
            border-radius: 4px; padding: 0.2rem 0.5rem !important;
            font-weight: 700; font-size: 0.78rem;
        }

        .video-info-bar {
            padding: 1.25rem 1.5rem;
            display: flex; align-items: flex-start;
            justify-content: space-between; gap: 1rem;
            border-bottom: 1.5px solid #e0eaff;
        }

        .video-title { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); margin: 0 0 0.25rem; }
        .video-desc  { font-size: 0.85rem; color: var(--text-muted); margin: 0; }

        .completion-badge {
            background: #d1fae5; color: #065f46;
            padding: 0.4rem 0.9rem; border-radius: var(--radius-full);
            font-size: 0.78rem; font-weight: 700;
            white-space: nowrap; display: flex; align-items: center; gap: 5px;
        }

        .watch-progress-row {
            display: flex; align-items: center; gap: 0.75rem;
            padding: 0.9rem 1.5rem;
        }

        .wpr-label {
            font-size: 0.72rem; font-weight: 700;
            text-transform: uppercase; letter-spacing: 0.5px;
            color: var(--text-muted); white-space: nowrap;
        }

        .wpr-bar { flex: 1; height: 8px; background: #e0eaff; border-radius: 4px; overflow: hidden; }
        .wpr-fill { height: 100%; background: #ff6b1a; border-radius: 4px; transition: width 1s ease; }
        .wpr-pct { font-size: 0.78rem; font-weight: 700; color: #ff6b1a; min-width: 36px; text-align: right; }

        .tab-warning {
            background: #fff0e8; color: #c2410c;
            padding: 0.65rem 1.5rem;
            font-size: 0.82rem; font-weight: 600;
            display: flex; align-items: center; gap: 0.5rem;
            border-top: 1.5px solid #ffd0b0;
        }

        .empty-player {
            background: #f8fbff; border-radius: var(--radius-xl);
            display: flex; flex-direction: column;
            align-items: center; justify-content: center;
            min-height: 40vh; color: var(--text-muted); text-align: center;
            border: 2px dashed #c0d4ff;
        }

        .test-header-card {
            background: white; border-radius: var(--radius-xl);
            box-shadow: var(--shadow-lg); border: 1.5px solid #e0eaff;
            padding: 1.5rem 2rem;
            display: flex; align-items: center;
            justify-content: space-between; margin-bottom: 1rem;
        }

        .thc-left { display: flex; align-items: center; gap: 1rem; }

        .thc-icon {
            width: 56px; height: 56px; background: #1a6ff5;
            border-radius: var(--radius-md);
            display: flex; align-items: center; justify-content: center;
            font-size: 1.4rem; color: white;
        }

        .thc-title { font-size: 1.3rem; font-weight: 800; margin: 0; }
        .thc-sub   { font-size: 0.82rem; color: var(--text-muted); margin: 0; }

        .thc-timer {
            display: flex; align-items: center; gap: 0.5rem;
            background: #f0f5ff; border: 2px solid #c0d4ff;
            border-radius: var(--radius-md); padding: 0.6rem 1.2rem;
            font-size: 1.3rem; font-weight: 800;
            color: var(--text-primary); font-variant-numeric: tabular-nums;
        }

        .thc-timer.warning { background: #fff0e8; border-color: #ffd0b0; color: #c2410c; }
        .thc-timer.danger  { background: #fee2e2; border-color: #fca5a5; color: #b91c1c; animation: timerPulse 0.5s infinite; }

        @keyframes timerPulse { 0%,100%{opacity:1} 50%{opacity:0.6} }

        .test-rules-card {
            background: #eef3ff; color: #1a6ff5;
            border-left: 4px solid #1a6ff5;
            border-radius: var(--radius-md);
            padding: 0.85rem 1.25rem;
            font-size: 0.85rem; font-weight: 500;
            margin-bottom: 1.5rem;
        }

        .question-card {
            background: white; border-radius: var(--radius-lg);
            box-shadow: var(--shadow-sm);
            padding: 1.5rem; margin-bottom: 1rem;
            border: 2px solid transparent;
            transition: border-color 0.2s, box-shadow 0.2s;
        }

        .question-card.answered { border-color: var(--success); }

        .qc-num {
            font-size: 0.72rem; font-weight: 800;
            text-transform: uppercase; letter-spacing: 0.6px;
            color: #ff6b1a; margin-bottom: 0.5rem;
        }

        .qc-text { font-size: 1rem; font-weight: 600; color: var(--text-primary); margin-bottom: 1rem; line-height: 1.5; }
        .qc-options { display: flex; flex-direction: column; gap: 0.5rem; }

        .opt-label {
            display: flex; align-items: center; gap: 0.75rem;
            padding: 0.75rem 1rem;
            border: 2px solid #e0eaff; border-radius: var(--radius-sm);
            cursor: pointer; transition: border-color 0.15s, background 0.15s; font-weight: 500;
        }

        .opt-label:hover { border-color: #1a6ff5; background: #f0f5ff; }
        .opt-label input[type=radio] { display: none; }
        .opt-label:has(input:checked) { border-color: #1a6ff5; background: #eef3ff; }

        .opt-key {
            width: 28px; height: 28px; background: #f0f5ff;
            border-radius: 50%;
            display: flex; align-items: center; justify-content: center;
            font-size: 0.75rem; font-weight: 800;
            flex-shrink: 0; color: var(--text-muted);
        }

        .opt-label:has(input:checked) .opt-key { background: #1a6ff5; color: white; }
        .opt-text { font-size: 0.9rem; }

        .test-submit-bar {
            background: white; border-radius: var(--radius-xl);
            box-shadow: var(--shadow-lg); border: 1.5px solid #e0eaff;
            padding: 1.25rem 2rem;
            display: flex; align-items: center; justify-content: space-between;
            margin-top: 1.5rem; position: sticky; bottom: 1rem;
        }

        .answered-tracker { font-size: 0.9rem; font-weight: 700; color: var(--text-muted); }
        .test-submit-btn { min-width: 160px; }

        .cert-outer { display: flex; justify-content: center; margin-bottom: 1.5rem; }

        .cert-card {
            background: white;
            border: 2px solid #ff6b1a;
            border-radius: 14px;
            box-shadow: 0 20px 60px rgba(26,111,245,0.12), inset 0 0 0 8px rgba(255,107,26,0.04);
            padding: 3rem; max-width: 760px; width: 100%;
            position: relative; overflow: hidden;
        }

        .cert-corner {
            position: absolute; width: 60px; height: 60px;
            border-color: #ff6b1a; border-style: solid; border-width: 0;
        }
        .cert-corner.tl { top: 12px; left: 12px; border-top-width: 3px; border-left-width: 3px; }
        .cert-corner.tr { top: 12px; right: 12px; border-top-width: 3px; border-right-width: 3px; }
        .cert-corner.bl { bottom: 12px; left: 12px; border-bottom-width: 3px; border-left-width: 3px; }
        .cert-corner.br { bottom: 12px; right: 12px; border-bottom-width: 3px; border-right-width: 3px; }

        .cert-inner { text-align: center; position: relative; z-index: 1; }

        .cert-logo {
            display: flex; align-items: center; justify-content: center; gap: 0.6rem;
            font-size: 1rem; font-weight: 800; color: #ff6b1a;
            margin-bottom: 1.5rem; letter-spacing: 1px; text-transform: uppercase;
        }

        .cert-presents { font-size: 0.9rem; color: #888; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 0.5rem; }
        .cert-name { font-size: 2.5rem; font-weight: 900; color: #1558d6; letter-spacing: -0.5px; margin-bottom: 0.75rem; font-family: Georgia, 'Times New Roman', serif; }
        .cert-body { font-size: 1rem; color: #666; margin-bottom: 0.5rem; }
        .cert-course { font-size: 1.4rem; font-weight: 800; color: #1a6ff5; margin-bottom: 0.5rem; font-family: Georgia, 'Times New Roman', serif; }
        .cert-score { font-size: 0.95rem; color: #888; margin-bottom: 2rem; }
        .cert-score strong { color: #065f46; font-size: 1.1rem; }

        .cert-footer {
            display: flex; justify-content: space-between; align-items: flex-end;
            padding-top: 1.5rem; border-top: 1px solid #ffd0b0;
        }

        .cert-sig { text-align: center; }
        .cert-sig-line { width: 120px; height: 2px; background: #1a6ff5; margin: 0 auto 0.4rem; }
        .cert-sig span, .cert-date span, .cert-id span { font-size: 0.85rem; font-weight: 700; color: var(--text-primary); display: block; }
        .cert-date small, .cert-id small { font-size: 0.7rem; color: #aaa; text-transform: uppercase; letter-spacing: 0.5px; }

        .cert-actions { display: flex; align-items: center; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-bottom: 2rem; }

        .reward-status { padding: 0.6rem 1.2rem; border-radius: var(--radius-full); font-weight: 700; font-size: 0.85rem; display: flex; align-items: center; gap: 0.5rem; }
        .reward-status.pending  { background: #fff0e8; color: #c2410c; }
        .reward-status.approved { background: #d1fae5; color: #065f46; }
        .reward-status.rejected { background: #fee2e2; color: #b91c1c; }

        .modal-backdrop {
            position: fixed; inset: 0;
            background: rgba(13,27,62,0.45);
            backdrop-filter: blur(4px);
            z-index: 9000;
            display: flex; align-items: center; justify-content: center; padding: 1rem;
        }

        .reward-modal {
            background: white; border-radius: var(--radius-xl);
            box-shadow: var(--shadow-lg); border: 1.5px solid #e0eaff;
            width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto;
        }

        .rm-header { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 1.5rem; border-bottom: 1px solid #e0eaff; }
        .rm-header h3 { margin: 0; font-size: 1.1rem; font-weight: 800; color: var(--text-primary); }
        .rm-close { background: none; border: none; font-size: 1.1rem; cursor: pointer; color: var(--text-muted); }

        .rm-body { padding: 1.5rem; }
        .rm-instructions { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 1rem; }
        .rm-platforms { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }

        .rm-platform-btn {
            flex: 1; min-width: 120px;
            display: flex; align-items: center; justify-content: center; gap: 0.4rem;
            padding: 0.6rem 1rem; border-radius: var(--radius-sm);
            text-decoration: none; font-size: 0.82rem; font-weight: 700;
            transition: transform 0.15s, opacity 0.15s;
        }

        .rm-platform-btn:hover { transform: translateY(-2px); opacity: 0.9; }
        .rm-platform-btn.whatsapp  { background: #25d366; color: white; }
        .rm-platform-btn.instagram { background: linear-gradient(135deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888); color: white; }
        .rm-platform-btn.facebook  { background: #1877f2; color: white; }

        .upload-zone {
            border: 2px dashed #c0d4ff; border-radius: var(--radius-md);
            padding: 2rem; text-align: center; cursor: pointer;
            color: var(--text-muted); transition: border-color 0.2s, background 0.2s;
        }

        .upload-zone:hover { border-color: #1a6ff5; background: #f0f5ff; }
        .upload-zone.has-file { border-color: var(--success); background: #d1fae5; color: #065f46; }

        .stat-mini { border-radius: var(--radius-md); padding: 1rem 1.25rem; display: flex; flex-direction: column; gap: 0.2rem; }
        .stat-mini.pending  { background: #fff0e8; }
        .stat-mini.approved { background: #d1fae5; }
        .stat-mini.rejected { background: #fee2e2; }

        .sm-num   { font-size: 1.8rem; font-weight: 800; color: var(--text-primary); }
        .sm-label { font-size: 0.78rem; font-weight: 600; color: var(--text-muted); }

        .platform-badge {
            display: inline-flex; align-items: center; gap: 0.4rem;
            padding: 0.25rem 0.65rem; border-radius: var(--radius-full);
            font-size: 0.75rem; font-weight: 700;
            background: #eef3ff; color: #1a6ff5;
        }

        @media (max-width: 768px) {
            .learn-layout { grid-template-columns: 1fr; }
            .learn-sidebar {
                position: fixed; top: 0; left: -100%;
                width: 85%; max-width: 300px;
                height: 100vh; max-height: 100vh;
                z-index: 2000; transition: left 0.3s ease;
                box-shadow: var(--shadow-lg);
            }
            .learn-sidebar.open { left: 0; }
            .sidebar-toggle { display: flex; }
            .cert-card { padding: 1.5rem; }
            .cert-name { font-size: 1.7rem; }
            .cert-footer { flex-direction: column; gap: 1rem; align-items: center; }
            .cert-actions { flex-direction: column; }
            .test-header-card { flex-direction: column; gap: 1rem; align-items: flex-start; }
            .test-submit-bar { flex-direction: column; gap: 1rem; }
        }

        @media print {
            .portal-navbar, .cert-actions, footer, .learn-sidebar, .sidebar-toggle { display: none !important; }
            .cert-card { box-shadow: none; border: 2px solid #ff6b1a; }
            body { background: white !important; }
        }

        /* ─── NAVBAR BRAND IMAGE ─── */
        .navbar-brand { display: flex; align-items: center; padding: 0; margin-right: 20px; }
        .navbar-brand img { height: 65px; width: auto; object-fit: contain; transition: transform 0.2s ease; mix-blend-mode: multiply; }
        .navbar-brand img:hover { transform: scale(1.05); }

        .navbar-logo {
  width: 8rem;
  height: 3.5rem;
  object-fit: contain;
  border-radius: 0.5rem;
}