* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: #ffffff;
  color: #333;
  padding-bottom: 80px;
}

/* Header - CSS ONLY FIX */
.header {
  background: #ffffff;
  padding: 20px;
  border-bottom: 2px solid #f0f0f0;
  position: sticky;
  top: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 15px;
  align-items: center;
}

.header h1 {
  font-size: 2em;
  color: #1a1a1a;
  margin: 0;
  grid-column: 1;
  grid-row: 1;
}

.theme-toggle {
  background: #f0f0f0;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-size: 1.2em;
  color: #666;
  grid-column: 2;
  grid-row: 1;
}

.theme-toggle:hover {
  background: #e0e0e0;
  transform: scale(1.1);
}

.theme-toggle i {
  transition: transform 0.3s ease;
}

.theme-toggle:hover i {
  transform: rotate(20deg);
}

.greeting {
  font-size: 1em;
  color: #666;
  padding: 12px 0 0 0;
  border-top: 1px solid #f0f0f0;
  margin: 0;
  grid-column: 1 / -1;
  grid-row: 2;
}

.greeting .name {
  font-weight: 600;
  color: #2563eb;
}

/* Mobile */
@media (max-width: 767px) {
  .header {
    padding: 15px;
  }

  .header h1 {
    font-size: 1.5em;
  }

  .theme-toggle {
    width: 36px;
    height: 36px;
    font-size: 1em;
  }

  .greeting {
    font-size: 0.9em;
  }
}
/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0px;
}

/* Page sections */
.page {
  display: none;
}

.page.active {
  display: block;
}
/* Page Swipe Transitions */
.page {
  display: none;
  padding: 20px 20px 100px 20px;
  transition:
    transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.35s ease;
  /* cubic-bezier untuk smooth tapi cepet */
}

.page.active {
  display: block;
}

.page.swipe-left {
  animation: swipeOutLeft 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.page.swipe-right {
  animation: swipeOutRight 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.page.swipe-in-left {
  animation: swipeInLeft 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.page.swipe-in-right {
  animation: swipeInRight 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes swipeOutLeft {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(-100%);
    opacity: 0;
  }
}

@keyframes swipeOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

@keyframes swipeInLeft {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes swipeInRight {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Swipe Overlay (optional visual feedback) */
.swipe-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 99;
}

.swipe-overlay.active {
  background: rgba(0, 0, 0, 0.05);
}
/* Streak Counter */
.streak-container {
  margin: 25px 0;
}

.streak-card {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  padding: 20px 25px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
  position: relative;
  overflow: hidden;
}

.streak-card::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -10%;
  width: 200px;
  height: 200px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}

.streak-icon {
  font-size: 3em;
  color: white;
  animation: fireFlicker 1.5s ease-in-out infinite;
}

@keyframes fireFlicker {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.9;
  }
}

.streak-content {
  flex: 1;
}

.streak-number {
  font-size: 2.5em;
  font-weight: 800;
  color: white;
  line-height: 1;
  margin-bottom: 5px;
}

.streak-label {
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.95em;
  font-weight: 500;
}

.streak-badge {
  background: rgba(255, 255, 255, 0.2);
  padding: 8px 15px;
  border-radius: 20px;
  color: white;
  font-weight: 600;
  font-size: 0.85em;
  backdrop-filter: blur(10px);
}

.streak-badge.hidden {
  display: none;
}

@media (max-width: 600px) {
  .streak-card {
    padding: 15px 20px;
  }

  .streak-icon {
    font-size: 2.5em;
  }

  .streak-number {
    font-size: 2em;
  }

  .streak-label {
    font-size: 0.85em;
  }
}
/* Statistics Section - Donut Charts */
.stats-section {
  margin: 10px 0;
}

.charts-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.chart-card {
  background: #ffffff;
  padding: 25px;
  border-radius: 15px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  text-align: center;
}

.chart-card h3 {
  color: #1a1a1a;
  margin-bottom: 20px;
  font-size: 1.1em;
}

.chart-wrapper {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 0 auto 10px;
}

.donut-chart {
  transform: rotate(-90deg);
}

.chart-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.chart-percentage {
  font-size: 1.8em;
  font-weight: bold;
  color: #1a1a1a;
}

.chart-label {
  font-size: 0.85em;
  color: #666;
}

.chart-legend {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9em;
}

.legend-color {
  width: 20px;
  height: 20px;
  border-radius: 4px;
}

/* Recent Activity Cards */
.recent-section {
  margin: 30px 0;
}

/* Simulation Section */
.simulation-section {
  margin: 30px 0;
}

.btn-simulation {
  width: 100%;
  padding: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-simulation:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-simulation i:first-child {
  font-size: 2em;
}

.btn-simulation > div {
  flex: 1;
  text-align: left;
}

.btn-simulation strong {
  display: block;
  font-size: 1.1em;
  margin-bottom: 5px;
}

.btn-simulation p {
  margin: 0;
  font-size: 0.9em;
  opacity: 0.9;
}

.btn-simulation i:last-child {
  font-size: 1.5em;
}
/* ── Juz Otomatis Field ─────────────────────────── */
.juz-field-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}
.juz-field-wrap input[readonly] {
  flex: 1;
  background: #f8f9fa;
  color: #94a3b8;
  cursor: not-allowed;
  border-color: #e2e8f0;
  font-style: italic;
}
.juz-auto-label {
  font-size: 0.72em;
  font-weight: 700;
  color: #16a34a;
  background: #dcfce7;
  border: 1px solid #bbf7d0;
  border-radius: 20px;
  padding: 2px 8px;
  margin-left: 6px;
  letter-spacing: 0.2px;
  vertical-align: middle;
}
.juz-auto-badge {
  display: none;
  font-size: 0.8em;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}
.juz-auto-badge.juz-single {
  display: inline-flex;
  background: #dbeafe;
  color: #1d4ed8;
  border: 1.5px solid #bfdbfe;
}
.juz-auto-badge.juz-cross {
  display: inline-flex;
  background: #fef3c7;
  color: #b45309;
  border: 1.5px solid #fde68a;
}
.juz-lock-hint {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.73em;
  color: #94a3b8;
  margin-top: 5px;
}
.juz-lock-hint i {
  color: #cbd5e1;
}

/* ── Info Halaman Terakhir (Self-reminder) ──────── */
.halaman-last-info {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: linear-gradient(135deg, #eff6ff, #f0f9ff);
  border: 1.5px solid #bfdbfe;
  border-radius: 10px;
  padding: 10px 13px;
  margin-top: 8px;
  font-size: 0.82em;
  color: #1e40af;
  line-height: 1.5;
}
.halaman-last-info i {
  color: #2563eb;
  margin-top: 2px;
  flex-shrink: 0;
}
.halaman-last-info strong {
  color: #1d4ed8;
}

/* Dark mode support */
body.dark-mode .juz-field-wrap input[readonly] {
  background: #1e293b;
  border-color: #334155;
  color: #475569;
}
body.dark-mode .halaman-last-info {
  background: linear-gradient(135deg, #1e3a5f, #1e2d45);
  border-color: #2563eb;
  color: #93c5fd;
}
body.dark-mode .halaman-last-info strong {
  color: #bfdbfe;
}
body.dark-mode .juz-lock-hint {
  color: #475569;
}

/* Progress Tracker Section */
.progress-tracker-section {
  margin: 20px 0 30px 0;
}

.btn-progress-tracker {
  width: 100%;
  padding: 20px;
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.btn-progress-tracker:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(5, 150, 105, 0.4);
}

.btn-progress-tracker i:first-child {
  font-size: 2em;
}

.btn-progress-tracker > div {
  flex: 1;
  text-align: left;
}

.btn-progress-tracker strong {
  display: block;
  font-size: 1.1em;
  margin-bottom: 5px;
}

.btn-progress-tracker p {
  margin: 0;
  font-size: 0.9em;
  opacity: 0.9;
}

.btn-progress-tracker i:last-child {
  font-size: 1.5em;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.section-header h2 {
  color: #1a1a1a;
  font-size: 1.5em;
}

.view-all-btn {
  background: none;
  border: none;
  color: #2563eb;
  font-size: 0.95em;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 5px;
}

.view-all-btn:hover {
  text-decoration: underline;
}

.activity-cards {
  display: grid;
  gap: 15px;
}

.activity-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border-left: 4px solid #2563eb;
  cursor: pointer;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.activity-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.activity-card.no-hover {
  cursor: default;
}

.activity-card.no-hover:hover {
  transform: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 12px;
}

.card-title {
  font-size: 1.2em;
  font-weight: 600;
  color: #1a1a1a;
}

.card-date {
  color: #888;
  font-size: 0.9em;
}

.card-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 10px;
}

.detail-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #555;
  font-size: 0.95em;
}

.detail-item i {
  color: #2563eb;
  width: 20px;
}

.card-notes {
  background: #f8f9fa;
  padding: 12px;
  border-radius: 8px;
  color: #666;
  font-style: italic;
  margin-top: 10px;
}

/* History Page */
.history-controls {
  background: #ffffff;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  margin-bottom: 20px;
}
/* Search & Filter Section */
.search-filter-section {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.search-box {
  flex: 1;
  min-width: 250px;
  position: relative;
  display: flex;
  align-items: center;
  background: #f8f9fa;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  padding: 0 15px;
  transition: all 0.3s;
}

.search-box:focus-within {
  border-color: #2563eb;
  background: white;
}

.search-box i.fa-search {
  color: #999;
  margin-right: 10px;
}

.search-box input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 12px 0;
  font-size: 0.95em;
  color: #333;
  outline: none;
}

.search-box input::placeholder {
  color: #999;
}

.clear-search {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.clear-search:hover {
  color: #dc2626;
}

.filter-buttons {
  display: flex;
  gap: 10px;
}

.filter-btn {
  padding: 12px 20px;
  border: 2px solid #e0e0e0;
  background: white;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.9em;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.filter-btn:hover {
  border-color: #2563eb;
  background: #f0f9ff;
}

.filter-btn.active {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
}

.filter-btn i:last-child {
  font-size: 0.8em;
  transition: transform 0.3s;
}

.filter-btn.dropdown-open i:last-child {
  transform: rotate(180deg);
}

.juz-filter-dropdown {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  margin-top: 10px;
}

.juz-filter-dropdown.active {
  max-height: 400px;
  overflow-y: auto;
}

.juz-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
  background: #f8f9fa;
  padding: 15px;
  border-radius: 10px;
}

.juz-filter-item {
  padding: 10px;
  border: 2px solid #e0e0e0;
  background: white;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9em;
  transition: all 0.2s;
  text-align: center;
}

.juz-filter-item:hover {
  border-color: #2563eb;
  background: #f0f9ff;
  transform: translateY(-2px);
}

.juz-filter-item.active {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
}

.search-result-count {
  margin: 15px 0;
  color: #666;
  font-size: 0.9em;
}

.no-results {
  text-align: center;
  padding: 40px 20px;
  color: #999;
}

.no-results i {
  font-size: 3em;
  margin-bottom: 15px;
  opacity: 0.3;
}

.no-results h4 {
  color: #666;
  margin-bottom: 8px;
}
/* Stats Page Tabs */
.stats-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  background: #f8f9fa;
  padding: 8px;
  border-radius: 12px;
}

.stats-tab-btn {
  flex: 1;
  padding: 12px 20px;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95em;
  font-weight: 600;
  color: #666;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.stats-tab-btn:hover {
  background: white;
}

.stats-tab-btn.active {
  background: white;
  color: #f59e0b;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stats-tab-content {
  display: none;
}

.stats-tab-content.active {
  display: block;
}

/* Calendar Styles */
.calendar-container {
  background: white;
  padding: 25px;
  border-radius: 15px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.calendar-header h3 {
  color: #1a1a1a;
  font-size: 1.3em;
}

.calendar-nav-btn {
  background: #f0f0f0;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  color: #666;
}

.calendar-nav-btn:hover {
  background: #e0e0e0;
  transform: scale(1.1);
}

.calendar-legend {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85em;
  color: #666;
}

.legend-box {
  width: 20px;
  height: 20px;
  border-radius: 4px;
}

.legend-box.success {
  background: #16a34a;
}

.legend-box.progress {
  background: #f59e0b;
}

.legend-box.missed {
  background: #dc2626;
}

.legend-box.future {
  background: #e5e7eb;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.calendar-day-header {
  text-align: center;
  font-weight: 600;
  color: #666;
  padding: 10px 5px;
  font-size: 0.85em;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  background: #f8f9fa;
  color: #999;
}

.calendar-day.success {
  background: #16a34a;
  color: white;
}

.calendar-day.progress {
  background: #f59e0b;
  color: white;
}

.calendar-day.missed {
  background: #dc2626;
  color: white;
}

.calendar-day.future {
  background: #e5e7eb;
  color: #cbd5e1;
}

.calendar-day.today {
  box-shadow: 0 0 0 3px #2563eb;
}

.calendar-day:not(.future):hover {
  transform: scale(1.1);
  z-index: 10;
}

/* Backup Section */
.backup-container {
  max-width: 600px;
  margin: 0 auto;
}

.backup-section {
  background: white;
  padding: 25px;
  border-radius: 15px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  margin-bottom: 20px;
}

.backup-section h3 {
  color: #1a1a1a;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.backup-section p {
  color: #666;
  margin-bottom: 20px;
  line-height: 1.6;
}

.backup-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.qr-code-container {
  margin-top: 20px;
  text-align: center;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 12px;
}

.qr-code-container canvas {
  max-width: 256px;
  width: 100%;
  height: auto;
  margin-bottom: 10px;
}

.qr-code-container p {
  color: #666;
  font-size: 0.9em;
}

.import-warning {
  background: #fef3c7;
  border: 2px solid #f59e0b;
  padding: 12px 15px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 15px;
  color: #92400e;
  font-size: 0.9em;
}

.import-warning i {
  color: #f59e0b;
  font-size: 1.2em;
}

.backup-info {
  background: #f0f9ff;
  padding: 20px;
  border-radius: 15px;
  border: 2px solid #3b82f6;
}

.backup-info h4 {
  color: #1e40af;
  margin-bottom: 15px;
}

.backup-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

.backup-stat-item {
  text-align: center;
  background: white;
  padding: 15px;
  border-radius: 10px;
}

.backup-stat-item i {
  font-size: 2em;
  color: #3b82f6;
  margin-bottom: 8px;
}

.backup-stat-item span {
  display: block;
  font-size: 1.5em;
  font-weight: 700;
  color: #1e40af;
  margin-bottom: 5px;
}

.backup-stat-item small {
  color: #64748b;
  font-size: 0.85em;
}

@media (max-width: 600px) {
  .calendar-day-header {
    font-size: 0.75em;
    padding: 8px 2px;
  }

  .calendar-grid {
    gap: 5px;
  }

  .backup-stats {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .search-filter-section {
    flex-direction: column;
  }

  .search-box {
    min-width: 100%;
  }

  .filter-buttons {
    width: 100%;
  }

  .filter-btn {
    flex: 1;
  }

  .juz-filter-grid {
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  }
}
/* Dark Mode - Stats Page */
body.dark-mode .stats-tabs {
  background: #0f172a;
}

body.dark-mode .stats-tab-btn {
  color: #94a3b8;
}

body.dark-mode .stats-tab-btn:hover {
  background: #1e293b;
}

body.dark-mode .stats-tab-btn.active {
  background: #1e293b;
  color: #fbbf24;
}

body.dark-mode .calendar-container {
  background: #1e293b;
}

body.dark-mode .calendar-header h3 {
  color: #f1f5f9;
}

body.dark-mode .calendar-nav-btn {
  background: #0f172a;
  color: #cbd5e1;
}

body.dark-mode .calendar-nav-btn:hover {
  background: #334155;
}

body.dark-mode .legend-item {
  color: #cbd5e1;
}

body.dark-mode .calendar-day {
  background: #0f172a;
  color: #64748b;
}

body.dark-mode .calendar-day-header {
  color: #94a3b8;
}

body.dark-mode .backup-section {
  background: #1e293b;
}

body.dark-mode .backup-section h3 {
  color: #f1f5f9;
}

body.dark-mode .backup-section p {
  color: #94a3b8;
}

body.dark-mode .qr-code-container {
  background: #0f172a;
}

body.dark-mode .import-warning {
  background: #78350f;
  border-color: #fbbf24;
  color: #fef3c7;
}

body.dark-mode .backup-info {
  background: #1e3a8a;
  border-color: #60a5fa;
}

body.dark-mode .backup-info h4 {
  color: #dbeafe;
}

body.dark-mode .backup-stat-item {
  background: #0f172a;
}

body.dark-mode .backup-stat-item span {
  color: #60a5fa;
}

body.dark-mode .backup-stat-item small {
  color: #94a3b8;
}

/* Dark Mode - Search & Filter */
body.dark-mode .search-box {
  background: #0f172a;
  border-color: #334155;
}

body.dark-mode .search-box:focus-within {
  border-color: #60a5fa;
  background: #1e293b;
}

body.dark-mode .search-box input {
  color: #e2e8f0;
}

body.dark-mode .filter-btn {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}

body.dark-mode .filter-btn:hover {
  border-color: #60a5fa;
  background: #1e3a8a;
}

body.dark-mode .filter-btn.active {
  background: #2563eb;
}

body.dark-mode .juz-filter-grid {
  background: #0f172a;
}

body.dark-mode .juz-filter-item {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}

body.dark-mode .juz-filter-item:hover {
  background: #1e3a8a;
  border-color: #60a5fa;
}

body.dark-mode .juz-filter-item.active {
  background: #2563eb;
}

body.dark-mode .search-result-count {
  color: #94a3b8;
}

body.dark-mode .no-results {
  color: #64748b;
}

body.dark-mode .no-results h4 {
  color: #94a3b8;
}
.view-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 10px 20px;
  border: 2px solid #e0e0e0;
  background: #ffffff;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95em;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tab-btn.active {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
}

.tab-btn i {
  font-size: 1.1em;
}

.chart-container {
  background: #ffffff;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  margin-top: 20px;
}

.bar-chart {
  margin-top: 20px;
}

.bar-item {
  margin-bottom: 15px;
}

.bar-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  font-size: 0.9em;
  color: #555;
}

.bar-bg {
  width: 100%;
  height: 30px;
  background: #f0f0f0;
  border-radius: 15px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 15px;
  transition: width 0.5s ease;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 10px;
  color: white;
  font-weight: 600;
  font-size: 0.85em;
}

/* Settings Page */
.settings-section {
  background: #ffffff;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  margin-bottom: 20px;
}

.settings-section h3 {
  color: #1a1a1a;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-section h3 i {
  color: #2563eb;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1em;
  transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #2563eb;
}

.target-options {
  display: grid;
  gap: 15px;
  margin-top: 15px;
}

/* Target Section - Redesigned */
.target-cards-container {
  display: grid;
  gap: 15px;
  margin-top: 15px;
}

.target-card {
  background: white;
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  border: 2px solid transparent;
  transition: all 0.3s;
}

.target-card.active {
  border-color: #2563eb;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.2);
}

.target-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
  cursor: pointer;
  user-select: none;
}

.target-card-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.target-icon {
  width: 45px;
  height: 45px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3em;
}

.target-icon.daily {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  color: #2563eb;
}

.target-icon.monthly {
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
  color: #16a34a;
}

.target-icon.juz {
  background: linear-gradient(135deg, #fed7aa 0%, #fdba74 100%);
  color: #ea580c;
}

.target-icon.surah {
  background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
  color: #7c3aed;
}

.target-text h4 {
  color: #1a1a1a;
  margin-bottom: 3px;
  font-size: 1.05em;
}

.target-text p {
  color: #666;
  font-size: 0.85em;
  margin: 0;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  width: 50px;
  height: 28px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #e5e7eb;
  border-radius: 28px;
  transition: 0.3s;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.3s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(22px);
}

.target-card-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.target-card.active .target-card-body {
  max-height: 200px;
}

.target-input-group {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 10px;
}

.target-input-group label {
  display: block;
  color: #666;
  font-size: 0.9em;
  margin-bottom: 8px;
  font-weight: 600;
}

.target-input-group input,
.target-input-group select {
  width: 100%;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1em;
  transition: all 0.3s;
}

.target-input-group input:focus,
.target-input-group select:focus {
  border-color: #2563eb;
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.target-surah-inputs {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 10px;
}

@media (max-width: 600px) {
  .target-surah-inputs {
    grid-template-columns: 1fr;
  }
}
/* Reminder Section */
.reminder-card {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 2px solid #3b82f6;
  border-radius: 15px;
  padding: 25px;
  text-align: center;
  margin-bottom: 20px;
}

.reminder-status {
  margin-bottom: 15px;
}

.reminder-status i {
  font-size: 3em;
  color: #3b82f6;
  margin-bottom: 10px;
}

.reminder-status p {
  color: #1e40af;
  font-weight: 600;
  margin: 0;
}

.reminder-status.active i {
  color: #16a34a;
}

.reminder-status.active {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-color: #16a34a;
}

.reminder-settings {
  margin-top: 20px;
}

.reminder-option {
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  transition: all 0.3s;
}

.reminder-option:hover {
  border-color: #3b82f6;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.reminder-info {
  display: flex;
  align-items: center;
  gap: 15px;
  flex: 1;
}

.reminder-info i {
  font-size: 1.5em;
  color: #3b82f6;
  width: 35px;
  text-align: center;
}

.reminder-info h4 {
  color: #1a1a1a;
  margin: 0 0 3px 0;
  font-size: 1em;
}

.reminder-info p {
  color: #666;
  margin: 0;
  font-size: 0.85em;
}

.reminder-time-picker {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 10px;
  margin: 10px 0 20px 0;
}

.reminder-time-picker label {
  display: block;
  color: #666;
  font-size: 0.9em;
  margin-bottom: 8px;
  font-weight: 600;
}

.reminder-time-picker input[type="time"] {
  width: 100%;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1.1em;
  transition: all 0.3s;
}

.reminder-time-picker input[type="time"]:focus {
  border-color: #3b82f6;
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
/* About Dropdown Menu - FIXED VERSION */
.about-dropdown {
  position: fixed;
  bottom: 80px;
  right: 20px;
  background: white;
  border-radius: 15px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  padding: 10px;
  min-width: 220px;
  opacity: 0;
  transform: translateY(20px) scale(0.9);
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 999;
}

.about-dropdown.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.about-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  color: #1a1a1a;
}

.about-dropdown-item:hover {
  background: #f0f9ff;
  color: #2563eb;
}

.about-dropdown-item i {
  font-size: 1.2em;
  width: 25px;
  text-align: center;
  color: #16a34a; /* Semua icon jadi hijau */
}

.about-dropdown-item:hover i {
  color: #2563eb; /* Saat hover jadi biru */
}

/* Item pertama (Perpustakaan) - special style */
.about-dropdown-item:first-child {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 2px solid #16a34a;
  font-weight: 600;
  color: #15803d;
  margin-bottom: 8px;
}

.about-dropdown-item:first-child i {
  color: #16a34a; /* Icon tetap hijau */
}
.about-dropdown-item:hover i {
  color: #2563eb; /* Icon tetap hijau */
}

.about-dropdown-item:first-child:hover {
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
  transform: scale(1.02);
}
/* About item (second item) */
.about-dropdown-item:nth-child(2) {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 2px solid #16a34a;
  font-weight: 600;
  color: #15803d;
}

.about-dropdown-item:nth-child(2):hover {
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
  transform: scale(1.02);
}
/* DESKTOP: LANGSUNG TEMPEL! */
@media (min-width: 768px) {
  .about-dropdown {
    bottom: 400px; /* Sama tingginya dengan nav sidebar */
    left: 260px; /* Muncul di samping sidebar */
    right: auto;
  }

  .bottom-nav {
    left: 0;
    width: 250px;
    height: 100vh;
    flex-direction: column;
    justify-content: flex-start;
    padding: 30px 0;
  }
}

/* Library Page */
.library-header {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px;
  background: white;
  border-bottom: 2px solid #f0f0f0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.back-button {
  background: #f0f0f0;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  color: #666;
}

.back-button:hover {
  background: #e0e0e0;
  transform: scale(1.1);
}

.library-header h2 {
  color: #1a1a1a;
  font-size: 1.3em;
  margin: 0;
}

.library-controls {
  padding: 15px 20px;
  background: white;
  display: flex;
  gap: 10px;
}

.library-search {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  background: #f8f9fa;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  padding: 0 15px;
}

.library-search i {
  color: #999;
  margin-right: 10px;
}

.library-search input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 12px 0;
  font-size: 0.95em;
  outline: none;
}

.library-filter {
  padding: 12px 15px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  background: white;
  font-size: 0.9em;
  cursor: pointer;
  outline: none;
  transition: all 0.3s;
}

.library-filter:focus {
  border-color: #16a34a;
}

.library-content {
  padding: 15px 20px 100px 20px;
}

.library-author-card {
  background: white;
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 15px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: all 0.3s;
  border-left: 4px solid #16a34a;
}

.library-author-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
}

.library-author-card.category-ulama {
  border-left-color: #2563eb;
}

.library-author-card.category-sahabat {
  border-left-color: #16a34a;
}

.library-author-card.category-hadits {
  border-left-color: #f59e0b;
}

.library-author-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.library-author-icon {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3em;
}

.library-author-icon.category-ulama {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  color: #2563eb;
}

.library-author-icon.category-sahabat {
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
  color: #16a34a;
}

.library-author-icon.category-hadits {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #f59e0b;
}

.library-author-name {
  flex: 1;
}

.library-author-name h3 {
  color: #1a1a1a;
  margin: 0 0 3px 0;
  font-size: 1.1em;
}

.library-author-name span {
  color: #666;
  font-size: 0.85em;
}

.library-preview {
  color: #555;
  font-style: italic;
  line-height: 1.6;
  margin-bottom: 10px;
}

.library-count {
  display: inline-block;
  background: #f0f9ff;
  color: #2563eb;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.85em;
  font-weight: 600;
}

/* Library Modal */
.library-modal-content {
  max-height: 60vh;
  overflow-y: auto;
}

.library-quote-item {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 15px;
  border-left: 4px solid #16a34a;
}

.library-quote-text {
  color: #1a1a1a;
  line-height: 1.8;
  font-size: 1.05em;
  margin-bottom: 10px;
  font-style: italic;
}

.library-quote-source {
  color: #666;
  font-size: 0.85em;
  display: flex;
  align-items: center;
  gap: 5px;
}

.library-quote-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #e0e0e0;
}

.library-action-btn {
  flex: 1;
  padding: 10px;
  border: none;
  background: #f0f0f0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.library-action-btn:hover {
  background: #e0e0e0;
  transform: translateY(-2px);
}

.library-action-btn.primary {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  color: white;
}

.library-action-btn.primary:hover {
  background: linear-gradient(135deg, #15803d 0%, #166534 100%);
}

/* Dark Mode - Library */
body.dark-mode .about-dropdown {
  background: #1e293b;
}

body.dark-mode .about-dropdown-item {
  color: #e2e8f0;
}

body.dark-mode .about-dropdown-item:hover {
  background: #0f172a;
}

body.dark-mode .library-header {
  background: #1e293b;
  border-bottom-color: #334155;
}

body.dark-mode .library-header h2 {
  color: #f1f5f9;
}

body.dark-mode .back-button {
  background: #0f172a;
  color: #cbd5e1;
}

body.dark-mode .library-controls {
  background: #1e293b;
}

body.dark-mode .library-search {
  background: #0f172a;
  border-color: #334155;
}

body.dark-mode .library-search input {
  color: #e2e8f0;
}

body.dark-mode .library-filter {
  background: #0f172a;
  border-color: #334155;
  color: #e2e8f0;
}

body.dark-mode .library-author-card {
  background: #1e293b;
}

body.dark-mode .library-author-name h3 {
  color: #f1f5f9;
}

body.dark-mode .library-preview {
  color: #cbd5e1;
}

body.dark-mode .library-quote-item {
  background: #0f172a;
}

body.dark-mode .library-quote-text {
  color: #f1f5f9;
}

body.dark-mode .library-action-btn {
  background: #0f172a;
  color: #e2e8f0;
}

/* Dark Mode - Reminder */
body.dark-mode .reminder-card {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
  border-color: #60a5fa;
}

body.dark-mode .reminder-status i {
  color: #60a5fa;
}

body.dark-mode .reminder-status p {
  color: #dbeafe;
}

body.dark-mode .reminder-option {
  background: #1e293b;
  border-color: #334155;
}

body.dark-mode .reminder-option:hover {
  border-color: #60a5fa;
}

body.dark-mode .reminder-info h4 {
  color: #f1f5f9;
}

body.dark-mode .reminder-info p {
  color: #94a3b8;
}

body.dark-mode .reminder-time-picker {
  background: #0f172a;
}

body.dark-mode .reminder-time-picker label {
  color: #cbd5e1;
}

body.dark-mode .reminder-time-picker input[type="time"] {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}

/* Dark Mode - Target Cards */
body.dark-mode .target-card {
  background: #1e293b;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

body.dark-mode .target-card.active {
  border-color: #60a5fa;
  box-shadow: 0 4px 15px rgba(96, 165, 250, 0.3);
}

body.dark-mode .target-text h4 {
  color: #f1f5f9;
}

body.dark-mode .target-text p {
  color: #94a3b8;
}

body.dark-mode .toggle-slider {
  background-color: #334155;
}

body.dark-mode .target-input-group {
  background: #0f172a;
}

body.dark-mode .target-input-group label {
  color: #cbd5e1;
}

body.dark-mode .target-input-group input,
body.dark-mode .target-input-group select {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}

.btn {
  padding: 12px 30px;
  border: none;
  border-radius: 8px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: #2563eb;
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-success {
  background: #16a34a;
  color: white;
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

.btn-danger {
  background: #dc2626;
  color: white;
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}
/* Fasting Page */
.fasting-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  background: white;
  border-bottom: 2px solid #f0f0f0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.fasting-header h2 {
  color: #1a1a1a;
  font-size: 1.3em;
  margin: 0;
  flex: 1;
  text-align: center;
}

.settings-icon-btn {
  background: #f0f0f0;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  color: #666;
}

.settings-icon-btn:hover {
  background: #e0e0e0;
  transform: rotate(90deg);
}

.fasting-info-card {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 2px solid #f59e0b;
  border-radius: 15px;
  padding: 20px;
  margin: 20px;
}

.fasting-info-card h3 {
  color: #92400e;
  margin: 0 0 10px 0;
  font-size: 1.2em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.fasting-info-card p {
  color: #78350f;
  margin: 5px 0;
  line-height: 1.6;
}

.fasting-info-card .info-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}

.fasting-info-card .info-row i {
  color: #d97706;
  width: 20px;
}

.fasting-stats-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 0 20px 20px 20px;
}

.fasting-stat-card {
  background: white;
  padding: 15px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border-left: 4px solid #16a34a;
}

.fasting-stat-card:nth-child(2) {
  border-left-color: #dc2626;
}

.fasting-stat-card.qadha {
  border-left-color: #f59e0b;
}

.fasting-stat-card i {
  font-size: 1.8em;
  color: #16a34a;
}

.fasting-stat-card:nth-child(2) i {
  color: #dc2626;
}

.fasting-stat-card.qadha i {
  color: #f59e0b;
}

.fasting-stat-card h3 {
  margin: 0;
  font-size: 1.5em;
  color: #1a1a1a;
}

.fasting-stat-card p {
  margin: 0;
  font-size: 0.75em;
  color: #666;
}

.fasting-calendar-container {
  padding: 0 20px 100px 20px;
}

.fasting-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-top: 15px;
}

.fasting-day-header {
  text-align: center;
  font-weight: 600;
  color: #666;
  font-size: 0.85em;
  padding: 8px 0;
}

.fasting-day {
  aspect-ratio: 1;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  font-size: 0.9em;
  font-weight: 600;
}

.fasting-day:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.fasting-day.empty {
  cursor: default;
  background: transparent;
}

.fasting-day.empty:hover {
  transform: none;
  box-shadow: none;
}

.fasting-day.fasting {
  background: #16a34a;
  color: white;
}

.fasting-day.not-fasting {
  background: #dc2626;
  color: white;
}

.fasting-day.qadha {
  background: #f59e0b;
  color: white;
}

.fasting-day.future {
  background: #e5e7eb;
  color: #999;
  cursor: default;
}

.fasting-day.future:hover {
  transform: none;
}

.fasting-day.today {
  border: 3px solid #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.fasting-day-number {
  font-size: 1.1em;
}

.fasting-day-icon {
  font-size: 0.7em;
  margin-top: 2px;
}

.fasting-status-badge {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 600;
  margin-bottom: 15px;
}

.fasting-status-badge.fasting {
  background: #dcfce7;
  color: #15803d;
}

.fasting-status-badge.not-fasting {
  background: #fee2e2;
  color: #991b1b;
}

.fasting-status-badge.qadha {
  background: #fef3c7;
  color: #92400e;
}

.fasting-detail-info {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 10px;
  margin: 15px 0;
}

.fasting-detail-info p {
  margin: 8px 0;
  color: #555;
  line-height: 1.6;
}

.fasting-detail-info strong {
  color: #1a1a1a;
}

.fasting-action-buttons {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.fasting-action-buttons button {
  flex: 1;
}

/* Dark Mode - Quick Actions (hanya untuk grid lama jika ada, bukan scroll track) */
body.dark-mode .quick-actions:not(.qa-scroll-track) .quick-action-item {
  background: #1e293b;
}

body.dark-mode .quick-actions:not(.qa-scroll-track) .quick-action-item span {
  color: #e2e8f0;
}

/* Dark Mode - Fasting */
body.dark-mode .fasting-header {
  background: #1e293b;
  border-bottom-color: #334155;
}

body.dark-mode .fasting-header h2 {
  color: #f1f5f9;
}

body.dark-mode .settings-icon-btn {
  background: #0f172a;
  color: #cbd5e1;
}

body.dark-mode .fasting-info-card {
  background: linear-gradient(135deg, #78350f 0%, #92400e 100%);
  border-color: #d97706;
}

body.dark-mode .fasting-info-card h3,
body.dark-mode .fasting-info-card p {
  color: #fef3c7;
}

body.dark-mode .fasting-stat-card {
  background: #1e293b;
}

body.dark-mode .fasting-stat-card h3 {
  color: #f1f5f9;
}

body.dark-mode .fasting-stat-card p {
  color: #94a3b8;
}

body.dark-mode .fasting-day-header {
  color: #94a3b8;
}

body.dark-mode .fasting-detail-info {
  background: #0f172a;
}

body.dark-mode .fasting-detail-info p {
  color: #cbd5e1;
}

body.dark-mode .fasting-detail-info strong {
  color: #f1f5f9;
}

@media (max-width: 600px) {
  /* quick-actions lama dihapus, sekarang pakai qa-scroll-track */

  .fasting-stats-cards {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .fasting-calendar-grid {
    gap: 5px;
  }

  .fasting-day {
    font-size: 0.8em;
  }
}
/* Quick Actions (Mini Nav Style) */
/* ── Quick Actions Scroll ─────────────────────────────── */
.qa-scroll-container {
  position: relative;
  padding: 4px 0 8px;
}

.qa-scroll-track {
  display: flex !important;
  flex-direction: row !important;
  overflow-x: auto;
  overflow-y: visible;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 4px 8px;
  /* Pastikan tidak wrap ke bawah */
  flex-wrap: nowrap !important;
}

.qa-scroll-track::-webkit-scrollbar {
  display: none;
}

/* Override .quick-action-item default agar tidak override scroll layout */
.qa-scroll-track .quick-action-item {
  flex: 0 0 20% !important; /* 5 icon per page = 20% lebar track */
  width: 20% !important;
  max-width: 20% !important;
  scroll-snap-align: start;
  min-width: 0;
  display: flex !important;
  flex-direction: column !important;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 10px 4px;
  cursor: pointer;
  border-radius: 16px;
  background: transparent !important; /* hapus background putih dari default */
  box-shadow: none !important; /* hapus shadow dari default */
  transition: background 0.15s;
  text-align: center;
}

/* Hide item saat filter aktif — !important wajib untuk kalahkan display:flex !important */
.qa-scroll-track .quick-action-item.qa-hidden {
  display: none !important;
  flex: 0 0 0% !important;
  width: 0 !important;
  max-width: 0 !important;
  min-width: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

.qa-scroll-track .quick-action-item:hover {
  transform: none !important; /* matikan translateY dari default */
  box-shadow: none !important;
  background: rgba(0, 0, 0, 0.03) !important;
}

.qa-scroll-track .quick-action-item:active {
  transform: none !important;
  background: rgba(0, 0, 0, 0.05) !important;
}

body.dark-mode .qa-scroll-track .quick-action-item:hover {
  background: rgba(255, 255, 255, 0.05) !important;
}

body.dark-mode .qa-scroll-track .quick-action-item:active {
  background: rgba(255, 255, 255, 0.08) !important;
}

.qa-scroll-track .quick-action-icon {
  width: 52px;
  height: 52px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.15s;
  flex-shrink: 0;
}

.qa-scroll-track .quick-action-item:active .quick-action-icon {
  transform: scale(0.92);
}

.qa-scroll-track .quick-action-item span {
  font-size: 10.5px;
  font-weight: 600;
  color: #374151;
  line-height: 1.35;
  text-align: center;
  word-break: keep-all;
}

body.dark-mode .qa-scroll-track .quick-action-item span {
  color: #d1d5db;
}

/* Dots indicator */
.qa-dots {
  display: flex;
  justify-content: center;
  gap: 5px;
  padding-top: 8px;
}

.qa-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d1d5db;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
}

.qa-dot.active {
  width: 18px;
  border-radius: 3px;
  background: #6b7280;
}

body.dark-mode .qa-dot {
  background: #4b5563;
}
body.dark-mode .qa-dot.active {
  background: #9ca3af;
}

/* About Page */
.about-header {
  text-align: center;
  padding: 30px 20px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  margin-bottom: 20px;
}

.about-logo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin-bottom: 15px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.about-header h2 {
  color: #1a1a1a;
  font-size: 1.8em;
  margin-bottom: 5px;
}

.about-header p {
  color: #666;
  font-size: 1em;
}

.about-list {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.about-item {
  padding: 20px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background 0.3s;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.about-item:last-child {
  border-bottom: none;
}

.about-item:hover {
  background: #f8f9fa;
}

.about-item-content {
  display: flex;
  align-items: center;
  gap: 15px;
}

.about-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2em;
}

.about-text h4 {
  color: #1a1a1a;
  margin-bottom: 3px;
}

.about-text p {
  color: #888;
  font-size: 0.9em;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  padding: 30px;
  border-radius: 15px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h3 {
  color: #1a1a1a;
}

.close-modal {
  background: none;
  border: none;
  font-size: 1.5em;
  cursor: pointer;
  color: #888;
}

/* Custom Select with Search */
.select-wrapper {
  position: relative;
}

.select-search {
  width: 100%;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1em;
  cursor: pointer;
  background: white;
}

.select-search:focus {
  outline: none;
  border-color: #2563eb;
}

.select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  margin-top: 5px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 100;
  display: none;
}

.select-dropdown.active {
  display: block;
}

.select-option {
  padding: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.select-option:hover {
  background: #f0f0f0;
}

.select-option.selected {
  background: #e0f2fe;
  color: #2563eb;
  font-weight: 600;
}
/* Last Position Indicator */
.last-position-card {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 2px solid #3b82f6;
  border-radius: 12px;
  padding: 15px;
  margin: 15px 0;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.last-position-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #1e40af;
  font-weight: 600;
  margin-bottom: 12px;
  font-size: 0.95em;
}

.last-position-header i {
  font-size: 1.2em;
}

.last-position-content {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.last-position-item {
  background: white;
  padding: 10px;
  border-radius: 8px;
  border-left: 3px solid #3b82f6;
}

.last-position-label {
  font-size: 0.8em;
  color: #64748b;
  margin-bottom: 3px;
}

.last-position-value {
  font-size: 1.1em;
  font-weight: 700;
  color: #1e40af;
}

.last-position-date {
  grid-column: 1 / -1;
  background: white;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.85em;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 6px;
}

.last-position-date i {
  color: #3b82f6;
}

.btn-auto-fill {
  width: 100%;
  padding: 10px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s;
  font-size: 0.9em;
}

.btn-auto-fill:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-auto-fill i {
  font-size: 1em;
}

@media (max-width: 600px) {
  .last-position-content {
    grid-template-columns: 1fr;
  }
}

/* Dark Mode - Last Position */
body.dark-mode .last-position-card {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
  border-color: #3b82f6;
}

body.dark-mode .last-position-header {
  color: #dbeafe;
}

body.dark-mode .last-position-item {
  background: #0f172a;
  border-left-color: #60a5fa;
}

body.dark-mode .last-position-label {
  color: #94a3b8;
}

body.dark-mode .last-position-value {
  color: #60a5fa;
}

body.dark-mode .last-position-date {
  background: #0f172a;
  color: #cbd5e1;
}

body.dark-mode .last-position-date i {
  color: #60a5fa;
}

/* Bottom Navigation (Mobile) */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #ffffff;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-around;
  padding: 10px 0;
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 20px;
  cursor: pointer;
  text-decoration: none;
  color: #888;
  transition: all 0.3s;
  border: none;
  background: none;
  font-size: 0.85em;
  border-radius: 12px;
  min-width: 70px;
}

.nav-item i {
  font-size: 1.5em;
  margin-bottom: 5px;
}

.nav-item:nth-child(1) i {
  color: #2563eb;
}
.nav-item:nth-child(2) i {
  color: #16a34a;
}
.nav-item:nth-child(3) i {
  color: #f59e0b;
}
.nav-item:nth-child(4) i {
  color: #ea580c;
}
.nav-item:nth-child(5) i {
  color: #7c3aed;
}

.nav-item.active:nth-child(1) {
  color: #2563eb;
  background: #dbeafe;
}
.nav-item.active:nth-child(2) {
  color: #16a34a;
  background: #dcfce7;
}
.nav-item.active:nth-child(3) {
  color: #f59e0b;
  background: #fef3c7;
}
.nav-item.active:nth-child(4) {
  color: #ea580c;
  background: #ffedd5;
}
.nav-item.active:nth-child(5) {
  color: #7c3aed;
  background: #f3e8ff;
}

/* Desktop Navigation */
@media (min-width: 768px) {
  body {
    padding-bottom: 0;
    padding-left: 250px;
  }

  .bottom-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    height: 100vh;
    flex-direction: column;
    justify-content: flex-start;
    padding: 30px 0;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  }

  .nav-item {
    flex-direction: row;
    justify-content: flex-start;
    padding: 15px 20px;
    width: calc(100% - 20px);
    margin: 0 10px;
    font-size: 1em;
    gap: 15px;
  }

  .nav-item i {
    margin-bottom: 0;
    font-size: 1.3em;
  }

  .header {
    margin-left: 0;
  }
}

/* Floating Action Button */
.fab {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 56px;
  height: 56px;
  background: #16a34a;
  color: white;
  border-radius: 50%;
  border: none;
  font-size: 1.5em;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(22, 163, 74, 0.4);
  transition:
    transform 0.3s,
    box-shadow 0.3s;
  z-index: 99;
}

.fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(22, 163, 74, 0.5);
}

@media (min-width: 768px) {
  .fab {
    bottom: 20px;
  }
}

/* Mobile specific */
@media (max-width: 767px) {
  .fab {
    width: 50px;
    height: 50px;
    font-size: 1.3em;
  }

  .header h1 {
    font-size: 1.5em;
  }

  .greeting {
    font-size: 0.95em;
  }

  .chart-wrapper {
    width: 160px;
    height: 160px;
  }

  .chart-percentage {
    font-size: 1em;
  }

  .charts-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }

  .chart-card {
    padding: 10px;
  }

  .chart-card h3 {
    font-size: 0.7em;
  }
}
/* Mobile specific */
@media (max-width: 400px) {
  .fab {
    width: 50px;
    height: 50px;
    font-size: 1.3em;
  }

  .header h1 {
    font-size: 1.5em;
  }

  .greeting {
    font-size: 0.95em;
  }

  .chart-wrapper {
    width: 160px;
    height: 160px;
  }

  .chart-percentage {
    font-size: 1em;
  }

  .charts-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 5px;
    width: 45px;
    height: auto;
  }

  .chart-card {
    padding: 10px;
  }

  .chart-card h3 {
    font-size: 0.7em;
  }
}
/* AI Chatbot Button */
.ai-fab {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 1.5em;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
  transition: all 0.3s;
  z-index: 100;
  animation: aiPulse 2s infinite;
}
.ai-fab.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.8);
}

.ai-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 25px rgba(124, 58, 237, 0.6);
}

.ai-fab:active {
  transform: scale(0.95);
}

@keyframes aiPulse {
  0%,
  100% {
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
  }
  50% {
    box-shadow: 0 4px 25px rgba(124, 58, 237, 0.7);
  }
}

/* AI Chat Modal */
.ai-chat-modal {
  position: fixed;
  bottom: 220px;
  right: 20px;
  width: 380px;
  height: 550px;
  background: white;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(20px) scale(0.9);
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 998;
  display: flex;
  flex-direction: column;
}

.ai-chat-modal.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.ai-chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.ai-chat-header {
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
  padding: 15px 20px;
  border-radius: 20px 20px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: white;
}

.ai-chat-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-chat-title i {
  font-size: 1.8em;
}

.ai-chat-title h3 {
  margin: 0;
  font-size: 1.1em;
}

.ai-status {
  font-size: 0.75em;
  opacity: 0.9;
}

.ai-close-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.ai-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Chat Messages Area */
.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: #f8f9fa;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.ai-chat-messages::-webkit-scrollbar {
  width: 6px;
}

.ai-chat-messages::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.ai-message-group {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.ai-message-group.user {
  flex-direction: row-reverse;
}

.ai-avatar {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3em;
  flex-shrink: 0;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ai-bubble {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: 15px;
  background: white;
  word-wrap: break-word;
  line-height: 1.5;
}

/* AI Message Bubble */
.ai-message-group .ai-bubble {
  border: 2px solid #7c3aed;
  border-radius: 15px 15px 15px 3px;
  color: #1a1a1a;
}

/* User Message Bubble */
.ai-message-group.user .ai-bubble {
  border: 2px solid #2563eb;
  border-radius: 15px 15px 3px 15px;
  color: #1a1a1a;
}

.ai-bubble p {
  margin: 0 0 8px 0;
}

.ai-bubble p:last-child {
  margin-bottom: 0;
}

.ai-bubble ul {
  margin: 8px 0 0 0;
  padding-left: 20px;
}

.ai-bubble ul li {
  margin: 5px 0;
}

.ai-bubble strong {
  color: #7c3aed;
  font-weight: 600;
}

.ai-timestamp {
  font-size: 0.7em;
  color: #999;
  margin-top: 4px;
  text-align: right;
}

/* Loading Animation */
.ai-loading {
  display: flex;
  gap: 5px;
  padding: 12px 16px;
}

.ai-loading span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7c3aed;
  animation: aiTyping 1.4s infinite;
}

.ai-loading span:nth-child(2) {
  animation-delay: 0.2s;
}

.ai-loading span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes aiTyping {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

/* Welcome Message */
.ai-welcome-message {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

/* Chat Input */
.ai-chat-input {
  padding: 15px;
  background: white;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 10px;
  border-radius: 0 0 20px 20px;
}

.ai-chat-input input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 25px;
  outline: none;
  font-size: 0.95em;
  transition: all 0.3s;
}

.ai-chat-input input:focus {
  border-color: #7c3aed;
}

.ai-send-btn {
  width: 45px;
  height: 45px;
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
  border: none;
  border-radius: 50%;
  color: rgb(255, 255, 255);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-size: 1.1em;
}

.ai-send-btn:hover {
  transform: scale(1.05);
}

.ai-send-btn:active {
  transform: scale(0.95);
}

/* Dark Mode - AI Chat */
body.dark-mode .ai-chat-modal {
  background: #1e293b;
}

body.dark-mode .ai-chat-messages {
  background: #0f172a;
}

body.dark-mode .ai-bubble {
  background: #1e293b;
  color: #e2e8f0;
}

body.dark-mode .ai-message-group .ai-bubble {
  border-color: #a855f7;
}

body.dark-mode .ai-message-group.user .ai-bubble {
  border-color: #60a5fa;
}

body.dark-mode .ai-bubble strong {
  color: #c084fc;
}

body.dark-mode .ai-chat-input {
  background: #1e293b;
  border-top-color: #334155;
}

body.dark-mode .ai-chat-input input {
  background: #0f172a;
  border-color: #334155;
  color: #e2e8f0;
}

body.dark-mode .ai-avatar {
  background: #1e293b;
}

/* Mobile Responsive */
@media (max-width: 600px) {
  .ai-chat-modal {
    right: 10px;
    left: 10px;
    width: auto;
    bottom: 90px;
    height: 500px;
  }

  .ai-fab {
    bottom: 150px;
    right: 20px;
    width: 55px;
    height: 55px;
  }
}
/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

.empty-state i {
  font-size: 4em;
  margin-bottom: 20px;
  opacity: 0.3;
}

.empty-state h3 {
  color: #666;
  margin-bottom: 10px;
}

/* Form Row */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* Mushaf Info */
.mushaf-info {
  background: #f0f9ff;
  border-left: 4px solid #2563eb;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.mushaf-info h4 {
  color: #1a1a1a;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mushaf-info p {
  color: #666;
  font-size: 0.9em;
  line-height: 1.6;
}

/* Detail Grid Modal */
.detail-grid {
  display: grid;
  gap: 20px;
}

.detail-section {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
}

.detail-section h4 {
  color: #1a1a1a;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1em;
}

.detail-section h4 i {
  color: #2563eb;
}

.detail-item-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #e0e0e0;
}

.detail-item-row:last-child {
  border-bottom: none;
}

.detail-item-label {
  color: #666;
  font-weight: 600;
}

.detail-item-value {
  color: #1a1a1a;
  font-weight: 500;
}

.detail-notes-box {
  background: white;
  padding: 15px;
  border-radius: 8px;
  color: #555;
  font-style: italic;
  border-left: 3px solid #2563eb;
}

/* Simulation Modal Styles */
.simulation-info {
  background: #f0f9ff;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  border-left: 4px solid #2563eb;
}

.simulation-info h4 {
  color: #1a1a1a;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.simulation-info p {
  color: #555;
  line-height: 1.6;
  margin: 5px 0;
}

.simulation-target {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  border-radius: 12px;
  text-align: center;
  margin-bottom: 25px;
}

.simulation-target h3 {
  margin-bottom: 10px;
  font-size: 1.3em;
}

.simulation-target .big-number {
  font-size: 3em;
  font-weight: bold;
  margin: 10px 0;
}

.simulation-target p {
  opacity: 0.9;
  font-size: 1em;
}

.strategy-cards {
  display: grid;
  gap: 15px;
  margin-top: 20px;
}

.strategy-card {
  background: #ffffff;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  padding: 20px;
  transition: all 0.3s;
}

.strategy-card:hover {
  border-color: #2563eb;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

.strategy-card.recommended {
  border-color: #16a34a;
  background: #f0fdf4;
}

.strategy-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

.strategy-badge {
  background: #2563eb;
  color: white;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.85em;
  font-weight: 600;
}

.strategy-badge.recommended {
  background: #16a34a;
}

.strategy-title {
  font-size: 1.2em;
  font-weight: 600;
  color: #1a1a1a;
  flex: 1;
}

.strategy-description {
  color: #666;
  margin-bottom: 15px;
  line-height: 1.6;
}

.strategy-breakdown {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
}

.breakdown-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #e0e0e0;
}

.breakdown-item:last-child {
  border-bottom: none;
}

.breakdown-label {
  color: #555;
  display: flex;
  align-items: center;
  gap: 8px;
}

.breakdown-label i {
  color: #2563eb;
  width: 20px;
}

.breakdown-value {
  font-weight: 600;
  color: #1a1a1a;
}

.strategy-total {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 2px solid #2563eb;
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  color: #2563eb;
}

.no-target-warning {
  background: #fff3cd;
  border: 2px solid #ffc107;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}

.no-target-warning i {
  font-size: 3em;
  color: #ffc107;
  margin-bottom: 15px;
}

.no-target-warning h4 {
  color: #1a1a1a;
  margin-bottom: 10px;
}

.no-target-warning p {
  color: #666;
  line-height: 1.6;
  margin-bottom: 15px;
}

/* Progress Modal Styles */
.progress-header {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: white;
  padding: 25px;
  border-radius: 12px;
  text-align: center;
  margin-bottom: 25px;
}

.progress-header h3 {
  font-size: 1.5em;
  margin-bottom: 8px;
}

.progress-header p {
  opacity: 0.95;
  font-size: 1em;
}

.progress-current {
  background: #f0fdf4;
  border: 2px solid #059669;
  border-radius: 12px;
  padding: 25px;
  margin-bottom: 20px;
}

.progress-current h4 {
  color: #047857;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.2em;
}

.progress-divider {
  border: 0;
  height: 2px;
  background: linear-gradient(to right, transparent, #059669, transparent);
  margin: 20px 0;
}

.progress-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin-bottom: 20px;
}

.progress-detail-item {
  background: white;
  padding: 15px;
  border-radius: 8px;
  border-left: 3px solid #059669;
}

.progress-detail-label {
  font-size: 0.85em;
  color: #666;
  margin-bottom: 5px;
}

.progress-detail-value {
  font-size: 1.3em;
  font-weight: 700;
  color: #047857;
}

.progress-last-read {
  background: white;
  padding: 15px;
  border-radius: 8px;
  margin-top: 15px;
}

.progress-last-read h5 {
  color: #047857;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-last-info {
  display: flex;
  justify-content: space-between;
  color: #555;
  font-size: 0.95em;
}

.progress-bars {
  margin-top: 25px;
}

.progress-bar-item {
  margin-bottom: 20px;
}

.progress-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.progress-bar-title {
  font-weight: 600;
  color: #1a1a1a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-bar-percentage {
  font-weight: 700;
  color: #059669;
  font-size: 1.1em;
}

.progress-bar-track {
  width: 100%;
  height: 25px;
  background: #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  border-radius: 12px;
  transition: width 0.8s ease;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 10px;
  color: white;
  font-size: 0.85em;
  font-weight: 600;
}

.progress-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-top: 20px;
}

.progress-stat-card {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  padding: 15px;
  border-radius: 10px;
  text-align: center;
  border: 1px solid #059669;
}

.progress-stat-value {
  font-size: 1.8em;
  font-weight: 700;
  color: #047857;
  margin-bottom: 5px;
}

.progress-stat-label {
  font-size: 0.85em;
  color: #065f46;
}

.no-progress-warning {
  background: #fef3c7;
  border: 2px solid #f59e0b;
  border-radius: 12px;
  padding: 30px;
  text-align: center;
}

.no-progress-warning i {
  font-size: 3em;
  color: #f59e0b;
  margin-bottom: 15px;
}

.no-progress-warning h4 {
  color: #1a1a1a;
  margin-bottom: 10px;
  font-size: 1.3em;
}

.no-progress-warning p {
  color: #666;
  line-height: 1.6;
  margin-bottom: 15px;
}

@media (max-width: 600px) {
  .progress-detail-grid {
    grid-template-columns: 1fr;
  }

  .progress-stats-grid {
    grid-template-columns: 1fr;
  }
}

/* Toast Notification */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: white;
  padding: 16px 20px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  max-width: 400px;
  animation: slideIn 0.3s ease-out;
  border-left: 4px solid #16a34a;
}

.toast.success {
  border-left-color: #16a34a;
}

.toast.success .toast-icon {
  color: #16a34a;
}

.toast.error {
  border-left-color: #dc2626;
}

.toast.error .toast-icon {
  color: #dc2626;
}

.toast.warning {
  border-left-color: #f59e0b;
}

.toast.warning .toast-icon {
  color: #f59e0b;
}

.toast.info {
  border-left-color: #2563eb;
}

.toast.info .toast-icon {
  color: #2563eb;
}

.toast-icon {
  font-size: 1.5em;
  flex-shrink: 0;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 3px;
  font-size: 0.95em;
}

.toast-message {
  color: #666;
  font-size: 0.9em;
  line-height: 1.4;
}

.toast-close {
  background: none;
  border: none;
  color: #999;
  font-size: 1.2em;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.toast-close:hover {
  background: #f0f0f0;
  color: #666;
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

.toast.slide-out {
  animation: slideOut 0.3s ease-in forwards;
}

@media (max-width: 600px) {
  .toast-container {
    left: 10px;
    right: 10px;
    top: 10px;
  }

  .toast {
    min-width: auto;
    max-width: none;
  }
}
/* Dark Mode Styles */
body.dark-mode {
  background: #0f172a;
  color: #e2e8f0;
}

body.dark-mode .header {
  background: #1e293b;
  border-bottom-color: #334155;
}

body.dark-mode .header h1 {
  color: #f1f5f9;
}

body.dark-mode .greeting {
  color: #94a3b8;
  border-top-color: #334155;
}

body.dark-mode .greeting .name {
  color: #60a5fa;
}

body.dark-mode .theme-toggle {
  background: #334155;
  color: #fbbf24;
}

body.dark-mode .theme-toggle:hover {
  background: #475569;
}

body.dark-mode .chart-card {
  background: #1e293b;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

body.dark-mode .chart-card h3 {
  color: #f1f5f9;
}

body.dark-mode .chart-label {
  color: #94a3b8;
}

body.dark-mode .chart-percentage {
  color: #f1f5f9;
}

body.dark-mode .activity-card {
  background: #1e293b;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-mode .activity-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

body.dark-mode .card-title {
  color: #f1f5f9;
}

body.dark-mode .card-date {
  color: #94a3b8;
}

body.dark-mode .detail-item {
  color: #cbd5e1;
}

body.dark-mode .card-notes {
  background: #0f172a;
  color: #94a3b8;
}

body.dark-mode .bottom-nav {
  background: #1e293b;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
}

body.dark-mode .nav-item {
  color: #94a3b8;
}

body.dark-mode .nav-item.active:nth-child(1) {
  background: #1e3a8a;
  color: #60a5fa;
}

body.dark-mode .nav-item.active:nth-child(2) {
  background: #14532d;
  color: #4ade80;
}

body.dark-mode .nav-item.active:nth-child(3) {
  background: #7c2d12;
  color: #fb923c;
}

body.dark-mode .nav-item.active:nth-child(4) {
  background: #4c1d95;
  color: #a78bfa;
}

body.dark-mode .modal-content {
  background: #1e293b;
}

body.dark-mode .modal-header h3 {
  color: #f1f5f9;
}

body.dark-mode .close-modal {
  color: #94a3b8;
}

body.dark-mode .form-group label {
  color: #cbd5e1;
}

body.dark-mode .form-group input,
body.dark-mode .form-group select,
body.dark-mode .form-group textarea {
  background: #0f172a;
  border-color: #334155;
  color: #e2e8f0;
}

body.dark-mode .form-group input:focus,
body.dark-mode .form-group select:focus,
body.dark-mode .form-group textarea:focus {
  border-color: #60a5fa;
}

body.dark-mode .settings-section {
  background: #1e293b;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-mode .settings-section h3 {
  color: #f1f5f9;
}

body.dark-mode .about-header {
  background: #1e293b;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-mode .about-header h2 {
  color: #f1f5f9;
}

body.dark-mode .about-header p {
  color: #94a3b8;
}

body.dark-mode .about-list {
  background: #1e293b;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-mode .about-item {
  border-bottom-color: #334155;
}

body.dark-mode .about-item:hover {
  background: #0f172a;
}

body.dark-mode .about-text h4 {
  color: #f1f5f9;
}

body.dark-mode .about-text p {
  color: #94a3b8;
}

body.dark-mode .history-controls {
  background: #1e293b;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-mode .tab-btn {
  background: #0f172a;
  border-color: #334155;
  color: #cbd5e1;
}

body.dark-mode .tab-btn.active {
  background: #2563eb;
  color: white;
}

body.dark-mode .chart-container {
  background: #1e293b;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-mode .bar-label {
  color: #cbd5e1;
}

body.dark-mode .bar-bg {
  background: #0f172a;
}

body.dark-mode .select-dropdown {
  background: #1e293b;
  border-color: #334155;
}

body.dark-mode .select-option:hover {
  background: #0f172a;
}

body.dark-mode .select-option.selected {
  background: #1e3a8a;
  color: #60a5fa;
}

body.dark-mode .detail-section {
  background: #0f172a;
}

body.dark-mode .detail-section h4 {
  color: #f1f5f9;
}

body.dark-mode .detail-item-label {
  color: #94a3b8;
}

body.dark-mode .detail-item-value {
  color: #f1f5f9;
}

body.dark-mode .detail-notes-box {
  background: #1e293b;
  color: #cbd5e1;
}

body.dark-mode .mushaf-info {
  background: #1e3a8a;
  border-left-color: #60a5fa;
}

body.dark-mode .mushaf-info h4 {
  color: #f1f5f9;
}

body.dark-mode .mushaf-info p {
  color: #cbd5e1;
}

body.dark-mode .empty-state {
  color: #64748b;
}

body.dark-mode .empty-state h3 {
  color: #94a3b8;
}

body.dark-mode .toast {
  background: #1e293b;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

body.dark-mode .toast-title {
  color: #f1f5f9;
}

body.dark-mode .toast-message {
  color: #94a3b8;
}

body.dark-mode .toast-close:hover {
  background: #0f172a;
  color: #cbd5e1;
}
/* PWA Install Popup */
.pwa-popup {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.pwa-popup.active {
  opacity: 1;
  pointer-events: all;
}

.pwa-popup-content {
  background: white;
  border-radius: 24px 24px 0 0;
  padding: 30px 25px;
  width: 100%;
  max-width: 480px;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
}

.pwa-popup.active .pwa-popup-content {
  transform: translateY(0);
}

.pwa-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.pwa-popup-logo {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.pwa-popup-close {
  background: #f0f0f0;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
}

.pwa-popup-content h3 {
  font-size: 1.4em;
  color: #1a1a1a;
  margin-bottom: 10px;
}

.pwa-popup-content p {
  color: #666;
  font-size: 0.95em;
  line-height: 1.6;
  margin-bottom: 20px;
}

.pwa-popup-features {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 25px;
  flex-wrap: wrap;
}

.pwa-popup-features span {
  background: #f0fdf4;
  color: #16a34a;
  border: 1.5px solid #16a34a;
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 0.85em;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pwa-btn-install {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1em;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.pwa-btn-install:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(22, 163, 74, 0.35);
}

.pwa-btn-dismiss {
  width: 100%;
  padding: 12px;
  background: none;
  border: none;
  color: #888;
  font-size: 0.95em;
  cursor: pointer;
}

.pwa-btn-dismiss:hover {
  color: #333;
}

/* Dark mode */
body.dark-mode .pwa-popup-content {
  background: #1e293b;
}

body.dark-mode .pwa-popup-content h3 {
  color: #f1f5f9;
}

body.dark-mode .pwa-popup-content p {
  color: #94a3b8;
}

body.dark-mode .pwa-popup-close {
  background: #334155;
  color: #cbd5e1;
}
.exit-confirm-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  z-index: 99999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: exitFadeIn 0.2s ease;
}

@keyframes exitFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.exit-confirm-sheet {
  background: #ffffff;
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-width: 480px;
  padding: 32px 24px calc(40px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.25);
  position: relative;
  z-index: 100000;
}

.exit-confirm-sheet.visible {
  transform: translateY(0);
}
/* ── Exit Confirmation ──────────────────────────── */
.exit-confirm-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  z-index: 99999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: exitFadeIn 0.2s ease;
}

@keyframes exitFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.exit-confirm-sheet {
  background: #ffffff;
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-width: 480px;
  padding: 32px 24px calc(80px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.25);
  position: relative;
  z-index: 100000;
}

.exit-confirm-sheet.visible {
  transform: translateY(0);
}

.exit-confirm-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #fee2e2, #fecdd3);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 1.6em;
  color: #e11d48;
}

.exit-confirm-title {
  font-size: 1.15em;
  font-weight: 800;
  color: #1e293b;
  margin: 0 0 8px;
}

.exit-confirm-desc {
  font-size: 0.88em;
  color: #64748b;
  line-height: 1.6;
  margin: 0 0 28px;
}

.exit-confirm-actions {
  display: flex;
  gap: 10px;
}

.exit-btn-cancel,
.exit-btn-exit {
  flex: 1;
  padding: 14px;
  border: none;
  border-radius: 14px;
  font-size: 0.92em;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: all 0.18s;
}

.exit-btn-cancel {
  background: #f1f5f9;
  color: #475569;
  border: 1.5px solid #e2e8f0;
}

.exit-btn-exit {
  background: linear-gradient(135deg, #e11d48, #be123c);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(225, 29, 72, 0.35);
}

/* Dark mode */
body.dark-mode .exit-confirm-sheet {
  background: #1e293b;
}
body.dark-mode .exit-confirm-title {
  color: #f1f5f9;
}
body.dark-mode .exit-confirm-desc {
  color: #94a3b8;
}
body.dark-mode .exit-btn-cancel {
  background: #334155;
  color: #94a3b8;
  border-color: #475569;
}
/* ══ AI Guide Modal ══════════════════════════════════════ */
.ai-guide-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  z-index: 99999;
  display: none;
  align-items: flex-end;
  justify-content: center;
  animation: agFadeIn 0.2s ease;
}
.ai-guide-overlay.active {
  display: flex;
}

@keyframes agFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.ai-guide-sheet {
  background: #fff;
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.2);
}
.ai-guide-sheet.visible {
  transform: translateY(0);
}

/* Header */
.ai-guide-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 14px;
  border-bottom: 1px solid #f1f5f9;
  flex-shrink: 0;
}
.ai-guide-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ai-guide-header-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.1em;
  flex-shrink: 0;
}
.ai-guide-header h3 {
  font-size: 1em;
  font-weight: 800;
  color: #1e293b;
  margin: 0 0 2px;
}
.ai-guide-header p {
  font-size: 0.75em;
  color: #94a3b8;
  margin: 0;
}
.ai-guide-close {
  width: 32px;
  height: 32px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 0.85em;
  transition: all 0.15s;
  flex-shrink: 0;
}
.ai-guide-close:hover {
  background: #fee2e2;
  color: #e11d48;
  border-color: #fecdd3;
}

/* Search */
.ai-guide-search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 16px 8px;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  flex-shrink: 0;
  transition: border-color 0.2s;
}
.ai-guide-search-wrap:focus-within {
  border-color: #7c3aed;
  background: #faf5ff;
}
.ai-guide-search-wrap > i {
  color: #94a3b8;
  font-size: 0.9em;
}
.ai-guide-search-wrap input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 0.9em;
  color: #1e293b;
  outline: none;
}
.ai-guide-search-wrap input::placeholder {
  color: #cbd5e1;
}
.ai-guide-search-clear {
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  padding: 0;
  font-size: 1em;
}
.ai-guide-search-clear:hover {
  color: #64748b;
}

/* Filter chips */
.ai-guide-filters {
  display: flex;
  gap: 7px;
  padding: 0 16px 10px;
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: none;
}
.ai-guide-filters::-webkit-scrollbar {
  display: none;
}
.ai-guide-filter {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  color: #64748b;
  font-size: 0.78em;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s;
  flex-shrink: 0;
}
.ai-guide-filter:hover {
  border-color: #7c3aed;
  color: #7c3aed;
}
.ai-guide-filter.active {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 3px 10px rgba(124, 58, 237, 0.3);
}

/* Hint */
.ai-guide-hint {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 16px 8px;
  padding: 8px 12px;
  background: #faf5ff;
  border: 1px solid #ede9fe;
  border-radius: 10px;
  font-size: 0.75em;
  color: #7c3aed;
  font-weight: 600;
  flex-shrink: 0;
}
.ai-guide-hint i {
  font-size: 0.9em;
}

/* List */
.ai-guide-list {
  overflow-y: auto;
  padding: 4px 16px calc(24px + env(safe-area-inset-bottom, 0px));
  flex: 1;
}

/* Section header */
.ai-guide-section {
  font-size: 0.72em;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #94a3b8;
  padding: 14px 0 8px;
}

/* Item card */
.ai-guide-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1.5px solid #f1f5f9;
  margin-bottom: 7px;
  cursor: pointer;
  transition: all 0.18s;
  background: #fff;
}
.ai-guide-item:hover {
  border-color: #7c3aed;
  background: #faf5ff;
  transform: translateX(3px);
}
.ai-guide-item:active {
  transform: scale(0.98);
}

.ai-guide-item-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1em;
  flex-shrink: 0;
}

.ai-guide-item-text {
  flex: 1;
  min-width: 0;
}
.ai-guide-item-text strong {
  display: block;
  font-size: 0.87em;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 2px;
}
.ai-guide-item-text span {
  font-size: 0.75em;
  color: #94a3b8;
  font-style: italic;
}

.ai-guide-item-arrow {
  color: #cbd5e1;
  font-size: 0.8em;
  flex-shrink: 0;
}
.ai-guide-item:hover .ai-guide-item-arrow {
  color: #7c3aed;
}

/* Empty state */
.ai-guide-empty {
  text-align: center;
  padding: 40px 20px;
  color: #94a3b8;
}
.ai-guide-empty i {
  font-size: 2em;
  margin-bottom: 10px;
  display: block;
}
.ai-guide-empty p {
  font-size: 0.88em;
  margin: 0;
}

/* Dark mode */
body.dark-mode .ai-guide-sheet {
  background: #1e293b;
}
body.dark-mode .ai-guide-header {
  border-bottom-color: #334155;
}
body.dark-mode .ai-guide-header h3 {
  color: #f1f5f9;
}
body.dark-mode .ai-guide-search-wrap {
  background: #0f172a;
  border-color: #334155;
}
body.dark-mode .ai-guide-search-wrap:focus-within {
  border-color: #7c3aed;
  background: #1a0f2e;
}
body.dark-mode .ai-guide-search-wrap input {
  color: #f1f5f9;
}
body.dark-mode .ai-guide-filter {
  background: #334155;
  border-color: #475569;
  color: #94a3b8;
}
body.dark-mode .ai-guide-filter.active {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  color: #fff;
}
body.dark-mode .ai-guide-hint {
  background: #1a0f2e;
  border-color: #4c1d95;
  color: #a78bfa;
}
body.dark-mode .ai-guide-item {
  background: #0f172a;
  border-color: #334155;
}
body.dark-mode .ai-guide-item:hover {
  background: #1a0f2e;
  border-color: #7c3aed;
}
body.dark-mode .ai-guide-item-text strong {
  color: #f1f5f9;
}
body.dark-mode .ai-guide-close {
  background: #334155;
  border-color: #475569;
  color: #94a3b8;
}
body.dark-mode .ai-guide-section {
  color: #475569;
}

/* ── Quick Action Filter Chips ──────────────────────────── */
.qa-filter-tabs {
  display: flex;
  gap: 8px;
  padding: 4px 16px 10px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.qa-filter-tabs::-webkit-scrollbar {
  display: none;
}

.qa-filter-tab {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border: 1.5px solid #e5e7eb;
  border-radius: 20px;
  background: var(--card-bg, #fff);
  color: var(--text-secondary, #6b7280);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.qa-filter-tab i {
  font-size: 11px;
}
.qa-filter-tab:hover {
  border-color: #a78bfa;
  color: #7c3aed;
}
.qa-filter-tab.active {
  background: linear-gradient(135deg, #3a7fed, #556bf7);
  border-color: transparent;
  color: white;
  box-shadow: 0 3px 10px rgba(124, 58, 237, 0.3);
}
body.dark-mode .qa-filter-tab {
  background: #1e293b;
  border-color: #334155;
  color: #94a3b8;
}
body.dark-mode .qa-filter-tab:hover {
  border-color: #a78bfa;
  color: #a78bfa;
}
body.dark-mode .qa-filter-tab.active {
  background: linear-gradient(135deg, #3a7fed, #556bf7);
  border-color: transparent;
  color: white;
}
