:root {
  --primary: #4f46e5;
  --primary-700: #4338ca;
  --primary-900: #312e81;
  --primary-soft: #eef2ff;
  --accent: #06b6d4;
  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #172033;
  --muted: #687386;
  --line: #e5e9f2;
  --success: #059669;
  --success-soft: #ecfdf5;
  --warning: #d97706;
  --warning-soft: #fffbeb;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --info: #0284c7;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05), 0 5px 18px rgba(15, 23, 42, .045);
  --shadow: 0 18px 50px rgba(15, 23, 42, .09);
  --sidebar: 264px;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
svg { display: block; }
[hidden] { display: none !important; }

/* ---------- umum ---------- */
.loading-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 10%, color-mix(in srgb, var(--primary), transparent 87%), transparent 32%),
    radial-gradient(circle at 85% 85%, rgba(6, 182, 212, .12), transparent 30%),
    var(--bg);
}
.loading-box { text-align: center; color: var(--muted); }
.spinner {
  width: 42px; height: 42px; margin: 0 auto 14px;
  border: 4px solid color-mix(in srgb, var(--primary), white 80%);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin .75s linear infinite;
}
.spinner.small { width: 20px; height: 20px; border-width: 2px; margin: 0; }
@keyframes spin { to { transform: rotate(360deg); } }

.page-loading {
  min-height: 360px; display: grid; place-items: center; color: var(--muted);
}
.page-loading > div { text-align: center; }

.btn {
  border: 0; border-radius: 11px; min-height: 40px; padding: 9px 15px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer; font-weight: 700; color: var(--text); background: #fff;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, opacity .15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 8px 22px color-mix(in srgb, var(--primary), transparent 72%); }
.btn-primary:hover { background: var(--primary-700); }
.btn-secondary { background: var(--primary-soft); color: var(--primary-700); }
.btn-outline { border: 1px solid var(--line); background: #fff; }
.btn-outline:hover { border-color: color-mix(in srgb, var(--primary), white 55%); background: var(--primary-soft); }
.btn-danger { color: var(--danger); background: var(--danger-soft); }
.btn-success { color: #fff; background: var(--success); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-sm { min-height: 34px; padding: 6px 10px; font-size: 12.5px; border-radius: 9px; }
.btn-icon { width: 40px; padding: 0; flex: 0 0 auto; }
.btn-block { width: 100%; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 20px; }
.card-title { margin: 0; font-size: 16px; line-height: 1.35; }
.card-subtitle { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; min-height: 25px; padding: 3px 9px;
  border-radius: 999px; font-size: 11.5px; font-weight: 800; line-height: 1;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--line);
}
.badge.primary { background: var(--primary-soft); color: var(--primary-700); border-color: transparent; }
.badge.success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge.warning { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.badge.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge.info { background: #e0f2fe; color: var(--info); border-color: transparent; }
.badge.draft { background: #f1f5f9; color: #64748b; border-color: transparent; }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.tiny { font-size: 11px; }
.weight-700 { font-weight: 700; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-primary { color: var(--primary); }
.text-center { text-align: center; }
.mt-0 { margin-top: 0 !important; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-0 { margin-bottom: 0 !important; }
.gap-8 { gap: 8px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

.form-grid { display: grid; gap: 14px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { min-width: 0; }
.field label {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 12px; color: #49556a; font-weight: 800; margin: 0 0 6px;
}
.field input, .field select, .field textarea, .control {
  width: 100%; border: 1px solid #dbe1eb; border-radius: 11px; background: #fff;
  color: var(--text); min-height: 43px; padding: 9px 12px; outline: none;
  transition: border .15s ease, box-shadow .15s ease;
}
.field textarea { min-height: 108px; resize: vertical; line-height: 1.55; }
.field input:focus, .field select:focus, .field textarea:focus, .control:focus {
  border-color: color-mix(in srgb, var(--primary), white 30%);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary), transparent 88%);
}
.field .help { color: var(--muted); font-size: 11.5px; margin-top: 5px; }
.input-row { display: flex; gap: 8px; }
.input-row > input, .input-row > select { flex: 1; min-width: 0; }
.check-row {
  display: flex; align-items: flex-start; gap: 9px; cursor: pointer; color: #49556a;
  font-weight: 600; font-size: 13px;
}
.check-row input { width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--primary); }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.check-card {
  display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 11px;
  padding: 10px; cursor: pointer; background: #fff;
}
.check-card input { width: 16px; height: 16px; accent-color: var(--primary); }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; flex-wrap: wrap; }

.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px;
}
.toolbar .search { flex: 1; min-width: 220px; position: relative; }
.toolbar .search svg { position: absolute; width: 18px; height: 18px; left: 12px; top: 12px; color: #94a3b8; }
.toolbar .search input { padding-left: 38px; }
.toolbar input, .toolbar select {
  border: 1px solid #dbe1eb; background: #fff; border-radius: 11px; min-height: 42px;
  padding: 8px 11px; outline: none;
}

.progress {
  height: 8px; background: #e9edf5; border-radius: 99px; overflow: hidden;
}
.progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--accent)); }
.progress-line { display: flex; align-items: center; gap: 10px; }
.progress-line .progress { flex: 1; }
.progress-line b { font-size: 11px; color: var(--muted); min-width: 34px; text-align: right; }

.empty-state { padding: 48px 24px; text-align: center; color: var(--muted); }
.empty-icon {
  width: 62px; height: 62px; border-radius: 20px; display: grid; place-items: center;
  margin: 0 auto 14px; background: var(--primary-soft); color: var(--primary);
}
.empty-icon svg { width: 28px; height: 28px; }
.empty-state h3 { color: var(--text); margin: 0 0 6px; font-size: 16px; }
.empty-state p { margin: 0 auto 16px; max-width: 460px; }

/* ---------- login ---------- */
.login-page {
  min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(390px, .9fr);
  background: #fff;
}
.login-visual {
  position: relative; overflow: hidden; padding: 64px; color: #fff;
  background: linear-gradient(145deg, var(--primary-900), var(--primary) 58%, #7c3aed);
  display: flex; flex-direction: column; justify-content: space-between;
}
.login-visual::before, .login-visual::after {
  content: ""; position: absolute; border-radius: 50%; border: 1px solid rgba(255,255,255,.15);
}
.login-visual::before { width: 520px; height: 520px; right: -170px; top: -160px; }
.login-visual::after { width: 370px; height: 370px; left: -160px; bottom: -120px; }
.visual-orb { position: absolute; width: 210px; height: 210px; right: 10%; bottom: 16%; border-radius: 50%; background: rgba(34,211,238,.18); filter: blur(1px); }
.login-brand { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.brand-mark {
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
  background: #fff; color: var(--primary); font-weight: 900; font-size: 20px; overflow: hidden;
  box-shadow: 0 10px 30px rgba(15,23,42,.18);
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.login-brand strong { font-size: 21px; letter-spacing: -.02em; }
.login-brand small { display: block; opacity: .74; font-size: 12px; }
.visual-copy { position: relative; z-index: 1; max-width: 620px; }
.visual-copy .eyebrow { display: inline-flex; border: 1px solid rgba(255,255,255,.22); background: rgba(255,255,255,.1); border-radius: 99px; padding: 7px 12px; font-weight: 700; font-size: 12px; }
.visual-copy h1 { font-size: clamp(34px, 5vw, 62px); line-height: 1.03; letter-spacing: -.045em; margin: 18px 0 18px; }
.visual-copy p { font-size: 16px; line-height: 1.7; opacity: .8; max-width: 540px; }
.visual-points { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 30px; }
.visual-point { border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.09); border-radius: 15px; padding: 14px; backdrop-filter: blur(8px); }
.visual-point b { display: block; font-size: 13px; }
.visual-point span { font-size: 11.5px; opacity: .7; }
.visual-footer { position: relative; z-index: 1; font-size: 11.5px; opacity: .6; }
.login-panel { display: grid; place-items: center; padding: 36px; background: #fff; }
.login-card { width: min(100%, 410px); }
.login-mobile-brand { display: none; margin-bottom: 28px; }
.login-card h2 { font-size: 30px; letter-spacing: -.035em; margin: 0 0 8px; }
.login-card > p { color: var(--muted); margin: 0 0 28px; }
.login-card .field { margin-bottom: 15px; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 48px; }
.password-toggle { position: absolute; right: 4px; top: 3px; width: 38px; height: 36px; border: 0; background: transparent; color: #778196; cursor: pointer; display: grid; place-items: center; }
.password-toggle svg { width: 19px; height: 19px; }
.login-note { margin-top: 18px; padding: 12px 14px; background: var(--surface-2); border-radius: 12px; color: var(--muted); font-size: 11.5px; text-align: center; }
.login-version { text-align: center; margin-top: 20px; color: #9aa3b3; font-size: 11px; }

/* ---------- kerangka ---------- */
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 50; width: var(--sidebar);
  display: flex; flex-direction: column; color: #dbe4ff;
  background: linear-gradient(180deg, #111827 0%, #172554 58%, var(--primary-900) 100%);
  border-right: 1px solid rgba(255,255,255,.06);
  transition: transform .22s ease;
}
.sidebar-brand { height: 78px; padding: 16px 17px; display: flex; align-items: center; gap: 11px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-brand .brand-mark { width: 42px; height: 42px; border-radius: 13px; flex: 0 0 auto; }
.sidebar-brand b { color: #fff; font-size: 18px; display: block; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 165px; }
.sidebar-brand small { color: rgba(219,228,255,.58); font-size: 10.5px; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 10px; scrollbar-width: thin; }
.nav-label { padding: 15px 11px 7px; color: rgba(219,228,255,.42); text-transform: uppercase; letter-spacing: .13em; font-size: 9.5px; font-weight: 800; }
.nav-link {
  min-height: 43px; padding: 9px 11px; border-radius: 11px; display: flex; align-items: center; gap: 11px;
  color: rgba(219,228,255,.78); font-weight: 650; margin-bottom: 2px; position: relative;
}
.nav-link svg { width: 19px; height: 19px; flex: 0 0 auto; }
.nav-link:hover { background: rgba(255,255,255,.075); color: #fff; }
.nav-link.active { color: #fff; background: rgba(255,255,255,.13); box-shadow: inset 3px 0 0 #67e8f9; }
.sidebar-footer { padding: 12px; border-top: 1px solid rgba(255,255,255,.08); }
.user-mini { display: flex; align-items: center; gap: 10px; padding: 9px; border-radius: 12px; background: rgba(255,255,255,.07); }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto;
  color: #fff; background: linear-gradient(145deg, var(--primary), #22d3ee); font-weight: 900;
}
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.user-mini .info { flex: 1; min-width: 0; }
.user-mini b, .user-mini span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-mini b { color: #fff; font-size: 12.5px; }
.user-mini span { color: rgba(219,228,255,.55); font-size: 10.5px; }
.sidebar-actions { display: flex; gap: 6px; margin-top: 8px; }
.sidebar-actions button { flex: 1; min-height: 32px; border: 0; border-radius: 9px; color: rgba(219,228,255,.78); background: rgba(255,255,255,.07); cursor: pointer; font-size: 11px; }
.sidebar-actions button:hover { background: rgba(255,255,255,.12); color: #fff; }
.sidebar-version { text-align: center; color: rgba(219,228,255,.34); font-size: 9.5px; margin-top: 8px; }

.main-wrap { min-height: 100vh; margin-left: var(--sidebar); }
.topbar {
  height: 70px; position: sticky; top: 0; z-index: 35; display: flex; align-items: center; gap: 14px;
  padding: 0 28px; background: rgba(246,248,252,.9); backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(229,233,242,.85);
}
.menu-toggle { display: none; border: 0; background: #fff; border-radius: 10px; width: 40px; height: 40px; color: var(--text); box-shadow: var(--shadow-sm); cursor: pointer; place-items: center; }
.menu-toggle svg { width: 21px; height: 21px; }
.topbar-copy { flex: 1; min-width: 0; }
.topbar-copy h1 { margin: 0; font-size: 18px; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-copy p { margin: 1px 0 0; color: var(--muted); font-size: 11px; }
.topbar-right { display: flex; align-items: center; gap: 9px; }
.topbar-chip { display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 7px; background: #fff; border: 1px solid var(--line); border-radius: 999px; }
.topbar-chip b { font-size: 11.5px; }
.page-content { padding: 24px 28px 56px; max-width: 1540px; margin: 0 auto; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 45; backdrop-filter: blur(2px); }
.force-password-banner { margin: -2px 0 18px; border: 1px solid #fde68a; background: var(--warning-soft); color: #92400e; border-radius: 13px; padding: 11px 13px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.force-password-banner p { margin: 0; font-size: 12.5px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.page-head h2 { margin: 0; font-size: 24px; line-height: 1.2; letter-spacing: -.035em; }
.page-head p { margin: 5px 0 0; color: var(--muted); max-width: 700px; }
.page-head-actions { display: flex; gap: 9px; flex-wrap: wrap; }

/* ---------- dashboard ---------- */
.hero {
  position: relative; overflow: hidden; color: #fff; min-height: 220px;
  border-radius: var(--radius-lg); padding: 30px 32px;
  background: linear-gradient(135deg, #172554, var(--primary) 58%, #7c3aed);
  box-shadow: 0 24px 55px color-mix(in srgb, var(--primary), transparent 75%);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.hero::after { content: ""; position: absolute; width: 330px; height: 330px; right: -110px; top: -135px; border-radius: 50%; border: 52px solid rgba(255,255,255,.07); }
.hero::before { content: ""; position: absolute; width: 210px; height: 210px; right: 19%; bottom: -150px; border-radius: 50%; background: rgba(34,211,238,.16); }
.hero-copy { position: relative; z-index: 1; max-width: 720px; }
.hero-copy .eyebrow { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .14em; color: #a5f3fc; }
.hero-copy h2 { margin: 7px 0 10px; font-size: clamp(27px, 4vw, 42px); letter-spacing: -.045em; line-height: 1.1; }
.hero-copy p { margin: 0; color: rgba(255,255,255,.74); font-size: 14.5px; line-height: 1.65; }
.hero-actions { display: flex; gap: 9px; margin-top: 20px; flex-wrap: wrap; }
.hero .btn-primary { color: var(--primary-900); background: #fff; box-shadow: none; }
.hero .btn-secondary { color: #fff; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.15); }
.hero-progress {
  position: relative; z-index: 1; width: 150px; height: 150px; flex: 0 0 auto; border-radius: 50%;
  display: grid; place-items: center; background: conic-gradient(#67e8f9 var(--p, 0%), rgba(255,255,255,.15) 0);
}
.hero-progress::before { content: ""; width: 118px; height: 118px; border-radius: 50%; background: rgba(23,37,84,.82); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.hero-progress .value { position: absolute; text-align: center; }
.hero-progress b { display: block; font-size: 28px; letter-spacing: -.04em; }
.hero-progress span { font-size: 10.5px; color: rgba(255,255,255,.65); }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 18px 0; }
.stat-card { padding: 17px; display: flex; align-items: center; gap: 13px; }
.stat-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex: 0 0 auto; }
.stat-icon svg { width: 21px; height: 21px; }
.stat-card:nth-child(2) .stat-icon { background: #ecfeff; color: #0891b2; }
.stat-card:nth-child(3) .stat-icon { background: var(--success-soft); color: var(--success); }
.stat-card:nth-child(4) .stat-icon { background: #fff7ed; color: #ea580c; }
.stat-value { font-size: 22px; font-weight: 850; letter-spacing: -.03em; line-height: 1.1; }
.stat-label { color: var(--muted); font-size: 11.5px; margin-top: 3px; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .7fr); gap: 18px; align-items: start; }
.section-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 12px; }
.section-title h3 { margin: 0; font-size: 16px; }
.section-title a { color: var(--primary); font-size: 12px; font-weight: 800; }
.announcement-list { display: grid; gap: 10px; }
.announcement-item { border: 1px solid var(--line); border-radius: 13px; padding: 13px; background: #fff; }
.announcement-item h4 { margin: 0 0 5px; font-size: 13px; }
.announcement-item p { margin: 0; color: var(--muted); font-size: 12px; white-space: pre-line; }
.announcement-meta { margin-top: 8px; color: #9aa3b3; font-size: 10.5px; }

/* ---------- course ---------- */
.course-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.course-card { overflow: hidden; transition: transform .16s ease, box-shadow .16s ease; cursor: pointer; }
.course-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.course-cover { position: relative; aspect-ratio: 16 / 9; background: linear-gradient(135deg, var(--primary-900), var(--primary), #22d3ee); overflow: hidden; }
.course-cover img { width: 100%; height: 100%; object-fit: cover; }
.course-cover::after { content: ""; position: absolute; inset: auto 0 0; height: 42%; background: linear-gradient(transparent, rgba(15,23,42,.3)); }
.course-cover .cover-placeholder { width: 100%; height: 100%; display: grid; place-items: center; color: rgba(255,255,255,.85); }
.course-cover .cover-placeholder svg { width: 42px; height: 42px; }
.course-cover .course-category { position: absolute; z-index: 1; left: 12px; top: 12px; color: #fff; background: rgba(15,23,42,.55); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.15); }
.course-body { padding: 16px; }
.course-body h3 { margin: 0; font-size: 15px; line-height: 1.35; min-height: 40px; }
.course-body p { margin: 7px 0 13px; color: var(--muted); font-size: 12px; line-height: 1.55; min-height: 37px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.course-meta { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 11px; margin-bottom: 12px; }
.course-meta span { display: inline-flex; align-items: center; gap: 5px; }
.course-meta svg { width: 14px; height: 14px; }
.course-foot { display: flex; align-items: center; gap: 10px; }
.course-foot .progress { flex: 1; }
.course-foot b { font-size: 11px; color: var(--primary); }

.course-hero { overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .65fr); min-height: 280px; }
.course-hero-copy { padding: 30px; display: flex; flex-direction: column; justify-content: center; }
.course-hero-copy h2 { font-size: clamp(27px, 4vw, 40px); line-height: 1.12; letter-spacing: -.045em; margin: 10px 0 12px; }
.course-hero-copy p { margin: 0; color: var(--muted); max-width: 760px; line-height: 1.7; }
.course-hero-meta { display: flex; gap: 9px; flex-wrap: wrap; }
.course-hero-actions { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.course-hero-image { min-height: 260px; background: linear-gradient(135deg, var(--primary-900), var(--primary), #22d3ee); }
.course-hero-image img { width: 100%; height: 100%; object-fit: cover; }
.course-hero-image .cover-placeholder { width: 100%; height: 100%; display: grid; place-items: center; color: rgba(255,255,255,.8); }
.course-hero-image svg { width: 62px; height: 62px; }
.course-progress-box { margin-top: 18px; max-width: 500px; }
.course-progress-box .progress-line b { color: var(--primary); }
.course-sections { display: grid; gap: 13px; margin-top: 18px; }
.course-section { overflow: hidden; }
.section-head { padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.section-head h3 { margin: 0; font-size: 14px; }
.section-head p { margin: 3px 0 0; color: var(--muted); font-size: 11.5px; }
.section-head .count { color: var(--muted); font-size: 11px; font-weight: 700; }
.lesson-row { display: flex; align-items: center; gap: 12px; padding: 13px 17px; border-bottom: 1px solid #eef1f6; cursor: pointer; }
.lesson-row:last-child { border-bottom: 0; }
.lesson-row:hover { background: color-mix(in srgb, var(--primary-soft), white 45%); }
.lesson-state { width: 31px; height: 31px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid #dbe1eb; color: #94a3b8; flex: 0 0 auto; }
.lesson-state.done { color: #fff; background: var(--success); border-color: var(--success); }
.lesson-state svg { width: 15px; height: 15px; }
.lesson-row .lesson-copy { flex: 1; min-width: 0; }
.lesson-row .lesson-copy b { display: block; font-size: 13px; }
.lesson-row .lesson-copy span { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lesson-row .duration { color: var(--muted); font-size: 10.5px; white-space: nowrap; }

/* ---------- lesson ---------- */
.lesson-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 18px; align-items: start; }
.lesson-main { min-width: 0; }
.video-frame { width: 100%; aspect-ratio: 16 / 9; background: #0b1020; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.video-frame iframe, .video-frame video { width: 100%; height: 100%; border: 0; display: block; background: #000; }
.video-empty { width: 100%; height: 100%; display: grid; place-items: center; text-align: center; color: #94a3b8; padding: 30px; }
.video-empty svg { width: 50px; height: 50px; margin: 0 auto 12px; color: #c4b5fd; }
.lesson-card { margin-top: 15px; padding: 22px; }
.lesson-top-meta { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 10px; }
.lesson-card h2 { margin: 0 0 8px; font-size: 25px; letter-spacing: -.035em; }
.lesson-summary { color: var(--muted); margin: 0; line-height: 1.65; }
.lesson-actions { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 18px 0; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.lesson-content { font-size: 14.5px; line-height: 1.82; color: #303b50; white-space: pre-line; }
.lesson-content:empty::after { content: "Belum ada catatan tambahan untuk materi ini."; color: var(--muted); }
.resources { margin-top: 22px; }
.resources h3 { font-size: 14px; margin: 0 0 10px; }
.resource-link { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; margin-bottom: 8px; color: var(--primary-700); font-weight: 700; }
.resource-link:hover { background: var(--primary-soft); }
.resource-link svg { width: 18px; height: 18px; flex: 0 0 auto; }
.lesson-nav-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.lesson-nav-btn { border: 1px solid var(--line); border-radius: 13px; padding: 12px; background: #fff; cursor: pointer; min-width: 0; }
.lesson-nav-btn:last-child { text-align: right; }
.lesson-nav-btn small { display: block; color: var(--muted); margin-bottom: 3px; }
.lesson-nav-btn b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.lesson-sidebar { position: sticky; top: 88px; max-height: calc(100vh - 110px); overflow: hidden; display: flex; flex-direction: column; }
.lesson-sidebar-head { padding: 16px; border-bottom: 1px solid var(--line); }
.lesson-sidebar-head h3 { margin: 0; font-size: 14px; }
.lesson-sidebar-head p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.lesson-nav-list { overflow-y: auto; padding: 8px; }
.lesson-nav-section { color: #64748b; font-size: 9.5px; text-transform: uppercase; letter-spacing: .1em; font-weight: 850; padding: 11px 8px 6px; }
.lesson-nav-item { display: flex; align-items: flex-start; gap: 9px; padding: 9px; border-radius: 10px; cursor: pointer; margin-bottom: 2px; }
.lesson-nav-item:hover { background: var(--surface-2); }
.lesson-nav-item.active { background: var(--primary-soft); color: var(--primary-700); }
.lesson-nav-item .dot { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid #cbd5e1; flex: 0 0 auto; display: grid; place-items: center; margin-top: 1px; }
.lesson-nav-item.done .dot { background: var(--success); border-color: var(--success); color: #fff; }
.lesson-nav-item .dot svg { width: 11px; height: 11px; }
.lesson-nav-item span { font-size: 11.5px; line-height: 1.4; }

/* ---------- tools ---------- */
.tool-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.tool-card { overflow: hidden; padding: 17px; display: flex; flex-direction: column; min-height: 235px; transition: transform .15s ease, box-shadow .15s ease; }
.tool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.tool-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.tool-icon { width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center; background: var(--primary-soft); font-size: 24px; overflow: hidden; }
.tool-icon img { width: 100%; height: 100%; object-fit: cover; }
.tool-card h3 { margin: 15px 0 7px; font-size: 15px; }
.tool-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; flex: 1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tool-card .btn { margin-top: 16px; }
.tool-clicks { color: #9aa3b3; font-size: 10px; margin-top: 7px; text-align: center; }

/* ---------- tabel/admin ---------- */
.table-card { overflow: hidden; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid #edf0f5; vertical-align: middle; }
th { background: var(--surface-2); color: #657086; text-transform: uppercase; letter-spacing: .07em; font-size: 9.5px; font-weight: 850; white-space: nowrap; }
td { font-size: 12.5px; }
tbody tr:hover td { background: #fbfcfe; }
tbody tr:last-child td { border-bottom: 0; }
.table-user { display: flex; align-items: center; gap: 10px; min-width: 170px; }
.table-user b { display: block; font-size: 12.5px; }
.table-user small { display: block; color: var(--muted); }
.row-actions { display: flex; gap: 5px; justify-content: flex-end; }
.row-actions .btn { min-width: 34px; }

.admin-stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.admin-stat { padding: 17px; }
.admin-stat .label { color: var(--muted); font-size: 11px; }
.admin-stat .value { font-size: 25px; font-weight: 850; letter-spacing: -.04em; margin: 4px 0; }
.admin-stat .note { color: #9aa3b3; font-size: 10.5px; }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(290px, .75fr); gap: 17px; align-items: start; }
.activity-list { display: grid; }
.activity-item { display: flex; gap: 11px; padding: 11px 0; border-bottom: 1px solid #edf0f5; }
.activity-item:last-child { border-bottom: 0; }
.activity-dot { width: 33px; height: 33px; border-radius: 11px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex: 0 0 auto; }
.activity-dot svg { width: 16px; height: 16px; }
.activity-copy { flex: 1; min-width: 0; }
.activity-copy b { font-size: 12px; }
.activity-copy p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.activity-copy small { display: block; color: #a0a8b6; margin-top: 3px; font-size: 9.5px; }
.expiry-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #edf0f5; }
.expiry-item:last-child { border-bottom: 0; }
.expiry-item .copy { flex: 1; min-width: 0; }
.expiry-item b, .expiry-item span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.expiry-item b { font-size: 12px; }
.expiry-item span { color: var(--muted); font-size: 10.5px; }

.package-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.package-card { padding: 18px; position: relative; overflow: hidden; }
.package-card::before { content: ""; position: absolute; width: 90px; height: 90px; right: -35px; top: -35px; border-radius: 50%; background: var(--pkg, var(--primary)); opacity: .1; }
.package-color { width: 12px; height: 12px; border-radius: 50%; background: var(--pkg, var(--primary)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--pkg, var(--primary)), transparent 85%); }
.package-card h3 { margin: 14px 0 6px; font-size: 16px; }
.package-card > p { margin: 0; color: var(--muted); min-height: 42px; font-size: 12px; }
.package-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 15px 0; }
.package-stat { background: var(--surface-2); border-radius: 10px; padding: 9px; text-align: center; }
.package-stat b { display: block; font-size: 15px; }
.package-stat span { color: var(--muted); font-size: 9.5px; }
.package-actions { display: flex; gap: 7px; }


.package-form-basic {
  border: 1px solid var(--line); border-radius: 16px; padding: 16px; background: #fff;
}
.package-color-field { display: flex; align-items: center; gap: 11px; min-height: 43px; }
.package-color-field input[type="color"] {
  width: 64px; min-width: 64px; height: 43px; min-height: 43px; padding: 4px; cursor: pointer;
}
.package-color-field span { color: var(--muted); font-size: 11.5px; line-height: 1.45; }
.package-access-note {
  display: flex; align-items: flex-start; gap: 11px; margin-top: 16px; padding: 13px 14px;
  border: 1px solid #cfe0ff; border-radius: 14px; background: #f5f8ff;
}
.package-access-note > div {
  width: 31px; height: 31px; border-radius: 9px; display: grid; place-items: center;
  flex: 0 0 auto; color: var(--primary); background: var(--primary-soft);
}
.package-access-note svg { width: 17px; height: 17px; }
.package-access-note p { margin: 0; color: #526076; font-size: 11.5px; line-height: 1.55; }
.package-access-note b { display: block; color: var(--text); font-size: 12.5px; margin-bottom: 2px; }
.package-access-note span { display: block; }
.package-access-layout {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; margin-top: 16px;
}
.package-access-panel {
  min-width: 0; border: 1px solid var(--line); border-radius: 16px; background: #fff; overflow: hidden;
}
.package-access-panel-head {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 13px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2);
}
.package-access-panel-icon {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  color: var(--primary); background: var(--primary-soft);
}
.package-access-panel-icon svg { width: 18px; height: 18px; }
.package-access-panel-head h4 { margin: 0; font-size: 13.5px; }
.package-access-panel-head p { margin: 2px 0 0; color: var(--muted); font-size: 10.5px; line-height: 1.4; }
.package-access-count {
  min-width: 52px; padding: 5px 8px; border-radius: 99px; text-align: center;
  color: var(--primary-700); background: var(--primary-soft); font-size: 10.5px; font-weight: 800;
}
.package-access-toolbar {
  display: flex; align-items: center; gap: 8px; padding: 10px 11px; border-bottom: 1px solid var(--line);
}
.package-access-search { position: relative; flex: 1; min-width: 0; }
.package-access-search svg {
  position: absolute; width: 16px; height: 16px; left: 10px; top: 10px; color: #94a3b8; pointer-events: none;
}
.package-access-search input {
  width: 100%; height: 36px; border: 1px solid #dbe1eb; border-radius: 10px; padding: 7px 9px 7px 33px;
  outline: none; color: var(--text); background: #fff;
}
.package-access-search input:focus {
  border-color: color-mix(in srgb, var(--primary), white 30%);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary), transparent 90%);
}
.package-access-tools { display: flex; gap: 5px; flex: 0 0 auto; }
.package-access-tools button {
  border: 0; border-radius: 8px; padding: 7px 8px; cursor: pointer; color: #536177;
  background: #eef2f7; font-size: 9.5px; font-weight: 800;
}
.package-access-tools button:hover { color: var(--primary-700); background: var(--primary-soft); }
.package-access-list {
  display: grid; gap: 8px; padding: 10px; max-height: 350px; overflow-y: auto; overscroll-behavior: contain;
}
.package-access-option {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px;
  min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer;
  background: #fff; transition: border-color .14s ease, background .14s ease, box-shadow .14s ease;
}
.package-access-option:hover { border-color: #c9d2e1; background: #fbfcfe; }
.package-access-option:has(.package-access-check:checked) {
  border-color: color-mix(in srgb, var(--primary), white 48%);
  background: color-mix(in srgb, var(--primary-soft), white 45%);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary), transparent 93%);
}
.package-access-option.is-filtered { display: none; }
.package-access-check { width: 17px; height: 17px; margin: 0; accent-color: var(--primary); }
.package-access-copy { min-width: 0; display: grid; gap: 2px; }
.package-access-title {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text); font-size: 11.8px; font-weight: 800;
}
.package-access-meta { color: var(--muted); font-size: 9.8px; }
.package-access-warning { color: #a16207; font-size: 9.3px; line-height: 1.35; }
.package-access-assignment {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: #667085; font-size: 9.3px;
}
.package-access-badges { display: grid; justify-items: end; gap: 5px; }
.package-access-badges .badge { font-size: 8.5px; padding: 3px 6px; }
.access-scope {
  max-width: 105px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border-radius: 99px; padding: 3px 6px; font-size: 8.5px; font-weight: 800;
}
.access-scope.all { color: #075985; background: #e0f2fe; }
.access-scope.limited { color: var(--primary-700); background: var(--primary-soft); }
.access-scope.orphan { color: #9f1239; background: #ffe4e6; }
.package-access-no-result { padding: 24px 12px; text-align: center; color: var(--muted); font-size: 11px; }
.package-access-empty-static {
  min-height: 220px; padding: 28px 18px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; color: var(--muted);
}
.package-access-empty-static .empty-icon { margin-bottom: 8px; }
.package-access-empty-static b { color: var(--text); font-size: 13px; }
.package-access-empty-static span { max-width: 260px; margin-top: 4px; font-size: 10.5px; line-height: 1.5; }

.admin-course-list { display: grid; gap: 12px; }
.admin-course-card { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 13px; }
.admin-course-cover { width: 150px; aspect-ratio: 16/9; border-radius: 12px; overflow: hidden; background: linear-gradient(135deg, var(--primary-900), var(--primary), #22d3ee); color: #fff; display: grid; place-items: center; }
.admin-course-cover img { width: 100%; height: 100%; object-fit: cover; }
.admin-course-cover svg { width: 30px; height: 30px; }
.admin-course-copy { min-width: 0; }
.admin-course-copy h3 { margin: 0 0 5px; font-size: 15px; }
.admin-course-copy p { margin: 0; color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-course-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.admin-course-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.editor-header { display: grid; grid-template-columns: 170px minmax(0, 1fr) auto; gap: 18px; padding: 17px; align-items: center; }
.editor-cover { width: 170px; aspect-ratio: 16/9; border-radius: 12px; overflow: hidden; background: linear-gradient(135deg, var(--primary-900), var(--primary), #22d3ee); display: grid; place-items: center; color: #fff; }
.editor-cover img { width: 100%; height: 100%; object-fit: cover; }
.editor-cover svg { width: 34px; height: 34px; }
.editor-copy h2 { margin: 0 0 6px; font-size: 21px; }
.editor-copy p { margin: 0; color: var(--muted); }
.editor-actions { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.editor-section { overflow: hidden; margin-top: 13px; }
.editor-section-head { padding: 13px 15px; background: var(--surface-2); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.editor-section-head h3 { margin: 0; font-size: 14px; }
.editor-section-head p { margin: 2px 0 0; color: var(--muted); font-size: 10.5px; }
.editor-section-actions { display: flex; gap: 5px; }
.editor-lesson { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid #edf0f5; }
.editor-lesson:last-child { border-bottom: 0; }
.drag-handle { color: #a8b0bf; flex: 0 0 auto; }
.drag-handle svg { width: 17px; height: 17px; }
.editor-lesson-copy { flex: 1; min-width: 0; }
.editor-lesson-copy b { display: block; font-size: 12.5px; }
.editor-lesson-copy span { color: var(--muted); font-size: 10.5px; }
.editor-lesson-actions { display: flex; gap: 4px; }

.upload-box { border: 1.5px dashed #cbd5e1; border-radius: 13px; padding: 15px; background: var(--surface-2); text-align: center; }
.upload-box input[type=file] { display: none; }
.upload-preview { width: 100%; max-height: 220px; object-fit: cover; border-radius: 10px; margin-bottom: 10px; }
.upload-progress { height: 8px; border-radius: 99px; overflow: hidden; background: #e2e8f0; margin-top: 10px; display: none; }
.upload-progress span { display: block; height: 100%; background: var(--primary); width: 0; transition: width .1s linear; }
.upload-status { font-size: 11px; color: var(--muted); margin-top: 7px; }

.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 17px; align-items: start; }
.brand-preview { position: sticky; top: 88px; overflow: hidden; }
.brand-preview-top { min-height: 180px; padding: 22px; color: #fff; background: linear-gradient(135deg, #172554, var(--preview-primary, var(--primary)), #7c3aed); display: flex; flex-direction: column; justify-content: flex-end; }
.brand-preview-top .brand-mark { margin-bottom: 13px; }
.brand-preview-top h3 { margin: 0; font-size: 22px; }
.brand-preview-top p { margin: 4px 0 0; color: rgba(255,255,255,.7); font-size: 11.5px; }
.brand-preview-body { padding: 17px; }
.brand-preview-body b { display: block; margin-bottom: 4px; }
.brand-preview-body span { color: var(--muted); font-size: 11.5px; }

/* ---------- profil/pengumuman ---------- */
.profile-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 17px; align-items: start; }
.profile-card { padding: 22px; }
.profile-side { padding: 22px; text-align: center; }
.profile-side .avatar { width: 76px; height: 76px; margin: 0 auto 12px; font-size: 26px; }
.profile-side h3 { margin: 0 0 3px; }
.profile-side p { color: var(--muted); margin: 0 0 13px; }
.membership-box { text-align: left; border: 1px solid var(--line); border-radius: 13px; padding: 13px; background: var(--surface-2); }
.membership-row { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 8px; font-size: 11.5px; }
.membership-row:last-child { margin-bottom: 0; }
.membership-row span { color: var(--muted); }

.announcement-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.announcement-card { padding: 19px; }
.announcement-card h3 { margin: 10px 0 7px; font-size: 15px; }
.announcement-card p { margin: 0; color: var(--muted); line-height: 1.7; white-space: pre-line; }
.announcement-card footer { margin-top: 14px; color: #9aa3b3; font-size: 10.5px; }

/* ---------- modal/toast ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(15,23,42,.55); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 18px; animation: fadeIn .14s ease; }
.modal { width: min(100%, 620px); max-height: calc(100vh - 36px); overflow: hidden; background: #fff; border-radius: 20px; box-shadow: 0 30px 90px rgba(15,23,42,.25); display: flex; flex-direction: column; animation: popIn .18s ease; }
.modal.wide { width: min(100%, 850px); }
.modal.xwide { width: min(100%, 1050px); }
.modal-head { padding: 18px 20px; display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 18px; }
.modal-head p { margin: 4px 0 0; color: var(--muted); font-size: 11.5px; }
.modal-close { width: 36px; height: 36px; border-radius: 10px; border: 0; background: var(--surface-2); color: var(--muted); cursor: pointer; display: grid; place-items: center; flex: 0 0 auto; }
.modal-close svg { width: 18px; height: 18px; }
.modal-body { padding: 20px; overflow-y: auto; overscroll-behavior: contain; }
.modal-foot { padding: 13px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; background: var(--surface-2); }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { transform: translateY(12px) scale(.985); opacity: 0; } }

#toast-root { position: fixed; z-index: 150; right: 18px; top: 18px; display: grid; gap: 9px; pointer-events: none; }
.toast { width: min(360px, calc(100vw - 36px)); border-radius: 13px; padding: 12px 14px; color: #fff; background: #172033; box-shadow: 0 15px 40px rgba(15,23,42,.22); display: flex; align-items: flex-start; gap: 10px; pointer-events: auto; animation: toastIn .2s ease; }
.toast.success { background: #047857; }
.toast.error { background: #b91c1c; }
.toast.warning { background: #b45309; }
.toast svg { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 1px; }
.toast p { margin: 0; font-size: 12.5px; font-weight: 650; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } }

.confirm-box { text-align: center; padding: 6px 4px 2px; }
.confirm-icon { width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; margin: 0 auto 14px; background: var(--danger-soft); color: var(--danger); }
.confirm-icon svg { width: 27px; height: 27px; }
.confirm-box h3 { margin: 0 0 7px; font-size: 18px; }
.confirm-box p { margin: 0; color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .course-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats-grid, .admin-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-grid, .admin-grid { grid-template-columns: 1fr; }
  .lesson-layout { grid-template-columns: minmax(0, 1fr) 280px; }
  .package-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 920px) {
  .login-page { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-panel { min-height: 100vh; background: radial-gradient(circle at top, var(--primary-soft), transparent 45%), #fff; }
  .login-mobile-brand { display: flex; align-items: center; gap: 11px; }
  .login-mobile-brand .brand-mark { box-shadow: none; background: var(--primary); color: #fff; }
  .sidebar { transform: translateX(-102%); }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-overlay { display: block; }
  .main-wrap { margin-left: 0; }
  .menu-toggle { display: grid; }
  .topbar { padding: 0 18px; }
  .page-content { padding: 20px 18px 48px; }
  .lesson-layout { grid-template-columns: 1fr; }
  .lesson-sidebar { position: static; max-height: 420px; }
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .course-hero { grid-template-columns: 1fr; }
  .course-hero-image { min-height: 220px; order: -1; }
  .settings-grid, .profile-grid { grid-template-columns: 1fr; }
  .brand-preview { position: static; }
}

@media (max-width: 680px) {
  body { font-size: 13.5px; }
  .login-panel { padding: 24px 20px; align-items: center; }
  .login-card h2 { font-size: 26px; }
  .topbar { height: 62px; padding: 0 13px; }
  .topbar-copy h1 { font-size: 15px; }
  .topbar-copy p { display: none; }
  .topbar-chip { padding-right: 7px; }
  .topbar-chip b { display: none; }
  .page-content { padding: 16px 13px 38px; }
  .page-head { align-items: flex-start; margin-bottom: 15px; }
  .page-head h2 { font-size: 21px; }
  .page-head p { font-size: 12px; }
  .page-head-actions { width: 100%; }
  .page-head-actions .btn { flex: 1; }
  .hero { min-height: 0; padding: 24px 20px; border-radius: 19px; }
  .hero-copy h2 { font-size: 27px; }
  .hero-progress { display: none; }
  .stats-grid, .admin-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .stat-card { padding: 13px 12px; gap: 9px; }
  .stat-icon { width: 37px; height: 37px; border-radius: 12px; }
  .stat-value { font-size: 18px; }
  .stat-label { font-size: 10px; }
  .course-grid, .tool-grid, .package-grid, .announcement-grid { grid-template-columns: 1fr; }
  .course-card { display: grid; grid-template-columns: 116px minmax(0, 1fr); }
  .course-cover { aspect-ratio: auto; min-height: 156px; }
  .course-cover .course-category { left: 7px; top: 7px; max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .course-body { padding: 13px; }
  .course-body h3 { min-height: 0; font-size: 13.5px; }
  .course-body p { min-height: 0; -webkit-line-clamp: 2; margin-bottom: 8px; font-size: 11px; }
  .course-meta { gap: 7px; flex-wrap: wrap; margin-bottom: 8px; }
  .course-meta span:last-child { display: none; }
  .tool-card { min-height: 0; }
  .course-hero-copy { padding: 21px 18px; }
  .course-hero-copy h2 { font-size: 27px; }
  .course-hero-image { min-height: 180px; }
  .lesson-card { padding: 17px; }
  .lesson-card h2 { font-size: 21px; }
  .lesson-nav-buttons { grid-template-columns: 1fr; }
  .form-grid.two, .form-grid.three, .check-grid { grid-template-columns: 1fr; }
  .package-access-layout { grid-template-columns: 1fr; }
  .package-access-list { max-height: 310px; }
  .package-access-toolbar { align-items: stretch; flex-direction: column; }
  .package-access-tools { justify-content: flex-end; }
  .package-access-option { grid-template-columns: auto minmax(0, 1fr); align-items: start; }
  .package-access-badges { grid-column: 2; grid-row: 2; display: flex; justify-items: initial; flex-wrap: wrap; }
  .package-color-field { align-items: flex-start; flex-direction: column; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal, .modal.wide, .modal.xwide { width: 100%; max-height: 92vh; border-radius: 20px 20px 0 0; }
  .modal-body { padding: 17px; }
  .modal-head, .modal-foot { padding-left: 17px; padding-right: 17px; }
  #toast-root { right: 10px; top: 10px; }
  .toolbar .search { min-width: 100%; }
  .toolbar select { flex: 1; min-width: 0; }
  .admin-course-card { grid-template-columns: 96px minmax(0, 1fr); gap: 11px; }
  .admin-course-cover { width: 96px; }
  .admin-course-actions { grid-column: 1 / -1; justify-content: stretch; }
  .admin-course-actions .btn { flex: 1; }
  .editor-header { grid-template-columns: 100px minmax(0, 1fr); gap: 12px; }
  .editor-cover { width: 100px; }
  .editor-actions { grid-column: 1 / -1; justify-content: stretch; }
  .editor-actions .btn { flex: 1; }
  .editor-section-head { align-items: flex-start; }
  .editor-lesson { align-items: flex-start; }
  .editor-lesson-actions { flex-wrap: wrap; width: 70px; justify-content: flex-end; }
  .force-password-banner { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 390px) {
  .stats-grid, .admin-stat-grid { grid-template-columns: 1fr 1fr; }
  .stat-icon { display: none; }
  .course-card { grid-template-columns: 102px minmax(0, 1fr); }
  .course-cover { min-height: 145px; }
}
