/* ============================================================
   Murajaah Harian — Design System (CSS Lokal)
   Tanpa Tailwind. Satu sumber kebenaran untuk warna, spasi,
   tipografi, dan komponen.
   ============================================================ */

/* ---------- 1. DESIGN TOKENS ---------- */
:root {
  /* Brand — hijau emerald (identitas utama) + emas (aksen) */
  --emerald-950: #03110f;
  --emerald-900: #051a18;
  --emerald-800: #0a2d2a;
  --emerald-700: #065f46;
  --emerald-600: #047857;
  --emerald-500: #059669;
  --emerald-400: #10b981;
  --emerald-100: #d1fae5;
  --emerald-50:  #ecfdf5;

  --gold-600: #a97e1a;
  --gold-500: #c59b27;
  --gold-400: #e3c567;
  --gold-100: #fbf3dd;

  /* Netral */
  --ink-900: #0f172a;
  --ink-700: #334155;
  --ink-600: #475569;
  --ink-500: #64748b;
  --ink-400: #94a3b8;
  --ink-300: #cbd5e1;
  --ink-200: #e2e8f0;
  --ink-100: #f1f5f9;
  --ink-50:  #f8fafc;

  /* Semantik */
  --success:       #047857;
  --success-strong:#065f46;
  --success-bg:    #ecfdf5;
  --warning:       #b45309;
  --warning-bg:    #fffbeb;
  --danger:        #dc2626;
  --danger-bg:     #fef2f2;
  --info:          #1d4ed8;
  --info-bg:       #eff6ff;

  /* Spasi (skala 4px) */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px; --s12: 48px;

  /* Radius */
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 24px; --r-full: 9999px;

  /* Tipografi */
  --font-serif: Georgia, 'Times New Roman', serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --fs-xs: 12px; --fs-sm: 14px; --fs-base: 16px; --fs-lg: 18px;
  --fs-xl: 20px; --fs-2xl: 24px; --fs-3xl: 30px;

  /* Elevasi */
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06);
  --shadow-md: 0 4px 6px -1px rgba(15,23,42,.10);
  --shadow-lg: 0 12px 24px -6px rgba(15,23,42,.15);
}

/* ---------- 2. RESET & DASAR ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--ink-900);
  background: #faf9f6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 700; line-height: 1.25; color: var(--ink-900); }
a { color: var(--emerald-700); text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ---------- 3. LAYOUT ---------- */
.container-main { width: 94%; max-width: 1150px; margin: 0 auto; }
.container-narrow { width: 92%; max-width: 480px; margin: 0 auto; }

/* ---------- 4. KOMPONEN ---------- */

/* Tombol */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 44px; padding: var(--s3) var(--s5);
  border: 1px solid transparent; border-radius: var(--r-md);
  font-weight: 700; font-size: var(--fs-sm); line-height: 1;
  cursor: pointer; transition: background .15s ease, transform .1s ease, box-shadow .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--emerald-700); color: #fff; }
.btn-primary:hover { background: var(--emerald-600); }
.btn-gold { background: var(--gold-500); color: #fff; }
.btn-gold:hover { background: var(--gold-600); }
.btn-secondary { background: #fff; color: var(--ink-700); border-color: var(--ink-200); }
.btn-secondary:hover { background: var(--ink-50); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-ghost { background: transparent; color: var(--ink-600); }
.btn-ghost:hover { background: var(--ink-100); }
.btn-block { width: 100%; }

/* Input */
.input {
  width: 100%; min-height: 44px; padding: var(--s3) var(--s4);
  border: 1px solid var(--ink-300); border-radius: var(--r-md);
  background: #fff; font-size: var(--fs-base);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus { outline: none; border-color: var(--emerald-600); box-shadow: 0 0 0 3px rgba(5,150,105,.15); }
.input::placeholder { color: var(--ink-400); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.label { display: block; font-weight: 600; font-size: var(--fs-sm); color: var(--ink-700); margin-bottom: var(--s2); }

/* Kartu */
.card {
  background: #fff; border: 1px solid var(--ink-200);
  border-radius: var(--r-xl); padding: var(--s6);
  box-shadow: var(--shadow-sm);
}
.card-header { margin-bottom: var(--s4); }

/* Badge */
.badge {
  display: inline-flex; align-items: center; gap: var(--s1);
  padding: var(--s1) var(--s3); border-radius: var(--r-full);
  font-size: var(--fs-xs); font-weight: 700; line-height: 1.4; white-space: nowrap;
}
.badge-success { background: var(--success-bg); color: var(--success-strong); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger); }
.badge-info    { background: var(--info-bg);    color: var(--info); }
.badge-neutral { background: var(--ink-100);    color: var(--ink-600); }
.badge-gold    { background: var(--gold-100);   color: var(--gold-600); }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(15,23,42,.5);
  display: flex; align-items: center; justify-content: center; padding: var(--s4);
}
.modal {
  width: 100%; max-width: 460px; max-height: 90vh; overflow-y: auto;
  background: #fff; border-radius: var(--r-xl); padding: var(--s6);
  box-shadow: var(--shadow-lg);
}

/* Toast */
.toast {
  position: fixed; bottom: var(--s6); left: 50%; transform: translateX(-50%);
  z-index: 100; background: var(--ink-900); color: #fff;
  padding: var(--s3) var(--s5); border-radius: var(--r-md);
  font-size: var(--fs-sm); box-shadow: var(--shadow-lg);
  animation: toast-in .25s ease;
}
.toast-success { background: var(--success-strong); }
.toast-error { background: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, var(--ink-100) 25%, var(--ink-200) 50%, var(--ink-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease infinite; border-radius: var(--r-md);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ---------- 5. AKSESIBILITAS ---------- */
:focus-visible { outline: 3px solid var(--emerald-700); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
@media (pointer: coarse) {
  button, [role="button"], a.btn { min-height: 44px; }
}


/* ===== Layar Login ===== */
.hidden { display: none !important; }
.animate-spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.login-screen {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; justify-content: center;
  padding: 0 16px;
  background: radial-gradient(circle at 50% 0%, #0a2d2a, #051a18 85%);
}
.login-card {
  position: relative; overflow: hidden;
  max-width: 448px; width: 100%; margin: 0 auto;
  background: #fff; border-radius: 32px; padding: 32px;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,.45);
}
.login-pattern {
  position: absolute; inset: 0; opacity: .05; pointer-events: none;
  background: radial-gradient(#051a18 1px, transparent 1px);
  background-size: 24px 24px;
}
.pengelola-area { position: relative; z-index: 10; text-align: center; margin-bottom: 24px; }
.pengelola-toggle { background: none; border: 0; color: #94a3b8; font-size: 11px; font-weight: 600; cursor: pointer; }
.pengelola-toggle:hover { color: #047857; }
.pengelola-menu { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.pengelola-link { font-size: 11px; font-weight: 700; padding: 8px 12px; border-radius: 12px; background: #f1f5f9; color: #475569; }
.pengelola-link:hover { background: #ecfdf5; color: #065f46; }
.login-head { position: relative; z-index: 10; text-align: center; margin-bottom: 24px; }
.login-logo {
  width: 64px; height: 64px; margin: 0 auto 12px;
  background: #fefcf7; border: 1px solid #d1fae5; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #065f46; font-size: 24px; box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.login-title { font-size: 20px; font-weight: 800; color: #051a18; }
.login-subtitle { font-size: 12px; color: #64748b; margin-top: 4px; font-weight: 500; }
.field-stack { display: flex; flex-direction: column; gap: 16px; margin-bottom: 24px; }
.field { position: relative; z-index: 10; }
.field-label { display: block; font-size: 10px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; padding-left: 4px; }
.input-wrap { position: relative; }
.input-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: 14px; }
.input-with-icon { padding-left: 44px; background: #fefcf7; }
.login-error { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; color: #dc2626; background: #fef2f2; border: 1px solid #fee2e2; padding: 12px; border-radius: 12px; margin-bottom: 16px; font-weight: 600; text-align: center; }
.login-submit { position: relative; z-index: 10; }
.login-footer { text-align: center; color: rgba(255,255,255,.3); font-size: 10px; margin-top: 24px; letter-spacing: .025em; }
.school-list { display: flex; flex-direction: column; gap: 8px; max-height: 224px; overflow-y: auto; padding-right: 4px; }
.back-link { display: block; width: 100%; margin-top: 12px; font-size: 12px; color: #047857; font-weight: 600; background: none; border: 0; cursor: pointer; }
.back-link:hover { text-decoration: underline; }


/* ===== Dashboard Santri ===== */
.dashboard { max-width: 1152px; margin: 0 auto; padding: 16px; }
.dashboard-grid { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 1024px) { .dashboard-grid { grid-template-columns: 1fr 2fr; } }
.col { display: flex; flex-direction: column; gap: 24px; }

.arch-header { position: relative; background: linear-gradient(135deg, #051a18 0%, #0a2d2a 70%, #164e48 100%); border-radius: 28px; padding: 32px 24px 40px; color: #faf8f5; box-shadow: 0 10px 25px rgba(5,26,24,.15); overflow: hidden; text-align: center; margin-bottom: 24px; }
.header-pattern { position: absolute; inset: 0; opacity: .08; pointer-events: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cpath d='M30 0 L60 30 L30 60 L0 30 Z M30 10 L50 30 L30 50 L10 30 Z' fill='%23C59B27' fill-rule='evenodd'/%3E%3C/svg%3E"); background-repeat: repeat; }
.header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; position: relative; z-index: 10; }
.header-tools { display: flex; align-items: center; gap: 8px; }
.school-chip { font-size: 9px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.1); padding: 4px 12px; border-radius: 9999px; color: #6ee7b7; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.streak-chip { background: rgba(245,158,11,.2); border: 1px solid rgba(251,191,36,.3); color: #fcd34d; font-size: 12px; font-weight: 800; padding: 4px 12px; border-radius: 9999px; display: flex; align-items: center; gap: 6px; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.icon-btn { width: 36px; height: 36px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.1); border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-btn:hover { background: rgba(255,255,255,.2); }
.header-name { font-size: 24px; font-weight: 800; color: #fff; margin-bottom: 6px; position: relative; z-index: 10; }
.header-basmalah { font-size: 12px; color: #f0d58c; font-weight: 700; position: relative; z-index: 10; font-family: Amiri, serif; }

.card-title-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.section-title { font-size: 12px; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: .05em; padding-left: 4px; }
.muted { font-size: 12px; color: #94a3b8; }
.mini-chip { font-size: 9px; background: #ecfdf5; color: #065f46; padding: 2px 8px; border-radius: 4px; font-weight: 700; }
.select-inline { font-size: 12px; font-weight: 700; padding: 6px 12px; background: #fefcf7; border: 1px solid #e2e8f0; border-radius: 12px; color: #065f46; }

.stat-center { text-align: center; padding: 8px 0; }
.stat-label { font-size: 10px; color: #94a3b8; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 2px; }
.stat-value { font-size: 48px; font-weight: 900; color: #065f46; line-height: 1; }
.stat-sub { font-size: 12px; color: #64748b; font-weight: 600; margin-bottom: 12px; }
.progress-meta { display: flex; justify-content: space-between; font-size: 10px; color: #64748b; margin-bottom: 6px; padding: 0 4px; font-weight: 700; }
.progress-bar { width: 100%; background: #f1f5f9; border-radius: 9999px; height: 12px; padding: 1px; border: 1px solid rgba(226,232,240,.5); }
.progress-fill { background: linear-gradient(90deg, #047857, #f59e0b); height: 100%; border-radius: 9999px; transition: width 1s; }

.action-row { display: flex; gap: 12px; }
.btn-outline { flex: 1; background: #fff; border: 1px solid #e2e8f0; color: #334155; padding: 12px; border-radius: 16px; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.btn-outline:hover { border-color: #047857; color: #065f46; }
.btn-whatsapp { flex: 1; background: #047857; color: #fff; padding: 12px; border-radius: 16px; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; }
.btn-whatsapp:hover { background: #065f46; }

.section-head { display: flex; justify-content: space-between; align-items: center; padding: 16px; border-radius: 24px; background: #fff; border: 1px solid #e2e8f0; box-shadow: 0 6px 20px rgba(5,26,24,.04); }
.section-head h3 { font-weight: 800; color: #051a18; font-size: 16px; }
.section-head p { font-size: 12px; color: #64748b; }
.btn-add { background: linear-gradient(135deg, #164e48, #0a2d2a); color: #faf8f5; box-shadow: 0 4px 15px rgba(5,26,24,.2); padding: 12px 20px; border-radius: 16px; font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 8px; cursor: pointer; border: 0; }
.btn-add:hover { box-shadow: 0 6px 20px rgba(5,26,24,.35); }

.logs-list { display: flex; flex-direction: column; gap: 14px; }
.log-card { background: #fff; border: 1px solid #e5ddd0; border-radius: 24px; padding: 20px; box-shadow: 0 6px 20px rgba(5,26,24,.04); transition: all .3s; }
.log-card:hover { border-color: #164e48; box-shadow: 0 10px 28px rgba(5,26,24,.08); }
.log-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.log-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.log-surah { font-weight: 700; font-size: 14px; color: #0f172a; letter-spacing: .02em; }
.juz-chip { font-size: 9px; background: #ecfdf5; color: #065f46; border: 1px solid #d1fae5; font-weight: 700; padding: 2px 8px; border-radius: 6px; }
.log-meta { font-size: 12px; color: #64748b; margin-top: 4px; font-weight: 500; }
.log-right { text-align: right; }
.log-date { font-size: 12px; color: #94a3b8; font-weight: 500; display: block; }
.delete-link { font-size: 10px; color: #dc2626; font-weight: 700; margin-top: 4px; display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; cursor: pointer; }
.delete-link:hover { color: #b91c1c; }
.audio-row { margin-top: 12px; background: #f8fafc; padding: 10px; border-radius: 12px; border: 1px solid #f1f5f9; display: flex; align-items: center; gap: 12px; }
.audio-player { width: 100%; height: 32px; background: transparent; }
.note-box { margin-top: 10px; background: rgba(255,251,235,.7); border: 1px solid rgba(253,230,138,.6); border-radius: 12px; padding: 10px; font-size: 12px; color: #78350f; display: flex; align-items: flex-start; gap: 8px; }
.empty-state { padding: 32px; text-align: center; color: #94a3b8; border-radius: 28px; background: #fff; border: 1px solid #e2e8f0; }
.surah-row { display: flex; justify-content: space-between; align-items: center; font-size: 12px; padding: 8px 0; border-bottom: 1px solid rgba(241,245,249,.6); }
.surah-name { font-weight: 600; color: #1f2937; }
.surah-count { color: #047857; font-weight: 700; background: #ecfdf5; padding: 2px 8px; border-radius: 6px; }
.surah-list { display: flex; flex-direction: column; gap: 8px; max-height: 224px; overflow-y: auto; padding-right: 4px; }

.form-grid-3 { display: grid; grid-template-columns: 1fr 2fr; gap: 12px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.record-area { background: #fefcf7; border: 1px solid #e2e8f0; border-radius: 16px; padding: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 85px; position: relative; }
.rec-btn { width: 44px; height: 44px; border-radius: 50%; background: #ecfdf5; border: 1px solid #d1fae5; color: #047857; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.rec-btn:hover { background: #d1fae5; }
.rec-btn-danger { background: #fef2f2; border-color: #fee2e2; color: #dc2626; }
.rec-btn-danger:hover { background: #fee2e2; }
.rec-label { font-size: 9px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.rec-timer { font-size: 12px; font-weight: 600; font-family: monospace; color: #dc2626; padding-left: 16px; }

.floating-nav { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); width: 90%; max-width: 384px; background: rgba(255,255,255,.95); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid #e5ddd0; border-radius: 9999px; padding: 12px 32px; display: flex; justify-content: space-between; align-items: center; z-index: 40; box-shadow: 0 6px 30px rgba(5,26,24,.08); }
@media (min-width: 1024px) { .floating-nav { display: none; } }
.nav-btn { color: #047857; display: flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: 0; cursor: pointer; }
.nav-btn-gray { color: #94a3b8; }
.nav-label { font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.nav-fab { background: linear-gradient(135deg, #164e48, #0a2d2a); color: #faf8f5; width: 52px; height: 52px; border-radius: 50%; margin-top: -36px; border: 4px solid #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 15px rgba(5,26,24,.2); cursor: pointer; }

.badge-mumtaz { background: #ecfdf5; color: #065f46; }
.badge-jayyid { background: #eff6ff; color: #1e40af; }
.badge-ulang { background: #fef2f2; color: #991b1b; }
.badge-wait { background: #fffbeb; color: #92400e; }

.rec-idle { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.stat-total { font-weight: 700; color: #047857; }
@keyframes ping { 75%, 100% { transform: scale(2.2); opacity: 0; } }
.animate-ping { animation: ping 1s cubic-bezier(0,0,.2,1) infinite; }
@media (max-width: 1023px) { .dashboard { padding-bottom: 24px; } }
body { padding-bottom: 0; }


/* ===== Portal Ustadz ===== */
.tab-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; background: #fff; padding: 6px; border-radius: 16px; border: 1px solid #e2e8f0; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.tab-btn { background: transparent; color: #64748b; padding: 10px 16px; border-radius: 12px; font-weight: 700; font-size: 12px; display: flex; align-items: center; gap: 8px; border: 0; cursor: pointer; transition: all .15s; }
.tab-btn:hover { color: #065f46; }
.tab-btn-active { background: #065f46; color: #fff; padding: 10px 16px; border-radius: 12px; font-weight: 700; font-size: 12px; display: flex; align-items: center; gap: 8px; border: 0; cursor: pointer; }
.filter-bar { display: flex; flex-direction: column; gap: 16px; justify-content: space-between; align-items: center; padding: 16px; border-radius: 16px; background: #fff; border: 1px solid #d1fae5; margin-bottom: 24px; }
@media (min-width: 768px) { .filter-bar { flex-direction: row; } }
.filter-item { display: flex; align-items: center; gap: 8px; }
.filter-label { font-size: 12px; font-weight: 700; color: #64748b; white-space: nowrap; }
.filter-select { padding: 10px; background: #fefcf7; border: 1px solid #e2e8f0; border-radius: 12px; font-size: 12px; font-weight: 700; color: #1f2937; min-width: 160px; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stat-card { display: flex; flex-direction: column; justify-content: center; padding: 16px; border-radius: 16px; background: #fff; border: 1px solid #e2e8f0; box-shadow: 0 6px 20px rgba(5,26,24,.04); }
.stat-card-label { font-size: 9px; color: #94a3b8; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.stat-card-value { font-size: 24px; font-weight: 900; color: #051a18; margin-top: 2px; }
.search-wrap { position: relative; width: 100%; }
@media (min-width: 768px) { .search-wrap { width: 320px; } }
.search-input { width: 100%; padding: 10px 16px 10px 44px; background: #fefcf7; border: 1px solid #e2e8f0; border-radius: 12px; font-size: 14px; color: #1f2937; }
.search-input:focus { outline: none; border-color: #047857; }
.search-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: 14px; }
.refresh-btn { width: 40px; height: 40px; border: 1px solid #e2e8f0; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: #065f46; background: #fefcf7; cursor: pointer; }
.refresh-btn:hover { border-color: #047857; }

.accordion-card { border-radius: 24px; overflow: hidden; border: 1px solid #e2e8f0; box-shadow: 0 1px 2px rgba(0,0,0,.05); background: #fff; }
.accordion-head { padding: 16px; background: #fefcf7; cursor: pointer; display: flex; flex-direction: column; gap: 12px; justify-content: space-between; align-items: flex-start; }
.accordion-head:hover { background: #f0fdf4; }
@media (min-width: 640px) { .accordion-head { flex-direction: row; align-items: center; } }
.avatar-initial { width: 44px; height: 44px; border-radius: 16px; background: #065f46; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 18px; flex-shrink: 0; }
.accordion-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.accordion-name { font-weight: 800; font-size: 16px; color: #111827; }
.accordion-sub { font-size: 12px; color: #94a3b8; font-weight: 400; }
.accordion-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #64748b; margin-top: 2px; font-weight: 500; }
.accordion-body { padding: 16px; background: #f8fafc; border-top: 1px solid #f1f5f9; display: flex; flex-direction: column; gap: 12px; }
.chevron-btn { width: 32px; height: 32px; border-radius: 50%; background: #fff; border: 1px solid #e2e8f0; display: flex; align-items: center; justify-content: center; color: #64748b; }
.badge-pending { display: inline-flex; align-items: center; gap: 4px; background: #fef3c7; color: #92400e; border: 1px solid #fde68a; font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 9999px; }
.badge-done { display: inline-flex; align-items: center; gap: 4px; background: #ecfdf5; color: #065f46; border: 1px solid #d1fae5; font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 9999px; }
.log-row { background: #fff; padding: 16px; border-radius: 16px; border: 1px solid #e2e8f0; box-shadow: 0 1px 2px rgba(0,0,0,.05); display: flex; flex-direction: column; gap: 12px; justify-content: space-between; align-items: flex-start; }
.log-row:hover { border-color: #6ee7b7; }
@media (min-width: 768px) { .log-row { flex-direction: row; align-items: center; } }
.log-surah-title { font-weight: 800; font-size: 14px; color: #051a18; }
.log-sub { font-size: 10px; color: #94a3b8; font-weight: 500; margin-top: 2px; }
.audio-sm { height: 32px; width: 176px; border-radius: 8px; }
.btn-edit { background: #ecfdf5; color: #065f46; padding: 6px 12px; border-radius: 12px; font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 6px; border: 0; cursor: pointer; }
.btn-edit:hover { background: #d1fae5; }
.btn-share { background: #047857; color: #fff; padding: 6px 12px; border-radius: 12px; font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 6px; border: 0; cursor: pointer; }
.btn-delete-sm { background: #fef2f2; color: #dc2626; padding: 6px; border-radius: 12px; font-size: 12px; font-weight: 700; border: 0; cursor: pointer; }
.btn-delete-sm:hover { background: #fee2e2; }
.admin-header-tools { display: flex; align-items: center; gap: 12px; }
.role-badge-live { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #6ee7b7; font-weight: 700; }
.logout-chip { font-size: 12px; background: rgba(255,255,255,.1); color: #fff; padding: 4px 12px; border-radius: 9999px; font-weight: 600; border: 0; cursor: pointer; }
.logout-chip:hover { background: rgba(255,255,255,.2); }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }


/* ===== Admin Sekolah & Super Admin ===== */
.stat-student-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 16px; box-shadow: 0 1px 2px rgba(0,0,0,.05); transition: all .2s; }
.stat-student-card:hover { border-color: #6ee7b7; box-shadow: 0 6px 16px rgba(5,26,24,.08); }
.stat-student-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.stat-student-name { font-weight: 800; font-size: 15px; color: #111827; }
.stat-student-sub { font-size: 11px; color: #94a3b8; margin-top: 2px; }
.stat-count-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; padding: 0 10px; border-radius: 9999px; background: #ecfdf5; color: #065f46; font-weight: 800; font-size: 14px; white-space: nowrap; flex-shrink: 0; }
.stat-student-meta { display: flex; gap: 16px; font-size: 12px; margin-bottom: 10px; }
.stat-meta-item .k { color: #94a3b8; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.stat-meta-item .v { color: #334155; font-weight: 700; }
.chip-group { display: flex; flex-wrap: wrap; gap: 4px; }
.surah-chip { display: inline-block; background: #f1f5f9; color: #334155; font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 8px; }
.grade-chip { display: inline-block; background: #ecfdf5; color: #065f46; border: 1px solid #d1fae5; font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: 8px; }
.grade-chip-empty { display: inline-block; background: #f1f5f9; color: #94a3b8; font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 8px; }
.card-list { display: flex; flex-direction: column; gap: 12px; }
.table-responsive { overflow-x: auto; max-height: 384px; }
.table { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; }
.table thead tr { border-bottom: 1px solid #f1f5f9; color: #94a3b8; font-weight: 700; text-transform: uppercase; }
.table th { padding: 10px 12px; font-size: 10px; letter-spacing: .03em; }
.table td { padding: 10px 12px; }
.table tbody tr { border-bottom: 1px solid #f1f5f9; color: #1f2937; }
.form-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 24px; padding: 24px; box-shadow: 0 6px 20px rgba(5,26,24,.04); }
.form-icon { width: 48px; height: 48px; background: #ecfdf5; color: #065f46; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 20px; margin-bottom: 12px; border: 1px solid #d1fae5; }
.form-grid-admin { display: grid; grid-template-columns: 1fr; gap: 32px; }
@media (min-width: 1024px) { .form-grid-admin { grid-template-columns: 1fr 2fr; } }
.form-grid-2col { display: grid; grid-template-columns: 1fr; gap: 32px; }
@media (min-width: 1024px) { .form-grid-2col { grid-template-columns: 1fr 1fr; } }

/* ===== Utility fallback (sisa pola layout manajemen) ===== */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: 1fr; }
.gap-8 { gap: 32px; } .gap-4 { gap: 16px; } .gap-3 { gap: 12px; }
.space-y-8 > * + * { margin-top: 32px; }
.space-y-4 > * + * { margin-top: 16px; }
.space-y-2 > * + * { margin-top: 8px; }
.space-y-3\.5 > * + * { margin-top: 14px; }
@media (min-width: 1024px) { .lg\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); } .lg\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); } }
.divide-y > * + * { border-top: 1px solid #f1f5f9; }
.text-\[10px\] { font-size: 10px; } .text-\[11px\] { font-size: 11px; } .text-\[9px\] { font-size: 9px; }
.rounded-\[28px\] { border-radius: 28px; } .rounded-\[24px\] { border-radius: 24px; }
.glass-card { border-radius: 24px; }


/* ===== UTILITY MINI-TAILWIND (sisa class yang belum dimigrasi) ===== */
/* Layout */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1 1 0%; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.relative { position: relative; }
.z-10 { z-index: 10; }

/* Gap */
.gap-1 { gap: 4px; } .gap-1\.5 { gap: 6px; } .gap-2 { gap: 8px; }
.gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-6 { gap: 24px; } .gap-8 { gap: 32px; }

/* Padding */
.p-1 { padding: 4px; } .p-1\.5 { padding: 6px; } .p-2 { padding: 8px; }
.p-2\.5 { padding: 10px; } .p-3 { padding: 12px; } .p-4 { padding: 16px; }
.p-5 { padding: 20px; } .p-6 { padding: 24px; } .p-8 { padding: 32px; }
.px-2 { padding-left: 8px; padding-right: 8px; }
.px-2\.5 { padding-left: 10px; padding-right: 10px; }
.px-3 { padding-left: 12px; padding-right: 12px; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.py-0\.5 { padding-top: 2px; padding-bottom: 2px; }
.py-1 { padding-top: 4px; padding-bottom: 4px; }
.py-1\.5 { padding-top: 6px; padding-bottom: 6px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-2\.5 { padding-top: 10px; padding-bottom: 10px; }
.py-4 { padding-top: 16px; padding-bottom: 16px; }
.py-6 { padding-top: 24px; padding-bottom: 24px; }
.py-12 { padding-top: 48px; padding-bottom: 48px; }

/* Margin */
.m-0 { margin: 0; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; } .mb-8 { margin-bottom: 32px; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.ml-1 { margin-left: 4px; } .ml-2 { margin-left: 8px; } .ml-3 { margin-left: 12px; }
.ml-auto { margin-left: auto; } .mr-auto { margin-right: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Background */
.bg-white { background: #fff; }
.bg-white\/10 { background: rgba(255,255,255,.1); }
.bg-gray-50 { background: #f9fafb; } .bg-gray-50\/60 { background: rgba(249,250,251,.6); }
.bg-gray-100 { background: #f3f4f6; }
.bg-emerald-50 { background: #ecfdf5; } .bg-emerald-100 { background: #d1fae5; }
.bg-emerald-400 { background: #34d399; } .bg-emerald-600 { background: #059669; }
.bg-emerald-800 { background: #065f46; }
.bg-amber-50\/60 { background: rgba(255,251,235,.6); } .bg-amber-100 { background: #fef3c7; }
.bg-red-50 { background: #fef2f2; } .bg-red-100 { background: #fee2e2; }
.bg-\[\#FEFCF7\] { background: #fefcf7; }

/* Border */
.border { border: 1px solid #e2e8f0; }
.border-b { border-bottom: 1px solid #e2e8f0; }
.border-t { border-top: 1px solid #e2e8f0; }
.border-white\/10 { border-color: rgba(255,255,255,.1); }
.border-gray-100 { border-color: #f3f4f6; }
.border-gray-200 { border-color: #e5e7eb; }
.border-gray-200\/80 { border-color: rgba(229,231,235,.8); }
.border-emerald-100 { border-color: #d1fae5; }
.border-amber-100 { border-color: #fef3c7; }
.border-amber-200 { border-color: #fde68a; }

/* Radius */
.rounded { border-radius: 4px; }
.rounded-md { border-radius: 6px; }
.rounded-lg { border-radius: 8px; }
.rounded-xl { border-radius: 12px; }
.rounded-2xl { border-radius: 16px; }
.rounded-3xl { border-radius: 24px; }
.rounded-full { border-radius: 9999px; }

/* Font & teks */
.font-black { font-weight: 900; }
.font-extrabold { font-weight: 800; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.font-normal { font-weight: 400; }
.font-mono { font-family: ui-monospace, monospace; }
.uppercase { text-transform: uppercase; }
.tracking-wide { letter-spacing: .025em; }
.tracking-wider { letter-spacing: .05em; }
.text-xs { font-size: 12px; }
.text-sm { font-size: 14px; }
.text-base { font-size: 16px; }
.text-lg { font-size: 18px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-\[\#F0D58C\] { color: #f0d58c; }
.text-white { color: #fff; }
.w-full { width: 100%; }
.min-w-0 { min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Responsive sm (>=640) & md (>=768) */
@media (min-width: 640px) {
  .sm\:flex-row { flex-direction: row; }
  .sm\:items-center { align-items: center; }
  .sm\:justify-end { justify-content: flex-end; }
  .sm\:p-5 { padding: 20px; }
}
@media (min-width: 768px) {
  .md\:flex-row { flex-direction: row; }
  .md\:items-center { align-items: center; }
  .md\:items-end { align-items: flex-end; }
  .md\:border-t-0 { border-top: 0; }
}

/* ===== RESPONSIVE MOBILE (perbaikan tumpuk) ===== */
@media (max-width: 640px) {
  .arch-header { padding: 20px 16px 28px; border-radius: 20px; }
  .header-row { flex-direction: column; align-items: flex-start; gap: 10px; }
  .header-row > .header-tools, .header-row > .admin-header-tools { margin-left: 0; width: 100%; justify-content: flex-start; }
  .header-name { font-size: 20px; }
  .school-chip { white-space: normal; line-height: 1.4; }
  .stat-grid { grid-template-columns: 1fr; gap: 10px; }
  .stat-card { padding: 12px; }
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
  .action-row { flex-direction: column; }
  .dashboard { padding: 12px; }
  .card { padding: 16px; }
  .modal { padding: 20px; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .btn-add { width: 100%; justify-content: center; }
  .tab-btn, .tab-btn-active { padding: 8px 10px; font-size: 11px; }
  .filter-item { width: 100%; }
  .filter-select, .select-inline { width: 100%; min-width: 0; }
  .form-card { padding: 16px; }
  .table-responsive { max-height: 320px; }
  /* header admin sekolah/superadmin: susun vertikal */
  .arch-header .flex.justify-between { flex-direction: column; align-items: flex-start; gap: 10px; }
}

/* ===== Logo header ===== */
.header-logo { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: #fff; border: 2px solid rgba(255,255,255,.35); flex-shrink: 0; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
@media (max-width: 640px) { .header-logo { width: 36px; height: 36px; } }

/* Hilangkan floating nav (mobile) */
.floating-nav { display: none !important; }

.space-y-1 > * + * { margin-top: 4px; }
.space-y-6 > * + * { margin-top: 24px; }
