* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: linear-gradient(135deg, #eef4ff 0%, #f8fbff 45%, #edf2f7 100%);
  color: #1f2937;
  min-height: 100vh;
  overflow: hidden;
}

.app-wrapper {
  width: min(1180px, 94%);
  height: 100vh;
  margin: 0 auto;
  padding: 18px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hero {
  background: linear-gradient(135deg, #0f172a, #1d4ed8);
  color: white;
  border-radius: 22px;
  padding: 24px 30px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.22);
}

.badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  margin-bottom: 8px;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: 38px;
  line-height: 1;
}

.hero p {
  margin: 0;
  max-width: 850px;
  font-size: 15px;
  line-height: 1.5;
  color: #dbeafe;
}

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

.stat-card {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(203, 213, 225, 0.75);
  border-radius: 18px;
  padding: 14px 18px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.07);
}

.stat-card span {
  display: block;
  color: #64748b;
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 4px;
}

.stat-card strong {
  font-size: 28px;
  color: #1d4ed8;
}

.dashboard {
  flex: 1;
  display: grid;
  grid-template-columns: 0.8fr 1.4fr;
  gap: 16px;
  min-height: 0;
}

.panel {
  background: rgba(255, 255, 255, 0.93);
  border: 1px solid rgba(203, 213, 225, 0.75);
  border-radius: 22px;
  padding: 20px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  min-height: 0;
}

.add-panel {
  height: fit-content;
}

.tasks-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.panel h2 {
  margin: 0 0 6px;
  color: #0f172a;
  font-size: 22px;
}

.panel-text {
  margin: 0 0 14px;
  color: #64748b;
  line-height: 1.45;
  font-size: 14px;
}

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

input {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  font-size: 14px;
  outline: none;
  transition: 0.2s ease;
  background: #f8fafc;
}

input:focus {
  border-color: #2563eb;
  background: white;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

button {
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  transition: 0.2s ease;
  white-space: nowrap;
}

.primary-btn {
  padding: 12px 18px;
  background: #1d4ed8;
  color: white;
}

.primary-btn:hover {
  background: #1e40af;
  transform: translateY(-1px);
}

.secondary-btn {
  padding: 10px 14px;
  background: #e0ecff;
  color: #1d4ed8;
}

.secondary-btn:hover {
  background: #cfe0ff;
}

.section-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 8px;
}

#taskList {
  list-style: none;
  padding: 0;
  margin: 0;
  overflow-y: auto;
  max-height: 300px;
  padding-right: 4px;
}

.task-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 5px solid #2563eb;
  padding: 12px 14px;
  border-radius: 15px;
  margin-bottom: 9px;
  transition: 0.2s ease;
}

.task-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.task-title {
  font-weight: 700;
  color: #0f172a;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.task-date {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: 11px;
}

.completed .task-title {
  text-decoration: line-through;
  color: #64748b;
}

.completed {
  border-left-color: #16a34a;
  background: #f0fdf4;
}

.actions {
  display: flex;
  gap: 7px;
}

.done-btn {
  padding: 8px 11px;
  background: #dcfce7;
  color: #166534;
}

.done-btn:hover {
  background: #bbf7d0;
}

.delete-btn {
  padding: 8px 11px;
  background: #fee2e2;
  color: #991b1b;
}

.delete-btn:hover {
  background: #fecaca;
}

.loading,
.empty-state {
  text-align: center;
  color: #64748b;
  padding: 18px;
  border: 1px dashed #cbd5e1;
  border-radius: 15px;
  background: #f8fafc;
  font-size: 14px;
}

.empty-state {
  display: none;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #64748b;
  font-size: 13px;
  padding: 0 4px;
}

@media (max-width: 900px) {
  body {
    overflow: auto;
  }

  .app-wrapper {
    height: auto;
  }

  .stats-grid,
  .dashboard {
    grid-template-columns: 1fr;
  }

  #taskList {
    max-height: none;
  }
}
