/* ============================================================
   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(--heading, 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(--heading, 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(--heading, 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(--heading, 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(--heading, 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(--heading, 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(--heading, 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(--heading, 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(--heading, 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(--heading, 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(--heading, 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(--heading, 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(--heading, 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(--heading, 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;
  }
}


/* ============================================================
   T4 — Logo click, Footer simetris, Gender icon
   ============================================================ */

/* Logo clickable */
.logo {
  transition: opacity 0.2s;
}

.logo:hover {
  opacity: 0.8;
}

/* Footer kontak — WA & Email simetris */
.contact-links a {
  min-width: 130px;
  justify-content: center;
}

/* Gender icon */
/* Gender icon — SVG */
.gender-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
  vertical-align: middle;
  margin-left: 6px;
  user-select: none;
}

.gender-icon svg {
  width: 14px;
  height: 14px;
  display: block;
}

.gender-icon.male {
  background: rgba(20, 61, 46, 0.12);
  color: #143d2e;
}

.gender-icon.female {
  background: rgba(184, 147, 90, 0.2);
  color: #8a6d15;
}

/* Siswa card: nama + gender icon */
.siswa-nama {
  display: inline-flex;
  align-items: center;
  gap: 0;
}

/* Detail siswa info card */
.siswa-info-text h1 {
  display: inline-flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
}

@media (max-width: 720px) {
  .contact-links a {
    min-width: 110px;
  }
  .gender-icon {
    width: 18px;
    height: 18px;
    font-size: 0.65rem;
  }
}

/* Gender picker di modal tambah siswa */
.gender-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.gender-option {
  cursor: pointer;
  position: relative;
}

.gender-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.gender-option-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--bg-soft);
  border: 1.5px solid var(--border-soft);
  border-radius: var(--r);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--t-fast);
}

.gender-option:hover .gender-option-box {
  border-color: var(--sage);
  background: var(--primary-softer);
}

.gender-option input[type="radio"]:checked + .gender-option-box {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 3px 10px rgba(26, 77, 58, 0.2);
}

.gender-option input[type="radio"]:checked + .gender-option-box .gender-symbol.male,
.gender-option input[type="radio"]:checked + .gender-option-box .gender-symbol.female {
  background: rgba(255,255,255,0.22);
  color: #fff;
}

.gender-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
}

.gender-symbol svg {
  width: 18px;
  height: 18px;
  display: block;
}

.gender-symbol.male {
  background: rgba(20, 61, 46, 0.12);
  color: #143d2e;
}

.gender-symbol.female {
  background: rgba(184, 147, 90, 0.2);
  color: #8a6d15;
}

.gender-option input[type="radio"]:checked + .gender-option-box .gender-symbol.male,
.gender-option input[type="radio"]:checked + .gender-option-box .gender-symbol.female {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

/* User gender icon di topbar */
.user-gender-icon {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-left: 6px;
  line-height: 1;
}

.user-gender-icon:empty {
  display: none;
}

.user-gender-icon .gender-icon {
  margin-left: 0;
  width: 18px;
  height: 18px;
}

.user-gender-icon .gender-icon svg {
  width: 11px;
  height: 11px;
}

@media (max-width: 720px) {
  .user-gender-icon .gender-icon {
    width: 16px;
    height: 16px;
  }
  .user-gender-icon .gender-icon svg {
    width: 10px;
    height: 10px;
  }
}


/* ============================================================
   T5 — Toast Notification & Polish
   ============================================================ */

.toast-container {
  position: fixed;
  top: 76px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 380px;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(20, 30, 20, 0.14);
  border-left: 3px solid var(--primary);
  transform: translateX(150%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto;
  min-width: 260px;
}

.toast.show { transform: translateX(0); }

.toast-success { border-left-color: #16a34a; }
.toast-error { border-left-color: #dc2626; }
.toast-info { border-left-color: var(--primary); }

.toast-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  background: var(--primary);
}

.toast-success .toast-icon { background: #16a34a; }
.toast-error .toast-icon { background: #dc2626; }

.toast-content {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.5;
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}

@media (max-width: 720px) {
  .toast-container {
    top: 68px;
    right: 12px;
    left: 12px;
    max-width: none;
  }
  .toast {
    min-width: 0;
    width: 100%;
  }
}

/* ============================================================
   UI MODAL — Confirm & Prompt (Elegan)
   ============================================================ */

.ui-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.ui-modal.show { opacity: 1; }

.ui-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 30, 20, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.ui-modal-card {
  position: relative;
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  padding: 32px 28px 24px;
  box-shadow: 0 24px 60px rgba(20, 30, 20, 0.24);
  text-align: center;
  transform: scale(0.92) translateY(10px);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.ui-modal.show .ui-modal-card {
  transform: scale(1) translateY(0);
}

.ui-modal-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  font-size: 1.6rem;
  line-height: 1;
}

.ui-modal-icon.question {
  background: linear-gradient(135deg, #f0f5e9, #dbeada);
}

.ui-modal-icon.danger {
  background: linear-gradient(135deg, #fef2f2, #fee2e2);
}

.ui-modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1a2520;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

.ui-modal-message {
  font-size: 0.9rem;
  color: #4d5c54;
  line-height: 1.6;
  margin-bottom: 24px;
  white-space: normal;
}

.ui-modal-input-wrap {
  margin-bottom: 20px;
  text-align: left;
}

.ui-modal-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 0.92rem;
  border: 1.5px solid #e8e2d2;
  border-radius: 10px;
  background: #f7f4ee;
  color: #1a2520;
  outline: none;
  font-family: inherit;
  transition: all 0.2s;
  box-sizing: border-box;
}

.ui-modal-input:focus {
  border-color: #1a4d3a;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(26, 77, 58, 0.1);
}

.ui-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.ui-modal-btn {
  flex: 1;
  padding: 12px 20px;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  border: none;
}

.ui-modal-btn.cancel {
  background: #f7f4ee;
  color: #4d5c54;
  border: 1.5px solid #e8e2d2;
}

.ui-modal-btn.cancel:hover {
  background: #efe9dc;
  border-color: #d8d0be;
}

.ui-modal-btn.confirm {
  background: linear-gradient(135deg, #1a4d3a, #2d7a5a);
  color: #fff;
}

.ui-modal-btn.confirm:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(26, 77, 58, 0.28);
}

.ui-modal-btn.confirm.danger {
  background: linear-gradient(135deg, #c76c6c, #a85555);
}

.ui-modal-btn.confirm.danger:hover {
  box-shadow: 0 6px 20px rgba(199, 108, 108, 0.3);
}

.ui-modal-btn:active { transform: scale(0.98); }

@media (max-width: 480px) {
  .ui-modal-card {
    padding: 26px 20px 18px;
    border-radius: 14px;
  }
  .ui-modal-icon {
    width: 48px; height: 48px;
    font-size: 1.4rem;
    margin-bottom: 14px;
  }
  .ui-modal-title { font-size: 1.05rem; }
  .ui-modal-message { font-size: 0.85rem; }
  .ui-modal-btn { padding: 11px 16px; font-size: 0.85rem; }
}

/* Toast posisi final */
.toast-container {
  position: fixed;
  top: 76px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 380px;
}

@media (max-width: 720px) {
  .toast-container {
    top: 68px;
    left: 12px;
    right: 12px;
    max-width: none;
    align-items: center;
  }
  .toast {
    min-width: 0;
    width: 100%;
    max-width: 400px;
  }
}


/* ============================================================
   JUZ OVERRIDE — Atur Juz Manual
   ============================================================ */

.juz-override-info {
  background: var(--primary-softer);
  border: 1px solid var(--sage);
  border-radius: var(--r);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.juz-override-info p {
  margin: 0;
}

.juz-override-info strong {
  color: var(--primary);
  font-weight: 700;
}

.juz-override-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 4px;
}

.juz-override-loading {
  text-align: center;
  padding: 30px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.juz-override-item {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-sm);
  transition: all var(--t-fast);
}

.juz-override-item.is-manual {
  background: linear-gradient(135deg, var(--primary-softer), #fff);
  border-color: var(--sage);
}

.juz-override-label {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text);
}

.juz-override-preview {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: right;
}

.juz-override-select {
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: all var(--t-fast);
  min-width: 100px;
}

.juz-override-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 77, 58, 0.1);
}

.juz-override-select option[value="full"] {
  font-weight: 700;
}

/* Badge "Manual" di progress per juz */
.juz-manual-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--gold);
  color: #fff;
  border-radius: var(--r-pill);
  vertical-align: middle;
}

.juz-progress-label {
  display: inline-flex;
  align-items: center;
}

/* Tombol khusus juz */
#juzBtn {
  background: linear-gradient(135deg, var(--primary-softer), #fff);
  border-color: var(--sage);
}

#juzBtn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

@media (max-width: 720px) {
  .juz-override-item {
    grid-template-columns: 50px 1fr auto;
    padding: 8px 10px;
    gap: 8px;
  }
  .juz-override-label {
    font-size: 0.78rem;
  }
  .juz-override-select {
    font-size: 0.72rem;
    padding: 5px 8px;
    min-width: 80px;
  }
  .juz-override-preview {
    display: none;
  }
  .juz-override-list {
    max-height: 320px;
  }
}


/* ============================================================
   TAB BAR — Navigasi Horizontal Sticky
   ============================================================ */

.tabbar {
  position: sticky;
  top: 68px;
  z-index: 90;
  background: rgba(247, 244, 238, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.tabbar::-webkit-scrollbar { display: none; }

.tabbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  gap: 2px;
  min-width: max-content;
}

.tabbar-btn {
  padding: 14px 16px;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  white-space: nowrap;
  transition: color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  letter-spacing: -0.01em;
}

.tabbar-btn:hover { color: var(--text); }

.tabbar-btn.active { color: var(--primary); }

.tabbar-btn.active::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: -1px;
  height: 2.5px;
  background: var(--primary);
  border-radius: 3px 3px 0 0;
}

.tabbar-btn .tab-icon {
  font-size: 1rem;
  line-height: 1;
}

.tab-content {
  animation: tabFadeIn 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-content[hidden] { display: none; }

@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Coming Soon Placeholder */
.coming-soon {
  text-align: center;
  padding: 90px 24px;
  max-width: 420px;
  margin: 0 auto;
}

.coming-soon-icon {
  font-size: 4rem;
  line-height: 1;
  margin-bottom: 22px;
  opacity: 0.55;
  display: inline-block;
  animation: floatIcon 3s ease-in-out infinite;
}

@keyframes floatIcon {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

.coming-soon h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--heading, var(--text));
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.coming-soon p {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--text-muted);
}

.coming-soon-badge {
  display: inline-block;
  margin-top: 22px;
  padding: 6px 16px;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: var(--r-pill);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 720px) {
  .tabbar { top: 60px; }
  .tabbar-inner { padding: 0 16px; }
  .tabbar-btn {
    padding: 12px 12px;
    font-size: 0.82rem;
  }
  .tabbar-btn.active::after {
    left: 12px;
    right: 12px;
  }
  .coming-soon { padding: 60px 20px; }
  .coming-soon-icon { font-size: 3rem; }
  .coming-soon h2 { font-size: 1.2rem; }
}

@media (max-width: 380px) {
  .tabbar-btn {
    padding: 11px 10px;
    font-size: 0.78rem;
    gap: 5px;
  }
  .tabbar-btn .tab-icon { font-size: 0.9rem; }
}


/* ============================================================
   FAB — Floating Action Button
   ============================================================ */

.fab-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 85;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.fab-main {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  border: none;
  font-size: 1.6rem;
  font-weight: 300;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(26, 77, 58, 0.32);
  display: grid;
  place-items: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  line-height: 1;
  padding: 0;
  font-family: inherit;
}

.fab-main:hover { transform: scale(1.06); }
.fab-main.open { transform: rotate(45deg); }

.fab-menu {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
  animation: fabIn 0.25s ease;
}

@keyframes fabIn {
  from { opacity: 0; transform: translateY(10px) scale(0.9); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.fab-action {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: #fff;
  border: 1.5px solid var(--border-soft);
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(20, 30, 20, 0.1);
  transition: all 0.2s;
  white-space: nowrap;
}

.fab-action:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateX(-3px);
}

.fab-action-icon { font-size: 1.1rem; line-height: 1; }

/* Geser tombol back-to-top supaya tidak tabrakan dengan FAB */
.back-to-top {
  bottom: 96px;
}

@media (max-width: 720px) {
  .fab-container { bottom: 18px; right: 18px; }
  .fab-main { width: 52px; height: 52px; font-size: 1.5rem; }
  .fab-action { padding: 11px 16px; font-size: 0.82rem; }
  .back-to-top { bottom: 84px; right: 18px; }
}

/* Riwayat: expand toggle */
.riwayat-toggle {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 11px 16px;
  background: var(--bg-soft);
  border: 1.5px dashed var(--border);
  border-radius: var(--r);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.riwayat-toggle:hover {
  background: var(--primary-soft);
  border-color: var(--sage);
  border-style: solid;
}

.riwayat-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-soft);
}

.riwayat-section-title h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--heading, var(--text));
}

.riwayat-count-badge {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-soft);
  padding: 3px 10px;
  border-radius: var(--r-pill);
}


/* ============================================================
   GURU — Quick Actions di Dashboard
   ============================================================ */

.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
  animation: fadeUp 0.5s ease 0.2s backwards;
}

.quick-action-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: var(--card);
  border: 1.5px solid var(--border-soft);
  border-radius: var(--r-md);
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.quick-action-btn:hover {
  border-color: var(--primary);
  background: var(--primary-softer);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26, 77, 58, 0.1);
}

.quick-action-icon {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: var(--r);
  background: var(--primary-soft);
  display: grid;
  place-items: center;
}

.quick-action-text {
  flex: 1;
  min-width: 0;
}

.quick-action-text strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.quick-action-text span {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

@media (max-width: 640px) {
  .quick-actions { grid-template-columns: 1fr; }
  .quick-action-btn { padding: 14px 16px; gap: 12px; }
  .quick-action-icon { width: 40px; height: 40px; font-size: 1.4rem; }
  .quick-action-text strong { font-size: 0.88rem; }
  .quick-action-text span { font-size: 0.74rem; }
}


/* ============================================================
   FOOTER KONTAK — Contact Card (Redesign)
   ============================================================ */

.page-footer {
  margin-top: 56px;
  padding-top: 40px;
  border-top: 1px solid var(--border-soft);
  text-align: center;
}

.contact-card {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  background: var(--card);
  border: 1.5px solid var(--border-soft);
  border-radius: var(--r-lg);
  box-shadow: 0 2px 14px rgba(20, 30, 20, 0.05);
  margin-bottom: 20px;
  text-align: left;
  transition: all 0.25s;
}

.contact-card:hover {
  border-color: var(--sage);
  box-shadow: 0 6px 24px rgba(26, 77, 58, 0.1);
  transform: translateY(-2px);
}

.contact-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1.15rem;
  flex-shrink: 0;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 14px rgba(26, 77, 58, 0.22);
}

.contact-info {
  text-align: left;
  min-width: 0;
}

.contact-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.contact-role {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
}

.contact-role::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 3px rgba(26, 77, 58, 0.12);
}

.contact-prompt {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  font-style: italic;
}

.contact-links {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.contact-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 150px;
  padding: 12px 22px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  background: var(--card);
  border: 1.5px solid var(--border-soft);
  border-radius: var(--r);
  text-decoration: none;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.contact-links a:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(20, 30, 20, 0.08);
}

.contact-links a.wa-link {
  color: #128C7E;
  border-color: rgba(37, 211, 102, 0.3);
  background: rgba(37, 211, 102, 0.06);
}

.contact-links a.wa-link:hover {
  background: rgba(37, 211, 102, 0.12);
  border-color: #25D366;
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.18);
}

.contact-links a.email-link {
  color: var(--primary);
  border-color: var(--sage);
  background: var(--primary-softer);
}

.contact-links a.email-link:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
  box-shadow: 0 6px 18px rgba(26, 77, 58, 0.12);
}

.contact-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .page-footer { margin-top: 40px; padding-top: 28px; }
  .contact-card { padding: 14px 18px; gap: 12px; }
  .contact-avatar { width: 46px; height: 46px; font-size: 1rem; }
  .contact-name { font-size: 0.94rem; }
  .contact-role { font-size: 0.74rem; }
  .contact-prompt { font-size: 0.8rem; }
  .contact-links a { min-width: 130px; padding: 11px 18px; font-size: 0.84rem; }
}

@media (max-width: 380px) {
  .contact-links { flex-direction: column; align-items: stretch; }
  .contact-links a { min-width: 0; }
}

/* ============================================================ */
/* ACTIVITY CARD — Status Online Siswa (13 Okt 2026)           */
/* ============================================================ */
.activity-card {
  background: var(--card, #ffffff);
  border-radius: 20px;
  padding: 16px 18px;
  margin: 16px 0 20px;
  box-shadow: 0 2px 12px rgba(26, 77, 58, 0.08);
  border: 1px solid rgba(201, 214, 190, 0.4);
  animation: fadeUp 0.35s ease;
}

.activity-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.activity-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #b8c0b5;
  flex-shrink: 0;
  transition: background 0.3s ease;
}

.activity-dot.online {
  background: #2d7a5a;
  box-shadow: 0 0 0 0 rgba(45, 122, 90, 0.6);
  animation: pulse-online 2s infinite;
}

.activity-dot.recent {
  background: #6b7c70;
}

.activity-dot.stale {
  background: #c0392b;
}

.activity-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text, #1a3a2e);
  letter-spacing: -0.2px;
}

.activity-time {
  font-size: 0.82rem;
  color: var(--text-muted, #6b7c70);
  margin-left: 20px;
  margin-bottom: 0;
}

.activity-card.has-action .activity-time {
  margin-bottom: 12px;
}

.activity-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: 4px;
  padding: 10px 16px;
  background: #fef2f2;
  color: #c0392b;
  border: 1.5px solid #f5c6c6;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.activity-action:hover {
  background: #fde8e8;
  border-color: #e8a5a5;
  transform: translateY(-1px);
}

.activity-action:active {
  transform: translateY(0);
}

@keyframes pulse-online {
  0% {
    box-shadow: 0 0 0 0 rgba(45, 122, 90, 0.6);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(45, 122, 90, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(45, 122, 90, 0);
  }
}

/* Responsif: mobile */
@media (max-width: 480px) {
  .activity-card {
    padding: 14px 16px;
    border-radius: 18px;
  }
  .activity-text {
    font-size: 0.9rem;
  }
  .activity-time {
    font-size: 0.78rem;
    margin-left: 20px;
  }
  .activity-action {
    font-size: 0.84rem;
    padding: 9px 14px;
  }
}
/* ===== END ACTIVITY CARD ===== */

/* ═══════════════════════════════════════════════════════════ */
/* ICON SYSTEM — Hafalanku Premium Duotone Icons               */
/* Ditambahkan: 15 Okt 2026                                    */
/* Prinsip: SVG icons, ukuran konsisten, tap target ≥40px      */
/* ═══════════════════════════════════════════════════════════ */

:root {
  /* ─── Icon Sizes ─── */
  --icon-xs: 14px;    /* chip, badge inline */
  --icon-sm: 16px;    /* chevron, expand */
  --icon-md: 18px;    /* topbar, tombol kecil */
  --icon-lg: 20px;    /* modal, header action */
  --icon-xl: 22px;    /* tab bar, template */
  --icon-2xl: 24px;   /* FAB */
  --icon-hero: 44px;  /* empty state */

  /* ─── Tap Targets (area sentuh) ─── */
  --tap-sm: 38px;
  --tap-md: 40px;
  --tap-lg: 44px;
  --tap-xl: 56px;     /* FAB */

  /* ─── Bar Heights ─── */
  --topbar-h: 60px;
  --tabbar-h: 62px;

  /* ─── Icon Colors (ikut konteks) ─── */
  --icon-active: #1a4d3a;
  --icon-inactive: #9aa89c;
  --icon-gold: #c9a961;
  --icon-danger: #c0392b;
}

/* ═══════════════════════════════════════════════════════════ */
/* A. BASE SVG — semua icon Hafalanku                          */
/* ═══════════════════════════════════════════════════════════ */
.hk-icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  transition: color 0.2s ease, transform 0.2s ease;
}

.hk-icon-xs  { width: var(--icon-xs);  height: var(--icon-xs); }
.hk-icon-sm  { width: var(--icon-sm);  height: var(--icon-sm); }
.hk-icon-md  { width: var(--icon-md);  height: var(--icon-md); }
.hk-icon-lg  { width: var(--icon-lg);  height: var(--icon-lg); }
.hk-icon-xl  { width: var(--icon-xl);  height: var(--icon-xl); }
.hk-icon-2xl { width: var(--icon-2xl); height: var(--icon-2xl); }
.hk-icon-hero{ width: var(--icon-hero);height: var(--icon-hero); }

/* ═══════════════════════════════════════════════════════════ */
/* B. TAB BAR ICON                                             */
/* ═══════════════════════════════════════════════════════════ */

/* Struktur tab item: icon di atas, label di bawah */
.tabbar-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 6px;
  min-height: var(--tabbar-h);
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 12px;
  transition: background 0.2s ease;
  position: relative;
}

.tabbar-btn.active {
  background: rgba(26, 77, 58, 0.06);
}

/* SVG icon di tab bar */
.tabbar-btn svg {
  width: var(--icon-xl);
  height: var(--icon-xl);
  color: var(--icon-inactive);
  transition: color 0.2s ease, transform 0.2s ease;
  display: block;
}

.tabbar-btn.active svg {
  color: var(--icon-active);
}

/* Garis emas kecil di atas saat aktif (opsional) */
.tabbar-btn.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 2.5px;
  background: var(--gold);
  border-radius: 0 0 2px 2px;
}

/* Label teks di tab bar */
.tabbar-btn > span:not(.tab-icon) {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.1px;
  line-height: 1;
  color: var(--icon-inactive);
  transition: color 0.2s ease;
}

.tabbar-btn.active > span:not(.tab-icon) {
  color: var(--icon-active);
}

/* Fallback emoji (biar tetap rapi selama transisi) */
.tabbar-btn .tab-icon {
  font-size: 20px;
  line-height: 1;
  display: block;
  filter: grayscale(0.15);
}

/* ═══════════════════════════════════════════════════════════ */
/* C. TOPBAR ICON (back, logout)                               */
/* ═══════════════════════════════════════════════════════════ */

/* Tombol kembali */
.btn-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tap-sm);
  height: var(--tap-sm);
  border-radius: 10px;
  background: rgba(26, 77, 58, 0.06);
  border: none;
  color: var(--icon-active);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  padding: 0;
  font-size: 0; /* sembunyikan teks/emoji kalau ada */
}

.btn-back:hover {
  background: rgba(26, 77, 58, 0.12);
}

.btn-back:active {
  transform: scale(0.96);
}

.btn-back svg {
  width: var(--icon-md);
  height: var(--icon-md);
  stroke-width: 2.2;
}

/* Tombol logout */
.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  min-height: var(--tap-sm);
  background: #fef2f2;
  color: var(--icon-danger);
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: -0.1px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.btn-logout:hover {
  background: #fde8e8;
}

.btn-logout:active {
  transform: scale(0.97);
}

.btn-logout svg {
  width: var(--icon-sm);
  height: var(--icon-sm);
  stroke-width: 2.2;
}

/* ═══════════════════════════════════════════════════════════ */
/* D. TOMBOL AKSI HEADER (target, WA, settings)                */
/* ═══════════════════════════════════════════════════════════ */

.btn-manage-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tap-md);
  height: var(--tap-md);
  border-radius: 12px;
  background: #f0f5ec;
  border: 1px solid rgba(201, 214, 190, 0.5);
  color: var(--icon-active);
  cursor: pointer;
  padding: 0;
  font-size: 0;
  transition: all 0.2s ease;
}

.btn-manage-btn:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  transform: translateY(-2px);
}

.btn-manage-btn:active {
  transform: translateY(0);
}

.btn-manage-btn svg {
  width: var(--icon-lg);
  height: var(--icon-lg);
  stroke-width: 1.9;
  transition: color 0.2s ease;
}

/* ═══════════════════════════════════════════════════════════ */
/* E. STAT CARD ICON                                           */
/* ═══════════════════════════════════════════════════════════ */

.stat-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(26, 77, 58, 0.08);
  color: var(--icon-active);
  flex-shrink: 0;
}

.stat-card-icon svg {
  width: var(--icon-lg);
  height: var(--icon-lg);
  stroke-width: 1.9;
}

/* ═══════════════════════════════════════════════════════════ */
/* F. MODAL MANAGE ICON                                        */
/* ═══════════════════════════════════════════════════════════ */

.manage-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(26, 77, 58, 0.08);
  color: var(--icon-active);
  flex-shrink: 0;
}

.manage-icon svg {
  width: var(--icon-lg);
  height: var(--icon-lg);
  stroke-width: 1.85;
}

.manage-btn.danger .manage-icon {
  background: rgba(192, 57, 43, 0.1);
  color: var(--icon-danger);
}

/* ═══════════════════════════════════════════════════════════ */
/* G. WA TEMPLATE ICON                                         */
/* ═══════════════════════════════════════════════════════════ */

.wa-template-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(26, 77, 58, 0.08);
  color: var(--icon-active);
  flex-shrink: 0;
}

.wa-template.active .wa-template-icon {
  background: var(--primary);
  color: #ffffff;
}

.wa-template-icon svg {
  width: var(--icon-md);
  height: var(--icon-md);
  stroke-width: 2;
}

/* ═══════════════════════════════════════════════════════════ */
/* H. INLINE ICONS (chip, badge, chevron)                      */
/* ═══════════════════════════════════════════════════════════ */

/* Chevron (expand/collapse) */
.chevron-icon {
  width: var(--icon-sm);
  height: var(--icon-sm);
  color: var(--icon-inactive);
  transition: transform 0.25s ease;
  stroke-width: 2.2;
}

/* Icon di judul section / h2 / h3 */
.section-icon {
  width: var(--icon-md);
  height: var(--icon-md);
  color: var(--icon-active);
  stroke-width: 2;
  vertical-align: -3px;
  margin-right: 6px;
  display: inline-block;
}

/* ═══════════════════════════════════════════════════════════ */
/* I. FAB (Floating Action Button)                             */
/* ═══════════════════════════════════════════════════════════ */

.fab-btn svg {
  width: var(--icon-2xl);
  height: var(--icon-2xl);
  stroke-width: 2.4;
}

/* ═══════════════════════════════════════════════════════════ */
/* J. EMPTY STATE & COMING SOON                                */
/* ═══════════════════════════════════════════════════════════ */

.coming-soon-icon {
  color: var(--icon-active);
  opacity: 0.6;
  margin-bottom: 12px;
}

.coming-soon-icon svg {
  width: var(--icon-hero);
  height: var(--icon-hero);
  stroke-width: 1.5;
}

/* ═══════════════════════════════════════════════════════════ */
/* K. RESPONSIVE — mobile kecil                                */
/* ═══════════════════════════════════════════════════════════ */

@media (max-width: 380px) {
  :root {
    --icon-xl: 20px;   /* tab bar sedikit lebih kecil */
    --tabbar-h: 58px;
  }
  .tabbar-btn > span:not(.tab-icon) {
    font-size: 10px;
  }
  .tabbar-btn {
    padding: 6px 2px;
  }
}

/* ═══════════════════════════════════════════════════════════ */
/* L. TRANSISI AMAN — support 2 struktur (emoji + svg)         */
/* ═══════════════════════════════════════════════════════════ */

/* Kalau tab button punya SVG DAN emoji, sembunyikan emoji */
.tabbar-btn svg ~ .tab-icon {
  display: none;
}

/* Kalau tombol punya SVG, pastikan tidak ada teks aneh */
.btn-back svg,
.btn-manage-btn svg {
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════ */
/* END ICON SYSTEM                                             */
/* ═══════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════ */
/* TAB BAR FIX + STAT ICON ANIMATION — 15 Okt 2026             */
/* ═══════════════════════════════════════════════════════════ */

/* ─── 1. FIX TAB BAR: SPACING & UKURAN ─── */
.tabbar-inner {
  display: flex;
  justify-content: space-around;
  align-items: center;
  width: 100%;
  gap: 4px;
}

.tabbar-btn {
  flex: 1 1 0;
  max-width: 140px;
  min-width: 0;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 12px;
  transition: background 0.2s ease, transform 0.15s ease;
}

.tabbar-btn:active {
  transform: scale(0.95);
}

.tabbar-btn svg {
  width: 24px;
  height: 24px;
  transition: transform 0.2s ease;
}

.tabbar-btn.active svg {
  transform: scale(1.08);
}

.tabbar-btn > span:not(.tab-icon) {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: -0.15px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ─── 2. STAT CARD ICON — DASAR ─── */
.stat-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: rgba(26, 77, 58, 0.08);
  color: var(--primary);
  flex-shrink: 0;
  transition: background 0.25s ease;
}

.stat-card-icon svg {
  width: 22px;
  height: 22px;
  transition: transform 0.3s ease;
}

/* Hover efek halus di card */
.stat-card:hover .stat-card-icon {
  background: rgba(26, 77, 58, 0.13);
}

/* ─── 3. ANIMASI BUKU (HAFALAN) — Halaman Bernafas ─── */
@keyframes hk-book-page-breath {
  0%, 100% { opacity: 0.15; }
  50%      { opacity: 0.45; }
}

@keyframes hk-book-flip {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.03); }
}

.icon-anim-book {
  transform-origin: center;
  animation: hk-book-flip 3.5s ease-in-out infinite;
}

.icon-anim-book path[fill="currentColor"] {
  animation: hk-book-page-breath 3.5s ease-in-out infinite;
}

/* ─── 4. ANIMASI REFRESH (MUROJA'AH) — Berputar Pelan ─── */
@keyframes hk-refresh-rotate {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.icon-anim-refresh {
  transform-origin: center;
  animation: hk-refresh-rotate 6s linear infinite;
}

/* ─── 5. ANIMASI API (STREAK) — Hijau Menyala ─── */
@keyframes hk-fire-pulse {
  0%, 100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
  40% {
    transform: scale(1.1) translateY(-1px);
    opacity: 0.9;
  }
  70% {
    transform: scale(0.97) translateY(0);
    opacity: 1;
  }
}

@keyframes hk-fire-glow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(45, 122, 90, 0);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(45, 122, 90, 0.15);
  }
}

.icon-anim-fire {
  transform-origin: center bottom;
  animation: hk-fire-pulse 1.8s ease-in-out infinite;
}

/* Icon streak: warna hijau terang + glow */
.stat-card-icon.icon-fire-green {
  background: rgba(45, 122, 90, 0.12);
  color: var(--primary-light);
}

.stat-card-icon.icon-fire-green svg path[fill="currentColor"] {
  opacity: 0.35;
  animation: hk-book-page-breath 2s ease-in-out infinite;
}

/* ─── 6. REDUCED MOTION — matikan animasi kalau user prefer ─── */
@media (prefers-reduced-motion: reduce) {
  .icon-anim-book,
  .icon-anim-book path,
  .icon-anim-refresh,
  .icon-anim-fire,
  .stat-card-icon.icon-fire-green svg path {
    animation: none;
  }
  .tabbar-btn.active svg {
    transform: none;
  }
}

/* ─── 7. RESPONSIVE — mobile kecil ─── */
@media (max-width: 380px) {
  .tabbar-btn svg {
    width: 22px;
    height: 22px;
  }
  .tabbar-btn > span:not(.tab-icon) {
    font-size: 10.5px;
  }
  .tabbar-btn {
    padding: 7px 2px;
  }
  .stat-card-icon {
    width: 34px;
    height: 34px;
  }
  .stat-card-icon svg {
    width: 20px;
    height: 20px;
  }
}

/* ═══════════════════════════════════════════════════════════ */
/* END TAB BAR FIX + STAT ICON ANIMATION                        */
/* ═══════════════════════════════════════════════════════════ */

/* ─── ANIMASI PIALA ACHIEVEMENT — 15 Okt 2026 ─── */
@keyframes hk-trophy-float {
  0%, 100% {
    transform: translateY(0);
    filter: drop-shadow(0 6px 12px rgba(168, 124, 43, 0.25));
  }
  50% {
    transform: translateY(-5px);
    filter: drop-shadow(0 10px 20px rgba(224, 185, 90, 0.5));
  }
}

.ach-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
}

.ach-icon svg {
  width: 52px;
  height: 52px;
  animation: hk-trophy-float 3.2s ease-in-out infinite;
}

.ach-badge {
  display: inline-block;
  margin-top: 10px;
  padding: 8px 22px;
  background: linear-gradient(135deg, #5a3d12 0%, #3a2608 100%);
  color: #f5d987;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 14px rgba(90, 61, 18, 0.35), inset 0 1px 0 rgba(245, 217, 135, 0.3);
  border: 1px solid rgba(245, 217, 135, 0.25);
}

@media (prefers-reduced-motion: reduce) {
  .ach-icon svg {
    animation: none;
  }
}

/* ═══════════════════════════════════════════════════════════ */
/* FOOTER PROFESIONAL — 15 Okt 2026                            */
/* ═══════════════════════════════════════════════════════════ */

/* ─── FOOTER DASHBOARD (siswa.html) ─── */
.page-footer {
  margin-top: 40px;
  padding: 24px 0 20px;
  border-top: 1px solid rgba(201, 214, 190, 0.5);
}

.footer-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.footer-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.footer-avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(26, 77, 58, 0.2);
}

.footer-profile-text {
  min-width: 0;
  overflow: hidden;
}

.footer-name {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 2px;
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.footer-role {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
}

.footer-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.footer-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
  font-family: inherit;
}

.footer-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.footer-btn-wa {
  background: var(--primary);
  color: #ffffff;
  border: 1px solid var(--primary);
}

.footer-btn-wa:hover {
  background: var(--primary-light);
  border-color: var(--primary-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(26, 77, 58, 0.25);
}

.footer-btn-email {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--sage);
}

.footer-btn-email:hover {
  background: rgba(26, 77, 58, 0.06);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.footer-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(201, 214, 190, 0.6) 50%, transparent 100%);
  margin: 0 0 14px;
}

.footer-copy {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0;
  letter-spacing: 0.1px;
}

/* ─── FOOTER LOGIN (index.html & ganti-password.html) ─── */
.login-footer-new {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid rgba(201, 214, 190, 0.4);
}

.login-footer-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.login-footer-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(26, 77, 58, 0.18);
}

.login-footer-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 2px;
}

.login-footer-role {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin: 0;
}

.login-footer-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.login-footer-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  font-family: inherit;
}

.login-footer-btn svg {
  width: 14px;
  height: 14px;
}

.login-footer-btn-wa {
  background: var(--primary);
  color: #ffffff;
}

.login-footer-btn-wa:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
}

.login-footer-btn-email {
  background: rgba(26, 77, 58, 0.06);
  color: var(--primary);
  border: 1px solid var(--sage);
}

.login-footer-btn-email:hover {
  background: rgba(26, 77, 58, 0.12);
  transform: translateY(-1px);
}

.login-footer-copy {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 560px) {
  .footer-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .footer-profile { width: 100%; }
  .footer-actions { width: 100%; }
  .footer-btn { flex: 1; justify-content: center; }
}

@media (max-width: 380px) {
  .footer-name { font-size: 0.95rem; }
  .footer-role { font-size: 0.78rem; }
  .footer-btn { font-size: 0.8rem; padding: 8px 12px; }
}

/* ═══════════════════════════════════════════════════════════ */
/* END FOOTER PROFESIONAL                                       */
/* ═══════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════ */
/* PWA INSTALL BANNER — 16 Okt 2026                            */
/* ═══════════════════════════════════════════════════════════ */

.hk-install-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(150%);
  width: calc(100% - 32px);
  max-width: 440px;
  background: #ffffff;
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 12px 32px rgba(26, 77, 58, 0.22), 0 0 0 1px rgba(201, 214, 190, 0.4);
  z-index: 9999;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

.hk-install-banner.show {
  transform: translateX(-50%) translateY(0);
}

.hk-install-content {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.hk-install-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(26, 77, 58, 0.2);
}

.hk-install-text {
  flex: 1;
  min-width: 0;
}

.hk-install-text strong {
  display: block;
  font-size: 0.94rem;
  color: var(--text);
  margin-bottom: 3px;
  letter-spacing: -0.2px;
}

.hk-install-text span {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.hk-install-text b {
  color: var(--primary);
  font-weight: 700;
}

.hk-install-actions {
  display: flex;
  gap: 8px;
}

.hk-install-btn-primary,
.hk-install-btn-secondary {
  flex: 1;
  padding: 10px 16px;
  border-radius: 11px;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  letter-spacing: -0.1px;
}

.hk-install-btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(26, 77, 58, 0.25);
}

.hk-install-btn-primary:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
}

.hk-install-btn-secondary {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid rgba(201, 214, 190, 0.7);
}

.hk-install-btn-secondary:hover {
  background: rgba(26, 77, 58, 0.05);
  color: var(--text);
}

@media (max-width: 380px) {
  .hk-install-banner {
    padding: 14px;
    bottom: 14px;
  }
  .hk-install-text strong { font-size: 0.88rem; }
  .hk-install-text span { font-size: 0.72rem; }
  .hk-install-btn-primary,
  .hk-install-btn-secondary { padding: 9px 12px; font-size: 0.82rem; }
}

/* ═══════════════════════════════════════════════════════════ */
/* FASE 1 — BOTTOM TASKBAR (GLASSMORPHISM) & ONLINE DOT         */
/* ═══════════════════════════════════════════════════════════ */

/* 1. Beri jarak di bawah body agar konten tidak tertutup taskbar */
body.dashboard-page {
  padding-bottom: calc(72px + env(safe-area-inset-bottom)) !important;
}

/* 2. Style Taskbar Bawah */
.tabbar {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  top: auto !important;
  z-index: 9999;
  background: rgba(247, 244, 234, 0.85) !important; /* Cream transparan */
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-top: 1px solid rgba(201, 214, 190, 0.6) !important;
  border-bottom: none !important;
  padding-bottom: env(safe-area-inset-bottom); /* Support iPhone home bar */
  box-shadow: 0 -4px 24px rgba(26, 77, 58, 0.06);
}

.tabbar-inner {
  max-width: 600px !important;
  margin: 0 auto;
  height: 64px;
  display: flex;
  justify-content: space-around;
  align-items: center;
}

/* Penyesuaian tombol tab di bawah */
.tabbar-btn {
  height: 100%;
  border-radius: 0;
  padding: 6px 4px;
  background: transparent;
}

.tabbar-btn.active {
  background: transparent; /* Hilangkan background kotak */
}

/* Garis emas di ATAS icon saat aktif (karena tabbar di bawah) */
.tabbar-btn.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: var(--gold);
  border-radius: 0 0 4px 4px;
}

/* 3. Online Dot (Menyatu dengan nama) */
.hk-online-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #b8c0b5; /* Default abu */
  margin-left: 6px;
  vertical-align: middle;
  position: relative;
  top: -1px;
  transition: background 0.3s ease;
}

.hk-online-dot.is-online {
  background: #2d7a5a; /* Hijau */
  box-shadow: 0 0 0 0 rgba(45, 122, 90, 0.6);
  animation: hk-dot-pulse 2s infinite;
}

.hk-online-dot.is-stale {
  background: #c0392b; /* Merah */
}

@keyframes hk-dot-pulse {
  0% { box-shadow: 0 0 0 0 rgba(45, 122, 90, 0.6); }
  70% { box-shadow: 0 0 0 6px rgba(45, 122, 90, 0); }
  100% { box-shadow: 0 0 0 0 rgba(45, 122, 90, 0); }
}

/* Sembunyikan activity-card lama agar tidak dobel (kita ganti dengan dot) */
#activityCard {
  display: none !important;
}

/* Perbaikan Jarak Dot & Teks Status */
.hk-online-dot {
  margin-left: 10px !important; /* Jarak pas dari nama */
  width: 10px !important;       /* Sedikit lebih besar agar jelas */
  height: 10px !important;
}

.hk-status-text {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
  letter-spacing: -0.1px;
}

.hk-status-text.is-online-text {
  color: var(--primary-light);
  font-weight: 600;
}

.hk-status-text.is-stale-text {
  color: var(--danger);
}

/* ═══════════════════════════════════════════════════════════ */
/* FIX FAB POSITION — Agar tidak tertutup Taskbar Bawah         */
/* ═══════════════════════════════════════════════════════════ */

.fab-container {
  position: fixed !important;
  /* Taskbar tingginya 64px + safe area (untuk iPhone). 
     Kita beri jarak 20px di atas taskbar */
  bottom: calc(84px + env(safe-area-inset-bottom)) !important; 
  right: 20px !important;
  z-index: 10000 !important; /* Harus lebih tinggi dari taskbar (9999) */
}

/* Khusus untuk halaman detail-siswa.html yang baru kita tambah FAB-nya */
#guruFabContainer {
  position: fixed !important;
  bottom: calc(84px + env(safe-area-inset-bottom)) !important;
  right: 20px !important;
  z-index: 10000 !important;
}

/* Sesuaikan tombol back-to-top agar tidak menabrak FAB */
.back-to-top {
  bottom: calc(150px + env(safe-area-inset-bottom)) !important;
}

/* ═══════════════════════════════════════════════════════════ */
/* BOTTOM SHEET MUROJAAH & HAFALAN                             */
/* ═══════════════════════════════════════════════════════════ */

/* Container Bottom Sheet */
.hk-bottom-sheet {
  position: fixed;
  bottom: -100%; /* Mulai dari bawah */
  left: 0;
  right: 0;
  height: 90vh; /* 90% tinggi layar */
  background: #ffffff;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
  z-index: 10000;
  transition: bottom 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

/* State saat terbuka */
.hk-bottom-sheet.show {
  bottom: 0;
}

/* Backdrop gelap di belakang */
.hk-bottom-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.hk-bottom-backdrop.show {
  opacity: 1;
  visibility: visible;
}

/* Header Bottom Sheet */
.hk-bs-header {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(201, 214, 190, 0.5);
  flex-shrink: 0;
}

.hk-bs-header h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--primary);
  margin: 0;
}

.hk-bs-close {
  background: #f0f5ec;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Body Bottom Sheet (Bisa di-scroll) */
.hk-bs-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
}

/* Footer Bottom Sheet (Tombol Simpan) */
.hk-bs-footer {
  padding: 16px 20px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(201, 214, 190, 0.5);
  background: #ffffff;
  border-radius: 0 0 24px 24px;
  flex-shrink: 0;
}

/* Grid Surat */
.hk-surat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.hk-surat-card {
  padding: 12px;
  border: 1.5px solid rgba(201, 214, 190, 0.6);
  border-radius: 12px;
  background: var(--cream-soft);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hk-surat-card.selected {
  border-color: var(--primary);
  background: rgba(26, 77, 58, 0.05);
}

.hk-surat-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
}

.hk-surat-ayat {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Bagian Surat Terpilih (Muncul di bawah grid) */
.hk-selected-section {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px dashed var(--sage);
  display: none; /* Sembunyi jika belum ada yang dipilih */
}

.hk-selected-section.active {
  display: block;
}

.hk-selected-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 10px;
}

.hk-selected-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: #fafbf8;
  border: 1px solid var(--sage);
  border-radius: 10px;
  margin-bottom: 8px;
}

.hk-selected-item-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.hk-status-select {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--sage);
  background: #ffffff;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  outline: none;
}

/* ═══════════════════════════════════════════════════════════ */
/* REVISI BOTTOM SHEET — Inline Status & Color Coding          */
/* ═══════════════════════════════════════════════════════════ */

/* Grid Surat */
.hk-surat-grid {
  display: grid;
  grid-template-columns: 1fr; /* Jadi 1 kolom agar lega dan muat dropdown */
  gap: 10px;
  margin-top: 12px;
}

.hk-surat-card {
  padding: 12px 14px;
  border: 1.5px solid rgba(201, 214, 190, 0.6);
  border-radius: 12px;
  background: var(--cream-soft);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.hk-surat-card:active {
  transform: scale(0.98);
}

.hk-surat-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hk-surat-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.hk-surat-ayat {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Dropdown Nilai Inline (Sembunyi jika belum dipilih) */
.hk-status-inline-wrap {
  display: none;
}

.hk-surat-card.selected .hk-status-inline-wrap {
  display: block;
}

.hk-status-inline-wrap select {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.1);
  background: #ffffff;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  outline: none;
  cursor: pointer;
}

/* --- Pewarnaan Kartu Sesuai Nilai --- */
/* Default: Hijau (Jayyid & di atasnya) */
.hk-surat-card.selected[data-status="Jayyid"],
.hk-surat-card.selected[data-status="Jayyid Jiddan"],
.hk-surat-card.selected[data-status="Mumtaz"],
.hk-surat-card.selected[data-status="Mumtaz Murtafi'"] {
  border-color: #2d7a5a;
  background: #f0f9f4;
}
.hk-surat-card.selected[data-status="Jayyid"] .hk-surat-name,
.hk-surat-card.selected[data-status="Jayyid Jiddan"] .hk-surat-name,
.hk-surat-card.selected[data-status="Mumtaz"] .hk-surat-name,
.hk-surat-card.selected[data-status="Mumtaz Murtafi'"] .hk-surat-name {
  color: #1a4d3a;
}

/* Default: Kuning (Maqbul) */
.hk-surat-card.selected[data-status="Maqbul"] {
  border-color: #d4a017;
  background: #fff9e6;
}
.hk-surat-card.selected[data-status="Maqbul"] .hk-surat-name {
  color: #7a5a10;
}

/* Default: Merah (Rasib) */
.hk-surat-card.selected[data-status="Rasib"] {
  border-color: #c0392b;
  background: #fdf2f2;
}
.hk-surat-card.selected[data-status="Rasib"] .hk-surat-name {
  color: #c0392b;
}

/* ═══════════════════════════════════════════════════════════ */
/* FIX TAMPILAN BOTTOM SHEET (JUZ & SURAT)                      */
/* ═══════════════════════════════════════════════════════════ */

/* 1. Perbaikan Tombol Juz (Jadikan Pill/Kotak) */
.hk-bottom-sheet .juz-tabs {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  margin-bottom: 20px !important;
}

.hk-bottom-sheet .juz-tab {
  padding: 8px 16px !important;
  background: #ffffff !important;
  border: 1.5px solid rgba(201, 214, 190, 0.8) !important;
  border-radius: 20px !important; /* Membuat ujung membulat */
  color: var(--text-muted) !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
  width: auto !important; /* Mencegah melebar penuh */
  display: inline-block !important;
}

/* Warna saat Juz Dipilih */
.hk-bottom-sheet .juz-tab.active {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(26, 77, 58, 0.2) !important;
}

/* 2. Perbaikan Kartu Surat (Paksa Rata Kiri & Rapi) */
.hk-bottom-sheet .hk-surat-card {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  text-align: left !important; /* Paksa rata kiri */
  padding: 14px 16px !important;
  background: #ffffff !important;
}

.hk-bottom-sheet .hk-surat-info {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important; /* Paksa rata kiri */
  text-align: left !important;
  width: 100% !important;
}

.hk-bottom-sheet .hk-surat-name {
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  color: var(--text) !important;
  margin-bottom: 4px !important;
  text-align: left !important;
}

.hk-bottom-sheet .hk-surat-ayat {
  font-size: 0.75rem !important;
  color: var(--text-muted) !important;
  text-align: left !important;
}

/* 3. Dropdown Nilai */
.hk-bottom-sheet .hk-status-inline-wrap {
  display: none;
  margin-left: 10px;
}

.hk-bottom-sheet .hk-surat-card.selected .hk-status-inline-wrap {
  display: block;
}

.hk-bottom-sheet .hk-status-inline-wrap select {
  padding: 8px 12px !important;
  border-radius: 10px !important;
  border: 1.5px solid var(--sage) !important;
  background: #ffffff !important;
  font-family: inherit !important;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  color: var(--primary) !important;
  cursor: pointer !important;
  outline: none !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%231a4d3a' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 10px center !important;
  padding-right: 32px !important;
}

/* ═══════════════════════════════════════════════════════════ */
/* BOTTOM SHEET HAFALAN (Form & Surat Terpilih)                */
/* ═══════════════════════════════════════════════════════════ */

/* Kartu Surat di Hafalan (Hanya 1 yang bisa aktif) */
.hk-bottom-sheet .hk-surat-card.selected-hafalan {
  border-color: var(--primary);
  background: rgba(26, 77, 58, 0.05);
  box-shadow: 0 0 0 2px rgba(26, 77, 58, 0.2);
}
.hk-bottom-sheet .hk-surat-card.selected-hafalan .hk-surat-name {
  color: var(--primary);
}

/* Form Input di Hafalan */
.hk-bottom-sheet .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.hk-bottom-sheet .form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.hk-bottom-sheet .form-group input[type="number"],
.hk-bottom-sheet .form-group textarea,
.hk-bottom-sheet .form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--sage);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9rem;
  background: #ffffff;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}

.hk-bottom-sheet .form-group input[type="number"]:focus,
.hk-bottom-sheet .form-group textarea:focus,
.hk-bottom-sheet .form-group select:focus {
  border-color: var(--primary);
}

/* Tombol Kembali di Form Hafalan */
.btn-back-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  margin-bottom: 12px;
  transition: color 0.2s;
}

.btn-back-step:hover {
  color: var(--primary);
}

/* ═══════════════════════════════════════════════════════════ */
/* PROFILE DROPDOWN MENU (Topbar)                              */
/* ═══════════════════════════════════════════════════════════ */

.profile-dropdown-wrap {
  position: relative;
}

.profile-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 10px;
  transition: background 0.2s;
}

.profile-trigger:hover {
  background: rgba(26, 77, 58, 0.06);
}

.chevron-dropdown {
  color: var(--text-muted);
  transition: transform 0.2s;
}

.profile-trigger.open .chevron-dropdown {
  transform: rotate(180deg);
}

/* Menu Dropdown */
.profile-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 200px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(201, 214, 190, 0.5);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
}

.profile-dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background 0.2s;
}

.dropdown-item:hover {
  background: rgba(26, 77, 58, 0.06);
}

.dropdown-item.danger {
  color: var(--danger);
}

.dropdown-item.danger:hover {
  background: #fef2f2;
}

.dropdown-divider {
  height: 1px;
  background: rgba(201, 214, 190, 0.6);
  margin: 4px 0;
}

/* ═══════════════════════════════════════════════════════════ */
/* ZONA BAHAYA (Edit Profil)                                   */
/* ═══════════════════════════════════════════════════════════ */
.danger-zone {
  margin-top: 24px;
  border-top: 1px dashed rgba(201, 214, 190, 0.8);
  padding-top: 16px;
}

.danger-zone-label {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--danger);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  display: block;
}

.danger-actions {
  display: flex;
  gap: 10px;
}

/* Memperbaiki Tampilan Tombol Juz menjadi Grid Simetris */
.hk-bottom-sheet .juz-tabs {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(65px, 1fr)) !important;
  gap: 8px !important;
  margin-bottom: 20px !important;
}

.hk-bottom-sheet .juz-tab {
  padding: 8px 0 !important;
  text-align: center !important;
  justify-content: center !important;
  font-size: 0.8rem !important;
  border-radius: 8px !important;
  border: 1.5px solid var(--sage) !important;
  background: #ffffff !important;
  color: var(--text-muted) !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
}

.hk-bottom-sheet .juz-tab.active {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 10px rgba(26, 77, 58, 0.2) !important;
}

/* ═══════════════════════════════════════════════════════════ */
/* REFRESH FOOTER: MINIMALIST CONTACT LINKS                    */
/* ═══════════════════════════════════════════════════════════ */

/* Container Utama Footer */
.footer-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 24px;
}

/* Area Kiri: Profil */
.footer-profile {
  display: flex;
  align-items: center;
  gap: 14px;
}

.footer-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  box-shadow: 0 4px 10px rgba(26, 77, 58, 0.15);
}

.footer-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 2px;
  letter-spacing: -0.2px;
}

.footer-role {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

/* Area Kanan: Tautan Kontak (Bukan Tombol) */
.footer-actions {
  display: flex;
  gap: 8px;
}

.footer-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  color: var(--text-muted); /* Warna teks abu-abu redup */
  background: transparent;
  border: none;
}

.footer-btn svg {
  width: 18px;
  height: 18px;
  transition: color 0.2s ease;
}

/* Efek Hover: Berubah jadi hijau saat disentuh */
.footer-btn:hover {
  background: rgba(26, 77, 58, 0.05);
  color: var(--primary);
}

.footer-btn-wa:hover svg { color: #25D366; } /* Warna khas WA */
.footer-btn-email:hover svg { color: var(--primary); }

/* Garis Pemisah */
.footer-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 214, 190, 0.8), transparent);
  margin: 0 0 16px;
}

/* Teks Copyright */
.footer-copy {
  text-align: center;
  font-size: 0.75rem;
  color: #9ca3af;
  margin: 0;
  letter-spacing: 0.2px;
}

/* Responsif di HP */
@media (max-width: 560px) {
  .footer-main {
    flex-direction: column;
    text-align: center;
  }
  .footer-profile {
    flex-direction: column;
    gap: 8px;
  }
  .footer-actions {
    justify-content: center;
    width: 100%;
  }
}

/* Login Footer Minimalis */
.login-footer-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}

.login-footer-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid rgba(201, 214, 190, 0.5);
  transition: all 0.2s;
}

.login-footer-btn:hover {
  background: rgba(26, 77, 58, 0.05);
  color: var(--primary);
  border-color: var(--primary);
}
.login-footer-btn svg { width: 16px; height: 16px; }

/* ═══════════════════════════════════════════════════════════ */
/* ULTRA MINIMALIST LOGIN FOOTER                               */
/* ═══════════════════════════════════════════════════════════ */

.login-footer-ultra {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid rgba(201, 214, 190, 0.4);
  text-align: center;
  font-size: 0.8rem;
  color: #9ca3af;
}

.ultra-links {
  margin-bottom: 12px; /* Jarak antara link dan copyright */
}

.ultra-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.ultra-links a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.login-footer-ultra .sep {
  color: #d1d5db;
  margin: 0 8px;
  font-weight: 300;
}

.ultra-copy {
  font-size: 0.7rem;
  color: #d1d5db;
}

/* ═══════════════════════════════════════════════════════════ */
/* APP FOOTER ULTRA MINIMALIS (Konsisten di semua halaman)     */
/* ═══════════════════════════════════════════════════════════ */

.app-footer-ultra {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(201, 214, 190, 0.4);
  text-align: center;
  font-size: 0.8rem;
  color: #9ca3af;
  padding-bottom: 20px; /* Jarak aman dari taskbar bawah */
}

.app-footer-ultra .ultra-links {
  margin-bottom: 12px;
}

.app-footer-ultra .ultra-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.app-footer-ultra .ultra-links a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.app-footer-ultra .sep {
  color: #d1d5db;
  margin: 0 8px;
  font-weight: 300;
}

.app-footer-ultra .ultra-copy {
  font-size: 0.7rem;
  color: #d1d5db;
}

/* ============================================================
   HAFALANKU — Profil ringkas; tampilan pencapaian kembali ke awal
   ============================================================ */

.student-profile-area {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 64px);
  min-width: 0;
}

.student-profile-details {
  display: grid;
  justify-items: end;
  gap: 0;
  min-width: 0;
}

.student-profile-details > .user-name {
  max-width: 300px;
  font-size: 0.9rem;
  line-height: 1.4;
  text-align: right;
  overflow-wrap: anywhere;
}

.student-profile-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 44px;
  min-height: 44px;
  padding: 2px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--primary);
  font: inherit;
  cursor: pointer;
}

.student-profile-button:hover,
.student-profile-button[aria-expanded="true"] {
  background: var(--primary-soft);
}

.student-profile-button > svg {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}

.student-profile-button #userGenderIcon {
  display: inline-flex;
  align-items: center;
  margin: 0;
}

.student-profile-button #userGenderIcon .hf-avatar {
  --hf-avatar-size: 36px;
}

.student-profile-dropdown {
  position: absolute;
  top: 48px;
  right: 0;
  z-index: 110;
  min-width: 160px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 8px 28px rgba(26, 58, 46, 0.14);
}

.student-profile-dropdown[hidden] {
  display: none;
}

.student-profile-dropdown .btn-logout {
  justify-content: flex-start;
  width: 100%;
  min-height: 44px;
}

.student-heading {
  margin-bottom: 20px;
}

.student-heading .greeting {
  margin: 0;
}

.student-heading .greeting h1 {
  margin-bottom: 6px;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.student-heading #greetName {
  display: inline;
  font: inherit;
}

.student-heading .greeting p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.6;
}

/* Akses keyboard tanpa mengubah tampilan kartu awal. */
.student-dashboard-page #badgeHighlight:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
}

@media (max-width: 760px) {
  .student-dashboard-page > .container {
    padding-top: 20px;
  }
  .student-profile-area {
    gap: 6px;
  }
  .student-profile-details > .user-name {
    max-width: 220px;
    font-size: 0.86rem;
  }
  .student-heading .greeting h1 {
    font-size: 1.25rem;
  }
  .student-heading .greeting p {
    font-size: 0.86rem;
  }
}

@media (max-width: 360px) {
  .student-profile-details > .user-name {
    max-width: 160px;
    font-size: 0.8rem;
  }
  .student-heading .greeting h1 {
    font-size: 1.15rem;
  }
}

/* ============================================================
   HAFALANKU — Target bulanan (guru dan siswa)
   ============================================================ */
.monthly-target-card {
  margin: 0 0 22px;
  padding: 18px 20px;
  border: 1px solid var(--sage);
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--shadow-xs);
}
.monthly-target-card[hidden] { display: none; }
.monthly-target-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.monthly-target-header h2 {
  margin: 0;
  color: var(--heading, var(--text));
  font-size: 1rem;
  font-weight: 700;
}
.monthly-target-month {
  display: grid;
  gap: 4px;
  color: var(--text-muted);
  font-size: 0.7rem;
}
.monthly-target-card input {
  box-sizing: border-box;
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-soft);
  color: var(--text);
  font: inherit;
}
.monthly-target-month input { width: 155px; font-size: 0.8rem; }
.monthly-target-card input:focus-visible,
.monthly-target-editor summary:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}
.monthly-target-goals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.monthly-goal { min-width: 0; }
.monthly-goal-label { color: var(--text-muted); font-size: 0.78rem; }
.monthly-goal-count {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 3px;
  margin: 6px 0 8px;
  color: var(--primary);
  font-size: 1.3rem;
  font-weight: 800;
}
.monthly-goal-count span { color: var(--text-muted); font-size: 0.78rem; font-weight: 500; }
.monthly-goal-track { height: 5px; overflow: hidden; border-radius: 99px; background: var(--primary-soft); }
.monthly-goal-fill { height: 100%; border-radius: inherit; background: var(--primary); transition: width 0.5s ease; }
.monthly-goal.is-complete .monthly-goal-fill { background: var(--primary-light); }
.monthly-goal-unset { margin: 7px 0 0; color: var(--text-muted); font-size: 0.8rem; }
.monthly-target-empty { grid-column: 1 / -1; margin: 0; color: var(--text-muted); font-size: 0.85rem; line-height: 1.6; }
.monthly-target-status { margin: 12px 0 0; color: var(--primary); font-size: 0.78rem; line-height: 1.6; }
.monthly-target-status.is-error { color: var(--danger); }
.monthly-target-note { margin: 8px 0 0; color: var(--text-muted); font-size: 0.7rem; line-height: 1.6; }
.monthly-target-editor { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; }
.monthly-target-editor summary { width: fit-content; min-height: 32px; color: var(--primary); font-size: 0.82rem; font-weight: 700; cursor: pointer; }
.monthly-target-form { margin-top: 10px; }
.monthly-target-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.monthly-target-fields label { display: grid; gap: 6px; color: var(--text); font-size: 0.8rem; }
.monthly-target-fields small { color: var(--text-muted); font-size: 0.7rem; font-weight: 400; line-height: 1.5; }
.monthly-target-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.monthly-target-actions .btn-primary,
.monthly-target-actions .btn-secondary { width: auto; min-height: 42px; font-size: 0.8rem; }
.monthly-target-actions button:disabled { opacity: 0.55; cursor: not-allowed; }
@media (max-width: 600px) {
  .monthly-target-card { padding: 16px; }
  .monthly-target-fields { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .monthly-goal-fill { transition: none; }
}

/* ============================================================
   HAFALANKU — Statistik siswa ringkas
   ============================================================ */
.student-stats.stats-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.student-stats > .stat-card {
  min-width: 0;
  padding: 16px;
  border-radius: 18px;
}

.student-stats .stat-card-header {
  align-items: flex-start;
  gap: 8px;
  min-height: 32px;
  margin-bottom: 10px;
}

.student-stats .stat-card-label {
  min-width: 0;
  color: var(--text-secondary);
  font-size: 0.8rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.student-stats .stat-card-icon {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 10px;
}

.student-stats .stat-card-icon svg {
  width: 18px;
  height: 18px;
}

.student-stats .stat-card-value {
  flex-wrap: wrap;
  gap: 3px;
  margin-bottom: 7px;
  font-size: clamp(1.5rem, 4.8vw, 1.9rem);
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.student-stats .stat-card-value .unit {
  margin-left: 0;
  font-size: 0.78rem;
}

.student-stats .stat-card-trend {
  display: block;
  font-size: 0.74rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

/* Rutinitas menjadi baris ringkas selebar dua kartu. */
.student-stats > .student-stat-streak {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 3px 12px;
  padding: 12px 16px;
}

.student-stat-streak .stat-card-header {
  grid-column: 1;
  grid-row: 1;
  align-items: center;
  justify-content: flex-start;
  min-height: 0;
  margin: 0;
}

.student-stat-streak .stat-card-icon {
  order: -1;
  width: 28px;
  height: 28px;
}

.student-stat-streak .stat-card-label {
  font-weight: 600;
}

.student-stat-streak .stat-card-value {
  grid-column: 2;
  grid-row: 1 / 3;
  justify-content: flex-end;
  margin: 0;
  font-size: 1.35rem;
}

.student-stat-streak .stat-card-trend {
  grid-column: 1;
  grid-row: 2;
  padding-left: 36px;
}

@media (max-width: 400px) {
  .student-stats.stats-grid {
    gap: 10px;
  }
  .student-stats > .stat-card {
    padding: 12px;
  }
  .student-stats .stat-card-header {
    min-height: 34px;
    gap: 6px;
  }
  .student-stats .stat-card-label {
    font-size: 0.74rem;
  }
  .student-stats .stat-card-icon {
    width: 26px;
    height: 26px;
  }
  .student-stats .stat-card-icon svg {
    width: 16px;
    height: 16px;
  }
  .student-stats .stat-card-trend {
    font-size: 0.7rem;
  }
  .student-stats > .student-stat-streak {
    padding: 10px 12px;
  }
  .student-stat-streak .stat-card-header {
    min-height: 0;
  }
  .student-stat-streak .stat-card-trend {
    padding-left: 32px;
  }
}

/* ============================================================
   HAFALANKU — Dua kartu dengan kedalaman dan perpindahan manual
   ============================================================ */
.card-stack {
  --stack-height: 260px;
  --stack-peek: 44px;
  position: relative;
  margin: 0 0 24px;
  padding-bottom: var(--stack-peek);
}
.card-stack[hidden], .card-stack [hidden] { display: none !important; }
.card-stack-stage {
  position: relative;
  height: var(--stack-height);
  perspective: 1100px;
  isolation: isolate;
}
.stack-card {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: var(--r-lg);
  transform-origin: center center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border: 1px solid rgba(255, 255, 255, 0.22);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.stack-achievement {
  background: linear-gradient(135deg, #e3b943 0%, #f1daa0 45%, #e1b744 100%);
  color: #422006;
}
.stack-target {
  background: #164b3a;
  color: #fff8e8;
}
.card-stack[data-active="achievement"] .stack-achievement,
.card-stack[data-active="target"] .stack-target {
  z-index: 3;
  transform: translate3d(0, 0, 0) rotate(0);
  box-shadow: 0 14px 30px -14px rgba(24, 40, 27, 0.42), 0 3px 7px rgba(24, 40, 27, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.card-stack[data-active="achievement"] .stack-target,
.card-stack[data-active="target"] .stack-achievement {
  z-index: 1;
  transform: translate3d(0, var(--stack-peek), -24px) scale(0.985) rotate(-0.5deg);
  box-shadow: 0 10px 18px -10px rgba(24, 40, 27, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.stack-face-body {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stack-face-body[aria-hidden="true"] { visibility: hidden; }
.card-stack.is-swapping .stack-face-body[aria-hidden="true"] { visibility: visible; }
.stack-face-body[aria-hidden="true"] * { animation-play-state: paused; }
.card-stack .achievement-card {
  flex: 0 0 auto;
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  animation: none;
}
.card-stack .achievement-card::before { animation: none; }
.card-stack .ach-title:focus,
.card-stack #monthlyTargetTitle:focus { outline-offset: 4px; }
.stack-peek-button {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-sizing: border-box;
  min-height: var(--stack-peek);
  width: 100%;
  padding: 9px 18px;
  border: 0;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.stack-peek-button > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.stack-peek-action { display: inline-flex; flex-shrink: 0; align-items: center; gap: 5px; font-size: 0.75rem; font-weight: 500; }
.stack-peek-action svg { width: 14px; height: 14px; flex-shrink: 0; }
.stack-target .stack-peek-button { color: #fff0bc; }
.stack-peek-button:hover { background: rgba(255, 255, 255, 0.08); }
.stack-peek-button:focus-visible { outline: 2px solid currentColor; outline-offset: -5px; }
.card-stack .monthly-target-card {
  position: relative;
  flex: 0 0 auto;
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: 18px 22px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: inherit;
}
.stack-ornament { position: absolute; top: -22px; left: -22px; width: 90px; height: 90px; color: #d9b868; opacity: 0.25; pointer-events: none; }
.stack-ornament.is-right { left: auto; right: -22px; transform: scaleX(-1); }
.card-stack .monthly-target-header { position: relative; justify-content: center; flex-wrap: nowrap; gap: 8px; margin-bottom: 12px; }
.card-stack .monthly-target-header h2 { color: #fff1c8; font-size: 1.1rem; text-align: center; }
.stack-month-picker { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 32px; width: 32px; height: 32px; color: #f0d58c; cursor: pointer; }
.stack-month-picker > svg { width: 18px; height: 18px; }
.card-stack .stack-month-picker input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.stack-month-picker input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; cursor: pointer; }
.stack-month-picker:focus-within { outline: 2px solid #f0d58c; outline-offset: 2px; border-radius: 6px; }
.card-stack .monthly-target-goals { grid-template-columns: minmax(0, 1fr); gap: 12px; }
.card-stack .monthly-goal { display: grid; grid-template-columns: 26px minmax(0, 1fr); align-items: start; gap: 10px; }
.stack-goal-icon { width: 24px; height: 24px; margin-top: 4px; color: #edcf7a; }
.stack-goal-body { min-width: 0; }
.stack-goal-top { line-height: 1.2; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card-stack .monthly-goal-label { color: #fff1c8; font-size: 0.8rem; font-weight: 600; }
.stack-goal-percent { color: #f5df9a; font-size: 0.74rem; }
.card-stack .monthly-goal-count { margin: 2px 0 6px; color: #fff8e8; font-size: 1.15rem; line-height: 1.2; }
.card-stack .monthly-goal-count span { color: #e7eddf; font-size: 0.82rem; }
.card-stack .monthly-goal-track { height: 5px; background: rgba(222, 237, 219, 0.25); }
.card-stack .monthly-goal-fill,
.card-stack .monthly-goal.is-complete .monthly-goal-fill { background: linear-gradient(90deg, #ffe8a2, #e9bb42); }
.stack-goal-remaining { margin: 3px 0 0; color: #e2e9db; font-size: 0.68rem; line-height: 1.3; }
.card-stack .monthly-target-status { margin-top: 8px; color: #e3eadc; font-size: 0.7rem; line-height: 1.4; text-align: center; }
.card-stack .monthly-target-status.is-error { color: #ffe0d4; }
.card-stack .monthly-target-empty,
.card-stack .monthly-goal-unset { color: #e3eadc; }
.card-stack .monthly-target-note { display: none; }
.stack-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.card-stack.is-swapping .stack-card { pointer-events: none; will-change: transform; }
.card-stack[data-swap="target"] .stack-target,
.card-stack[data-swap="achievement"] .stack-achievement { animation: hkStackForward 0.64s cubic-bezier(0.22, 0.7, 0.25, 1) both; }
.card-stack[data-swap="target"] .stack-achievement,
.card-stack[data-swap="achievement"] .stack-target { animation: hkStackBackward 0.64s cubic-bezier(0.22, 0.7, 0.25, 1) both; }
@keyframes hkStackForward {
  0% { z-index: 1; transform: translate3d(0, var(--stack-peek), -24px) scale(0.985) rotate(-0.5deg); }
  42% { z-index: 1; transform: translate3d(8px, 54px, 35px) scale(1.005) rotate(2deg); }
  50% { z-index: 4; }
  100% { z-index: 4; transform: translate3d(0, 0, 0) scale(1) rotate(0); }
}
@keyframes hkStackBackward {
  0% { z-index: 3; transform: translate3d(0, 0, 0) scale(1) rotate(0); }
  40% { z-index: 3; transform: translate3d(-8px, -8px, 45px) scale(1.005) rotate(-2deg); }
  51% { z-index: 1; }
  100% { z-index: 1; transform: translate3d(0, var(--stack-peek), -24px) scale(0.985) rotate(-0.5deg); }
}
.card-stack.is-single { padding-bottom: 0; }
.card-stack.is-single .stack-target { transform: none; }
@media (hover: hover) and (pointer: fine) {
  .card-stack:not(.is-swapping):not(.is-single):hover .stack-card:has(.stack-face-body[aria-hidden="false"]) { transform: translate3d(0, -2px, 10px) rotateX(0.6deg); }
}
@media (max-width: 720px) {
  .card-stack .monthly-target-card { padding: 14px 18px; }
  .card-stack .monthly-target-header h2 { font-size: 1rem; }
  .card-stack .monthly-target-header { margin-bottom: 10px; }
  .card-stack .monthly-target-goals { gap: 10px; }
  .stack-peek-button { padding: 8px 14px; font-size: 0.76rem; }
  .stack-peek-action { font-size: 0.7rem; }
}
@media (max-width: 360px) {
  .stack-peek-button { gap: 6px; padding-left: 11px; padding-right: 11px; font-size: 0.71rem; }
  .stack-peek-action { font-size: 0.66rem; gap: 3px; }
}
@media (prefers-reduced-motion: reduce) {
  .card-stack .stack-card,
  .card-stack .achievement-card *,
  .card-stack .monthly-goal-fill { animation: none !important; transition: none !important; }
  .card-stack:not(.is-swapping):hover .stack-card:has(.stack-face-body[aria-hidden="false"]) { transform: none; }
}

/* Input siswa — scoped agar halaman guru tetap menggunakan desain semula. */
.student-input-page .fab-main {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: auto; min-width: 104px; padding: 0 18px; border-radius: 28px;
}
.student-input-page .fab-main.open { transform: none; }
.student-input-page .fab-main > svg { transition: transform .2s ease; flex-shrink: 0; }
.student-input-page .fab-main.open > svg { transform: rotate(45deg); }
.input-fab-label { font-size: .87rem; font-weight: 700; line-height: 1.3; }
.student-input-page .fab-action { display: flex; align-items: center; gap: 12px; text-align: left; min-height: 64px; width: 268px; white-space: normal; }
.input-action-copy { display: flex; flex-direction: column; gap: 4px; }
.input-action-copy strong { font-size: .87rem; }
.input-action-copy small { font-size: .7rem; color: var(--text-muted); font-weight: 400; }
.student-input-page .fab-action-icon { display: grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0; border-radius: 10px; background: var(--cream, #f8f6ed); }
.student-input-sheet { bottom: 0; transform: translateY(110%); visibility: hidden; transition: transform .3s cubic-bezier(.22,.7,.25,1), visibility .3s; height: 90vh; height: 90dvh; z-index: 10002; }
.student-input-sheet.show { transform: translateY(0); visibility: visible; }
.student-input-page #bsMurojaahBackdrop, .student-input-page #bsHafalanBackdrop { z-index: 10001; }
.student-input-sheet .hk-bs-header { align-items: flex-start; gap: 12px; }
.input-sheet-help { font-size: .78rem; line-height: 1.6; color: var(--text-muted); margin: 5px 0 0; }
.student-input-sheet .hk-bs-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.input-fields { margin: 0; padding: 0; border: 0; min-width: 0; }
.input-fields:disabled { opacity: .65; }
.student-input-sheet .hk-bs-footer { padding-bottom: max(16px, env(safe-area-inset-bottom)); }
.input-selection { margin: 0 0 8px; font-size: .78rem; font-weight: 600; color: var(--primary); }
.input-error { margin: 14px 0 0; padding: 11px 13px; border-radius: 10px; color: #9b2922; background: #fff0ee; font-size: .8rem; line-height: 1.6; }
.input-error[hidden] { display: none; }
.input-range { margin: 8px 0 0; color: var(--text-muted); font-size: .75rem; line-height: 1.6; }
.input-empty { grid-column: 1 / -1; margin: 0; padding: 20px 10px; color: var(--text-muted); text-align: center; font-size: .82rem; line-height: 1.6; }
.student-input-sheet .form-label-block { margin-top: 0; }
.student-input-sheet .hk-surat-card { min-width: 0; gap: 10px; font: inherit; border: 1.5px solid var(--sage); border-radius: 12px; }
.student-input-sheet#bsMurojaah .hk-surat-card { flex-wrap: wrap; padding: 0 !important; gap: 0; cursor: default; }
.student-input-sheet#bsMurojaah .hk-surat-card.selected { border-color: var(--primary); background: #f5f8f0 !important; }
.input-surat-pick { border: 0; background: transparent; display: flex; align-items: center; gap: 12px; padding: 13px 14px; width: 100%; text-align: left; color: inherit; font: inherit; cursor: pointer; border-radius: 10px; min-height: 60px; }
.input-check { display: grid; place-items: center; width: 22px; height: 22px; flex-shrink: 0; border: 1.5px solid var(--sage); border-radius: 7px; color: transparent; background: white; }
.input-check svg { width: 16px; height: 16px; }
.selected .input-check { color: white; background: var(--primary); border-color: var(--primary); }
.student-input-sheet#bsMurojaah .hk-status-inline-wrap { width: 100%; margin: 0; padding: 0 14px 12px 48px; box-sizing: border-box; }
.student-input-sheet .hk-status-inline-wrap label { display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: .75rem; }
.student-input-sheet .hk-status-inline-wrap select { flex: 1; min-width: 0; min-height: 44px; }
.input-hafalan-pick { cursor: pointer; }
.input-hafalan-pick:hover { border-color: var(--primary); }
.input-surat-arrow { color: var(--primary); font-size: 1.4rem; }
.student-input-sheet button:focus-visible, .student-input-page .fab-container button:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
.student-input-sheet select:focus-visible { outline: 2px solid var(--primary) !important; outline-offset: 2px; }
.student-input-sheet [aria-invalid="true"] { border-color: #b72e27 !important; }
.student-input-sheet .hk-bs-close, .student-input-sheet .btn-back-step { min-height: 44px; }
.student-input-sheet .hk-bs-footer button { min-height: 48px; }
.student-input-sheet button:disabled { opacity: .55; cursor: default; }
@media (min-width: 721px) {
 .student-input-sheet { max-width: 660px; margin: 0 auto; }
}
@media (max-width: 720px) {
 .student-input-page .fab-main { min-width: 100px; }
 .student-input-sheet .hk-surat-grid { grid-template-columns: minmax(0, 1fr); }
 .student-input-sheet .form-group input, .student-input-sheet .form-group select, .student-input-sheet .form-group textarea { font-size: 16px !important; }
 .student-input-sheet .hk-status-inline-wrap select { font-size: 16px !important; }
}
@media (prefers-reduced-motion: reduce) {
 .student-input-sheet, .student-input-page .fab-main, .student-input-page .fab-main > svg { transition: none; }
}

/* Menu Hafalan siswa — scope tab, tidak mengubah dashboard dan halaman guru. */
#hafalanTab .hafalan-page-heading { margin-bottom: 18px; }
#hafalanTab .hafalan-page-heading h2 { margin: 0 0 5px; color: var(--primary); font-size: 1.5rem; font-weight: 800; }
#hafalanTab .hafalan-page-heading p { margin: 0; font-size: .88rem; color: var(--text-muted); line-height: 1.6; }
#hafalanTab .hafalan-latest { padding: 20px; margin-bottom: 20px; background: #fff; border: 1px solid var(--sage); border-radius: var(--r-lg, 20px); box-shadow: 0 3px 12px rgba(26,77,58,.03); }
#hafalanTab .hafalan-latest-top { display: flex; align-items: flex-start; gap: 13px; }
#hafalanTab .hafalan-latest-icon { flex-shrink: 0; width: 29px; height: 29px; margin-top: 2px; color: var(--primary); }
#hafalanTab .hafalan-latest-copy { min-width: 0; flex: 1; }
#hafalanTab .hafalan-latest-label { margin: 0 0 5px; color: var(--text-muted); font-size: .8rem; }
#hafalanTab #hafalanLatestTitle { margin: 0; font-size: 1.08rem; font-weight: 800; line-height: 1.5; color: var(--primary); overflow-wrap: anywhere; }
#hafalanTab #hafalanLatestMeta { margin: 4px 0 0; font-size: .78rem; line-height: 1.6; color: var(--text-muted); }
#hafalanTab .hafalan-approved { display: inline-flex; align-items: center; gap: 5px; color: var(--primary); padding: 5px 9px; background: #edf5e7; border-radius: 8px; font-size: .72rem; font-weight: 600; white-space: nowrap; }
#hafalanTab .hafalan-approved[hidden], #hafalanTab [hidden] { display: none !important; }
#hafalanTab .hafalan-approved svg { width: 14px; height: 14px; }
#hafalanTab #hafalanAddButton { display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%; min-height: 46px; margin-top: 16px; font-size: .88rem; }
#hafalanTab #hafalanAddButton svg { width: 18px; height: 18px; }
#hafalanTab .progress-card { margin-bottom: 0; }
#hafalanTab .hafalan-history-heading { margin-top: 24px; gap: 10px; flex-wrap: wrap; }
#hafalanTab .hafalan-search-box { position: relative; margin: 14px 0 12px; }
#hafalanTab .hafalan-search-box > svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 19px; height: 19px; color: var(--text-muted); pointer-events: none; }
#hafalanTab #hafalanSearch { box-sizing: border-box; width: 100%; min-height: 46px; border: 1px solid var(--sage); background: white; border-radius: 12px; padding: 11px 14px 11px 42px; color: var(--text); font: inherit; font-size: .88rem; }
#hafalanTab .hafalan-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; max-width: 520px; }
#hafalanTab .hafalan-filter { min-width: 0; min-height: 42px; border: 1px solid var(--sage); border-radius: 10px; padding: 8px 5px; background: transparent; color: var(--text-muted); font: inherit; font-size: .78rem; font-weight: 600; cursor: pointer; }
#hafalanTab .hafalan-filter.is-active { background: var(--primary); color: white; border-color: var(--primary); }
#hafalanTab #hafalanResultsStatus { margin: 11px 0; color: var(--text-muted); font-size: .74rem; line-height: 1.5; }
#hafalanTab .history-item { padding: 16px; }
#hafalanTab .history-title { overflow-wrap: anywhere; }
#hafalanTab .history-date { flex-shrink: 0; }
#hafalanTab .history-badges { display: flex; flex-wrap: wrap; gap: 6px; }
#hafalanTab .history-badges .badge { white-space: normal; line-height: 1.5; }
#hafalanTab .hafalan-status-unknown { background: #f1f1ec; color: var(--text-muted); }
#hafalanTab #btnToggleHafalan { min-height: 44px; }
#hafalanTab button:focus-visible, #hafalanTab input:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.hafalan-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 720px) {
 #hafalanTab .hafalan-latest { padding: 16px; }
 #hafalanTab .hafalan-latest-top { flex-wrap: wrap; gap: 10px; }
 #hafalanTab .hafalan-approved { margin-left: 39px; }
 #hafalanTab .hafalan-latest-copy { flex-basis: calc(100% - 39px); }
 #hafalanTab #hafalanSearch { font-size: 16px; }
 #hafalanTab .history-item-header { flex-direction: column; align-items: flex-start; gap: 5px; }
 #hafalanTab .history-item { padding: 14px; }
}
@media (max-width: 360px) {
 #hafalanTab .hafalan-filters { gap: 5px; }
 #hafalanTab .hafalan-filter { font-size: .72rem; }
}

/* Profil siswa dan dialog, scope terpisah dari halaman guru. */
.student-profile-dropdown { min-width: 190px; }
.student-profile-dropdown .profile-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 11px 13px; border: 0; border-radius: 9px; background: transparent; color: var(--text); font: inherit; font-size: .85rem; text-align: left; cursor: pointer; }
.student-profile-dropdown .profile-menu-item svg { width: 19px; height: 19px; flex-shrink: 0; color: var(--primary); }
.student-profile-dropdown .profile-menu-item:hover { background: #f0f5eb; }
.student-profile-open .fab-container { display: none; }
.student-profile-view { max-width: 700px; margin: 0 auto; padding-bottom: 16px; }
.student-profile-view [hidden] { display: none !important; }
.student-profile-view h2 { font-size: 1.5rem; font-weight: 800; color: var(--primary); margin: 0 0 18px; }
.student-profile-view h3 { font-size: 1rem; font-weight: 700; margin: 0 0 9px; color: var(--heading, var(--text)); }
.profile-back-button { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin: 0 0 10px; padding: 0 5px; border: 0; background: transparent; color: var(--primary); font: inherit; font-size: .85rem; cursor: pointer; }
.profile-back-button svg { width: 19px; height: 19px; }
.student-profile-card { padding: 20px; background: white; border: 1px solid var(--sage); border-radius: var(--r-lg,20px); margin-bottom: 16px; }
.student-profile-view .profile-identity { display: flex; gap: 17px; align-items: center; }
.profile-identity > div { min-width: 0; }
.student-profile-view #studentProfileAvatar { width: 80px; height: 80px; flex: 0 0 80px; }
.profile-identity #studentProfileName { overflow-wrap: anywhere; margin-bottom: 5px; font-size: 1.15rem; line-height: 1.4; }
.profile-identity #studentProfileUsername { margin: 0 0 8px; color: var(--text-muted); font-size: .83rem; overflow-wrap: anywhere; }
.profile-role-label { display: inline-block; padding: 3px 10px; border-radius: 16px; background: #eef4e8; color: var(--primary); font-size: .75rem; }
.profile-account-info { margin: 0 0 10px; }
.profile-account-info > div { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 12px; padding: 11px 0; border-bottom: 1px solid #edf0e7; font-size: .85rem; line-height: 1.5; }
.profile-account-info dt { color: var(--text-muted); }
.profile-account-info dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.profile-muted { margin: 5px 0 10px; color: var(--text-muted); font-size: .78rem; line-height: 1.6; }
.profile-status { color: var(--text-muted); font-size: .8rem; line-height: 1.6; margin: 10px 0; }
.profile-status:empty { display: none; }
.profile-badge-previews { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0; }
.profile-badge-preview { flex: 1 1 80px; min-width: 0; max-width: 33%; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; font-size: .75rem; color: var(--primary); line-height: 1.5; overflow-wrap: anywhere; }
.profile-badge-emoji { font-size: 1.6rem; line-height: 1.4; flex-shrink: 0; }
.profile-setting-row { width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: space-between; border: 0; border-top: 1px solid var(--sage); background: transparent; padding: 13px 0 0; color: var(--primary); font: inherit; font-size: .87rem; font-weight: 600; cursor: pointer; }
.profile-setting-row svg { width: 18px; height: 18px; }
.profile-text-button { border: 0; padding: 10px 4px; background: transparent; color: var(--primary); font: inherit; font-size: .8rem; text-decoration: underline; cursor: pointer; min-height: 44px; }
.profile-badge-count { color: var(--primary); font-size: .9rem; font-weight: 700; margin: 15px 0; }
.profile-badge-options { display: grid; gap: 10px; margin-top: 14px; }
.profile-badge-option { display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 78px; padding: 14px; border: 1px solid var(--sage); border-radius: 13px; background: white; color: var(--text); text-align: left; font: inherit; cursor: pointer; }
.profile-badge-option.is-selected { background: #eef5e8; border-color: var(--primary); }
.profile-badge-option-copy { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.profile-badge-option-copy strong { font-size: .88rem; overflow-wrap: anywhere; }
.profile-badge-option-copy small { font-size: .73rem; color: var(--text-muted); line-height: 1.5; }
.profile-badge-mark { width: 24px; height: 24px; border: 1px solid var(--sage); border-radius: 50%; color: var(--primary); display: grid; place-items: center; flex-shrink: 0; }
.profile-badge-mark svg { width: 18px; height: 18px; }
.is-selected .profile-badge-mark { background: var(--primary); border-color: var(--primary); color: white; }
.profile-badge-option:disabled { opacity: .55; cursor: default; }
.profile-badge-save-area { position: sticky; bottom: calc(76px + env(safe-area-inset-bottom)); background: var(--cream, #f7f4e9); padding: 14px 0 2px; margin-top: 15px; text-align: center; border-top: 1px solid var(--sage); }
.profile-badge-save-area > .btn-primary { width: 100%; min-height: 46px; }
.student-profile-view button:disabled, .student-password-dialog button:disabled { opacity: .55; cursor: default; }
.student-profile-view button:focus-visible, .student-profile-dropdown button:focus-visible, .student-password-dialog :is(button,input):focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.student-password-dialog { box-sizing: border-box; width: min(460px, calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; margin: auto; padding: 24px; border: 1px solid var(--sage); border-radius: 20px; color: var(--text); background: white; box-shadow: 0 18px 60px rgba(20,50,30,.2); }
.student-password-dialog::backdrop { background: rgba(20,40,30,.45); }
.student-password-dialog h2 { color: var(--primary); font-size: 1.25rem; margin: 0 0 8px; }
.profile-password-fields { border: 0; padding: 0; margin: 14px 0; min-width: 0; }
.profile-password-fields > label { display: block; margin: 12px 0 7px; font-size: .85rem; }
.profile-password-fields > input { box-sizing: border-box; width: 100%; min-height: 45px; padding: 10px 12px; border: 1px solid var(--sage); border-radius: 9px; font: inherit; font-size: 16px; background: white; color: var(--text); }
.profile-password-fields .profile-show-password { display: flex; gap: 9px; align-items: center; min-height: 44px; }
.profile-password-error { color: #a42b23; font-size: .8rem; line-height: 1.6; }
.profile-password-error:empty { display: none; }
.profile-password-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.profile-password-actions button { min-height: 44px; }
@media (max-width: 720px) {
 .student-profile-card { padding: 16px; }
 .student-profile-view #studentProfileAvatar { width: 68px; height: 68px; flex-basis: 68px; }
 .profile-identity #studentProfileName { font-size: 1rem; }
 .student-profile-view .profile-identity { gap: 13px; }
 .profile-badge-preview { font-size: .7rem; }
}

/* Menu Muroja'ah siswa: satu sumber data, scope terpisah dari menu lain. */
#murojaahTab [hidden] { display: none !important; }
#murojaahTab .mur-page-heading { margin-bottom: 18px; }
#murojaahTab .mur-page-heading h2 { margin: 0 0 5px; color: var(--primary); font-weight: 800; font-size: 1.5rem; }
#murojaahTab .mur-page-heading p { margin: 0; color: var(--text-muted); font-size: .88rem; line-height: 1.6; }
#murojaahTab .mur-peta-help { color: var(--text-muted); font-size: .74rem; line-height: 1.6; margin: 10px 0; }
#murojaahTab .mur-peta-help summary { cursor: pointer; color: var(--primary); min-height: 32px; }
#murojaahTab .mur-peta-help p { margin: 2px 0 10px; }
#murojaahTab .mur-peta-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
#murojaahTab #petaLoadStatus, #murojaahTab #petaResultsStatus { color: var(--text-muted); font-size: .74rem; line-height: 1.6; margin: 8px 0; }
#murojaahTab #petaLoadStatus:empty { display: none; }
#murojaahTab #petaRetry { background: transparent; border: 0; color: var(--primary); font: inherit; font-size: .78rem; text-decoration: underline; min-height: 44px; cursor: pointer; }
#murojaahTab .chips { flex-wrap: wrap; gap: 7px; }
#murojaahTab .chip { min-height: 40px; }
#murojaahTab .peta-card .search-box { max-width: none; }
#murojaahTab #petaSearch { box-sizing: border-box; width: 100%; min-height: 44px; }
#murojaahTab .legend { display: flex; flex-wrap: wrap; gap: 8px 14px; line-height: 1.5; }
#murojaahTab .peta-table { min-width: 640px; }
#murojaahTab .mur-peta-toggle { border: 0; background: transparent; color: inherit; font: inherit; padding: 5px 0; min-height: 44px; width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; cursor: pointer; }
#murojaahTab .mur-peta-toggle > svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--text-muted); }
#murojaahTab .mur-peta-toggle[aria-expanded="true"] > svg { transform: rotate(180deg); }
#murojaahTab .surat-cell { flex-wrap: wrap; gap: 4px 9px; }
#murojaahTab .surat-cell-name { overflow-wrap: anywhere; }
#murojaahTab .mur-peta-status { display: inline-block; max-width: 100%; box-sizing: border-box; padding: 4px 8px; border-radius: 8px; font-size: .72rem; font-weight: 600; line-height: 1.5; white-space: normal; }
#murojaahTab .mur-peta-status.is-lancar { background: #e5f1e4; color: #195437; }
#murojaahTab .mur-peta-status.is-cukup { background: #eef4df; color: #426231; }
#murojaahTab .mur-peta-status.is-kurang { background: #fff4d5; color: #805d09; }
#murojaahTab .mur-peta-status.is-belum_lancar { background: #fae9e6; color: #943d32; }
#murojaahTab .mur-peta-status:is(.is-belum,.is-bulan_lalu,.is-unknown) { background: #f0f1eb; color: #687469; }
#murojaahTab .mur-peta-grade { display: block; margin-top: 4px; color: var(--text-muted); font-size: .68rem; line-height: 1.5; }
#murojaahTab .riwayat-detail-item .badge { white-space: normal; text-align: right; line-height: 1.5; }
#murojaahTab .mur-history-heading { margin-top: 24px; flex-wrap: wrap; gap: 8px; }
#murojaahTab .mur-history-controls { display: grid; gap: 10px; margin: 14px 0 11px; }
#murojaahTab .mur-history-search { position: relative; }
#murojaahTab .mur-history-search > svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-muted); pointer-events: none; }
#murojaahTab #murojaahHistorySearch, #murojaahTab #murojaahHistoryGrade { box-sizing: border-box; width: 100%; min-height: 45px; padding: 11px 13px; border: 1px solid var(--sage); border-radius: 11px; background: white; color: var(--text); font: inherit; font-size: .85rem; }
#murojaahTab #murojaahHistorySearch { padding-left: 40px; }
#murojaahTab #murojaahHistoryResults { margin: 10px 0; color: var(--text-muted); font-size: .74rem; line-height: 1.5; }
#murojaahTab .history-item { padding: 16px; }
#murojaahTab .history-title { overflow-wrap: anywhere; }
#murojaahTab .history-date { flex-shrink: 0; }
#murojaahTab .mur-history-meta { margin: 5px 0 8px; font-size: .78rem; line-height: 1.5; color: var(--text-muted); }
#murojaahTab .history-badges .badge { white-space: normal; line-height: 1.5; }
#murojaahTab #btnToggleMurojaah { min-height: 44px; }
#murojaahTab .mur-encouragement { text-align: center; color: var(--text-muted); font-size: .8rem; margin: 22px 0 8px; line-height: 1.6; }
#murojaahTab :is(button,input,select):focus-visible, #murojaahTab summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.mur-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
#murojaahTab .mur-compact-list { display: none; }
#murojaahTab .mur-mobile-count { display: none; }
@media (min-width: 721px) {
 #murojaahTab .mur-history-controls { grid-template-columns: minmax(0,1fr) minmax(200px,260px); }
}
@media (max-width: 720px) {
 #murojaahTab :is(#petaSearch,#murojaahHistorySearch,#murojaahHistoryGrade) { font-size: 16px; }
 /* Tabel asli tetap utuh untuk desktop, bukan lagi dipaksa menjadi grid. */
 #murojaahTab .mur-peta-desktop { display: none; }
 #murojaahTab .mur-compact-list { display: block; list-style: none; margin: 10px 0 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
 #murojaahTab .mur-compact-item { display: block; list-style: none; margin: 0; padding: 0; border: 0; border-top: 1px solid var(--sage); border-radius: 0; background: transparent; box-shadow: none; }
 #murojaahTab .mur-compact-toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; box-sizing: border-box; width: 100%; min-height: 84px; margin: 0; padding: 11px 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; color: var(--text); text-align: left; font: inherit; line-height: 1.4; cursor: pointer; }
 #murojaahTab .mur-compact-copy { display: flex; flex-direction: column; gap: 3px; flex: 1 1 0; min-width: 0; }
 #murojaahTab .mur-compact-name { display: block; font-size: .94rem; font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
 #murojaahTab .mur-compact-meta { display: block; font-size: .78rem; line-height: 1.4; color: var(--text-muted); }
 #murojaahTab .mur-compact-date { display: block; font-size: .76rem; line-height: 1.4; color: var(--text-muted); }
 #murojaahTab .mur-compact-state { display: flex; align-items: center; justify-content: flex-end; gap: 4px; flex: 0 1 auto; max-width: 40%; min-width: 0; }
 #murojaahTab .mur-compact-state .mur-peta-status { font-size: .72rem; padding: 4px 8px; text-align: center; line-height: 1.4; }
 #murojaahTab .mur-compact-state > svg { width: 11px; height: 11px; flex-shrink: 0; color: var(--text-muted); }
 #murojaahTab .mur-compact-toggle[aria-expanded="true"] .mur-compact-state > svg { transform: rotate(180deg); }
 #murojaahTab .mur-compact-detail { padding: 10px 11px 14px; margin: 0 0 10px; background: #f6f8f1; border: 1px solid var(--sage); border-radius: 10px; }
 #murojaahTab .mur-compact-detail-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--text-muted); font-size: .74rem; }
 #murojaahTab .mur-compact-detail-heading [lang="ar"] { font-family: 'Traditional Arabic', 'Amiri', serif; font-size: 1.15rem; }
 #murojaahTab .mur-compact-detail-grade { margin: 6px 0 10px; color: var(--text-muted); font-size: .76rem; line-height: 1.5; }
 #murojaahTab .mur-compact-detail .riwayat-detail-item { padding: 9px; gap: 10px; }
 #murojaahTab .mur-compact-detail .riwayat-detail-left { min-width: 0; }
 #murojaahTab .mur-compact-empty { list-style: none; margin: 0; padding: 16px 0; color: var(--text-muted); font-size: .8rem; line-height: 1.6; text-align: center; }
 #murojaahTab .peta-card { padding: 16px 14px 8px; }
 #murojaahTab .peta-card-header { margin-bottom: 12px; gap: 8px; }
 #murojaahTab .mur-mobile-count { display: inline-block; flex: 0 0 auto; padding: 3px 7px; margin-top: 2px; border-radius: 10px; background: #eef3e7; color: var(--primary); font-size: .68rem; line-height: 1.5; white-space: nowrap; }
 #murojaahTab .peta-card .legend { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px 10px; margin: 9px 0 10px; }
 #murojaahTab .peta-card .legend-item { gap: 6px; font-size: .74rem; min-width: 0; line-height: 1.4; }
 #murojaahTab .peta-card .legend-dot { width: 8px; height: 8px; flex-shrink: 0; }
 #murojaahTab .peta-card .legend-item:nth-child(5) { display: none; }
 #murojaahTab #petaResultsStatus { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; margin: 0; padding: 0; }
 #murojaahTab .mur-peta-help { margin: 6px 0 0; padding-top: 7px; border-top: 1px solid var(--sage); }
 #murojaahTab .mur-peta-help summary { min-height: 32px; font-size: .72rem; }
 #murojaahTab .history-item-header { flex-direction: column; align-items: flex-start; gap: 5px; }
 #murojaahTab .history-item { padding: 14px; }
 body:has(#murojaahTab:not([hidden])) .fab-main { min-width: 96px; height: 46px; padding: 0 14px; }
 body:has(#murojaahTab:not([hidden])) .fab-main .input-fab-label { font-size: .82rem; }
 body:has(#murojaahTab:not([hidden])) .back-to-top { display: none; }
}

/* Dashboard guru — semua perubahan dibatasi body guru agar tampilan siswa tetap. */
.teacher-dashboard-page [hidden] { display: none !important; }
.teacher-dashboard-page .teacher-dashboard-top { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; }
.teacher-dashboard-page .greeting { min-width: 0; margin: 0; }
.teacher-dashboard-page .greeting h1 { font-size: 1.5rem; line-height: 1.45; }
.teacher-dashboard-page .greeting p { font-size: .85rem; line-height: 1.6; margin-top: 5px; }
.teacher-dashboard-page .teacher-text-button { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; min-height: 44px; padding: 8px 5px; color: var(--primary); background: transparent; border: 0; font: inherit; font-size: .78rem; cursor: pointer; text-decoration: underline; }
.teacher-dashboard-page .teacher-stats-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.teacher-dashboard-page .teacher-stat { margin: 0; padding: 15px; min-width: 0; min-height: 0; border: 1px solid var(--sage); border-radius: 16px; background: white; box-shadow: none; animation: none; text-align: left; color: var(--text); font-family: inherit; }
.teacher-dashboard-page .teacher-stat .stat-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 10px; }
.teacher-dashboard-page .teacher-stat .stat-card-header > svg { width: 21px; height: 21px; color: var(--primary); flex-shrink: 0; }
.teacher-dashboard-page .teacher-stat .stat-card-label { font-size: .8rem; line-height: 1.4; }
.teacher-dashboard-page .teacher-stat .stat-card-value { display: block; margin: 0 0 4px; font-size: 1.8rem; line-height: 1.2; font-weight: 800; color: var(--primary); }
.teacher-dashboard-page .teacher-stat .stat-card-trend { display: block; font-size: .7rem; margin: 0; line-height: 1.5; color: var(--text-muted); }
.teacher-dashboard-page .teacher-pending-stat { cursor: pointer; }
.teacher-dashboard-page .teacher-total-records { margin: 11px 0 18px; color: var(--text-muted); font-size: .78rem; }
.teacher-dashboard-page .teacher-total-records strong { color: var(--primary); }
.teacher-dashboard-page .teacher-review-panel { background: white; border: 1px solid var(--sage); border-radius: 16px; padding: 17px; margin-bottom: 16px; }
.teacher-dashboard-page .teacher-review-panel h2 { color: var(--heading, var(--text)); font-size: 1.05rem; margin: 0 0 7px; }
.teacher-dashboard-page .teacher-review-message { margin: 7px 0 11px; font-size: .78rem; line-height: 1.6; color: var(--text-muted); }
.teacher-dashboard-page .teacher-review-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--sage); text-decoration: none; color: var(--text); }
.teacher-dashboard-page .teacher-review-copy { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.teacher-dashboard-page .teacher-review-copy strong { font-size: .86rem; line-height: 1.4; overflow-wrap: anywhere; }
.teacher-dashboard-page .teacher-review-copy > span { color: var(--text-muted); font-size: .76rem; }
.teacher-dashboard-page .teacher-review-row > svg { width: 17px; height: 17px; flex-shrink: 0; color: var(--primary); }
.teacher-dashboard-page .teacher-review-more { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; min-height: 44px; margin: 0; padding: 12px 0 0; border: 0; border-top: 1px solid var(--sage); background: transparent; color: var(--primary); font: inherit; font-size: .78rem; font-weight: 600; text-align: left; cursor: pointer; }
.teacher-dashboard-page .teacher-review-more svg { width: 19px; height: 19px; flex-shrink: 0; }
.teacher-dashboard-page .quick-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.teacher-dashboard-page .quick-action-btn { min-width: 0; padding: 13px 11px; border-radius: 13px; gap: 9px; align-items: center; }
.teacher-dashboard-page .quick-action-btn .quick-action-icon { width: 28px; height: 28px; flex-shrink: 0; }
.teacher-dashboard-page .quick-action-text strong { font-size: .83rem; line-height: 1.4; }
.teacher-dashboard-page .quick-action-text > span { display: none; }
.teacher-dashboard-page .teacher-list-tools { margin: 16px 0 12px; }
.teacher-dashboard-page .teacher-search-wrap { position: relative; }
.teacher-dashboard-page .teacher-search-wrap > svg { position: absolute; width: 18px; height: 18px; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.teacher-dashboard-page #teacherStudentSearch { box-sizing: border-box; width: 100%; min-height: 46px; padding: 11px 14px 11px 41px; border: 1px solid var(--sage); border-radius: 11px; background: white; color: var(--text); font: inherit; font-size: .85rem; }
.teacher-dashboard-page .teacher-filter-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-top: 10px; }
.teacher-dashboard-page .teacher-filters { display: flex; flex-wrap: wrap; gap: 7px; }
.teacher-dashboard-page .teacher-filter { border: 1px solid var(--sage); border-radius: 10px; background: transparent; color: var(--text-muted); min-height: 40px; padding: 8px 12px; font: inherit; font-size: .78rem; font-weight: 600; cursor: pointer; }
.teacher-dashboard-page .teacher-filter.is-active { color: white; border-color: var(--primary); background: var(--primary); }
.teacher-dashboard-page #teacherStudentResults { margin: 9px 0 13px; color: var(--text-muted); font-size: .74rem; line-height: 1.5; }
.teacher-dashboard-page .teacher-load-error, .teacher-dashboard-page .teacher-no-results { padding: 14px; margin: 12px 0; border-radius: 11px; background: #f7f5e9; color: var(--text-muted); font-size: .8rem; line-height: 1.6; }
.teacher-dashboard-page .siswa-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.teacher-dashboard-page .teacher-student-card { position: relative; display: flex; align-items: flex-start; gap: 12px; min-width: 0; padding: 15px; border: 1px solid var(--sage); border-radius: 15px; background: white; text-decoration: none; color: var(--text); box-shadow: none; }
.teacher-dashboard-page .teacher-avatar { width: 44px; height: 44px; flex: 0 0 44px; display: inline-grid; place-items: center; border-radius: 50%; background: #e6efdf; color: var(--primary); font-size: .8rem; font-weight: 700; }
.teacher-dashboard-page .teacher-student-copy { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.teacher-dashboard-page .teacher-student-name { font-size: .9rem; line-height: 1.4; font-weight: 700; overflow-wrap: anywhere; }
.teacher-dashboard-page .teacher-student-username { color: var(--text-muted); font-size: .75rem; line-height: 1.4; overflow-wrap: anywhere; }
.teacher-dashboard-page .teacher-online-status { display: flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: .72rem; line-height: 1.5; }
.teacher-dashboard-page .teacher-online-status .hk-online-dot { position: static; width: 7px; height: 7px; flex: 0 0 7px; margin: 0; box-shadow: none; }
.teacher-dashboard-page .teacher-online-status.is-online-text { color: var(--primary); }
.teacher-dashboard-page .teacher-student-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 5px; padding-top: 8px; border-top: 1px solid #edf0e6; color: var(--text-muted); font-size: .75rem; line-height: 1.5; }
.teacher-dashboard-page .teacher-pending-badge { display: inline-block; padding: 2px 7px; border-radius: 8px; background: #fff0cf; color: #865810; font-size: .69rem; font-weight: 600; }
.teacher-dashboard-page .teacher-status-unknown { font-size: .69rem; color: #8a6a2e; line-height: 1.5; }
.teacher-dashboard-page .teacher-student-arrow { width: 15px; height: 15px; flex: 0 0 15px; align-self: center; color: var(--primary); }
.teacher-dashboard-page button:disabled { opacity: .55; cursor: default; }
.teacher-dashboard-page :is(button,a,input):focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.teacher-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 720px) {
 .teacher-dashboard-page .teacher-dashboard-top { gap: 9px; }
 .teacher-dashboard-page .greeting h1 { font-size: 1.28rem; }
 .teacher-dashboard-page .greeting p { font-size: .78rem; }
 .teacher-dashboard-page .teacher-stats-grid { gap: 10px; }
 .teacher-dashboard-page .teacher-stat { padding: 13px; }
 .teacher-dashboard-page .teacher-stat .stat-card-header > svg { width: 18px; height: 18px; }
 .teacher-dashboard-page .teacher-stat .stat-card-label { font-size: .76rem; }
 .teacher-dashboard-page .siswa-grid { grid-template-columns: minmax(0,1fr); }
 .teacher-dashboard-page #teacherStudentSearch { font-size: 16px; }
 .teacher-dashboard-page .section-header { gap: 10px; flex-wrap: wrap; align-items: flex-start; }
 .teacher-dashboard-page .section-header .btn-add { min-height: 44px; }
}
@media (min-width: 1100px) { .teacher-dashboard-page .siswa-grid { grid-template-columns: repeat(3,minmax(0,1fr)); } }

/* Detail guru: scoped to avoid changing the student and teacher dashboard. */
.teacher-detail-page [hidden] { display: none !important; }
.teacher-detail-page .detail-state { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px 16px; margin:14px 0; border:1px solid #d7e1d2; border-radius:14px; background:#f0f4eb; color:var(--primary); font-size:.85rem; }
.teacher-detail-page .detail-state button,.teacher-detail-page #detailOpenPending { border:0; background:transparent; color:var(--primary); font:inherit; font-weight:700; cursor:pointer; min-height:44px; padding:8px; white-space:nowrap; }
.teacher-detail-page .pending-header { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.teacher-detail-page #detailOpenPending { margin-left:auto; }
.teacher-detail-page .detail-review-panel { background:#fff; border:1px solid #e1e7dc; border-radius:20px; padding:22px; margin-top:22px; scroll-margin-top:110px; }
.teacher-detail-page .detail-review-panel .riwayat-section-title { margin:0; }
.teacher-detail-page .detail-review-intro,.teacher-detail-page .detail-review-count,.teacher-detail-page .detail-review-footnote { color:var(--text-muted); font-size:.82rem; line-height:1.6; margin:8px 0 16px; }
.teacher-detail-page .detail-review-footnote { font-size:.75rem; margin-bottom:0; }
.teacher-detail-page .detail-review-tools { display:grid; grid-template-columns:minmax(0,1fr) minmax(150px,.45fr); gap:12px; }
.teacher-detail-page .detail-review-tools label { font-size:.75rem; font-weight:600; color:var(--text-muted); min-width:0; }
.teacher-detail-page .detail-review-tools input,.teacher-detail-page .detail-review-tools select { box-sizing:border-box; display:block; width:100%; min-height:44px; border:1px solid #d7dfd2; border-radius:10px; background:#fafbf8; padding:10px 12px; margin-top:5px; font:inherit; font-size:.875rem; color:var(--text); }
.teacher-detail-page .detail-review-filters { display:flex; gap:6px; flex-wrap:wrap; margin-top:14px; }
.teacher-detail-page .detail-review-filters button { border:1px solid #d7dfd2; background:#fff; color:var(--primary); border-radius:999px; min-height:44px; padding:8px 13px; font:inherit; font-size:.8rem; font-weight:600; cursor:pointer; }
.teacher-detail-page .detail-review-filters button.active { background:var(--primary); border-color:var(--primary); color:#fff; }
.teacher-detail-page .detail-review-item { box-shadow:none; border:1px solid #e0e6db; padding:16px; margin:0; }
.teacher-detail-page .detail-review-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:10px; }
.teacher-detail-page .detail-review-heading h4 { font-size:1rem; line-height:1.5; margin:0; overflow-wrap:anywhere; color:var(--primary); }
.teacher-detail-page .detail-review-heading h4 span { font-weight:500; font-size:.88rem; }
.teacher-detail-page .detail-review-heading p { font-size:.78rem; color:var(--text-muted); margin:4px 0 10px; }
.teacher-detail-page .detail-review-note { font-size:.82rem; line-height:1.6; margin:10px 0 0; overflow-wrap:anywhere; }
.teacher-detail-page .detail-review-item .history-actions { display:flex; gap:8px; padding-top:12px; margin-top:12px; border-top:1px solid #eef0e9; }
.teacher-detail-page .detail-review-item .history-actions button { min-height:44px; font-size:.82rem; flex:1; }
.teacher-detail-page .detail-more { position:relative; flex:0 0 auto; }
.teacher-detail-page .detail-more summary { display:flex; align-items:center; justify-content:center; width:44px; height:44px; border-radius:10px; cursor:pointer; color:var(--text-muted); list-style:none; }
.teacher-detail-page .detail-more summary::-webkit-details-marker { display:none; }
.teacher-detail-page .detail-more[open] summary { background:#f3f5ef; }
.teacher-detail-page .detail-more button { position:absolute; right:0; top:44px; z-index:3; white-space:nowrap; padding:12px 16px; min-height:44px; border:1px solid #eed6d0; border-radius:10px; background:#fff; color:#b2382d; box-shadow:0 8px 22px #143b2620; font:inherit; font-size:.8rem; cursor:pointer; }
.teacher-detail-page .detail-count-note { margin:12px 0 22px; font-size:.78rem; color:var(--text-muted); line-height:1.7; }
.teacher-detail-page .detail-count-note summary { cursor:pointer; padding:10px 0; }
.teacher-detail-page button:disabled { opacity:.55; cursor:wait; }
.teacher-detail-page :is(button,input,select,summary):focus-visible { outline:3px solid #72a98b; outline-offset:3px; }
.teacher-detail-page .detail-peta-mobile { display:none; }
@media(max-width:600px) {
 .teacher-detail-page .siswa-info-card { padding:16px; gap:12px; flex-wrap:wrap; }
 .teacher-detail-page .siswa-info-text { flex:1; min-width:0; }
 .teacher-detail-page .siswa-info-text h1 { font-size:1.1rem; overflow-wrap:anywhere; }
 .teacher-detail-page .siswa-actions { flex-basis:100%; display:flex; justify-content:flex-end; gap:8px; }
 .teacher-detail-page .detail-stats-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
 .teacher-detail-page .detail-stats-grid .stat-card { padding:16px; min-width:0; }
 .teacher-detail-page .detail-stats-grid .stat-card:last-child { grid-column:1/-1; }
 .teacher-detail-page .detail-review-panel { padding:16px; border-radius:16px; }
 .teacher-detail-page .detail-review-tools { grid-template-columns:minmax(0,1fr); gap:10px; }
 .teacher-detail-page .detail-review-filters { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
 .teacher-detail-page .detail-review-item { padding:14px; }
 .teacher-detail-page .detail-review-heading h4 span { display:block; }
 .teacher-detail-page .detail-state { align-items:flex-start; }
 .teacher-detail-page .detail-peta-desktop { display:none; }
 .teacher-detail-page .detail-peta-mobile { display:block; }
 .teacher-detail-page .detail-peta-row { border-bottom:1px solid #e4e9df; }
 .teacher-detail-page .detail-peta-row:last-child { border-bottom:0; }
 .teacher-detail-page .detail-peta-row>button { display:flex; align-items:center; justify-content:space-between; gap:10px; width:100%; border:0; background:transparent; padding:14px 0; text-align:left; font:inherit; color:var(--primary); cursor:pointer; }
 .teacher-detail-page .detail-peta-row>button>span:first-child { min-width:0; }
 .teacher-detail-page .detail-peta-row strong { display:block; font-size:.95rem; overflow-wrap:anywhere; }
 .teacher-detail-page .detail-peta-row small { display:block; color:var(--text-muted); font-size:.75rem; line-height:1.6; }
 .teacher-detail-page .detail-peta-row .badge { flex:0 0 auto; max-width:42%; white-space:normal; font-size:.7rem; }
 .teacher-detail-page .detail-peta-row ul { margin:0 0 12px; padding:12px 12px 12px 26px; background:#f5f7f1; border-radius:10px; font-size:.75rem; color:var(--text-muted); line-height:1.8; }
 .teacher-detail-page .detail-peta-row li strong { display:inline; font-size:inherit; }
}

/* Hafaluma identity: retain the existing page layouts and approved avatars. */
.brand-page { --heading:var(--primary); --primary:#075c42; --primary-dark:#064632; --primary-light:#28765a; }
.brand-page .hf-brand { display:inline-flex; align-items:center; gap:10px; text-decoration:none; color:inherit; flex-shrink:0; }
.brand-page .hf-brand__symbol { width:42px; height:42px; flex-shrink:0; perspective:650px; display:block; }
.brand-page .hf-brand__emblem { display:block; width:100%; height:100%; object-fit:contain; transform:rotateX(var(--hf-rx,0deg)) rotateY(var(--hf-ry,0deg)) translateY(var(--hf-y,0px)) scale(var(--hf-scale,1)); transition:transform 280ms cubic-bezier(.22,1,.36,1); }
.brand-page .hf-brand__word { display:block; width:144px; height:auto; }
.brand-page .hf-brand:focus-visible { outline:3px solid #3a9675; outline-offset:5px; border-radius:5px; }
.brand-page .login-brand { animation:none; }
.brand-page .login-brand h1 { background:none; -webkit-text-fill-color:currentColor; margin:0; line-height:1; }
.brand-page .brand-identity { display:flex; flex-direction:column; align-items:flex-start; gap:4px; position:relative; z-index:1; }
.brand-page .login-wordmark { width:180px; max-width:100%; height:auto; display:block; }
.brand-page .login-brand .hf-brand__symbol { width:84px; height:84px; margin-bottom:20px; position:relative; z-index:1; }
.brand-page .login-brand .hf-brand__emblem { border-radius:20px; filter:drop-shadow(0 8px 16px #0002); }
.brand-page .brand-tagline { font-size:.875rem; font-weight:400; line-height:1.4; color:#faf7ee; opacity:.9; margin:0; position:relative; z-index:1; }
.brand-page .brand-desc { max-width:320px; font-size:.95rem; line-height:1.6; margin:22px 0 32px; }
.brand-page .report-brand-mark { width:64px; height:64px; border-radius:0; box-shadow:none; object-fit:contain; }
.brand-page .report-brand-name { display:block; font-size:13px; letter-spacing:.03em; color:#075c42; margin-bottom:4px; }
@media(max-width:720px) {
 .brand-page .topbar .hf-brand__word { display:none; }
 .brand-page .topbar .hf-brand__symbol { width:36px; height:36px; }
 .brand-page .login-wordmark { width:160px; }
 .brand-page .login-brand .hf-brand__symbol { width:64px; height:64px; margin-bottom:20px; }
 .brand-page .brand-tagline { font-size:.875rem; }
 .brand-page .brand-desc { margin:20px 0 24px; font-size:.9rem; }
}
@media(prefers-reduced-motion:reduce) {
 .brand-page .hf-brand__emblem { transform:none!important; transition:none!important; animation:none!important; filter:none!important; }
}
@media print { .brand-page .hf-brand__emblem { transform:none!important; filter:none!important; } }

/* Greeting hand: native color emoji, as requested from the portfolio reference. */
.brand-page .student-heading .greet-name-group { display:inline-flex; align-items:center; max-width:100%; vertical-align:baseline; font:inherit; color:inherit; }
.brand-page .student-heading #greetName { min-width:0; overflow-wrap:anywhere; color:inherit; }
.brand-page .greet-wave { display:inline-block; width:1.12em; height:1.12em; flex-shrink:0; margin-left:.16em; vertical-align:-.14em; color:inherit; }
.brand-page .greet-wave__hand { display:block; width:100%; height:100%; font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif; font-size:1em; font-weight:400; font-style:normal; line-height:1.12; transform-origin:70% 75%; animation:hf-greeting-wave 1.4s ease-in-out 2; }
@keyframes hf-greeting-wave {
  0%,100% { transform:rotate(0deg); }
  15% { transform:rotate(14deg); }
  30% { transform:rotate(-8deg); }
  45% { transform:rotate(12deg); }
  60% { transform:rotate(-5deg); }
  75% { transform:rotate(0deg); }
}
@media(prefers-reduced-motion:reduce) {
 .brand-page .greet-wave__hand { animation:none; transform:none; }
}
