body {
  font-family: Arial, sans-serif;
  background: #ced4dd;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  padding: 50px 30px;
  box-sizing: border-box;
}

/* 2×2 centred grid */
.page-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 28px;
  width: 100%;
  max-width: 960px;
}

.container {
  background: white;
  padding: 24px 28px;
  width: 100%;
  box-sizing: border-box;
  border-radius: 14px;
  box-shadow: 10px 8px 20px rgba(88, 83, 104, 0.25);
}

.stats-container {
  background: white;
  text-align: center;
  justify-content: center;
  align-items: center;
  padding: 28px;
  width: 100%;
  box-sizing: border-box;
  border-radius: 12px;
  box-shadow: 10px 8px 20px rgba(88, 83, 104, 0.3);
}

h1 {
  text-align: center;
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: #3a2f5e;
  margin: 0 0 18px 0;
  letter-spacing: 0.3px;
}

.add-habit {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.add-habit input {
  flex: 1;
  padding: 9px 12px;
  border: 1.5px solid #d1c4e9;
  border-radius: 8px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.add-habit input:focus {
  border-color: #7e57c2;
}

input {
  flex: 1;
  padding: 8px;
  border-radius: 10px;
}

.date {
  position: fixed;
  top: 20px;
  left: 20px;
  font-size: 14px;
}

.time {
  position: fixed;
  top: 20px;
  right: 20px;
  font-size: 14px;
}

button {
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 10px;
  box-shadow: 5px solid rgb(152, 149, 192);
  transition: all 0.2s ease;
}

button:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

/* Habit tracker Add button — matches to-do style */
#addButton {
  background: #7e57c2;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

#addButton:hover {
  background: #5e35b1;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(94, 53, 177, 0.3);
}

/* ── Habit list items ── */
#habitList li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f5f2fb;
  border-left: 3px solid #7e57c2;
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 10px;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

#habitList li:hover {
  background: #ede7f6;
  box-shadow: 0 2px 8px rgba(126, 87, 194, 0.15);
}

.habit-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #3a2f5e;
}

.streak {
  font-size: 0.85rem;
  color: #6d4c99;
}

.habit-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

#habitList li button {
  border: none;
  padding: 0;
  cursor: pointer;
  background: none;
}

#habitList li button:hover {
  transform: scale(1.15);
}



#habitList {
  list-style: none;
  padding: 0;
  margin: 0;
}

.totalContainer {
  margin-top: 16px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: #7e57c2;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}



.complete-btn {
  width: 18px;
  height: 18px;
  border: 2px solid black;
  border-radius: 4px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.complete-btn.done::after {
  content: "✔";
  font-size: 12px;
}

.weekly-graph {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 12px;
    height: 170px;
    margin-top: 20px;
}

.graph-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}

.graph-bar {
    width: 22px;
    background-color: rgb(150, 144, 167);
    border-radius: 4px;
    transition: height 0.4s ease;
}

.graph-label {
    margin-top: 6px;
    font-size: 12px;
    color: #555;
}

.today-column .graph-bar {
    background-color: rgb(118, 112, 134);
}

/* ─── Monthly Heatmap ────────────────────────────────────────────────────── */

.heatmap-container {
  background: white;
  border-radius: 14px;
  padding: 24px 28px;
  box-shadow: 10px 8px 20px rgba(88, 83, 104, 0.25);
  width: 100%;
  box-sizing: border-box;
}

.heatmap-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 12px;
}

.heatmap-header h2 {
  margin: 0;
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  font-size: 1.05rem;
  color: #3a2f5e;
  min-width: 180px;
  text-align: center;
}

.heatmap-nav-btn {
  background: #ede7f6;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 1rem;
  cursor: pointer;
  color: #4527a0;
  transition: background 0.2s ease, transform 0.15s ease;
}

.heatmap-nav-btn:hover {
  background: #d1c4e9;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(69, 39, 160, 0.2);
}

/* Day-of-week header row */
.heatmap-day-labels {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  margin-bottom: 6px;
  text-align: center;
}

.heatmap-day-labels span {
  font-size: 11px;
  color: #888;
  font-weight: 600;
  text-transform: uppercase;
}

/* The grid itself */
.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

.heatmap-cell {
  aspect-ratio: 1;
  border-radius: 5px;
  position: relative;
  cursor: default;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.heatmap-cell:hover {
  transform: scale(1.18);
  box-shadow: 0 3px 10px rgba(69, 39, 160, 0.3);
  z-index: 5;
}

.heatmap-empty {
  background: transparent !important;
  cursor: default;
}

.heatmap-empty:hover {
  transform: none;
  box-shadow: none;
}

/* Ring highlight for today */
.heatmap-today {
  outline: 2px solid #4527a0;
  outline-offset: 1px;
}

/* Day number inside cell */
.heatmap-day-num {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 600;
  pointer-events: none;
  user-select: none;
  text-shadow: 0 1px 2px rgba(0,0,0,0.25);
}

/* Legend */
.heatmap-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  margin-top: 12px;
  font-size: 11px;
  color: #888;
}

.legend-box {
  width: 14px;
  height: 14px;
  border-radius: 3px;
}

/* ─── Daily To-Do List ────────────────────────────────────────────────────── */

.todo-container {
  background: white;
  border-radius: 14px;
  padding: 24px 28px;
  box-shadow: 10px 8px 20px rgba(88, 83, 104, 0.25);
  width: 100%;
  box-sizing: border-box;
}

.todo-title {
  margin: 0 0 18px 0;
}

.todo-add-row {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.todo-add-row input {
  flex: 1;
  padding: 9px 12px;
  border: 1.5px solid #d1c4e9;
  border-radius: 8px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.todo-add-row input:focus {
  border-color: #7e57c2;
}

.todo-add-row button {
  background: #7e57c2;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.todo-add-row button:hover {
  background: #5e35b1;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(94, 53, 177, 0.3);
}

/* Task list */
.todo-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.todo-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  background: #f5f2fb;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 0;
  border-left: none;
  justify-content: flex-start;
  transition: background 0.2s;
}

.todo-item:hover {
  background: #ede7f6;
}

.todo-checkbox {
  width: 16px;
  height: 16px;
  accent-color: #7e57c2;
  cursor: pointer;
  flex-shrink: 0;
  flex-grow: 0;
  margin-right: 2px;
}

.todo-label {
  flex: 1;
  font-size: 0.9rem;
  color: #333;
  text-align: left;
  transition: color 0.2s, text-decoration 0.2s;
}

/* Strikethrough when done */
.todo-done .todo-label {
  text-decoration: line-through;
  color: #a89cc8;
}

.todo-del-btn {
  background: none;
  border: none;
  color: #bbb;
  cursor: pointer;
  font-size: 0.8rem;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
  flex-shrink: 0;
}

.todo-del-btn:hover {
  color: #e53935;
  background: #fce4ec;
  transform: none;
  box-shadow: none;
}

/* Pending tasks section */
.pending-section {
  margin-top: 20px;
  border-top: 1.5px dashed #d1c4e9;
  padding-top: 14px;
}

.pending-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #8d6e63;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 10px 0;
}

.pending-list .todo-item {
  background: #fdf6ee;
  border-left: 3px solid #ffb74d;
}

.pending-list .todo-item:hover {
  background: #fff3e0;
}