/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Hind Siliguri', sans-serif;
  background: #022c22;
  color: #ecfdf5;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font-family: 'Hind Siliguri', sans-serif; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: 'Hind Siliguri', sans-serif; }
.arabic { font-family: 'Amiri', serif; direction: rtl; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: #022c22; }
::-webkit-scrollbar-thumb { background: #059669; border-radius: 2px; }

/* ===== APP SHELL ===== */
#app { display: flex; flex-direction: column; min-height: 100vh; }

/* ===== HEADER ===== */
#header {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: rgba(2,44,34,0.96);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(16,185,129,0.15);
}
#app-title { font-size: 17px; font-weight: 700; color: #6ee7b7; line-height: 1.2; }
#app-date { font-size: 11px; color: #065f46; margin-top: 2px; }
#header-icon { font-size: 24px; }

/* ===== MAIN CONTENT ===== */
#main-content { flex: 1; overflow-y: auto; padding-bottom: 80px; }

/* ===== BOTTOM NAV ===== */
#bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-around;
  padding: 6px 2px 8px;
  background: rgba(2,44,34,0.97);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(16,185,129,0.2);
}
.nav-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 4px 6px; border-radius: 12px;
  transition: all 0.2s; color: #1a5c3a; min-width: 0;
}
.nav-btn.active { color: #34d399; background: rgba(16,185,129,0.15); }
.nav-icon { font-size: 18px; line-height: 1; }
.nav-label { font-size: 9px; font-weight: 500; white-space: nowrap; }

/* ===== GLASS CARD ===== */
.card {
  background: rgba(6,78,59,0.35);
  border: 1px solid rgba(16,185,129,0.15);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
}
.card-title { font-size: 18px; font-weight: 700; color: #a7f3d0; margin-bottom: 4px; }
.card-sub { font-size: 13px; color: #059669; }

/* ===== SECTION ===== */
.section { padding: 16px 16px 0; }

/* ===== PROGRESS BAR ===== */
.progress-wrap { background: rgba(6,78,59,0.4); border-radius: 999px; height: 8px; overflow: hidden; margin: 8px 0; }
.progress-fill { height: 100%; border-radius: 999px; transition: width 0.5s ease; background: #059669; }
.progress-fill.gold { background: #f59e0b; }

/* ===== GRID ===== */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }

/* ===== STAT CARD ===== */
.stat-card {
  background: rgba(6,78,59,0.35);
  border: 1px solid rgba(16,185,129,0.12);
  border-radius: 14px; padding: 14px 12px;
  text-align: center; cursor: pointer;
  transition: all 0.2s;
}
.stat-card:active { transform: scale(0.96); }
.stat-num { font-size: 22px; font-weight: 700; color: #6ee7b7; }
.stat-label { font-size: 11px; color: #065f46; margin-top: 2px; }
.stat-sub { font-size: 12px; color: #047857; margin-top: 2px; }

/* ===== BUTTONS ===== */
.btn-primary {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 12px 20px; border-radius: 12px;
  background: linear-gradient(135deg, #059669, #047857);
  color: #fff; font-size: 14px; font-weight: 600;
  transition: all 0.2s; border: none; cursor: pointer;
}
.btn-primary:active { transform: scale(0.97); opacity: 0.9; }
.btn-secondary {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 10px 16px; border-radius: 12px;
  background: rgba(6,78,59,0.4); border: 1px solid rgba(16,185,129,0.2);
  color: #6ee7b7; font-size: 13px; font-weight: 500;
  transition: all 0.2s; cursor: pointer;
}
.btn-secondary:active { transform: scale(0.97); }
.btn-sm {
  padding: 6px 14px; border-radius: 10px; font-size: 12px; font-weight: 500;
  background: rgba(6,78,59,0.5); border: 1px solid rgba(16,185,129,0.2);
  color: #6ee7b7; transition: all 0.2s; cursor: pointer;
}
.btn-sm.active { background: #059669; color: #fff; border-color: #059669; }
.btn-sm:active { transform: scale(0.95); }

/* ===== INPUTS ===== */
.inp {
  width: 100%; padding: 10px 14px; border-radius: 10px;
  background: rgba(6,78,59,0.3);
  border: 1px solid rgba(16,185,129,0.2);
  color: #ecfdf5; font-family: 'Hind Siliguri', sans-serif;
  font-size: 14px; transition: border-color 0.2s; outline: none;
}
.inp:focus { border-color: #059669; box-shadow: 0 0 0 3px rgba(5,150,105,0.12); }
.inp::placeholder { color: #065f46; }
select.inp option { background: #064e3b; color: #ecfdf5; }
.inp-label { font-size: 12px; color: #047857; display: block; margin-bottom: 4px; }

/* ===== TOGGLE ===== */
.toggle-wrap { display: flex; align-items: center; justify-content: space-between; padding: 4px 0; }
.toggle-track {
  width: 46px; height: 26px; border-radius: 999px;
  background: #064e3b; border: 1px solid rgba(16,185,129,0.2);
  position: relative; cursor: pointer; transition: background 0.2s; flex-shrink: 0;
}
.toggle-track.on { background: #059669; border-color: #059669; }
.toggle-thumb {
  position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #6ee7b7; transition: transform 0.2s;
}
.toggle-track.on .toggle-thumb { transform: translateX(20px); background: #fff; }

/* ===== HEATMAP ===== */
.heatmap { display: flex; flex-wrap: wrap; gap: 5px; }
.hm-cell { width: 22px; height: 22px; border-radius: 4px; background: rgba(16,185,129,0.07); transition: transform 0.15s; }
.hm-cell:hover { transform: scale(1.3); }
.hm-1 { background: rgba(16,185,129,0.2); }
.hm-2 { background: rgba(16,185,129,0.4); }
.hm-3 { background: rgba(16,185,129,0.65); }
.hm-4 { background: rgba(16,185,129,0.9); }

/* ===== SALAH PILLS ===== */
.salah-row { display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: 14px; margin-bottom: 8px; background: rgba(6,78,59,0.25); border: 1px solid rgba(16,185,129,0.1); transition: all 0.2s; }
.salah-row.done { background: rgba(5,150,105,0.15); border-color: rgba(16,185,129,0.3); }
.salah-emoji { font-size: 22px; width: 32px; text-align: center; flex-shrink: 0; }
.salah-info { flex: 1; }
.salah-name { font-size: 15px; font-weight: 600; color: #a7f3d0; }
.salah-arabic { font-size: 12px; color: #047857; font-family: 'Amiri', serif; }
.salah-check { width: 32px; height: 32px; border-radius: 50%; border: 2px solid #1a5c3a; background: none; font-size: 16px; color: #059669; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s; flex-shrink: 0; }
.salah-check.done { background: #059669; border-color: #059669; color: #fff; }
.salah-check:active { transform: scale(0.88); }

/* ===== QUALITY PILLS ===== */
.quality-pills { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(16,185,129,0.1); }
.qpill { padding: 4px 10px; border-radius: 999px; font-size: 11px; background: rgba(6,78,59,0.5); color: #047857; border: 1px solid rgba(16,185,129,0.15); cursor: pointer; transition: all 0.15s; }
.qpill.sel { background: #059669; color: #fff; border-color: #059669; }

/* ===== DHIKR COUNTER ===== */
#dhikr-tap-area {
  width: 200px; height: 200px; border-radius: 50%;
  background: linear-gradient(135deg, #059669, #047857);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  margin: 16px auto; cursor: pointer; border: none;
  box-shadow: 0 8px 32px rgba(5,150,105,0.35);
  transition: transform 0.1s;
  color: #fff;
}
#dhikr-tap-area:active { transform: scale(0.92); }
#dhikr-count-display { font-size: 52px; font-weight: 700; line-height: 1; }
#dhikr-count-sub { font-size: 14px; opacity: 0.8; margin-top: 4px; }
.dhikr-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: 14px;
  background: rgba(6,78,59,0.25); border: 1px solid rgba(16,185,129,0.1);
  margin-bottom: 8px; cursor: pointer; transition: all 0.2s;
}
.dhikr-item:active { transform: scale(0.98); background: rgba(6,78,59,0.4); }
.dhikr-item.active { border-color: #059669; background: rgba(5,150,105,0.12); }
.dhikr-arabic { font-size: 15px; color: #f59e0b; font-family: 'Amiri', serif; }
.dhikr-prog { flex: 1; }
.dhikr-count-badge { font-size: 13px; font-weight: 700; color: #6ee7b7; min-width: 52px; text-align: right; }

/* ===== HABIT ROWS ===== */
.habit-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px; border-radius: 14px;
  background: rgba(6,78,59,0.2); border: 1px solid rgba(16,185,129,0.08);
  margin-bottom: 7px; transition: all 0.2s;
}
.habit-row.done { background: rgba(5,150,105,0.1); border-color: rgba(16,185,129,0.25); }
.habit-check { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #1a5c3a; background: none; font-size: 13px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s; flex-shrink: 0; color: transparent; }
.habit-check.done { background: #059669; border-color: #059669; color: #fff; }
.habit-check:active { transform: scale(0.85); }
.habit-name { font-size: 13px; font-weight: 500; color: #a7f3d0; flex: 1; }
.habit-row.done .habit-name { color: #047857; text-decoration: line-through; }
.habit-badge { font-size: 10px; padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.badge-must { background: rgba(16,185,129,0.15); color: #34d399; }
.badge-should { background: rgba(59,130,246,0.15); color: #93c5fd; }
.badge-elite { background: rgba(139,92,246,0.15); color: #c4b5fd; }
.habit-streak { font-size: 11px; color: #f97316; white-space: nowrap; }

/* ===== CAT HEADER ===== */
.cat-header { font-size: 12px; font-weight: 600; color: #047857; text-transform: uppercase; letter-spacing: 0.08em; margin: 16px 0 8px; padding-left: 2px; }

/* ===== FILTER PILLS ===== */
.filter-row { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; }
.filter-row::-webkit-scrollbar { height: 0; }

/* ===== INSIGHT ===== */
.insight { display: flex; align-items: flex-start; gap: 8px; padding: 12px; border-radius: 12px; background: rgba(6,78,59,0.25); margin-bottom: 8px; font-size: 13px; color: #6ee7b7; }

/* ===== STREAK BADGE ===== */
.streak-box { text-align: center; padding: 12px 8px; border-radius: 12px; background: rgba(6,78,59,0.3); }
.streak-num { font-size: 24px; font-weight: 700; color: #6ee7b7; }
.streak-label { font-size: 11px; color: #047857; margin-top: 2px; }

/* ===== PIN ===== */
#pin-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: #022c22;
  display: flex; align-items: center; justify-content: center;
}
#pin-box { text-align: center; padding: 32px 24px; }
.pin-title { font-size: 20px; font-weight: 700; color: #6ee7b7; margin-bottom: 6px; }
.pin-sub { font-size: 13px; color: #047857; margin-bottom: 24px; }
#pin-dots { display: flex; gap: 14px; justify-content: center; margin-bottom: 12px; }
.pin-dot { width: 16px; height: 16px; border-radius: 50%; background: #064e3b; border: 2px solid #059669; transition: all 0.2s; }
.pin-dot.filled { background: #059669; transform: scale(1.2); }
.pin-dot.error { background: #ef4444; border-color: #ef4444; }
#pin-keypad { display: grid; grid-template-columns: repeat(3, 72px); gap: 12px; justify-content: center; margin-top: 16px; }
.key-btn { width: 72px; height: 64px; border-radius: 16px; background: rgba(6,78,59,0.5); border: 1px solid rgba(16,185,129,0.2); color: #a7f3d0; font-size: 22px; font-family: 'Hind Siliguri', sans-serif; font-weight: 600; cursor: pointer; transition: all 0.15s; }
.key-btn:active { transform: scale(0.92); background: rgba(5,150,105,0.3); }

/* ===== TOAST ===== */
#toast {
  position: fixed; bottom: 88px; left: 50%; transform: translateX(-50%);
  background: #065f46; color: #a7f3d0; padding: 10px 20px;
  border-radius: 999px; font-size: 13px; z-index: 50;
  opacity: 0; transition: opacity 0.3s; pointer-events: none;
  white-space: nowrap; border: 1px solid rgba(16,185,129,0.3);
}
#toast.show { opacity: 1; }

/* ===== ANIMATIONS ===== */
@keyframes fadeIn { from { opacity:0; transform: translateY(12px); } to { opacity:1; transform: translateY(0); } }
.fade-in { animation: fadeIn 0.35s ease; }
@keyframes pop { 0%,100%{transform:scale(1)} 50%{transform:scale(1.18)} }
.pop { animation: pop 0.2s ease; }

/* ===== MISC ===== */
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.mt8 { margin-top: 8px; }
.mt12 { margin-top: 12px; }
.mt16 { margin-top: 16px; }
.mb8 { margin-bottom: 8px; }
.txt-muted { color: #047857; font-size: 12px; }
.txt-gold { color: #f59e0b; }
.txt-em { color: #6ee7b7; }
.fw7 { font-weight: 700; }
.f18 { font-size: 18px; }
.f22 { font-size: 22px; }
.divider { height: 1px; background: rgba(16,185,129,0.1); margin: 12px 0; }
.recent-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid rgba(16,185,129,0.08); }
.recent-row:last-child { border-bottom: none; }
.pill-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
