 {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #eef4fb;
  --card: #ffffff;
  --text: #1f2a37;
  --muted: #667085;
  --border: #d8e3f0;
  --primary: #4a7bd0;
  --primary-dark: #3460aa;
  --success: #4aa36c;
  --shadow: 0 10px 30px rgba(31, 42, 55, 0.08);
}

body.dark {
  --bg: #101826;
  --card: #182233;
  --text: #eef3fb;
  --muted: #9ba8bc;
  --border: #2a3750;
  --primary: #78a6ff;
  --primary-dark: #5f8ae0;
  --success: #58b883;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background: linear-gradient(180deg, var(--bg), #f8fbff);
  color: var(--text);
  min-height: 100vh;
  padding: 24px;
}

.page-shell {
  max-width: 1080px;
  margin: 0 auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
}

.eyebrow {
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 8px;
}


h1 {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  line-height: 1.15;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 999px;
  padding: 12px 16px;
  cursor: pointer;
  box-shadow: var(--shadow);
}


.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

main {
  display: grid;
  gap: 20px;
}

.hero {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  padding: 24px;
}

.hero-text h2 {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.date-text,
.hero-note,
.section-subtitle,
.empty-state,
.about-section p,
.quote-box p,
.stat-card p,
.section-head p {
  color: var(--muted);
}

.date-text {
  margin-bottom: 10px;
}

.quote-box {
  padding: 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(74, 123, 208, 0.12), rgba(74, 163, 108, 0.12));
}

.quote-label {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.controls,
.habits-section,
.progress-section,
.about-section {
  padding: 24px;
}

.input-row,
.filter-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-row {
  margin-top: 14px;
}

input[type="text"] {
  flex: 1;
  min-width: 220px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  padding: 14px 16px;
  font-size: 1rem;
}

input[type="text"]::placeholder {
  color: var(--muted);
}

button {
  font: inherit;
}





#addHabitBtn {
  border: none;
  background: var(--primary);
  color: white;
  border-radius: 14px;
  padding: 14px 18px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

#addHabitBtn:hover,
.filter-btn:hover,
.habit-action:hover,
.theme-toggle:hover {
  transform: translateY(-1px);
}

#addHabitBtn:hover {
  background: var(--primary-dark);
}

.filter-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-btn,
.habit-action {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}


.filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.stat-card {
  padding: 20px;
}

.stat-card h3 {
  font-size: 2rem;
  margin-top: 10px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.progress-bar {
  height: 16px;
  border-radius: 999px;
  background: #dde6f2;
  overflow: hidden;
  margin: 10px 0 14px;
}

body.dark .progress-bar {
  background: #26334b;
}

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

.celebration-message {
  color: var(--success);
  font-weight: 700;
}

.habit-list {
  display: grid;
  gap: 14px;
}


.habit-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(74, 123, 208, 0.03);
}

.habit-item.completed {
  background: rgba(74, 163, 108, 0.08);
}

.habit-item.completed .habit-name {
  text-decoration: line-through;
  color: var(--muted);
}

.habit-info {
  min-width: 0;
}

.habit-name {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 4px;
  word-break: break-word;
}

.habit-status {
  font-size: 0.92rem;
  color: var(--muted);
}

.habit-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.habit-action.delete {
  border-color: #f0b7bd;
  color: #b94a57;
}

.habit-action.edit {
  border-color: #c9d7f3;
  color: var(--primary-dark);
}

.habit-check {
  width: 20px;
  height: 20px;
  accent-color: var(--success);
}

.empty-state {
  text-align: center;
  padding: 24px 12px;
}

.about-section p {
  line-height: 1.7;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}


@media (max-width: 820px) {
  .hero,
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body {
    padding: 14px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .controls,
  .habits-section,
  .progress-section,
  .about-section,
  .hero {
    padding: 18px;
  }

  .habit-item {
    grid-template-columns: 1fr;
  }

  .habit-actions {
    justify-content: flex-start;
  }
}



