/* ==========================================================================
   XtClasses LMS - Core theme (shared by every layout)
   --------------------------------------------------------------------------
   1. Fonts          6. Dashboard layout     11. Pagination
   2. Theme tokens   7. Sidebar              12. Toastr skin
   3. Bootstrap      8. Topbar               13. Select2 skin
   4. Base           9. Cards & widgets      14. Auth layout
   5. Components    10. Tables & toolbar     15. Player layout
   ========================================================================== */

/* 1. Fonts ---------------------------------------------------------------- */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("../vendor/inter/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("../vendor/inter/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("../vendor/inter/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("../vendor/inter/inter-latin-700-normal.woff2") format("woff2"); }

/* 2. Theme tokens - change the brand here ---------------------------------- */
:root {
    --xt-primary: #4f46e5;
    --xt-primary-rgb: 79, 70, 229;
    --xt-primary-dark: #3730a3;
    --xt-primary-light: #eef2ff;
    --xt-secondary: #0ea5e9;
    --xt-secondary-rgb: 14, 165, 233;
    --xt-success: #10b981;
    --xt-success-rgb: 16, 185, 129;
    --xt-warning: #f59e0b;
    --xt-warning-rgb: 245, 158, 11;
    --xt-danger: #ef4444;
    --xt-danger-rgb: 239, 68, 68;
    --xt-info: #06b6d4;
    --xt-info-rgb: 6, 182, 212;

    --xt-dark: #111827;
    --xt-body: #374151;
    --xt-heading: #111827;
    --xt-muted: #6b7280;
    --xt-border: #e5e7eb;
    --xt-bg: #f5f7fb;
    --xt-white: #ffffff;

    --xt-sidebar-bg: #111827;
    --xt-sidebar-text: #9ca3af;
    --xt-sidebar-hover: rgba(255, 255, 255, .06);
    --xt-sidebar-width: 260px;
    --xt-sidebar-mini: 76px;
    --xt-topbar-height: 64px;

    --xt-radius: 12px;
    --xt-radius-sm: 8px;
    --xt-radius-lg: 16px;
    --xt-shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
    --xt-shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
    --xt-shadow-md: 0 6px 16px rgba(16, 24, 40, .08);
    --xt-shadow-lg: 0 16px 40px rgba(16, 24, 40, .12);
    --xt-transition: .2s ease;
    --xt-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* 3. Bootstrap overrides ---------------------------------------------------- */
:root {
    --bs-primary: var(--xt-primary);
    --bs-primary-rgb: var(--xt-primary-rgb);
    --bs-secondary-rgb: 100, 116, 139;
    --bs-success: var(--xt-success);
    --bs-success-rgb: var(--xt-success-rgb);
    --bs-warning: var(--xt-warning);
    --bs-warning-rgb: var(--xt-warning-rgb);
    --bs-danger: var(--xt-danger);
    --bs-danger-rgb: var(--xt-danger-rgb);
    --bs-info: var(--xt-info);
    --bs-info-rgb: var(--xt-info-rgb);
    --bs-body-font-family: var(--xt-font);
    --bs-body-color: var(--xt-body);
    --bs-body-font-size: .9375rem;
    --bs-heading-color: var(--xt-heading);
    --bs-border-color: var(--xt-border);
    --bs-border-radius: var(--xt-radius-sm);
    --bs-border-radius-lg: var(--xt-radius);
    --bs-link-color: var(--xt-primary);
    --bs-link-color-rgb: var(--xt-primary-rgb);
    --bs-link-hover-color: var(--xt-primary-dark);
    --bs-link-hover-color-rgb: 55, 48, 163;
    --bs-primary-bg-subtle: var(--xt-primary-light);
    --bs-primary-text-emphasis: var(--xt-primary-dark);
    --bs-secondary-color: var(--xt-muted);
    --bs-focus-ring-color: rgba(var(--xt-primary-rgb), .2);
}

.btn { --bs-btn-font-weight: 500; --bs-btn-padding-x: 1rem; --bs-btn-padding-y: .5rem; --bs-btn-font-size: .9rem; border-radius: var(--xt-radius-sm); transition: all var(--xt-transition); }
.btn-sm { --bs-btn-padding-x: .7rem; --bs-btn-padding-y: .3rem; --bs-btn-font-size: .8125rem; }
.btn-lg { --bs-btn-padding-x: 1.5rem; --bs-btn-padding-y: .75rem; --bs-btn-font-size: 1rem; }
.btn-primary {
    --bs-btn-bg: var(--xt-primary); --bs-btn-border-color: var(--xt-primary);
    --bs-btn-hover-bg: var(--xt-primary-dark); --bs-btn-hover-border-color: var(--xt-primary-dark);
    --bs-btn-active-bg: var(--xt-primary-dark); --bs-btn-active-border-color: var(--xt-primary-dark);
    --bs-btn-disabled-bg: var(--xt-primary); --bs-btn-disabled-border-color: var(--xt-primary);
    --bs-btn-focus-shadow-rgb: var(--xt-primary-rgb);
    box-shadow: 0 1px 2px rgba(var(--xt-primary-rgb), .25);
}
.btn-outline-primary {
    --bs-btn-color: var(--xt-primary); --bs-btn-border-color: var(--xt-primary);
    --bs-btn-hover-bg: var(--xt-primary); --bs-btn-hover-border-color: var(--xt-primary);
    --bs-btn-active-bg: var(--xt-primary-dark); --bs-btn-active-border-color: var(--xt-primary-dark);
    --bs-btn-focus-shadow-rgb: var(--xt-primary-rgb);
}
.btn-success { --bs-btn-bg: var(--xt-success); --bs-btn-border-color: var(--xt-success); --bs-btn-hover-bg: #059669; --bs-btn-hover-border-color: #059669; }
.btn-danger  { --bs-btn-bg: var(--xt-danger);  --bs-btn-border-color: var(--xt-danger);  --bs-btn-hover-bg: #dc2626; --bs-btn-hover-border-color: #dc2626; }
.btn-light   { --bs-btn-bg: #f3f4f6; --bs-btn-border-color: #f3f4f6; --bs-btn-hover-bg: #e5e7eb; --bs-btn-hover-border-color: #e5e7eb; --bs-btn-color: var(--xt-body); }
.btn-white   { background: #fff; border: 1px solid var(--xt-border); color: var(--xt-body); }
.btn-white:hover { background: #f9fafb; border-color: #d1d5db; color: var(--xt-heading); }
.btn-soft-primary { background: var(--xt-primary-light); color: var(--xt-primary); border: 0; }
.btn-soft-primary:hover { background: var(--xt-primary); color: #fff; }
.btn-icon { width: 36px; height: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.btn-icon.btn-sm { width: 30px; height: 30px; }
.btn .spinner-border { width: 1rem; height: 1rem; border-width: .15em; }

.form-control, .form-select { border-color: #d1d5db; border-radius: var(--xt-radius-sm); padding: .55rem .85rem; font-size: .9rem; color: var(--xt-heading); }
.form-control-sm, .form-select-sm { padding: .35rem .7rem; font-size: .8125rem; }
.form-control-lg { padding: .75rem 1rem; font-size: 1rem; }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: var(--xt-primary); box-shadow: 0 0 0 .2rem rgba(var(--xt-primary-rgb), .15); }
.form-control::placeholder { color: #9ca3af; }
.form-label { font-weight: 500; font-size: .875rem; color: var(--xt-heading); margin-bottom: .4rem; }
.form-label .req { color: var(--xt-danger); margin-left: 2px; }
.form-text { font-size: .8rem; color: var(--xt-muted); }
.form-check-input:checked { background-color: var(--xt-primary); border-color: var(--xt-primary); }
.input-group-text { background: #f9fafb; border-color: #d1d5db; color: var(--xt-muted); }
.invalid-feedback { font-size: .8rem; }

.dropdown-menu { border: 1px solid var(--xt-border); border-radius: var(--xt-radius); box-shadow: var(--xt-shadow-lg); padding: .4rem; font-size: .9rem; }
.dropdown-item { border-radius: 6px; padding: .5rem .75rem; display: flex; align-items: center; gap: .6rem; color: var(--xt-body); }
.dropdown-item i { color: var(--xt-muted); font-size: 1rem; }
.dropdown-item:hover, .dropdown-item:focus { background: #f3f4f6; color: var(--xt-heading); }
.dropdown-item:active, .dropdown-item.active { background: var(--xt-primary-light); color: var(--xt-primary); }
.dropdown-item.text-danger i { color: var(--xt-danger); }
.dropdown-header { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--xt-muted); }

.modal-content { border: 0; border-radius: var(--xt-radius-lg); box-shadow: var(--xt-shadow-lg); }
.modal-header { border-bottom-color: var(--xt-border); padding: 1rem 1.5rem; }
.modal-body { padding: 1.5rem; }
.modal-footer { border-top-color: var(--xt-border); padding: .9rem 1.5rem; }
.modal-backdrop.show { opacity: .45; }

.nav-tabs { border-bottom-color: var(--xt-border); gap: .25rem; }
.nav-tabs .nav-link { border: 0; border-bottom: 2px solid transparent; color: var(--xt-muted); font-weight: 500; padding: .75rem 1rem; }
.nav-tabs .nav-link:hover { color: var(--xt-heading); border-bottom-color: #d1d5db; }
.nav-tabs .nav-link.active { color: var(--xt-primary); border-bottom-color: var(--xt-primary); background: transparent; }
.nav-pills .nav-link { color: var(--xt-body); font-weight: 500; border-radius: var(--xt-radius-sm); }
.nav-pills .nav-link.active { background: var(--xt-primary); }

.progress { --bs-progress-height: .5rem; --bs-progress-bg: #eef0f4; --bs-progress-border-radius: 99px; --bs-progress-bar-bg: var(--xt-primary); }
.alert { border-radius: var(--xt-radius); border: 0; font-size: .9rem; }
.breadcrumb { --bs-breadcrumb-divider: "›"; font-size: .8125rem; margin: 0; }
.breadcrumb-item a { color: var(--xt-muted); text-decoration: none; }
.breadcrumb-item a:hover { color: var(--xt-primary); }
.breadcrumb-item.active { color: var(--xt-heading); }
.tooltip { --bs-tooltip-bg: var(--xt-dark); --bs-tooltip-font-size: .78rem; }
.offcanvas { border: 0 !important; }

/* 4. Base ---------------------------------------------------------------- */
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--xt-font); background: var(--xt-bg); color: var(--xt-body); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { color: var(--xt-heading); font-weight: 700; letter-spacing: -.01em; }
a { text-decoration: none; }
img { max-width: 100%; }
::selection { background: rgba(var(--xt-primary-rgb), .18); }
.text-primary { color: var(--xt-primary) !important; }
.text-muted { color: var(--xt-muted) !important; }
.text-heading { color: var(--xt-heading) !important; }
.bg-primary { background-color: var(--xt-primary) !important; }
.bg-primary-light { background-color: var(--xt-primary-light) !important; }
.fw-medium { font-weight: 500 !important; }
.fw-semibold { font-weight: 600 !important; }
.fs-13 { font-size: .8125rem !important; }
.fs-14 { font-size: .875rem !important; }
.min-w-0 { min-width: 0; }
.text-truncate-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cursor-pointer { cursor: pointer; }
.skip-link { position: absolute; left: -999px; top: 0; z-index: 2000; background: var(--xt-primary); color: #fff; padding: .5rem 1rem; border-radius: 0 0 8px 0; }
.skip-link:focus { left: 0; }

/* Scrollbars (webkit) */
.xt-scroll::-webkit-scrollbar { width: 6px; height: 6px; }
.xt-scroll::-webkit-scrollbar-thumb { background: rgba(156, 163, 175, .4); border-radius: 99px; }
.xt-scroll::-webkit-scrollbar-track { background: transparent; }

/* 5. Components --------------------------------------------------------- */
/* Soft badges */
.badge { font-weight: 600; font-size: .72rem; padding: .38em .7em; border-radius: 6px; letter-spacing: .01em; }
.badge-soft-primary   { background: rgba(var(--xt-primary-rgb), .1);   color: var(--xt-primary); }
.badge-soft-secondary { background: #f1f5f9; color: #475569; }
.badge-soft-success   { background: rgba(var(--xt-success-rgb), .12); color: #047857; }
.badge-soft-warning   { background: rgba(var(--xt-warning-rgb), .14); color: #b45309; }
.badge-soft-danger    { background: rgba(var(--xt-danger-rgb), .1);   color: #b91c1c; }
.badge-soft-info      { background: rgba(var(--xt-info-rgb), .12);    color: #0e7490; }
.badge-dot::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: .4em; vertical-align: middle; position: relative; top: -1px; }

/* Avatars */
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: .875rem; background: var(--xt-primary-light); color: var(--xt-primary); }
.avatar-xs { width: 28px; height: 28px; font-size: .7rem; }
.avatar-sm { width: 34px; height: 34px; font-size: .78rem; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.1rem; }
.avatar-xl { width: 96px; height: 96px; font-size: 1.75rem; }

/* Icon boxes */
.icon-box { width: 44px; height: 44px; border-radius: var(--xt-radius-sm); display: inline-flex; align-items: center; justify-content: center; font-size: 1.25rem; flex-shrink: 0; }
.icon-box-sm { width: 34px; height: 34px; font-size: 1rem; }
.icon-box-lg { width: 56px; height: 56px; font-size: 1.5rem; border-radius: var(--xt-radius); }
.icon-box.primary { background: rgba(var(--xt-primary-rgb), .1);   color: var(--xt-primary); }
.icon-box.success { background: rgba(var(--xt-success-rgb), .12);  color: var(--xt-success); }
.icon-box.warning { background: rgba(var(--xt-warning-rgb), .14);  color: var(--xt-warning); }
.icon-box.danger  { background: rgba(var(--xt-danger-rgb), .1);    color: var(--xt-danger); }
.icon-box.info    { background: rgba(var(--xt-secondary-rgb), .12); color: var(--xt-secondary); }

/* Empty state */
.empty-state { text-align: center; padding: 3rem 1rem; }
.empty-state .icon-box { margin-bottom: 1rem; }
.empty-state h6 { margin-bottom: .35rem; }
.empty-state p { color: var(--xt-muted); font-size: .875rem; max-width: 360px; margin: 0 auto 1rem; }

/* Course thumbnail placeholder (used until real images exist) */
.thumb-placeholder { display: flex; align-items: center; justify-content: center; color: rgba(255, 255, 255, .9); font-size: 2.5rem; background: linear-gradient(135deg, var(--xt-primary), var(--xt-secondary)); }
.thumb-placeholder.v2 { background: linear-gradient(135deg, #0ea5e9, #10b981); }
.thumb-placeholder.v3 { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.thumb-placeholder.v4 { background: linear-gradient(135deg, #8b5cf6, #ec4899); }
.thumb-placeholder.v5 { background: linear-gradient(135deg, #111827, #4f46e5); }
.thumb-placeholder.v6 { background: linear-gradient(135deg, #06b6d4, #4f46e5); }

/* Brand */
.xt-brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 700; font-size: 1.25rem; color: var(--xt-heading); letter-spacing: -.02em; }
.xt-brand:hover { color: var(--xt-heading); }
.xt-brand-icon { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, var(--xt-primary), #7c3aed); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 1.15rem; flex-shrink: 0; box-shadow: 0 4px 12px rgba(var(--xt-primary-rgb), .35); }
.xt-brand-logo { max-height: 36px; width: auto; }
.xt-brand span b { color: var(--xt-primary); font-weight: 700; }

/* Page loader bar for AJAX requests */
.xt-ajax-bar { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: linear-gradient(90deg, var(--xt-primary), var(--xt-secondary)); z-index: 3000; transition: width .4s ease, opacity .3s ease; opacity: 0; }
.xt-ajax-bar.active { opacity: 1; width: 75%; }
.xt-ajax-bar.done { width: 100%; opacity: 0; }

/* Image upload preview */
.upload-preview { width: 100%; max-width: 240px; aspect-ratio: 16 / 9; border: 2px dashed #d1d5db; border-radius: var(--xt-radius); display: flex; align-items: center; justify-content: center; overflow: hidden; background: #f9fafb; color: var(--xt-muted); }
.upload-preview img { width: 100%; height: 100%; object-fit: cover; }
.upload-preview.square { aspect-ratio: 1; max-width: 120px; border-radius: 50%; }

/* 6. Dashboard layout --------------------------------------------------- */
.xt-wrapper { min-height: 100vh; }
.xt-main { margin-left: var(--xt-sidebar-width); min-height: 100vh; display: flex; flex-direction: column; }
.xt-content { flex: 1; padding: 1.75rem; }
.xt-footer { padding: 1rem 1.75rem; font-size: .8125rem; color: var(--xt-muted); border-top: 1px solid var(--xt-border); background: #fff; }

.page-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.page-header h1, .page-header .page-title { font-size: 1.4rem; margin: 0 0 .25rem; }
.page-header .page-actions { display: flex; flex-wrap: wrap; gap: .5rem; }

/* 7. Sidebar ------------------------------------------------------------- */
.xt-sidebar { position: fixed; top: 0; bottom: 0; left: 0; z-index: 1040; width: var(--xt-sidebar-width); background: var(--xt-sidebar-bg); color: var(--xt-sidebar-text); display: flex; flex-direction: column; }
/* Animate only after a user toggle, never on page load / window resize */
.xt-animate .xt-sidebar { transition: width var(--xt-transition), transform var(--xt-transition); }
.xt-animate .xt-main { transition: margin-left var(--xt-transition); }
.xt-sidebar-brand { height: var(--xt-topbar-height); display: flex; align-items: center; justify-content: space-between; padding: 0 1.25rem; border-bottom: 1px solid rgba(255, 255, 255, .06); flex-shrink: 0; }
.xt-sidebar-brand .xt-brand { color: #fff; white-space: nowrap; overflow: hidden; }
.xt-sidebar-brand .xt-brand span b { color: #a5b4fc; }
.xt-sidebar-nav { flex: 1; overflow-y: auto; padding: 1rem .75rem; }
.xt-nav-section { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; color: #6b7280; padding: 1rem .75rem .5rem; white-space: nowrap; }
.xt-nav-section:first-child { padding-top: 0; }
.xt-nav-link { display: flex; align-items: center; gap: .8rem; padding: .62rem .75rem; margin-bottom: 2px; border-radius: var(--xt-radius-sm); color: var(--xt-sidebar-text); font-weight: 500; font-size: .9rem; white-space: nowrap; transition: background var(--xt-transition), color var(--xt-transition); position: relative; }
.xt-nav-link i { font-size: 1.1rem; width: 22px; text-align: center; flex-shrink: 0; }
.xt-nav-link:hover { background: var(--xt-sidebar-hover); color: #fff; }
.xt-nav-link.active { background: var(--xt-primary); color: #fff; box-shadow: 0 4px 12px rgba(var(--xt-primary-rgb), .35); }
.xt-nav-link .badge { margin-left: auto; }
.xt-sidebar-footer { padding: 1rem; border-top: 1px solid rgba(255, 255, 255, .06); flex-shrink: 0; }
.xt-sidebar-user { display: flex; align-items: center; gap: .7rem; color: #fff; min-width: 0; }
.xt-sidebar-user small { color: var(--xt-sidebar-text); display: block; font-size: .75rem; }
.xt-sidebar-backdrop { position: fixed; inset: 0; background: rgba(17, 24, 39, .5); z-index: 1035; opacity: 0; visibility: hidden; transition: opacity var(--xt-transition), visibility var(--xt-transition); }

/* Desktop: collapsed "mini" sidebar */
@media (min-width: 992px) {
    .sidebar-mini .xt-sidebar { width: var(--xt-sidebar-mini); }
    .sidebar-mini .xt-main { margin-left: var(--xt-sidebar-mini); }
    .sidebar-mini .xt-sidebar .xt-brand span,
    .sidebar-mini .xt-sidebar .xt-nav-link span,
    .sidebar-mini .xt-sidebar .xt-nav-link .badge,
    .sidebar-mini .xt-sidebar .xt-sidebar-user > div { display: none; }
    .sidebar-mini .xt-sidebar .xt-nav-section { font-size: 0; padding: .5rem 0; border-top: 1px solid rgba(255, 255, 255, .06); margin-top: .5rem; }
    .sidebar-mini .xt-sidebar .xt-nav-section:first-child { border-top: 0; margin-top: 0; }
    .sidebar-mini .xt-sidebar .xt-nav-link { justify-content: center; padding: .7rem; }
    .sidebar-mini .xt-sidebar .xt-sidebar-brand { justify-content: center; padding: 0; }
    .sidebar-mini .xt-sidebar .xt-sidebar-user { justify-content: center; }
}

/* Tablet & mobile: off-canvas sidebar */
@media (max-width: 991.98px) {
    .xt-sidebar { transform: translateX(-100%); box-shadow: var(--xt-shadow-lg); }
    .xt-main { margin-left: 0; }
    .sidebar-open .xt-sidebar { transform: translateX(0); }
    .sidebar-open .xt-sidebar-backdrop { opacity: 1; visibility: visible; }
    .sidebar-open { overflow: hidden; }
}

/* 8. Topbar ------------------------------------------------------------- */
.xt-topbar { position: sticky; top: 0; z-index: 1030; height: var(--xt-topbar-height); background: rgba(255, 255, 255, .92); backdrop-filter: saturate(180%) blur(8px); border-bottom: 1px solid var(--xt-border); display: flex; align-items: center; gap: .75rem; padding: 0 1.75rem; }
.xt-topbar .btn-toggle { border: 0; background: transparent; color: var(--xt-body); font-size: 1.35rem; padding: .25rem; line-height: 1; border-radius: 6px; }
.xt-topbar .btn-toggle:hover { background: #f3f4f6; }
.xt-topbar-search { position: relative; max-width: 360px; width: 100%; }
.xt-topbar-search i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: #9ca3af; }
.xt-topbar-search .form-control { padding-left: 2.4rem; background: #f3f4f6; border-color: transparent; }
.xt-topbar-search .form-control:focus { background: #fff; }
.xt-topbar-actions { margin-left: auto; display: flex; align-items: center; gap: .35rem; }
.xt-topbar-icon { position: relative; width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--xt-body); font-size: 1.2rem; border: 0; background: transparent; }
.xt-topbar-icon:hover { background: #f3f4f6; color: var(--xt-heading); }
.xt-topbar-icon .dot { position: absolute; top: 8px; right: 9px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--xt-danger); color: #fff; font-size: .62rem; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; }
.xt-user-toggle { display: flex; align-items: center; gap: .6rem; border: 0; background: transparent; padding: .25rem .5rem .25rem .25rem; border-radius: 99px; color: var(--xt-heading); }
.xt-user-toggle:hover { background: #f3f4f6; }
.xt-user-toggle .name { font-weight: 600; font-size: .875rem; line-height: 1.1; text-align: left; }
.xt-user-toggle .name small { display: block; font-weight: 400; color: var(--xt-muted); font-size: .75rem; }

.notif-menu { width: 340px; max-width: calc(100vw - 1.5rem); padding: 0; overflow: hidden; }
.notif-menu .notif-head { display: flex; align-items: center; justify-content: space-between; padding: .85rem 1rem; border-bottom: 1px solid var(--xt-border); }
.notif-menu .notif-list { max-height: 340px; overflow-y: auto; }
.notif-item { display: flex; gap: .75rem; padding: .8rem 1rem; border-bottom: 1px solid #f3f4f6; color: var(--xt-body); font-size: .85rem; }
.notif-item:hover { background: #f9fafb; color: var(--xt-body); }
.notif-item.unread { background: rgba(var(--xt-primary-rgb), .04); }
.notif-item small { color: var(--xt-muted); }
.notif-menu .notif-foot { display: block; text-align: center; padding: .7rem; font-size: .85rem; font-weight: 500; }

@media (max-width: 575.98px) {
    .xt-topbar { padding: 0 1rem; }
    .xt-content { padding: 1.25rem 1rem; }
    .xt-footer { padding: 1rem; text-align: center; }
    .page-header h1, .page-header .page-title { font-size: 1.2rem; }
    .page-header .page-actions { width: 100%; }
    .page-header .page-actions .btn { flex: 1; }
}

/* 9. Cards & widgets ---------------------------------------------------- */
.card { --bs-card-border-color: var(--xt-border); --bs-card-border-radius: var(--xt-radius); --bs-card-inner-border-radius: calc(var(--xt-radius) - 1px); --bs-card-cap-bg: #fff; --bs-card-spacer-x: 1.25rem; --bs-card-spacer-y: 1.25rem; box-shadow: var(--xt-shadow); }
.card-header { padding: 1rem 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.card-title { font-size: 1rem; font-weight: 600; margin: 0; color: var(--xt-heading); }
.card-footer { background: #fff; padding: .85rem 1.25rem; }
.card-hover { transition: transform var(--xt-transition), box-shadow var(--xt-transition); }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--xt-shadow-md); }

.stat-card .card-body { display: flex; align-items: flex-start; gap: 1rem; }
.stat-card .stat-label { color: var(--xt-muted); font-size: .8125rem; font-weight: 500; margin-bottom: .25rem; }
.stat-card .stat-value { font-size: 1.6rem; font-weight: 700; color: var(--xt-heading); line-height: 1.2; }
.stat-card .stat-trend { font-size: .78rem; font-weight: 600; margin-top: .35rem; }
.stat-card .stat-trend.up { color: var(--xt-success); }
.stat-card .stat-trend.down { color: var(--xt-danger); }

.welcome-card { background: linear-gradient(135deg, var(--xt-primary) 0%, #7c3aed 100%); color: #fff; border: 0; overflow: hidden; position: relative; }
.welcome-card::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255, 255, 255, .08); }
.welcome-card h4, .welcome-card h5 { color: #fff; }
.welcome-card p { color: rgba(255, 255, 255, .85); }

.activity-list { list-style: none; margin: 0; padding: 0; }
.activity-list li { display: flex; gap: .85rem; padding: .75rem 0; border-bottom: 1px dashed var(--xt-border); }
.activity-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.activity-list .title { font-size: .875rem; color: var(--xt-heading); font-weight: 500; }
.activity-list small { color: var(--xt-muted); font-size: .78rem; }

.chart-box { position: relative; height: 300px; }
@media (max-width: 575.98px) { .chart-box { height: 240px; } }

/* 10. Tables & list toolbar --------------------------------------------- */
.table { --bs-table-color: var(--xt-body); --bs-table-border-color: var(--xt-border); --bs-table-hover-bg: #f9fafb; margin-bottom: 0; font-size: .875rem; }
.table > thead th { background: #f9fafb; color: var(--xt-muted); font-weight: 600; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; padding: .8rem 1rem; white-space: nowrap; border-bottom-width: 1px; }
.table > tbody td { padding: .85rem 1rem; vertical-align: middle; }
.table > tbody tr:last-child td { border-bottom: 0; }
.table .th-sort { color: inherit; display: inline-flex; align-items: center; gap: .3rem; }
.table .th-sort:hover, .table .th-sort.active { color: var(--xt-primary); }
.table .th-sort i { font-size: .75rem; }
.table-user { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.table-user .name { font-weight: 600; color: var(--xt-heading); display: block; }
.table-user small { color: var(--xt-muted); }
.table-actions { display: flex; justify-content: flex-end; gap: .35rem; white-space: nowrap; }
.card > .table-responsive { border-radius: 0 0 var(--xt-radius) var(--xt-radius); }
.card > .table-responsive:first-child { border-radius: var(--xt-radius) var(--xt-radius) 0 0; }

.list-toolbar { padding: 1rem 1.25rem; border-bottom: 1px solid var(--xt-border); }
.list-toolbar .search-box { position: relative; }
.list-toolbar .search-box > i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: #9ca3af; pointer-events: none; z-index: 2; }
.list-toolbar .search-box .form-control { padding-left: 2.4rem; }
.list-toolbar .search-box .search-spinner { position: absolute; right: .85rem; top: 50%; margin-top: -.5rem; width: 1rem; height: 1rem; display: none; }
.list-toolbar.is-loading .search-spinner { display: block; }

.list-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; padding: .9rem 1.25rem; border-top: 1px solid var(--xt-border); font-size: .8125rem; color: var(--xt-muted); }
.list-footer .per-page { display: flex; align-items: center; gap: .5rem; }
.list-footer .per-page .form-select { width: auto; }

@media (max-width: 767.98px) {
    .list-footer { justify-content: center; text-align: center; }
    .table > thead th, .table > tbody td { padding-left: .75rem; padding-right: .75rem; }
}

/* 11. Pagination -------------------------------------------------------- */
.pagination { --bs-pagination-color: var(--xt-body); --bs-pagination-border-color: var(--xt-border); --bs-pagination-hover-bg: #f3f4f6; --bs-pagination-hover-color: var(--xt-heading); --bs-pagination-hover-border-color: var(--xt-border); --bs-pagination-active-bg: var(--xt-primary); --bs-pagination-active-border-color: var(--xt-primary); --bs-pagination-focus-box-shadow: 0 0 0 .2rem rgba(var(--xt-primary-rgb), .15); --bs-pagination-font-size: .85rem; --bs-pagination-disabled-color: #c0c4cc; gap: 4px; margin: 0; flex-wrap: wrap; }
.pagination .page-link { border-radius: var(--xt-radius-sm) !important; min-width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; font-weight: 500; }
.pagination-sm .page-link { min-width: 30px; height: 30px; }

/* 12. Toastr skin ------------------------------------------------------- */
#toast-container > div { opacity: 1; border-radius: var(--xt-radius); box-shadow: var(--xt-shadow-lg); padding: 14px 16px 14px 52px; width: 340px; max-width: calc(100vw - 24px); font-family: var(--xt-font); font-size: .875rem; background-position: 16px center; background-size: 22px; }
#toast-container > div:hover { box-shadow: var(--xt-shadow-lg); }
#toast-container > .toast-success { background-color: #059669; }
#toast-container > .toast-error   { background-color: #dc2626; }
#toast-container > .toast-warning { background-color: #d97706; }
#toast-container > .toast-info    { background-color: var(--xt-primary); }
#toast-container .toast-title { font-weight: 600; margin-bottom: 2px; }
#toast-container .toast-progress { opacity: .35; height: 3px; }
#toast-container.toast-top-right { top: 16px; right: 16px; }
@media (max-width: 575.98px) {
    #toast-container.toast-top-right { right: 12px; left: 12px; top: 12px; }
    #toast-container > div { width: 100%; }
}

/* 13. Select2 skin (on top of the bootstrap-5 theme) -------------------- */
.select2-container--bootstrap-5 .select2-selection { border-color: #d1d5db; border-radius: var(--xt-radius-sm); min-height: calc(1.5em + 1.1rem + 2px); font-size: .9rem; }
.select2-container--bootstrap-5.select2-container--focus .select2-selection,
.select2-container--bootstrap-5.select2-container--open .select2-selection { border-color: var(--xt-primary); box-shadow: 0 0 0 .2rem rgba(var(--xt-primary-rgb), .15); }
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered { color: var(--xt-heading); }
.select2-container--bootstrap-5 .select2-dropdown { border-color: var(--xt-border); border-radius: var(--xt-radius-sm); box-shadow: var(--xt-shadow-lg); font-size: .9rem; }
.select2-container--bootstrap-5 .select2-dropdown .select2-results__options .select2-results__option.select2-results__option--highlighted { background: var(--xt-primary-light); color: var(--xt-primary); }
.select2-container--bootstrap-5 .select2-dropdown .select2-results__options .select2-results__option.select2-results__option--selected,
.select2-container--bootstrap-5 .select2-dropdown .select2-results__options .select2-results__option[aria-selected=true]:not(.select2-results__option--highlighted) { background: var(--xt-primary); color: #fff; }
.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered .select2-selection__choice { background: var(--xt-primary-light); border-color: transparent; color: var(--xt-primary); border-radius: 6px; font-weight: 500; }
.select2-container--bootstrap-5 .select2-dropdown .select2-search .select2-search__field:focus { border-color: var(--xt-primary); box-shadow: 0 0 0 .2rem rgba(var(--xt-primary-rgb), .15); }
.is-invalid + .select2-container--bootstrap-5 .select2-selection { border-color: var(--xt-danger); }
.form-select-sm + .select2-container--bootstrap-5 .select2-selection { min-height: calc(1.5em + .7rem + 2px); font-size: .8125rem; }

/* 14. Auth layout ------------------------------------------------------- */
.xt-auth { min-height: 100vh; display: flex; background: #fff; }
.xt-auth-aside { flex: 0 0 46%; max-width: 46%; background: linear-gradient(150deg, var(--xt-primary) 0%, #6d28d9 60%, #312e81 100%); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.xt-auth-aside::before, .xt-auth-aside::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .07); }
.xt-auth-aside::before { width: 420px; height: 420px; right: -140px; top: -120px; }
.xt-auth-aside::after { width: 300px; height: 300px; left: -100px; bottom: -100px; }
.xt-auth-aside > * { position: relative; z-index: 1; }
.xt-auth-aside .xt-brand { color: #fff; }
.xt-auth-aside .xt-brand span b { color: #c7d2fe; }
.xt-auth-aside .xt-brand-icon { background: rgba(255, 255, 255, .15); box-shadow: none; }
.xt-auth-aside h2 { color: #fff; font-size: 2.1rem; line-height: 1.25; margin-bottom: 1rem; }
.xt-auth-aside p { color: rgba(255, 255, 255, .8); font-size: 1.02rem; }
.xt-auth-points { list-style: none; padding: 0; margin: 2rem 0 0; }
.xt-auth-points li { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; color: rgba(255, 255, 255, .92); }
.xt-auth-points i { width: 32px; height: 32px; border-radius: 8px; background: rgba(255, 255, 255, .14); display: inline-flex; align-items: center; justify-content: center; }
.xt-auth-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 2.5rem 1.5rem; }
.xt-auth-box { width: 100%; max-width: 420px; }
.xt-auth-box h1 { font-size: 1.65rem; margin-bottom: .4rem; }
.xt-auth-box .lead-sm { color: var(--xt-muted); margin-bottom: 2rem; }
.password-field { position: relative; }
.password-field .form-control { padding-right: 2.75rem; }
.password-field .toggle-password { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--xt-muted); padding: .35rem .5rem; z-index: 5; }
.password-field .form-control.is-invalid ~ .toggle-password { right: 1.9rem; }
@media (max-width: 991.98px) {
    .xt-auth-aside { display: none; }
    .xt-auth { background: var(--xt-bg); }
    .xt-auth-box { background: #fff; padding: 2rem 1.5rem; border-radius: var(--xt-radius-lg); box-shadow: var(--xt-shadow-md); }
}

/* 15. Player layout ----------------------------------------------------- */
.xt-player { min-height: 100vh; display: flex; flex-direction: column; background: #fff; }
.xt-player-top { height: 60px; background: var(--xt-dark); color: #fff; display: flex; align-items: center; gap: 1rem; padding: 0 1rem; position: sticky; top: 0; z-index: 1030; }
.xt-player-top .course-title { color: #fff; font-weight: 600; font-size: .95rem; margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xt-player-top .btn-player { color: #d1d5db; border: 1px solid rgba(255, 255, 255, .15); background: transparent; }
.xt-player-top .btn-player:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.xt-player-top .progress-wrap { display: flex; align-items: center; gap: .6rem; font-size: .8rem; color: #d1d5db; }
.xt-player-top .progress { width: 120px; --bs-progress-bg: rgba(255, 255, 255, .15); --bs-progress-bar-bg: var(--xt-success); }
.xt-player-body { flex: 1; display: flex; min-height: 0; }
.xt-player-main { flex: 1; min-width: 0; }
.xt-player-video { background: #000; }
.xt-player-video .ratio { max-height: calc(100vh - 160px); }
.xt-player-video video { width: 100%; height: 100%; background: #000; }
.xt-player-content { padding: 1.5rem 2rem 3rem; max-width: 960px; }
.xt-player-nav { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .75rem 2rem; border-bottom: 1px solid var(--xt-border); flex-wrap: wrap; }
.xt-player-side { width: 360px; flex-shrink: 0; border-left: 1px solid var(--xt-border); background: #fff; display: flex; flex-direction: column; height: calc(100vh - 60px); position: sticky; top: 60px; }
.xt-player-side .side-head { padding: 1rem 1.25rem; border-bottom: 1px solid var(--xt-border); display: flex; align-items: center; justify-content: space-between; }
.xt-player-side .side-body { flex: 1; overflow-y: auto; }
.curriculum-section { border-bottom: 1px solid var(--xt-border); }
.curriculum-section > button { width: 100%; border: 0; background: #f9fafb; padding: .9rem 1.25rem; text-align: left; display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; font-weight: 600; font-size: .875rem; color: var(--xt-heading); }
.curriculum-section > button small { display: block; font-weight: 400; color: var(--xt-muted); font-size: .75rem; margin-top: 2px; }
.curriculum-section > button i { transition: transform var(--xt-transition); margin-top: 2px; }
.curriculum-section > button.collapsed i { transform: rotate(-90deg); }
.curriculum-lesson { display: flex; align-items: flex-start; gap: .75rem; padding: .75rem 1.25rem; color: var(--xt-body); font-size: .85rem; border-left: 3px solid transparent; }
.curriculum-lesson:hover { background: #f9fafb; color: var(--xt-heading); }
.curriculum-lesson.active { background: var(--xt-primary-light); border-left-color: var(--xt-primary); color: var(--xt-primary-dark); font-weight: 500; }
.curriculum-lesson .lesson-check { font-size: 1.05rem; color: #d1d5db; flex-shrink: 0; margin-top: 1px; }
.curriculum-lesson.done .lesson-check { color: var(--xt-success); }
.curriculum-lesson small { display: flex; align-items: center; gap: .35rem; color: var(--xt-muted); font-size: .75rem; margin-top: 2px; font-weight: 400; }
.side-collapsed .xt-player-side { display: none; }
@media (max-width: 991.98px) {
    .xt-player-side { position: fixed; top: 0; right: 0; bottom: 0; height: 100vh; z-index: 1045; width: min(360px, 90vw); transform: translateX(100%); transition: transform var(--xt-transition); box-shadow: var(--xt-shadow-lg); }
    .side-open .xt-player-side { transform: translateX(0); }
    .side-collapsed .xt-player-side { display: flex; }
    .side-open .xt-sidebar-backdrop { opacity: 1; visibility: visible; z-index: 1040; }
    .xt-player-content { padding: 1.25rem 1rem 2.5rem; }
    .xt-player-nav { padding: .75rem 1rem; }
    .xt-player-top .progress-wrap { display: none; }
}
@media (max-width: 575.98px) {
    .xt-player-nav .btn { flex: 1; white-space: nowrap; }
    .xt-player-nav .btn-complete { order: -1; flex-basis: 100%; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* 16. Course builder ---------------------------------------------------- */
.drag-handle { cursor: grab; color: #9ca3af; font-size: 1.1rem; padding: 0 .15rem; touch-action: none; }
.drag-handle:hover { color: var(--xt-primary); }
.sortable-ghost { opacity: .45; background: var(--xt-primary-light) !important; }
.sortable-chosen { box-shadow: var(--xt-shadow-md); }
.curriculum-card > .card-header { background: #f9fafb; flex-wrap: nowrap; }
.lesson-row { padding: .7rem 1rem; }
.lesson-row:hover { background: #fafbff; }
.border-dashed { border: 2px dashed #d1d5db !important; color: var(--xt-muted); }
.border-dashed:hover { border-color: var(--xt-primary) !important; color: var(--xt-primary); }
.object-fit-cover { object-fit: cover; }

/* Summernote: match the theme */
.note-editor.note-frame { border-color: #d1d5db; border-radius: var(--xt-radius-sm); }
.note-editor.note-frame .note-toolbar { background: #f9fafb; border-bottom: 1px solid var(--xt-border); border-radius: var(--xt-radius-sm) var(--xt-radius-sm) 0 0; }
.note-editor.note-frame .note-statusbar { border-radius: 0 0 var(--xt-radius-sm) var(--xt-radius-sm); }
.note-editor .note-editing-area .note-editable { color: var(--xt-heading); font-size: .925rem; }
.note-editor.note-frame.is-invalid, .is-invalid + .note-editor.note-frame { border-color: var(--xt-danger); }
.note-modal { z-index: 1060; }

/* Rich text output (descriptions, articles) */
.rich-text { line-height: 1.7; }
.rich-text h2, .rich-text h3, .rich-text h4 { margin-top: 1.5rem; margin-bottom: .75rem; }
.rich-text img { max-width: 100%; height: auto; border-radius: var(--xt-radius-sm); }
.rich-text pre { background: var(--xt-dark); color: #e5e7eb; padding: 1rem; border-radius: var(--xt-radius-sm); overflow-x: auto; }
.rich-text blockquote { border-left: 4px solid var(--xt-primary); padding-left: 1rem; color: var(--xt-muted); }
.rich-text table { width: 100%; margin-bottom: 1rem; border-collapse: collapse; }
.rich-text th, .rich-text td { border: 1px solid var(--xt-border); padding: .5rem .75rem; }

/* 17. Course player extras --------------------------------------------- */
.up-next { position: absolute; inset: 0; background: rgba(17, 24, 39, .88); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 1.5rem; z-index: 5; }
.xt-player-nav .btn-complete { min-width: 190px; }
@media (max-width: 575.98px) { .xt-player-nav .btn-complete { min-width: 0; } }

/* 18. Quizzes & assignments --------------------------------------------- */
.quiz-bar { position: sticky; top: 60px; z-index: 20; background: #fff; border-bottom: 1px solid var(--xt-border); padding: .75rem 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.quiz-timer { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.1rem; padding: .35rem .85rem; border-radius: 99px; background: var(--xt-primary-light); color: var(--xt-primary); white-space: nowrap; }
.quiz-timer.warning { background: rgba(var(--xt-warning-rgb), .15); color: #b45309; animation: xt-pulse 1s ease-in-out infinite; }
.quiz-timer.danger { background: rgba(var(--xt-danger-rgb), .12); color: var(--xt-danger); }
@keyframes xt-pulse { 50% { opacity: .6; } }
.quiz-question.answered { border-color: rgba(var(--xt-primary-rgb), .35); }
.quiz-option { display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem; border: 1px solid var(--xt-border); border-radius: var(--xt-radius-sm); margin-bottom: .5rem; cursor: pointer; transition: border-color var(--xt-transition), background var(--xt-transition); }
.quiz-option:hover { border-color: #c7d2fe; background: #fafbff; }
.quiz-option.selected { border-color: var(--xt-primary); background: var(--xt-primary-light); }
.quiz-option .form-check-input { margin: 0; flex-shrink: 0; width: 1.15em; height: 1.15em; }
.quiz-score { width: 120px; height: 120px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 700; flex-shrink: 0; }
.quiz-score.passed { background: rgba(var(--xt-success-rgb), .15); color: #047857; border: 4px solid var(--xt-success); }
.quiz-score.failed { background: rgba(var(--xt-danger-rgb), .08); color: #b91c1c; border: 4px solid var(--xt-danger); }
.review-option { display: flex; align-items: center; gap: .6rem; padding: .5rem .75rem; border-radius: var(--xt-radius-sm); margin-bottom: .35rem; font-size: .925rem; color: var(--xt-muted); }
.review-option.review-correct { background: rgba(var(--xt-success-rgb), .1); color: #047857; font-weight: 600; }
.review-option.review-wrong { background: rgba(var(--xt-danger-rgb), .08); color: #b91c1c; }
.question-card .card-body { padding: 1rem 1.25rem; }
@media (max-width: 991.98px) { .quiz-bar { padding: .6rem 1rem; } }

/* 19. Reviews, Q&A, wishlist -------------------------------------------- */
.star-input { display: inline-flex; flex-direction: row-reverse; gap: .15rem; }
.star-input input { position: absolute; opacity: 0; pointer-events: none; }
.star-input label { font-size: 1.6rem; color: #d1d5db; cursor: pointer; transition: color .1s, transform .1s; line-height: 1; }
.star-input label:hover, .star-input label:hover ~ label, .star-input input:checked ~ label { color: #f59e0b; }
.star-input label:hover { transform: scale(1.1); }
.star-input input:focus-visible + label { outline: 2px solid var(--xt-primary); outline-offset: 2px; border-radius: 4px; }
.qa-question { border-bottom: 1px solid var(--xt-border); padding: 1rem 0; }
.qa-question:last-child { border-bottom: 0; }
.qa-answers { border-left: 3px solid var(--xt-primary-light); margin: .75rem 0 0 1.1rem; padding-left: 1rem; }
.qa-answer { padding: .5rem 0; }
.qa-answer.is-instructor .qa-name::after { content: "Instructor"; font-size: .68rem; font-weight: 600; color: var(--xt-primary); background: var(--xt-primary-light); border-radius: 4px; padding: .1rem .4rem; margin-left: .4rem; }
.wish-toggle.active { color: var(--xt-danger) !important; }

/* Horizontally scrolling tab strips: swipeable, no visible scrollbar */
.nav.flex-nowrap.overflow-auto { scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.nav.flex-nowrap.overflow-auto::-webkit-scrollbar { display: none; }

/* Live class room: chat ------------------------------------------------- */
.live-chat { position: sticky; top: calc(var(--xt-topbar-height) + 1rem); }
.live-chat-body { height: 420px; overflow-y: auto; display: flex; flex-direction: column; gap: .6rem; }
.live-msg { padding: .5rem .7rem; border-radius: 10px; background: #f5f7fb; font-size: .9rem; word-wrap: break-word; }
.live-msg.staff { background: rgba(79, 70, 229, .08); border-left: 3px solid var(--xt-primary); }
.live-msg-head { display: flex; align-items: center; font-size: .82rem; margin-bottom: .1rem; }
.live-msg .js-del { opacity: 0; transition: opacity .15s; }
.live-msg:hover .js-del, .live-msg .js-del:focus { opacity: 1; }
@media (max-width: 1199.98px) { .live-chat { position: static; } .live-chat-body { height: 320px; } }

/* Mobile App admin: image boxes and phone preview ----------------------- */
.app-image-box { height: 84px; border: 1px dashed var(--xt-border); border-radius: 10px; display: flex; align-items: center; justify-content: center; padding: .5rem; background: #fff; overflow: hidden; }
.app-image-box.dark { background: #111827; border-color: #374151; }
.app-image-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.form-control-color { max-width: 3rem; padding: .25rem; }

.phone-preview-wrap { position: sticky; top: calc(var(--xt-topbar-height) + 1rem); max-width: 340px; margin: 0 auto; }
.phone-preview {
    --pp-primary: #4F46E5; --pp-secondary: #0EA5E9; --pp-accent: #F59E0B; --pp-success: #10B981; --pp-warning: #F59E0B; --pp-danger: #EF4444;
    --pp-splash: #4F46E5; --pp-radius: 12px; --pp-font: 'Inter', system-ui, sans-serif;
    --pp-bg: #F5F7FB; --pp-surface: #FFFFFF; --pp-text: #111827; --pp-muted: #6B7280; --pp-border: #E5E7EB;
    position: relative; height: 620px; border: 10px solid #111827; border-radius: 40px; overflow: hidden; background: var(--pp-bg);
    font-family: var(--pp-font); color: var(--pp-text); box-shadow: 0 20px 50px rgba(17, 24, 39, .18); font-size: 13px;
}
.phone-preview.dark { --pp-bg: #0B1120; --pp-surface: #161E2E; --pp-text: #F3F4F6; --pp-muted: #9CA3AF; --pp-border: #273244; }
.phone-preview .pp-screen { position: absolute; inset: 0; display: flex; flex-direction: column; }
.phone-preview .pp-status { display: flex; justify-content: space-between; padding: .45rem 1.1rem .2rem; font-size: 11px; font-weight: 600; }
.phone-preview .pp-appbar { display: flex; justify-content: space-between; align-items: center; padding: .35rem 1rem .6rem; font-size: 1.05rem; }
.phone-preview .pp-logo { display: flex; align-items: center; height: 26px; }
.phone-preview .pp-logo img { max-height: 26px; max-width: 140px; }
.phone-preview .pp-logo-dark, .phone-preview.dark .pp-logo-light:has(+ .pp-logo-dark) { display: none; }
.phone-preview.dark .pp-logo-dark { display: inline; }
.phone-preview .pp-name { color: var(--pp-primary); }
.phone-preview .pp-body { flex: 1; overflow: hidden; padding: 0 1rem; display: flex; flex-direction: column; gap: .7rem; }
.phone-preview .pp-greet { font-weight: 700; font-size: 1.05rem; }
.phone-preview .pp-search { background: var(--pp-surface); border: 1px solid var(--pp-border); border-radius: var(--pp-radius); padding: .55rem .8rem; color: var(--pp-muted); }
.phone-preview .pp-banner { border-radius: var(--pp-radius); padding: .9rem; color: #fff; background: linear-gradient(135deg, var(--pp-primary), var(--pp-secondary)); display: flex; flex-direction: column; gap: .3rem; align-items: flex-start; }
.phone-preview .pp-banner small { font-size: 10px; font-weight: 700; letter-spacing: .05em; background: rgba(255, 255, 255, .2); padding: .1rem .4rem; border-radius: 6px; }
.phone-preview .pp-btn-light { background: #fff; color: var(--pp-primary); font-weight: 600; font-size: 12px; padding: .3rem .7rem; border-radius: var(--pp-radius); }
.phone-preview .pp-section { display: flex; justify-content: space-between; font-weight: 700; }
.phone-preview .pp-section span { color: var(--pp-primary); font-weight: 600; font-size: 12px; }
.phone-preview .pp-card { background: var(--pp-surface); border-radius: var(--pp-radius); overflow: hidden; display: flex; }
.phone-preview[data-card="outlined"] .pp-card { border: 1px solid var(--pp-border); }
.phone-preview[data-card="elevated"] .pp-card { box-shadow: 0 6px 18px rgba(17, 24, 39, .12); }
.phone-preview .pp-thumb { width: 92px; background: linear-gradient(135deg, var(--pp-accent), var(--pp-danger)); }
.phone-preview .pp-card-body { flex: 1; padding: .6rem .7rem; display: flex; flex-direction: column; gap: .2rem; }
.phone-preview .pp-rating { color: var(--pp-muted); font-size: 11px; }
.phone-preview .pp-rating i { color: var(--pp-accent); }
.phone-preview .pp-price { font-weight: 700; }
.phone-preview .pp-chip { font-size: 10px; font-weight: 600; color: var(--pp-accent); background: color-mix(in srgb, var(--pp-accent) 15%, transparent); padding: .1rem .45rem; border-radius: 999px; }
.phone-preview .pp-btn { background: var(--pp-primary); color: #fff; text-align: center; font-weight: 600; padding: .65rem; border-radius: var(--pp-radius); }
.phone-preview .pp-badges { display: flex; gap: .4rem; font-size: 11px; font-weight: 600; }
.phone-preview .pp-badges span { padding: .15rem .5rem; border-radius: 999px; }
.phone-preview .pp-ok { color: var(--pp-success); background: color-mix(in srgb, var(--pp-success) 15%, transparent); }
.phone-preview .pp-warn { color: var(--pp-warning); background: color-mix(in srgb, var(--pp-warning) 15%, transparent); }
.phone-preview .pp-live { color: #fff; background: var(--pp-danger); }
.phone-preview .pp-tabs { display: flex; justify-content: space-around; background: var(--pp-surface); border-top: 1px solid var(--pp-border); padding: .45rem .25rem .8rem; }
.phone-preview .pp-tabs span { display: flex; flex-direction: column; align-items: center; gap: .1rem; font-size: 10px; color: var(--pp-muted); min-width: 0; }
.phone-preview .pp-tabs i { font-size: 1.15rem; }
.phone-preview .pp-tabs .active { color: var(--pp-primary); font-weight: 600; }
.phone-preview .pp-splash { background: var(--pp-splash); color: #fff; align-items: center; justify-content: center; gap: .8rem; }
.phone-preview .pp-splash-logo img { max-width: 170px; max-height: 90px; }
.phone-preview .pp-splash .pp-name { color: #fff; font-size: 1.6rem; }
.phone-preview .pp-tagline { opacity: .85; padding: 0 2rem; text-align: center; }
.phone-preview .pp-spinner { width: 26px; height: 26px; border: 3px solid rgba(255, 255, 255, .35); border-top-color: #fff; border-radius: 50%; margin-top: 2rem; animation: pp-spin 1s linear infinite; }
@keyframes pp-spin { to { transform: rotate(360deg); } }
@media (max-width: 1199.98px) { .phone-preview-wrap { position: static; } }

/* Mobile App admin: navigation rows ------------------------------------- */
.nav-rows { display: flex; flex-direction: column; gap: .5rem; }
.nav-item-row { display: flex; align-items: center; gap: .6rem; padding: .5rem .6rem; border: 1px solid var(--xt-border); border-radius: 10px; background: #fff; }
.nav-item-row.sortable-ghost { opacity: .5; }
.nav-item-row .drag-handle { cursor: grab; color: var(--xt-muted); }
.nav-icon-preview { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: rgba(79, 70, 229, .08); color: var(--xt-primary); }
.tabs-preview { border: 1px solid var(--xt-border); border-radius: 12px; padding: .5rem .25rem .6rem; background: #fff; }
.tabs-preview span { display: flex; flex-direction: column; align-items: center; color: var(--xt-muted); font-size: .7rem; min-width: 0; }
.tabs-preview span i { font-size: 1.2rem; }
.tabs-preview span.active { color: var(--xt-primary); font-weight: 600; }
@media (max-width: 575.98px) { .nav-item-row { flex-wrap: wrap; } .nav-item-row > .flex-grow-1 { flex-basis: 100%; order: 5; } }

/* Mobile App admin: onboarding slides ----------------------------------- */
.slide-card { border: 1px solid var(--xt-border); border-radius: 12px; overflow: hidden; background: #fff; height: 100%; }
.slide-card.is-hidden { opacity: .6; }
.slide-visual { position: relative; aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, rgba(79, 70, 229, .1), rgba(14, 165, 233, .12)); color: var(--xt-primary); font-size: 2.6rem; }
.slide-visual img { width: 100%; height: 100%; object-fit: cover; }
.slide-handle { position: absolute; top: .4rem; left: 50%; transform: translateX(-50%); background: rgba(255, 255, 255, .9); color: var(--xt-muted); border-radius: 6px; padding: 0 .4rem; font-size: 1rem; cursor: grab; }
.slide-badge { position: absolute; top: .5rem; right: .5rem; font-size: .7rem; }

/* Mobile App admin: banners and action picker --------------------------- */
.banner-thumb { position: relative; aspect-ratio: 2 / 1; background: linear-gradient(135deg, rgba(79, 70, 229, .12), rgba(14, 165, 233, .15)); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.banner-thumb > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.banner-overlay { position: absolute; inset: auto 0 0 0; padding: .9rem 1rem; color: #fff; display: flex; flex-direction: column; align-items: flex-start; gap: .2rem; background: linear-gradient(transparent, rgba(0, 0, 0, .6)); }
.banner-overlay b { font-size: 1.05rem; text-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
.banner-overlay small { opacity: .9; }
.banner-btn { background: #fff; color: var(--xt-primary); font-weight: 600; font-size: .8rem; padding: .25rem .7rem; border-radius: 8px; margin-top: .2rem; }
.action-picker .js-action-value { display: none; }
.section-type-card { display: flex; gap: .75rem; align-items: flex-start; padding: .8rem; border: 1px solid var(--xt-border); border-radius: 12px; color: inherit; text-decoration: none; height: 100%; transition: border-color .15s, box-shadow .15s; }
.section-type-card:hover { border-color: var(--xt-primary); box-shadow: 0 4px 14px rgba(79, 70, 229, .12); color: inherit; }
.section-type-card strong { display: block; color: var(--xt-heading, #111827); }
.section-type-card small { color: var(--xt-muted); }
.popup-preview { background: rgba(17, 24, 39, .55); border-radius: 16px; padding: 1.5rem; display: flex; justify-content: center; }
.popup-card { width: 260px; background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.popup-card img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.popup-btn { display: block; margin-top: .75rem; text-align: center; background: var(--xt-primary); color: #fff; border-radius: 10px; padding: .45rem; font-weight: 600; font-size: .85rem; }
.notif-preview { background: linear-gradient(135deg, #1f2937, #4b5563); border-radius: 16px; padding: 1.25rem; }
.notif-card { background: rgba(255, 255, 255, .95); border-radius: 14px; padding: .75rem .9rem; }
.notif-app { width: 20px; height: 20px; border-radius: 5px; background: var(--xt-primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: .7rem; }
