/* ===== COURSE SYSTEM STYLES ===== */

.alw-course-main,
.alw-lesson-main {
    min-height: 60vh;
}

/* User's purchased courses ([my_courses]) */
.alw-user-courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}
.alw-user-course-card {
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}
.alw-user-course-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.1);
}
.alw-user-course-card-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}
.alw-user-course-card-body {
    padding: 1.5rem;
}
.alw-user-course-card-body h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

/* Progress Bar */
.alw-progress-wrap {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.alw-progress-bar {
    flex: 1;
    height: 8px;
    background: var(--muted);
    border-radius: 4px;
    overflow: hidden;
}
.alw-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 4px;
    transition: width 0.5s ease;
    min-width: 4px;
}
.alw-progress-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ===== LESSON LAYOUT ===== */
.alw-lesson-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 0;
    max-width: 100%;
    margin: 0;
    padding: 0;
    direction: ltr;
    min-height: calc(100vh - 120px);
}
.alw-lesson-body {
    padding: 1.5rem 2.5rem 0;
    display: flex;
    flex-direction: column;
    direction: rtl;
}
.alw-lesson-sidebar {
    border-left: 1px solid var(--border);
    background: var(--background);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--muted) transparent;
    direction: rtl;
}

/* Lesson Header */
.alw-lesson-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 0.25rem;
}
.alw-lesson-title {
    font-family: 'Cairo', 'IBM Plex Sans Arabic', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 0.75rem;
    color: var(--foreground);
}
.alw-lesson-expand {
    flex-shrink: 0;
    color: var(--muted-foreground);
    padding: 0.4rem;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}
.alw-lesson-expand:hover {
    color: var(--foreground);
    background: var(--muted);
}

/* Lesson content sections (stacked, no tabs) */
.alw-lesson-section {
    margin-top: 1.5rem;
}

@keyframes alwFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== LESSON CONTENT SECTIONS ===== */
.alw-lesson-intro {
    line-height: 1.8;
    margin-bottom: 2rem;
    color: var(--foreground);
}
.alw-lesson-summary {
    padding: 2rem;
    margin-bottom: 2rem;
    line-height: 1.8;
}
.alw-lesson-summary h3 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
}
.alw-lesson-video {
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    margin-bottom: 0.5rem;
    width: 100%;
}
.alw-lesson-video iframe,
.alw-lesson-video video {
    width: 100%;
    aspect-ratio: 16/9;
    border: none;
    display: block;
    max-height: 70vh;
}
.alw-download-section {
    padding: 2rem;
}
.alw-download-section h3 {
    margin-bottom: 0.5rem;
}

/* ===== LESSON ACTIONS (Bottom Bar) ===== */
.alw-lesson-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding: 1.25rem 0;
    border-top: 1px solid var(--border);
}
.alw-lesson-actions-start,
.alw-lesson-actions-end {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.alw-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.alw-nav-next {
    background: var(--primary);
    color: var(--primary-foreground);
    padding: 0.65rem 1.75rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
}
.alw-nav-next:hover {
    opacity: 0.9;
    transform: translateX(-2px);
}
.alw-nav-prev {
    color: var(--muted-foreground);
}
.alw-nav-prev:hover {
    color: var(--primary);
}
.alw-btn-complete {
    font-size: 0.95rem;
    padding: 0.65rem 1.75rem;
    border: none;
    cursor: pointer;
    border-radius: 50px;
    font-weight: 600;
}
.alw-completed-badge {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
}

/* ===== SIDEBAR ===== */
.alw-sidebar-wrap {
    display: flex;
    flex-direction: column;
    height: 100%;
}
.alw-sidebar-course-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}
.alw-sidebar-course-header:hover {
    background: var(--muted);
}
.alw-sidebar-course-title {
    font-family: 'Cairo', 'IBM Plex Sans Arabic', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--foreground);
}
.alw-sidebar-chevron {
    transition: transform 0.3s ease;
    flex-shrink: 0;
    color: var(--muted-foreground);
}
.alw-sidebar-course-header:not(.alw-collapsed) .alw-sidebar-chevron {
    transform: rotate(90deg);
}

.alw-sidebar-body {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--muted) transparent;
}
.alw-sidebar-body.alw-hidden {
    display: none;
}

.alw-sidebar-progress {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

/* Sidebar Section */
.alw-sidebar-section {
    border-bottom: 1px solid var(--border);
}
.alw-sidebar-section-header {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.85rem 1.25rem;
    width: 100%;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    text-align: right;
    transition: background 0.2s;
    user-select: none;
}
.alw-sidebar-section-header:hover {
    background: var(--muted);
}
.alw-section-chevron {
    margin-top: 0.15rem;
    flex-shrink: 0;
    transition: transform 0.3s ease;
    color: var(--muted-foreground);
}
.alw-sidebar-section-header.alw-section-open .alw-section-chevron {
    transform: rotate(180deg);
}
.alw-sidebar-section-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.alw-sidebar-section-name {
    font-family: 'Cairo', 'IBM Plex Sans Arabic', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--foreground);
}
.alw-sidebar-section-count {
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

/* Sidebar Lessons List */
.alw-sidebar-lessons {
    list-style: none;
    display: none;
    padding: 0;
    margin: 0;
}
.alw-sidebar-lessons.alw-section-expanded {
    display: block;
}

.alw-sidebar-lesson {
    position: relative;
}
.alw-sidebar-lesson-link {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.6rem 2.25rem 0.6rem 1rem;
    color: var(--foreground);
    font-size: 0.85rem;
    transition: background 0.15s;
    cursor: pointer;
    text-decoration: none;
}
a.alw-sidebar-lesson-link:hover {
    background: rgba(166, 89, 63, 0.04);
}

.alw-sidebar-lesson-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}
.alw-sidebar-lesson-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex: 1;
    min-width: 0;
}

/* Active lesson highlight */
.alw-sidebar-active .alw-sidebar-lesson-link {
    background: var(--foreground);
    color: var(--background);
}
.alw-sidebar-active .alw-sidebar-lesson-title {
    color: var(--background);
}
.alw-sidebar-active .alw-sidebar-icon,
.alw-sidebar-active .alw-sidebar-duration,
.alw-sidebar-active .alw-sidebar-type-badge {
    color: rgba(255,255,255,0.6);
    border-color: rgba(255,255,255,0.2);
}

/* Completed lesson */
.alw-sidebar-done .alw-sidebar-lesson-title {
    color: var(--muted-foreground);
}
.alw-sidebar-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    min-width: 20px;
    background: #22c55e;
    border-radius: 50%;
    color: #fff;
    flex-shrink: 0;
}
.alw-sidebar-active .alw-sidebar-check {
    background: #22c55e;
    color: #fff;
}

/* Locked lesson */
.alw-sidebar-locked .alw-sidebar-lesson-link {
    opacity: 0.5;
    cursor: not-allowed;
}
.alw-sidebar-lock {
    color: var(--muted-foreground);
    flex-shrink: 0;
}

.alw-sidebar-lesson-title {
    flex: 1;
    line-height: 1.4;
}
.alw-sidebar-lesson-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    flex-shrink: 0;
}
.alw-sidebar-icon {
    color: var(--muted-foreground);
    min-width: 18px;
}
.alw-sidebar-duration {
    font-size: 0.75rem;
    color: var(--muted-foreground);
    font-variant-numeric: tabular-nums;
}

/* Type badges row under lesson title */
.alw-sidebar-types {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}
.alw-sidebar-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    color: var(--muted-foreground);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.1rem 0.4rem;
    line-height: 1.3;
}
.alw-sidebar-type-badge svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

/* ===== COURSE OVERVIEW (section-based) ===== */
.alw-overview-section {
    margin-bottom: 0.5rem;
}
.alw-overview-section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--secondary);
    border-radius: var(--radius);
    margin-bottom: 0.25rem;
    cursor: pointer;
    user-select: none;
    border: none;
    width: 100%;
    font-family: inherit;
    text-align: right;
    transition: background 0.2s;
}
.alw-overview-section-header:hover {
    background: var(--muted);
}
.alw-overview-section-title {
    font-weight: 700;
    font-size: 1.05rem;
    flex: 1;
}
.alw-overview-section-badge {
    font-size: 0.8rem;
    color: var(--muted-foreground);
}
.alw-overview-section-chevron {
    transition: transform 0.3s ease;
    color: var(--muted-foreground);
}
.alw-overview-section-header:not(.alw-ov-collapsed) .alw-overview-section-chevron {
    transform: rotate(180deg);
}
.alw-overview-lessons {
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.alw-overview-lessons.alw-ov-hidden {
    max-height: 0 !important;
    overflow: hidden;
}

/* Lesson Row */
.alw-lesson-row {
    transition: border-color 0.3s, background 0.2s;
}
.alw-lesson-row:hover:not(.alw-lesson-locked) {
    border-color: rgba(166, 89, 63, 0.3) !important;
}
.alw-lesson-done {
    opacity: 0.85;
}
.alw-lesson-locked {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== QUIZ ===== */
.alw-quiz-section {
    margin-bottom: 1rem;
}
.alw-quiz-title,
.alw-form-title {
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
}
.alw-quiz-question {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}
.alw-q-text {
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.alw-q-type-badge {
    font-size: 0.7rem;
    font-weight: 500;
    background: var(--secondary);
    color: var(--muted-foreground);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}
.alw-quiz-option {
    display: block;
    padding: 0.6rem 0.85rem;
    margin-bottom: 0.3rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    border: 1px solid transparent;
}
.alw-quiz-option:hover {
    background: rgba(166, 89, 63, 0.05);
}
.alw-quiz-option input {
    margin-left: 0.5rem;
}
.alw-option-text {
    font-size: 0.95rem;
}
.alw-quiz-option.correct {
    background: rgba(34, 197, 94, 0.1) !important;
    border-color: rgba(34, 197, 94, 0.3);
}
.alw-quiz-option.incorrect {
    background: rgba(239, 68, 68, 0.1) !important;
    border-color: rgba(239, 68, 68, 0.3);
}
.alw-quiz-feedback {
    display: none;
    margin-top: 0.5rem;
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
}
.alw-quiz-feedback.show-correct {
    display: block !important;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: #166534;
}
.alw-quiz-feedback.show-incorrect {
    display: block !important;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #991b1b;
}
.alw-quiz-result {
    padding: 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}
.alw-quiz-result span {
    margin-right: 1rem;
}
.alw-result-pass {
    background: rgba(34,197,94,0.1);
    border: 1px solid rgba(34,197,94,0.3);
}
.alw-result-fail {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.3);
}
#alw-quiz-message {
    display: none;
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
}

/* Free text inputs in quiz */
.alw-quiz-text-input {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    background: var(--background);
    color: var(--foreground);
}
.alw-quiz-textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    background: var(--background);
    color: var(--foreground);
}

/* ===== LESSON FORM ===== */
.alw-form-section {
    margin-bottom: 1rem;
}
.alw-form-desc {
    color: var(--muted-foreground);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}
.alw-form-saved-notice {
    background: rgba(34,197,94,0.08);
    border: 1px solid rgba(34,197,94,0.2);
    color: #166534;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}
.alw-form-field-wrap {
    margin-bottom: 1.5rem;
}
.alw-form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}
.alw-required {
    color: #d63638;
    margin-right: 0.2rem;
}
.alw-form-input,
.alw-form-textarea,
.alw-form-select {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    background: var(--background);
    color: var(--foreground);
    transition: border-color 0.2s;
}
.alw-form-input:focus,
.alw-form-textarea:focus,
.alw-form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(166, 89, 63, 0.1);
}
.alw-form-textarea {
    resize: vertical;
}
.alw-form-check-label {
    display: block;
    padding: 0.4rem 0;
    cursor: pointer;
    font-size: 0.95rem;
}
.alw-form-check-label input {
    margin-left: 0.5rem;
}
#alw-form-message {
    display: none;
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
}

/* ===== MISC ===== */
.alw-access-denied {
    animation: alwFadeIn 0.5s ease;
}
.alw-login-required {
    text-align: center;
    padding: 3rem;
}
.alw-my-account-courses {
    margin: 1rem 0;
}

/* ===== Member login & portal ===== */
.alw-member-card {
    padding: 2rem 1.75rem;
}
.alw-member-notice {
    padding: 0.85rem 1rem;
    border-radius: 10px;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    text-align: center;
}
.alw-member-notice-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #991b1b;
}
.alw-member-label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
    color: var(--foreground);
}
.alw-member-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 1rem;
    background: var(--background);
    color: var(--foreground);
    box-sizing: border-box;
}
.alw-member-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(166, 89, 63, 0.12);
}
.alw-member-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--muted-foreground);
    cursor: pointer;
}
.alw-member-logout {
    transition: border-color 0.2s, color 0.2s;
}
.alw-member-logout:hover {
    border-color: var(--primary) !important;
    color: var(--primary) !important;
}

/* ===== MEMBER PORTAL (Tabbed) ===== */
.alw-portal {
    min-height: 70vh;
}
.alw-portal-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

/* Header */
.alw-portal-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 1.75rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 1rem;
    margin-bottom: 1.5rem;
}
.alw-portal-avatar .alw-avatar-img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 3px solid var(--primary);
    object-fit: cover;
}
.alw-portal-welcome {
    flex: 1;
}
.alw-portal-welcome h1 {
    font-family: 'Noto Naskh Arabic', serif;
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.4;
}
.alw-portal-welcome p {
    margin: 0.15rem 0 0;
    font-size: 0.85rem;
    color: var(--muted-foreground);
}
.alw-portal-logout {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    border: 1px solid var(--border);
    border-radius: 0.65rem;
    color: var(--muted-foreground);
    font-size: 0.85rem;
    transition: all 0.2s;
    white-space: nowrap;
}
.alw-portal-logout:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Stats Row */
.alw-portal-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}
.alw-stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.1rem 0.75rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    text-align: center;
}
.alw-stat-number {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}
.alw-stat-number small {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--muted-foreground);
}
.alw-stat-label {
    font-size: 0.78rem;
    color: var(--muted-foreground);
    margin-top: 0.25rem;
}

/* Tabs Navigation */
.alw-portal-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 1.75rem;
}
.alw-tab-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.85rem 1rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--muted-foreground);
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}
.alw-tab-btn:hover {
    color: var(--foreground);
    background: rgba(166, 89, 63, 0.04);
}
.alw-tab-btn.alw-tab-active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.alw-tab-btn svg {
    flex-shrink: 0;
}

/* Tab Panels */
.alw-tab-panel {
    display: none;
    animation: alwPanelIn 0.35s ease;
}
.alw-tab-panel.alw-panel-active {
    display: block;
}
@keyframes alwPanelIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Empty State */
.alw-empty-state {
    text-align: center;
    padding: 4rem 2rem;
}
.alw-empty-state svg {
    margin: 0 auto 1.25rem;
    opacity: 0.4;
}
.alw-empty-state h3 {
    font-size: 1.15rem;
    margin-bottom: 0.4rem;
}
.alw-empty-state p {
    color: var(--muted-foreground);
    font-size: 0.9rem;
}

/* Course Cards (Portal) */
.alw-portal-courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}
.alw-portal-course {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 1rem;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}
.alw-portal-course:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}
.alw-portal-course.alw-course-complete {
    border-color: rgba(34, 197, 94, 0.35);
}
.alw-portal-course-img {
    position: relative;
    overflow: hidden;
}
.alw-portal-course-img img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}
.alw-course-badge-done {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: rgba(34, 197, 94, 0.9);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
}
.alw-portal-course-body {
    padding: 1.25rem;
}
.alw-portal-course-body h3 {
    font-size: 1.1rem;
    margin: 0 0 0.75rem;
    line-height: 1.4;
}
.alw-portal-course-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--muted-foreground);
    margin-bottom: 0.5rem;
}
.alw-portal-pct {
    font-weight: 700;
    color: var(--primary);
}
.alw-portal-course-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 1rem;
    padding: 0.6rem 1.4rem;
    background: var(--primary);
    color: var(--primary-foreground);
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.88rem;
    transition: opacity 0.2s, transform 0.2s;
}
.alw-portal-course-btn:hover {
    opacity: 0.9;
    transform: translateX(-2px);
}

/* Account Tab */
.alw-account-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}
.alw-account-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.15rem 1.25rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 0.85rem;
}
.alw-account-card-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(166, 89, 63, 0.08);
    border-radius: 0.65rem;
    color: var(--primary);
    flex-shrink: 0;
}
.alw-account-label {
    display: block;
    font-size: 0.78rem;
    color: var(--muted-foreground);
    margin-bottom: 0.15rem;
}
.alw-account-value {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--foreground);
    word-break: break-all;
}

/* Orders Table */
.alw-section-title {
    font-family: 'Noto Naskh Arabic', serif;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
}
.alw-orders-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 0.85rem;
}
.alw-orders-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.alw-orders-table th {
    background: var(--secondary);
    padding: 0.75rem 1rem;
    text-align: right;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--muted-foreground);
}
.alw-orders-table td {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border);
}
.alw-order-status {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 5px;
    font-size: 0.78rem;
    font-weight: 600;
}
.alw-status-completed {
    background: rgba(34, 197, 94, 0.1);
    color: #166534;
}
.alw-status-processing {
    background: rgba(59, 130, 246, 0.1);
    color: #1e40af;
}
.alw-status-on-hold {
    background: rgba(245, 158, 11, 0.1);
    color: #92400e;
}

/* Profile Tab */
.alw-profile-notice {
    padding: 0.85rem 1.15rem;
    border-radius: 0.65rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}
.alw-notice-success {
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.25);
    color: #166534;
}
.alw-profile-form {
    max-width: 640px;
}
.alw-profile-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}
.alw-profile-section h3 {
    font-family: 'Noto Naskh Arabic', serif;
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}
.alw-profile-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.alw-field-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.alw-field-group label {
    font-weight: 600;
    font-size: 0.9rem;
}
.alw-field-full {
    margin-top: 1rem;
}
.alw-field-hint {
    font-size: 0.8rem;
    color: var(--muted-foreground);
    margin-top: 0.2rem;
}
.alw-profile-save {
    margin-top: 0.5rem;
    font-size: 0.95rem;
    padding: 0.75rem 2rem;
}

/* Footer Note */
.alw-portal-footer-note {
    text-align: center;
    margin-top: 3rem;
    font-size: 0.85rem;
    color: var(--muted-foreground);
}
.alw-portal-footer-note a {
    color: var(--primary);
    font-weight: 600;
}
.alw-portal-footer-note a:hover {
    text-decoration: underline;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .alw-lesson-layout {
        grid-template-columns: 1fr;
        direction: rtl;
    }
    .alw-lesson-sidebar {
        position: static;
        height: auto;
        border-left: none;
        border-top: 1px solid var(--border);
        order: -1;
    }
    .alw-lesson-body {
        order: 1;
        padding: 1rem;
    }
    .alw-sidebar-body {
        max-height: 400px;
        overflow-y: auto;
    }
}

@media (max-width: 768px) {
    .alw-user-courses-grid {
        grid-template-columns: 1fr;
    }
    .alw-lesson-actions {
        flex-direction: column-reverse;
        gap: 1rem;
    }
    .alw-lesson-actions-start,
    .alw-lesson-actions-end {
        width: 100%;
        justify-content: center;
    }
    .alw-btn-complete {
        width: 100%;
    }
    .alw-nav-next {
        width: 100%;
        justify-content: center;
    }
    .alw-lesson-title {
        font-size: 1.25rem;
    }

    /* Portal responsive */
    .alw-portal-header {
        flex-wrap: wrap;
    }
    .alw-portal-welcome h1 {
        font-size: 1.15rem;
    }
    .alw-portal-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    .alw-tab-btn span {
        display: none;
    }
    .alw-tab-btn {
        gap: 0;
        padding: 0.75rem 0.5rem;
    }
    .alw-tab-btn svg {
        width: 22px;
        height: 22px;
    }
    .alw-portal-courses-grid {
        grid-template-columns: 1fr;
    }
    .alw-account-grid {
        grid-template-columns: 1fr;
    }
    .alw-profile-fields {
        grid-template-columns: 1fr;
    }
}
