/* ============================================================
   REMBAK REMAJA SASAK — Stylesheet
   Palet: Hijau (#16a34a) · Putih · Abu muda (#f4f6f8)
   ============================================================ */

:root {
  --green-50:  #ecfdf5;
  --green-100: #d1fae5;
  --green-500: #16a34a;
  --green-600: #15803d;
  --green-700: #166534;

  --bg:        #f4f6f8;
  --surface:   #ffffff;
  --border:    #e5e7eb;
  --text:      #1f2937;
  --muted:     #6b7280;

  --sidebar-w: 268px;
  --radius:    16px;
  --shadow:    0 1px 3px rgba(16,24,40,.06), 0 8px 24px rgba(16,24,40,.06);
  --shadow-lg: 0 12px 32px rgba(22,163,74,.18);
}

/* ---------- DARK MODE ---------- */
body.dark {
  --bg:      #0f1720;
  --surface: #172130;
  --border:  #263445;
  --text:    #e6edf5;
  --muted:   #94a3b8;
  --green-50:  #14261d;
  --green-100: #17372a;
  --shadow: 0 1px 3px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.3);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background .25s, color .25s;
}

a { text-decoration: none; }

/* ============================================================
   AUTH PAGES
   ============================================================ */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.auth-hero {
  background: linear-gradient(140deg, var(--green-700), var(--green-500));
  color: #fff;
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.auth-hero::after {
  content: '';
  position: absolute;
  width: 460px; height: 460px;
  border-radius: 50%;
  background: rgba(255,255,255,.07);
  right: -140px; bottom: -160px;
}
.auth-hero h1 { font-weight: 800; font-size: 2.4rem; line-height: 1.2; }
.auth-hero .val-list li {
  margin-bottom: 12px;
  list-style: none;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.auth-hero .val-list { padding: 0; }

.auth-form {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: var(--surface);
  overflow-y: auto;
}
.auth-card { width: 100%; max-width: 460px; }

@media (max-width: 900px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transition: transform .3s ease;
}

.sidebar-brand {
  padding: 22px 20px;
  display: flex;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--border);
}
.brand-logo {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--green-500), var(--green-700));
  color: #fff;
  font-size: 1.15rem;
  flex: none;
}
.brand-text strong { display: block; font-size: .95rem; line-height: 1.2; }
.brand-text small  { color: var(--muted); font-size: .72rem; }

.sidebar-nav {
  padding: 14px 12px 24px;
  overflow-y: auto;
  flex: 1;
}
.nav-label {
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 14px 12px 8px;
  font-weight: 700;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border-radius: 11px;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 600;
  margin-bottom: 3px;
  transition: all .18s;
}
.nav-item i { width: 20px; text-align: center; font-size: .95rem; }
.nav-item:hover {
  background: var(--green-50);
  color: var(--green-600);
  transform: translateX(3px);
}
.nav-item.active {
  background: linear-gradient(135deg, var(--green-500), var(--green-600));
  color: #fff;
  box-shadow: var(--shadow-lg);
}
.nav-item .badge-count {
  margin-left: auto;
  background: #ef4444;
  color: #fff;
  font-size: .65rem;
  padding: 2px 7px;
  border-radius: 20px;
}

/* ---------- MAIN ---------- */
.main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  transition: margin .3s;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 14px 26px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.topbar h5 { margin: 0; font-weight: 800; font-size: 1.05rem; }
.breadcrumb { margin: 0; font-size: .78rem; --bs-breadcrumb-divider-color: var(--muted); }
.breadcrumb a { color: var(--green-600); }
.breadcrumb-item.active { color: var(--muted); }

.icon-btn {
  width: 40px; height: 40px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  display: grid;
  place-items: center;
  position: relative;
  transition: .18s;
}
.icon-btn:hover { color: var(--green-600); border-color: var(--green-500); }
.icon-btn .dot {
  position: absolute;
  top: 7px; right: 8px;
  width: 8px; height: 8px;
  background: #ef4444;
  border-radius: 50%;
}

.avatar-sm {
  width: 38px; height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--green-100);
}

.content { padding: 26px; }

/* Mobile sidebar */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,32,.5);
  z-index: 1035;
}
@media (max-width: 991px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); }
  .main { margin-left: 0; }
  .sidebar-backdrop.show { display: block; }
  .content { padding: 18px 14px; }
}

/* ============================================================
   CARDS & COMPONENTS
   ============================================================ */
.card-soft {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .22s, box-shadow .22s;
}
.card-soft:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.stat-card { padding: 20px; }
.stat-card .stat-icon {
  width: 50px; height: 50px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  margin-bottom: 14px;
}
.stat-card h3 { font-weight: 800; margin: 0; font-size: 1.85rem; }
.stat-card p  { color: var(--muted); margin: 0; font-size: .82rem; font-weight: 600; }

.bg-soft-green  { background: var(--green-50);  color: var(--green-600); }
.bg-soft-blue   { background: #e0f2fe; color: #0284c7; }
.bg-soft-orange { background: #ffedd5; color: #ea580c; }
.bg-soft-purple { background: #ede9fe; color: #7c3aed; }
.bg-soft-red    { background: #fee2e2; color: #dc2626; }

/* Menu grid (dashboard remaja) */
.menu-tile {
  display: block;
  padding: 22px 16px;
  text-align: center;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  transition: .22s;
  height: 100%;
}
.menu-tile:hover {
  border-color: var(--green-500);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  color: var(--green-600);
}
.menu-tile i { font-size: 1.6rem; margin-bottom: 10px; color: var(--green-500); display: block; }
.menu-tile span { font-size: .84rem; font-weight: 700; }

/* Mood picker */
.mood-opt {
  border: 2px solid var(--border);
  background: var(--surface);
  border-radius: 14px;
  padding: 14px 8px;
  width: 100%;
  cursor: pointer;
  transition: .2s;
  color: var(--text);
}
.mood-opt .emo { font-size: 2rem; display: block; line-height: 1.2; }
.mood-opt small { font-size: .72rem; font-weight: 700; color: var(--muted); }
.mood-opt:hover { transform: translateY(-4px) scale(1.03); border-color: var(--green-500); }
.mood-opt.selected {
  border-color: var(--green-500);
  background: var(--green-50);
  box-shadow: var(--shadow-lg);
}
.mood-opt.selected small { color: var(--green-600); }

/* Challenge */
.challenge-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  margin-bottom: 12px;
  transition: .2s;
}
.challenge-item:hover { border-color: var(--green-500); transform: translateX(4px); }
.challenge-item.done { background: var(--green-50); border-color: var(--green-500); }
.challenge-item.done .ch-title { text-decoration: line-through; color: var(--muted); }
.ch-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: var(--green-50);
  color: var(--green-600);
  flex: none;
}

/* Badge */
.badge-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 30px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  margin: 0 6px 8px 0;
}
.badge-chip.locked {
  background: var(--bg);
  color: var(--muted);
  border: 1px dashed var(--border);
}

/* Chat */
.chat-box {
  height: 380px;
  overflow-y: auto;
  padding: 16px;
  background: var(--bg);
  border-radius: 14px;
}
.bubble {
  max-width: 74%;
  padding: 10px 14px;
  border-radius: 14px;
  margin-bottom: 10px;
  font-size: .88rem;
  background: var(--surface);
  border: 1px solid var(--border);
}
.bubble .who { font-size: .68rem; font-weight: 800; color: var(--green-600); display: block; }
.bubble .time { font-size: .64rem; color: var(--muted); }
.bubble.me {
  margin-left: auto;
  background: var(--green-500);
  color: #fff;
  border-color: transparent;
}
.bubble.me .who, .bubble.me .time { color: rgba(255,255,255,.85); }

/* Test / quiz */
.q-card { padding: 22px; margin-bottom: 16px; }
.q-num {
  display: inline-grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 9px;
  background: var(--green-500);
  color: #fff;
  font-size: .8rem;
  font-weight: 800;
  margin-right: 10px;
}
.opt-label {
  display: block;
  padding: 12px 15px;
  border: 2px solid var(--border);
  border-radius: 11px;
  margin-bottom: 9px;
  cursor: pointer;
  font-size: .9rem;
  transition: .16s;
}
.opt-label:hover { border-color: var(--green-500); background: var(--green-50); }
.opt-label input { display: none; }
.opt-label.picked {
  border-color: var(--green-500);
  background: var(--green-50);
  font-weight: 700;
  color: var(--green-700);
}

/* Article */
.article-card img, .article-thumb {
  height: 150px;
  width: 100%;
  object-fit: cover;
  background: linear-gradient(135deg, var(--green-500), var(--green-700));
  border-radius: var(--radius) var(--radius) 0 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 2rem;
}

/* Calendar */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-cell {
  aspect-ratio: 1;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: .82rem;
  font-weight: 600;
  border: 1px solid transparent;
  position: relative;
}
.cal-cell.day { background: var(--bg); }
.cal-cell.today { background: var(--green-500); color: #fff; }
.cal-cell.has-event { border-color: var(--green-500); }
.cal-cell.has-event::after {
  content: '';
  position: absolute;
  bottom: 6px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--green-500);
}
.cal-cell.today.has-event::after { background: #fff; }
.cal-head { font-size: .7rem; color: var(--muted); font-weight: 800; text-align: center; padding: 6px 0; }

/* Tables */
.table-soft { margin: 0; color: var(--text); }
.table-soft thead th {
  background: var(--bg);
  color: var(--muted);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  border: 0;
  padding: 13px 16px;
  font-weight: 800;
}
.table-soft tbody td {
  padding: 13px 16px;
  vertical-align: middle;
  border-color: var(--border);
  font-size: .88rem;
}
.table-soft tbody tr:hover { background: var(--green-50); }

/* Forms */
.form-control, .form-select {
  border-radius: 11px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: .9rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--green-500);
  box-shadow: 0 0 0 4px var(--green-50);
  background: var(--surface);
  color: var(--text);
}
.form-label { font-weight: 700; font-size: .82rem; margin-bottom: 6px; }

.btn-green {
  background: linear-gradient(135deg, var(--green-500), var(--green-600));
  color: #fff;
  border: 0;
  border-radius: 11px;
  padding: 11px 22px;
  font-weight: 700;
  font-size: .9rem;
  transition: .2s;
}
.btn-green:hover { color: #fff; transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn-ghost {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 11px;
  padding: 10px 18px;
  font-weight: 600;
  font-size: .88rem;
}
.btn-ghost:hover { border-color: var(--green-500); color: var(--green-600); }

/* Progress bar */
.progress { height: 9px; border-radius: 20px; background: var(--bg); }
.progress-bar { background: linear-gradient(90deg, var(--green-500), var(--green-600)); }

/* Loading spinner overlay */
#loader {
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(3px);
  display: none;
  place-items: center;
  z-index: 3000;
}
#loader.show { display: grid; }
.spinner {
  width: 46px; height: 46px;
  border: 4px solid var(--green-100);
  border-top-color: var(--green-500);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Animations */
.fade-up { animation: fadeUp .45s ease both; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
.d-1 { animation-delay: .05s; }
.d-2 { animation-delay: .1s; }
.d-3 { animation-delay: .15s; }
.d-4 { animation-delay: .2s; }

/* Utility */
.text-muted-2 { color: var(--muted) !important; }
.card-title-sm { font-weight: 800; font-size: .95rem; margin: 0; }
.divider { height: 1px; background: var(--border); margin: 18px 0; }
.empty-state { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty-state i { font-size: 2.6rem; margin-bottom: 12px; opacity: .45; }

/* ============================================================
   FITUR EDUKATOR
   ============================================================ */

/* ---- Card edukator ---- */
.edu-card {
  position: relative;
  overflow: hidden;
  transition: transform .22s ease, box-shadow .22s ease;
}
.edu-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(22, 163, 74, .13);
}
.edu-card::before {
  content: '';
  position: absolute; inset: 0 0 auto 0; height: 4px;
  background: linear-gradient(90deg, var(--green-500), var(--green-700));
}

.edu-foto {
  width: 78px; height: 78px;
  border-radius: 50%; object-fit: cover;
  border: 3px solid var(--green-100);
}

/* Titik status online/offline */
.edu-dot {
  position: absolute;
  right: 2px; bottom: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 3px solid var(--surface);
}
.edu-dot.on  { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.22); }
.edu-dot.off { background: #94a3b8; }

.edu-meta {
  display: flex; gap: 4px;
  align-items: center;
  font-size: .74rem; color: var(--muted);
}

/* Baris statistik kecil di dalam card */
.edu-stat {
  display: flex; text-align: center;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 10px 0; margin: 12px 0;
}
.edu-stat > div { flex: 1; }
.edu-stat > div + div { border-left: 1px solid var(--border); }
.edu-stat b { display: block; font-size: .95rem; color: var(--text); }
.edu-stat span { font-size: .68rem; color: var(--muted); }

/* ---- Chat konsultasi ---- */
.chat-box {
  height: 460px;
  overflow-y: auto;
  padding: 18px;
  background: var(--bg);
  border-radius: 14px;
  display: flex; flex-direction: column; gap: 12px;
}
.chat-box::-webkit-scrollbar { width: 6px; }
.chat-box::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.bubble {
  max-width: 74%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: .87rem;
  line-height: 1.5;
  word-break: break-word;
  animation: bubbleIn .25s ease;
}
@keyframes bubbleIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.bubble.me {
  align-self: flex-end;
  background: var(--green-500);
  color: #fff;
  border-bottom-right-radius: 5px;
}
.bubble.them {
  align-self: flex-start;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 5px;
}

.bubble-time {
  display: block;
  margin-top: 4px;
  font-size: .66rem;
  opacity: .72;
}
.bubble.me .bubble-time { text-align: right; }

/* Pemisah tanggal di chat */
.chat-sep {
  align-self: center;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: .7rem;
  padding: 3px 12px;
  border-radius: 999px;
}

/* ---- Rating bintang interaktif ---- */
.star-pick {
  display: flex; gap: 6px;
  justify-content: center;
  font-size: 2rem;
  cursor: pointer;
}
.star-pick i {
  color: #d1d5db;
  transition: transform .12s ease, color .12s ease;
}
.star-pick i:hover { transform: scale(1.18); }
.star-pick i.on    { color: #f59e0b; }

/* Bar distribusi rating */
.rate-bar {
  display: flex; align-items: center; gap: 8px;
  font-size: .78rem; margin-bottom: 6px;
}
.rate-bar .track {
  flex: 1; height: 7px;
  background: var(--border);
  border-radius: 4px; overflow: hidden;
}
.rate-bar .fill {
  height: 100%;
  background: #f59e0b;
  border-radius: 4px;
}

/* ---- Item konsultasi (list) ---- */
.kons-item {
  display: flex; gap: 12px; align-items: center;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  text-decoration: none;
  transition: border-color .18s ease, transform .18s ease;
}
.kons-item:hover {
  border-color: var(--green-500);
  transform: translateX(3px);
}
.kons-badge {
  min-width: 20px; height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ef4444; color: #fff;
  font-size: .66rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
