/* ==========================================================================
   APLIKASI TAHFIDZ AL-QUR'AN - DESIGN SYSTEM & STYLESHEET
   Tema: Perpaduan Mewah Ungu (Royal Purple) & Hijau Tosca (Vibrant Turquoise)
   Responsive: Mobile-First + Tablet & Desktop Drawer + Dark Mode
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Scheherazade+New:wght@400;700&display=swap');

:root {
  /* Color Palette - Ungu & Hijau Tosca (Light Theme) */
  --primary: #6D28D9;            /* Royal Purple */
  --primary-light: #8B5CF6;      /* Vibrant Violet */
  --primary-dark: #4C1D95;       /* Deep Plum Purple */
  --primary-subtle: #F5F3FF;     /* Soft Lavender Tint */
  --primary-rgb: 109, 40, 217;

  --accent-tosca: #0D9488;       /* Hijau Tosca / Rich Teal */
  --tosca-light: #14B8A6;        /* Bright Tosca */
  --tosca-bright: #2DD4BF;       /* Glowing Mint Tosca */
  --tosca-subtle: #CCFBF1;       /* Light Tosca Tint */
  --tosca-dark: #0F766E;         /* Deep Forest Tosca */
  --tosca-rgb: 13, 148, 136;

  /* Aliases for semantic compatibility */
  --accent-gold: #2DD4BF;
  --gold-light: #CCFBF1;
  --gold-dark: #0F766E;

  /* Gradients */
  --gradient-duo: linear-gradient(135deg, #6D28D9 0%, #4F46E5 35%, #0D9488 100%);
  --gradient-purple: linear-gradient(135deg, #7C3AED 0%, #6D28D9 60%, #4C1D95 100%);
  --gradient-tosca: linear-gradient(135deg, #2DD4BF 0%, #14B8A6 45%, #0D9488 100%);
  --emerald-gradient: linear-gradient(135deg, #6D28D9 0%, #5B21B6 40%, #0D9488 100%);
  --gold-gradient: linear-gradient(135deg, #2DD4BF 0%, #14B8A6 50%, #0D9488 100%);
  --card-gradient: linear-gradient(180deg, #FFFFFF 0%, #FBF9FF 100%);

  /* Surface & Background */
  --bg-main: #F7F6FC;
  --bg-surface: #FFFFFF;
  --bg-surface-elevated: #FFFFFF;
  --bg-input: #F5F3FA;

  /* Typography Colors */
  --text-main: #1E1B4B;          /* Deep Indigo Slate */
  --text-muted: #64748B;
  --text-subtle: #5F6F85;
  --text-white: #FFFFFF;

  /* Borders & Highlights */
  --border: #E5E0F2;
  --border-focus: #0D9488;

  /* Functional Status */
  --success: #0D9488;
  --success-bg: #CCFBF1;
  --warning: #F59E0B;
  --warning-bg: #FFFBEB;
  --danger: #EF4444;
  --danger-bg: #FEF2F2;
  --info: #7C3AED;
  --info-bg: #F5F3FF;

  /* Shadows */
  --shadow-sm: 0 2px 6px rgba(109, 40, 217, 0.04);
  --shadow-md: 0 6px 18px rgba(109, 40, 217, 0.08);
  --shadow-lg: 0 12px 32px rgba(109, 40, 217, 0.12);
  --shadow-tosca: 0 6px 20px rgba(13, 148, 136, 0.3);
  --shadow-purple: 0 6px 20px rgba(109, 40, 217, 0.3);
  --shadow-gold: 0 6px 20px rgba(13, 148, 136, 0.3);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* Dimensions */
  --sidebar-width: 284px;
  --header-height: 72px;
  --mobile-nav-height: 68px;

  /* Fonts */
  --font-ui: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-arabic: 'Scheherazade New', 'Amiri', serif;
}

[data-theme="dark"] {
  --primary: #8B5CF6;
  --primary-light: #A78BFA;
  --primary-dark: #5B21B6;
  --primary-subtle: #211A45;
  --primary-rgb: 139, 92, 246;

  --accent-tosca: #2DD4BF;
  --tosca-light: #5EEAD4;
  --tosca-bright: #2DD4BF;
  --tosca-subtle: #0D3330;
  --tosca-dark: #0F766E;

  --accent-gold: #2DD4BF;

  --bg-main: #0C0A1D;
  --bg-surface: #14112B;
  --bg-surface-elevated: #1D193E;
  --bg-input: #1B1638;

  --card-gradient: linear-gradient(180deg, #14112B 0%, #191438 100%);
  --emerald-gradient: linear-gradient(135deg, #5B21B6 0%, #6D28D9 45%, #0D9488 100%);

  --text-main: #F5F3FF;
  --text-muted: #A5B4FC;
  --text-subtle: #9CA3AF;

  --border: #2A2452;
  --border-focus: #2DD4BF;

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 14px 36px rgba(0, 0, 0, 0.6);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-ui);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Subtle Geometric Star Lattice Background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(109, 40, 217, 0.05) 1px, transparent 1px),
                    radial-gradient(rgba(13, 148, 136, 0.04) 1px, transparent 1px);
  background-size: 28px 28px, 56px 56px;
  background-position: 0 0, 14px 14px;
  pointer-events: none;
  z-index: 0;
}

/* Layout Framework */
.app-container {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* Sidebar Styles (Desktop) */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-header {
  padding: 22px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--border);
}

.brand-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-text h1 {
  font-size: 1.15rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent-tosca) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.brand-text span {
  font-size: 0.75rem;
  color: var(--accent-tosca);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.nav-section-label {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-subtle);
  padding: 12px 12px 4px;
  position: relative;
  z-index: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  position: relative;
  z-index: 1;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.90rem;
  font-weight: 600;
  transition: all 0.2s ease;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
}

.nav-item > span:first-of-type {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-item i {
  font-size: 1.15rem;
  width: 22px;
  text-align: center;
  color: var(--text-subtle);
  transition: color 0.2s ease;
  flex-shrink: 0;
}

.nav-item:hover {
  background: var(--primary-subtle);
  color: var(--primary);
  border-color: rgba(109, 40, 217, 0.1);
}

.nav-item:hover i {
  color: var(--primary);
}

.nav-item.active {
  background: linear-gradient(135deg, #7C3AED 0%, #6D28D9 40%, #0D9488 100%);
  color: var(--text-white);
  box-shadow: 0 6px 18px rgba(109, 40, 217, 0.28);
}

.nav-item.active i {
  color: var(--tosca-bright);
}

.nav-item .badge-pill {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #2DD4BF 0%, #0D9488 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.35);
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.sidebar-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: var(--bg-surface-elevated);
}

.user-mini-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #F5BF42 0%, #E5A325 100%);
  border: 1px solid #D4931A;
  box-shadow: 0 3px 10px rgba(229, 163, 37, 0.25);
  box-sizing: border-box;
  min-height: 56px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.user-mini-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(229, 163, 37, 0.35);
}

.user-mini-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #FFFFFF;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.user-mini-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  overflow: hidden;
}

.user-mini-name {
  font-size: 0.84rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #1E1B4B;
  line-height: 1.25;
}

.user-mini-role {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  width: 100%;
  overflow: hidden;
  line-height: 1;
}

.user-mini-card .role-badge {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.user-mini-card .role-badge.guru {
  color: #0F766E;
}

.user-mini-card .role-badge.admin {
  color: #5B21B6;
}

.user-mini-card .role-badge.murid {
  color: #7C3AED;
}

.user-mini-card .role-badge.pengawas {
  color: #0284C7;
  background: #E0F2FE;
}

.user-mini-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: #2D2305;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
  line-height: 1.2;
}

.user-mini-card .sidebar-logout-btn {
  margin-left: auto;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #DC2626;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.user-mini-card .sidebar-logout-btn:hover {
  background: #EF4444;
  border-color: #EF4444;
  color: #FFFFFF;
  transform: scale(1.05);
}

[data-theme="dark"] .user-mini-card {
  background: linear-gradient(135deg, #E5A325 0%, #C98A16 100%);
  border-color: #A66E0C;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .user-mini-card .user-mini-name {
  color: #1E1B4B;
}

[data-theme="dark"] .user-mini-card .user-mini-role {
  color: #2D2305;
}

[data-theme="dark"] .user-mini-title {
  color: #2D2305;
}

.role-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.role-badge.admin {
  background: #EDE9FE;
  color: #5B21B6;
  border: 1px solid #DDD6FE;
}

.role-badge.guru {
  background: #CCFBF1;
  color: #0F766E;
  border: 1px solid #99F6E4;
}

.role-badge.murid {
  background: #F3E8FF;
  color: #7C3AED;
  border: 1px solid #E9D5FF;
}

.role-badge.pengawas {
  background: #E0F2FE;
  color: #0369A1;
  border: 1px solid #BAE6FD;
}

/* Main Content Area */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}

/* Top App Header */
.app-header {
  height: var(--header-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(12px);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--text-main);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
}

.page-title h2 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text-main) 0%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.page-title p {
  font-size: 0.8rem;
  color: var(--accent-tosca);
  font-weight: 700;
  margin: 2px 0 0 0;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Demo Switcher Dropdown (Hidden) */
.role-quick-switch {
  display: none !important;
  align-items: center;
  gap: 8px;
  background: var(--bg-main);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
}

.role-quick-switch label {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-muted);
  white-space: nowrap;
}

.role-quick-switch select {
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--primary);
  cursor: pointer;
  outline: none;
}

/* Collab By Section */
.header-collab-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-collab-text {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Header Partner Logos (BSI & ACF) */
.header-partner-logo,
.header-bsi-logo,
.header-acf-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 3px 10px;
  border-radius: 10px;
  background: #FFFFFF;
  border: 1px solid var(--border);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.header-partner-logo:hover,
.header-bsi-logo:hover,
.header-acf-logo:hover {
  border-color: #00A39D;
  box-shadow: 0 3px 12px rgba(0, 163, 157, 0.25);
  transform: translateY(-1px);
}

.partner-logo-img,
.bsi-logo-img {
  height: 24px;
  width: auto;
  max-width: 110px;
  object-fit: contain;
  display: block;
}

.header-bsi-logo {
  padding: 3px 12px;
}

[data-theme="dark"] .header-partner-logo,
[data-theme="dark"] .header-bsi-logo,
[data-theme="dark"] .header-acf-logo {
  background: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

/* Header Divider */
.header-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 4px;
}

/* Header Actions Group */
.header-actions-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  font-size: 1rem;
}

.icon-btn:hover {
  background: var(--primary-subtle);
  color: var(--primary);
  border-color: var(--primary);
}

.icon-btn .badge-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: var(--accent-tosca);
  border-radius: 50%;
  border: 2px solid var(--bg-surface);
}

/* Page Content Body */
.page-container {
  padding: 28px;
  flex: 1;
}

.page-view {
  display: none;
  animation: fadeIn 0.3s ease;
}

.page-view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Hero Banner Card - Dual Ungu & Tosca Gradient */
.hero-banner {
  background: linear-gradient(135deg, #4C1D95 0%, #6D28D9 42%, #0F766E 85%, #0D9488 100%);
  border-radius: var(--radius-lg);
  padding: 30px 34px;
  color: var(--text-white);
  position: relative;
  overflow: hidden;
  margin-bottom: 26px;
  box-shadow: 0 12px 36px rgba(109, 40, 217, 0.25);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.hero-banner::after {
  content: '﷽';
  position: absolute;
  right: -10px;
  bottom: -20px;
  font-family: var(--font-arabic);
  font-size: 130px;
  color: rgba(255, 255, 255, 0.07);
  pointer-events: none;
  line-height: 1;
}

.hero-text h3 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.hero-text p {
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.88);
  max-width: 580px;
  line-height: 1.5;
}

.hero-date-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(10px);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 12px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #E6FFFA;
}

.hero-actions {
  display: flex;
  gap: 12px;
  position: relative;
  z-index: 2;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-family: var(--font-ui);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #7C3AED 0%, #6D28D9 100%);
  color: var(--text-white);
  box-shadow: 0 4px 14px rgba(109, 40, 217, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(109, 40, 217, 0.45);
}

/* Vibrant Tosca Button */
.btn-gold {
  background: linear-gradient(135deg, #2DD4BF 0%, #14B8A6 45%, #0D9488 100%);
  color: #FFFFFF;
  box-shadow: 0 4px 18px rgba(13, 148, 136, 0.35);
}

.btn-gold:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(13, 148, 136, 0.45);
}

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text-main);
}

.btn-outline:hover {
  background: var(--primary-subtle);
  color: var(--primary);
  border-color: var(--primary);
}

.btn-white {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}

.btn-white:hover {
  background: #fdfaff;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 14px 26px;
  font-size: 1rem;
  border-radius: var(--radius-lg);
}

/* Stat Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: linear-gradient(135deg, rgba(109, 40, 217, 0.05) 0%, #FFFFFF 45%, rgba(13, 148, 136, 0.07) 100%);
  border: 1.5px solid rgba(109, 40, 217, 0.16);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: 0 4px 18px rgba(109, 40, 217, 0.06), 0 2px 6px rgba(13, 148, 136, 0.05);
  display: flex;
  align-items: center;
  gap: 18px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: linear-gradient(180deg, #6D28D9 0%, #0D9488 100%);
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(109, 40, 217, 0.12), 0 3px 10px rgba(13, 148, 136, 0.08);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

/* Tosca stat icon */
.stat-icon.emerald {
  background: #CCFBF1;
  color: #0F766E;
  border: 1px solid #99F6E4;
}

/* Purple stat icon */
.stat-icon.gold {
  background: #EDE9FE;
  color: #6D28D9;
  border: 1px solid #DDD6FE;
}

.stat-icon.blue {
  background: #E0E7FF;
  color: #4338CA;
  border: 1px solid #C7D2FE;
}

.stat-icon.purple {
  background: #F3E8FF;
  color: #7C3AED;
  border: 1px solid #E9D5FF;
}

.stat-data h4 {
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-main);
}

.stat-data p {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 3px;
}

.stat-data .trend {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent-tosca);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

/* Stat Icon Wrapper & Stat Info (for report / KPI cards) */
.stat-icon-wrapper {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.stat-icon-wrapper.purple {
  background: #F3E8FF;
  color: #7C3AED;
  border: 1px solid #E9D5FF;
}
.stat-icon-wrapper.tosca {
  background: #CCFBF1;
  color: #0F766E;
  border: 1px solid #99F6E4;
}
.stat-icon-wrapper.gold {
  background: #FEF3C7;
  color: #D97706;
  border: 1px solid #FDE68A;
}
.stat-icon-wrapper.blue {
  background: #E0E7FF;
  color: #4338CA;
  border: 1px solid #C7D2FE;
}

.stat-info .stat-value {
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-main);
}
.stat-info .stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 3px;
}

/* Mode gelap: kartu statistik ikut gelap */
[data-theme="dark"] .stat-card {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.14) 0%, #1E1B3A 50%, rgba(45, 212, 191, 0.10) 100%) !important;
  border: 1.5px solid rgba(167, 139, 250, 0.28) !important;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.4) !important;
}
[data-theme="dark"] .stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5) !important;
}
[data-theme="dark"] .stat-card .stat-data h4,
[data-theme="dark"] .stat-card h4,
[data-theme="dark"] .stat-card .stat-value { color: #F8FAFC !important; }
[data-theme="dark"] .stat-card .stat-data p,
[data-theme="dark"] .stat-card p,
[data-theme="dark"] .stat-card .stat-label { color: #CBD5E1 !important; }
[data-theme="dark"] .stat-card .stat-data .trend,
[data-theme="dark"] .stat-card .trend,
[data-theme="dark"] .stat-card .trend i { color: #5EEAD4 !important; font-weight: 800 !important; }
[data-theme="dark"] .stat-icon-wrapper.purple { background: rgba(139, 92, 246, 0.22); color: #C4B5FD; border-color: rgba(139, 92, 246, 0.4); }
[data-theme="dark"] .stat-icon-wrapper.tosca { background: rgba(45, 212, 191, 0.18); color: #5EEAD4; border-color: rgba(45, 212, 191, 0.4); }
[data-theme="dark"] .stat-icon-wrapper.gold,
[data-theme="dark"] .stat-icon-wrapper.amber,
[data-theme="dark"] .stat-icon-wrapper.orange { background: rgba(245, 158, 11, 0.2); color: #FCD34D; border-color: rgba(245, 158, 11, 0.4); }
[data-theme="dark"] .stat-icon-wrapper.blue { background: rgba(99, 102, 241, 0.22); color: #A5B4FC; border-color: rgba(99, 102, 241, 0.4); }
[data-theme="dark"] .stat-icon-wrapper.red { background: rgba(239, 68, 68, 0.2); color: #FCA5A5; border-color: rgba(239, 68, 68, 0.4); }

/* Dashboard 2-column & 3-column Grid */
.dashboard-grid-2 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 28px;
}

.dashboard-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 22px;
  margin-bottom: 28px;
}

.dashboard-grid-4 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 540px) {
  .dashboard-grid-4 {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .dashboard-grid-4 .stat-card {
    padding: 14px 12px;
    gap: 10px;
  }
  .dashboard-grid-4 .stat-icon-wrapper {
    width: 42px;
    height: 42px;
    font-size: 20px;
  }
  .dashboard-grid-4 .stat-value {
    font-size: 1.25rem;
  }
  .dashboard-grid-4 .stat-label {
    font-size: 0.75rem;
  }
}

.chart-tab-group {
  display: inline-flex;
  gap: 6px;
  background: var(--bg-input);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.chart-tab-btn {
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chart-tab-btn:hover {
  color: var(--primary);
  background: rgba(109, 40, 217, 0.05);
}

.chart-tab-btn.active {
  background: var(--bg-surface);
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(109, 40, 217, 0.12);
  border: 1px solid rgba(109, 40, 217, 0.15);
}

@media (max-width: 1024px) {
  .dashboard-grid-2 {
    grid-template-columns: 1fr;
  }
  .dashboard-grid-3 {
    grid-template-columns: 1fr;
  }
}

/* Card Container with Ungu & Hijau Tosca Gradient */
.card {
  background: linear-gradient(135deg, rgba(109, 40, 217, 0.05) 0%, #FFFFFF 45%, rgba(13, 148, 136, 0.07) 100%);
  border: 1.5px solid rgba(109, 40, 217, 0.18);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(109, 40, 217, 0.08), 0 2px 8px rgba(13, 148, 136, 0.05);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-header {
  padding: 16px 24px;
  border-bottom: 2px solid rgba(45, 212, 191, 0.35);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #5B21B6 0%, #6D28D9 35%, #0D9488 85%, #14B8A6 100%);
  color: #FFFFFF;
}

.card-header h3 {
  font-size: 1.05rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #FFFFFF;
  letter-spacing: -0.01em;
}

.card-header h3 i,
.card-header i.text-primary,
.card-header i.text-tosca {
  color: #2DD4BF !important; /* Glowing Mint Tosca */
  font-size: 1.15rem;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.card-header span {
  color: #CCFBF1 !important; /* Light Mint Tosca */
  font-weight: 700;
}

.card-header p {
  color: #EDE9FE !important; /* Soft Lavender */
}

/* Controls inside gradient card-header */
.card-header .btn-outline {
  border-color: rgba(255, 255, 255, 0.6);
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.15);
  font-weight: 700;
  transition: all 0.2s ease;
}

.card-header .btn-outline:hover {
  background: #FFFFFF;
  color: var(--primary);
  border-color: #FFFFFF;
  transform: translateY(-1px);
}

.card-header input,
.card-header select {
  background: #FFFFFF !important;
  color: #0F172A !important;
  border: 1.5px solid rgba(255, 255, 255, 0.6) !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.card-header input::placeholder {
  color: #64748B !important;
}

.card-header select option {
  background: #FFFFFF !important;
  color: #0F172A !important;
}

[data-theme="dark"] .card-header input,
[data-theme="dark"] .card-header select {
  background: #FFFFFF !important;
  color: #0F172A !important;
  border: 1.5px solid rgba(255, 255, 255, 0.7) !important;
}

[data-theme="dark"] .card-header input::placeholder {
  color: #64748B !important;
}

[data-theme="dark"] .card-header select option {
  background: #FFFFFF !important;
  color: #0F172A !important;
}

#childSurahQuickFilter,
#filterVoiceStatus,
#reportHalaqahFilter,
#reportStatusFilter,
#chkFilterJuz,
#chkFilterStatus {
  background: #FFFFFF !important;
  color: #0F172A !important;
  font-weight: 700 !important;
}

#childSurahQuickFilter option,
#filterVoiceStatus option,
#reportHalaqahFilter option,
#reportStatusFilter option,
#chkFilterJuz option,
#chkFilterStatus option {
  background: #FFFFFF !important;
  color: #0F172A !important;
}

.card-header .badge {
  background: rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.4);
  font-weight: 700;
}

.card-body {
  padding: 24px;
  background: linear-gradient(180deg, #FFFFFF 0%, rgba(245, 243, 255, 0.45) 50%, rgba(204, 251, 241, 0.2) 100%);
}

[data-theme="dark"] .card {
  background: linear-gradient(135deg, rgba(109, 40, 217, 0.15) 0%, #14112B 45%, rgba(13, 148, 136, 0.12) 100%);
  border-color: rgba(139, 92, 246, 0.3);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4), 0 0 16px rgba(45, 212, 191, 0.06);
}

[data-theme="dark"] .card-header {
  background: linear-gradient(135deg, #3B0764 0%, #4C1D95 35%, #0F766E 85%, #0D9488 100%);
  border-bottom-color: rgba(45, 212, 191, 0.3);
}

[data-theme="dark"] .card-body {
  background: linear-gradient(180deg, #14112B 0%, #191438 60%, rgba(13, 148, 136, 0.08) 100%);
}

/* Visual Canvas Charts Container */
.chart-container {
  position: relative;
  width: 100%;
  height: 260px;
}

/* Students Table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  padding: 14px 18px;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-subtle);
  border-bottom: 1px solid var(--border);
  background: var(--bg-input);
}

.data-table td {
  padding: 14px 18px;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tr:hover td {
  background: var(--primary-subtle);
}

.student-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.student-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-tosca);
  box-shadow: 0 2px 6px rgba(13, 148, 136, 0.2);
}

.student-name {
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.student-halaqah {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Progress Bar Components */
.progress-container {
  width: 100%;
  max-width: 160px;
}

.progress-bar-wrap {
  height: 8px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 4px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #7C3AED 0%, #14B8A6 100%);
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.35);
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-muted);
}

/* Grade Badges */
.grade-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 800;
}

.grade-badge.mumtaz {
  background: #CCFBF1;
  color: #0F766E;
  border: 1px solid #99F6E4;
}

.grade-badge.jayyid-jiddan {
  background: #EDE9FE;
  color: #5B21B6;
  border: 1px solid #DDD6FE;
}

.grade-badge.jayyid {
  background: #FFFBEB;
  color: #92400E;
  border: 1px solid #FDE68A;
}

/* 30 Juz Visual Matrix (Tosca for Khatam, Purple for In Progress) */
.juz-matrix-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 8px;
  margin-top: 14px;
}

@media (max-width: 900px) {
  .juz-matrix-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

@media (max-width: 600px) {
  .juz-matrix-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.juz-cell {
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-input);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.juz-cell .juz-num {
  font-size: 0.95rem;
  font-weight: 800;
}

.juz-cell .juz-lbl {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
}

.juz-cell.completed {
  background: linear-gradient(135deg, #14B8A6 0%, #0D9488 100%);
  color: #fff;
  border-color: #0F766E;
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.35);
}

.juz-cell.completed .juz-lbl {
  color: #E6FFFA;
}

.juz-cell.in_progress {
  background: #EDE9FE;
  color: #5B21B6;
  border-color: #C4B5FD;
}

.juz-cell.in_progress .juz-lbl {
  color: #7C3AED;
}

.juz-cell:hover {
  transform: scale(1.08);
  z-index: 2;
  box-shadow: var(--shadow-md);
  border-color: var(--accent-tosca);
}

/* Individual Student Header Card */
.student-profile-hero {
  background: var(--card-gradient);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  gap: 24px;
  align-items: center;
  margin-bottom: 24px;
  position: relative;
}

.profile-avatar-large {
  width: 98px;
  height: 98px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--primary);
  box-shadow: 0 6px 20px rgba(109, 40, 217, 0.25);
}

.profile-info-main {
  flex: 1;
}

.profile-info-main h2 {
  font-size: 1.45rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.profile-meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 14px;
}

.meta-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-input);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.meta-tag i {
  color: var(--accent-tosca);
}

.badges-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.honor-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #CCFBF1;
  color: #0F766E;
  border: 1px solid #99F6E4;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 800;
}

.honor-badge i {
  color: var(--accent-tosca);
}

/* Header Bar Box with Dual Ungu & Tosca Gradient */
.quran-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  background: linear-gradient(135deg, #5B21B6 0%, #6D28D9 35%, #0D9488 85%, #14B8A6 100%);
  border: 1.5px solid rgba(45, 212, 191, 0.45);
  border-radius: var(--radius-lg);
  padding: 18px 24px;
  margin-bottom: 24px;
  color: #FFFFFF;
  box-shadow: 0 10px 30px rgba(109, 40, 217, 0.16), 0 2px 8px rgba(13, 148, 136, 0.12);
  position: relative;
  overflow: hidden;
}

.quran-header-bar h2,
.quran-header-bar h3 {
  color: #FFFFFF !important;
  letter-spacing: -0.01em;
}

.quran-header-bar h2 i,
.quran-header-bar h3 i {
  color: #2DD4BF !important; /* Glowing Mint Tosca */
}

.quran-header-bar p {
  color: #CCFBF1 !important; /* Soft glowing mint tosca */
}

.quran-header-bar label {
  color: #FFFFFF !important;
  font-weight: 700;
}

.quran-header-bar select,
.quran-header-bar input {
  background: #FFFFFF !important;
  color: #0F172A !important;
  border: 1.5px solid rgba(255, 255, 255, 0.6) !important;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.quran-header-bar select option {
  background: #FFFFFF !important;
  color: #0F172A !important;
}

[data-theme="dark"] .quran-header-bar select,
[data-theme="dark"] .quran-header-bar input {
  background: #FFFFFF !important;
  color: #0F172A !important;
  border-color: rgba(255, 255, 255, 0.7) !important;
}

[data-theme="dark"] .quran-header-bar select option {
  background: #FFFFFF !important;
  color: #0F172A !important;
}

.quran-header-bar select:focus,
.quran-header-bar input:focus {
  border-color: #2DD4BF;
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.35);
}

.quran-header-bar .btn-outline {
  border-color: rgba(255, 255, 255, 0.6);
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.15);
  font-weight: 700;
}

.quran-header-bar .btn-outline:hover {
  background: #FFFFFF;
  color: var(--primary);
  border-color: #FFFFFF;
}

.quran-header-bar .chart-tab-group {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.35);
}

.quran-header-bar .chart-tab-btn {
  color: #EDE9FE;
}

.quran-header-bar .chart-tab-btn.active {
  background: #FFFFFF;
  color: var(--primary);
  font-weight: 800;
}

[data-theme="dark"] .quran-header-bar {
  background: linear-gradient(135deg, #3B0764 0%, #4C1D95 35%, #0F766E 85%, #0D9488 100%);
  border-color: rgba(45, 212, 191, 0.35);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 16px rgba(45, 212, 191, 0.08);
}


.surah-select-wrap select {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-main);
  outline: none;
  min-width: 220px;
}

/* Audio Player Master Widget - Dual Gradient */
.audio-player-widget {
  background: linear-gradient(135deg, #3B0764 0%, #5B21B6 45%, #0F766E 85%, #0D9488 100%);
  border-radius: var(--radius-lg);
  padding: 18px 24px;
  color: #fff;
  margin-bottom: 24px;
  box-shadow: 0 10px 30px rgba(109, 40, 217, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.player-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.player-icon-pulse {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--tosca-bright);
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.player-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.player-btn:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: scale(1.05);
}

.player-btn.play-master {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, #2DD4BF 0%, #0D9488 100%);
  color: #FFFFFF;
  font-size: 20px;
  box-shadow: 0 4px 18px rgba(13, 148, 136, 0.45);
}

/* Loop selector for Muroja'ah */
.repeat-loop-select {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.16);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.repeat-loop-select select {
  background: transparent;
  border: none;
  color: #fff;
  font-weight: 700;
  outline: none;
  cursor: pointer;
}

.repeat-loop-select select option {
  background: #3B0764;
  color: #fff;
}

/* Ayat Cards List */
.ayah-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.ayah-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  transition: all 0.2s ease;
  position: relative;
}

.ayah-card.active-playing {
  border-color: var(--accent-tosca);
  background: #F5F3FF;
  box-shadow: 0 6px 20px rgba(13, 148, 136, 0.18);
}

.ayah-top-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--border);
}

.ayah-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-subtle);
  color: var(--primary);
  font-weight: 800;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(109, 40, 217, 0.2);
}

.ayah-btn-group {
  display: flex;
  gap: 8px;
}

.ayah-action-btn {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.ayah-action-btn:hover {
  background: var(--primary-subtle);
  color: var(--primary);
  border-color: var(--primary);
}

.arabic-text {
  font-family: var(--font-arabic);
  font-size: 1.85rem;
  line-height: 2.2;
  text-align: right;
  direction: rtl;
  color: var(--text-main);
  margin-bottom: 14px;
  letter-spacing: 0;
  transition: filter 0.3s ease;
}

/* Blind Mode / Tutup Ayat */
.arabic-text.hidden-recall {
  filter: blur(8px);
  user-select: none;
  cursor: pointer;
}

.arabic-text.hidden-recall::after {
  content: ' (Klik untuk Intip Ayat)';
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--accent-tosca);
  display: block;
}

.transliteration-text {
  font-size: 0.9rem;
  color: var(--accent-tosca);
  font-style: italic;
  font-weight: 700;
  margin-bottom: 6px;
}

.translation-text {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* VOICE TEST (SPEECH RECOGNITION) VIEW */
.voice-test-wrapper {
  max-width: 780px;
  margin: 0 auto;
}

.mic-recorder-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px 24px;
  text-align: center;
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
}

.mic-button-big {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7C3AED 0%, #0D9488 100%);
  border: none;
  color: #fff;
  font-size: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 26px rgba(109, 40, 217, 0.4);
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  margin: 18px 0;
}

.mic-button-big:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 30px rgba(13, 148, 136, 0.5);
}

.mic-button-big.recording {
  background: linear-gradient(135deg, #EF4444 0%, #B91C1C 100%);
  animation: pulseMic 1.4s infinite;
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.45);
}

@keyframes pulseMic {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
  70% { box-shadow: 0 0 0 20px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.waveform-anim {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 36px;
  margin: 14px 0;
}

.wave-bar {
  width: 4px;
  height: 8px;
  background: var(--accent-tosca);
  border-radius: 4px;
  transition: height 0.15s ease;
}

.waveform-anim.active .wave-bar {
  animation: waveBar 0.8s ease-in-out infinite alternate;
}

.wave-bar:nth-child(2) { animation-delay: 0.1s; background: var(--primary); }
.wave-bar:nth-child(3) { animation-delay: 0.2s; background: var(--accent-tosca); }
.wave-bar:nth-child(4) { animation-delay: 0.3s; background: var(--primary-light); }
.wave-bar:nth-child(5) { animation-delay: 0.4s; background: var(--accent-tosca); }
.wave-bar:nth-child(6) { animation-delay: 0.2s; background: var(--primary); }
.wave-bar:nth-child(7) { animation-delay: 0.1s; background: var(--accent-tosca); }

@keyframes waveBar {
  from { height: 6px; }
  to { height: 32px; }
}

.test-result-box {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-top: 20px;
  text-align: left;
}

.accuracy-score-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.score-number {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--primary);
}

.word-comparison-diff {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--font-arabic);
  font-size: 1.45rem;
  direction: rtl;
  margin: 12px 0;
}

.word-tag {
  padding: 2px 8px;
  border-radius: 6px;
}

.word-tag.correct {
  background: #CCFBF1;
  color: #0F766E;
  border: 1px solid #99F6E4;
}

.word-tag.missing {
  background: #FEE2E2;
  color: #991B1B;
  text-decoration: line-through;
}

.record-timer-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(239, 68, 68, 0.12);
  color: #EF4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: 12px;
}

.blink {
  animation: blinkAnim 1s infinite alternate;
}

@keyframes blinkAnim {
  from { opacity: 0.25; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1.1); }
}

.voice-preview-box audio,
.voice-card-item audio {
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.08));
}

/* QUIZ VIEW */
.quiz-card {
  max-width: 680px;
  margin: 0 auto;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-md);
}

.quiz-score-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.quiz-streak-badge {
  background: #CCFBF1;
  color: #0F766E;
  border: 1px solid #5EEAD4;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-weight: 800;
  font-size: 0.85rem;
}

.quiz-question-box {
  background: var(--primary-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  margin-bottom: 24px;
  border: 1px solid rgba(109, 40, 217, 0.15);
}

.quiz-choices {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.quiz-choice-btn {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  font-family: var(--font-arabic);
  font-size: 1.35rem;
  direction: rtl;
  text-align: right;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-main);
}

.quiz-choice-btn:hover {
  background: #F5F3FF;
  border-color: var(--accent-tosca);
  transform: translateX(-4px);
}

.quiz-choice-btn.correct {
  background: #CCFBF1;
  border-color: #14B8A6;
  color: #0F766E;
}

.quiz-choice-btn.wrong {
  background: #FEE2E2;
  border-color: #EF4444;
  color: #991B1B;
}

/* MODAL SYSTEM */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(12, 10, 29, 0.6);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal-overlay.active {
  display: flex !important;
  animation: fadeIn 0.2s ease;
}

.modal-container {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card-gradient);
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 800;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: var(--bg-surface-elevated);
}

/* Form Controls */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-main);
}

.form-control {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-input);
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
  border-color: var(--accent-tosca);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.18);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--mobile-nav-height);
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  z-index: 50;
  backdrop-filter: blur(12px);
  justify-content: space-around;
  align-items: center;
  padding: 0 8px;
}

.mobile-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 700;
  background: none;
  border: none;
  padding: 6px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mobile-nav-btn i {
  font-size: 1.25rem;
}

.mobile-nav-btn.active {
  color: var(--primary);
}

.mobile-nav-btn.active i {
  color: var(--primary);
  transform: translateY(-2px);
}

/* Sidebar Mobile Close Button & Backdrop Overlay */
.sidebar-close-btn {
  display: none;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  cursor: pointer;
  margin-left: auto;
  transition: all 0.2s ease;
}

.sidebar-close-btn:hover {
  background: rgba(239, 68, 68, 0.35);
  border-color: #EF4444;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(12, 10, 29, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 85;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sidebar-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* Responsive Breakpoints */
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 90;
    width: 285px;
    max-width: 85vw;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .sidebar-close-btn {
    display: inline-flex;
  }
  .sidebar-backdrop {
    display: block;
  }
  .main-wrapper {
    margin-left: 0;
    padding-bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px) + 20px);
  }
  .mobile-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .mobile-bottom-nav {
    display: flex;
    height: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .hero-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
  }
  .student-profile-hero {
    flex-direction: column;
    text-align: center;
    padding: 20px 16px;
  }
  .profile-meta-tags, .badges-wrapper {
    justify-content: center;
  }
  .page-container {
    padding: 16px 14px;
  }
  .audio-player-widget {
    flex-direction: column;
    align-items: flex-start;
  }
  .toast-container {
    bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px) + 12px);
    right: 12px;
    left: 12px;
  }
  .toast {
    min-width: 0;
    width: 100%;
  }
}

/* ====================================================
   SMARTPHONE RESPONSIVE OPTIMIZATIONS (<= 768px)
   ==================================================== */
@media (max-width: 768px) {
  /* 1. Header Optimization - 2 Elegant Tiers on Mobile */
  .app-header {
    height: auto !important;
    padding: 8px 14px 10px 14px !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    row-gap: 8px !important;
  }

  .header-left {
    order: 1 !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    flex: 1 !important;
    min-width: 0 !important;
  }

  .mobile-menu-toggle {
    width: 36px !important;
    height: 36px !important;
    font-size: 1.35rem !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: var(--radius-sm) !important;
    flex-shrink: 0 !important;
  }

  .page-title h2 {
    font-size: 1.05rem !important;
    max-width: none !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    margin: 0 !important;
  }

  .page-title p {
    font-size: 0.75rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    margin: 1px 0 0 0 !important;
  }

  .header-right {
    order: 2 !important;
    display: contents !important;
  }

  .header-divider {
    display: none !important;
  }

  .header-actions-group {
    order: 2 !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
  }

  .header-actions-group .icon-btn {
    width: 36px !important;
    height: 36px !important;
    border-radius: 9px !important;
    font-size: 0.95rem !important;
  }

  .header-actions-group .header-logout-btn {
    height: 36px !important;
    padding: 0 10px !important;
    border-radius: 9px !important;
    font-size: 0.8rem !important;
    gap: 4px !important;
  }

  /* Row 2: Clean Centered Collab Banner on Mobile */
  .header-collab-group {
    order: 3 !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding-top: 8px !important;
    border-top: 1px solid var(--border) !important;
    gap: 8px !important;
  }

  .header-collab-text {
    display: inline-block !important;
    font-size: 0.75rem !important;
    color: var(--text-muted) !important;
    font-weight: 700 !important;
    margin-right: 2px !important;
  }

  .header-partner-logo {
    height: 34px !important;
    padding: 2px 10px !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08) !important;
  }

  .partner-logo-img {
    height: 22px !important;
    max-width: 95px !important;
  }

  /* 2. Container & Card Padding */
  .page-container {
    padding: 10px 8px;
  }
  .card {
    border-radius: 14px;
    margin-bottom: 14px;
  }
  .card-header {
    padding: 12px 14px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .card-header > div:first-child {
    width: 100%;
  }
  .card-header h3 {
    font-size: 0.95rem;
    flex-wrap: wrap;
    line-height: 1.3;
  }
  .card-header p {
    font-size: 0.75rem;
  }
  .card-body {
    padding: 14px 12px;
  }

  /* Card header controls full width on mobile */
  .card-header select,
  .card-header input,
  .card-header .btn {
    width: 100% !important;
    min-height: 40px;
  }

  /* Top Bar / Quran Header Bar */
  .quran-header-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px 12px;
    border-radius: 14px;
    margin-bottom: 14px !important;
  }
  .quran-header-bar > div {
    width: 100%;
  }
  .quran-header-bar select,
  .quran-header-bar input,
  .quran-header-bar button,
  .quran-header-bar .btn {
    width: 100% !important;
    min-height: 42px;
  }

  /* 3. Dashboard KPI Cards: 2x2 Grid with Compact Padding */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    margin-bottom: 16px !important;
  }
  .stat-card {
    padding: 12px 10px !important;
    gap: 10px !important;
    border-radius: 12px !important;
  }
  .stat-icon, .stat-icon-wrapper {
    width: 38px !important;
    height: 38px !important;
    font-size: 18px !important;
    border-radius: 10px !important;
  }
  .stat-data h4, .stat-value {
    font-size: 1.25rem !important;
  }
  .stat-data p, .stat-label {
    font-size: 0.75rem !important;
    line-height: 1.2;
  }
  .stat-badge {
    display: none !important;
  }

  /* 4. Student Profile Hero on Mobile */
  .student-profile-hero {
    padding: 16px 12px !important;
    gap: 12px !important;
  }
  .profile-avatar-large {
    width: 68px !important;
    height: 68px !important;
  }
  .profile-info-main h2 {
    font-size: 1.15rem !important;
  }
  .profile-meta-tags {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  .meta-tag {
    justify-content: center;
    font-size: 0.75rem;
    padding: 4px 8px;
  }
  #childHeroActions {
    width: 100%;
  }
  #childHeroActions button {
    width: 100% !important;
    min-height: 42px;
  }

  /* 5. 30 Juz Grid */
  .juz-matrix-grid {
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 6px !important;
  }
  .juz-cell {
    padding: 6px 2px !important;
    border-radius: 8px !important;
  }
  .juz-num {
    font-size: 0.85rem !important;
  }
  .juz-lbl {
    font-size: 0.75rem !important;
  }

  /* 6. Tables with smooth touch scrolling */
  .table-responsive,
  div[style*="overflow-x:auto"],
  div[style*="overflow-x: auto"] {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    border-radius: 10px;
    margin: 0 -4px;
  }
  .data-table {
    min-width: 540px;
  }
  .data-table th,
  .data-table td {
    padding: 8px 8px !important;
    font-size: 0.78rem !important;
    white-space: normal;
  }

  /* 7. Modal bottom-sheet style on mobile */
  .modal-overlay {
    padding: 0 !important;
    align-items: flex-end !important;
  }
  .modal-container {
    max-width: 100% !important;
    width: 100% !important;
    border-radius: 20px 20px 0 0 !important;
    max-height: 88vh !important;
    margin: 0 !important;
    animation: slideUpModal 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }
  .modal-header {
    padding: 14px 16px !important;
  }
  .modal-header h3 {
    font-size: 1rem !important;
  }
  .modal-body {
    padding: 14px 12px !important;
  }
  .modal-footer {
    padding: 12px 14px !important;
    flex-direction: column-reverse !important;
    gap: 8px !important;
  }
  .modal-footer button {
    width: 100% !important;
    min-height: 44px !important;
    justify-content: center !important;
  }

  /* Form columns stack on mobile */
  .form-row,
  div[style*="grid-template-columns: 1fr 1fr"],
  div[style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  /* 8. Digital Mushaf Reader on Smartphone */
  .mushaf-sheet {
    padding: 8px !important;
    border-radius: 12px !important;
  }
  .mushaf-frame-outer {
    padding: 6px !important;
    border-width: 2px !important;
  }
  .mushaf-page-flow {
    font-size: 1.3rem !important;
    line-height: 2.1 !important;
    word-spacing: 1px !important;
  }
  .mushaf-surah-cartouche {
    margin: 8px 0 !important;
    padding: 6px 12px !important;
  }
  .cartouche-title-ar {
    font-size: 1.1rem !important;
  }
  .basmalah-calligraphy {
    font-size: 1.2rem !important;
    margin: 6px 0 !important;
  }
  .mushaf-bottom-bar {
    padding: 8px 10px !important;
    gap: 6px !important;
  }
  .mushaf-nav-btn {
    padding: 6px 10px !important;
    font-size: 0.78rem !important;
  }

  /* 9. Audio setoran & voice recorder */
  .voice-record-btn {
    width: 64px !important;
    height: 64px !important;
    font-size: 26px !important;
  }

  /* 10. Public Speaking filters & rubrics */
  .ps-score-mini-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 4px !important;
  }
  .ps-score-mini-item {
    padding: 3px 4px !important;
  }
  .ps-score-mini-label {
    font-size: 0.65rem !important;
  }
  .ps-score-mini-val {
    font-size: 0.78rem !important;
  }
  .ps-certificate-card {
    padding: 16px 12px !important;
  }

  /* 11. iOS Auto-Zoom fix */
  input, select, textarea {
    font-size: 16px !important;
  }
}

@keyframes slideUpModal {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

@media (max-width: 420px) {
  .page-title h2 {
    font-size: 0.95rem !important;
  }
  .header-logout-btn span {
    display: none !important;
  }
  .header-logout-btn {
    width: 34px !important;
    padding: 0 !important;
    justify-content: center !important;
  }
  .header-partner-logo {
    height: 30px !important;
    padding: 2px 8px !important;
  }
  .partner-logo-img {
    height: 18px !important;
    max-width: 80px !important;
  }
  .icon-btn {
    width: 34px !important;
    height: 34px !important;
  }
}

/* ==========================================================================
   PROFESSIONAL CONFIRMATION MODAL & NOTIFICATIONS SYSTEM
   ========================================================================== */

/* Enhanced Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid rgba(226, 232, 240, 0.9);
  border-radius: 18px;
  padding: 14px 18px 14px 14px;
  box-shadow: 0 16px 36px -8px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 320px;
  max-width: 440px;
  animation: toastSlideIn 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] .toast {
  background: rgba(30, 27, 75, 0.94);
  border-color: rgba(148, 163, 184, 0.2);
  box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.55), 0 0 20px rgba(109, 40, 217, 0.25);
  color: #F8FAFC;
}

@keyframes toastSlideIn {
  from {
    transform: translateX(110%) scale(0.95);
    opacity: 0;
  }
  to {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
}

.toast-icon-box {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.toast-icon-box.toast-success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(13, 148, 136, 0.2) 100%);
  color: #10B981;
}

.toast-icon-box.toast-danger {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(220, 38, 38, 0.2) 100%);
  color: #EF4444;
}

.toast-icon-box.toast-warning {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(217, 119, 6, 0.2) 100%);
  color: #F59E0B;
}

.toast-icon-box.toast-info {
  background: linear-gradient(135deg, rgba(109, 40, 217, 0.15) 0%, rgba(13, 148, 136, 0.2) 100%);
  color: var(--primary, #6D28D9);
}

.toast-body-text {
  flex: 1;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main, #0F172A);
  line-height: 1.45;
}

[data-theme="dark"] .toast-body-text {
  color: #F1F5F9;
}

.toast-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted, #94A3B8);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
  line-height: 1;
}

.toast-close-btn:hover {
  color: var(--text-main, #0F172A);
  background: rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .toast-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
}

.toast-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  animation: toastProgress 3.2s linear forwards;
}

.toast-progress-bar.toast-bar-success {
  background: linear-gradient(90deg, #10B981, #0D9488);
}

.toast-progress-bar.toast-bar-danger {
  background: linear-gradient(90deg, #EF4444, #DC2626);
}

.toast-progress-bar.toast-bar-warning {
  background: linear-gradient(90deg, #F59E0B, #D97706);
}

.toast-progress-bar.toast-bar-info {
  background: linear-gradient(90deg, var(--primary, #6D28D9), var(--accent-tosca, #0D9488));
}

@keyframes toastProgress {
  from { width: 100%; }
  to { width: 0%; }
}

/* ================= CUSTOM CONFIRMATION MODAL ================= */
.custom-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 9999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s;
}

.custom-confirm-overlay.active {
  opacity: 1;
  visibility: visible;
}

.custom-confirm-box {
  width: 100%;
  max-width: 440px;
  background: var(--bg-surface, #FFFFFF);
  border: 1.5px solid var(--border, #E2E8F0);
  border-radius: 24px;
  padding: 32px 28px 24px 28px;
  box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.38), 0 0 0 1px rgba(255, 255, 255, 0.2) inset;
  text-align: center;
  position: relative;
  transform: scale(0.9) translateY(12px);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] .custom-confirm-box {
  background: linear-gradient(145deg, #1E1B4B 0%, #0F172A 100%);
  border-color: rgba(148, 163, 184, 0.2);
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.65), 0 0 30px rgba(109, 40, 217, 0.15);
}

.custom-confirm-overlay.active .custom-confirm-box {
  transform: scale(1) translateY(0);
}

/* Floating Icon Badge */
.confirm-icon-wrapper {
  width: 68px;
  height: 68px;
  margin: 0 auto 18px auto;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  position: relative;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
  transition: transform 0.25s ease;
}

.confirm-icon-wrapper::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.4);
  pointer-events: none;
}

.confirm-icon-wrapper.confirm-type-primary {
  background: linear-gradient(135deg, rgba(109, 40, 217, 0.15) 0%, rgba(13, 148, 136, 0.22) 100%);
  color: var(--primary, #6D28D9);
  border: 2px solid rgba(109, 40, 217, 0.25);
}

.confirm-icon-wrapper.confirm-type-danger {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(245, 158, 11, 0.2) 100%);
  color: #EF4444;
  border: 2px solid rgba(239, 68, 68, 0.25);
}

.confirm-icon-wrapper.confirm-type-warning {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(234, 88, 12, 0.2) 100%);
  color: #F59E0B;
  border: 2px solid rgba(245, 158, 11, 0.25);
}

.confirm-icon-wrapper.confirm-type-success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(13, 148, 136, 0.2) 100%);
  color: #10B981;
  border: 2px solid rgba(16, 185, 129, 0.25);
}

.confirm-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main, #0F172A);
  margin: 0 0 10px 0;
  letter-spacing: -0.3px;
}

[data-theme="dark"] .confirm-title {
  color: #FFFFFF;
}

.confirm-message {
  font-size: 0.94rem;
  line-height: 1.55;
  color: var(--text-muted, #64748B);
  margin: 0 0 26px 0;
  font-weight: 500;
}

[data-theme="dark"] .confirm-message {
  color: #CBD5E1;
}

.confirm-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
}

.btn-confirm-cancel {
  flex: 1;
  padding: 12px 18px;
  border-radius: 14px;
  border: 1.5px solid var(--border, #CBD5E1);
  background: var(--bg-surface, #F8FAFC);
  color: var(--text-main, #334155);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-confirm-cancel:hover {
  background: #E2E8F0;
  border-color: #94A3B8;
  transform: translateY(-1px);
}

[data-theme="dark"] .btn-confirm-cancel {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
  color: #E2E8F0;
}

[data-theme="dark"] .btn-confirm-cancel:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-confirm-ok {
  flex: 1.35;
  padding: 12px 22px;
  border-radius: 14px;
  border: none;
  font-size: 0.92rem;
  font-weight: 800;
  color: #FFFFFF;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-confirm-ok.btn-confirm-primary {
  background: linear-gradient(135deg, var(--primary, #6D28D9) 0%, #0D9488 100%);
  box-shadow: 0 6px 18px rgba(109, 40, 217, 0.32);
}

.btn-confirm-ok.btn-confirm-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(109, 40, 217, 0.45);
}

.btn-confirm-ok.btn-confirm-danger {
  background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
  box-shadow: 0 6px 18px rgba(239, 68, 68, 0.35);
}

.btn-confirm-ok.btn-confirm-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.48);
}

.btn-confirm-ok.btn-confirm-warning {
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.35);
}

.btn-confirm-ok.btn-confirm-warning:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.48);
}

/* Color Utility Classes - Ungu & Hijau Tosca */
.text-tosca, .text-gold {
  color: var(--accent-tosca) !important;
}
.text-purple, .text-primary {
  color: var(--primary) !important;
}
.bg-tosca {
  background: var(--accent-tosca) !important;
}
.bg-purple {
  background: var(--primary) !important;
}

/* Filter Pills Group in User & Report Management */
.filter-pills-group {
  display: flex;
  background: var(--bg-main);
  border: 1px solid var(--border);
  padding: 3px;
  border-radius: var(--radius-full);
  gap: 2px;
}

.role-pill-btn {
  background: none;
  border: none;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.role-pill-btn:hover {
  color: var(--primary);
}

.role-pill-btn.active {
  background: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(109, 40, 217, 0.3);
}

/* Screen Hide for Dedicated Print Container */
#santriCardsPrintArea,
.santri-print-area-root {
  display: none !important;
}

/* Print Styles: A4 Standard & ID Cards */
@page {
  size: A4 portrait;
  margin: 6mm 8mm;
}

@media print {
  *, *::before, *::after {
    box-sizing: border-box !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }

  .no-print {
    display: none !important;
  }

  /* CETAK KARTU SANTRI A4 (8 KARTU / LEMBAR): HANYA TAMPILKAN #santriCardsPrintArea */
  body.printing-cards > *:not(#santriCardsPrintArea),
  body.modal-kartu-open > *:not(#santriCardsPrintArea) {
    display: none !important;
  }

  body.printing-cards,
  body.modal-kartu-open {
    background: #FFFFFF !important;
    color: #000000 !important;
    padding: 0 !important;
    margin: 0 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body.printing-cards #santriCardsPrintArea,
  body.modal-kartu-open #santriCardsPrintArea {
    display: block !important;
    position: static !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    overflow: visible !important;
  }

  /* Lembar A4 Cetak (Memuat Tepat 8 Kartu: 2 Kolom x 4 Baris) */
  body.printing-cards .print-a4-page,
  body.modal-kartu-open .print-a4-page {
    width: 190mm !important;
    max-width: 190mm !important;
    height: auto !important;
    max-height: 242mm !important;
    box-sizing: border-box !important;
    margin: 0 auto !important;
    padding: 0 !important;
    page-break-after: always !important;
    break-after: page !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    overflow: hidden !important;
    display: block !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  body.printing-cards .print-a4-page:last-child,
  body.modal-kartu-open .print-a4-page:last-child {
    page-break-after: avoid !important;
    break-after: avoid !important;
  }

  body.printing-cards .print-a4-cards-grid,
  body.modal-kartu-open .print-a4-cards-grid {
    display: grid !important;
    grid-template-columns: 92mm 92mm !important;
    grid-template-rows: repeat(4, 58mm) !important;
    column-gap: 5mm !important;
    row-gap: 2.5mm !important;
    width: 189mm !important;
    height: 240mm !important;
    margin: 0 auto !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    justify-content: center !important;
    align-content: start !important;
  }

  body.printing-cards .printable-card-wrapper,
  body.modal-kartu-open .printable-card-wrapper {
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    width: 92mm !important;
    height: 58mm !important;
    box-sizing: border-box !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  /* Fisik Kartu ID Asli (Pas 8 pcs di A4): 9.2 cm x 5.8 cm */
  body.printing-cards .santri-id-card,
  body.modal-kartu-open .santri-id-card {
    width: 92mm !important;
    height: 58mm !important;
    max-width: 92mm !important;
    max-height: 58mm !important;
    box-sizing: border-box !important;
    border: 1.5px solid #0D9488 !important;
    border-radius: 6px !important;
    background: #FFFFFF !important;
    box-shadow: none !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    margin: 0 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body.printing-cards .santri-card-header,
  body.modal-kartu-open .santri-card-header {
    padding: 2mm 3.5mm !important;
    background-color: #0D9488 !important;
    background: linear-gradient(135deg, #7C3AED, #0D9488) !important;
    color: #FFFFFF !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    border-radius: 5px 5px 0 0 !important;
    border-bottom: 2px solid #0F766E !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
  }

  body.printing-cards .santri-card-header-title,
  body.modal-kartu-open .santri-card-header-title {
    font-size: 8.5pt !important;
    font-weight: 900 !important;
    letter-spacing: 0.4px !important;
    line-height: 1.15 !important;
    color: #FFFFFF !important;
    -webkit-text-stroke: 0.25px #0F172A;
    text-shadow: 0 0 1px #0F172A, 0 1px 2px rgba(0, 0, 0, 0.4) !important;
  }

  body.printing-cards .santri-card-header-sub,
  body.modal-kartu-open .santri-card-header-sub {
    font-size: 5pt !important;
    font-weight: 700 !important;
    margin-top: 1px !important;
    line-height: 1.1 !important;
    color: #FFFFFF !important;
    -webkit-text-stroke: 0.15px #0F172A;
    text-shadow: 0 0 1px #0F172A !important;
  }

  body.printing-cards .santri-card-header-badge,
  body.modal-kartu-open .santri-card-header-badge {
    font-size: 5pt !important;
    padding: 1.5px 5px !important;
    border-radius: 3px !important;
    font-weight: 800 !important;
    letter-spacing: 0.5px !important;
    background: rgba(255, 255, 255, 0.3) !important;
    border: 1px solid #FFFFFF !important;
    color: #FFFFFF !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    text-shadow: 0 0 1px #0F172A !important;
  }

  body.printing-cards .santri-card-body,
  body.modal-kartu-open .santri-card-body {
    padding: 2mm 3.5mm !important;
    gap: 2.5mm !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex: 1 !important;
    min-height: 0 !important;
    background: #FFFFFF !important;
  }

  body.printing-cards .santri-card-info,
  body.modal-kartu-open .santri-card-info {
    flex: 1 !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }

  body.printing-cards .santri-card-name,
  body.modal-kartu-open .santri-card-name {
    font-size: 9.5pt !important;
    font-weight: 900 !important;
    color: #0F172A !important;
    line-height: 1.15 !important;
    margin-bottom: 1.2mm !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body.printing-cards .santri-card-halaqah,
  body.modal-kartu-open .santri-card-halaqah {
    font-size: 7pt !important;
    color: #0D9488 !important;
    font-weight: 800 !important;
    margin-top: 0.6mm !important;
    display: flex !important;
    align-items: center !important;
    gap: 3px !important;
  }

  body.printing-cards .santri-card-halaqah i,
  body.modal-kartu-open .santri-card-halaqah i {
    font-size: 7.2pt !important;
  }

  body.printing-cards .santri-card-asal,
  body.modal-kartu-open .santri-card-asal {
    font-size: 6.5pt !important;
    color: #475569 !important;
    font-weight: 700 !important;
    margin-top: 0.6mm !important;
    display: flex !important;
    align-items: center !important;
    gap: 3px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body.printing-cards .santri-card-asal i,
  body.modal-kartu-open .santri-card-asal i {
    font-size: 6.8pt !important;
  }

  body.printing-cards .santri-card-area,
  body.modal-kartu-open .santri-card-area {
    font-size: 6.5pt !important;
    color: #0284C7 !important;
    font-weight: 800 !important;
    margin-top: 0.6mm !important;
    display: flex !important;
    align-items: center !important;
    gap: 3px !important;
  }

  body.printing-cards .santri-card-area i,
  body.modal-kartu-open .santri-card-area i {
    font-size: 6.8pt !important;
  }

  body.printing-cards .santri-card-qr-box,
  body.modal-kartu-open .santri-card-qr-box {
    width: 19mm !important;
    height: 19mm !important;
    padding: 1mm !important;
    border-radius: 4px !important;
    border: 1px solid #CBD5E1 !important;
    background: #FFFFFF !important;
    box-shadow: none !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
  }

  body.printing-cards .santri-card-qr-box img,
  body.modal-kartu-open .santri-card-qr-box img,
  body.printing-cards .santri-card-qr-box svg,
  body.modal-kartu-open .santri-card-qr-box svg,
  body.printing-cards .santri-card-qr-box canvas,
  body.modal-kartu-open .santri-card-qr-box canvas {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    display: block !important;
  }

  body.printing-cards .santri-card-footer,
  body.modal-kartu-open .santri-card-footer {
    padding: 1.2mm 3.5mm !important;
    background: #F8FAFC !important;
    border-top: 1px solid #E2E8F0 !important;
    border-radius: 0 0 5px 5px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body.printing-cards .santri-card-footer-logo,
  body.modal-kartu-open .santri-card-footer-logo {
    height: 3.8mm !important;
    width: auto !important;
    max-width: 48mm !important;
    object-fit: contain !important;
    mix-blend-mode: normal !important;
    display: block !important;
  }

  body.printing-cards .santri-card-scan-label,
  body.modal-kartu-open .santri-card-scan-label {
    font-size: 4.5pt !important;
    color: #94A3B8 !important;
    font-weight: 600 !important;
    letter-spacing: 0.02em !important;
  }

  /* Standard Report Styles for Other Views (When not printing cards) */
  body:not(.printing-cards):not(.modal-kartu-open) .sidebar,
  body:not(.printing-cards):not(.modal-kartu-open) .app-header,
  body:not(.printing-cards):not(.modal-kartu-open) .mobile-bottom-nav,
  body:not(.printing-cards):not(.modal-kartu-open) .toast-container,
  body:not(.printing-cards):not(.modal-kartu-open) .btn,
  body:not(.printing-cards):not(.modal-kartu-open) .filter-pills-group,
  body:not(.printing-cards):not(.modal-kartu-open) #userSearchInput,
  body:not(.printing-cards):not(.modal-kartu-open) #reportHalaqahFilter,
  body:not(.printing-cards):not(.modal-kartu-open) #reportStatusFilter,
  body:not(.printing-cards):not(.modal-kartu-open) .role-quick-switch,
  body:not(.printing-cards):not(.modal-kartu-open) .modal-overlay,
  body:not(.printing-cards):not(.modal-kartu-open) #santriCardsPrintArea {
    display: none !important;
  }

  body {
    background: #FFFFFF !important;
    color: #000000 !important;
  }

  body:not(.printing-cards):not(.modal-kartu-open) .main-wrapper {
    margin-left: 0 !important;
    padding: 0 !important;
  }

  body:not(.printing-cards):not(.modal-kartu-open) .page-view {
    display: none !important;
  }

  body:not(.printing-cards):not(.modal-kartu-open) .page-view.active {
    display: block !important;
  }

  .card {
    border: 1px solid #CCCCCC !important;
    box-shadow: none !important;
    break-inside: avoid;
  }

  .data-table th, .data-table td {
    border: 1px solid #DDDDDD !important;
    color: #000000 !important;
    padding: 8px 12px !important;
  }
}

/* ==========================================================================
   DIGITAL QURAN MUSHAF (TAMPILAN LEMBAR DIGITAL AL-QUR'AN)
   ========================================================================== */

/* View Mode Tabs */
.quran-view-mode-tabs {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.view-mode-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  border: 1.5px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.25s ease;
}

.view-mode-tab-btn:hover {
  border-color: var(--primary-light);
  color: var(--primary);
  transform: translateY(-1px);
}

.view-mode-tab-btn.active {
  background: linear-gradient(135deg, var(--primary) 0%, #0D9488 100%);
  color: #FFFFFF;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(109, 40, 217, 0.28);
}

/* Quick Navigation Bar */
.mushaf-navigation-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 18px;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(109, 40, 217, 0.05);
  flex-wrap: wrap;
}

.nav-control-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-main);
}

.nav-control-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  white-space: nowrap;
}

.nav-control-group select {
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--bg-input);
  color: var(--text-main);
  font-size: 0.86rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.nav-control-group select:focus {
  border-color: var(--accent-tosca);
}

/* Page Turner Controls */
.mushaf-page-turner {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-flip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.page-flip-btn:hover:not(:disabled) {
  background: var(--primary-subtle);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

.page-flip-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-input-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px 10px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
}

.page-input-wrapper input {
  width: 58px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--primary);
  font-size: 0.95rem;
  font-weight: 800;
  text-align: center;
  outline: none;
}

.page-input-wrapper input:focus {
  border-color: var(--accent-tosca);
  box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.2);
}

.page-input-wrapper .total-pages {
  color: var(--text-subtle);
}

/* ================= THE MUSHAF DIGITAL SHEET ================= */
.mushaf-sheet-container {
  position: relative;
  max-width: 860px;
  margin: 0 auto 30px auto;
}

/* Side Page Turn Buttons for Desktop */
.side-page-flip-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  color: var(--primary);
  box-shadow: 0 6px 20px rgba(109, 40, 217, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  cursor: pointer;
  z-index: 10;
  transition: all 0.25s ease;
}

.side-page-flip-btn.flip-left {
  left: -24px;
}

.side-page-flip-btn.flip-right {
  right: -24px;
}

.side-page-flip-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--primary) 0%, #0D9488 100%);
  color: #FFFFFF;
  border-color: transparent;
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 8px 24px rgba(13, 148, 136, 0.35);
}

.side-page-flip-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

@media (max-width: 920px) {
  .side-page-flip-btn {
    display: none;
  }
}

/* The Authentic Physical Sheet (Parchment & Ornate Islamic Border) */
.mushaf-sheet {
  background: #FFFDF7; /* Authentic Ivory / Warm Parchment */
  border-radius: 18px;
  box-shadow: 0 16px 48px rgba(109, 40, 217, 0.12), 0 4px 16px rgba(13, 148, 136, 0.08);
  padding: 18px;
  position: relative;
  transition: all 0.3s ease;
}

[data-theme="dark"] .mushaf-sheet {
  background: #171427; /* Rich dark velvet for night Quran reading */
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5), 0 0 24px rgba(45, 212, 191, 0.08);
}

/* Outer Ornate Frame with Double Gold & Tosca Border */
.mushaf-frame-outer {
  border: 3.5px double #C5A059; /* Traditional Quran Gold */
  border-radius: 14px;
  padding: 10px;
  position: relative;
  background: transparent;
}

[data-theme="dark"] .mushaf-frame-outer {
  border-color: #A08040;
}

/* Corner Rosettes */
.mushaf-frame-outer::before,
.mushaf-frame-outer::after {
  content: '❖';
  position: absolute;
  color: #C5A059;
  font-size: 1.1rem;
  line-height: 1;
}

.mushaf-frame-outer::before {
  top: -8px;
  left: -6px;
}

.mushaf-frame-outer::after {
  bottom: -8px;
  right: -6px;
}

/* Inner Frame */
.mushaf-frame-inner {
  border: 1.5px solid rgba(13, 148, 136, 0.55); /* Subtle Tosca Inner Border */
  border-radius: 10px;
  padding: 16px 22px 22px 22px;
  background: transparent;
  min-height: 650px;
  display: flex;
  flex-direction: column;
}

/* Sheet Ornate Header */
.mushaf-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid rgba(197, 160, 89, 0.4);
  padding-bottom: 12px;
  margin-bottom: 18px;
}

.sheet-corner-text {
  display: flex;
  flex-direction: column;
  font-size: 0.88rem;
  color: var(--text-main);
}

.sheet-corner-text strong {
  font-weight: 800;
  color: var(--primary);
}

.sheet-corner-text.right-align strong {
  font-family: 'Amiri', 'Scheherazade New', serif;
  font-size: 1.25rem;
  font-weight: 700;
}

.sheet-corner-text span {
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* Ornate Crest / Plakat in Header (Juz X) */
.sheet-juz-crest {
  background: linear-gradient(135deg, rgba(109, 40, 217, 0.1) 0%, rgba(45, 212, 191, 0.15) 100%);
  border: 1.5px solid #C5A059;
  padding: 4px 18px;
  border-radius: 20px;
  font-family: 'Amiri', 'Scheherazade New', serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #C5A059;
  text-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

[data-theme="dark"] .sheet-juz-crest {
  color: #2DD4BF;
  border-color: #2DD4BF;
  background: rgba(45, 212, 191, 0.12);
}

/* Sheet Arabic Body */
.mushaf-sheet-body {
  flex: 1;
}

/* Flowing Justified Quranic Arabic Text */
.mushaf-page-flow {
  direction: rtl;
  text-align: justify;
  text-align-last: center;
  font-family: 'Amiri', 'Scheherazade New', serif;
  font-size: 1.85rem;
  line-height: 2.5;
  color: #1E1B4B;
  word-spacing: 2px;
  letter-spacing: 0.5px;
}

[data-theme="dark"] .mushaf-page-flow {
  color: #F1F0FB;
}

/* Surah Cartouche / Ornate Banner */
.mushaf-surah-cartouche {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin: 18px 0 12px 0;
  padding: 10px 24px;
  border: 2px solid #C5A059;
  border-radius: 36px;
  background: linear-gradient(135deg, rgba(109, 40, 217, 0.08) 0%, rgba(13, 148, 136, 0.12) 100%);
  box-shadow: inset 0 0 12px rgba(197, 160, 89, 0.2);
}

[data-theme="dark"] .mushaf-surah-cartouche {
  border-color: #2DD4BF;
  background: linear-gradient(135deg, rgba(109, 40, 217, 0.25) 0%, rgba(13, 148, 136, 0.25) 100%);
}

.cartouche-content {
  text-align: center;
}

.cartouche-title-ar {
  font-family: 'Amiri', 'Scheherazade New', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.3;
}

[data-theme="dark"] .cartouche-title-ar {
  color: #A78BFA;
}

.cartouche-meta {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-tosca);
  direction: ltr;
}

/* Basmalah Calligraphy Banner */
.mushaf-basmalah-block {
  text-align: center;
  margin: 8px 0 16px 0;
}

.basmalah-calligraphy {
  font-family: 'Amiri', 'Scheherazade New', serif;
  font-size: 2.1rem;
  font-weight: 700;
  color: #4C1D95;
  display: inline-block;
  letter-spacing: 1px;
}

[data-theme="dark"] .basmalah-calligraphy {
  color: #DDD6FE;
}

/* Individual Ayah Span on Mushaf Sheet */
.mushaf-ayah-span {
  display: inline;
  padding: 2px 4px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  position: relative;
}

.mushaf-ayah-span:hover {
  background: rgba(45, 212, 191, 0.18);
}

/* Ayah Arabic text container on Sheet */
.mushaf-ayah-text {
  display: inline;
  transition: filter 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, background 0.25s ease;
}

/* Blind Mode / Tutup Ayat pada Lembar Mushaf */
.mushaf-ayah-text.hidden-recall {
  filter: blur(9px);
  -webkit-filter: blur(9px);
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  cursor: pointer;
  opacity: 0.35;
  border-radius: 4px;
}

[data-theme="dark"] .mushaf-ayah-text.hidden-recall {
  filter: blur(9px);
  -webkit-filter: blur(9px);
  opacity: 0.25;
}

.mushaf-ayah-span:hover .mushaf-ayah-text.hidden-recall {
  opacity: 0.55;
}

/* Visual feedback saat ayat diintip secara individual pada lembar mushaf */
.mushaf-ayah-span.peek-revealed .mushaf-ayah-text {
  filter: none !important;
  -webkit-filter: none !important;
  opacity: 1 !important;
  background: rgba(13, 148, 136, 0.15);
  border-radius: 6px;
  padding: 2px 4px;
}

/* Active Highlight when Reciting */
.mushaf-ayah-span.active-mushaf-ayah {
  background: linear-gradient(135deg, rgba(109, 40, 217, 0.22) 0%, rgba(45, 212, 191, 0.28) 100%) !important;
  box-shadow: 0 0 14px rgba(45, 212, 191, 0.45);
  border-radius: 8px;
  color: var(--primary-dark);
  font-weight: 700;
}

[data-theme="dark"] .mushaf-ayah-span.active-mushaf-ayah {
  background: linear-gradient(135deg, rgba(109, 40, 217, 0.45) 0%, rgba(45, 212, 191, 0.35) 100%) !important;
  color: #FFFFFF;
}

/* Ayah End Glyph (Circular Islamic Badge ﴿١﴾) */
.ayah-end-glyph {
  display: inline-block;
  margin: 0 4px;
  font-family: 'Amiri', 'Scheherazade New', serif;
  font-size: 1.35rem;
  color: #0D9488;
  vertical-align: middle;
}

.glyph-circle {
  color: #C5A059;
  font-weight: 700;
}

[data-theme="dark"] .glyph-circle {
  color: #2DD4BF;
}

/* Sheet Footer */
.mushaf-sheet-footer {
  margin-top: 24px;
  text-align: center;
}

.sheet-footer-line {
  height: 1.5px;
  background: rgba(197, 160, 89, 0.35);
  margin-bottom: 12px;
}

.sheet-page-footer {
  font-family: 'Amiri', 'Scheherazade New', serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: #C5A059;
  letter-spacing: 2px;
}

[data-theme="dark"] .sheet-page-footer {
  color: #2DD4BF;
}

.sheet-hint-text {
  font-size: 0.75rem;
  color: var(--text-subtle);
  margin-top: 6px;
  direction: ltr;
}

/* Mobile adjustments */
@media (max-width: 640px) {
  .mushaf-navigation-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .nav-control-group {
    justify-content: space-between;
  }

  .mushaf-page-turner {
    justify-content: space-between;
  }

  .mushaf-sheet {
    padding: 10px;
  }

  .mushaf-frame-inner {
    padding: 12px 14px;
  }

  .mushaf-page-flow {
    font-size: 1.5rem;
    line-height: 2.2;
  }

  .basmalah-calligraphy {
    font-size: 1.65rem;
  }

  .cartouche-title-ar {
    font-size: 1.45rem;
  }
}

/* ==========================================================================
   AUTHENTICATION: LOGIN SCREEN & STYLING
   Tema: Purple & Tosca Luxury Gradient + Glassmorphism
   + Interactive Lamp & Spotlight Feature (Mode Terang / Mode Gelap)
   ========================================================================== */

.login-wrapper {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: radial-gradient(circle at 15% 20%, #4C1D95 0%, #1E1B4B 45%, #042F2E 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(65px, 8vh, 95px) 16px 36px 16px;
  overflow-y: auto;
  min-height: 100vh;
  transition: background 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

/* State: Mode Gelap (Lampu Dimatikan) */
.login-wrapper[data-login-light="off"] {
  background: radial-gradient(circle at 50% 30%, #0F172A 0%, #060913 50%, #02040A 100%) !important;
}

.login-wrapper[data-login-light="off"] .ambient-shape {
  opacity: 0.08 !important;
  filter: blur(130px) !important;
}

/* ==========================================================================
   INTERACTIVE FLOATING QUICK LAMP SWITCH (Top Right)
   ========================================================================== */
.login-lamp-quick-switch {
  position: fixed;
  top: 18px;
  right: 20px;
  z-index: 100005;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25), 0 0 16px rgba(254, 240, 138, 0.3);
  color: #FEF08A;
  cursor: pointer;
  outline: none;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
}

.login-lamp-quick-switch:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35), 0 0 25px rgba(254, 240, 138, 0.5);
}

.login-lamp-quick-switch:active {
  transform: translateY(1px) scale(0.97);
}

.lamp-switch-bulb-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #FDE047, #F59E0B);
  color: #78350F;
  font-size: 1.15rem;
  box-shadow: 0 0 14px rgba(253, 224, 71, 0.85);
  transition: all 0.35s ease;
}

.lamp-switch-meta {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.lamp-switch-label {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #FFFFFF;
  line-height: 1.2;
}

.lamp-switch-hint {
  font-size: 0.75rem;
  color: #FEF08A;
  opacity: 0.92;
  font-weight: 600;
}

/* Quick Switch saat Lampu OFF */
.login-wrapper[data-login-light="off"] .login-lamp-quick-switch {
  background: rgba(15, 23, 42, 0.85);
  border-color: rgba(139, 92, 246, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65), 0 0 15px rgba(139, 92, 246, 0.18);
  color: #94A3B8;
}

.login-wrapper[data-login-light="off"] .lamp-switch-bulb-icon {
  background: #334155;
  color: #94A3B8;
  box-shadow: none;
}

.login-wrapper[data-login-light="off"] .lamp-switch-label {
  color: #E2E8F0;
}

.login-wrapper[data-login-light="off"] .lamp-switch-hint {
  color: #38BDF8;
}

/* ==========================================================================
   INTERACTIVE HANGING LAMP FIXTURE & PULL CORD
   ========================================================================== */
.login-lamp-fixture {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100003;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  user-select: none;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.45));
}

.lamp-ceiling-mount {
  width: 44px;
  height: 8px;
  background: #1E293B;
  border-radius: 0 0 8px 8px;
  border-bottom: 2px solid #475569;
}

.lamp-cord {
  width: 3px;
  height: clamp(35px, 5vh, 50px);
  background: linear-gradient(180deg, #334155 0%, #1E293B 100%);
  transform-origin: top center;
  animation: lampSwayAnim 7s ease-in-out infinite alternate;
}

@keyframes lampSwayAnim {
  0% { transform: rotate(-0.75deg); }
  100% { transform: rotate(0.75deg); }
}

.lamp-body {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform-origin: top center;
  animation: lampSwayAnim 7s ease-in-out infinite alternate;
}

.lamp-shade {
  width: 72px;
  height: 30px;
  background: linear-gradient(135deg, #1E1B4B 0%, #312E81 50%, #4338CA 100%);
  border-radius: 40px 40px 4px 4px;
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45), inset 0 2px 4px rgba(255, 255, 255, 0.25);
  position: relative;
  z-index: 3;
}

.lamp-bulb {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  margin-top: -8px;
  position: relative;
  z-index: 2;
  background: radial-gradient(circle at 35% 35%, #FFFFFF 0%, #FEF08A 35%, #F59E0B 75%, #D97706 100%);
  box-shadow: 0 0 25px #FDE047, 0 0 55px #EAB308, 0 0 95px rgba(245, 158, 11, 0.7);
  transition: all 0.45s ease;
}

.bulb-glow-core {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: radial-gradient(circle, #FFFFFF 25%, rgba(254, 240, 138, 0.6) 70%, transparent 100%);
  animation: bulbPulseAnim 2.5s ease-in-out infinite alternate;
}

@keyframes bulbPulseAnim {
  0% { opacity: 0.85; transform: scale(0.96); }
  100% { opacity: 1; transform: scale(1.05); }
}

/* Pull String */
.lamp-pull-cord {
  position: absolute;
  right: -18px;
  top: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  z-index: 4;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lamp-pull-cord:hover {
  transform: translateY(4px);
}

.lamp-pull-cord.pull-active {
  transform: translateY(18px);
}

.pull-chain {
  width: 2px;
  height: 36px;
  background: repeating-linear-gradient(180deg, #FCD34D 0px, #FCD34D 3px, #92400E 3px, #92400E 6px);
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.4);
}

.pull-ring {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #F59E0B, #B45309);
  border: 1.5px solid #FDE047;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35), 0 0 8px rgba(245, 158, 11, 0.5);
}

/* Cone of Light beaming down on the login card */
.lamp-light-cone {
  position: absolute;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  width: clamp(380px, 60vw, 760px);
  height: clamp(520px, 75vh, 760px);
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(ellipse at 50% 0%, rgba(254, 240, 138, 0.32) 0%, rgba(251, 191, 36, 0.14) 30%, rgba(245, 158, 11, 0.04) 60%, transparent 75%);
  clip-path: polygon(44% 0%, 56% 0%, 100% 100%, 0% 100%);
  opacity: 1;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

/* Saat Lampu OFF (Dimatikan) */
.login-wrapper[data-login-light="off"] .lamp-bulb {
  background: radial-gradient(circle at 35% 35%, #475569 0%, #1E293B 70%, #0F172A 100%) !important;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.5) !important;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.login-wrapper[data-login-light="off"] .bulb-glow-core {
  display: none !important;
}

.login-wrapper[data-login-light="off"] .lamp-light-cone {
  opacity: 0 !important;
  transform: translateX(-50%) scaleY(0.5);
}

.login-wrapper[data-login-light="off"] .pull-chain {
  background: repeating-linear-gradient(180deg, #64748B 0px, #64748B 3px, #1E293B 3px, #1E293B 6px);
}

.login-wrapper[data-login-light="off"] .pull-ring {
  background: #334155;
  border-color: #64748B;
  color: #94A3B8;
  box-shadow: none;
}

/* Ambient Floating Glow Shapes */
.login-ambient-shapes {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.ambient-shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.45;
  animation: floatOrb 16s ease-in-out infinite alternate;
}

.shape-purple {
  width: 450px;
  height: 450px;
  background: #7C3AED;
  top: -100px;
  left: -80px;
}

.shape-tosca {
  width: 480px;
  height: 480px;
  background: #0D9488;
  bottom: -120px;
  right: -80px;
  animation-duration: 20s;
  animation-direction: alternate-reverse;
}

.shape-glow {
  width: 320px;
  height: 320px;
  background: #2DD4BF;
  top: 45%;
  left: 60%;
  opacity: 0.25;
  animation-duration: 14s;
}

@keyframes floatOrb {
  0% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(40px, 30px) scale(1.08);
  }
  100% {
    transform: translate(-30px, 50px) scale(0.95);
  }
}

/* Watermark ACF on Purple Area of Login Screen */
.login-watermark-acf {
  position: absolute;
  left: clamp(30px, 10vw, 160px);
  top: 50%;
  transform: translateY(-50%);
  width: clamp(200px, 20vw, 320px);
  max-width: 340px;
  pointer-events: none;
  z-index: 1;
  opacity: 0.32;
  filter: drop-shadow(0 0 45px rgba(139, 92, 246, 0.45));
  user-select: none;
  animation: floatWatermark 10s ease-in-out infinite alternate;
}

.watermark-acf-img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

@keyframes floatWatermark {
  0% {
    transform: translateY(-50%) translateY(0px) rotate(0deg);
  }
  100% {
    transform: translateY(-50%) translateY(-14px) rotate(-1.5deg);
  }
}

@media (max-width: 1024px) {
  .login-watermark-acf {
    left: clamp(20px, 6vw, 80px);
    width: 200px;
    opacity: 0.22;
  }
}

@media (max-width: 768px) {
  .login-watermark-acf {
    left: 50%;
    top: 14%;
    transform: translate(-50%, -50%);
    width: 160px;
    opacity: 0.18;
  }
  @keyframes floatWatermark {
    0% {
      transform: translate(-50%, -50%) translateY(0px);
    }
    100% {
      transform: translate(-50%, -50%) translateY(-8px);
    }
  }
}

/* Watermark BSI Maslahat on Green/Tosca Area of Login Screen */
.login-watermark-bsi {
  position: absolute;
  right: clamp(30px, 8vw, 140px);
  top: 50%;
  transform: translateY(-50%);
  width: clamp(240px, 24vw, 380px);
  max-width: 400px;
  pointer-events: none;
  z-index: 1;
  opacity: 0.35;
  filter: drop-shadow(0 0 45px rgba(45, 212, 191, 0.45));
  user-select: none;
  animation: floatWatermarkBsi 11s ease-in-out infinite alternate;
}

.watermark-bsi-img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

@keyframes floatWatermarkBsi {
  0% {
    transform: translateY(-50%) translateY(0px) rotate(0deg);
  }
  100% {
    transform: translateY(-50%) translateY(14px) rotate(1.5deg);
  }
}

@media (max-width: 1024px) {
  .login-watermark-bsi {
    right: clamp(20px, 6vw, 80px);
    width: clamp(200px, 20vw, 260px);
    opacity: 0.25;
  }
}

@media (max-width: 768px) {
  .login-watermark-bsi {
    left: 50%;
    right: auto;
    top: 88%;
    transform: translate(-50%, -50%);
    width: 210px;
    opacity: 0.20;
  }
  @keyframes floatWatermarkBsi {
    0% {
      transform: translate(-50%, -50%) translateY(0px);
    }
    100% {
      transform: translate(-50%, -50%) translateY(8px);
    }
  }
}

/* Login Card Container */
.login-container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 460px;
  margin: auto;
  animation: loginCardFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes loginCardFadeIn {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 24px;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(109, 40, 217, 0.08);
  padding: 36px 32px;
  color: var(--text-main);
  transition: all 0.3s ease;
}

[data-theme="dark"] .login-card {
  background: rgba(20, 17, 43, 0.94);
  border-color: rgba(139, 92, 246, 0.25);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(45, 212, 191, 0.15);
}

/* Card Header */
.login-card-header {
  text-align: center;
  margin-bottom: 24px;
}

.login-brand-logo-wrap {
  width: 78px;
  height: 78px;
  margin: 0 auto 16px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(109, 40, 217, 0.1) 0%, rgba(13, 148, 136, 0.15) 100%);
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(109, 40, 217, 0.12);
  border: 1px solid rgba(109, 40, 217, 0.15);
}

.login-brand-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 16px;
}

.login-brand-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #6D28D9 0%, #4F46E5 40%, #0D9488 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
}

[data-theme="dark"] .login-brand-title {
  background: linear-gradient(135deg, #A78BFA 0%, #818CF8 40%, #2DD4BF 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-brand-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

.login-greeting-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  border-radius: 999px;
  background: #F5F3FF;
  border: 1px solid #DDD6FE;
  color: #6D28D9;
  font-size: 0.8rem;
  font-weight: 600;
}

[data-theme="dark"] .login-greeting-chip {
  background: rgba(109, 40, 217, 0.2);
  border-color: rgba(139, 92, 246, 0.4);
  color: #DDD6FE;
}

/* Alert Notification */
.login-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #FEF2F2;
  border: 1px solid #FCA5A5;
  color: #DC2626;
  border-radius: 12px;
  font-size: 0.86rem;
  font-weight: 500;
  margin-bottom: 18px;
  animation: shakeAlert 0.35s ease;
}

[data-theme="dark"] .login-alert {
  background: rgba(220, 38, 38, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #FCA5A5;
}

@keyframes shakeAlert {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* Form Styles */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-form-group label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.login-form-group label i {
  color: var(--primary);
  font-size: 0.95rem;
}

[data-theme="dark"] .login-form-group label i {
  color: var(--tosca-bright);
}

.login-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.login-input-wrap .input-prefix-icon {
  position: absolute;
  left: 14px;
  color: #94A3B8;
  font-size: 1.05rem;
  pointer-events: none;
  transition: color 0.2s ease;
}

.login-input {
  width: 100%;
  height: 46px;
  padding: 0 42px 0 42px;
  background: #F8FAFC;
  border: 1.5px solid #E2E8F0;
  border-radius: 12px;
  font-size: 0.92rem;
  color: var(--text-main);
  font-family: inherit;
  transition: all 0.2s ease;
}

[data-theme="dark"] .login-input {
  background: #191438;
  border-color: #2E265C;
  color: #F8FAFC;
}

.login-input:focus {
  outline: none;
  background: #FFFFFF;
  border-color: #0D9488;
  box-shadow: 0 0 0 3.5px rgba(13, 148, 136, 0.15);
}

[data-theme="dark"] .login-input:focus {
  background: #14112B;
  border-color: #2DD4BF;
  box-shadow: 0 0 0 3.5px rgba(45, 212, 191, 0.2);
}

.login-input-wrap:focus-within .input-prefix-icon {
  color: #0D9488;
}

[data-theme="dark"] .login-input-wrap:focus-within .input-prefix-icon {
  color: #2DD4BF;
}

.btn-toggle-password {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: #94A3B8;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-toggle-password:hover {
  color: var(--primary);
  background: rgba(109, 40, 217, 0.08);
}

/* Checkbox and options */
.login-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  margin-top: 2px;
}

.remember-checkbox-label {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  color: var(--text-muted);
  user-select: none;
}

.remember-checkbox-label input[type="checkbox"] {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.login-badge-secure {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #0D9488;
  font-weight: 600;
  font-size: 0.8rem;
}

[data-theme="dark"] .login-badge-secure {
  color: #2DD4BF;
}

/* Submit Action Button */
.btn-login-action {
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #6D28D9 0%, #4F46E5 40%, #0D9488 100%);
  color: #FFFFFF;
  font-size: 0.96rem;
  font-weight: 700;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(109, 40, 217, 0.35);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  margin-top: 6px;
}

.btn-login-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(13, 148, 136, 0.45);
  background: linear-gradient(135deg, #7C3AED 0%, #4338CA 40%, #14B8A6 100%);
}

.btn-login-action:active {
  transform: translateY(0);
}

.btn-login-action:disabled {
  opacity: 0.75;
  cursor: not-allowed;
  transform: none;
}

.spin-icon {
  display: inline-block;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Quick Demo Switcher Section */
.login-demo-section {
  margin-top: 24px;
}

.demo-section-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-subtle);
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 14px;
}

.demo-section-divider::before,
.demo-section-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px dashed var(--border);
}

.demo-section-divider span {
  padding: 0 12px;
}

.demo-quick-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.btn-demo-pill {
  background: #F8FAFC;
  border: 1.5px solid #E2E8F0;
  border-radius: 12px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
}

[data-theme="dark"] .btn-demo-pill {
  background: #1B1638;
  border-color: #2E265C;
}

.btn-demo-pill:hover {
  transform: translateY(-2px);
  border-color: #0D9488;
  background: #F0FDFA;
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.15);
}

[data-theme="dark"] .btn-demo-pill:hover {
  background: #231C4A;
  border-color: #2DD4BF;
  box-shadow: 0 4px 14px rgba(45, 212, 191, 0.2);
}

.demo-admin:hover {
  border-color: #7C3AED;
  background: #F5F3FF;
}

.demo-guru:hover {
  border-color: #2563EB;
  background: #EFF6FF;
}

.demo-santri:hover {
  border-color: #0D9488;
  background: #F0FDFA;
}

.demo-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.demo-pill-info strong {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
}

.demo-pill-info small {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Login Card Footer */
.login-card-footer {
  margin-top: 22px;
  text-align: center;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.login-card-footer p {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.version-tag {
  font-size: 0.75rem;
  color: var(--text-subtle);
  font-weight: 600;
}

/* ==========================================================================
   AUTHENTICATION: MODE GELAP (LAMPU MATI) & WATERMARK GLOW
   Saat lampu dimatikan: Form login menjadi gelap, tetapi logo ACF & BSI
   terlihat SANGAT JELAS dan bercahaya (Luminous Neon Glow).
   ========================================================================== */

/* 1. Form Login Menjadi Gelap saat Lampu Mati */
.login-wrapper[data-login-light="off"] .login-card {
  background: rgba(13, 18, 36, 0.94) !important;
  backdrop-filter: blur(28px) !important;
  -webkit-backdrop-filter: blur(28px) !important;
  border: 1px solid rgba(139, 92, 246, 0.3) !important;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.95), 0 0 35px rgba(109, 40, 217, 0.22) !important;
  color: #F8FAFC !important;
  transition: all 0.5s ease;
}

.login-wrapper[data-login-light="off"] .login-brand-title {
  background: linear-gradient(135deg, #C084FC 0%, #818CF8 40%, #2DD4BF 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  filter: drop-shadow(0 2px 8px rgba(192, 132, 252, 0.4));
}

.login-wrapper[data-login-light="off"] .login-brand-subtitle {
  color: #94A3B8 !important;
}

.login-wrapper[data-login-light="off"] .login-brand-tagline {
  color: #2DD4BF !important;
  text-shadow: 0 0 10px rgba(45, 212, 191, 0.5);
}

.login-wrapper[data-login-light="off"] .login-form-group label {
  color: #E2E8F0 !important;
}

.login-wrapper[data-login-light="off"] .login-form-group label i {
  color: #A78BFA !important;
}

.login-wrapper[data-login-light="off"] .input-prefix-icon {
  color: #818CF8 !important;
}

.login-wrapper[data-login-light="off"] .login-input {
  background: rgba(30, 41, 59, 0.9) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.16) !important;
  color: #FFFFFF !important;
}

.login-wrapper[data-login-light="off"] .login-input:focus {
  background: rgba(30, 41, 59, 1) !important;
  border-color: #2DD4BF !important;
  box-shadow: 0 0 0 3.5px rgba(45, 212, 191, 0.3) !important;
}

.login-wrapper[data-login-light="off"] .login-input::placeholder {
  color: #64748B !important;
}

.login-wrapper[data-login-light="off"] .btn-toggle-password {
  color: #CBD5E1 !important;
}

.login-wrapper[data-login-light="off"] .btn-toggle-password:hover {
  color: #2DD4BF !important;
  background: rgba(45, 212, 191, 0.12) !important;
}

.login-wrapper[data-login-light="off"] .remember-checkbox-label span {
  color: #CBD5E1 !important;
}

.login-wrapper[data-login-light="off"] .login-badge-secure {
  color: #2DD4BF !important;
}

.login-wrapper[data-login-light="off"] .login-card-footer {
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #64748B !important;
}

.login-wrapper[data-login-light="off"] .login-card-footer p {
  color: #94A3B8 !important;
}

.login-wrapper[data-login-light="off"] .version-tag {
  color: #64748B !important;
}

/* 2. Logo ACF & BSI Menyala Sangat Jelas saat Lampu Mati */
.login-wrapper[data-login-light="off"] .login-watermark-acf {
  opacity: 1 !important;
  filter: drop-shadow(0 0 25px #A855F7) drop-shadow(0 0 60px rgba(168, 85, 247, 0.95)) drop-shadow(0 0 100px rgba(124, 58, 237, 0.8)) brightness(1.3) contrast(1.15) !important;
  transform: translateY(-50%) scale(1.15) !important;
  z-index: 10 !important;
  animation: pulseGlowAcf 3s ease-in-out infinite alternate !important;
  transition: opacity 0.6s ease, filter 0.6s ease, transform 0.6s ease;
}

@keyframes pulseGlowAcf {
  0% {
    filter: drop-shadow(0 0 20px #A855F7) drop-shadow(0 0 50px rgba(168, 85, 247, 0.85)) brightness(1.25);
    transform: translateY(-50%) scale(1.12);
  }
  100% {
    filter: drop-shadow(0 0 35px #C084FC) drop-shadow(0 0 80px rgba(147, 51, 234, 1)) brightness(1.4);
    transform: translateY(-50%) scale(1.18);
  }
}

.login-wrapper[data-login-light="off"] .login-watermark-bsi {
  opacity: 1 !important;
  filter: drop-shadow(0 0 25px #2DD4BF) drop-shadow(0 0 60px rgba(45, 212, 191, 0.95)) drop-shadow(0 0 100px rgba(13, 148, 136, 0.8)) brightness(1.3) contrast(1.15) !important;
  transform: translateY(-50%) scale(1.15) !important;
  z-index: 10 !important;
  animation: pulseGlowBsi 3s ease-in-out infinite alternate !important;
  transition: opacity 0.6s ease, filter 0.6s ease, transform 0.6s ease;
}

@keyframes pulseGlowBsi {
  0% {
    filter: drop-shadow(0 0 20px #2DD4BF) drop-shadow(0 0 50px rgba(45, 212, 191, 0.85)) brightness(1.25);
    transform: translateY(-50%) scale(1.12);
  }
  100% {
    filter: drop-shadow(0 0 35px #5EEAD4) drop-shadow(0 0 80px rgba(13, 148, 136, 1)) brightness(1.4);
    transform: translateY(-50%) scale(1.18);
  }
}

/* 3. Dark Mode Illuminated Partner Spotlight (ACF & BSI) */
.login-dark-partner-spotlight {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  margin-top: 0;
  transform: translateY(12px);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.login-wrapper[data-login-light="off"] .login-dark-partner-spotlight {
  opacity: 1;
  max-height: 140px;
  margin-top: 18px;
  transform: translateY(0);
  pointer-events: auto;
}

.partner-spotlight-inner {
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(45, 212, 191, 0.35);
  border-radius: 18px;
  padding: 12px 20px;
  text-align: center;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.7), 0 0 30px rgba(139, 92, 246, 0.25);
}

.partner-spotlight-title {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #2DD4BF;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-shadow: 0 0 10px rgba(45, 212, 191, 0.4);
}

.partner-spotlight-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.partner-logo-banner-box {
  background: #ffffff;
  padding: 8px 18px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4), 0 0 22px rgba(45, 212, 191, 0.3);
  border: 1.5px solid rgba(45, 212, 191, 0.5);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  max-width: 100%;
}

.partner-logo-banner-box:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5), 0 0 30px rgba(45, 212, 191, 0.5);
}

.spotlight-partner-banner-img {
  height: 36px;
  max-width: 100%;
  width: auto;
  object-fit: contain;
  display: block;
}

.partner-logo-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  padding: 6px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.partner-logo-item:hover {
  transform: scale(1.05);
}

.partner-logo-item.partner-acf {
  border-color: rgba(168, 85, 247, 0.5);
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.35);
}

.partner-logo-item.partner-bsi {
  border-color: rgba(45, 212, 191, 0.5);
  box-shadow: 0 0 16px rgba(45, 212, 191, 0.35);
}

.spotlight-logo-img {
  height: 28px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6));
}

.partner-logo-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #F8FAFC;
}

.partner-spotlight-sep {
  color: #A855F7;
  font-size: 0.9rem;
  opacity: 0.75;
}

@media (max-width: 600px) {
  .login-lamp-quick-switch {
    top: 12px;
    right: 12px;
    padding: 6px 12px;
  }
  .lamp-switch-bulb-icon {
    width: 26px;
    height: 26px;
    font-size: 0.95rem;
  }
  .lamp-switch-hint {
    display: none;
  }
  .login-dark-partner-spotlight {
    margin-top: 12px;
  }
  .partner-logo-banner-box {
    padding: 6px 12px;
    border-radius: 10px;
  }
  .spotlight-partner-banner-img {
    height: 28px;
  }
  .partner-spotlight-logos {
    gap: 8px;
  }
  .partner-logo-item {
    padding: 4px 8px;
    gap: 6px;
  }
  .spotlight-logo-img {
    height: 22px;
  }
  .partner-logo-label {
    font-size: 0.75rem;
  }
}

/* ==========================================================================
   LOGOUT BUTTONS IN HEADER & SIDEBAR
   ========================================================================== */

.header-logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #DC2626;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

[data-theme="dark"] .header-logout-btn {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
  color: #F87171;
}

.header-logout-btn:hover {
  background: #EF4444;
  border-color: #EF4444;
  color: #FFFFFF;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.sidebar-logout-btn {
  margin-left: auto;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid rgba(239, 68, 68, 0.2);
  background: rgba(239, 68, 68, 0.08);
  color: #EF4444;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

[data-theme="dark"] .sidebar-logout-btn {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #F87171;
}

.sidebar-logout-btn:hover {
  background: #EF4444;
  border-color: #EF4444;
  color: #FFFFFF;
  transform: scale(1.05);
}

@media (max-width: 576px) {
  .login-card {
    padding: 28px 20px;
    border-radius: 20px;
  }
}

/* ==========================================================================
   SCORE EDITING & RANGE SLIDER STYLES
   ========================================================================== */

.score-display-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.score-display-cell:hover {
  background: var(--bg-input);
}

.score-display-cell:hover .score-edit-icon {
  transform: scale(1.18);
  color: var(--accent-tosca);
}

.score-edit-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(109, 40, 217, 0.08);
  color: var(--primary);
  font-size: 0.82rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] .score-edit-icon {
  background: rgba(139, 92, 246, 0.15);
  color: var(--primary-light);
}

.custom-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 6px;
  background: var(--border);
  outline: none;
  transition: background 0.2s;
  cursor: pointer;
}

.custom-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6D28D9 0%, #0D9488 100%);
  border: 2px solid #FFFFFF;
  box-shadow: 0 2px 8px rgba(109, 40, 217, 0.4);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.custom-range::-webkit-slider-thumb:hover {
  transform: scale(1.22);
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.5);
}

.custom-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6D28D9 0%, #0D9488 100%);
  border: 2px solid #FFFFFF;
  box-shadow: 0 2px 8px rgba(109, 40, 217, 0.4);
  cursor: pointer;
  transition: transform 0.15s ease;
}

[data-theme="dark"] .custom-range {
  background: var(--border);
}

[data-theme="dark"] .custom-range::-webkit-slider-thumb {
  background: linear-gradient(135deg, #8B5CF6 0%, #2DD4BF 100%);
  border-color: #14112B;
}

/* ================= CEKLIST HAFALAN SURAH STYLES ================= */
.student-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
}

.student-pill-btn img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--primary);
}

.student-pill-btn:hover {
  background: var(--primary-subtle);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.student-pill-btn.active {
  background: var(--gradient-duo);
  color: #FFFFFF;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(109, 40, 217, 0.3);
}

.student-pill-btn.active img {
  border-color: #FFFFFF;
}

.student-pill-btn .pill-badge {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(13, 148, 136, 0.15);
  color: var(--accent-tosca);
}

.student-pill-btn.active .pill-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
}

/* Surah Checkbox styling */
.surah-checkbox-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.surah-checkbox {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid var(--border);
  cursor: pointer;
  accent-color: var(--accent-tosca);
  transition: transform 0.15s ease;
}

.surah-checkbox:hover {
  transform: scale(1.15);
}

/* Surah Chips */
.surah-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-main);
  transition: all 0.15s ease;
}

.surah-chip.completed {
  background: #ECFDF5;
  color: #065F46;
  border-color: #A7F3D0;
}

[data-theme="dark"] .surah-chip.completed {
  background: #064E3B;
  color: #A7F3D0;
  border-color: #059669;
}

.surah-chip.in_progress {
  background: #FFFBEB;
  color: #92400E;
  border-color: #FDE68A;
}

[data-theme="dark"] .surah-chip.in_progress {
  background: #78350F;
  color: #FDE68A;
  border-color: #D97706;
}

/* Surah Status Pill */
.surah-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.surah-status-pill.completed {
  background: #ECFDF5;
  color: #059669;
  border: 1px solid #A7F3D0;
}

.surah-status-pill.in_progress {
  background: #FFFBEB;
  color: #D97706;
  border: 1px solid #FDE68A;
}

.surah-status-pill.not_started {
  background: var(--bg-input);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

[data-theme="dark"] .surah-status-pill.completed {
  background: #064E3B;
  color: #6EE7B7;
  border-color: #047857;
}

[data-theme="dark"] .surah-status-pill.in_progress {
  background: #451A03;
  color: #FCD34D;
  border-color: #92400E;
}

/* Mini Progress Bar in Table */
.surah-mini-progress {
  width: 100%;
  max-width: 110px;
  height: 6px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 4px;
}

.surah-mini-progress-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent-tosca), var(--tosca-bright));
  transition: width 0.3s ease;
}

.surah-mini-progress-fill.full {
  background: linear-gradient(90deg, #10B981, #059669);
}

/* ====================================================
   PUBLIC SPEAKING & MUHADHARAH ASSESSMENT MODULE
   ==================================================== */
.rubric-row {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--border-color, #E2E8F0);
}
.rubric-row:last-of-type {
  border-bottom: none;
  margin-bottom: 6px;
  padding-bottom: 0;
}
.rubric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.rubric-desc {
  font-size: 0.75rem;
  color: var(--text-muted, #64748B);
  margin-top: 1px;
}
.rubric-score-box {
  width: 72px;
}
.rubric-score-input {
  text-align: center;
  font-weight: 800;
  font-size: 0.95rem;
  padding: 4px 8px;
  border-radius: 8px;
  color: var(--primary, #7C3AED);
}
.rubric-range {
  width: 100%;
  height: 6px;
  border-radius: 4px;
  background: var(--border, #E2E8F0);
  outline: none;
  cursor: pointer;
  accent-color: var(--primary, #7C3AED);
}

/* Live score banner inside modal */
.ps-live-score-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.12), rgba(13, 148, 136, 0.12));
  border: 1px solid rgba(124, 58, 237, 0.25);
  border-radius: 12px;
  padding: 14px 18px;
  margin-top: 14px;
}

/* Language badges */
.badge-lang {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
}
.badge-lang-id {
  background: rgba(239, 68, 68, 0.1);
  color: #DC2626;
  border: 1px solid rgba(239, 68, 68, 0.25);
}
.badge-lang-ar {
  background: rgba(13, 148, 136, 0.12);
  color: #0D9488;
  border: 1px solid rgba(13, 148, 136, 0.25);
}
.badge-lang-en {
  background: rgba(59, 130, 246, 0.1);
  color: #2563EB;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

/* Grade badges extra */
.grade-badge.maqbul {
  background: #FEF3C7;
  color: #B45309;
  border: 1px solid #FDE68A;
}
.grade-badge.rasib {
  background: #FEE2E2;
  color: #B91C1C;
  border: 1px solid #FECACA;
}

/* Rubric mini grid in table cell */
.ps-score-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  font-size: 0.75rem;
  text-align: center;
}
.ps-score-mini-item {
  background: rgba(0, 0, 0, 0.03);
  padding: 3px 4px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.05);
}
.ps-score-mini-label {
  font-size: 0.75rem;
  color: var(--text-muted, #64748B);
  display: block;
}
.ps-score-mini-val {
  font-weight: 800;
  color: var(--text-main, #1E293B);
}

/* Certificate Card in Detail Modal */
.ps-certificate-card {
  border: 2px solid var(--border-color, #E2E8F0);
  border-radius: 16px;
  padding: 24px;
  background: #FFFFFF;
  position: relative;
  box-shadow: 0 4px 20px rgba(0,0,0,0.04);
}
.ps-certificate-header {
  text-align: center;
  padding-bottom: 16px;
  border-bottom: 2px dashed #E2E8F0;
  margin-bottom: 20px;
}
.ps-certificate-logo {
  height: 48px;
  margin-bottom: 8px;
}
.ps-certificate-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: #1E293B;
  margin: 0;
  letter-spacing: 0.5px;
}
.ps-certificate-subtitle {
  font-size: 0.8rem;
  color: #64748B;
  margin: 2px 0 0;
}
.ps-cert-student-box {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #F8FAFC;
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 20px;
}
.ps-cert-student-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #7C3AED;
}
.ps-rubric-bar-item {
  margin-bottom: 10px;
}
.ps-rubric-bar-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.ps-rubric-bar-track {
  width: 100%;
  height: 8px;
  background: #E2E8F0;
  border-radius: 4px;
  overflow: hidden;
}
.ps-rubric-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #7C3AED, #0D9488);
}
.ps-cert-final-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #F1F5F9;
  padding: 14px 18px;
  border-radius: 12px;
  margin-top: 18px;
}

/* Dark mode adjustments */
[data-theme="dark"] .ps-certificate-card {
  background: #18181B;
  border-color: #27272A;
}
[data-theme="dark"] .ps-certificate-title {
  color: #F8FAFC;
}
[data-theme="dark"] .ps-certificate-subtitle {
  color: #A1A1AA;
}
[data-theme="dark"] .ps-cert-student-box {
  background: #27272A;
}
[data-theme="dark"] .ps-cert-final-box {
  background: #27272A;
}
[data-theme="dark"] .ps-score-mini-item {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .ps-score-mini-val {
  color: #F8FAFC;
}
[data-theme="dark"] .ps-live-score-banner {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.2), rgba(13, 148, 136, 0.2));
  border-color: rgba(124, 58, 237, 0.4);
}

/* ==========================================================================
   PRESENSI SANTRI & BARCODE / QR SCANNER STYLES
   ========================================================================== */

.scanner-viewport-wrapper {
  position: relative;
  background: #0F172A;
  border-radius: 14px;
  overflow: hidden;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.6);
}

.scanner-laser-line {
  position: absolute;
  left: 5%;
  right: 5%;
  height: 3px;
  background: linear-gradient(90deg, transparent, #10B981, #0D9488, #10B981, transparent);
  box-shadow: 0 0 16px #10B981, 0 0 6px #0D9488;
  border-radius: 3px;
  pointer-events: none;
  z-index: 10;
  animation: scanLaser 2.2s infinite ease-in-out;
}

@keyframes scanLaser {
  0% { top: 12%; opacity: 0.9; }
  50% { top: 88%; opacity: 1; }
  100% { top: 12%; opacity: 0.9; }
}

/* Scanner toast feedback */
.scanner-feedback-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 12px;
  animation: slideDownFade 0.3s ease;
}

.scanner-feedback-card.success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #065F46;
}

.scanner-feedback-card.warning {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #92400E;
}

.scanner-feedback-card.error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #991B1B;
}

[data-theme="dark"] .scanner-feedback-card.success {
  background: rgba(16, 185, 129, 0.2);
  color: #6EE7B7;
}

[data-theme="dark"] .scanner-feedback-card.warning {
  background: rgba(245, 158, 11, 0.2);
  color: #FCD34D;
}

[data-theme="dark"] .scanner-feedback-card.error {
  background: rgba(239, 68, 68, 0.2);
  color: #FCA5A5;
}

/* Printable Santri ID Card & Lembar A4 Preview */
.print-a4-page {
  background: var(--bg-card, #ffffff);
  border: 1.5px solid var(--border-color, #E2E8F0);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 22px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .print-a4-page {
  background: #1E293B;
  border-color: #334155;
}

.print-a4-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border-color, #E2E8F0);
}

.print-a4-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.santri-id-card {
  width: 100%;
  max-width: 390px;
  aspect-ratio: 9.5 / 6.5;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 12px;
  border: 1.5px solid #E2E8F0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  page-break-inside: avoid;
}

[data-theme="dark"] .santri-id-card {
  background: #1E293B;
  border-color: #334155;
}

.santri-card-header {
  background: linear-gradient(135deg, #7C3AED, #0D9488);
  color: #ffffff;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.santri-card-header-title {
  font-weight: 900;
  font-size: 1.12rem;
  letter-spacing: 0.6px;
  line-height: 1.2;
}

.santri-card-header-sub {
  font-size: 0.75rem;
  opacity: 0.95;
  font-weight: 600;
  margin-top: 2px;
}

.santri-card-header-badge {
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.22);
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.santri-card-body {
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.santri-card-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.santri-card-name {
  font-weight: 900;
  color: var(--text-main, #0F172A);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.santri-card-halaqah {
  font-size: 0.95rem;
  color: var(--primary, #0D9488);
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.santri-card-asal {
  font-size: 0.88rem;
  color: var(--text-muted, #64748B);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.santri-card-area {
  font-size: 0.85rem;
  color: #0284C7;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
}

.santri-card-qr-box {
  width: 95px;
  height: 95px;
  flex-shrink: 0;
  background: #ffffff;
  padding: 4px;
  border: 1.5px solid #E2E8F0;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.santri-card-qr-box img,
.santri-card-qr-box svg,
.santri-card-qr-box canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.santri-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
  background: #F8FAFC;
  border-top: 1px solid #E2E8F0;
  border-radius: 0 0 12px 12px;
}

[data-theme="dark"] .santri-card-footer {
  background: #0F172A;
  border-color: #334155;
}

.santri-card-footer-logo {
  height: 20px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.santri-card-scan-label {
  font-size: 0.55rem;
  color: #94A3B8;
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* Printable Card Wrapper & Action Bar */
.printable-card-wrapper {
  background: var(--bg-card, #ffffff);
  border-radius: 14px;
  padding: 8px;
  border: 1px solid var(--border-color, #E2E8F0);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.03);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

[data-theme="dark"] .printable-card-wrapper {
  background: #1E293B;
  border-color: #334155;
}

.printable-card-wrapper:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.06);
}

.santri-card-action-bar {
  padding-top: 6px;
  border-top: 1px dashed var(--border-color, #E2E8F0);
}

.santri-card-action-bar .btn {
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  border-radius: 6px !important;
  padding: 4px 10px !important;
}

/* ==========================================================================
   DASHBOARD TOTAL SANTRI PER RUMAH QURAN
   ========================================================================== */
.rq-summary-card {
  background: var(--bg-card, #ffffff);
  border: 1.5px solid var(--border-color, #E2E8F0);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.rq-summary-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.rq-summary-card.active-filter {
  border-color: var(--primary, #7C3AED) !important;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.18) !important;
}

[data-theme="dark"] .rq-summary-card {
  background: #1E293B;
  border-color: #334155;
}

.rq-segment {
  height: 100%;
  transition: opacity 0.2s ease, transform 0.2s ease;
  cursor: pointer;
}

.rq-segment:hover {
  opacity: 0.85;
  filter: brightness(1.1);
}







/* ====================================================
   PENYEMPURNAAN TAMPILAN (label menu, header HP, banner)
   ==================================================== */

/* Label menu sidebar tidak lagi terpotong: boleh turun ke 2 baris */
.nav-item {
  white-space: normal;
  min-height: 44px;
}

.nav-item > span:first-of-type {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: break-word;
  line-height: 1.25;
}

/* Tombol di banner dashboard boleh turun baris di layar sempit */
.hero-actions {
  flex-wrap: wrap;
}

.hero-actions .btn {
  white-space: normal;
  min-width: 0;
}

@media (max-width: 768px) {
  /* Judul header ikut menyusut, tidak menimpa tombol di kanan */
  .page-title {
    min-width: 0 !important;
    flex: 1 1 auto !important;
  }

  .page-title h2,
  .page-title p {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    line-height: 1.2 !important;
  }

  .page-title h2 {
    font-size: 0.98rem !important;
  }

  .hero-actions {
    width: 100%;
  }

  .hero-actions .btn {
    flex: 1 1 140px;
  }
}

@media (max-width: 768px) {
  /* Navigasi surah/juz pada halaman Qur'an tidak melebihi lebar layar */
  .nav-control-group {
    flex-wrap: wrap;
    min-width: 0;
    max-width: 100%;
  }

  .nav-control-group select {
    min-width: 0;
    max-width: 100%;
    flex: 1 1 160px;
  }
}

@media (max-width: 768px) {
  /* Tombol sebelumnya/berikutnya + nomor halaman muat di layar HP */
  .mushaf-page-turner {
    width: 100%;
    min-width: 0;
    gap: 6px;
  }

  .mushaf-page-turner .page-flip-btn {
    padding: 8px 10px;
    flex: 0 1 auto;
    min-width: 0;
  }

  .mushaf-page-turner .page-input-wrapper {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: center;
  }
}

/* Lencana di banner judul halaman: teks putih agar terbaca di atas gradien */
.quran-header-bar .badge {
  background: rgba(255, 255, 255, 0.22) !important;
  color: #fff !important;
}

@media (max-width: 768px) {
  /* Pemilih ulangan pada pemutar audio tidak melebihi lebar layar */
  .repeat-loop-select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    flex-wrap: wrap;
  }

  .repeat-loop-select select {
    min-width: 0;
    max-width: 100%;
  }
}

/* ==========================================================================
   LOGIN DI HP: lampu, saklar & watermark dimatikan agar tidak menimpa form
   ========================================================================== */
@media (max-width: 768px) {
  .login-wrapper { overflow-x: hidden; }
  .login-lamp-fixture,
  .login-lamp-quick-switch,
  .lamp-light-cone,
  .login-watermark-acf,
  .login-watermark-bsi { display: none !important; }
}

/* ==========================================================================
   BADGE / CHIP: gaya dasar (sebelumnya tidak ada sehingga teks terpotong
   dan chip bertumpuk) + kontras di mode gelap
   ========================================================================== */
.badge, .badge-pill, .badge-tag, .grade-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  vertical-align: middle;
  line-height: 1.3;
  max-width: 100%;
  box-sizing: border-box;
  text-align: center;
  white-space: nowrap;
}
/* Chip di banner (latar putih transparan) boleh turun baris di layar sempit */
.badge[style*="255, 255, 255"] { white-space: normal; }
/* Di dalam tabel / baris sempit jangan dipatahkan; di tempat lain boleh turun baris */
td .badge, td .badge-pill, td .badge-tag, td .grade-badge,
.stat-card .badge, .stat-card .badge-pill { white-space: nowrap; }
.stat-info, .stat-data, .stat-card > div { min-width: 0; }
.badge-pill { padding: 3px 10px; border-radius: 999px; font-weight: 700; background: rgba(255, 255, 255, 0.18); color: #fff; }
.badge { border-radius: 999px; padding: 4px 12px; font-size: 0.78rem; }

/* Chip bertinta transparan (warna inline gelap) dicerahkan di permukaan gelap */
[data-theme="dark"] .badge[style*="rgba"]:not(.quran-header-bar *),
[data-theme="dark"] .badge-tag[style*="rgba"] {
  filter: brightness(1.7) saturate(1.1);
}

/* Varian ikon KPI yang sebelumnya tidak punya warna (ikon tak terlihat) */
.stat-icon-wrapper.amber, .stat-icon-wrapper.orange { background: #FEF3C7; color: #B45309; border: 1px solid #FDE68A; }
.stat-icon-wrapper.red { background: #FEE2E2; color: #DC2626; border: 1px solid #FECACA; }
/* Angka + persen di kartu: persen turun baris bila sempit */
.stat-info > div[style*="baseline"] { flex-wrap: wrap; row-gap: 2px; }

/* ==========================================================================
   Kelas yang dipakai di HTML/JS tetapi belum punya gaya (tombol abu-abu
   bawaan browser, spinner tak muncul, dsb.)
   ========================================================================== */
.btn-ghost { background: transparent; border: 1px solid transparent; color: var(--text-muted); cursor: pointer; border-radius: var(--radius-sm); }
.btn-ghost:hover { background: rgba(148, 163, 184, 0.18); }
.btn-link { background: transparent; border: none; color: var(--primary); cursor: pointer; }
.btn-danger { background: #DC2626; color: #fff; border-color: #DC2626; }
.btn-danger:hover { background: #B91C1C; }
.btn-outline-danger { background: transparent; color: #DC2626; border: 1px solid #DC2626; }
.btn-outline-danger:hover { background: #DC2626; color: #fff; }
.form-control-sm { padding: 6px 10px; font-size: 0.8rem; min-height: 34px; }
.text-danger { color: #DC2626; } .text-success { color: #059669; } .text-warning { color: #B45309; } .text-muted { color: var(--text-muted); }
[data-theme="dark"] .text-danger { color: #F87171; } [data-theme="dark"] .text-success { color: #34D399; } [data-theme="dark"] .text-warning { color: #FBBF24; }
.spinner-border { display: inline-block; width: 1.1em; height: 1.1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; vertical-align: -0.15em; animation: spinBorder 0.7s linear infinite; }
.spinner-border-sm { width: 0.9em; height: 0.9em; }
@keyframes spinBorder { to { transform: rotate(360deg); } }
.progress-bar-track { height: 8px; border-radius: 999px; background: rgba(148, 163, 184, 0.25); overflow: hidden; }
[data-theme="dark"] .rq-stacked-bar { background: rgba(148, 163, 184, 0.2) !important; }

/* ==========================================================================
   KONTRAS TERANG/GELAP (audit lanjutan)
   ========================================================================== */
/* Tombol tosca: teks putih di atas mint terang kurang terbaca -> pakai gradasi lebih tua */
.btn-gold { background: linear-gradient(135deg, #14B8A6 0%, #0D9488 50%, #0F766E 100%); }
/* Label di dalam bilah header ungu */
.quran-header-bar span[style*="text-muted"], .quran-header-bar label[style*="text-muted"] { color: rgba(255, 255, 255, 0.9) !important; }
/* Mode terang: chip bertinta transparan dengan warna cerah dibuat lebih pekat */
:root:not([data-theme="dark"]) .page-view .badge[style*="rgba"]:not([style*="255, 255, 255"]):not(.hero-banner *):not(.quran-header-bar *):not(.card-header *),
:root:not([data-theme="dark"]) .page-view .stat-card .badge-pill[style*="rgba"] {
  filter: brightness(0.74) saturate(1.15);
}
/* Mode gelap: pil tosca solid & angka teal pada latar gelap */
[data-theme="dark"] .badge-pill[style*="background:var(--accent-tosca)"] { color: #042F2E !important; }
[data-theme="dark"] strong[style*="#0D9488"], [data-theme="dark"] span[style*="color:#0D9488"] { color: #2DD4BF !important; }

/* ==========================================================================
   "COLLAB BY": kapsul logo mitra yang rapi & lebih besar (terang + gelap)
   ========================================================================== */
.header-partner-banner-logo {
  height: auto !important;
  padding: 5px 16px !important;
  border-radius: 999px !important;
  background: #FFFFFF !important;
  border: 1px solid rgba(148, 163, 184, 0.35) !important;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.10) !important;
}
.header-partner-banner-logo .partner-logo-img {
  height: 30px !important;
  width: auto !important;
  max-width: none !important;
  padding: 0 !important;
  object-fit: contain;
}
[data-theme="dark"] .header-partner-banner-logo {
  border-color: rgba(255, 255, 255, 0.18) !important;
  box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.25), 0 4px 16px rgba(0, 0, 0, 0.45) !important;
}
@media (max-width: 768px) {
  .header-partner-banner-logo { padding: 4px 14px !important; }
  .header-partner-banner-logo .partner-logo-img { height: 26px !important; }
}
@media (max-width: 400px) {
  .header-partner-banner-logo .partner-logo-img { height: 22px !important; }
}
/* Layar menengah: logo sedikit lebih kecil agar judul header tidak terdesak */
@media (min-width: 769px) and (max-width: 1280px) {
  .header-partner-banner-logo { padding: 4px 12px !important; }
  .header-partner-banner-logo .partner-logo-img { height: 24px !important; }
}
@media (min-width: 769px) and (max-width: 1100px) {
  .header-collab-text { display: none !important; }
  .header-partner-banner-logo .partner-logo-img { height: 22px !important; }
}

/* ==========================================================================
   FILTER / DROPDOWN: teks tidak terpotong + ikut gelap di mode gelap
   ========================================================================== */
/* Akar masalah teks "tenggelam": tinggi tetap 38px dengan padding vertikal 11px
   menyisakan ruang isi 16px < tinggi baris, sehingga huruf terpotong. */
select, .card-header select, .quran-header-bar select, select.form-control {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  min-height: 38px;
  line-height: 1.3;
  text-overflow: ellipsis;
}
.card-header select, .quran-header-bar select { padding-right: 34px !important; }

[data-theme="dark"] .card-header input,
[data-theme="dark"] .card-header select,
[data-theme="dark"] .quran-header-bar input,
[data-theme="dark"] .quran-header-bar select,
[data-theme="dark"] #childSurahQuickFilter,
[data-theme="dark"] #filterVoiceStatus,
[data-theme="dark"] #reportHalaqahFilter,
[data-theme="dark"] #reportStatusFilter,
[data-theme="dark"] #chkFilterJuz,
[data-theme="dark"] #chkFilterStatus {
  background-color: rgba(15, 23, 42, 0.62) !important;
  color: #F1F5F9 !important;
  border: 1.5px solid rgba(255, 255, 255, 0.28) !important;
  box-shadow: none !important;
  color-scheme: dark;
  backdrop-filter: blur(6px);
}
[data-theme="dark"] .card-header input::placeholder,
[data-theme="dark"] .quran-header-bar input::placeholder { color: #94A3B8 !important; }
[data-theme="dark"] .card-header select option,
[data-theme="dark"] .quran-header-bar select option,
[data-theme="dark"] #childSurahQuickFilter option,
[data-theme="dark"] #filterVoiceStatus option,
[data-theme="dark"] #reportHalaqahFilter option,
[data-theme="dark"] #reportStatusFilter option,
[data-theme="dark"] #chkFilterJuz option,
[data-theme="dark"] #chkFilterStatus option {
  background: #1E1B3A !important;
  color: #F1F5F9 !important;
}
[data-theme="dark"] .card-header select:focus,
[data-theme="dark"] .card-header input:focus,
[data-theme="dark"] .quran-header-bar select:focus,
[data-theme="dark"] .quran-header-bar input:focus {
  border-color: #2DD4BF !important;
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.3) !important;
}

/* ==========================================================================
   MODE GELAP: header kartu lebih tenang (ungu gelap polos + garis tosca)
   ========================================================================== */
[data-theme="dark"] .card-header {
  background: linear-gradient(135deg, #231A47 0%, #1F1A40 55%, #15292F 100%) !important;
  border-bottom: 1px solid rgba(45, 212, 191, 0.28) !important;
}

/* ==========================================================================
   HP: tabel lebar jadi kartu bertumpuk (label kolom diisi lewat JS)
   ========================================================================== */
@media (max-width: 640px) {
  .data-table.stack-mobile { min-width: 0 !important; width: 100% !important; display: block; }
  .data-table.stack-mobile thead { display: none; }
  .data-table.stack-mobile tbody { display: block; }
  .data-table.stack-mobile tr {
    display: block;
    margin: 0 0 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
  }
  .data-table.stack-mobile td {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    text-align: right;
    padding: 8px 12px !important;
    border: none !important;
    border-bottom: 1px dashed var(--border) !important;
    white-space: normal;
  }
  .data-table.stack-mobile td:last-child { border-bottom: none !important; }
  .data-table.stack-mobile td[data-label]::before {
    content: attr(data-label);
    flex: 0 0 36%;
    max-width: 36%;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-subtle);
  }
  .data-table.stack-mobile td[data-label=""]::before { display: none; }
  .data-table.stack-mobile td[colspan] { display: block !important; text-align: center; }
  .data-table.stack-mobile td > * { text-align: right; min-width: 0; }
  .table-responsive:has(.stack-mobile) { overflow-x: visible !important; margin: 0; }
}

/* ==========================================================================
   TOKEN CHIP: satu sumber warna untuk terang & gelap (menggantikan warna inline)
   ========================================================================== */
.chip-sky     { background: rgba(14, 165, 233, 0.14);  color: #0369A1; }
.chip-teal    { background: rgba(13, 148, 136, 0.14);  color: #0F766E; }
.chip-emerald { background: rgba(16, 185, 129, 0.14);  color: #047857; }
.chip-violet  { background: rgba(124, 58, 237, 0.12);  color: #6D28D9; }
.chip-indigo  { background: rgba(99, 102, 241, 0.13);  color: #4338CA; }
.chip-red     { background: rgba(239, 68, 68, 0.13);   color: #B91C1C; }
.chip-blue    { background: rgba(37, 99, 235, 0.11);   color: #1D4ED8; }
.chip-pink    { background: rgba(219, 39, 119, 0.11);  color: #BE185D; }
.chip-amber   { background: rgba(245, 158, 11, 0.16);  color: #B45309; }
[data-theme="dark"] .chip-sky     { background: rgba(56, 189, 248, 0.16);  color: #7DD3FC; }
[data-theme="dark"] .chip-teal    { background: rgba(45, 212, 191, 0.16);  color: #5EEAD4; }
[data-theme="dark"] .chip-emerald { background: rgba(52, 211, 153, 0.16);  color: #6EE7B7; }
[data-theme="dark"] .chip-violet  { background: rgba(167, 139, 250, 0.18); color: #C4B5FD; }
[data-theme="dark"] .chip-indigo  { background: rgba(129, 140, 248, 0.18); color: #A5B4FC; }
[data-theme="dark"] .chip-red     { background: rgba(248, 113, 113, 0.18); color: #FCA5A5; }
[data-theme="dark"] .chip-blue    { background: rgba(96, 165, 250, 0.18);  color: #93C5FD; }
[data-theme="dark"] .chip-pink    { background: rgba(244, 114, 182, 0.18); color: #F9A8D4; }
[data-theme="dark"] .chip-amber   { background: rgba(251, 191, 36, 0.18);  color: #FCD34D; }
/* Chip bertoken di header gradasi/kartu putih tetap terbaca */
.card-header .chip-teal, .card-header .chip-violet { background: rgba(255,255,255,0.2); color: #fff; }
[data-theme="dark"] .stat-card .chip-sky, [data-theme="dark"] .stat-card .chip-teal, [data-theme="dark"] .stat-card .chip-emerald,
[data-theme="dark"] .stat-card .chip-violet, [data-theme="dark"] .stat-card .chip-indigo, [data-theme="dark"] .stat-card .chip-red,
[data-theme="dark"] .stat-card .chip-blue, [data-theme="dark"] .stat-card .chip-pink, [data-theme="dark"] .stat-card .chip-amber { filter: none; }

/* Kartu tabel HP (penyempurnaan): judul kartu, nomor disembunyikan, isi panjang bertumpuk */
@media (max-width: 640px) {
  .data-table.stack-mobile tr { background: var(--bg-surface, transparent); box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05); }
  .data-table.stack-mobile td { padding: 10px 14px !important; min-height: 40px; }
  .data-table.stack-mobile td[data-role="index"] { display: none !important; }
  .data-table.stack-mobile td[data-role="title"] {
    justify-content: flex-start;
    text-align: left;
    background: rgba(124, 58, 237, 0.07);
    border-bottom: 1px solid var(--border) !important;
    padding: 12px 14px !important;
  }
  .data-table.stack-mobile td[data-role="title"]::before { display: none; }
  .data-table.stack-mobile td[data-role="title"] > * { text-align: left; }
  .data-table.stack-mobile td[data-wide] { flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; }
  .data-table.stack-mobile td[data-wide]::before { flex: none; max-width: none; }
  .data-table.stack-mobile td[data-wide] > * { text-align: left; }
  .data-table.stack-mobile td[data-label]::before { flex: 0 0 30%; max-width: 30%; }
}
[data-theme="dark"] .data-table.stack-mobile td[data-role="title"] { background: rgba(167, 139, 250, 0.1); }

/* ==========================================================================
   PADATKAN BANNER & HEADER (isi halaman lebih cepat terlihat)
   ========================================================================== */
.hero-banner { padding: 22px 28px; margin-bottom: 20px; }
.hero-text h3 { font-size: 1.4rem; }
.quran-header-bar { padding: 14px 22px; margin-bottom: 18px; }

@media (max-width: 768px) {
  .hero-banner { padding: 14px 16px !important; margin-bottom: 14px; gap: 12px !important; }
  .hero-banner::after { display: none; }
  .hero-text h3 { font-size: 1.1rem; margin-bottom: 4px; }
  .hero-text p { font-size: 0.8rem; line-height: 1.4; }
  .hero-date-badge { padding: 4px 10px; font-size: 0.75rem; margin-bottom: 8px; }
  .quran-header-bar { padding: 12px 14px !important; margin-bottom: 14px; gap: 10px; }
  .quran-header-bar h2, .quran-header-bar h3 { font-size: 1.05rem !important; margin-bottom: 2px; }
  .quran-header-bar p { font-size: 0.78rem; line-height: 1.4; }

  /* Header HP: judul ringkas "Tahfidz", tanpa subjudul & tulisan "Collab By" */
  .title-prefix, .page-title p, .header-collab-text { display: none !important; }
  .page-title h2 { font-size: 1.15rem !important; }
  .header-collab-group { padding-top: 6px !important; gap: 0 !important; }
  .header-partner-banner-logo { padding: 3px 12px !important; }
  .header-partner-banner-logo .partner-logo-img { height: 24px !important; }
}
#rumahQuranSummaryCards:not([hidden]) { display: grid; }

/* Elemen khusus guru/admin yang dirender belakangan tetap tersembunyi untuk peran lain */
body[data-role="murid"] .guru-only, body[data-role="kamar"] .guru-only,
body[data-role="pengawas"] .guru-only, body[data-role="pendamping"] .guru-only { display: none !important; }

/* Menu bawah HP: 6 tombol muat satu baris */
.mobile-nav-btn { flex: 1 1 0; min-width: 0; padding: 6px 2px; font-size: 0.7rem; white-space: nowrap; }

/* Baris chip di banner boleh turun baris di layar sempit */
div:has(> .badge[style*="255, 255, 255"]) { flex-wrap: wrap; }

/* Navigasi halaman mushaf di HP: dua baris agar teks tidak bertabrakan */
@media (max-width: 640px) {
  .mushaf-page-turner { flex-wrap: wrap; gap: 8px; }
  .mushaf-page-turner .page-input-wrapper {
    order: -1; flex: 1 1 100%; justify-content: center; flex-wrap: nowrap; white-space: nowrap;
  }
  .mushaf-page-turner .page-flip-btn {
    flex: 1 1 calc(50% - 4px); justify-content: center; white-space: nowrap; padding: 10px 12px; min-height: 44px;
  }
}

/* Deretan tombol aksi: boleh turun baris di HP agar tidak menabrak tepi kanan */
@media (max-width: 640px) {
  div:has(> .btn.btn-sm), div:has(> .btn.btn-sm) + div:has(> .btn.btn-sm),
  .santri-card-action-bar { flex-wrap: wrap !important; row-gap: 6px; }
  div:has(> .btn.btn-sm) > .btn { max-width: 100%; }
  /* Tombol aksi di kartu tabel: label dihilangkan, tombol memakai lebar penuh */
  td[data-label]:has(> div > .btn.btn-sm)::before { display: none !important; }
  td[data-label]:has(> div > .btn.btn-sm) { display: block !important; }
  /* Tombol aksi di kartu tabel: satu baris, lebar sama rata */
  td > div:has(> .btn.btn-sm):not(:has(> .btn:nth-child(5))) {
    display: grid !important; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
    gap: 6px !important; width: 100%; flex-wrap: nowrap !important;
  }
  td > div:has(> .btn.btn-sm):not(:has(> .btn:nth-child(5))) > .btn {
    min-width: 0; width: 100%; justify-content: center; white-space: nowrap;
    padding: 9px 4px; font-size: .78rem; gap: 4px; min-height: 40px;
  }
}
