:root {
  --bg: #f2f4f8;
  --text-main: #1d2433;
  --text-muted: #64718b;
  --surface: #ffffff;
  --surface-soft: #f7f9fc;
  --line: #dbe2ee;
  --primary: #2d6df6;
  --primary-strong: #1f55c4;
  --danger: #d53f4f;
  --success: #0f9f75;
  --warning: #dd8d1a;
  --shadow: 0 18px 45px rgba(38, 62, 109, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  color: var(--text-main);
  background: radial-gradient(circle at 15% 10%, #ffffff 0%, #eef3fb 35%, #edf1f8 100%);
}

.layout-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
}

.shape-one {
  width: 420px;
  height: 420px;
  background: rgba(45, 109, 246, 0.14);
  top: -120px;
  left: -100px;
}

.shape-two {
  width: 380px;
  height: 380px;
  background: rgba(15, 159, 117, 0.12);
  bottom: -120px;
  right: -100px;
}

.shape-three {
  width: 260px;
  height: 260px;
  background: rgba(221, 141, 26, 0.12);
  top: 30%;
  right: 26%;
}

.app-shell {
  width: min(1100px, 92vw);
  margin: 3rem auto;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.1rem;
  position: relative;
  z-index: 1;
}

.card {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.overview {
  padding: 1.35rem;
  display: grid;
  align-content: start;
  gap: 1.1rem;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 0.72rem;
  color: var(--primary);
  font-weight: 700;
}

h1 {
  margin: 0;
  font: 700 clamp(1.9rem, 3vw, 2.4rem) / 1.05 "Space Grotesk", sans-serif;
}

.subtitle {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.45;
}

.summary-card {
  background: linear-gradient(145deg, #2d6df6 0%, #4d83fa 100%);
  border-radius: 18px;
  color: #fff;
  padding: 1rem;
}

.summary-card p,
.summary-card small {
  margin: 0;
  opacity: 0.9;
}

.summary-card strong {
  display: block;
  font-size: 2rem;
  margin: 0.2rem 0;
  font-family: "Space Grotesk", sans-serif;
}

.legend {
  display: grid;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot.high {
  background: var(--danger);
}

.dot.medium {
  background: var(--warning);
}

.dot.low {
  background: var(--success);
}

.workspace {
  display: grid;
  gap: 1rem;
}

.composer,
.toolbar,
.list-panel {
  padding: 1rem;
}

.composer form {
  display: grid;
  grid-template-columns: 1fr 140px auto;
  gap: 0.7rem;
}

input[type="text"],
select {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
  color: var(--text-main);
  padding: 0.82rem 0.9rem;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(45, 109, 246, 0.16);
}

button {
  border: 0;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.composer button {
  background: var(--primary);
  color: #fff;
  padding: 0.8rem 1rem;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.filters {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.25rem;
  display: inline-flex;
  gap: 0.3rem;
}

.filter-btn {
  background: transparent;
  border-radius: 999px;
  padding: 0.5rem 0.92rem;
  color: var(--text-muted);
}

.filter-btn.active {
  background: var(--primary);
  color: #fff;
}

.ghost-btn {
  background: #fff1f3;
  color: var(--danger);
  padding: 0.6rem 0.9rem;
  border: 1px solid #ffd6dd;
}

.todo-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.65rem;
}

.todo-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.85rem;
  align-items: center;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.78rem;
}

.todo-item.done {
  border-color: #b4e5d7;
  background: #effaf6;
}

.check-wrap {
  position: relative;
  width: 22px;
  height: 22px;
}

.todo-check {
  opacity: 0;
  width: 0;
  height: 0;
}

.check-custom {
  position: absolute;
  inset: 0;
  border-radius: 6px;
  border: 1px solid #aab7cc;
  background: #fff;
}

.todo-check:checked + .check-custom {
  background: var(--success);
  border-color: var(--success);
}

.todo-check:checked + .check-custom::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
}

.todo-main-row {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  align-items: center;
}

.todo-title {
  margin: 0;
  font-weight: 600;
}

.todo-item.done .todo-title {
  text-decoration: line-through;
  color: #5a977f;
}

.todo-priority {
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.71rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.todo-priority.high {
  background: #ffecef;
  color: #be3a4b;
}

.todo-priority.medium {
  background: #fff5e6;
  color: #b66f0f;
}

.todo-priority.low {
  background: #e7f8f2;
  color: #157756;
}

.todo-date {
  color: var(--text-muted);
}

.todo-actions {
  display: inline-flex;
  gap: 0.4rem;
}

.icon-btn {
  background: #fff;
  border: 1px solid var(--line);
  padding: 0.42rem 0.62rem;
  color: #3e4e6a;
}

.delete-btn {
  border-color: #ffd6dd;
  color: var(--danger);
}

.empty-state {
  display: none;
  margin: 1rem 0 0;
  text-align: center;
  color: var(--text-muted);
}

.empty-state.visible {
  display: block;
}

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

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
    margin-top: 1.2rem;
  }

  .overview {
    gap: 0.8rem;
  }
}

@media (max-width: 700px) {
  .composer form {
    grid-template-columns: 1fr;
  }

  .toolbar {
    align-items: stretch;
  }

  .filters {
    width: 100%;
    justify-content: space-between;
  }

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

  .todo-actions {
    grid-column: 2 / -1;
    justify-content: flex-end;
  }
}
