/* ============================================
   ห้องเรียนหุ้น - Custom Styles
   Color Palette: French Lilac
   ============================================ */

/* ===== Font Awesome — override font-display to swap so icons never stay invisible ===== */
@font-face {
    font-family: "Font Awesome 6 Pro";
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: url('../font/webfonts/fa-light-300.woff2') format('woff2'),
         url('../font/webfonts/fa-light-300.ttf') format('truetype');
}
@font-face {
    font-family: "Font Awesome 6 Pro";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../font/webfonts/fa-regular-400.woff2') format('woff2'),
         url('../font/webfonts/fa-regular-400.ttf') format('truetype');
}
@font-face {
    font-family: "Font Awesome 6 Pro";
    font-style: normal;
    font-weight: 900;
    font-display: swap;
    src: url('../font/webfonts/fa-solid-900.woff2') format('woff2'),
         url('../font/webfonts/fa-solid-900.ttf') format('truetype');
}
@font-face {
    font-family: "Font Awesome 6 Brands";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../font/webfonts/fa-brands-400.woff2') format('woff2'),
         url('../font/webfonts/fa-brands-400.ttf') format('truetype');
}

:root {
    --primary: #864498;
    --primary-dark: #6B2D7B;
    --primary-light: #D8B4E2;
    --primary-lighter: #EDE0F0;
    --secondary: #A855A0;
    --text-dark: #3D1F4E;
    --surface: #F8F5FA;
    --card-bg: #FFFFFF;
    --live-badge: #EF4444;
    --elearning-badge: #3B82F6;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    --gradient-primary: linear-gradient(135deg, #864498 0%, #A855A0 100%);
    --gradient-hero: linear-gradient(135deg, #3D1F4E 0%, #864498 50%, #A855A0 100%);
    --gradient-live: linear-gradient(135deg, #EF4444 0%, #F97316 100%);
    --gradient-elearning: linear-gradient(135deg, #3B82F6 0%, #8B5CF6 100%);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
}

/* ===== Dark Mode Colors ===== */
:root.dark {
    --surface: #0F172A; /* slate-900 */
    --card-bg: #1E293B; /* slate-800 */
    --gray-800: #E2E8F0; /* slate-200 */
    --gray-500: #94A3B8; /* slate-400 */
    --gray-400: #64748B; /* slate-500 */
    --gray-300: #475569; /* slate-600 */
    --gray-200: #334155; /* slate-700 */
    --gray-100: #1E293B; /* slate-800 */
    --text-dark: #F8FAFC; /* slate-50 */
    --gradient-hero: linear-gradient(135deg, #1E0F27 0%, #3D1F4E 50%, #6B2D7B 100%);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.5), 0 2px 4px -2px rgba(0,0,0,0.5);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.5), 0 4px 6px -4px rgba(0,0,0,0.5);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.5), 0 8px 10px -6px rgba(0,0,0,0.5);
}

/* ===== Base ===== */
* { box-sizing: border-box; }

body {
    font-family: 'Nunito', 'Noto Sans Thai', sans-serif;
    background-color: var(--surface);
    color: var(--gray-800);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--primary-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ===== Course Card ===== */
.course-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    position: relative;
}
.course-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}
.course-card .card-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/9;
}
.course-card .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.course-card:hover .card-image img {
    transform: scale(1.05);
}

/* ===== Filter Buttons ===== */
.filter-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 1rem;
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #4b5563;
    cursor: pointer;
    transition: box-shadow 0.15s, background 0.15s, color 0.15s, border-color 0.15s;
}
.filter-btn:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.filter-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.dark .filter-btn {
    background: #1E293B;
    border-color: #334155;
    color: #cbd5e1;
}
.dark .filter-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ===== Badges ===== */
.badge-live {
    background: var(--gradient-live);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-lg);
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
.badge-elearning {
    background: var(--gradient-elearning);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-lg);
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
.badge-category {
    background: var(--primary-lighter);
    color: var(--primary-dark);
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-lg);
    font-size: 0.7rem;
    font-weight: 600;
}

/* ===== Price Tag ===== */
.price-tag {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
}
.price-original {
    text-decoration: line-through;
    color: var(--gray-400);
    font-size: 0.9rem;
    font-weight: 400;
}
.early-bird-badge {
    background: linear-gradient(135deg, #F59E0B 0%, #F97316 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-lg);
    font-size: 0.7rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    animation: pulse-glow 2s infinite;
}
@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
}

/* ===== Interest Counter ===== */
.interest-counter {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--secondary);
    font-size: 0.8rem;
    font-weight: 600;
}
.interest-counter i {
    animation: pulse-eye 2s infinite;
}
@keyframes pulse-eye {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ===== Spec Box (Collapsible) ===== */
.spec-box {
    background: linear-gradient(135deg, #1F2937 0%, #111827 100%);
    border: 1px solid #374151;
    border-radius: var(--radius-lg);
    margin-top: 2rem;
    overflow: hidden;
}
.spec-box summary {
    padding: 1rem 1.25rem;
    cursor: pointer;
    font-weight: 700;
    color: #D8B4E2;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    user-select: none;
    transition: background 0.2s;
}
.spec-box summary:hover {
    background: rgba(134,68,152,0.15);
}
.spec-box summary::marker { display: none; content: ''; }
.spec-box summary::-webkit-details-marker { display: none; }
.spec-box summary .chevron-icon {
    transition: transform 0.3s;
    font-size: 0.8rem;
}
.spec-box[open] summary .chevron-icon {
    transform: rotate(90deg);
}
.spec-box .spec-content {
    padding: 0 1.25rem 1.25rem;
    color: #D1D5DB;
    font-size: 0.85rem;
    line-height: 1.8;
}
.spec-box .spec-content code {
    background: rgba(134,68,152,0.2);
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
    color: #E9D5F5;
}
.spec-box .spec-content ul {
    list-style: none;
    padding: 0;
}
.spec-box .spec-content ul li {
    padding: 0.35rem 0;
    padding-left: 1.5rem;
    position: relative;
}
.spec-box .spec-content ul li::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Pro';
    font-weight: 300;
    position: absolute;
    left: 0;
    color: #10B981;
    font-size: 0.75rem;
}
.spec-box .spec-content h4 {
    color: #D8B4E2;
    font-weight: 700;
    margin: 0.75rem 0 0.35rem;
    font-size: 0.9rem;
}

/* ===== Buttons ===== */
.btn-primary {
    background: var(--gradient-primary);
    color: white;
    padding: 0.65rem 1.5rem;
    border-radius: var(--radius-lg);
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-size: 0.9rem;
}
.btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(134,68,152,0.4);
}
.btn-secondary {
    background: transparent;
    color: var(--primary);
    padding: 0.6rem 1.5rem;
    border-radius: var(--radius-lg);
    font-weight: 700;
    border: 2px solid var(--primary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-size: 0.9rem;
}
.btn-secondary:hover {
    background: var(--primary);
    color: white;
}
.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
    border-radius: var(--radius-lg);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

/* ===== Navigation ===== */
.nav-main {
    background: white;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 50;
}
.nav-link {
    color: var(--gray-600);
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    transition: all 0.2s;
    text-decoration: none;
    font-size: 0.9rem;
}
.nav-link:hover, .nav-link.active {
    color: var(--primary);
    background: var(--primary-lighter);
}

/* ===== Tabs ===== */
.tab-container { border-bottom: 2px solid var(--gray-200); }
.tab-btn {
    padding: 0.75rem 1.25rem;
    font-weight: 600;
    color: var(--gray-500);
    border: none;
    background: none;
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
    font-size: 0.9rem;
}
.tab-btn.active {
    color: var(--primary);
}
.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ===== Chat Panel Tabs (Sidebar) ===== */
.chat-tab-btn {
    flex: 1;
    padding: 0.6rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #9CA3AF;
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
    text-align: center;
}
.chat-tab-btn.active { color: #D8B4E2; }
.chat-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px; left: 0; right: 0;
    height: 2px;
    background: var(--primary);
}
.chat-tab-btn:hover { color: #E5E7EB; }
.chat-tab-panel { display: none; flex-direction: column; flex: 1; overflow: hidden; }
.chat-tab-panel.active { display: flex; }

/* Max Chat markdown */
.max-msg-content p { margin-bottom: 0.5rem; }
.max-msg-content p:last-child { margin-bottom: 0; }
.max-msg-content pre { background: #1E293B; padding: 0.75rem; border-radius: 0.5rem; overflow-x: auto; margin: 0.5rem 0; font-size: 0.8rem; }
.max-msg-content code { font-size: 0.8rem; }
.max-msg-content a { color: #D8B4E2; text-decoration: underline; }
.max-msg-content ul, .max-msg-content ol { padding-left: 1.25rem; margin: 0.5rem 0; }
.max-msg-content blockquote { border-left: 3px solid #4B5563; padding-left: 0.75rem; color: #9CA3AF; margin: 0.5rem 0; }

/* ===== Chat ===== */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}
.chat-message {
    margin-bottom: 0.75rem;
    display: flex;
    gap: 0.5rem;
}
.chat-message .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--primary-dark);
    flex-shrink: 0;
}
.chat-message .msg-content {
    background: var(--gray-100);
    padding: 0.5rem 0.75rem;
    border-radius: 0 var(--radius-md) var(--radius-md) var(--radius-md);
    font-size: 0.85rem;
    max-width: 85%;
}
.chat-input {
    padding: 0.75rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: 0.5rem;
}
.chat-input input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-lg);
    outline: none;
    font-size: 0.85rem;
}
.chat-input input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(134,68,152,0.1);
}

/* ===== Video Player ===== */
.video-container {
    position: relative;
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 16/9;
}
.video-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
}
.video-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255,255,255,0.3);
}
.video-progress-bar {
    height: 100%;
    background: var(--primary);
    width: 35%;
    position: relative;
}
.question-marker {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #F59E0B;
    border-radius: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
}

/* ===== Question Modal ===== */
.question-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}
.question-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-xl);
}

/* ===== Progress Ring ===== */
.progress-ring {
    position: relative;
    width: 60px;
    height: 60px;
}
.progress-ring svg {
    transform: rotate(-90deg);
}
.progress-ring .progress-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
}

/* ===== Admin Sidebar ===== */
.admin-sidebar {
    background: linear-gradient(180deg, #3D1F4E 0%, #1F2937 100%);
    width: 260px;
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 40;
    transition: transform 0.3s ease;
}
.admin-sidebar .sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
    text-decoration: none;
    border-radius: var(--radius-md);
    margin: 0.15rem 0.5rem;
}
.admin-sidebar .sidebar-link:hover,
.admin-sidebar .sidebar-link.active {
    background: rgba(134,68,152,0.3);
    color: white;
}
.admin-sidebar .sidebar-link i {
    width: 20px;
    text-align: center;
}
.admin-content {
    margin-left: 260px;
    min-height: 100vh;
}

/* ===== Stat Cards ===== */
.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}
.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
}

/* ===== Table ===== */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
.data-table thead th {
    background: var(--gray-100);
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.data-table thead th:first-child { border-radius: var(--radius-md) 0 0 0; }
.data-table thead th:last-child { border-radius: 0 var(--radius-md) 0 0; }
.data-table tbody td {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--gray-100);
}
.data-table tbody tr:hover {
    background: var(--primary-lighter);
}

/* ===== Billing Card (Google One Style) ===== */
.billing-card {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    transition: box-shadow 0.3s;
}
.billing-card:hover {
    box-shadow: var(--shadow-lg);
}

/* ===== Countdown ===== */
.countdown-box {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.countdown-unit {
    background: var(--primary-lighter);
    border-radius: var(--radius-md);
    padding: 0.35rem 0.6rem;
    text-align: center;
    min-width: 42px;
}
.countdown-unit .number {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary-dark);
    line-height: 1;
}
.countdown-unit .label {
    font-size: 0.6rem;
    color: var(--gray-500);
    text-transform: uppercase;
}

/* ===== Horizontal Scroll ===== */
.scroll-container {
    display: flex;
    gap: 1.25rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}
.scroll-container::-webkit-scrollbar { height: 4px; }
.scroll-container > * {
    scroll-snap-align: start;
    flex-shrink: 0;
}

/* ===== Status Badges ===== */
.status-success { background: #D1FAE5; color: #065F46; }
.status-warning { background: #FEF3C7; color: #92400E; }
.status-danger { background: #FEE2E2; color: #991B1B; }
.status-info { background: #DBEAFE; color: #1E40AF; }
.status-badge {
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-lg);
    font-size: 0.7rem;
    font-weight: 700;
}

/* ===== Mobile Responsive ===== */
@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    .admin-sidebar.open {
        transform: translateX(0);
    }
    .admin-content {
        margin-left: 0;
    }
    .course-card {
        border-radius: var(--radius-lg);
    }
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fadeInUp {
    animation: fadeInUp 0.5s ease forwards;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}
.animate-slideInRight {
    animation: slideInRight 0.3s ease forwards;
}

/* ===== Live Pulse ===== */
.live-pulse {
    width: 8px;
    height: 8px;
    background: #ECA96A;
    border-radius: 50%;
    display: inline-block;
    animation: live-pulse-anim 1.5s infinite;
}
@keyframes live-pulse-anim {
    0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.6); }
    70% { box-shadow: 0 0 0 8px rgba(239,68,68,0); }
    100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
}

/* ===== Form Styles ===== */
.form-input {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    transition: all 0.2s;
    font-family: inherit;
    background-color: #ffffff !important;
    color: var(--gray-800) !important;
}
.form-input:focus {
    outline: none;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(134,68,152,0.1) !important;
}
.form-input:read-only {
    background-color: var(--gray-50) !important;
    color: var(--gray-500) !important;
}

.dark .form-input {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}
.dark .form-input:focus {
    border-color: var(--primary-light) !important;
    box-shadow: 0 0 0 3px rgba(134,68,152,0.25) !important;
}
.dark .form-input:read-only {
    background-color: #334155 !important;
    color: #94a3b8 !important;
}
.dark .form-input::placeholder {
    color: #64748b !important;
}

.form-label {
    display: block;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--gray-700);
    margin-bottom: 0.35rem;
}
.dark .form-label {
    color: #cbd5e1 !important;
}

/* ===== Post-test Question ===== */
.question-item {
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: border-color 0.2s;
}
.question-item:hover {
    border-color: var(--primary-light);
}
.question-item.answered {
    border-color: var(--success);
    background: #F0FDF4;
}
.option-radio {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    margin-top: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}
.option-radio:hover {
    border-color: var(--primary-light);
    background: var(--primary-lighter);
}
.option-radio.selected {
    border-color: var(--primary);
    background: var(--primary-lighter);
}

/* ===== Category Card ===== */
.category-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}
.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    background: var(--primary-lighter);
}
.dark .category-card:hover {
    background: #2a1535;
}
.category-card .cat-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
    font-size: 1.5rem;
}

/* ===== SweetAlert2 Overrides ===== */
.swal2-popup {
    font-size: 0.85rem !important;
}
.swal2-title {
    font-size: 1.25rem !important;
}
.swal2-html-container {
    font-size: 0.9rem !important;
}
.swal2-confirm, .swal2-cancel {
    font-size: 0.85rem !important;
}

/* ===== SweetAlert2 Dark Mode Overrides ===== */
.dark .swal2-input, 
.dark .swal2-textarea, 
.dark .swal2-select {
    background-color: #0f172a !important; /* slate-900 */
    border-color: #334155 !important; /* slate-700 */
    color: #f1f5f9 !important; /* slate-100 */
}
.dark .swal2-input:focus, 
.dark .swal2-textarea:focus, 
.dark .swal2-select:focus {
    border-color: var(--primary-light) !important;
    box-shadow: 0 0 0 3px rgba(134,68,152,0.25) !important;
}
.dark .swal2-validation-message {
    background-color: #334155 !important;
    color: #f87171 !important; /* red-400 */
}

/* ===== CrSelect — Custom Dropdown ===== */
.cr-select-wrapper {
    position: relative;
}
.cr-select-btn.form-input {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    cursor: pointer;
    background: #fff;
    text-align: left;
    white-space: nowrap;
    user-select: none;
}
.cr-select-btn.form-input:hover {
    border-color: var(--primary-light);
}
.cr-select-btn.open {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(134,68,152,0.1) !important;
}
.cr-select-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: inherit;
}
.cr-select-chevron {
    flex-shrink: 0;
    font-size: 0.7rem;
    color: var(--gray-400);
    transition: transform 0.18s ease, color 0.18s ease;
}
.cr-select-btn.open .cr-select-chevron {
    transform: rotate(180deg);
    color: var(--primary);
}
.cr-select-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 100%;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 24px rgba(134,68,152,0.12), 0 2px 8px rgba(0,0,0,0.06);
    z-index: 9999;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
}
.cr-select-dropdown.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}
.cr-select-dropdown.align-right {
    left: auto;
    right: 0;
}
.cr-select-list {
    max-height: 220px;
    overflow-y: auto;
    padding: 0.3rem;
    margin: 0;
    list-style: none;
}
.cr-select-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--gray-700);
    transition: background 0.1s, color 0.1s;
    font-family: inherit;
    white-space: nowrap;
}
.cr-select-item:hover {
    background: var(--primary-lighter);
    color: var(--primary-dark);
}
.cr-select-item.active {
    background: var(--primary-lighter);
    color: var(--primary);
    font-weight: 700;
}
.cr-select-check {
    margin-left: auto;
    font-size: 0.7rem;
    color: var(--primary);
    display: none;
    flex-shrink: 0;
}
.cr-select-item.active .cr-select-check {
    display: block;
}

/* ===== CrSelect Dark Mode ===== */
.dark .cr-select-btn.form-input {
    background: #1E293B;
    border-color: #334155;
    color: #F3F4F6;
}
.dark .cr-select-btn.form-input:hover {
    border-color: var(--primary-light);
}
.dark .cr-select-dropdown {
    background: #1E293B;
    border-color: #334155;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.dark .cr-select-item {
    color: #E2E8F0;
}
.dark .cr-select-item:hover {
    background: #334155;
    color: #F8FAFC;
}
.dark .cr-select-item.active {
    background: rgba(134,68,152,0.25);
    color: var(--primary-light);
}
.dark .cr-select-chevron {
    color: #94A3B8;
}

#enrollments-app.data-table thead th { text-align: center; }
#enrollments-app.data-table thead th:first-child { text-align: left; }
#enrollments-app.data-table tbody td { text-align: center; }
#enrollments-app.data-table tbody td:first-child { text-align: left; }  

#enrollments-pay.data-table thead th { text-align: center; }
#enrollments-pay.data-table thead th:nth-child(3) { text-align: left; }
#enrollments-pay.data-table tbody td { text-align: center; }
#enrollments-pay.data-table tbody td:first-child,
#enrollments-pay.data-table tbody td:nth-child(2),
#enrollments-pay.data-table tbody td:nth-child(3) { text-align: left; }  

#courses-table.data-table thead th { text-align: center; }
#courses-table.data-table thead th:first-child { text-align: left; }
#courses-table.data-table tbody td { text-align: center; }
#courses-table.data-table tbody td:first-child { text-align: left; }

#enrollees-table.data-table thead th { text-align: center; }
#enrollees-table.data-table thead th:first-child { text-align: left; }
#enrollees-table.data-table tbody td { text-align: center; }
#enrollees-table.data-table tbody td:first-child { text-align: left; }  

#ads-table.data-table thead th { text-align: center; }
#ads-table.data-table thead th:first-child { text-align: left; }
#ads-table.data-table tbody td { text-align: center; }
#ads-table.data-table tbody td:first-child { text-align: left; }  

#courses-table-student.data-table thead th { text-align: center; }
#courses-table-student.data-table thead th:first-child { text-align: left; }
#courses-table-student.data-table tbody td { text-align: center; }
#courses-table-student.data-table tbody td:first-child { text-align: left; }  

#courses-table-ad.data-table thead th { text-align: center; }
#courses-table-ad.data-table thead th:first-child { text-align: left; }
#courses-table-ad.data-table tbody td { text-align: center; }
#courses-table-ad.data-table tbody td:first-child { text-align: left; }  