/* ==========================================================================
   Orbit design system — shared by the website and all panels.
   Colours are CSS variables; Admin → Settings → Brand colour overrides --brand*.
   ========================================================================== */
:root {
    --brand: #0F766E;          /* overridden by the brand colour setting */
    --brand-600: #0D9488;
    --brand-700: #115E59;
    --brand-50: #F0FDFA;
    --brand-100: #CCFBF1;
    --ink: #0B1324;
    --ink-2: #1E293B;
    --text: #334155;
    --muted: #64748B;
    --line: #E5E7EB;
    --bg: #F6F7F9;
    --card: #FFFFFF;
    --amber: #F59E0B;
    --rose: #E11D48;
    --violet: #7C3AED;
    --sky: #0284C7;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
}

html { scroll-behavior: smooth; }
body { font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; color: var(--text); background: #fff; font-size: 15px; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { color: var(--ink); font-weight: 750; letter-spacing: -.02em; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-700); }
.text-muted { color: var(--muted) !important; }
.text-brand { color: var(--brand) !important; }
.bg-brand { background: var(--brand) !important; }
.bg-brand-soft { background: var(--brand-50) !important; }
.bg-ink { background: var(--ink) !important; }
.fw-750 { font-weight: 750; }
.small-caps { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--muted); }
.lh-tight { line-height: 1.15; }
::selection { background: var(--brand-100); }

/* ---------- Buttons ---------- */
.btn { font-weight: 650; border-radius: 10px; padding: .6rem 1.1rem; font-size: .92rem; }
.btn-sm { padding: .38rem .75rem; font-size: .82rem; border-radius: 8px; }
.btn-lg { padding: .8rem 1.4rem; font-size: 1rem; border-radius: 12px; }
.btn-brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-brand:hover, .btn-brand:focus { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }
.btn-ink { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-ink:hover { background: var(--ink-2); color: #fff; }
.btn-soft { background: var(--brand-50); color: var(--brand-700); border-color: transparent; }
.btn-soft:hover { background: var(--brand-100); color: var(--brand-700); }
.btn-outline { border: 1px solid var(--line); background: #fff; color: var(--ink); }
.btn-outline:hover { border-color: var(--ink); color: var(--ink); background: #fff; }
.btn-ghost-light { color: #fff; border: 1px solid rgba(255,255,255,.25); }
.btn-ghost-light:hover { background: rgba(255,255,255,.1); color: #fff; }
.btn-amber { background: var(--amber); border-color: var(--amber); color: var(--ink); }
.btn-amber:hover { background: #D97706; color: var(--ink); }

/* ---------- Forms ---------- */
.form-control, .form-select { border-radius: 10px; border-color: #D9DEE5; padding: .6rem .85rem; font-size: .92rem; color: var(--ink); }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--brand) 18%, transparent); }
.form-label { font-weight: 650; font-size: .85rem; color: var(--ink-2); margin-bottom: .35rem; }
.form-text { color: var(--muted); font-size: .78rem; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.input-group-text { border-radius: 10px; border-color: #D9DEE5; background: #F8FAFC; }

/* ---------- Pills / badges ---------- */
.pill { display: inline-flex; align-items: center; gap: .3rem; padding: .22rem .6rem; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .01em; white-space: nowrap; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.pill-success { background: #ECFDF5; color: #047857; }
.pill-warning { background: #FFFBEB; color: #B45309; }
.pill-danger { background: #FEF2F2; color: #B91C1C; }
.pill-info { background: #EFF6FF; color: #1D4ED8; }
.pill-muted { background: #F1F5F9; color: #475569; }
.tag { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .6rem; border-radius: 8px; font-size: .75rem; font-weight: 650; background: #F1F5F9; color: var(--ink-2); }
.tag-brand { background: var(--brand-50); color: var(--brand-700); }

/* ---------- Cards ---------- */
.card-o { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.card-o > .card-o-head { padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.card-o > .card-o-head h2, .card-o > .card-o-head h3 { font-size: 1rem; margin: 0; }
.card-o > .card-o-body { padding: 1.25rem; }
.card-o.hover { transition: transform .15s, box-shadow .15s, border-color .15s; }
.card-o.hover:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #D7DCE3; }

/* ---------- Course thumbnail (generated when no image) ---------- */
.thumb { position: relative; aspect-ratio: 16/9; border-radius: 12px; overflow: hidden; display: flex; align-items: flex-end; padding: 1rem; color: #fff; isolation: isolate; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; }
.thumb .thumb-icon { position: absolute; right: -10px; top: -14px; font-size: 7rem; opacity: .16; line-height: 1; }
.thumb .thumb-title { font-weight: 750; font-size: 1.05rem; line-height: 1.2; text-shadow: 0 1px 2px rgba(0,0,0,.15); max-width: 85%; }
.thumb::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(135deg, rgba(255,255,255,.05) 0 2px, transparent 2px 14px); z-index: -1; }
.thumb.has-img::after { background: linear-gradient(to top, rgba(11,19,36,.55), transparent 60%); }

/* ---------- Course card ---------- */
.course-card { height: 100%; display: flex; flex-direction: column; }
.course-card .body { padding: .9rem .25rem 0; flex: 1; display: flex; flex-direction: column; }
.course-card h3 { font-size: 1rem; line-height: 1.35; margin: .35rem 0 .3rem; }
.course-card h3 a { color: var(--ink); }
.course-card .meta { font-size: .8rem; color: var(--muted); }
.course-card .price { font-weight: 800; color: var(--ink); font-size: 1.05rem; }
.course-card .strike { text-decoration: line-through; color: var(--muted); font-size: .85rem; font-weight: 500; }
.stars { color: var(--amber); letter-spacing: 1px; font-size: .8rem; }

/* ---------- Website ---------- */
.site-header { position: sticky; top: 0; z-index: 1030; background: rgba(255,255,255,.92); backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--line); }
.site-header .nav-link { color: var(--ink-2); font-weight: 600; font-size: .9rem; padding: .5rem .8rem !important; border-radius: 8px; }
.site-header .nav-link:hover, .site-header .nav-link.active { color: var(--brand); background: var(--brand-50); }
.site-search { position: relative; }
.site-search input { padding-left: 2.3rem; background: #F4F6F8; border-color: transparent; border-radius: 999px; min-width: 260px; }
.site-search i { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.mega { min-width: 520px; padding: .75rem; border-radius: 14px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.mega a { display: flex; gap: .7rem; align-items: center; padding: .55rem .7rem; border-radius: 10px; color: var(--ink-2); font-weight: 600; font-size: .88rem; }
.mega a:hover { background: var(--brand-50); color: var(--brand-700); }
.mega a i { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: #F1F5F9; color: var(--brand); font-size: 1rem; }

.hero { background: radial-gradient(1200px 500px at 85% -10%, color-mix(in srgb, var(--brand) 55%, transparent), transparent 60%), radial-gradient(800px 400px at -10% 110%, rgba(245,158,11,.18), transparent 60%), var(--ink); color: #CBD5E1; overflow: hidden; position: relative; }
.hero h1 { color: #fff; font-size: clamp(2.2rem, 4.6vw, 3.6rem); font-weight: 800; letter-spacing: -.035em; line-height: 1.05; }
.hero .accent { color: transparent; background: linear-gradient(90deg, #5EEAD4, #FCD34D); -webkit-background-clip: text; background-clip: text; }
.hero .lead { color: #94A3B8; font-size: 1.1rem; }
.hero-search { background: #fff; border-radius: 14px; padding: .4rem; display: flex; gap: .4rem; max-width: 560px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.hero-search input { border: 0; box-shadow: none !important; font-size: 1rem; }
.hero-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 48px 48px; mask-image: linear-gradient(to bottom, #000, transparent 85%); pointer-events: none; }
.hero-stack { position: relative; height: 420px; }
.hero-stack .float { position: absolute; background: #fff; border-radius: 16px; box-shadow: 0 30px 60px rgba(0,0,0,.35); color: var(--text); }
.hero-stat { color: #fff; font-weight: 800; font-size: 1.6rem; letter-spacing: -.02em; }

.section { padding: 5rem 0; }
.section-sm { padding: 3rem 0; }
.section-title { font-size: clamp(1.6rem, 2.6vw, 2.2rem); font-weight: 800; }
.eyebrow { display: inline-flex; align-items: center; gap: .4rem; font-size: .75rem; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); }

.cat-tile { display: flex; align-items: center; gap: .9rem; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: #fff; transition: .15s; }
.cat-tile:hover { border-color: var(--brand); color: var(--ink); box-shadow: var(--shadow); }
.cat-tile i { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.25rem; background: var(--brand-50); color: var(--brand); flex-shrink: 0; }

.step-num { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; background: var(--ink); color: #fff; }
.type-chip { display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; font-weight: 650; padding: .3rem .65rem; border-radius: 8px; background: #fff; border: 1px solid var(--line); }

.course-hero { background: var(--ink); color: #CBD5E1; padding: 3.5rem 0 3rem; }
.course-hero h1 { color: #fff; font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
.buy-box { position: sticky; top: 90px; }
.curriculum .mod { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: .6rem; }
.curriculum .mod-head { padding: .85rem 1rem; background: #F8FAFC; font-weight: 700; color: var(--ink); display: flex; justify-content: space-between; cursor: pointer; }
.curriculum .row-item { padding: .65rem 1rem; display: flex; align-items: center; gap: .7rem; border-top: 1px solid var(--line); font-size: .9rem; }
.type-dot { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-size: .95rem; flex-shrink: 0; }

.batch-option { display: block; border: 1.5px solid var(--line); border-radius: 12px; padding: .8rem 1rem; cursor: pointer; transition: .15s; }
.batch-option:hover { border-color: #94A3B8; }
.btn-check:checked + .batch-option { border-color: var(--brand); background: var(--brand-50); }
.seat-bar { height: 6px; background: #E2E8F0; border-radius: 9px; overflow: hidden; }
.seat-bar > span { display: block; height: 100%; background: var(--brand); }

.site-footer { background: var(--ink); color: #94A3B8; padding: 4rem 0 2rem; }
.site-footer h6 { color: #fff; font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 1rem; }
.site-footer a { color: #94A3B8; display: block; padding: .2rem 0; font-size: .9rem; }
.site-footer a:hover { color: #fff; }

.avatar { width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; font-size: .85rem; color: #fff; background: linear-gradient(135deg, var(--brand), var(--ink)); object-fit: cover; flex-shrink: 0; }
.avatar-sm { width: 32px; height: 32px; font-size: .75rem; }
.avatar-lg { width: 72px; height: 72px; font-size: 1.4rem; }
.avatar-xl { width: 112px; height: 112px; font-size: 2rem; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: radial-gradient(700px 400px at 100% 0, color-mix(in srgb, var(--brand) 60%, transparent), transparent 60%), var(--ink); color: #94A3B8; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; }
.auth-side h2 { color: #fff; font-size: 2rem; font-weight: 800; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 3rem 1.5rem; }
.auth-card { width: 100%; max-width: 420px; }
.role-switch { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.role-switch label { border: 1.5px solid var(--line); border-radius: 12px; padding: .8rem; cursor: pointer; text-align: center; font-weight: 650; color: var(--ink-2); }
.role-switch input:checked + label { border-color: var(--brand); background: var(--brand-50); color: var(--brand-700); }
@media (max-width: 991px) { .auth-wrap { grid-template-columns: 1fr; } .auth-side { display: none; } }

/* ---------- Panel ---------- */
.panel-body { background: var(--bg); }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; background: var(--ink); color: #94A3B8; display: flex; flex-direction: column; z-index: 1040; transition: transform .2s; }
.sidebar .brand { padding: 1.2rem 1.25rem; border-bottom: 1px solid rgba(255,255,255,.06); }
.sidebar nav { padding: .75rem; overflow-y: auto; flex: 1; }
.sidebar .nav-group { font-size: .68rem; text-transform: uppercase; letter-spacing: .14em; font-weight: 700; color: #475569; padding: 1rem .75rem .4rem; }
.sidebar .s-link { display: flex; align-items: center; gap: .75rem; padding: .58rem .75rem; border-radius: 10px; color: #A3B1C6; font-weight: 600; font-size: .88rem; position: relative; }
.sidebar .s-link i { font-size: 1.05rem; width: 20px; text-align: center; }
.sidebar .s-link:hover { color: #fff; background: rgba(255,255,255,.05); }
.sidebar .s-link.active { color: #fff; background: color-mix(in srgb, var(--brand) 26%, transparent); }
.sidebar .s-link.active::before { content: ''; position: absolute; left: -.75rem; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand-600); }
.sidebar .s-count { margin-left: auto; background: var(--amber); color: var(--ink); font-size: .68rem; font-weight: 800; border-radius: 999px; padding: .1rem .45rem; }
.sidebar .s-foot { padding: 1rem; border-top: 1px solid rgba(255,255,255,.06); }
.panel-main { margin-left: 260px; min-height: 100vh; }
.topbar { height: 68px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 1rem; padding: 0 1.75rem; position: sticky; top: 0; z-index: 1020; }
.topbar .page-title { font-size: 1.1rem; font-weight: 750; color: var(--ink); margin: 0; }
.topbar .crumbs { font-size: .78rem; color: var(--muted); }
.panel-content { padding: 1.75rem; max-width: 1400px; }
.icon-btn { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; border: 1px solid var(--line); background: #fff; color: var(--ink-2); position: relative; }
.icon-btn .dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--rose); border: 2px solid #fff; }
.notif-menu { width: 360px; padding: 0; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); }
.notif-menu .n-item { display: flex; gap: .75rem; padding: .8rem 1rem; border-bottom: 1px solid var(--line); color: var(--text); font-size: .85rem; }
.notif-menu .n-item:hover { background: #F8FAFC; }
.notif-menu .n-item.unread { background: var(--brand-50); }
@media (max-width: 991px) { .sidebar { transform: translateX(-100%); } .sidebar.open { transform: none; } .panel-main { margin-left: 0; } .panel-content { padding: 1.1rem; } .topbar { padding: 0 1rem; } }

.stat { padding: 1.15rem 1.25rem; display: flex; gap: 1rem; align-items: center; }
.stat .s-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; flex-shrink: 0; }
.stat .s-val { font-size: 1.5rem; font-weight: 800; color: var(--ink); letter-spacing: -.02em; line-height: 1.1; }
.stat .s-label { font-size: .78rem; color: var(--muted); font-weight: 600; }
.tone-brand { background: var(--brand-50); color: var(--brand); }
.tone-amber { background: #FFFBEB; color: #D97706; }
.tone-violet { background: #F5F3FF; color: var(--violet); }
.tone-sky { background: #F0F9FF; color: var(--sky); }
.tone-rose { background: #FFF1F2; color: var(--rose); }

.table-o { margin: 0; font-size: .88rem; }
.table-o thead th { background: #F8FAFC; color: var(--muted); font-weight: 700; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--line); padding: .75rem 1rem; white-space: nowrap; }
.table-o td { padding: .8rem 1rem; vertical-align: middle; border-color: var(--line); color: var(--ink-2); }
.table-o tbody tr:hover td { background: #FAFBFC; }
.table-o .t-strong { font-weight: 700; color: var(--ink); }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.seg { display: inline-flex; background: #EEF1F4; border-radius: 10px; padding: 3px; }
.seg a { padding: .38rem .8rem; border-radius: 8px; font-size: .82rem; font-weight: 650; color: var(--muted); }
.seg a.active { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty i { font-size: 2.4rem; color: #CBD5E1; display: block; margin-bottom: .75rem; }
.progress { background: #E9EDF2; border-radius: 99px; }
.progress-bar { background: var(--brand); border-radius: 99px; }
.flash { border-radius: 12px; border: 0; font-weight: 600; font-size: .9rem; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: .55rem 1rem; font-size: .9rem; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; color: var(--ink); }
.money-pos { color: #047857; font-weight: 700; }
.money-neg { color: #B91C1C; font-weight: 700; }

/* Curriculum builder */
.builder-module { background: #fff; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 1rem; }
.builder-module .bm-head { display: flex; align-items: center; gap: .75rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--line); }
.builder-item { display: flex; align-items: center; gap: .75rem; padding: .65rem 1.1rem; border-bottom: 1px dashed var(--line); background: #fff; }
.builder-item:last-child { border-bottom: 0; }
.drag { cursor: grab; color: #94A3B8; }
.sortable-ghost { opacity: .4; background: var(--brand-50) !important; }

/* Learning player */
.learn-top { height: 60px; background: var(--ink); color: #CBD5E1; display: flex; align-items: center; gap: 1rem; padding: 0 1.25rem; position: sticky; top: 0; z-index: 1030; }
.learn-top a { color: #CBD5E1; }
.learn-shell { display: grid; grid-template-columns: 340px 1fr; min-height: calc(100vh - 60px); }
.learn-side { background: #fff; border-right: 1px solid var(--line); overflow-y: auto; max-height: calc(100vh - 60px); position: sticky; top: 60px; }
.learn-side .ls-mod { padding: .85rem 1.1rem .4rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 750; color: var(--muted); }
.learn-side .ls-item { display: flex; gap: .7rem; align-items: center; padding: .6rem 1.1rem; color: var(--ink-2); font-size: .87rem; font-weight: 550; border-left: 3px solid transparent; }
.learn-side .ls-item:hover { background: #F8FAFC; color: var(--ink); }
.learn-side .ls-item.current { background: var(--brand-50); border-left-color: var(--brand); color: var(--ink); font-weight: 700; }
.learn-side .ls-item .chk { margin-left: auto; color: #10B981; }
.learn-main { background: var(--bg); padding: 2rem; }
.learn-content { max-width: 880px; margin: 0 auto; }
.prose { font-size: 1rem; line-height: 1.75; color: var(--ink-2); }
.prose h3, .prose h4 { margin-top: 1.6rem; }
.prose pre { background: var(--ink); color: #E2E8F0; padding: 1rem 1.2rem; border-radius: 10px; font-size: .85rem; }
.prose code { color: var(--brand-700); background: var(--brand-50); padding: .1rem .35rem; border-radius: 5px; font-size: .88em; }
.prose pre code { color: inherit; background: none; padding: 0; }
.video-frame { aspect-ratio: 16/9; border-radius: 14px; overflow: hidden; background: #000; }
.quiz-opt { display: flex; gap: .75rem; align-items: flex-start; padding: .85rem 1rem; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; margin-bottom: .55rem; background: #fff; }
.quiz-opt:hover { border-color: #94A3B8; }
.quiz-opt:has(input:checked) { border-color: var(--brand); background: var(--brand-50); }
.quiz-opt.right { border-color: #10B981; background: #ECFDF5; }
.quiz-opt.wrong { border-color: #F87171; background: #FEF2F2; }
.check-step { display: flex; gap: .75rem; align-items: center; padding: .7rem .9rem; border: 1px solid var(--line); border-radius: 10px; margin-bottom: .45rem; background: #fff; cursor: pointer; }
.check-step:has(input:checked) span { text-decoration: line-through; color: var(--muted); }
@media (max-width: 991px) { .learn-shell { grid-template-columns: 1fr; } .learn-side { position: static; max-height: none; display: none; } .learn-side.open { display: block; } .learn-main { padding: 1rem; } }

/* Tickets */
.msg { display: flex; gap: .85rem; margin-bottom: 1.25rem; }
.msg .bubble { background: #fff; border: 1px solid var(--line); border-radius: 4px 14px 14px 14px; padding: .9rem 1.1rem; flex: 1; }
.msg.staff .bubble { background: var(--brand-50); border-color: var(--brand-100); }
.msg.internal .bubble { background: #FFFBEB; border: 1px dashed #F59E0B; }
.msg .who { font-size: .8rem; color: var(--muted); margin-bottom: .35rem; }
.msg .who strong { color: var(--ink); }

/* Print (invoice / certificate) */
@media print { .no-print { display: none !important; } body { background: #fff !important; } }
.course-hero .text-dark, .course-hero .text-muted { color: #E2E8F0 !important; }
