:root {
  --bg-page: #eef2f7;
  --bg-surface: #ffffff;
  --bg-accent: #0f172a;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --border-subtle: #d6deea;
  --shadow-soft: 0 10px 24px rgba(15, 23, 42, 0.08);
  --radius-card: 14px;
  --radius-control: 10px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: linear-gradient(160deg, #f8fafc 0%, var(--bg-page) 100%);
  color: var(--text-primary);
}

.app-shell {
  max-width: 980px;
  margin: 0 auto;
  padding: 2rem 1.2rem 2.5rem;
}

.dashboard-header {
  background: var(--bg-accent);
  color: #f8fafc;
  border-radius: var(--radius-card);
  padding: 1.6rem 1.4rem;
  box-shadow: var(--shadow-soft);
}

.dashboard-header h1 {
  margin: 0;
  font-size: clamp(1.35rem, 2.8vw, 2rem);
  letter-spacing: 0.01em;
}

.dashboard-header p {
  margin: 0.55rem 0 0;
  color: #cbd5e1;
  font-size: 0.98rem;
}

main {
  margin-top: 1.2rem;
}

.stats-grid {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-soft);
}

.stat-card h2 {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.stat-value {
  margin: 0.45rem 0 0;
  font-size: 1.8rem;
  font-weight: 700;
}

.task-panel {
  margin-top: 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 1rem;
  box-shadow: var(--shadow-soft);
}

.task-panel-header h2 {
  margin: 0;
  font-size: 1.2rem;
}

.task-panel-header p {
  margin: 0.35rem 0 0;
  color: var(--text-secondary);
}

.task-form {
  display: flex;
  gap: 0.7rem;
  margin-top: 0.95rem;
}

.task-form input {
  flex: 1;
  border: 1px solid #b6c1d1;
  border-radius: var(--radius-control);
  padding: 0.7rem 0.75rem;
  font-size: 0.98rem;
}

.task-form input:focus {
  outline: 2px solid #93c5fd;
  outline-offset: 1px;
  border-color: #64748b;
}

.task-form button {
  border: 0;
  border-radius: var(--radius-control);
  background: #0f172a;
  color: #f8fafc;
  padding: 0.72rem 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 120ms ease, opacity 120ms ease;
}

.task-form button:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}

.task-list {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.6rem;
}

.task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
  background: #fbfdff;
  padding: 0.65rem 0.75rem;
}

.task-main {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.task-main input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: #0f172a;
}

.task-text {
  word-break: break-word;
}

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

.delete-btn {
  border: 1px solid #c6d2e1;
  border-radius: 8px;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0.35rem 0.55rem;
}

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

.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: 760px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .task-form {
    flex-direction: column;
  }

  .task-form button {
    width: 100%;
  }
}
