/* =============================================
   TALENTA BY INGINKERJA — Design System
   ============================================= */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&family=Inter:wght@300;400;500;600&display=swap');

/* =============================================
   CSS CUSTOM PROPERTIES (TOKENS)
   ============================================= */
:root {
  /* Brand */
  --primary:       #6366f1;
  --primary-dark:  #4f46e5;
  --primary-light: #a5b4fc;
  --primary-bg:    #eef2ff;

  /* Accent */
  --accent:        #f59e0b;
  --accent-dark:   #d97706;

  /* Semantic */
  --success:       #10b981;
  --success-bg:    #d1fae5;
  --danger:        #ef4444;
  --danger-bg:     #fee2e2;
  --warning:       #f59e0b;
  --warning-bg:    #fef3c7;
  --info:          #3b82f6;
  --info-bg:       #dbeafe;

  /* Light mode */
  --bg:            #f8fafc;
  --bg-card:       #ffffff;
  --bg-sidebar:    #1e1b4b;
  --bg-sidebar-hover: #312e81;
  --text:          #1e293b;
  --text-muted:    #64748b;
  --text-light:    #94a3b8;
  --border:        #e2e8f0;
  --shadow:        0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md:     0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg:     0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --shadow-xl:     0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);

  /* Typography */
  --font-sans:     'Inter', system-ui, -apple-system, sans-serif;
  --font-heading:  'Poppins', system-ui, -apple-system, sans-serif;

  /* Spacing */
  --radius:        0.5rem;
  --radius-lg:     0.75rem;
  --radius-xl:     1rem;
  --radius-full:   9999px;

  /* Sidebar */
  --sidebar-width: 240px;
  --topbar-height: 56px;

  /* Transitions — animate only compositor/paint-cheap properties.
     "all" forces the browser to watch every property (incl. layout) and
     causes jank while scrolling over hoverable elements. */
  --transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

/* Dark mode */
[data-theme="dark"] {
  --bg:            #0f172a;
  --bg-card:       #1e293b;
  --bg-sidebar:    #0f172a;
  --bg-sidebar-hover: #1e293b;
  --text:          #f1f5f9;
  --text-muted:    #94a3b8;
  --text-light:    #64748b;
  --border:        #334155;
  --shadow:        0 1px 3px rgba(0,0,0,0.3);
  --shadow-md:     0 4px 6px -1px rgba(0,0,0,0.4);
  --shadow-lg:     0 10px 15px -3px rgba(0,0,0,0.4);
  --primary-bg:    #1e1b4b;
  --success-bg:    #064e3b;
  --danger-bg:     #7f1d1d;
  --warning-bg:    #78350f;
  --info-bg:       #1e3a5f;
}

/* =============================================
   RESET & BASE
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* overflow-x:hidden di <html> mematikan optimasi compositor scrolling di
   sebagian browser — cukup di <body>. smooth hanya bila user tidak keberatan. */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 14px;
  transition: background-color 0.3s, color 0.3s;
  overflow-x: hidden;
}

h1,h2,h3,h4,h5,h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

a { color: var(--primary); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; }

ul, ol { list-style: none; }

/* =============================================
   UTILITIES
   ============================================= */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.container-sm { max-width: 768px; margin: 0 auto; padding: 0 1.5rem; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-sm     { font-size: 0.875rem; }
.text-xs     { font-size: 0.75rem; }
.text-lg     { font-size: 1.125rem; }
.text-xl     { font-size: 1.25rem; }
.text-2xl    { font-size: 1.5rem; }
.text-3xl    { font-size: 1.875rem; }
.text-4xl    { font-size: 2.25rem; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold   { font-weight: 700; }
.font-heading { font-family: var(--font-heading); }

.text-muted   { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

.p-2  { padding: 0.5rem; }
.p-4  { padding: 1rem; }
.p-6  { padding: 1.5rem; }
.p-8  { padding: 2rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }

.w-full { width: 100%; }
.hidden { display: none !important; }
.relative { position: relative; }
.absolute { position: absolute; }
.overflow-hidden { overflow: hidden; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  font-family: var(--font-sans);
  line-height: 1;
}

.btn:disabled, .btn.loading {
  opacity: 0.65;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(99,102,241,0.4); }

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg); border-color: var(--primary); color: var(--primary); }

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover { background: #dc2626; color: #fff; }

.btn-success {
  background: var(--success);
  color: #fff;
}
.btn-success:hover { background: #059669; color: #fff; }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: none;
}
.btn-ghost:hover { background: var(--bg); color: var(--text); }

.btn-sm { padding: 0.3125rem 0.75rem; font-size: 0.8125rem; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 0.9375rem; border-radius: var(--radius-lg); }
.btn-xl { padding: 0.875rem 1.75rem; font-size: 1rem; border-radius: var(--radius-lg); }
.btn-icon { padding: 0.4375rem; aspect-ratio: 1; justify-content: center; }
.btn-full { width: 100%; justify-content: center; }

/* Loading state */
.btn.loading::after {
  content: '';
  width: 1em;
  height: 1em;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* =============================================
   CARDS
   ============================================= */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }

.card-body { padding: 1.25rem; }
.card-header {
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
}
.card-footer {
  padding: 0.875rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
  overflow: hidden;
}

.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-xl); }

/* =============================================
   FORMS
   ============================================= */
.form-group { margin-bottom: 1rem; }

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.375rem;
}
.form-label span.required { color: var(--danger); margin-left: 2px; }

.form-control {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--text);
  background: var(--bg-card);
  transition: var(--transition);
  font-family: var(--font-sans);
  line-height: 1.5;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.form-control::placeholder { color: var(--text-light); }
.form-control:disabled { opacity: 0.6; cursor: not-allowed; background: var(--bg); }

textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { cursor: pointer; }

.form-hint { font-size: 0.8125rem; color: var(--text-muted); margin-top: 0.25rem; }
.form-error { font-size: 0.8125rem; color: var(--danger); margin-top: 0.25rem; }
.form-control.is-invalid { border-color: var(--danger); }
.form-control.is-valid   { border-color: var(--success); }

/* Input with icon */
.input-group { position: relative; }
.input-group .input-icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  pointer-events: none;
}
.input-group .form-control { padding-left: 2.5rem; }
/* Sisakan ruang kanan bila ada tombol toggle (mis. lihat/sembunyikan password) */
.input-group:has(.input-icon-right) .form-control { padding-right: 2.9rem; }
/* Tombol ikon kanan (toggle password) — reset tampilan <button> bawaan agar
   tidak muncul kotak abu-abu; jadikan tombol ikon bersih dengan hover halus. */
.input-group .input-icon-right {
  position: absolute;
  right: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
  appearance: none;
}
.input-group .input-icon-right:hover  { color: var(--primary); background: var(--bg); }
.input-group .input-icon-right:active { background: var(--border); }
.input-group .input-icon-right:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.input-group .input-icon-right i { font-size: 0.95rem; line-height: 1; pointer-events: none; }

/* Checkbox & Radio */
.form-check { display: flex; align-items: flex-start; gap: 0.5rem; cursor: pointer; }
.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
}
.form-check-label { font-size: 0.875rem; color: var(--text); cursor: pointer; }

/* =============================================
   BADGES
   ============================================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
}

.badge-primary   { background: var(--primary-bg); color: var(--primary); }
.badge-success   { background: var(--success-bg); color: var(--success); }
.badge-danger    { background: var(--danger-bg); color: var(--danger); }
.badge-warning   { background: var(--warning-bg); color: var(--accent-dark); }
.badge-info      { background: var(--info-bg); color: var(--info); }
.badge-gray      { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }

/* Custom badge classes from statusBadge helper */
.bg-emerald-100 { background: #d1fae5; } .text-emerald-700 { color: #047857; }
.bg-gray-100 { background: #f3f4f6; } .text-gray-600 { color: #4b5563; }
.bg-red-100 { background: #fee2e2; } .text-red-700 { color: #b91c1c; }
.bg-blue-100 { background: #dbeafe; } .text-blue-700 { color: #1d4ed8; }
.bg-yellow-100 { background: #fef9c3; } .text-yellow-700 { color: #a16207; }
.bg-purple-100 { background: #f3e8ff; } .text-purple-700 { color: #7e22ce; }
[data-theme="dark"] .bg-emerald-100 { background: #064e3b; } [data-theme="dark"] .text-emerald-700 { color: #6ee7b7; }
[data-theme="dark"] .bg-gray-100 { background: #374151; } [data-theme="dark"] .text-gray-600 { color: #d1d5db; }
[data-theme="dark"] .bg-red-100 { background: #7f1d1d; } [data-theme="dark"] .text-red-700 { color: #fca5a5; }

/* =============================================
   ALERTS / FLASH MESSAGES
   ============================================= */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  border-left: 4px solid;
}
.alert-success { background: var(--success-bg); color: #065f46; border-color: var(--success); }
.alert-error   { background: var(--danger-bg); color: #991b1b; border-color: var(--danger); }
.alert-warning { background: var(--warning-bg); color: #92400e; border-color: var(--warning); }
.alert-info    { background: var(--info-bg); color: #1e3a5f; border-color: var(--info); }
[data-theme="dark"] .alert-success { color: #6ee7b7; }
[data-theme="dark"] .alert-error   { color: #fca5a5; }
[data-theme="dark"] .alert-warning { color: #fcd34d; }
[data-theme="dark"] .alert-info    { color: #93c5fd; }

.alert .alert-close {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  color: currentColor;
  opacity: 0.7;
  font-size: 1rem;
  padding: 0;
  flex-shrink: 0;
}
.alert .alert-close:hover { opacity: 1; }

/* Toast notifications */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 380px;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-xl);
  animation: slideInRight 0.3s ease;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 0.875rem;
}

.toast-icon { font-size: 1.1rem; flex-shrink: 0; }
.toast-success .toast-icon { color: var(--success); }
.toast-error   .toast-icon { color: var(--danger); }
.toast-info    .toast-icon { color: var(--info); }

/* =============================================
   NAVBAR (PUBLIC)
   ============================================= */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
[data-theme="dark"] .navbar { background: rgba(15,23,42,0.95); }

.navbar-brand { display: flex; align-items: center; gap: 0.75rem; }
.navbar-brand img { height: 36px; width: auto; }
.navbar-brand-text { font-family: var(--font-heading); font-size: 1.125rem; font-weight: 700; color: var(--text); }
.navbar-brand-sub  { font-size: 0.7rem; color: var(--text-muted); display: block; line-height: 1; }

.navbar-nav { display: flex; align-items: center; gap: 0.25rem; }
.navbar-nav a {
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
}
.navbar-nav a:hover { color: var(--primary); background: var(--primary-bg); }

.navbar-actions { display: flex; align-items: center; gap: 0.5rem; }

.dark-toggle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1rem;
  transition: var(--transition);
}
.dark-toggle:hover { color: var(--primary); border-color: var(--primary); }

/* =============================================
   DASHBOARD LAYOUT
   ============================================= */
.dashboard-wrapper {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  overflow-y: auto;
  /* Layer sendiri di compositor: scroll konten tidak me-repaint sidebar */
  transform: translateZ(0);
}

.sidebar-logo {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.sidebar-logo img { height: 40px; width: auto; }
.sidebar-logo-text { font-family: var(--font-heading); font-weight: 700; color: white; font-size: 0.95rem; }
.sidebar-logo-sub  { font-size: 0.65rem; color: rgba(255,255,255,0.5); display: block; }

.sidebar-nav { flex: 1; padding: 1rem 0; }
.sidebar-section { margin-bottom: 0.25rem; }
.sidebar-section-label {
  padding: 0.5rem 1.5rem 0.25rem;
  font-size: 0.625rem;
  font-weight: 700;
  color: rgba(255,255,255,0.3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1.5rem;
  color: rgba(255,255,255,0.65);
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
  border-radius: 0;
}
.sidebar-link:hover { color: white; background: var(--bg-sidebar-hover); }
.sidebar-link.active { color: white; background: var(--primary); }
.sidebar-link i { width: 20px; text-align: center; font-size: 0.9rem; }

.sidebar-footer {
  flex-shrink: 0;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.sidebar-collapse-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.55);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: color 0.15s;
}
.sidebar-collapse-btn:hover { color: rgba(255,255,255,0.9); }
.sidebar-collapse-btn i {
  width: 20px;
  text-align: center;
  font-size: 0.875rem;
  flex-shrink: 0;
  transition: transform 0.3s;
}

.dashboard-main {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
  min-width: 0;
}

.topbar {
  height: var(--topbar-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
  /* Layer compositor sendiri: sticky repositioning tanpa repaint */
  transform: translateZ(0);
}

.topbar-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
  flex: 1;
}
.topbar-actions { display: flex; align-items: center; gap: 0.75rem; }

.topbar-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.375rem 0.625rem;
  border-radius: var(--radius);
  transition: var(--transition);
}
.topbar-user:hover { background: var(--bg); }
.topbar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  box-sizing: border-box;
}
/* Bingkai + lencana Premium menempel di foto profil (hemat ruang di HP) */
.topbar-avatar-wrap { position: relative; display: inline-flex; flex-shrink: 0; }
.topbar-avatar-wrap.is-premium .topbar-user-avatar { border: 2px solid var(--accent, #f59e0b); }
.topbar-avatar-badge {
  position: absolute; right: -3px; bottom: -3px;
  width: 15px; height: 15px; border-radius: 50%; line-height: 1;
  background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff;
  font-size: 8px; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-card);
}
.topbar-user-name {
  font-size: 0.875rem; font-weight: 500; color: var(--text);
  max-width: 100px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@media (min-width: 768px) { .topbar-user-name { max-width: 180px; } }

.page-content { padding: 1.25rem; flex: 1; }

/* Sidebar toggle — mobile only; desktop uses sidebar footer arrow */
.sidebar-toggle {
  display: flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1.25rem;
  flex-shrink: 0;
}

/* Desktop collapsed sidebar */
.sidebar-collapsed .sidebar {
  width: 64px;
  overflow: visible;
}
.sidebar-collapsed .sidebar-logo { justify-content: center; padding: 1rem 0; }
.sidebar-collapsed .sidebar-logo > div { display: none; }
.sidebar-collapsed .sidebar-logo img { width: 38px; height: 38px; object-fit: cover; object-position: left center; }
.sidebar-collapsed .sidebar-section-label { opacity: 0; height: 0; padding: 0; overflow: hidden; }
.sidebar-collapsed .sidebar-link { justify-content: center; padding: 0.7rem 0; }
.sidebar-collapsed .sidebar-link i { width: auto; font-size: 1rem; }
.sidebar-collapsed .sidebar-link .sidebar-link-text,
.sidebar-collapsed .sidebar-link .badge,
.sidebar-collapsed .sidebar-link .credit-badge { display: none; }
.sidebar-collapsed .sidebar-link { position: relative; }
.sidebar-collapsed .sidebar-link:hover::after {
  content: attr(data-label);
  position: absolute;
  left: 68px;
  top: 50%;
  transform: translateY(-50%);
  background: #1e1b4b;
  color: white;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  white-space: nowrap;
  z-index: 200;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
}
.sidebar-collapsed .sidebar-collapse-btn { justify-content: center; padding: 0.875rem 0; }
.sidebar-collapsed .sidebar-collapse-btn .sidebar-link-text { display: none; }
.sidebar-collapsed .sidebar-collapse-icon { transform: rotate(180deg); }
.sidebar-collapsed .dashboard-main { margin-left: 64px; }

/* =============================================
   STATS CARDS
   ============================================= */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.stat-icon.indigo  { background: var(--primary-bg); color: var(--primary); }
.stat-icon.green   { background: var(--success-bg); color: var(--success); }
.stat-icon.red     { background: var(--danger-bg); color: var(--danger); }
.stat-icon.amber   { background: var(--warning-bg); color: var(--warning); }
.stat-icon.blue    { background: var(--info-bg); color: var(--info); }
.stat-icon.purple  { background: #f3e8ff; color: #7e22ce; }

.stat-value { font-size: 1.5rem; font-weight: 700; font-family: var(--font-heading); color: var(--text); line-height: 1; }
.stat-label { font-size: 0.8125rem; color: var(--text-muted); margin-top: 0.25rem; }

/* =============================================
   TABLES
   ============================================= */
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; border-radius: var(--radius-lg); border: 1px solid var(--border); }
/* Pembungkus scroll tabel (otomatis via app.js) — tanpa border agar tampilan tetap */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; width: 100%; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  background: var(--bg-card);
}

.table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td {
  padding: 0.875rem 1rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--bg); }

/* Mobile: biarkan tabel selebar isinya lalu digeser horizontal di pembungkus,
   sehingga semua kolom bisa dilihat dengan swipe (bukan terpotong). */
@media (max-width: 640px) {
  .table-wrapper > .table,
  .table-responsive > .table,
  .table-responsive > table { white-space: nowrap; }
  .table-wrapper > .table td,
  .table-responsive > .table td,
  .table-responsive > table td { white-space: nowrap; }
}

/* =============================================
   PAGINATION
   ============================================= */
.pagination { display: flex; gap: 0.25rem; align-items: center; justify-content: center; margin-top: 1.5rem; flex-wrap: wrap; }
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: var(--transition);
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

/* =============================================
   MODALS
   ============================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}
.modal-overlay.open { opacity: 1; visibility: visible; }

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95);
  transition: transform 0.2s;
}
.modal-overlay.open .modal { transform: scale(1); }

.modal-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-size: 1.0625rem; font-weight: 600; }
.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1.1rem;
  padding: 0.25rem;
  border-radius: var(--radius);
  transition: var(--transition);
}
.modal-close:hover { background: var(--bg); color: var(--danger); }
.modal-body    { padding: 1.25rem; }
.modal-footer  { padding: 0.875rem 1.25rem; border-top: 1px solid var(--border); display: flex; gap: 0.75rem; justify-content: flex-end; }

/* =============================================
   HERO SECTION (PUBLIC)
   ============================================= */
.hero {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 35%, #818cf8 60%, #a78bfa 100%);
  color: white;
  padding: 5rem 0 6rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-content { position: relative; z-index: 1; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  padding: 0.375rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(255,255,255,0.25);
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.25rem); line-height: 1.2; color: white; margin-bottom: 1.25rem; }
.hero h1 span { color: #fbbf24; }
.hero p { font-size: 1.125rem; color: rgba(255,255,255,0.85); max-width: 560px; margin-bottom: 2rem; line-height: 1.7; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero-cta { background: white; color: var(--primary); font-weight: 700; }
.hero-cta:hover { background: #f8fafc; color: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0,0,0,0.2); }
.hero-secondary { background: transparent; color: white; border: 2px solid rgba(255,255,255,0.4); }
.hero-secondary:hover { background: rgba(255,255,255,0.1); color: white; }

/* =============================================
   HOME HERO (MINI)
   ============================================= */
.home-hero {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 50%, #818cf8 100%);
  padding: 5rem 0 6rem;
  position: relative;
  overflow: hidden;
}
.home-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.home-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
}
.home-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  padding: 0.375rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 600;
  color: white;
  border: 1px solid rgba(255,255,255,0.25);
  margin-bottom: 1.5rem;
}
.home-hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  color: white;
  line-height: 1.2;
  margin-bottom: 1.25rem;
}
.home-hero p {
  font-size: 1.125rem;
  color: rgba(255,255,255,0.85);
  margin-bottom: 2rem;
  line-height: 1.7;
}
.home-hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }
.home-hero .btn-ghost {
  background: rgba(255,255,255,0.12);
  color: white;
  border: 1.5px solid rgba(255,255,255,0.3);
}
.home-hero .btn-ghost:hover {
  background: rgba(255,255,255,0.22);
  color: white;
}

/* =============================================
   FEATURE CARDS (PUBLIC)
   ============================================= */
.features-section {
  padding: 5rem 0;
  background: linear-gradient(180deg, #f5f3ff 0%, var(--bg) 200px);
}
[data-theme="dark"] .features-section {
  background: linear-gradient(180deg, #1e1b4b 0%, var(--bg) 250px);
}
.section-title { font-size: clamp(1.5rem, 4vw, 2rem); text-align: center; margin-bottom: 0.75rem; }
.section-subtitle { text-align: center; color: var(--text-muted); max-width: 520px; margin: 0 auto 3rem; font-size: 1rem; }

.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.feature-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.feature-card.indigo::before  { background: var(--primary); }
.feature-card.blue::before    { background: var(--info); }
.feature-card.purple::before  { background: #8b5cf6; }
.feature-card.green::before   { background: var(--success); }
.feature-card.amber::before   { background: var(--accent); }

.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-xl); border-color: var(--primary); }
.feature-card.coming-soon { opacity: 0.7; }
.feature-card.coming-soon:hover { transform: none; }

.feature-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
}
.feature-icon.indigo { background: var(--primary-bg); color: var(--primary); }
.feature-icon.blue   { background: var(--info-bg); color: var(--info); }
.feature-icon.purple { background: #f3e8ff; color: #7e22ce; }
.feature-icon.green  { background: var(--success-bg); color: var(--success); }
.feature-icon.amber  { background: var(--warning-bg); color: var(--accent-dark); }

.feature-card h3 { font-size: 1.0625rem; margin-bottom: 0.5rem; }
.feature-card p  { font-size: 0.875rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 0; flex: 1; }

.feature-status {
  position: absolute;
  top: 1rem; right: 1rem;
}

/* =============================================
   CV BUILDER FORM
   ============================================= */
.cv-steps {
  display: flex;
  gap: 0;
  margin-bottom: 2rem;
  overflow-x: auto;
  padding-bottom: 0.375rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.cv-steps::-webkit-scrollbar { height: 3px; }
.cv-steps::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.cv-steps::-webkit-scrollbar-track { background: transparent; }

.cv-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
}
.cv-step.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.cv-step.done   { color: var(--success); }
.cv-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}
.cv-step.active .cv-step-num { background: var(--primary); border-color: var(--primary); color: white; }
.cv-step.done .cv-step-num   { background: var(--success); border-color: var(--success); color: white; }

/* Repeating sections */
.repeating-section { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 1rem; }
.repeating-item { padding: 1rem; border-bottom: 1px dashed var(--border); }
.repeating-item:last-child { border-bottom: none; }
.repeating-item[draggable].dragging { opacity: 0.4; border: 2px dashed var(--primary); border-radius: var(--radius); }
.repeating-item-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; cursor: pointer; user-select: none; }
.repeating-item.collapsed .repeating-item-header { margin-bottom: 0; }
.repeating-item.collapsed .repeating-grid { display: none; }
.ri-toggle { transition: transform .2s; color: var(--text-muted); }
.repeating-item.collapsed .ri-toggle { transform: rotate(180deg); }
.ri-summary { color: var(--text-muted); font-size: 0.8125rem; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.repeating-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.drag-handle { cursor: grab; color: var(--text-muted); padding: 2px 4px; opacity: 0.5; transition: opacity 0.15s; }
.drag-handle:hover { opacity: 1; color: var(--primary); }
.drag-handle:active { cursor: grabbing; }

/* =============================================
   CV PREVIEW / PRINT
   ============================================= */
.cv-preview-wrapper {
  background: white;
  box-shadow: var(--shadow-xl);
  border-radius: var(--radius-lg);
  overflow: hidden;
  max-width: 794px;
  margin: 0 auto;
}

/* =============================================
   EMPTY STATE
   ============================================= */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}
.empty-state-icon {
  font-size: 3rem;
  color: var(--text-light);
  margin-bottom: 1rem;
}
.empty-state h3 { font-size: 1rem; color: var(--text-muted); font-weight: 500; margin-bottom: 0.5rem; }
.empty-state p  { font-size: 0.875rem; max-width: 280px; margin: 0 auto 1.25rem; }

/* =============================================
   PROGRESS BAR
   ============================================= */
.progress { height: 6px; background: var(--bg); border-radius: var(--radius-full); overflow: hidden; }
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
}

/* =============================================
   AVATAR
   ============================================= */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.avatar-sm  { width: 32px;  height: 32px; }
.avatar-md  { width: 48px;  height: 48px; }
.avatar-lg  { width: 80px;  height: 80px; }
.avatar-xl  { width: 120px; height: 120px; }

/* =============================================
   DROPDOWN
   ============================================= */
.dropdown { position: relative; }
/* Elevate the card containing an open dropdown above sibling grid cards */
._dd-elevated { position: relative; z-index: 50; }
.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  min-width: 180px;
  z-index: 100;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}
.dropdown.open .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  color: var(--text);
  transition: var(--transition);
}
.dropdown-item:hover { background: var(--bg); color: var(--primary); }
.dropdown-item.danger:hover { color: var(--danger); }
.dropdown-divider { height: 1px; background: var(--border); margin: 0.25rem 0; }
/* Reset form wrapper inside dropdown — prevents white box in dark mode */
.dropdown-menu form { margin: 0; padding: 0; background: transparent; border: none; display: block; }
.dropdown-menu button.dropdown-item { width: 100%; text-align: left; background: none; border: none; cursor: pointer; font-family: inherit; font-size: 0.875rem; }

/* =============================================
   CREDIT BADGE
   ============================================= */
.credit-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 600;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #1c1917;
}

/* =============================================
   FOOTER
   ============================================= */
.footer {
  background: var(--bg-card); /* Putih */
  color: var(--text);
  border-top: 1px solid var(--border);
  padding: 4rem 0 0 0;
  position: relative;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 3rem;
  margin-bottom: 3.5rem;
  position: relative;
  z-index: 2;
}
.footer-brand img { height: 40px; margin-bottom: 1.25rem; }
.footer-desc { font-size: 0.9375rem; color: var(--text-muted); line-height: 1.75; max-width: 320px; }
.footer-title { font-size: 0.9375rem; font-weight: 700; color: var(--text); margin-bottom: 1.25rem; letter-spacing: 0.05em; }
.footer-links a { display: block; font-size: 0.9375rem; color: var(--text-muted); padding: 0.4rem 0; transition: color 0.2s ease, transform 0.2s ease; }
.footer-links a:hover { color: var(--primary); transform: translateX(4px); }
.footer-bottom {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark, #4338ca));
  padding: 1.5rem 0;
  font-size: 0.875rem;
  color: rgba(255,255,255,0.9);
  margin-top: auto;
}
.footer-bottom a { color: white; }


/* =============================================
   AUTH PAGES
   ============================================= */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: linear-gradient(135deg, #f0f4ff 0%, #f8fafc 50%, #fef9ef 100%);
}
[data-theme="dark"] .auth-wrapper { background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%); }

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: 2.5rem;
}
.auth-logo { text-align: center; margin-bottom: 2rem; }
.auth-logo img { height: 48px; }
.auth-title { font-size: 1.5rem; font-weight: 700; text-align: center; margin-bottom: 0.5rem; }
.auth-subtitle { text-align: center; color: var(--text-muted); font-size: 0.9rem; margin-bottom: 2rem; }

.divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.25rem 0;
  color: var(--text-muted);
  font-size: 0.8125rem;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.625rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}
.google-btn:hover { border-color: var(--primary); background: var(--primary-bg); color: var(--primary); }
.google-btn img { width: 18px; }

/* =============================================
   SCROLLBAR
   ============================================= */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-light); }

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

.animate-fade-in   { animation: fadeIn 0.3s ease; }
.animate-slide-up  { animation: slideUp 0.4s ease; }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 1024px) {
  /* Sidebar goes to mobile mode */
  .sidebar { transform: translateX(-100%); width: var(--sidebar-width) !important; }
  .sidebar.open { transform: translateX(0); }
  .dashboard-main { margin-left: 0 !important; overflow-x: visible; }
  .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 49; }
  .sidebar-overlay.open { display: block; }
  /* Cancel desktop collapse on mobile */
  .sidebar-collapsed .sidebar { width: var(--sidebar-width) !important; }
  .sidebar-collapsed .sidebar-logo { justify-content: flex-start; padding: 1.25rem 1.5rem; }
  .sidebar-collapsed .sidebar-logo > div { display: block; }
  .sidebar-collapsed .sidebar-section-label { opacity: 1; height: auto; padding: 0.5rem 1.5rem 0.25rem; }
  .sidebar-collapsed .sidebar-link { justify-content: flex-start; padding: 0.625rem 1.5rem; }
  .sidebar-collapsed .sidebar-link .sidebar-link-text,
  .sidebar-collapsed .sidebar-link .badge,
  .sidebar-collapsed .sidebar-link .credit-badge { display: inline-flex; }
  .sidebar-collapsed .sidebar-link:hover::after { display: none; }
  .sidebar-collapsed .sidebar-collapse-btn { justify-content: flex-start; padding: 0.875rem 1.5rem; }
  .sidebar-collapsed .sidebar-collapse-btn .sidebar-link-text { display: inline; }
  .sidebar-collapsed .sidebar-collapse-icon { transform: none; }
  .sidebar-toggle { display: flex; }
}

/* Tablet step: jangan langsung 4 kolom sempit → 2 kolom dulu */
@media (max-width: 1024px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

/* Touch target minimal di tablet & hp (WCAG ~44px) */
@media (max-width: 1024px) {
  .btn { min-height: 40px; }
  .btn-primary, .btn-danger, .btn-success { min-height: 44px; }
  .exam-modtab { padding: 0.5rem 0.7rem; }
  .to-filterbar { gap: 0.5rem; }
  .to-filterbar a { padding: 0.5rem 0.9rem; }
}

/* Hamburger button */
.navbar-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius);
  order: 3;
}
.navbar-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}
.navbar-hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.navbar-hamburger.is-open span:nth-child(2) { opacity: 0; }
.navbar-hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav drawer */
.nav-mobile-menu {
  display: none;
  position: fixed;
  top: 64px;
  left: 0; right: 0;
  z-index: 120;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.22s ease, opacity 0.22s ease;
  max-height: calc(100vh - 64px);
  overflow-y: auto;
}
.nav-mobile-menu.is-open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.nav-mobile-inner { padding: 0.5rem 0 1rem; }
.nav-mobile-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  font-size: 0.95rem;
  color: var(--text);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.nav-mobile-link:hover { background: var(--primary-bg); color: var(--primary); }
.nav-mobile-link.danger { color: var(--danger); }
.nav-mobile-link.danger:hover { background: rgba(239,68,68,.08); }
.nav-mobile-link.nav-mobile-cta {
  margin: 0.5rem 1rem 0;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  justify-content: center;
  font-weight: 600;
  padding: 0.75rem 1rem;
}
.nav-mobile-link.nav-mobile-cta:hover { background: var(--primary-dark); color: #fff; }
.nav-mobile-divider { height: 1px; background: var(--border); margin: 0.5rem 0; }
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 119;
  background: rgba(0,0,0,0.35);
}
.nav-overlay.is-open { display: block; }

@media (max-width: 768px) {
  .navbar-hamburger { display: flex; }
  .nav-mobile-menu { display: block; }
  .navbar-nav { display: none; }
  .navbar-actions { margin-left: auto; }
  .navbar-actions .btn { display: none; }
  .navbar-actions .btn-navbar-login { display: inline-flex; }
  .features-grid { grid-template-columns: 1fr; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer-desc { max-width: 100%; }
  .hero { padding: 3rem 0 4rem; }
  .hero-actions { flex-direction: column; }
  .repeating-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .auth-card { padding: 1.25rem; }
  .page-content { padding: 0.875rem; }
  .card-body { padding: 1rem; }
  .card-header, .card-footer { padding: 0.75rem 1rem; }
  .topbar-title { font-size: 0.875rem; max-width: 160px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: .6rem; }
  .stat-card { padding: .75rem; gap: .5rem; }
  .stat-value { font-size: 1.4rem; }
  .page-content { padding: 0.75rem; }
  .card { border-radius: 8px; }
  .card-body { padding: 0.875rem; }
  .repeating-grid { grid-template-columns: 1fr !important; }
}

/* =============================================
   BOTTOM NAVIGATION (mobile/tablet)
   Navigasi cepat di bawah layar, muncul saat
   sidebar berubah jadi drawer (<=1024px).
   ============================================= */
.bottom-nav { display: none; }

@media (max-width: 1024px) {
  .bottom-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 45;                                       /* di bawah overlay sidebar (49) */
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
    padding-bottom: env(safe-area-inset-bottom, 0px);  /* aman utk notch iOS */
  }
  .bottom-nav-item {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 0.4rem 0.25rem 0.45rem;
    background: none;
    border: 0;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.6rem;
    font-weight: 600;
    line-height: 1.1;
    transition: color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
  }
  .bottom-nav-item i { font-size: 1.1rem; line-height: 1; }
  .bottom-nav-item span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .bottom-nav-item.active { color: var(--primary); }
  .bottom-nav-item:active { background: var(--bg); }

  /* Sisakan ruang agar konten terakhir tidak tertutup bar */
  .dashboard-main { padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px)); }
}

/* ── Bottom-sheet submenu (Try Out & eLearn) ── */
.bn-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 46;                       /* di atas bottom-nav (45), di bawah sidebar */
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.bn-sheet-backdrop.open { opacity: 1; visibility: visible; }

.bn-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 47;
  background: var(--bg-card);
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.18);
  padding: 0.4rem 0.75rem calc(0.6rem + env(safe-area-inset-bottom, 0px));
  max-height: 80vh;
  overflow-y: auto;
  transform: translateY(100%);
  visibility: hidden;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.25s;
}
.bn-sheet.open { transform: translateY(0); visibility: visible; }
.bn-sheet-grip {
  width: 38px;
  height: 4px;
  border-radius: 99px;
  background: var(--border);
  margin: 0.4rem auto 0.5rem;
}
.bn-sheet-head {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 0 0.5rem 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.bn-sheet-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 0.6rem;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}
.bn-sheet-link > i:first-child { width: 22px; text-align: center; color: var(--text-muted); font-size: 0.95rem; }
.bn-sheet-link span { flex: 1; min-width: 0; }
.bn-sheet-link:active { background: var(--bg); }
.bn-sheet-link.active { background: var(--primary-bg); color: var(--primary); }
.bn-sheet-link.active > i:first-child { color: var(--primary); }
.bn-sheet-check { color: var(--primary); font-size: 0.8rem; }

body.bn-sheet-lock { overflow: hidden; }

/* =============================================
   TRY OUT CPNS MODULE
   ============================================= */

/* ── Hero / dashboard ── */
.to-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff; border-radius: var(--radius-xl); padding: 1.75rem; margin-bottom: 1.5rem;
  position: relative; overflow: hidden;
}
.to-hero h1 { color: #fff; font-size: 1.5rem; }
.to-hero p { color: rgba(255,255,255,.85); }
.to-hero .to-hero-icon { position: absolute; right: -10px; bottom: -20px; font-size: 8rem; opacity: .12; }

.to-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 1rem; }
.to-quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 0.875rem; }
.to-quick {
  display: flex; flex-direction: column; gap: .5rem; padding: 1.1rem; border-radius: var(--radius-lg);
  background: var(--bg-card); border: 1px solid var(--border); transition: var(--transition); text-align: left;
}
.to-quick:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--primary); }
.to-quick i { font-size: 1.4rem; color: var(--primary); }
.to-quick .t { font-weight: 600; font-size: .9375rem; color: var(--text); }
.to-quick .s { font-size: .75rem; color: var(--text-muted); }

/* ── Module / category cards ── */
.to-module-card {
  border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.1rem; background: var(--bg-card);
  transition: var(--transition); display: flex; flex-direction: column; gap: .6rem;
}
.to-module-card:hover { box-shadow: var(--shadow-md); border-color: var(--primary-light); }
.to-chip {
  display: inline-flex; align-items: center; gap: .3rem; font-size: .7rem; font-weight: 600;
  padding: .15rem .5rem; border-radius: var(--radius-full); background: var(--primary-bg); color: var(--primary);
}

/* ── Progress bar ── */
.to-progress { height: 8px; background: var(--border); border-radius: var(--radius-full); overflow: hidden; }
.to-progress > span { display: block; height: 100%; background: var(--primary); border-radius: var(--radius-full); transition: width .4s ease; }
.to-progress.ok > span { background: var(--success); }
.to-progress.warn > span { background: var(--warning); }
.to-progress.danger > span { background: var(--danger); }

/* Anak grid 2-kolom boleh menyusut: tabel/konten lebar di dalamnya akan
   scroll sendiri, bukan melebarkan halaman (cegah terpotong di HP). */
.to-detail-grid > * { min-width: 0; }

/* ── Module score row ── */
.to-modrow { display: grid; grid-template-columns: 130px 1fr 86px; align-items: center; gap: .75rem; padding: .5rem 0; }
.to-modrow + .to-modrow { border-top: 1px solid var(--border); }
@media (max-width: 560px){ .to-modrow { grid-template-columns: 1fr; gap: .25rem; } }

/* ── Responsif mobile: hero, statistik & pintasan dashboard tryout ── */
@media (max-width: 640px) {
  .to-hero { padding: 1.25rem; }
  .to-hero h1 { font-size: 1.2rem; }
  .to-hero p { font-size: .85rem; }
  .to-hero .to-hero-icon { font-size: 5.5rem; right: -8px; bottom: -14px; }
  .to-stat-grid { grid-template-columns: 1fr 1fr; gap: .6rem; }
  .to-quick-grid { grid-template-columns: 1fr 1fr; gap: .6rem; }
  .to-stat-grid .stat-card { padding: .8rem; gap: .55rem; }
  .to-stat-grid .stat-value { font-size: 1.25rem; }
  .to-stat-grid .stat-icon { width: 34px; height: 34px; font-size: 1rem; }
  .to-quick { padding: .85rem; }
  .to-quick i { font-size: 1.3rem; }
  .to-quick .t { font-size: .875rem; }
}

/* =============================================
   EXAM (CAT) INTERFACE
   ============================================= */
.exam-body { background: var(--bg); }
.exam-wrap { min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden; }

.exam-header {
  position: sticky; top: 0; z-index: 100; background: var(--bg-card); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 1.25rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10); transform: translateZ(0);
}
.exam-header .meta { min-width: 0; }
.exam-header .meta .t { font-weight: 700; font-family: var(--font-heading); font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exam-header .meta .s { font-size: .75rem; color: var(--text-muted); display: flex; align-items: center; gap: .4rem; min-width: 0; }
.exam-modline { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }   /* nama modul memotong, tak melebar ke banyak baris */
.exam-header-ctrl { display: flex; align-items: center; gap: .75rem; flex-shrink: 0; }
.exam-user { font-size: .75rem; font-weight: 600; color: var(--text-muted); white-space: nowrap; display: inline-flex; align-items: center; gap: .35rem; }

.exam-timer {
  display: flex; align-items: center; gap: .5rem; font-family: var(--font-heading); font-weight: 700;
  font-size: 1rem; padding: .35rem .7rem; border-radius: var(--radius-lg); background: var(--primary-bg); color: var(--primary);
  white-space: nowrap;
}
.exam-timer.warn { background: var(--warning-bg); color: var(--accent-dark); animation: pulse 1.4s infinite; }
.exam-timer.danger { background: var(--danger-bg); color: var(--danger); animation: pulse 1s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.55} }

.exam-save-status { font-size: .75rem; color: var(--text-muted); display: inline-flex; align-items: center; gap: .35rem; flex-shrink: 0; }
.exam-save-status.saving { color: var(--info); }
.exam-save-status.saved { color: var(--success); }
.exam-save-status.failed { color: var(--danger); }

/* Header ujian — rapikan di mobile */
@media (max-width: 640px) {
  .exam-header { gap: .5rem; padding: .5rem .75rem; }
  .exam-header .meta .t { font-size: .85rem; }
  .exam-header .meta .s { font-size: .68rem; }
  .exam-user { display: none; }
  .exam-timer { font-size: .9rem; padding: .3rem .55rem; }
}

.exam-main { flex: 1; display: grid; grid-template-columns: 1fr minmax(0, 300px); gap: 1.25rem; padding: 1.25rem; max-width: 1200px; margin: 0 auto; width: 100%; box-sizing: border-box; }
@media (max-width: 900px){ .exam-main { grid-template-columns: 1fr; padding: .75rem; } }

.exam-qcard { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.4rem; box-shadow: var(--shadow); min-width: 0; overflow-x: hidden; }
.exam-qnum { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; border-radius: var(--radius); background: var(--primary); color: #fff; font-weight: 700; font-family: var(--font-heading); }
.exam-qtext { font-size: 1.02rem; line-height: 1.7; margin: 1rem 0 1.25rem; }
.exam-qimg { max-width: 100%; border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: 1rem; }

.exam-opt {
  display: flex; align-items: flex-start; gap: .75rem; padding: .85rem 1rem; border: 1.5px solid var(--border);
  border-radius: var(--radius-lg); cursor: pointer; transition: var(--transition); margin-bottom: .65rem; background: var(--bg-card);
}
.exam-opt:hover { border-color: var(--primary-light); background: var(--bg); }
.exam-opt.selected { border-color: var(--primary); background: var(--primary-bg); }
.exam-opt input { margin-top: .2rem; }
.exam-opt .key { font-weight: 700; color: var(--primary); flex-shrink: 0; }
.exam-opt .txt { flex: 1; }

.exam-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }

/* navigator */
.exam-side { display: flex; flex-direction: column; gap: 1rem; }
.exam-nav-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1rem; box-shadow: var(--shadow); position: sticky; top: 76px; }
.exam-nav-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: .4rem; margin-top: .75rem; max-height: 280px; overflow-y: auto; }
.exam-nav-btn {
  aspect-ratio: 1; border: 1.5px solid var(--border); border-radius: var(--radius); background: var(--bg-card);
  font-size: .8rem; font-weight: 600; cursor: pointer; color: var(--text-muted); transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.exam-nav-btn:hover { border-color: var(--primary); }
.exam-nav-btn.answered { background: var(--success); color: #fff; border-color: var(--success); }
.exam-nav-btn.flagged { background: var(--warning); color: #fff; border-color: var(--warning); }
.exam-nav-btn.flagged.answered { background: var(--warning); }
.exam-nav-btn.current { outline: 3px solid var(--primary-light); outline-offset: 1px; border-color: var(--primary); }

.exam-legend { display: flex; flex-wrap: wrap; gap: .75rem; font-size: .72rem; color: var(--text-muted); margin-top: .85rem; }
.exam-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.exam-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

.exam-modtabs { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .25rem; }
.exam-modtab { font-size: .73rem; font-weight: 600; padding: .25rem .6rem; border-radius: var(--radius-full); background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }
.exam-modtab.active { background: var(--primary-bg); color: var(--primary); border-color: var(--primary-light); }

/* submit resume modal table */
.to-resume { width: 100%; border-collapse: collapse; margin: .75rem 0; }
.to-resume td { padding: .45rem .6rem; border-bottom: 1px solid var(--border); font-size: .875rem; }
.to-resume td:last-child { text-align: right; font-weight: 700; }

/* =============================================
   PEMBAHASAN / RESULT
   ============================================= */
.to-disc-q { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.1rem; margin-bottom: 1rem; background: var(--bg-card); }
.to-disc-opt { display: flex; gap: .6rem; padding: .55rem .8rem; border-radius: var(--radius); margin-bottom: .4rem; border: 1px solid transparent; }
.to-disc-opt.correct { background: var(--success-bg); border-color: var(--success); }
.to-disc-opt.chosen-wrong { background: var(--danger-bg); border-color: var(--danger); }
.to-disc-opt .key { font-weight: 700; }
.to-disc-expl { margin-top: .75rem; padding: .8rem; background: var(--info-bg); border-radius: var(--radius); font-size: .875rem; }
.to-result-big { font-size: 2.5rem; font-weight: 800; font-family: var(--font-heading); line-height: 1; }

.to-passpill { display:inline-flex;align-items:center;gap:.4rem;padding:.35rem .9rem;border-radius:var(--radius-full);font-weight:700;font-size:.85rem; }
.to-passpill.pass { background: var(--success-bg); color: #065f46; }
.to-passpill.fail { background: var(--danger-bg); color: #991b1b; }
.to-passpill.pending { background: var(--warning-bg); color: #92400e; }

/* simple bar chart */
.to-chart { display: flex; align-items: flex-end; gap: .5rem; height: 160px; padding-top: 1rem; }
.to-chart .bar { flex: 1; background: var(--primary); border-radius: 4px 4px 0 0; min-height: 4px; position: relative; transition: height .4s; }
.to-chart .bar span { position: absolute; top: -1.1rem; left: 0; right: 0; text-align: center; font-size: .7rem; font-weight: 600; }
.to-chart .bar small { position: absolute; bottom: -1.3rem; left: 0; right: 0; text-align: center; font-size: .65rem; color: var(--text-muted); }

/* segmented filter */
.to-filterbar { display: flex; flex-wrap: wrap; gap: .4rem; }
.to-filterbar a { font-size: .8rem; padding: .35rem .8rem; border-radius: var(--radius-full); border: 1px solid var(--border); color: var(--text-muted); }
.to-filterbar a.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* =============================================
   SIDEBAR SUBMENU (Try Out CPNS, dll.)
   ============================================= */
.sidebar-submenu {
  display: flex;
  flex-direction: column;
  margin: 0.15rem 0 0.4rem 2.35rem;
  padding-left: 0.6rem;
  border-left: 2px solid rgba(255,255,255,0.12);
  gap: 1px;
}
.sidebar-sublink {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.75rem;
  color: rgba(255,255,255,0.55);
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: var(--radius);
  transition: var(--transition);
}
.sidebar-sublink:hover { color: #fff; background: var(--bg-sidebar-hover); }
.sidebar-sublink.active { color: #fff; background: rgba(99,102,241,0.22); }
.sidebar-sublink.active i { color: var(--primary-light); }
.sidebar-sublink i { width: 16px; text-align: center; font-size: 0.78rem; }

/* Sembunyikan submenu saat sidebar diciutkan (desktop) */
.sidebar-collapsed .sidebar-submenu { display: none; }

@media (max-width: 1024px) {
  /* Mobile membatalkan collapse → submenu tampil lagi */
  .sidebar-collapsed .sidebar-submenu { display: flex; }
}

/* =============================================
   RICH CONTENT (soal/pembahasan dari editor)
   ============================================= */
.rich-content table, .exam-qtext table, .to-disc-q table, .to-disc-expl table {
  border-collapse: collapse; margin: .5rem 0; max-width: 100%;
}
.rich-content th, .rich-content td,
.exam-qtext th, .exam-qtext td,
.to-disc-q th, .to-disc-q td,
.to-disc-expl th, .to-disc-expl td {
  border: 1px solid var(--border); padding: .4rem .6rem; text-align: left;
}
.rich-content img, .exam-qtext img, .to-disc-q img, .to-disc-expl img {
  max-width: 100%; height: auto; border-radius: 4px;
}
/* Pulihkan bullet/number list (di-reset global ul,ol{list-style:none}) */
.rich-content ul, .exam-qtext ul, .to-disc-q ul, .to-disc-expl ul { list-style: disc; padding-left: 1.5rem; margin: .4rem 0; }
.rich-content ol, .exam-qtext ol, .to-disc-q ol, .to-disc-expl ol { list-style: decimal; padding-left: 1.5rem; margin: .4rem 0; }
.rich-content p, .exam-qtext p { margin: 0 0 .5rem; }
.rich-content p:last-child, .exam-qtext p:last-child { margin-bottom: 0; }

/* =============================================
   COOKIE CONSENT (AdSense / privasi)
   ============================================= */
.cookie-consent {
  position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 1000;
  max-width: 880px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-xl); padding: 0.9rem 1.1rem;
}
.cookie-consent-text { font-size: 0.85rem; color: var(--text-muted); flex: 1; min-width: 220px; }
.cookie-consent-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }
@media (max-width: 560px) { .cookie-consent { flex-direction: column; align-items: stretch; text-align: center; } .cookie-consent-actions { justify-content: center; } }

/* =============================================
   ACCESSIBILITY — fokus keyboard yang jelas (WCAG 2.2)
   ============================================= */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, [tabindex]:focus-visible, .sidebar-link:focus-visible,
.exam-nav-btn:focus-visible, .exam-opt:focus-within {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}
.exam-opt:focus-within { outline-offset: 0; }
/* Skip-to-content untuk pengguna keyboard/screen reader */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 2000;
  background: var(--primary); color: #fff; padding: .6rem 1rem; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; color: #fff; }
