/* ===== RESET & BASE ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #7C6FA0;
  --primary-dark: #5E5280;
  --primary-light: #F3F0FA;
  --accent: #E8A0BF;
  --accent-light: #FDF0F5;
  --bg: #FAF8FD;
  --card-bg: #FFFFFF;
  --text-primary: #2E2640;
  --text-secondary: #9890A8;
  --border: #EDE8F3;
  --success: #7EC8A0;
  --success-light: #EEF9F2;
  --warning: #F5C542;
  --danger: #E8637A;
  --cat-quran: #7C6FA0;
  --cat-duas: #E8A0BF;
  --cat-diet: #7EC8A0;
  --cat-actions: #87B7D6;
  --nav-height: 68px;
  --header-height: 110px;
  --subheader-height: 68px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html, body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  height: 100%;
}

#app {
  height: 100%;
  position: relative;
}

/* ===== SCREENS ===== */
.screen {
  position: absolute;
  inset: 0;
  background: var(--bg);
  z-index: 1;
}

.screen.hidden {
  display: none;
}

/* ===== WELCOME ===== */
.welcome-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 32px;
  text-align: center;
  gap: 16px;
}

.welcome-logo {
  width: 80%;
  max-width: 320px;
  height: auto;
  margin-bottom: 24px;
}

.welcome-content p {
  color: var(--text-secondary);
  font-size: 15px;
}

.date-input {
  width: 100%;
  max-width: 280px;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 16px;
  font-family: 'Outfit', sans-serif;
  color: var(--text-primary);
  background: var(--card-bg);
  transition: border-color 0.2s;
}

.date-input:focus {
  outline: none;
  border-color: var(--primary);
}

/* ===== SPLASH ===== */
.splash-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ===== GOOGLE LOGIN ===== */
.btn-google {
  width: 100%;
  max-width: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  background: var(--card-bg);
  color: var(--text-primary);
  border: 2px solid var(--border);
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.btn-google:active {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(124, 111, 160, 0.15);
}

.login-error {
  color: var(--danger);
  font-size: 13px;
  min-height: 20px;
}

/* ===== BUTTONS ===== */
.btn-primary {
  width: 100%;
  max-width: 280px;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary:active:not(:disabled) {
  opacity: 0.85;
  transform: scale(0.98);
}

.btn-secondary {
  width: 100%;
  padding: 12px 24px;
  background: var(--card-bg);
  color: var(--text-primary);
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 15px;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  transition: border-color 0.2s;
}

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

.btn-danger {
  width: 100%;
  padding: 12px 24px;
  background: var(--danger);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
}

.btn-text {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 14px;
  font-family: 'Outfit', sans-serif;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 12px;
}

.icon-btn {
  background: var(--primary-light);
  border: none;
  color: var(--primary);
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  transition: background 0.2s;
}

.icon-btn:active {
  background: var(--border);
}

/* ===== HEADER ===== */
#app-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 6px 20px 4px;
  background: var(--bg);
  position: relative;
  z-index: 10;

}

.header-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.header-logo {
  height: 160px;
  width: auto;
  max-width: 70vw;
  object-fit: contain;
  margin: -30px 0 -30px -10px;
}

.header-month {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  padding: 4px 12px;
  border-radius: 20px;
  white-space: nowrap;
}

#app-header > .icon-btn {
  margin-top: 8px;
}

/* ===== SUB-HEADER ===== */
#sub-header {
  padding: 0 20px 16px;
  background: var(--bg);
}

#greeting {
  font-size: 14px;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 10px;
}

/* ===== PROGRESS BAR ===== */
.progress-bar-container {
  position: relative;
  height: 10px;
  background: var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 10px;
  transition: width 0.3s ease;
  width: 0%;
}

.progress-bar-fill.complete {
  background: linear-gradient(90deg, var(--success), #A8E6C0);
}

.progress-text {
  position: absolute;
  right: 0;
  top: -20px;
  font-size: 13px;
  color: var(--primary);
  font-weight: 700;
}

.progress-bar-container {
  margin-top: 20px;
}

/* ===== PULL TO REFRESH ===== */
.pull-indicator {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 0;
  overflow: hidden;
  transition: height 0.2s ease;
}

.pull-indicator.visible {
  height: 50px;
}

.pull-indicator.refreshing .pull-spinner {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ===== TAB CONTENT ===== */
#tab-content {
  overflow-y: auto;
  height: calc(100% - var(--header-height) - var(--subheader-height) - var(--nav-height) - var(--safe-bottom));
  padding-bottom: 32px;
}

.tab-panel {
  padding: 0 20px;
}

.tab-panel.hidden {
  display: none;
}

/* ===== BOTTOM NAV ===== */
#bottom-nav {
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: var(--nav-height);
  background: var(--card-bg);
  padding-bottom: var(--safe-bottom);
  position: sticky;
  bottom: 0;
  z-index: 10;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 20px rgba(124, 111, 160, 0.08);
}

.nav-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  padding: 8px 20px;
  border-radius: 14px;
  transition: color 0.2s;
}

.nav-tab.active {
  color: var(--primary);
}

.nav-tab.active svg {
  stroke: var(--primary);
}

.nav-tab.active::after {
  content: '';
  width: 20px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 2px;
}

/* ===== SECTION HEADERS ===== */
.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.section-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.section-chevron {
  font-size: 10px;
  transition: transform 0.2s;
  display: inline-block;
}

.section-chevron.collapsed {
  transform: rotate(-90deg);
}

.section-count {
  font-size: 12px;
  font-weight: 600;
  margin-left: auto;
  margin-right: 4px;
  opacity: 0.7;
}

/* Category badge styling */
.cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px 4px 8px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.cat-badge .cat-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: white;
}

.section-header.cat-quran .cat-badge { background: var(--primary-light); color: var(--cat-quran); }
.section-header.cat-quran .cat-icon { background: var(--cat-quran); }
.section-header.cat-duas .cat-badge { background: var(--accent-light); color: #B5628A; }
.section-header.cat-duas .cat-icon { background: var(--cat-duas); }
.section-header.cat-diet .cat-badge { background: var(--success-light); color: #4A9B6E; }
.section-header.cat-diet .cat-icon { background: var(--cat-diet); }
.section-header.cat-actions .cat-badge { background: #EDF4F9; color: #5A8CAA; }
.section-header.cat-actions .cat-icon { background: var(--cat-actions); }
.section-header.cat-scheduled .cat-badge { background: var(--primary-light); color: var(--primary); }
.section-header.cat-scheduled .cat-icon { background: var(--primary); }

/* Legacy section header color fallbacks */
.section-header.cat-quran { color: var(--cat-quran); }
.section-header.cat-duas { color: var(--cat-duas); }
.section-header.cat-diet { color: var(--cat-diet); }
.section-header.cat-actions { color: var(--cat-actions); }
.section-header.cat-scheduled { color: var(--primary); }

/* ===== CHECKLIST ITEMS ===== */
.checklist-item {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  padding: 12px 16px;
  margin-bottom: 8px;
  background: var(--card-bg);
  border-radius: 16px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 8px rgba(124, 111, 160, 0.06);
}

.checklist-item:active {
  transform: scale(0.98);
  box-shadow: 0 1px 4px rgba(124, 111, 160, 0.04);
}

.check-circle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2.5px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.checklist-item.checked .check-circle {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border: none;
}

.checklist-item.checked .check-circle::after {
  content: '';
  width: 7px;
  height: 11px;
  border: solid white;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
  margin-top: -2px;
}

.item-label {
  flex: 1;
  font-size: 15px;
  line-height: 1.4;
  font-weight: 500;
}

.checklist-item.checked .item-label {
  opacity: 0.35;
  text-decoration: line-through;
}

.item-counter {
  font-size: 11px;
  font-weight: 600;
  color: var(--cat-diet);
  background: var(--success-light);
  padding: 3px 10px;
  border-radius: 10px;
  white-space: nowrap;
}

/* ===== MONTHLY TIP CARDS ===== */
.cat-tips {
  background: var(--primary-light);
}

.tip-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  margin: 6px 0;
  background: var(--primary-light);
  border-radius: 14px;
  border-left: 3px solid var(--primary);
  cursor: pointer;
  transition: transform 0.15s;
}

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

.tip-text {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
  font-style: italic;
}

/* ===== DETAIL SCREEN ===== */
.detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--header-height);
  padding: 0 20px;
  background: var(--bg);
}

.detail-header span {
  font-size: 17px;
  font-weight: 600;
  color: var(--primary-dark);
}

.detail-body {
  padding: 20px;
  overflow-y: auto;
  height: calc(100% - var(--header-height));
}

.detail-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

.detail-arabic {
  font-family: 'Noto Nastaliq Urdu', serif;
  font-size: 24px;
  line-height: 2.4;
  direction: rtl;
  text-align: right;
  color: var(--text-primary);
  margin: 12px 0;
  padding: 16px;
  background: var(--primary-light);
  border-radius: 12px;
}

.detail-english {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin: 12px 0;
  white-space: pre-wrap;
}

.detail-meta {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 4px 0;
}

.detail-action {
  margin-top: 24px;
}

.detail-action .btn-primary {
  max-width: 100%;
}

.btn-completed {
  width: 100%;
  padding: 14px 24px;
  background: var(--success);
  color: white;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  opacity: 0.6;
}

/* ===== SETTINGS ===== */
.settings-body {
  padding: 20px;
  overflow-y: auto;
  height: calc(100% - var(--header-height));
}

.setting-group {
  margin-bottom: 24px;
}

.setting-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.setting-hint {
  font-size: 13px;
  color: var(--primary);
  margin-top: 8px;
  font-weight: 600;
}

/* ===== INSTALL INSTRUCTIONS ===== */
.install-steps {
  background: var(--primary-light);
  border-radius: 14px;
  padding: 16px;
}

.install-steps p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.5;
}

.install-steps .install-browser {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 12px;
}

.install-steps ol {
  list-style: none;
  counter-reset: steps;
  padding: 0;
  margin: 0;
}

.install-steps ol li {
  counter-increment: steps;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  padding: 6px 0 6px 32px;
  position: relative;
}

.install-steps ol li::before {
  content: counter(steps);
  position: absolute;
  left: 0;
  width: 22px;
  height: 22px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  top: 7px;
}

.install-steps .install-hint {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 10px;
  font-style: italic;
}

/* ===== MONTH VIEW ===== */
.month-selector-wrap {
  text-align: center;
  padding: 16px 0 8px;
}

.month-selector {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.month-selector-label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 6px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.month-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--card-bg);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.month-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border: none;
  color: white;
}

.month-btn.current {
  border-color: var(--primary);
  color: var(--primary);
}

/* Summary card */
.month-summary {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 0;
  margin: 12px 0 8px;
  box-shadow: 0 2px 8px rgba(124, 111, 160, 0.06);
}

.month-summary-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.month-summary-num {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.month-summary-label {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.month-summary-divider {
  width: 1px;
  height: 32px;
  background: var(--border);
}

/* Section titles */
.month-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 24px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

/* Category groups within daily */
.month-cat-group {
  margin-bottom: 16px;
}

.month-cat-header {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  padding: 8px 0 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.month-cat-count {
  font-size: 11px;
  color: var(--text-secondary);
  background: var(--primary-light);
  padding: 1px 7px;
  border-radius: 10px;
}

/* Day groups within weekly */
.month-day-group {
  margin-bottom: 12px;
}

.month-day-header {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  padding: 8px 0 4px;
}

/* Month items */
.month-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 4px;
  font-size: 14px;
  background: var(--card-bg);
  border-radius: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 1px 4px rgba(124, 111, 160, 0.04);
  transition: transform 0.15s;
}

.month-item:active {
  transform: scale(0.98);
}

.month-item-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.month-item-dot.quran { background: var(--cat-quran); }
.month-item-dot.duas { background: var(--cat-duas); }
.month-item-dot.diet { background: var(--cat-diet); }
.month-item-dot.actions { background: var(--cat-actions); }

.month-item-text {
  font-size: 14px;
  line-height: 1.4;
  font-weight: 500;
}

/* Highlights */
.month-highlight {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 8px 0;
  box-shadow: 0 2px 8px rgba(124, 111, 160, 0.06);
}

.month-highlight-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.month-highlight p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ===== ONGOING VIEW ===== */
.ongoing-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 20px 0 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--border);
}

.ongoing-section-hint {
  font-size: 12px;
  color: var(--text-secondary);
  margin: -4px 0 12px;
  line-height: 1.4;
}

.ongoing-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 8px rgba(124, 111, 160, 0.06);
  transition: transform 0.15s;
}

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

.ongoing-card-title {
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.ongoing-card-title .cat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cat-dot.quran { background: var(--cat-quran); }
.cat-dot.duas { background: var(--cat-duas); }
.cat-dot.diet { background: var(--cat-diet); }
.cat-dot.actions { background: var(--cat-actions); }

.ongoing-progress {
  position: relative;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}

.ongoing-progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.ongoing-progress-fill.normal { background: linear-gradient(90deg, var(--primary), var(--accent)); }
.ongoing-progress-fill.complete { background: linear-gradient(90deg, var(--success), #A8E6C0); }

.ongoing-counter {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: right;
  margin-bottom: 6px;
}

.ongoing-schedule {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  gap: 12px;
  align-items: center;
}

.ongoing-schedule-btn {
  background: var(--primary-light);
  color: var(--primary);
  border: none;
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  transition: background 0.2s;
}

.ongoing-schedule-btn:active {
  background: var(--border);
}

/* Manual counter */
.manual-counter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 8px 0 6px;
}

.manual-counter-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  font-size: 18px;
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}

.manual-counter-btn:active {
  transform: scale(0.9);
}

.manual-counter-btn.minus {
  background: var(--border);
  color: var(--text-secondary);
}

.manual-counter-btn.plus {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
}

.manual-counter-value {
  min-width: 48px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}

.ongoing-card.completed {
  opacity: 0.5;
}

.ongoing-card.completed .ongoing-card-title::after {
  content: ' \2014 done';
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 400;
}

.streak-badge {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
}

.streak-warning {
  font-size: 12px;
  color: var(--danger);
  margin-top: 4px;
}

.duration-start-btn {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  margin-top: 4px;
  transition: opacity 0.2s;
}

.duration-start-btn:active {
  opacity: 0.85;
}

.ongoing-onetime-item {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 52px;
  padding: 10px 14px;
  margin-bottom: 6px;
  background: var(--card-bg);
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(124, 111, 160, 0.04);
  transition: transform 0.15s;
}

.ongoing-onetime-item:active {
  transform: scale(0.98);
}

.ongoing-onetime-item.checked .check-circle {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border: none;
}

.ongoing-onetime-item.checked .check-circle::after {
  content: '';
  width: 7px;
  height: 11px;
  border: solid white;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
  margin-top: -2px;
}

.ongoing-onetime-item.checked .item-label {
  opacity: 0.35;
  text-decoration: line-through;
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(46, 38, 64, 0.4);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(2px);
}

.modal-overlay.hidden {
  display: none;
}

.modal-sheet {
  background: var(--card-bg);
  border-radius: 20px 20px 0 0;
  padding: 24px 20px;
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-sheet h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--primary-dark);
}

.modal-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.modal-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  margin-top: 16px;
}

.toggle-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.toggle-grid-7 {
  /* 7 items per row */
}

.toggle-btn {
  width: 44px;
  height: 44px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--card-bg);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.toggle-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border: none;
  color: white;
}

.selector-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.calculator-text {
  font-size: 13px;
  margin: 16px 0;
  padding: 12px;
  border-radius: 12px;
  background: #FEF3C7;
  color: #92400E;
}

.calculator-text.success {
  background: var(--success-light);
  color: #065F46;
}

.modal-actions {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-actions .btn-primary {
  max-width: 100%;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-secondary);
}

.empty-state p {
  font-size: 15px;
}

/* ===== DAY TOGGLE ===== */
.day-toggle {
  display: flex;
  gap: 0;
  background: var(--border);
  border-radius: 12px;
  padding: 3px;
  margin-bottom: 16px;
}

.day-toggle-btn {
  flex: 1;
  padding: 8px 16px;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  background: transparent;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.day-toggle-btn.active {
  background: var(--card-bg);
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(124, 111, 160, 0.1);
}

/* ===== UTILITIES ===== */
.hidden {
  display: none !important;
}

/* scrollbar styling */
#tab-content::-webkit-scrollbar {
  width: 3px;
}
#tab-content::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

/* ===== RESPONSIVE ===== */
@media (min-width: 480px) {
  #tab-content {
    max-width: 480px;
    margin: 0 auto;
  }
}

/* ===== THEME TOGGLE ===== */
.theme-toggle {
  display: flex;
  gap: 0;
  background: var(--border);
  border-radius: 12px;
  padding: 3px;
}

.theme-btn {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  background: transparent;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.theme-btn.active {
  background: var(--card-bg);
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(124, 111, 160, 0.1);
}

/* ===== DARK THEME ===== */
html.dark {
  --primary: #A99BC8;
  --primary-dark: #C8BCe0;
  --primary-light: #2A2438;
  --accent: #D48AAD;
  --accent-light: #2D2028;
  --bg: #1A1622;
  --card-bg: #231E2E;
  --text-primary: #E8E4F0;
  --text-secondary: #8A8098;
  --border: #332D40;
  --success: #6AB889;
  --success-light: #1E2B22;
  --warning: #D4A93A;
  --danger: #D4576E;
  --cat-quran: #A99BC8;
  --cat-duas: #D48AAD;
  --cat-diet: #6AB889;
  --cat-actions: #6DA4C4;
}

html.dark .btn-google {
  background: var(--card-bg);
  border-color: var(--border);
}

html.dark .month-btn {
  background: var(--card-bg);
}

html.dark .modal-sheet {
  background: var(--card-bg);
}

html.dark .modal-overlay {
  background: rgba(0, 0, 0, 0.6);
}

html.dark .calculator-text {
  background: #2D2618;
  color: #D4A93A;
}

html.dark .calculator-text.success {
  background: var(--success-light);
  color: var(--success);
}

html.dark .section-header.cat-duas .cat-badge { background: var(--accent-light); color: var(--accent); }
html.dark .section-header.cat-diet .cat-badge { background: var(--success-light); color: var(--success); }
html.dark .section-header.cat-actions .cat-badge { background: #1E2630; color: var(--cat-actions); }

html.dark img.welcome-logo,
html.dark img.header-logo {
  filter: brightness(1.3);
}
