/* ============ AwanJasa BOLTLMS ============ */
:root {
  --purple-900: #3B1D6E;
  --purple-800: #4C1D95;
  --purple-700: #5B21B6;
  --purple-600: #6D28D9;
  --purple-500: #7C3AED;
  --purple-400: #A855F7;
  --purple-100: #EDE9FE;
  --purple-50: #F7F4FE;
  --amber: #FBBF24;
  --amber-dark: #D97706;
  --ink: #1E1B2E;
  --ink-soft: #5A5470;
  --line: #E6E0F2;
  --card: #FFFFFF;
  --bg: #F6F4FB;
  --green: #16A34A;
  --red: #DC2626;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(59, 29, 110, .08), 0 8px 24px rgba(59, 29, 110, .07);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.55; }
button { font-family: var(--font); cursor: pointer; }
input, select, textarea { font-family: var(--font); font-size: 14px; }
a { color: var(--purple-600); }

/* ---------- boot splash ---------- */
.boot-splash { height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; color: var(--ink-soft); }
.boot-logo { width: 120px; height: 90px; }

/* ---------- auth screen ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-hero {
  background: radial-gradient(1200px 700px at 20% -10%, #8B5CF6 0%, var(--purple-800) 45%, var(--purple-900) 100%);
  color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.auth-hero::after {
  content: ''; position: absolute; right: -120px; bottom: -120px; width: 380px; height: 380px;
  border-radius: 50%; background: rgba(168, 85, 247, .25); filter: blur(10px);
}
.auth-brand { display: flex; align-items: center; gap: 14px; }
.auth-brand svg { width: 72px; height: 54px; }
.auth-brand .name { font-size: 22px; font-weight: 800; letter-spacing: .5px; }
.auth-brand .name span { color: var(--amber); }
.auth-brand .tag { font-size: 12px; opacity: .75; letter-spacing: 1.6px; text-transform: uppercase; }
.auth-hero h1 { font-size: 40px; line-height: 1.15; font-weight: 800; max-width: 520px; }
.auth-hero h1 em { color: var(--amber); font-style: normal; }
.auth-hero p.lede { margin-top: 16px; max-width: 460px; opacity: .85; }
.auth-points { display: flex; flex-direction: column; gap: 10px; margin-top: 28px; }
.auth-points div { display: flex; gap: 10px; align-items: center; font-size: 14px; opacity: .92; }
.auth-points .dot { width: 26px; height: 26px; border-radius: 8px; background: rgba(255,255,255,.14); display: grid; place-items: center; font-size: 13px; flex: none; }
.auth-foot { font-size: 12.5px; opacity: .6; }

.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--card); }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h2 { font-size: 26px; font-weight: 800; margin-bottom: 6px; }
.auth-card .sub { color: var(--ink-soft); margin-bottom: 26px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--ink-soft); }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 10px; background: #FCFBFE;
  transition: border-color .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--purple-500); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 10px; border: none; font-weight: 700; font-size: 14px;
  transition: transform .06s, box-shadow .15s, background .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--purple-500), var(--purple-700)); color: #fff; box-shadow: 0 6px 18px rgba(124, 58, 237, .35); }
.btn-primary:hover { box-shadow: 0 8px 22px rgba(124, 58, 237, .45); }
.btn-ghost { background: var(--purple-50); color: var(--purple-700); }
.btn-ghost:hover { background: var(--purple-100); }
.btn-danger { background: #FEE2E2; color: var(--red); }
.btn-amber { background: var(--amber); color: #451A03; }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.auth-alt { text-align: center; margin-top: 18px; font-size: 14px; color: var(--ink-soft); }
.auth-alt a { font-weight: 700; cursor: pointer; }
.demo-box { margin-top: 26px; border-top: 1.5px dashed var(--line); padding-top: 18px; }
.demo-box p { font-size: 12.5px; color: var(--ink-soft); margin-bottom: 10px; text-align: center; }
.demo-btns { display: flex; gap: 8px; }
.demo-btns button { flex: 1; }
.form-error { background: #FEF2F2; color: var(--red); border: 1px solid #FECACA; padding: 10px 14px; border-radius: 10px; font-size: 13.5px; margin-bottom: 16px; display: none; }
.form-error.show { display: block; }

/* ---------- app shell ---------- */
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar {
  background: linear-gradient(180deg, var(--purple-900), var(--purple-800));
  color: #fff; padding: 22px 16px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 20px; border-bottom: 1px solid rgba(255,255,255,.12); }
.side-brand svg { width: 52px; height: 40px; }
.side-brand b { font-size: 16.5px; letter-spacing: .3px; }
.side-brand b span { color: var(--amber); }
.side-brand small { display: block; font-size: 10px; letter-spacing: 1.6px; opacity: .65; text-transform: uppercase; }
.nav { margin-top: 18px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px;
  color: rgba(255,255,255,.82); text-decoration: none; font-weight: 600; font-size: 14px; transition: background .15s;
}
.nav a:hover { background: rgba(255,255,255,.08); }
.nav a.active { background: rgba(251, 191, 36, .16); color: var(--amber); }
.nav .icon { width: 20px; text-align: center; }
.side-user { border-top: 1px solid rgba(255,255,255,.12); padding-top: 14px; display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, var(--amber), #F59E0B);
  color: #451A03; display: grid; place-items: center; font-weight: 800; flex: none;
}
.side-user .who { flex: 1; min-width: 0; }
.side-user .who b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user .who small { font-size: 11.5px; opacity: .65; text-transform: capitalize; }
.side-user button { background: none; border: none; color: rgba(255,255,255,.6); font-size: 17px; padding: 6px; }
.side-user button:hover { color: #fff; }

.main { padding: 34px 40px 60px; max-width: 1200px; width: 100%; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.page-head h1 { font-size: 26px; font-weight: 800; }
.page-head p { color: var(--ink-soft); margin-top: 4px; }

/* ---------- cards & grids ---------- */
.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); }
.stat-card { padding: 20px 22px; }
.stat-card .label { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--ink-soft); }
.stat-card .value { font-size: 30px; font-weight: 800; margin-top: 4px; color: var(--purple-800); }
.stat-card .hint { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }

.course-card { overflow: hidden; display: flex; flex-direction: column; transition: transform .12s, box-shadow .15s; }
.course-card:hover { transform: translateY(-3px); box-shadow: 0 4px 6px rgba(59,29,110,.08), 0 16px 34px rgba(59,29,110,.13); }
.course-cover { height: 120px; display: grid; place-items: center; font-size: 46px; position: relative; }
.course-cover .badge-cat {
  position: absolute; top: 12px; left: 12px; background: rgba(255,255,255,.92); color: var(--purple-800);
  font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: 99px;
}
.course-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.course-body h3 { font-size: 16.5px; font-weight: 800; line-height: 1.3; }
.course-body .meta { font-size: 12.5px; color: var(--ink-soft); display: flex; gap: 12px; flex-wrap: wrap; }
.course-body .teacher { font-size: 13px; color: var(--ink-soft); }
.course-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding-top: 10px; }
.price { font-weight: 800; font-size: 17px; color: var(--purple-700); }
.price small { font-weight: 600; color: var(--ink-soft); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 99px; font-size: 12px; font-weight: 700; }
.pill-green { background: #DCFCE7; color: var(--green); }
.pill-red { background: #FEE2E2; color: var(--red); }
.pill-amber { background: #FEF3C7; color: var(--amber-dark); }
.pill-purple { background: var(--purple-100); color: var(--purple-700); }
.pill-gray { background: #F1F0F5; color: var(--ink-soft); }

.progress-bar { height: 8px; border-radius: 99px; background: var(--purple-100); overflow: hidden; }
.progress-bar > div { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--purple-500), var(--purple-400)); transition: width .3s; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .7px; color: var(--ink-soft); padding: 12px 16px; border-bottom: 1.5px solid var(--line); white-space: nowrap; }
td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--purple-50); }

/* ---------- player ---------- */
.player { display: grid; grid-template-columns: 300px 1fr; gap: 22px; align-items: start; }
.player.with-ai { grid-template-columns: 300px 1fr 360px; }
.curriculum { position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow-y: auto; }
.curriculum .mod-title { padding: 13px 16px 7px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .8px; color: var(--ink-soft); }
.curriculum .lesson-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px; cursor: pointer; font-size: 13.5px; font-weight: 600;
  border-left: 3px solid transparent;
}
.curriculum .lesson-item:hover { background: var(--purple-50); }
.curriculum .lesson-item.active { background: var(--purple-100); border-left-color: var(--purple-600); color: var(--purple-800); }
.curriculum .check { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: 11px; flex: none; color: transparent; }
.curriculum .lesson-item.done .check { background: var(--green); border-color: var(--green); color: #fff; }
.curriculum .ltype { margin-left: auto; font-size: 11px; color: var(--ink-soft); }
.lesson-panel { padding: 30px 34px; }
.lesson-panel h2 { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.lesson-panel .lesson-meta { color: var(--ink-soft); font-size: 13px; margin-bottom: 20px; }
.lesson-content { font-size: 15px; }
.lesson-content p { margin: 12px 0; }
.lesson-content strong { color: var(--purple-800); }
.lesson-content ol, .lesson-content ul { margin: 12px 0 12px 22px; }
.lesson-content li { margin: 6px 0; }
.lesson-actions { margin-top: 26px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.expiry-strip {
  display: flex; align-items: center; gap: 10px; background: var(--purple-100); color: var(--purple-800);
  border-radius: 10px; padding: 10px 16px; font-size: 13.5px; font-weight: 600; margin-bottom: 18px;
}
.expiry-strip.warn { background: #FEF3C7; color: var(--amber-dark); }

/* quiz */
.quiz-q { margin-bottom: 22px; }
.quiz-q h4 { margin-bottom: 10px; font-size: 15px; }
.quiz-opt { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 10px; margin-bottom: 8px; cursor: pointer; transition: border-color .12s, background .12s; }
.quiz-opt:hover { border-color: var(--purple-400); }
.quiz-opt.selected { border-color: var(--purple-600); background: var(--purple-50); }
.quiz-opt.right { border-color: var(--green); background: #DCFCE7; }
.quiz-opt.wrong { border-color: var(--red); background: #FEE2E2; }
.quiz-score { font-size: 20px; font-weight: 800; margin: 12px 0; }

/* ---------- AI tutor ---------- */
.ai-panel { position: sticky; top: 24px; display: flex; flex-direction: column; max-height: calc(100vh - 48px); overflow: hidden; }
.ai-head { padding: 14px 18px; background: linear-gradient(135deg, var(--purple-700), var(--purple-500)); color: #fff; display: flex; align-items: center; gap: 10px; }
.ai-head .ai-avatar { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.18); display: grid; place-items: center; font-size: 17px; }
.ai-head b { font-size: 14.5px; }
.ai-head small { display: block; font-size: 11.5px; opacity: .8; }
.ai-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; background: var(--purple-50); min-height: 260px; }
.ai-msg { max-width: 88%; padding: 10px 14px; border-radius: 14px; font-size: 13.5px; white-space: pre-wrap; word-wrap: break-word; }
.ai-msg.user { align-self: flex-end; background: var(--purple-600); color: #fff; border-bottom-right-radius: 4px; }
.ai-msg.assistant { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.ai-msg.assistant strong { color: var(--purple-700); }
.ai-empty { text-align: center; color: var(--ink-soft); font-size: 13px; margin: auto; padding: 20px; }
.ai-empty .suggestions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.ai-empty .suggestions button { border: 1.5px solid var(--purple-100); background: #fff; border-radius: 10px; padding: 9px 12px; font-size: 12.5px; color: var(--purple-700); font-weight: 600; }
.ai-empty .suggestions button:hover { border-color: var(--purple-400); }
.ai-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: #fff; }
.ai-input input { flex: 1; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 10px; }
.ai-input input:focus { outline: none; border-color: var(--purple-500); }
.typing { display: inline-flex; gap: 4px; align-items: center; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--purple-400); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25 } 30% { opacity: 1 } }

/* ---------- calendar ---------- */
.event-row { display: flex; gap: 16px; padding: 18px 20px; align-items: flex-start; }
.event-date { flex: none; width: 64px; text-align: center; background: var(--purple-100); border-radius: 12px; padding: 10px 4px; }
.event-date b { display: block; font-size: 21px; color: var(--purple-800); }
.event-date span { font-size: 11.5px; font-weight: 700; text-transform: uppercase; color: var(--purple-600); }
.event-info { flex: 1; }
.event-info h4 { font-size: 15.5px; font-weight: 800; }
.event-info .when { font-size: 13px; color: var(--ink-soft); margin: 3px 0; }
.event-info p { font-size: 13.5px; color: var(--ink-soft); }

/* ---------- modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(30, 27, 46, .55); display: grid; place-items: center; z-index: 60; padding: 20px; }
.modal { background: #fff; border-radius: 18px; max-width: 520px; width: 100%; max-height: 90vh; overflow-y: auto; padding: 28px 30px; box-shadow: 0 24px 70px rgba(0,0,0,.3); }
.modal h3 { font-size: 19px; font-weight: 800; margin-bottom: 6px; }
.modal .sub { color: var(--ink-soft); font-size: 14px; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }
.pay-option { display: flex; align-items: center; gap: 12px; border: 1.5px solid var(--line); padding: 13px 16px; border-radius: 12px; margin-bottom: 10px; cursor: pointer; font-weight: 600; }
.pay-option:hover { border-color: var(--purple-400); }
.pay-option.selected { border-color: var(--purple-600); background: var(--purple-50); }
.pay-option .pm-icon { font-size: 20px; }

/* ---------- certificate ---------- */
.cert { border: 3px double var(--purple-500); border-radius: 18px; padding: 44px; text-align: center; background: linear-gradient(180deg, #fff, var(--purple-50)); }
.cert .cert-logo { width: 90px; height: 68px; }
.cert h2 { font-size: 15px; letter-spacing: 3px; text-transform: uppercase; color: var(--purple-600); margin: 12px 0 4px; }
.cert .cert-name { font-size: 32px; font-weight: 800; color: var(--purple-900); margin: 12px 0; }
.cert .cert-course { font-size: 19px; font-weight: 700; margin: 6px 0 14px; }
.cert .cert-meta { font-size: 13px; color: var(--ink-soft); }
.cert .cert-serial { margin-top: 18px; font-size: 11.5px; color: var(--ink-soft); letter-spacing: 1px; }

/* ---------- misc ---------- */
.empty-state { text-align: center; padding: 60px 30px; color: var(--ink-soft); }
.empty-state .big { font-size: 44px; margin-bottom: 12px; }
.section-title { font-size: 17px; font-weight: 800; margin: 30px 0 14px; }
.toast {
  position: fixed; bottom: 26px; right: 26px; background: var(--ink); color: #fff; padding: 13px 20px;
  border-radius: 12px; font-size: 14px; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.3); z-index: 100;
  animation: pop .2s ease-out;
}
.toast.error { background: var(--red); }
@keyframes pop { from { transform: translateY(8px); opacity: 0 } to { transform: none; opacity: 1 } }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.days-left { font-weight: 800; }
.days-left.low { color: var(--red); }
.mb8 { margin-bottom: 8px; } .mb16 { margin-bottom: 16px; } .mb24 { margin-bottom: 24px; }
.mt16 { margin-top: 16px; } .flex { display: flex; gap: 10px; align-items: center; } .grow { flex: 1; }
.muted { color: var(--ink-soft); font-size: 13px; }

@media (max-width: 1100px) {
  .player.with-ai { grid-template-columns: 260px 1fr; }
  .ai-panel { position: fixed; right: 16px; bottom: 16px; top: auto; width: 360px; max-height: 70vh; z-index: 50; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
}
@media (max-width: 900px) {
  .auth-wrap { grid-template-columns: 1fr; } .auth-hero { display: none; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 40; height: auto; bottom: 0; top: auto; width: 100%; flex-direction: row; padding: 8px 10px; align-items: center; }
  .side-brand, .side-user { display: none; }
  .nav { flex-direction: row; margin: 0; overflow-x: auto; }
  .main { padding: 20px 16px 90px; }
  .player, .player.with-ai { grid-template-columns: 1fr; }
  .curriculum { position: static; max-height: none; }
}

@media print {
  .sidebar, .page-head button, .no-print { display: none !important; }
  .main { padding: 0; }
  body { background: #fff; }
}
