/* ============================================================
   TASKFLOW — Design System v2
   Tema: Islami Modern Minimalis
   ============================================================ */

/* ---------- 1. DESIGN TOKENS ---------- */
:root {
  /* Warna dasar */
  --bg: #f7f4ea;
  --bg-soft: #faf8f0;
  --card: #ffffff;

  /* Warna utama */
  --primary: #1a4d3a;
  --primary-dark: #0f3828;
  --primary-light: #2d7a5a;
  --primary-soft: #e8f0e0;
  --primary-softer: #f0f5e9;

  /* Aksen */
  --sage: #c9d6be;
  --sage-dark: #a8b89c;
  --gold: #c9a961;
  --gold-light: #e6d9b5;

  /* Text */
  --text: #1a3a2e;
  --text-secondary: #4a5c50;
  --text-muted: #6b7c70;
  --text-light: #96a69a;

  /* Border & divider */
  --border: #e8ebe0;
  --border-soft: #f0f2e9;

  /* Status warna (untuk hafalan & muroja'ah) */
  --status-mumtaz-murtafi: #c9a961;
  --status-mumtaz: #1a4d3a;
  --status-jayyid-jiddan: #2d7a5a;
  --status-jayyid: #5da87a;
  --status-maqbul: #d4a017;
  --status-rasib: #c76c6c;
  --status-neutral: #b8c0b5;

  /* Approval */
  --pending-bg: #fef3c7;
  --pending-text: #92400e;
  --approved-bg: #d1e7d1;
  --approved-text: #1a4d3a;
  --rejected-bg: #f8d7d7;
  --rejected-text: #8b2828;

  /* Radius */
  --r-sm: 8px;
  --r: 12px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 24px;
  --r-pill: 999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(26, 58, 46, 0.04);
  --shadow-sm: 0 1px 3px rgba(26, 58, 46, 0.05);
  --shadow: 0 2px 12px rgba(26, 58, 46, 0.06);
  --shadow-md: 0 4px 20px rgba(26, 58, 46, 0.08);
  --shadow-lg: 0 12px 40px rgba(26, 58, 46, 0.12);

  /* Transisi */
  --t-fast: 0.15s ease;
  --t: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- 2. RESET & BASE ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font-family: inherit; }

/* Scrollbar halus */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--sage); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--sage-dark); }

/* Animasi masuk */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 20%, rgba(26, 77, 58, 0.05), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(201, 169, 97, 0.06), transparent 45%),
    var(--bg);
}

.login-container {
  width: 100%;
  max-width: 900px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--card);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  min-height: 580px;
}

.login-brand {
  background: linear-gradient(150deg, var(--primary-dark) 0%, var(--primary) 60%, var(--primary-light) 100%);
  color: #fff;
  padding: 52px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.login-brand::before {
  content: "";
  position: absolute;
  top: -100px; right: -100px;
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(255,255,255,0.10), transparent 70%);
  border-radius: 50%;
}

.login-brand::after {
  content: "◯";
  position: absolute;
  bottom: -60px; left: -40px;
  font-size: 220px;
  color: rgba(201, 169, 97, 0.10);
  line-height: 1;
  font-weight: 100;
}

.brand-icon { font-size: 2.8rem; margin-bottom: 20px; position: relative; z-index: 1; }

.login-brand h1 {
  font-size: 1.75rem;
  line-height: 1.25;
  margin-bottom: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
  position: relative;
  z-index: 1;
}

.brand-desc {
  font-size: 0.95rem;
  line-height: 1.6;
  opacity: 0.85;
  margin-bottom: 36px;
  position: relative;
  z-index: 1;
  max-width: 320px;
}

.brand-quote {
  padding: 18px 20px;
  border-left: 3px solid var(--gold);
  background: rgba(255,255,255,0.06);
  border-radius: 0 var(--r) var(--r) 0;
  position: relative;
  z-index: 1;
  backdrop-filter: blur(4px);
}

.brand-quote p {
  font-size: 0.88rem;
  line-height: 1.55;
  font-style: italic;
  margin-bottom: 6px;
}

.brand-quote span {
  font-size: 0.78rem;
  opacity: 0.7;
  font-weight: 600;
}

.login-form-panel {
  padding: 52px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-header { margin-bottom: 28px; }

.login-header h2 {
  font-size: 1.65rem;
  margin-bottom: 6px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.login-header p { color: var(--text-muted); font-size: 0.92rem; }

/* ---------- Form ---------- */
.form-group { margin-bottom: 18px; }

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 7px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 13px 16px;
  font-size: 0.95rem;
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  background: var(--bg-soft);
  color: var(--text);
  outline: none;
  transition: all var(--t-fast);
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  background: var(--card);
  box-shadow: 0 0 0 4px rgba(26, 77, 58, 0.08);
}

.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-light); }

textarea { resize: vertical; min-height: 70px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.form-label-block {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

/* ---------- Buttons ---------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: var(--r);
  cursor: pointer;
  transition: all var(--t-fast);
  font-family: inherit;
  white-space: nowrap;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(26, 77, 58, 0.25);
}

.btn-primary:active:not(:disabled) { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 20px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  cursor: pointer;
  transition: all var(--t-fast);
  font-family: inherit;
}

.btn-secondary:hover { background: var(--bg-soft); border-color: var(--sage); }

.btn-logout {
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--border);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: all var(--t-fast);
  font-family: inherit;
}

.btn-logout:hover { background: var(--primary-soft); border-color: var(--sage); }

.btn-back {
  background: transparent;
  border: 1.5px solid var(--border);
  width: 36px;
  height: 36px;
  border-radius: var(--r);
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--text);
  display: grid;
  place-items: center;
  transition: all var(--t-fast);
  margin-right: 4px;
}

.btn-back:hover { background: var(--bg-soft); }

/* ---------- Error box ---------- */
.login-error {
  padding: 12px 16px;
  background: var(--rejected-bg);
  color: var(--rejected-text);
  border-radius: var(--r);
  font-size: 0.88rem;
  margin-bottom: 16px;
  line-height: 1.5;
  border-left: 3px solid var(--status-rasib);
}

/* ---------- Footer kontak ---------- */
.login-footer {
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--border-soft);
  text-align: center;
}

.contact-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.contact-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}

.contact-links {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.contact-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: var(--r-pill);
  text-decoration: none;
  transition: all var(--t-fast);
}

.contact-links a:hover { background: var(--sage); transform: translateY(-1px); }

/* ============================================================
   DASHBOARD LAYOUT
   ============================================================ */
.dashboard-page { background: var(--bg); min-height: 100vh; }

.topbar {
  background: rgba(247, 244, 234, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--primary);
  letter-spacing: -0.01em;
}

.logo-icon { font-size: 1.4rem; }

.topbar-user {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-info { text-align: right; line-height: 1.3; }

.user-role {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 700;
}

.user-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 28px 72px;
}

/* ---------- Page header ---------- */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.page-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 6px;
  color: var(--text);
}

.subtitle {
  font-size: 0.92rem;
  color: var(--text-muted);
}

.btn-add {
  padding: 11px 20px;
  font-size: 0.9rem;
  width: auto;
}

.btn-add span {
  font-size: 1.15rem;
  line-height: 1;
  font-weight: 400;
}

/* ---------- Loading ---------- */
.loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.spinner {
  width: 32px;
  height: 32px;
  margin: 0 auto 14px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ============================================================
   STATS & CHART CARDS (untuk dashboard baru)
   ============================================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--border-soft);
  transition: all var(--t);
  animation: fadeUp 0.4s ease backwards;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.stat-card-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.stat-card-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  background: var(--primary-soft);
  display: grid;
  place-items: center;
  font-size: 0.95rem;
}

.stat-card-value {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 4px;
}

.stat-card-value .unit {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 4px;
}

.stat-card-trend {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-card-trend.up { color: var(--primary-light); }
.stat-card-trend.down { color: var(--status-rasib); }

/* ---------- Simple Bar Chart (CSS only) ---------- */
.mini-chart {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 48px;
  margin-top: 12px;
}

.mini-chart-bar {
  flex: 1;
  background: var(--primary-soft);
  border-radius: 4px 4px 2px 2px;
  min-height: 4px;
  transition: all var(--t);
  position: relative;
}

.mini-chart-bar.filled { background: var(--primary); }
.mini-chart-bar:hover { background: var(--primary-light); }

.mini-chart-labels {
  display: flex;
  gap: 5px;
  margin-top: 6px;
  font-size: 0.68rem;
  color: var(--text-light);
  text-align: center;
}

.mini-chart-labels span { flex: 1; }

/* ---------- Donut / Circular Progress ---------- */
.donut-wrap {
  display: flex;
  align-items: center;
  gap: 18px;
}

.donut {
  position: relative;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
}

.donut svg { transform: rotate(-90deg); }

.donut-bg { stroke: var(--border-soft); }

.donut-fill {
  stroke: var(--primary);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.donut-text {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.02em;
}

/* ---------- Progress Bar ---------- */
.progress-track {
  width: 100%;
  height: 8px;
  background: var(--border-soft);
  border-radius: var(--r-pill);
  overflow: hidden;
  margin-top: 10px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-light), var(--primary));
  border-radius: var(--r-pill);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ============================================================
   SUMMARY CARD (gaya gradient)
   ============================================================ */
.summary-card {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: #fff;
  border-radius: var(--r-lg);
  padding: 22px 26px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 18px;
  align-items: center;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.summary-card::after {
  content: "";
  position: absolute;
  top: -50%; right: -20%;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(255,255,255,0.08), transparent 60%);
  border-radius: 50%;
  pointer-events: none;
}

.summary-item { text-align: center; position: relative; z-index: 1; }

.summary-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.75;
  margin-bottom: 8px;
  font-weight: 600;
}

.summary-value {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.summary-value.small {
  font-size: 0.85rem;
  font-weight: 500;
  opacity: 0.95;
  line-height: 1.55;
}

.summary-divider {
  width: 1px;
  height: 50px;
  background: rgba(255,255,255,0.18);
}

/* ============================================================
   TABS
   ============================================================ */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--card);
  padding: 5px;
  border-radius: var(--r);
  border: 1px solid var(--border-soft);
  margin-bottom: 22px;
  width: fit-content;
  box-shadow: var(--shadow-xs);
}

.tab {
  padding: 10px 18px;
  border: none;
  background: transparent;
  border-radius: var(--r-sm);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  transition: all var(--t-fast);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tab:hover { color: var(--text); background: var(--bg-soft); }
.tab.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 6px rgba(26, 77, 58, 0.2);
}

.tab-count {
  background: rgba(0,0,0,0.08);
  padding: 2px 8px;
  border-radius: var(--r-pill);
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 20px;
  text-align: center;
}

.tab.active .tab-count { background: rgba(255,255,255,0.22); }

/* ============================================================
   FILTER CHIPS (untuk Peta Surat)
   ============================================================ */
.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.chip {
  padding: 8px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: all var(--t-fast);
  font-family: inherit;
}

.chip:hover { border-color: var(--sage); background: var(--bg-soft); }
.chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ============================================================
   SEARCH BOX
   ============================================================ */
.search-box {
  position: relative;
  margin-bottom: 16px;
  max-width: 380px;
}

.search-box input {
  width: 100%;
  padding: 11px 16px 11px 42px;
  font-size: 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--card);
  color: var(--text);
  outline: none;
  transition: all var(--t-fast);
  font-family: inherit;
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(26, 77, 58, 0.08);
}

.search-box::before {
  content: "🔍";
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  opacity: 0.5;
  pointer-events: none;
}

/* ============================================================
   BADGES (status hafalan)
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: var(--r-pill);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.badge-status-mumtaz-murtafi {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: #4a3a15;
}

.badge-status-mumtaz {
  background: var(--primary-soft);
  color: var(--primary);
}

.badge-status-jayyid-jiddan {
  background: #dbeada;
  color: #1a4d3a;
}

.badge-status-jayyid {
  background: #e5f0e0;
  color: #2d7a5a;
}

.badge-status-maqbul {
  background: #fbf0d0;
  color: #8a6d15;
}

.badge-status-rasib {
  background: #f5dcdc;
  color: #8b2828;
}

.badge-approval { background: var(--pending-bg); color: var(--pending-text); }
.badge-approval.approved { background: var(--approved-bg); color: var(--approved-text); }
.badge-approval.rejected { background: var(--rejected-bg); color: var(--rejected-text); }

/* ============================================================
   SISWA CARD (dashboard guru)
   ============================================================ */
.siswa-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.siswa-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  padding: 20px;
  cursor: pointer;
  transition: all var(--t);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-xs);
  animation: fadeUp 0.35s ease backwards;
}

.siswa-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--sage);
}

.siswa-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.siswa-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.siswa-avatar.big {
  width: 64px;
  height: 64px;
  font-size: 1.4rem;
}

.siswa-nama {
  font-weight: 700;
  font-size: 0.98rem;
  margin-bottom: 2px;
  line-height: 1.3;
  color: var(--text);
}

.siswa-username {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

.siswa-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.stat-box {
  background: var(--bg-soft);
  padding: 12px;
  border-radius: var(--r);
  text-align: center;
}

.stat-number {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 5px;
  font-weight: 700;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-muted);
  background: var(--card);
  border: 1.5px dashed var(--border);
  border-radius: var(--r-lg);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-state h3 {
  color: var(--text);
  font-size: 1.1rem;
  margin-bottom: 6px;
  font-weight: 700;
}

.empty-state p { font-size: 0.9rem; }

/* ============================================================
   HISTORY LIST
   ============================================================ */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-item {
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  padding: 16px 18px;
  transition: all var(--t-fast);
  animation: fadeUp 0.3s ease backwards;
}

.history-item:hover {
  border-color: var(--sage);
  box-shadow: var(--shadow-sm);
}

.history-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.history-title {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--text);
}

.history-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  padding: 2px 10px;
  background: var(--bg-soft);
  border-radius: var(--r-pill);
}

.history-detail {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 8px;
}

.history-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.empty-history {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
  background: var(--card);
  border: 1.5px dashed var(--border);
  border-radius: var(--r-md);
}

/* ============================================================
   TABLE (untuk Peta Surat)
   ============================================================ */
.table-wrap {
  background: var(--card);
  border-radius: var(--r-lg);
  border: 1px solid var(--border-soft);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

.table-scroll { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead th {
  padding: 14px 18px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border-soft);
}

tbody td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text);
}

tbody tr:last-child td { border-bottom: none; }

tbody tr {
  transition: background var(--t-fast);
}

tbody tr:hover { background: var(--bg-soft); }

.cell-muted { color: var(--text-muted); font-size: 0.85rem; }
.cell-number {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Legend dots */
.legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 58, 46, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

.modal-content {
  position: relative;
  background: var(--card);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 460px;
  box-shadow: var(--shadow-lg);
  animation: popIn 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  padding: 24px 26px 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.modal-header h2 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.modal-header-success h2 { color: var(--primary); }

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 4px;
  border-radius: var(--r-sm);
  transition: all var(--t-fast);
  font-family: inherit;
}

.modal-close:hover { background: var(--bg-soft); color: var(--text); }

.modal-body { padding: 8px 26px 20px; }
.modal-desc { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 16px; }

.modal-footer {
  padding: 12px 26px 24px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ---------- Info box (hasil) ---------- */
.info-box {
  background: var(--bg-soft);
  border-radius: var(--r-md);
  padding: 16px 18px;
  margin-bottom: 14px;
  border: 1px solid var(--border-soft);
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  gap: 12px;
  font-size: 0.9rem;
}

.info-row + .info-row { border-top: 1px solid var(--border-soft); }

.info-label { color: var(--text-muted); font-weight: 500; }

.info-value {
  font-weight: 600;
  color: var(--text);
  text-align: right;
  word-break: break-all;
}

.info-value.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; }

.info-value.big {
  font-size: 1.55rem;
  color: var(--primary);
  letter-spacing: 0.12em;
  font-weight: 700;
}

.info-row.highlight {
  background: linear-gradient(135deg, var(--gold-light), #f5ead0);
  border-radius: var(--r);
  padding: 12px 16px;
  margin: 6px -18px 0;
  border-top: none !important;
}

.warning-text {
  font-size: 0.83rem;
  color: #8a6d15;
  background: #fbf0d0;
  padding: 12px 16px;
  border-radius: var(--r);
  line-height: 1.5;
  border-left: 3px solid var(--gold);
}

/* ============================================================
   JUZ TABS (di modal input hafalan)
   ============================================================ */
.juz-tabs {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  background: var(--bg-soft);
  padding: 6px;
  border-radius: var(--r);
  border: 1px solid var(--border-soft);
  margin-bottom: 4px;
  max-height: 150px;
  overflow-y: auto;
}

.juz-tab {
  padding: 8px 4px;
  font-size: 0.78rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-family: inherit;
  transition: all var(--t-fast);
}

.juz-tab:hover { background: var(--card); color: var(--text); }
.juz-tab.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 6px rgba(26, 77, 58, 0.2);
}

/* ---------- Surat list ---------- */
.surat-list {
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--r);
  padding: 6px;
  min-height: 100px;
  max-height: 210px;
  overflow-y: auto;
}

.surat-placeholder {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 30px 20px;
}

.surat-item {
  padding: 11px 14px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all var(--t-fast);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.surat-item:hover { background: var(--card); }

.surat-item.selected {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

.surat-arab {
  font-family: 'Traditional Arabic', 'Amiri', 'Scheherazade New', serif;
  font-size: 1.15rem;
  opacity: 0.7;
  direction: rtl;
}

.surat-item.selected .surat-arab { opacity: 0.95; }

/* ============================================================
   TARGET INFO (muroja'ah)
   ============================================================ */
.target-info {
  background: var(--primary-softer);
  border: 1px solid var(--sage);
  border-radius: var(--r);
  padding: 14px 16px;
  margin-bottom: 14px;
}

.target-info-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.target-info-content {
  font-size: 0.87rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.target-line {
  padding: 5px 0;
  border-bottom: 1px dashed var(--sage);
}

.target-line:last-child { border-bottom: none; }

/* ---------- Checkbox row ---------- */
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-soft);
  border: 1.5px solid var(--border-soft);
  border-radius: var(--r);
  margin-bottom: 14px;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all var(--t-fast);
}

.checkbox-row:hover { background: var(--card); border-color: var(--sage); }

.checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

.checkbox-row span { color: var(--text); font-weight: 500; }

#manualForm { animation: slideDown 0.25s ease; margin-bottom: 4px; }

/* ============================================================
   PENDING BOX (di detail siswa)
   ============================================================ */
.pending-box {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-left: 4px solid var(--gold);
  border-radius: var(--r);
  padding: 14px 20px;
  margin-bottom: 22px;
  animation: slideDown 0.4s ease;
}

.pending-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--pending-text);
  font-size: 0.9rem;
}

.pending-icon { font-size: 1.2rem; }

/* ============================================================
   HISTORY ACTIONS
   ============================================================ */
.history-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-soft);
  flex-wrap: wrap;
}

.btn-action {
  padding: 7px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--r-sm);
  border: 1px solid;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--t-fast);
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.btn-approve {
  color: var(--approved-text);
  background: var(--approved-bg);
  border-color: #b8d8b8;
}
.btn-approve:hover { background: #b8d8b8; transform: translateY(-1px); }

.btn-reject {
  color: var(--rejected-text);
  background: var(--rejected-bg);
  border-color: #e8b8b8;
}
.btn-reject:hover { background: #e8b8b8; transform: translateY(-1px); }

.btn-delete {
  color: var(--text-muted);
  background: var(--bg-soft);
  border-color: var(--border);
}
.btn-delete:hover {
  color: var(--status-rasib);
  background: var(--rejected-bg);
  border-color: #e8b8b8;
}

/* ============================================================
   SISWA INFO CARD (detail siswa)
   ============================================================ */
.siswa-info-card {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  padding: 22px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-xs);
}

.siswa-info-text h1 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
  color: var(--text);
}

.siswa-info-username {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

/* ============================================================
   PANEL & PAGE FOOTER
   ============================================================ */
.tab-panel { animation: fadeIn 0.25s ease; }

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.panel-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.page-footer {
  margin-top: 48px;
  padding-top: 26px;
  border-top: 1px solid var(--border-soft);
  text-align: center;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 720px) {
  .login-container {
    grid-template-columns: 1fr;
    max-width: 440px;
    min-height: auto;
  }

  .login-brand { padding: 36px 30px; }
  .login-brand h1 { font-size: 1.45rem; }
  .brand-desc { margin-bottom: 20px; font-size: 0.88rem; }
  .brand-quote { padding: 14px 16px; }
  .brand-quote p { font-size: 0.82rem; }

  .login-form-panel { padding: 36px 30px; }
  .login-header h2 { font-size: 1.4rem; }

  .topbar-inner { padding: 12px 18px; }
  .logo-text { display: none; }
  .user-role { display: none; }
  .container { padding: 22px 18px 48px; }
  .page-header { flex-direction: column; align-items: stretch; }
  .page-header h1 { font-size: 1.4rem; }
  .btn-add { width: 100%; justify-content: center; }

  .modal-footer { flex-direction: column-reverse; }
  .modal-footer .btn-primary,
  .modal-footer .btn-secondary { width: 100%; }

  .summary-card { grid-template-columns: 1fr; }
  .summary-divider { height: 1px; width: 60%; margin: 0 auto; }

  .form-row { grid-template-columns: 1fr; }

  .tabs { width: 100%; }
  .tab { flex: 1; justify-content: center; padding: 10px 12px; font-size: 0.82rem; }

  .siswa-info-card { padding: 18px; }
  .siswa-avatar.big { width: 54px; height: 54px; font-size: 1.2rem; }
  .siswa-info-text h1 { font-size: 1.2rem; }

  .juz-tabs { grid-template-columns: repeat(5, 1fr); }

  table { font-size: 0.82rem; }
  thead th, tbody td { padding: 11px 12px; }
}

@media (max-width: 400px) {
  .login-page { padding: 12px; }
  .login-brand, .login-form-panel { padding: 26px 22px; }
  .stats-grid { grid-template-columns: 1fr; }
}


/* ============================================================
   LOGO (SVG)
   ============================================================ */

.logo-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: block;
}

.brand-icon {
  width: 72px;
  height: 72px;
  margin-bottom: 22px;
  display: block;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
}

/* Sesuaikan logo di topbar mobile */
@media (max-width: 720px) {
  .logo-icon {
    width: 28px;
    height: 28px;
  }
}


/* ============================================================
   LOGO & CONTACT ICONS (v2)
   ============================================================ */

.logo-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: block;
  border-radius: 9px;
}

.brand-icon {
  width: 84px;
  height: 84px;
  margin-bottom: 22px;
  display: block;
  border-radius: 21px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

/* Ikon kontak (WA & Email) */
.contact-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: -3px;
}

/* Sesuaikan di mobile */
@media (max-width: 720px) {
  .logo-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
  }
  .brand-icon {
    width: 72px;
    height: 72px;
    border-radius: 18px;
  }
}


/* ============================================================
   LOGIN — Enhancements (10.4b)
   ============================================================ */

/* Animasi masuk */
.login-brand {
  animation: fadeUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.login-form-panel {
  animation: fadeUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.1s backwards;
}

/* Input password dengan toggle */
.input-password {
  position: relative;
}

.input-password input {
  padding-right: 46px;
}

.btn-toggle-pw {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--t-fast);
  padding: 0;
  font-family: inherit;
}

.btn-toggle-pw:hover {
  background: var(--bg-soft);
  color: var(--text);
}

.btn-toggle-pw.active {
  color: var(--primary);
}

.btn-toggle-pw .icon-eye {
  width: 18px;
  height: 18px;
  display: block;
}

.btn-toggle-pw.active .icon-eye {
  position: relative;
}

.btn-toggle-pw.active .icon-eye::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: currentColor;
  transform: translateY(-50%) rotate(-45deg);
  border-radius: 2px;
}

/* Tombol submit dengan spinner */
.btn-primary {
  position: relative;
  overflow: hidden;
}

.btn-primary .btn-spinner {
  display: inline-flex;
  align-items: center;
  animation: spin 0.8s linear infinite;
}

.btn-primary .btn-spinner svg {
  width: 16px;
  height: 16px;
}

/* Tombol submit lebih besar di login */
#loginBtn {
  padding: 14px 22px;
  font-size: 0.98rem;
  margin-top: 4px;
}

/* Perbaiki animasi focus */
.form-group input:focus {
  transition: all 0.2s ease;
}

/* Brand panel lebih hidup */
.login-brand h1 {
  background: linear-gradient(135deg, #ffffff 0%, #e8ebe0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Brand quote lebih elegan */
.brand-quote {
  position: relative;
  padding-left: 22px;
}

.brand-quote::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--gold), transparent);
  border-radius: 2px;
}

/* Responsive improvement */
@media (max-width: 720px) {
  .login-container {
    box-shadow: var(--shadow-md);
  }
  .login-brand {
    padding: 32px 28px 28px;
  }
  .login-form-panel {
    padding: 30px 28px 34px;
  }
  .brand-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
  }
  .login-brand h1 {
    font-size: 1.35rem;
  }
}


/* ============================================================
   DASHBOARD SISWA — Redesign (10.4c)
   ============================================================ */

/* Greeting */
.greeting {
  margin-bottom: 24px;
  animation: fadeUp 0.5s ease backwards;
}

.greeting h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
  color: var(--text);
}

.greeting h1 span {
  color: var(--primary);
}

.greeting p {
  font-size: 0.92rem;
  color: var(--text-muted);
}

/* Stat Card enhancement */
.stat-card {
  position: relative;
}

.stat-card-icon {
  font-size: 1rem;
  line-height: 1;
}

.stat-card-value {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

/* Target Card */
.target-card {
  background: linear-gradient(135deg, var(--primary-softer), #ffffff);
  border: 1px solid var(--sage);
  border-radius: var(--r-lg);
  padding: 20px 24px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-xs);
  animation: fadeUp 0.5s ease 0.15s backwards;
}

.target-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--sage);
}

.target-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r);
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(26, 77, 58, 0.2);
}

.target-card-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.target-card-header p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.target-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.target-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  padding: 6px 0;
}

.target-item-bullet {
  color: var(--primary);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Progress Card */
.progress-card {
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  padding: 22px 24px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-xs);
  animation: fadeUp 0.5s ease 0.2s backwards;
}

.progress-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.progress-card-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.progress-card-header p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.progress-pct {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.03em;
  line-height: 1;
  flex-shrink: 0;
}

.progress-card .progress-track {
  height: 10px;
  background: var(--bg-soft);
  border-radius: var(--r-pill);
  overflow: hidden;
  margin-top: 0;
}

.progress-card .progress-fill {
  background: linear-gradient(90deg, var(--primary-light), var(--primary));
  position: relative;
}

.progress-card .progress-fill::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
}

/* Mobile */
@media (max-width: 720px) {
  .greeting h1 {
    font-size: 1.25rem;
  }
  .progress-pct {
    font-size: 1.35rem;
  }
  .target-card,
  .progress-card {
    padding: 18px 20px;
  }
}


/* ============================================================
   DASHBOARD GURU — Redesign (10.4d)
   ============================================================ */

/* Section header */
.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  margin-top: 32px;
  flex-wrap: wrap;
  animation: fadeUp 0.5s ease 0.15s backwards;
}

.section-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

/* Pending Alert */
.pending-alert {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, #fef9e7, #fdf2d0);
  border: 1px solid #f5d98a;
  border-radius: var(--r-lg);
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-xs);
  animation: slideDown 0.4s ease, pulseAlert 2.5s ease-in-out 1s infinite;
}

@keyframes pulseAlert {
  0%, 100% { box-shadow: var(--shadow-xs); }
  50% { box-shadow: 0 4px 20px rgba(201, 169, 97, 0.15); }
}

.pending-alert-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--r);
  background: linear-gradient(135deg, var(--gold), #b08d3f);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(201, 169, 97, 0.3);
}

.pending-alert-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.88rem;
  color: var(--pending-text);
  line-height: 1.4;
}

.pending-alert-body strong {
  font-size: 0.95rem;
  font-weight: 700;
}

/* Siswa card enhancement */
.siswa-card {
  position: relative;
  overflow: hidden;
}

.siswa-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  opacity: 0;
  transition: opacity var(--t-fast);
}

.siswa-card:hover::before {
  opacity: 1;
}

.siswa-card-header > div:last-child {
  min-width: 0;
  flex: 1;
}

.siswa-nama {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Mobile */
@media (max-width: 720px) {
  .section-header h2 {
    font-size: 1.05rem;
  }
  .section-header .btn-add {
    width: 100%;
  }
  .pending-alert {
    padding: 14px 16px;
  }
  .pending-alert-icon {
    width: 38px;
    height: 38px;
    font-size: 1rem;
  }
}


/* ============================================================
   MODAL MUROJA'AH — Redesign v2 (Juz Grid & Surat Grid)
   ============================================================ */

.mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: var(--bg-soft);
  padding: 6px;
  border-radius: var(--r);
  margin-bottom: 18px;
}

.mode-btn {
  padding: 11px;
  border: none;
  background: transparent;
  border-radius: var(--r-sm);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--text-muted);
  font-family: inherit;
  transition: all var(--t-fast);
}

.mode-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 6px rgba(26, 77, 58, 0.2);
}

.picker-section {
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  padding: 14px;
  margin-bottom: 14px;
}

.picker-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.picker-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
}

.picker-title {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text);
  flex: 1;
}

.picker-selected {
  font-size: 0.78rem;
  color: var(--primary);
  font-weight: 700;
  background: var(--card);
  padding: 4px 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--sage);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Juz Grid */
.juz-grid {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.juz-btn {
  width: 48px;
  height: 48px;
  border: 1.5px solid var(--border);
  background: var(--card);
  border-radius: var(--r-sm);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: all var(--t-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 0;
}

.juz-btn .juz-label {
  font-size: 0.55rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.juz-btn:hover {
  border-color: var(--sage);
  background: var(--primary-softer);
}

.juz-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 3px 10px rgba(26, 77, 58, 0.28);
}

.juz-btn.active .juz-label {
  color: rgba(255, 255, 255, 0.8);
}

/* Surat Grid */
.surat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  max-height: 210px;
  overflow-y: auto;
  padding: 2px;
}

@media (min-width: 480px) {
  .surat-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.surat-btn {
  padding: 9px 11px;
  border: 1.5px solid var(--border);
  background: var(--card);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: all var(--t-fast);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.surat-btn:hover {
  border-color: var(--sage);
  background: var(--primary-softer);
}

.surat-btn.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 3px 10px rgba(26, 77, 58, 0.28);
}

.surat-btn-name {
  font-weight: 700;
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

.surat-btn.selected .surat-btn-name { color: #fff; }

.surat-btn-ayat {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 500;
}

.surat-btn.selected .surat-btn-ayat {
  color: rgba(255, 255, 255, 0.8);
}

.surat-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 24px 16px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Override juz-tabs lama (untuk modal hafalan) tetap ada */


/* ============================================================
   AUTO-COLLAPSE SURAT (Feature 1)
   ============================================================ */

.surat-selected-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(135deg, var(--primary-softer), #ffffff);
  border: 1.5px solid var(--primary);
  border-radius: var(--r);
  padding: 12px 14px;
  animation: popIn 0.25s ease;
}

.surat-selected-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.surat-selected-check {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 3px 8px rgba(26, 77, 58, 0.25);
}

.surat-selected-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.surat-selected-ayat {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.btn-change-surat {
  padding: 7px 14px;
  border: 1.5px solid var(--primary);
  background: var(--card);
  color: var(--primary);
  border-radius: var(--r-sm);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--t-fast);
  flex-shrink: 0;
}

.btn-change-surat:hover {
  background: var(--primary);
  color: #fff;
}

/* Pastikan CSS modal muroja'ah dari step sebelumnya tetap ada */
.mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: var(--bg-soft);
  padding: 6px;
  border-radius: var(--r);
  margin-bottom: 18px;
}

.mode-btn {
  padding: 11px;
  border: none;
  background: transparent;
  border-radius: var(--r-sm);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--text-muted);
  font-family: inherit;
  transition: all var(--t-fast);
}

.mode-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 6px rgba(26, 77, 58, 0.2);
}

.picker-section {
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  padding: 14px;
  margin-bottom: 14px;
}

.picker-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.picker-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
}

.picker-title {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text);
  flex: 1;
}

.picker-selected {
  font-size: 0.78rem;
  color: var(--primary);
  font-weight: 700;
  background: var(--card);
  padding: 4px 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--sage);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.juz-grid {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.juz-btn {
  width: 48px;
  height: 48px;
  border: 1.5px solid var(--border);
  background: var(--card);
  border-radius: var(--r-sm);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: all var(--t-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 0;
}

.juz-btn .juz-label {
  font-size: 0.55rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.juz-btn:hover { border-color: var(--sage); background: var(--primary-softer); }

.juz-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 3px 10px rgba(26, 77, 58, 0.28);
}

.juz-btn.active .juz-label { color: rgba(255, 255, 255, 0.8); }

.surat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  max-height: 210px;
  overflow-y: auto;
  padding: 2px;
}

@media (min-width: 480px) {
  .surat-grid { grid-template-columns: repeat(3, 1fr); }
}

.surat-btn {
  padding: 9px 11px;
  border: 1.5px solid var(--border);
  background: var(--card);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: all var(--t-fast);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.surat-btn:hover { border-color: var(--sage); background: var(--primary-softer); }

.surat-btn.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 3px 10px rgba(26, 77, 58, 0.28);
}

.surat-btn-name {
  font-weight: 700;
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

.surat-btn.selected .surat-btn-name { color: #fff; }

.surat-btn-ayat {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 500;
}

.surat-btn.selected .surat-btn-ayat { color: rgba(255, 255, 255, 0.8); }

.surat-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 24px 16px;
  font-size: 0.82rem;
  color: var(--text-muted);
}


/* ============================================================
   PETA SURAT (Feature 2)
   ============================================================ */

.peta-card {
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  padding: 22px 22px 8px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-xs);
  animation: fadeUp 0.4s ease backwards;
}

.peta-card-header {
  margin-bottom: 16px;
}

.peta-card-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.peta-subtitle {
  font-size: 0.83rem;
  color: var(--text-muted);
}

.peta-card .chips {
  margin-bottom: 12px;
}

.peta-card .search-box {
  max-width: 320px;
  margin-bottom: 14px;
}

.peta-card .legend {
  margin-bottom: 14px;
}

.peta-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.peta-table thead th {
  position: sticky;
  top: 0;
  background: var(--bg-soft);
  z-index: 1;
}

.peta-loading {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.surat-cell {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.surat-cell-name {
  font-weight: 600;
  color: var(--text);
}

.surat-cell-arab {
  font-family: 'Traditional Arabic', 'Amiri', 'Scheherazade New', serif;
  font-size: 1.05rem;
  opacity: 0.6;
  color: var(--text-muted);
  direction: rtl;
}

.badge-kelancaran {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: var(--r-pill);
  white-space: nowrap;
}

.badge-kelancaran.belum {
  background: #f0f2e9;
  color: var(--text-muted);
}

.badge-kelancaran.bulan_lalu {
  background: var(--border-soft);
  color: var(--text-muted);
}

@media (max-width: 720px) {
  .peta-card {
    padding: 16px 14px 6px;
  }
  .peta-table {
    font-size: 0.78rem;
  }
  .peta-table thead th,
  .peta-table tbody td {
    padding: 10px 10px;
  }
  .surat-cell {
    gap: 6px;
  }
  .surat-cell-arab {
    font-size: 0.9rem;
  }
  .peta-card .search-box {
    max-width: 100%;
  }
}


/* ============================================================
   PETA SURAT v2 — Dibaca Count & Expandable Detail
   ============================================================ */

.peta-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.peta-card-header > div {
  flex: 1;
  min-width: 200px;
}

.peta-card-header .btn-add {
  flex-shrink: 0;
  padding: 11px 18px;
  font-size: 0.88rem;
}

@media (max-width: 720px) {
  .peta-card-header .btn-add {
    width: 100%;
    justify-content: center;
  }
}

/* Kolom Dibaca */
.dibaca-count {
  display: inline-block;
  padding: 3px 10px;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: var(--r-pill);
  font-weight: 700;
  font-size: 0.78rem;
  min-width: 32px;
  text-align: center;
}

/* Row interaktif */
.peta-row {
  cursor: pointer;
  transition: background 0.15s ease;
}

.peta-row:hover {
  background: var(--primary-softer);
}

.peta-row.expanded {
  background: var(--primary-softer);
}

.peta-row.expanded .surat-cell-name {
  color: var(--primary);
}

/* Detail row */
.peta-row-detail > td {
  padding: 0 !important;
  background: var(--primary-softer);
  border-bottom: 1px solid var(--border) !important;
}

.riwayat-detail-inner {
  padding: 14px 20px 16px;
}

.riwayat-detail-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.riwayat-detail-item {
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.riwayat-detail-left {
  flex: 1;
  min-width: 0;
}

.riwayat-detail-label {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--primary-soft);
  padding: 2px 8px;
  border-radius: var(--r-pill);
  margin-bottom: 4px;
}

.riwayat-detail-date {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.riwayat-detail-ayat {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.riwayat-detail-empty {
  padding: 16px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

@media (max-width: 720px) {
  .riwayat-detail-inner { padding: 12px 14px; }
  .riwayat-detail-item { padding: 10px 12px; }
}


/* ============================================================
   TAHAP 2 — Tab Full-width, Progress per Juz, Target Compact
   ============================================================ */

/* Tab: full-width, 2 kolom sama besar */
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 5px;
  background: var(--card);
  border-radius: var(--r);
  border: 1px solid var(--border-soft);
  width: 100%;
  margin-bottom: 22px;
  box-shadow: var(--shadow-xs);
}

.tabs .tab {
  padding: 13px 16px;
  border: none;
  background: transparent;
  border-radius: var(--r-sm);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  transition: all var(--t-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.tabs .tab:hover { color: var(--text); background: var(--bg-soft); }
.tabs .tab.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 6px rgba(26, 77, 58, 0.2);
}

/* Target card — perkecil */
.target-card {
  padding: 14px 18px;
  margin-bottom: 18px;
}

.target-card-header {
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 10px;
}

.target-card-icon {
  width: 34px;
  height: 34px;
  font-size: 0.95rem;
  border-radius: var(--r-sm);
}

.target-card-header h3 {
  font-size: 0.88rem;
  margin-bottom: 1px;
}

.target-card-header p {
  font-size: 0.72rem;
}

.target-card-body {
  gap: 5px;
}

.target-item {
  font-size: 0.81rem;
  padding: 3px 0;
  gap: 8px;
}

.target-item-bullet {
  font-size: 0.85rem;
}

/* Progress per Juz */
.juz-progress-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.progress-empty {
  text-align: center;
  padding: 30px 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.juz-progress-item {
  display: flex;
  flex-direction: column;
}

.juz-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 7px;
}

.juz-progress-label {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

.juz-progress-pct {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.juz-progress-track {
  height: 8px;
  background: var(--bg-soft);
  border-radius: var(--r-pill);
  overflow: hidden;
  margin-bottom: 6px;
}

.juz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-light), var(--primary));
  border-radius: var(--r-pill);
  transition: width 0.9s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.juz-progress-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2.5s infinite;
}

.juz-progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  color: var(--text-muted);
  gap: 8px;
  flex-wrap: wrap;
}

.juz-progress-meta > span:last-child {
  font-weight: 500;
  color: var(--text-secondary);
}

/* Stat card value small (untuk hafalan terakhir) */
.stat-card-value.small {
  font-size: 1.15rem !important;
  line-height: 1.3 !important;
}

/* Responsive */
@media (max-width: 720px) {
  .tabs .tab {
    padding: 12px 10px;
    font-size: 0.82rem;
  }
  .juz-progress-pct {
    font-size: 0.95rem;
  }
  .juz-progress-meta {
    font-size: 0.7rem;
  }
}


/* ============================================================
   ACHIEVEMENT CARD — Perayaan Pencapaian
   ============================================================ */

.achievement-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-lg);
  padding: 24px 26px;
  margin-bottom: 22px;
  background: linear-gradient(135deg, #d4a017 0%, #f0d9a0 40%, #d4a017 100%);
  background-size: 200% 200%;
  animation: achShimmer 4s ease-in-out infinite, fadeUp 0.5s ease backwards;
  box-shadow: 0 8px 30px rgba(212, 160, 23, 0.28);
  color: #422006;
}

@keyframes achShimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.achievement-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.4), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(255,255,255,0.25), transparent 45%);
  pointer-events: none;
  animation: achGlow 3s ease-in-out infinite alternate;
}

@keyframes achGlow {
  from { opacity: 0.5; }
  to { opacity: 1; }
}

.ach-content {
  position: relative;
  z-index: 2;
  text-align: center;
}

.ach-icon {
  font-size: 2.8rem;
  line-height: 1;
  margin-bottom: 10px;
  filter: drop-shadow(0 2px 8px rgba(66, 32, 6, 0.3));
  animation: achBounce 2s ease-in-out infinite;
  display: inline-block;
}

@keyframes achBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.ach-title {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  color: #422006;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
}

.ach-subtitle {
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.5;
  color: #5a3a15;
  max-width: 420px;
  margin: 0 auto 12px;
}

.ach-badge {
  display: inline-block;
  padding: 6px 18px;
  background: rgba(66, 32, 6, 0.92);
  color: #ffe9a8;
  border-radius: var(--r-pill);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: 0 3px 10px rgba(66, 32, 6, 0.35);
}

.ach-badge.progress {
  background: rgba(66, 32, 6, 0.82);
}

/* Sparkles */
.ach-sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.ach-spark {
  position: absolute;
  font-size: 1.2rem;
  color: #fffbe0;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.9);
  opacity: 0;
  animation: sparkle 3s ease-in-out infinite;
}

.ach-spark.s1 { top: 12%; left: 10%; font-size: 1rem; animation-delay: 0s; }
.ach-spark.s2 { top: 18%; right: 12%; font-size: 1.4rem; animation-delay: 0.5s; }
.ach-spark.s3 { top: 55%; left: 6%; font-size: 0.9rem; animation-delay: 1s; }
.ach-spark.s4 { top: 75%; right: 8%; font-size: 1.1rem; animation-delay: 1.5s; }
.ach-spark.s5 { top: 35%; right: 30%; font-size: 0.85rem; animation-delay: 2s; }
.ach-spark.s6 { top: 82%; left: 25%; font-size: 1rem; animation-delay: 2.5s; }

@keyframes sparkle {
  0%, 100% { opacity: 0; transform: scale(0.5) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.2) rotate(180deg); }
}

@media (max-width: 720px) {
  .achievement-card {
    padding: 20px 18px;
    margin-bottom: 18px;
  }
  .ach-icon { font-size: 2.4rem; }
  .ach-title { font-size: 1.2rem; }
  .ach-subtitle { font-size: 0.88rem; }
  .ach-badge { font-size: 0.76rem; padding: 5px 14px; }
  .ach-spark.s2 { font-size: 1.1rem; }
  .ach-spark.s4 { font-size: 0.9rem; }
}


/* ============================================================
   MONTH SELECTOR (Guru)
   ============================================================ */

.month-selector-wrap {
  margin-bottom: 20px;
}

.month-selector-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.month-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  overflow-x: auto;
  padding-bottom: 4px;
}

.month-chip {
  padding: 8px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: all var(--t-fast);
  font-family: inherit;
  white-space: nowrap;
  flex-shrink: 0;
}

.month-chip:hover {
  border-color: var(--sage);
  background: var(--bg-soft);
}

.month-chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 3px 10px rgba(26, 77, 58, 0.22);
}

@media (max-width: 720px) {
  .month-chip {
    padding: 7px 14px;
    font-size: 0.78rem;
  }
}


/* ============================================================
   PENDING NOTIFICATION & MODAL LIST
   ============================================================ */

/* Stat card clickable */
.stat-card.clickable {
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
}

.stat-card.clickable:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

/* Pending alert — clickable */
.pending-alert.clickable {
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
}

.pending-alert.clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(201, 169, 97, 0.28);
  background: linear-gradient(135deg, #fef3c7, #fce7ac);
}

.pending-alert-arrow {
  font-size: 1.4rem;
  color: var(--gold);
  font-weight: 700;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.pending-alert.clickable:hover .pending-alert-arrow {
  transform: translateX(4px);
}

/* Siswa card pending badge */
.siswa-pending-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: linear-gradient(135deg, var(--gold), #b08d3f);
  color: #fff;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 3px 10px rgba(201, 169, 97, 0.4);
  animation: pulseBadge 2s ease-in-out infinite;
}

@keyframes pulseBadge {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.siswa-card.has-pending {
  border-color: var(--gold);
  box-shadow: 0 4px 16px rgba(201, 169, 97, 0.18);
}

/* Modal Pending List */
.pending-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 420px;
  overflow-y: auto;
  padding: 4px 0;
}

.pending-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-soft);
  border: 1.5px solid var(--border-soft);
  border-radius: var(--r-md);
  text-decoration: none;
  color: inherit;
  transition: all var(--t-fast);
  cursor: pointer;
}

.pending-item:hover {
  background: var(--primary-softer);
  border-color: var(--primary);
  transform: translateX(3px);
  box-shadow: 0 4px 12px rgba(26, 77, 58, 0.1);
}

.pending-item-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.pending-item-info {
  flex: 1;
  min-width: 0;
}

.pending-item-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pending-item-count {
  font-size: 0.8rem;
  color: var(--pending-text);
  font-weight: 600;
}

.pending-item-arrow {
  font-size: 1.3rem;
  color: var(--primary);
  font-weight: 700;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.pending-item:hover .pending-item-arrow {
  transform: translateX(4px);
}

@media (max-width: 720px) {
  .siswa-pending-badge {
    font-size: 0.62rem;
    padding: 3px 8px;
  }
  .pending-item {
    padding: 12px 14px;
    gap: 10px;
  }
  .pending-item-avatar {
    width: 38px;
    height: 38px;
    font-size: 0.85rem;
  }
  .pending-item-name {
    font-size: 0.88rem;
  }
  .pending-item-count {
    font-size: 0.74rem;
  }
}


/* ============================================================
   FINAL POLISH
   ============================================================ */

/* Smooth scroll */
html { scroll-behavior: smooth; }

/* Back to top button */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  box-shadow: 0 6px 20px rgba(26, 77, 58, 0.3);
  transition: all var(--t);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--primary-dark);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 28px rgba(26, 77, 58, 0.4);
}

.back-to-top:active {
  transform: translateY(0) scale(0.96);
}

@media (max-width: 720px) {
  .back-to-top {
    bottom: 16px;
    right: 16px;
    width: 42px;
    height: 42px;
    font-size: 1.1rem;
  }
}

/* Better empty state */
.empty-history,
.progress-empty {
  position: relative;
}

/* Focus visible for accessibility */
*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

button:focus-visible,
a:focus-visible {
  outline-offset: 2px;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Print friendly */
@media print {
  .topbar, .back-to-top, .btn-logout, .btn-add, .tabs { display: none; }
  body { background: #fff; }
  .container { max-width: 100%; }
}


/* ============================================================
   F1 — Kelola Siswa (Reset Password & Hapus)
   ============================================================ */

.siswa-info-card {
  position: relative;
}

.btn-manage {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-soft);
  border: 1.5px solid var(--border);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  color: var(--text-muted);
  transition: all var(--t-fast);
  font-family: inherit;
}

.btn-manage:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
  transform: rotate(45deg);
}

.btn-manage:active {
  transform: rotate(45deg) scale(0.94);
}

/* Manage actions */
.manage-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.manage-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--bg-soft);
  border: 1.5px solid var(--border-soft);
  border-radius: var(--r-md);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: all var(--t-fast);
  width: 100%;
}

.manage-btn:hover {
  background: var(--primary-softer);
  border-color: var(--primary);
  transform: translateX(3px);
}

.manage-btn.danger:hover {
  background: var(--rejected-bg);
  border-color: #e8b8b8;
}

.manage-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--r-sm);
  background: var(--card);
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  border: 1px solid var(--border-soft);
}

.manage-btn.danger .manage-icon {
  background: #fef2f2;
  border-color: #fecaca;
}

.manage-info {
  flex: 1;
  min-width: 0;
}

.manage-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text);
  margin-bottom: 2px;
}

.manage-btn.danger .manage-title {
  color: var(--rejected-text);
}

.manage-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.manage-arrow {
  font-size: 1.2rem;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.2s;
}

.manage-btn:hover .manage-arrow {
  transform: translateX(4px);
  color: var(--primary);
}

/* Modal danger header */
.modal-header-danger h2 {
  color: var(--rejected-text);
}

.delete-warning-list {
  list-style: none;
  padding: 14px 16px;
  background: var(--rejected-bg);
  border-radius: var(--r);
  border-left: 3px solid var(--status-rasib);
  margin-bottom: 8px;
}

.delete-warning-list li {
  font-size: 0.85rem;
  color: var(--rejected-text);
  padding: 4px 0;
  line-height: 1.5;
}

.delete-warning-list li strong {
  background: rgba(139, 40, 40, 0.12);
  padding: 1px 6px;
  border-radius: 4px;
}

/* Button danger */
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 22px;
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
  background: var(--status-rasib);
  border: none;
  border-radius: var(--r);
  cursor: pointer;
  font-family: inherit;
  transition: all var(--t-fast);
}

.btn-danger:hover:not(:disabled) {
  background: #a85555;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(199, 108, 108, 0.3);
}

.btn-danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 720px) {
  .btn-manage {
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }
  .manage-btn {
    padding: 14px;
    gap: 12px;
  }
  .manage-icon {
    width: 38px;
    height: 38px;
    font-size: 1rem;
  }
}


/* ============================================================
   F2 — Backup & Section Header
   ============================================================ */

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  margin-top: 32px;
  flex-wrap: wrap;
  animation: fadeUp 0.5s ease 0.15s backwards;
}

.section-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.section-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.section-actions .btn-secondary,
.section-actions .btn-primary {
  padding: 11px 18px;
  font-size: 0.88rem;
}

.backup-info-box {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  background: var(--primary-softer);
  border: 1px solid var(--sage);
  border-radius: var(--r);
  margin-bottom: 16px;
}

.backup-info-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  line-height: 1;
}

.backup-info-text {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.backup-info-text strong {
  color: var(--primary);
  font-weight: 700;
}

.btn-create-backup {
  width: 100%;
  justify-content: center;
  margin-bottom: 20px;
}

.backup-list-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}

.backup-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-soft);
  padding: 3px 10px;
  border-radius: var(--r-pill);
}

.backup-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
}

.backup-loading,
.backup-empty {
  text-align: center;
  padding: 30px 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.backup-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  transition: all var(--t-fast);
}

.backup-item:hover {
  background: var(--primary-softer);
  border-color: var(--sage);
}

.backup-item-main {
  flex: 1;
  min-width: 0;
}

.backup-item-date {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 5px;
}

.backup-item-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.backup-type {
  padding: 2px 8px;
  border-radius: var(--r-pill);
  font-weight: 700;
  font-size: 0.68rem;
}

.backup-type.auto {
  background: var(--primary-soft);
  color: var(--primary);
}

.backup-type.manual {
  background: #fbf0d0;
  color: #8a6d15;
}

.backup-size {
  font-family: ui-monospace, monospace;
  font-weight: 600;
}

.backup-counts {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.backup-item-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.btn-backup-download,
.btn-backup-delete {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 0.9rem;
  display: grid;
  place-items: center;
  transition: all var(--t-fast);
  font-family: inherit;
  color: var(--text-muted);
}

.btn-backup-download:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-backup-delete:hover {
  background: var(--rejected-bg);
  border-color: #e8b8b8;
  color: var(--rejected-text);
}

@media (max-width: 720px) {
  .section-actions {
    width: 100%;
  }
  .section-actions .btn-secondary,
  .section-actions .btn-primary {
    flex: 1;
    justify-content: center;
  }
  .backup-item {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .backup-item-actions {
    justify-content: flex-end;
  }
}

/* ============================================================
   F3 — Chart Trend (Compact)
   ============================================================ */

.chart-card {
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-xs);
  animation: fadeUp 0.5s ease 0.2s backwards;
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.chart-header h3 {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
  letter-spacing: -0.01em;
}

.chart-header p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.chart-legend {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.chart-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.chart-container {
  width: 100%;
  overflow-x: auto;
}

.chart-svg {
  width: 100%;
  height: auto;
  max-height: 150px;
  display: block;
  min-width: 420px;
}

.chart-grid-line {
  stroke: var(--border-soft);
  stroke-width: 1;
  stroke-dasharray: 3 4;
}

.chart-axis-label {
  font-size: 9px;
  fill: var(--text-light);
  font-family: inherit;
}

.chart-month-label {
  font-size: 10px;
  fill: var(--text-muted);
  font-weight: 600;
  font-family: inherit;
}

.chart-line {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-line-mur { stroke: var(--primary); }
.chart-line-haf { stroke: var(--gold); }

.chart-area-mur {
  fill: var(--primary);
  opacity: 0.08;
}
.chart-area-haf {
  fill: var(--gold);
  opacity: 0.06;
}

.chart-dot {
  stroke: #fff;
  stroke-width: 1.5;
}

.chart-dot-mur { fill: var(--primary); }
.chart-dot-haf { fill: var(--gold); }

.chart-dot-label {
  font-size: 9px;
  font-weight: 700;
  font-family: inherit;
}
.chart-dot-label-mur { fill: var(--primary); }

.chart-empty {
  text-align: center;
  padding: 30px 16px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

@media (max-width: 720px) {
  .chart-card {
    padding: 14px 14px;
  }
  .chart-header h3 {
    font-size: 0.85rem;
  }
  .chart-legend {
    font-size: 0.68rem;
    gap: 8px;
  }
  .chart-svg {
    max-height: 130px;
  }
}

/* ============================================================
   F4 — Badge Highlight + Modal + Toast
   ============================================================ */

/* Highlight Card */
.badge-highlight {
  position: relative;
  background: linear-gradient(135deg, var(--primary-softer), #ffffff);
  border: 1.5px solid var(--sage);
  border-radius: var(--r-lg);
  padding: 16px 20px 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-xs);
  animation: fadeUp 0.5s ease 0.15s backwards;
  transition: all var(--t);
}

.badge-highlight.clickable {
  cursor: pointer;
}

.badge-highlight.clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26, 77, 58, 0.12);
  border-color: var(--primary);
}

.badge-highlight-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.badge-highlight-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.badge-highlight-icon {
  font-size: 1.2rem;
}

.badge-highlight-counter {
  padding: 4px 12px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--r-pill);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge-highlight-body {
  margin-bottom: 12px;
}

.badge-highlight-loading,
.badge-highlight-empty {
  text-align: center;
  padding: 8px 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.badge-pill-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--card);
  border: 1px solid var(--sage);
  border-radius: var(--r-pill);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  transition: all var(--t-fast);
}

.badge-pill:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
}

.badge-pill-emoji {
  font-size: 1rem;
  line-height: 1;
}

.badge-pill-title {
  white-space: nowrap;
}

.badge-pill-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  background: var(--primary-soft);
  border: 1px solid var(--sage);
  border-radius: var(--r-pill);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary);
}

.badge-highlight-footer {
  padding-top: 12px;
  border-top: 1px dashed var(--sage);
}

.badge-next {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.badge-next-emoji {
  font-size: 1.1rem;
  line-height: 1;
  opacity: 0.5;
  filter: grayscale(0.6);
}

.badge-next-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  flex: 1;
  min-width: 180px;
}

.badge-next-text strong {
  color: var(--text);
  font-weight: 700;
}

.badge-next-progress {
  color: var(--primary);
  font-weight: 700;
  margin-left: 2px;
}

.badge-next-bar {
  width: 100%;
  height: 4px;
  background: var(--border-soft);
  border-radius: var(--r-pill);
  overflow: hidden;
  margin-top: 4px;
}

.badge-next-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-light), var(--primary));
  border-radius: var(--r-pill);
  transition: width 0.8s ease;
}

.badge-next-complete {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
  text-align: center;
  padding: 4px 0;
}

.badge-highlight-arrow {
  display: none;
}

@media (min-width: 480px) {
  .badge-highlight-arrow {
    display: block;
    position: absolute;
    bottom: 18px;
    right: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--primary);
    opacity: 0.7;
    transition: all var(--t-fast);
  }
  .badge-highlight.clickable:hover .badge-highlight-arrow {
    opacity: 1;
    transform: translateX(4px);
  }
}

/* Modal Badge Grid */
.badge-modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 2px;
}

.badge-modal-item {
  text-align: center;
  padding: 14px 10px 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-soft);
  background: var(--bg-soft);
  transition: all var(--t-fast);
}

.badge-modal-item.unlocked {
  background: linear-gradient(135deg, var(--primary-softer), #ffffff);
  border-color: var(--sage);
}

.badge-modal-item.unlocked:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(26, 77, 58, 0.12);
}

.badge-modal-item.locked {
  opacity: 0.55;
}

.badge-modal-emoji {
  font-size: 1.8rem;
  line-height: 1;
  margin-bottom: 8px;
}

.badge-modal-item.locked .badge-modal-emoji {
  filter: grayscale(1);
  opacity: 0.5;
}

.badge-modal-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.25;
}

.badge-modal-item.locked .badge-modal-title {
  color: var(--text-muted);
}

.badge-modal-desc {
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 6px;
  min-height: 28px;
}

.badge-modal-progress {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--r-pill);
  background: var(--card);
  color: var(--text-muted);
  display: inline-block;
}

.badge-modal-item.unlocked .badge-modal-progress {
  background: var(--primary);
  color: #fff;
}

/* Toast */
.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, #ffffff, var(--primary-softer));
  border: 2px solid var(--primary);
  border-radius: var(--r-lg);
  padding: 14px 20px;
  box-shadow: 0 10px 40px rgba(26, 77, 58, 0.22);
  transform: translateX(150%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 240px;
  max-width: 340px;
  pointer-events: auto;
}

.toast.show {
  transform: translateX(0);
}

.toast-emoji {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
  animation: toastBounce 0.6s ease;
}

@keyframes toastBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2) rotate(-8deg); }
}

.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 3px;
}

.toast-badge-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

@media (max-width: 720px) {
  .badge-highlight {
    padding: 14px 16px 16px;
  }
  .badge-highlight-title {
    font-size: 0.88rem;
  }
  .badge-pill {
    font-size: 0.72rem;
    padding: 5px 10px;
  }
  .badge-pill-emoji {
    font-size: 0.9rem;
  }
  .badge-next-text {
    font-size: 0.72rem;
  }
  .badge-modal-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .badge-modal-emoji {
    font-size: 1.5rem;
  }
  .badge-modal-title {
    font-size: 0.75rem;
  }
  .toast-container {
    top: 68px;
    right: 12px;
    left: 12px;
  }
  .toast {
    min-width: 0;
    width: 100%;
    max-width: none;
  }
}


/* ============================================================
   F5 — WhatsApp Integration
   ============================================================ */

.siswa-info-card {
  position: relative;
}

.siswa-info-hp {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 6px;
  font-weight: 500;
}

.siswa-actions {
  position: absolute;
  top: 18px;
  right: 18px;
  display: flex;
  gap: 8px;
}

.btn-manage-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-soft);
  border: 1.5px solid var(--border);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  color: var(--text-muted);
  transition: all var(--t-fast);
  font-family: inherit;
  padding: 0;
}

.btn-manage-btn:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
  transform: scale(1.08);
}

/* WA Modal */
.wa-no-phone {
  display: flex;
  gap: 14px;
  padding: 16px;
  background: #fef3c7;
  border: 1px solid #fbbf24;
  border-radius: var(--r-md);
  margin-bottom: 16px;
  align-items: flex-start;
}

.wa-no-phone-icon {
  font-size: 1.8rem;
  line-height: 1;
  flex-shrink: 0;
}

.wa-no-phone-text {
  flex: 1;
  min-width: 0;
}

.wa-no-phone-text strong {
  display: block;
  color: var(--pending-text);
  font-size: 0.92rem;
  margin-bottom: 4px;
}

.wa-no-phone-text p {
  font-size: 0.82rem;
  color: #92400e;
  line-height: 1.5;
  margin-bottom: 10px;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.82rem;
}

/* Template Grid */
.wa-templates {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 4px;
}

.wa-template {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg-soft);
  border: 1.5px solid var(--border-soft);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all var(--t-fast);
  font-family: inherit;
  text-align: left;
}

.wa-template:hover {
  border-color: var(--sage);
  background: var(--primary-softer);
}

.wa-template.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 3px 10px rgba(26, 77, 58, 0.2);
}

.wa-template-icon {
  font-size: 1.2rem;
  line-height: 1;
  flex-shrink: 0;
}

.wa-template-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

.wa-template.active .wa-template-name {
  color: #fff;
}

#waMessage {
  font-family: inherit;
  font-size: 0.85rem;
  line-height: 1.5;
  min-height: 160px;
}

@media (max-width: 720px) {
  .siswa-actions {
    top: 14px;
    right: 14px;
  }
  .btn-manage-btn {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }
  .wa-templates {
    grid-template-columns: 1fr;
  }
}