/**
 * Live Simak Tahfidz - Core Design System & Styling
 * Shafwah Design Standard: Professional, Serene, Academic SaaS
 */

@import url('https://fonts.googleapis.com/css2?family=Spectral:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400;1,600&family=Amiri:ital,wght@0,400;0,700;1,400&family=Scheherazade+New:wght@400;700&display=swap');

@font-face {
  font-family: 'UthmanicHafs';
  src: url('../fonts/UthmanicHafs1Ver18.woff2') format('woff2'),
       url('../fonts/UthmanicHafs1Ver18.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'surahnames';
  src: url('../fonts/sura_names.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --lt-font-sans: 'Spectral', Georgia, Cambria, 'Times New Roman', Times, serif;
  --lt-font-main: 'Spectral', Georgia, Cambria, 'Times New Roman', Times, serif;
  --lt-font-quran: 'UthmanicHafs', 'KFGQPC HAFS Uthmanic Script', 'Amiri', 'Scheherazade New', 'Traditional Arabic', serif;

  /* Color Palette */
  --lt-ayah-medallion-fill: #b48325;       /* Quranic Classic Gold */
  --lt-ayah-medallion-border: #8c6214;     /* Antique Deep Gold Border */
  --lt-ayah-medallion-inner-ring: #fef08a; /* Bright Gold Accent Ring */
  --lt-ayah-medallion-num-color: #ffffff;  /* Angka Wajib Putih Bersih */

  --lt-slate-50: #f8fafc;
  --lt-slate-100: #f1f5f9;
  --lt-slate-200: #e2e8f0;
  --lt-slate-300: #cbd5e1;
  --lt-slate-400: #94a3b8;
  --lt-slate-500: #64748b;
  --lt-slate-600: #475569;
  --lt-slate-700: #334155;
  --lt-slate-800: #1e293b;
  --lt-slate-900: #0f172a;

  --lt-emerald-50: #ecfdf5;
  --lt-emerald-100: #d1fae5;
  --lt-emerald-600: #059669;
  --lt-emerald-700: #047857;
  --lt-emerald-800: #065f46;
  --lt-emerald-900: #064e3b;

  /* Errors Palette (Subtle & Elegant) */
  --lt-jaly-bg: #fff1f2;
  --lt-jaly-border: #fecdd3;
  --lt-jaly-text: #9f1239;
  --lt-jaly-indicator: #e11d48;

  --lt-khofiy-bg: #fffbeb;
  --lt-khofiy-border: #fde68a;
  --lt-khofiy-text: #92400e;
  --lt-khofiy-indicator: #d97706;

  --lt-radius-sm: 6px;
  --lt-radius-md: 10px;
  --lt-radius-lg: 16px;
  --lt-radius-xl: 24px;
}

/* ==========================================================================
   ISOLATION & HARDENED TYPOGRAPHY (SPECTRAL MANDATORY RESET)
   Prevents any WordPress theme from overriding font-family, sizes, or line-heights.
   ========================================================================== */

html body .lt-app-wrapper,
html body .lt-app-wrapper *,
html body .lt-certificate-wrap,
html body .lt-certificate-wrap *,
html body .lt-modal,
html body .lt-modal *,
html body .lt-toast,
html body #lt-toast {
  font-family: 'Spectral', Georgia, Cambria, 'Times New Roman', serif !important;
  box-sizing: border-box !important;
}

/* Strictly Preserve Authentic Arabic Quran Fonts */
html body .lt-app-wrapper .lt-mushaf-flow,
html body .lt-app-wrapper .lt-mushaf-flow *,
html body .lt-app-wrapper .lt-word,
html body .lt-app-wrapper .lt-ayah-stop,
html body .lt-app-wrapper .lt-surah-arabic-title,
html body .lt-app-wrapper .lt-bismillah-text,
html body .lt-certificate-wrap .lt-cert-word-ar,
html body .lt-certificate-wrap .lt-cert-arabic,
html body .lt-modal #lt-mark-arabic,
html body [dir="rtl"],
html body .lt-font-arabic {
  font-family: 'Amiri', 'Scheherazade New', 'Traditional Arabic', serif !important;
}

/* Complete Heading Reset: Detach from WP Theme H1-H6 Default Dimensions */
html body .lt-app-wrapper h1,
html body .lt-app-wrapper h2,
html body .lt-app-wrapper h3,
html body .lt-app-wrapper h4,
html body .lt-app-wrapper h5,
html body .lt-app-wrapper h6,
html body .lt-certificate-wrap h1,
html body .lt-certificate-wrap h2,
html body .lt-certificate-wrap h3,
html body .lt-certificate-wrap h4,
html body .lt-certificate-wrap h5,
html body .lt-certificate-wrap h6,
html body .lt-modal h1,
html body .lt-modal h2,
html body .lt-modal h3,
html body .lt-modal h4,
html body .lt-modal h5,
html body .lt-modal h6 {
  font-family: 'Spectral', Georgia, Cambria, 'Times New Roman', serif !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.25 !important;
  letter-spacing: normal !important;
  text-transform: none !important;
}

/* Proportional Typography Scale with !important */
html body .lt-app-wrapper h1,
html body .lt-certificate-wrap h1,
html body .lt-modal h1,
.lt-title-xl {
  font-size: 1.35rem !important;
  font-weight: 800 !important;
  line-height: 1.25 !important;
}

html body .lt-app-wrapper h2,
html body .lt-certificate-wrap h2,
html body .lt-modal h2,
.lt-title-lg {
  font-size: 1.15rem !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
}

html body .lt-app-wrapper h3,
html body .lt-certificate-wrap h3,
html body .lt-modal h3,
.lt-title-md {
  font-size: 0.975rem !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
}

html body .lt-app-wrapper h4,
html body .lt-certificate-wrap h4,
html body .lt-modal h4,
.lt-title-sm {
  font-size: 0.875rem !important;
  font-weight: 700 !important;
  line-height: 1.4 !important;
}

html body .lt-app-wrapper p,
html body .lt-certificate-wrap p,
html body .lt-modal p {
  margin: 0 !important;
  line-height: 1.5 !important;
}

/* Container & Base */
.lt-app-wrapper {
  color: var(--lt-slate-800);
  background-color: var(--lt-slate-50);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding: 1.5rem;
  box-sizing: border-box;
}

.lt-app-wrapper * {
  box-sizing: border-box;
}

/* Top App Header */
.lt-header {
  background-color: #ffffff;
  border: 1px solid var(--lt-slate-200);
  border-radius: var(--lt-radius-lg);
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.lt-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.lt-brand-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--lt-radius-md);
  background: linear-gradient(135deg, var(--lt-emerald-800), var(--lt-emerald-900));
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lt-brand-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--lt-slate-900);
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.2;
}

.lt-brand-subtitle {
  font-size: 0.75rem;
  color: var(--lt-slate-500);
  margin: 0.15rem 0 0;
}

/* Mode Switcher Nav Tabs */
.lt-nav-tabs {
  display: inline-flex;
  background-color: var(--lt-slate-100);
  padding: 4px;
  border-radius: var(--lt-radius-md);
  border: 1px solid var(--lt-slate-200);
  gap: 4px;
}

.lt-nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--lt-slate-600);
  background: transparent;
  border: none;
  border-radius: var(--lt-radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.lt-nav-tab:hover {
  color: var(--lt-slate-900);
}

.lt-nav-tab.active {
  background-color: #ffffff;
  color: var(--lt-emerald-800);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* Stat & Score Cards */
.lt-card {
  background: #ffffff;
  border: 1px solid var(--lt-slate-200);
  border-radius: var(--lt-radius-lg);
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.lt-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.lt-metric-card {
  background: #ffffff;
  border: 1px solid var(--lt-slate-200);
  border-radius: var(--lt-radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lt-metric-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--lt-slate-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.lt-metric-val {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--lt-slate-900);
}

.lt-metric-sub {
  font-size: 0.75rem;
  color: var(--lt-slate-400);
  margin-top: 2px;
}

/* Specific Pill Badges */
.lt-badge-jaly {
  background-color: var(--lt-jaly-bg);
  border: 1px solid var(--lt-jaly-border);
  color: var(--lt-jaly-text);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.lt-badge-khofiy {
  background-color: var(--lt-khofiy-bg);
  border: 1px solid var(--lt-khofiy-border);
  color: var(--lt-khofiy-text);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Buttons */
.lt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--lt-radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.lt-btn-primary {
  background-color: var(--lt-emerald-700);
  color: #ffffff;
}

.lt-btn-primary:hover {
  background-color: var(--lt-emerald-800);
}

.lt-btn-secondary {
  background-color: #ffffff;
  border-color: var(--lt-slate-300);
  color: var(--lt-slate-700);
}

.lt-btn-secondary:hover {
  background-color: var(--lt-slate-50);
  border-color: var(--lt-slate-400);
}

.lt-btn-wa {
  background-color: #25D366;
  color: #ffffff;
  font-weight: 700;
}

.lt-btn-wa:hover {
  background-color: #20bd5a;
}

/* Modals */
.lt-modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.lt-modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.lt-modal-card {
  background: #ffffff;
  border-radius: var(--lt-radius-lg);
  max-width: 520px;
  width: 100%;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  border: 1px solid var(--lt-slate-200);
  transform: translateY(8px) scale(0.98);
  transition: transform 0.2s ease;
}

.lt-modal-backdrop.open .lt-modal-card {
  transform: translateY(0) scale(1);
}

.lt-modal-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--lt-slate-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lt-modal-body {
  padding: 1.25rem;
}

/* Toast */
.lt-toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background-color: var(--lt-slate-900);
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--lt-radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
  z-index: 100000;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.lt-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Searchable Combobox Component */
.lt-combobox {
  position: relative;
  display: inline-block;
}

.lt-combobox-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #ffffff;
  border: 1.5px solid var(--lt-slate-300);
  border-radius: var(--lt-radius-sm);
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--lt-slate-800);
  cursor: pointer;
  min-width: 260px;
  max-width: 320px;
  text-align: left;
  transition: all 0.15s ease;
  user-select: none;
}

.lt-combobox-trigger:hover,
.lt-combobox-trigger:focus {
  border-color: var(--lt-emerald-600);
  outline: none;
}

.lt-combobox-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 300px;
  max-width: 360px;
  width: 100%;
  background: #ffffff;
  border: 1.5px solid var(--lt-slate-200);
  border-radius: var(--lt-radius-md);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
  z-index: 1000;
  overflow: hidden;
}

.lt-combobox-search-wrap {
  padding: 8px;
  background: #f8fafc;
  border-bottom: 1px solid var(--lt-slate-200);
}

.lt-combobox-search-input {
  width: 100%;
  padding: 7px 10px;
  font-size: 0.825rem;
  border: 1px solid var(--lt-slate-300);
  border-radius: var(--lt-radius-sm);
  background: #ffffff;
  color: var(--lt-slate-800);
  outline: none;
}

.lt-combobox-search-input:focus {
  border-color: var(--lt-emerald-600);
  box-shadow: 0 0 0 2px var(--lt-emerald-100);
}

.lt-combobox-list {
  max-height: 260px;
  overflow-y: auto;
  padding: 4px 0;
}

.lt-combobox-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  font-size: 0.825rem;
  color: var(--lt-slate-700);
  cursor: pointer;
  transition: background-color 0.1s ease;
}

.lt-combobox-item:hover {
  background-color: var(--lt-slate-100);
  color: var(--lt-slate-900);
}

.lt-combobox-item.is-selected {
  background-color: var(--lt-emerald-50);
  color: var(--lt-emerald-900);
  font-weight: 700;
}

/* Mode Switcher Tabs */
.lt-mode-tabs {
  display: inline-flex;
  align-items: center;
  background: var(--lt-slate-100);
  border: 1px solid var(--lt-slate-200);
  border-radius: var(--lt-radius-md);
  padding: 3px;
  gap: 3px;
}

.lt-mode-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: calc(var(--lt-radius-md) - 2px);
  border: none;
  background: transparent;
  color: var(--lt-slate-600);
  cursor: pointer;
  transition: all 0.15s ease;
}

.lt-mode-tab:hover {
  color: var(--lt-slate-900);
}

.lt-mode-tab.is-active {
  background: #047857;
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 1px 3px rgba(4, 120, 87, 0.3);
}

/* Page Navigation Bar */
.lt-page-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 1.5px solid var(--lt-emerald-200);
  border-radius: var(--lt-radius-md);
  padding: 8px 14px;
  margin-bottom: 0.75rem;
  box-shadow: 0 1px 3px rgba(4, 120, 87, 0.05);
}

.lt-page-indicator-badge {
  text-align: center;
}

.lt-page-indicator-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--lt-emerald-900);
}

.lt-page-indicator-subtitle {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--lt-emerald-700);
}

/* Verse Jump Box */
.lt-verse-jump-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--lt-slate-50);
  border: 1px solid var(--lt-slate-200);
  border-radius: var(--lt-radius-sm);
  padding: 4px 8px;
}

.lt-verse-input {
  width: 56px;
  padding: 4px 6px;
  font-size: 0.825rem;
  font-weight: 700;
  text-align: center;
  border: 1px solid var(--lt-slate-300);
  border-radius: var(--lt-radius-sm);
  background: #ffffff;
  color: var(--lt-slate-800);
  outline: none;
}

.lt-verse-input:focus {
  border-color: var(--lt-emerald-600);
  box-shadow: 0 0 0 2px var(--lt-emerald-100);
}

/* Mushaf Page Footer */
.lt-mushaf-page-footer {
  text-align: center;
  padding: 1rem 0 0.5rem;
  border-top: 1px dashed var(--lt-slate-200);
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lt-mushaf-page-number {
  font-family: var(--lt-font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--lt-slate-500);
  letter-spacing: 0.05em;
}

/* ==========================================================================
   HIGH-RESPONSIVENESS & MOBILE-FIRST SYSTEM (TABLET & SMARTPHONE)
   ========================================================================== */

/* Universal Safe Padding for Mobile Bottom Navbars */
@media (max-width: 991px) {
  .lt-app-wrapper {
    padding: 0.65rem 0.65rem 100px 0.65rem !important; /* Prevents overlap with mobile fixed navbars */
  }
}

/* Exam Layout Grid (Desktop: 2-Col 8:4, Mobile: 1-Col 100%) */
.lt-exam-layout {
  display: grid;
  grid-template-columns: 8fr 4fr;
  gap: 1.25rem;
  align-items: start;
}

.lt-mushaf-col,
.lt-sidebar-col {
  min-width: 0;
  width: 100%;
}

@media (max-width: 1024px) {
  .lt-exam-layout {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
  }
  .lt-mushaf-col,
  .lt-sidebar-col {
    width: 100% !important;
  }
}

/* Santri Admin Grid Layout */
.lt-santri-layout {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1.5rem;
}

@media (max-width: 991px) {
  .lt-santri-layout {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
  }
}

/* Scoreboard Card Styles */
.lt-scoreboard-card {
  margin-bottom: 0.85rem;
  padding: 1rem 1.25rem;
  background: #ffffff;
  border: 1px solid var(--lt-slate-200);
  border-radius: var(--lt-radius-lg);
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.lt-scoreboard-flex {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.lt-santri-timer-section {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.lt-santri-selector-wrap {
  display: flex;
  flex-direction: column;
}

.lt-label-tiny {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--lt-slate-400);
  letter-spacing: 0.04em;
  display: block;
  margin-bottom: 4px;
}

.lt-santri-inputs {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lt-santri-search-wrap {
  position: relative;
  width: 130px;
}

.lt-search-icon {
  width: 13px;
  height: 13px;
  color: var(--lt-slate-400);
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
}

.lt-search-input {
  width: 100%;
  font-size: 0.825rem;
  font-weight: 600;
  padding: 6px 8px 6px 26px;
  border-radius: var(--lt-radius-sm);
  border: 1.5px solid var(--lt-slate-300);
  background: #ffffff;
  color: var(--lt-slate-800);
  outline: none;
}

.lt-santri-dropdown {
  font-size: 0.85rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--lt-radius-sm);
  border: 1.5px solid var(--lt-slate-300);
  background: #ffffff;
  color: var(--lt-slate-800);
  min-width: 210px;
  max-width: 280px;
  cursor: pointer;
}

.lt-metrics-action-section {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.lt-hud-metric-pill {
  border-radius: var(--lt-radius-md);
  padding: 5px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.lt-pill-jaly {
  background: var(--lt-jaly-bg);
  border: 1.5px solid var(--lt-jaly-border);
}

.lt-pill-khofiy {
  background: var(--lt-khofiy-bg);
  border: 1.5px solid var(--lt-khofiy-border);
}

.lt-pill-score {
  background: #ecfdf5;
  border: 1.5px solid #a7f3d0;
  padding: 5px 14px;
}

.lt-metric-num {
  font-size: 1.5rem;
  font-weight: 900;
  line-height: 1;
}

.lt-pill-jaly .lt-metric-num {
  color: var(--lt-jaly-text);
}

.lt-pill-khofiy .lt-metric-num {
  color: var(--lt-khofiy-text);
}

.lt-pill-score .lt-metric-num {
  color: #065f46;
}

.lt-metric-texts {
  line-height: 1.15;
}

.lt-metric-title {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  display: block;
}

.lt-pill-jaly .lt-metric-title {
  color: var(--lt-jaly-text);
}

.lt-pill-khofiy .lt-metric-title {
  color: var(--lt-khofiy-text);
}

.lt-pill-score .lt-metric-title {
  color: #047857;
}

.lt-metric-sub {
  font-size: 0.6rem;
  color: var(--lt-slate-400);
}

.lt-pill-score .lt-metric-sub {
  color: #059669;
  font-weight: 700;
}

.lt-btn-finish-exam {
  background: #047857;
  color: #ffffff;
  padding: 9px 18px;
  border-radius: var(--lt-radius-md);
  font-weight: 800;
  font-size: 0.85rem;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  box-shadow: 0 2px 6px rgba(4,120,87,0.25);
  transition: background-color 0.15s ease;
}

.lt-btn-finish-exam:hover {
  background: #065f46;
}

/* Scoreboard Mobile Layout (< 992px) */
@media (max-width: 991px) {
  .lt-scoreboard-flex {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
  }
  .lt-santri-timer-section {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.6rem !important;
  }
  .lt-santri-inputs {
    flex-direction: column !important;
    width: 100% !important;
    gap: 6px !important;
  }
  .lt-santri-search-wrap {
    width: 100% !important;
  }
  .lt-santri-dropdown {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
  .lt-metrics-action-section {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important;
    width: 100% !important;
  }
  .lt-hud-metric-pill {
    padding: 6px 4px !important;
    flex-direction: column !important;
    text-align: center !important;
    gap: 2px !important;
    justify-content: center !important;
  }
  .lt-metric-num {
    font-size: 1.25rem !important;
  }
  .lt-metric-title {
    font-size: 0.58rem !important;
  }
  .lt-metric-sub {
    font-size: 0.52rem !important;
  }
  .lt-btn-finish-exam {
    grid-column: span 3 !important;
    width: 100% !important;
    padding: 11px 16px !important;
    font-size: 0.9rem !important;
    justify-content: center !important;
  }
}

/* Mode Bar & Filter Bar Styles */
.lt-mode-scope-bar,
.lt-filter-controls-bar {
  background: #ffffff;
  border: 1px solid var(--lt-slate-200);
  border-radius: var(--lt-radius-lg);
  padding: 8px 16px;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.lt-session-scope-badge {
  color: var(--lt-emerald-800);
  font-weight: 800;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.lt-juz-filter-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lt-filter-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--lt-slate-400);
  text-transform: uppercase;
}

.lt-juz-select {
  font-size: 0.825rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--lt-radius-md);
  border: 1.5px solid var(--lt-slate-200);
  background: #ffffff;
  color: var(--lt-slate-800);
  cursor: pointer;
}

.lt-surah-controls-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  max-width: 420px;
  justify-content: center;
}

.lt-btn-nav-surah {
  padding: 6px 9px;
  font-size: 0.8rem;
}

.lt-juz-controls-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 991px) {
  .lt-mode-scope-bar,
  .lt-filter-controls-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    padding: 8px 10px !important;
  }
  .lt-mode-tabs {
    display: flex !important;
    width: 100% !important;
  }
  .lt-mode-tab {
    flex: 1 !important;
    justify-content: center !important;
    padding: 7px 6px !important;
    font-size: 0.72rem !important;
    text-align: center !important;
  }
  .lt-session-scope-badge {
    justify-content: center !important;
    text-align: center !important;
    width: 100% !important;
  }
  .lt-juz-filter-wrap {
    width: 100% !important;
    justify-content: space-between !important;
  }
  .lt-juz-select {
    flex: 1 !important;
  }
  .lt-surah-controls-wrap {
    max-width: 100% !important;
    width: 100% !important;
  }
  .lt-verse-jump-wrap {
    justify-content: center !important;
    width: 100% !important;
    padding: 6px !important;
  }
  .lt-juz-controls-wrap {
    flex-direction: column !important;
    width: 100% !important;
  }
}

/* Mushaf Touch & Mobile Font Experience */
@media (max-width: 768px) {
  .lt-mushaf-card {
    padding: 1.15rem 0.75rem !important;
  }
  .lt-surah-frame {
    padding: 0.75rem 0.85rem !important;
    margin-bottom: 1.25rem !important;
  }
  .lt-surah-arabic-title {
    font-size: 1.75rem !important;
  }
  .lt-bismillah-wrap {
    margin: 1rem 0 1.25rem !important;
  }
  .lt-bismillah-text {
    font-size: 1.45rem !important;
  }
  .lt-mushaf-flow {
    font-size: 1.65rem !important;
    line-height: 2.65 !important;
    word-spacing: 0.15rem !important;
    text-align: right !important;
  }
  .lt-word {
    padding: 0 0.15rem !important;
    margin: 0 1px !important;
  }
  .lt-ayah-stop {
    min-width: 28px !important;
    height: 28px !important;
    font-size: 1.05rem !important;
    margin: 0 0.25rem !important;
  }
  .lt-mushaf-page-footer {
    flex-wrap: wrap !important;
    gap: 6px !important;
    justify-content: center !important;
  }
  .lt-mushaf-page-footer button {
    padding: 6px 12px !important;
    font-size: 0.72rem !important;
  }
  #lt-mushaf-page-footer-num {
    padding: 6px 14px !important;
    font-size: 0.75rem !important;
  }
}

/* Rekapitulasi Table & Card System */
.lt-table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.lt-table-toolbar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.lt-rekap-view-toggle {
  display: inline-flex;
  background: var(--lt-slate-100);
  border: 1px solid var(--lt-slate-200);
  border-radius: var(--lt-radius-sm);
  padding: 2px;
  gap: 2px;
}

.lt-rekap-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  background: transparent;
  border: none;
  border-radius: calc(var(--lt-radius-sm) - 2px);
  color: var(--lt-slate-600);
  cursor: pointer;
  transition: all 0.15s ease;
}

.lt-rekap-toggle-btn.active {
  background: #ffffff;
  color: var(--lt-emerald-800);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.lt-admin-search-input {
  font-size: 0.85rem;
  padding: 6px 12px;
  border-radius: var(--lt-radius-sm);
  border: 1px solid var(--lt-slate-300);
  width: 250px;
  box-sizing: border-box;
}

.lt-table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.lt-sessions-table {
  width: 100% !important;
  min-width: 920px !important; /* STRICT: Never compress columns into ribbons */
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.lt-sessions-table th {
  background: var(--lt-slate-100);
  border-bottom: 2px solid var(--lt-slate-200);
  color: var(--lt-slate-600);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  padding: 10px 14px;
  white-space: nowrap;
}

.lt-sessions-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--lt-slate-100);
  vertical-align: middle;
}

.lt-sessions-table td.col-surah {
  min-width: 220px !important;
  white-space: normal !important;
  line-height: 1.4 !important;
}

.lt-sessions-table td.col-notes {
  min-width: 220px !important;
  max-width: 320px !important;
  white-space: normal !important;
  line-height: 1.4 !important;
}

.lt-sessions-table td.col-santri {
  min-width: 160px !important;
  white-space: normal !important;
}

.lt-rekap-cards-list {
  display: none;
  flex-direction: column;
  gap: 0.75rem;
}

/* On mobile/tablet screens <= 900px */
@media (max-width: 900px) {
  .lt-table-toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .lt-table-toolbar-controls {
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
  }
  .lt-rekap-view-toggle {
    width: 100% !important;
    display: flex !important;
  }
  .lt-rekap-toggle-btn {
    flex: 1 !important;
    justify-content: center !important;
    padding: 7px !important;
  }
  .lt-search-box-wrap {
    width: 100% !important;
  }
  .lt-admin-search-input {
    width: 100% !important;
  }
  .lt-btn-export-excel {
    width: 100% !important;
    justify-content: center !important;
  }

  /* Default on mobile: Show cards, hide table */
  body:not(.lt-show-table-mode) .lt-rekap-cards-list {
    display: flex !important;
  }
  body:not(.lt-show-table-mode) .lt-table-responsive {
    display: none !important;
  }

  /* When table toggle is clicked on mobile */
  body.lt-show-table-mode .lt-rekap-cards-list {
    display: none !important;
  }
  body.lt-show-table-mode .lt-table-responsive {
    display: block !important;
  }

  /* KPI Stat Grid on Mobile: 2x2 */
  .lt-stat-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }
  .lt-metric-card {
    padding: 10px 12px !important;
  }
  .lt-metric-val {
    font-size: 1.35rem !important;
  }
}

/* Modals Safe Mobile Touch */
@media (max-width: 640px) {
  .lt-modal-card {
    max-width: calc(100vw - 20px) !important;
    max-height: calc(100vh - 100px) !important;
    margin: 10px auto 90px auto !important; /* safe from bottom nav */
  }
  .lt-modal-header {
    padding: 0.85rem 1rem !important;
  }
  .lt-modal-body {
    padding: 1rem !important;
  }
}


