* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Arial, sans-serif;
  color: #1f2937;
  background: #eef2f7;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 70px 20px;
}

.date-card {
  width: min(650px, 100%);
  background: #ffffff;
  padding: 18px 28px;
  border-radius: 14px;
  border: 1px solid #d9e2ec;
  box-shadow: 0 18px 45px rgba(31, 41, 55, 0.12);
  box-sizing: border-box;

  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.date-card label {
  font-size: 13px;
  color: #6b7280;
  font-weight: 600;
}

.date-card input[type="date"] {
  min-width: 0;
  max-width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #111827;
  font-size: 15px;
  outline: none;
  cursor: pointer;
  transition: 0.2s ease;
  box-sizing: border-box;
}

.date-card input[type="date"]:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.date-card input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
}
.todo-box {
  width: min(650px, 100%);
  background: #ffffff;
  padding: 28px;
  border-radius: 14px;
  border: 1px solid #d9e2ec;
  box-shadow: 0 18px 45px rgba(31, 41, 55, 0.12);
}

h1 {
  margin: 0 0 22px;
  text-align: center;
  font-size: 32px;
  color: #111827;
}

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

.stats-div {
  min-height: 88px;
  padding: 14px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

.stats-title,
.stats-value {
  margin: 0;
  text-align: center;
}

.stats-title {
  font-size: 13px;
  line-height: 1.3;
  color: #6b7280;
}

.stats-value {
  font-size: 24px;
  font-weight: 700;
  color: #2563eb;
}

.input-row {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

input[type="text"] {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 15px;
  outline: none;
}

input[type="text"]:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

button {
  border: 0;
  border-radius: 8px;
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
}

#add_button {
  background: #2563eb;
  color: #ffffff;
}

#add_button:hover {
  background: #1d4ed8;
}

.delete {
  margin-left: auto;
  background: #ef4444;
  color: #ffffff;
}

.delete:hover {
  background: #dc2626;
}

.todo-list {
  list-style: none;
  padding: 0;
  margin-bottom: 20px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
}

.todo-list li {
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #e5e7eb;
  background: #ffffff;
}

.todo-list li:last-child {
  border-bottom: 0;
}

.todo-list span {
  flex: 1;
  line-height: 1.4;
  min-width: 0;
  overflow-wrap: anywhere;
}

.check {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: #2563eb;
}

@media (max-width: 560px) {
  body {
    justify-content: flex-start;
    padding: 18px 12px 28px;
  }

  .date-card,
  .todo-box {
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 12px 30px rgba(31, 41, 55, 0.1);
  }

  .date-row,
  .input-row {
    flex-direction: column;
  }

  .date-card input[type="date"],
  input[type="text"],
  .date-row button,
  .input-row button {
    width: 100%;
  }

  h1 {
    margin-bottom: 18px;
    font-size: 26px;
  }

  .stats {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .stats-div {
    min-height: 76px;
    padding: 12px 10px;
  }

  .todo-list li {
    gap: 10px;
    padding: 12px;
  }

  .delete {
    width: auto;
    margin-left: 4px;
    padding: 10px 12px;
  }
}

.input-error {
  margin-top: -10px;
  margin-bottom: 16px;
  color: #ef4444;
  font-size: 14px;
  text-align: center;
}



.date-row {
  display: flex;
  width: 100%;
  min-width: 0;
  gap: 10px;
}

#apply_date_button {
  background: #2563eb;
  color: white;
  white-space: nowrap;
}

#apply_date_button:hover {
  background: #1d4ed8;
}

#no_todos_message{
  text-align: center;
}

.chart-container {
  width: min(650px, 100%);
  height: 320px;
  padding: 28px;
  margin-bottom: 18px;
  background: #ffffff;
  border: 1px solid #d9e2ec;
  border-radius: 14px;
  box-shadow: 0 18px 45px rgba(31, 41, 55, 0.12);
}

#myChart {
  width: 100% !important;
  height: 100% !important;
}

@media (max-width: 560px) {
  .chart-container {
    height: 280px;
    padding: 18px;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(31, 41, 55, 0.1);
  }
}

.hidden {
  display: none;
}
