* {
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #eef2ff 0%, #ffffff 100%);
  color: #0f172a;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.wrap {
  width: 920px;
  max-width: 100%;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
  padding: 20px;
  border: 1px solid rgba(15, 23, 42, 0.04);
  flex-grow: 1;
}

header {
  text-align: center;
  margin-bottom: 10px;
}

h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 0.2px;
  color: #0b1220;
}

.controls {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
}

.input-text,
.input-date {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

input[type="text"],
input[type="date"],
input[type="search"],
select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  outline: none;
  font-size: 14px;
  color: #0f172a;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02) inset;
}

.btn {
  background: #4f46e5;
  color: white;
  border: none;
  padding: 12px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.12);
}

.btn:hover {
  background: #4338ca;
}

.btn.secondary {
  background: rgba(99, 102, 241, 0.08);
  color: #0b1220;
  box-shadow: none;
  border: 1px solid rgba(15, 23, 42, 0.04);
}

.btn.secondary:hover {
  background-color: #e0e0e0;
}

.btn.ghost {
  border: 1px solid rgba(15, 23, 42, 0.06);
  background-color: #ff8b8b;
  color: #0b1220;
}

.btn.ghost:hover {
  background-color: #ff5555;
}

.row {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  align-items: center;
}

.filter-box {
  display: flex;
  gap: 10px;
}

.table {
  margin-top: 16px;
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fafc, #ffffff);
  border: 1px solid rgba(15, 23, 42, 0.03);
  padding: 10px;
}

.table-header {
  display: grid;
  grid-template-columns: 1fr 180px 120px 110px;
  gap: 12px;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 700;
  color: #6b7280;
  border-bottom: 1px dashed rgba(15, 23, 42, 0.03);
  align-items: center;
}

.table-body {
  padding: 8px 8px 18px 8px;
}

.row-item {
  display: grid;
  grid-template-columns: 1fr 180px 120px 110px;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  border-radius: 10px;
  margin: 8px 6px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  border: 1px solid rgba(15, 23, 42, 0.03);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
}

.row-item > div[data-label] {
  position: relative;
}

.row-item > div[data-label]::before {
  content: attr(data-label);
  display: none;
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 6px;
}

.muted {
  color: #6b7280;
  font-size: 14px;
}

.task-title {
  font-weight: 600;
  font-size: 15px;
  color: #0b1220;
}

.actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.pill {
  padding: 8px 10px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pill.pending {
  background: #fff7ed;
  color: #92400e;
  border: 1px solid rgba(147, 64, 14, 0.06);
}

.pill.done {
  background: #ecfdf5;
  color: #166534;
  border: 1px solid rgba(22, 101, 52, 0.06);
}

.empty {
  text-align: center;
  padding: 28px;
  color: #6b7280;
  font-weight: 600;
}

.error {
  color: #ef4444;
  font-size: 13px;
  margin-top: 8px;
}

footer p {
  text-align: center;
}
footer {
  margin-top: auto;
}

@media (max-width: 980px) {
  .wrap {
    width: 95%;
  }
  .table-header,
  .row-item {
    grid-template-columns: 1fr 140px 110px 90px;
  }
}

/* Mobile adjustments */
@media (max-width: 640px) {
  body {
    padding: 12px;
  }
  .controls,
  .row {
    flex-direction: column;
    align-items: stretch;
  }
  .controls {
    gap: 10px;
  }
  .input-text,
  .input-date {
    width: 100%;
  }
  .btn {
    width: 100%;
    padding: 12px;
  }

  .row {
    gap: 8px;
  }

  .filter-box {
    flex-wrap: wrap;
  }

  .table-header {
    display: none;
  }
  .row-item {
    display: block;
    padding: 14px;
    margin: 10px 0;
  }
  .row-item > div {
    padding: 6px 0;
    border-bottom: 1px dashed rgba(15, 23, 42, 0.03);
  }
  .row-item > div:last-child {
    border-bottom: none;
  }

  .row-item > div[data-label]::before {
    display: block;
  }
  .row-item .actions {
    justify-content: flex-start;
    gap: 10px;
    margin-top: 6px;
    flex-wrap: wrap;
  }

  .actions .btn,
  .actions .btn.ghost,
  .actions .btn.secondary {
    padding: 10px 12px;
  }
}

/* small polish: focus */
input:focus,
select:focus,
button:focus {
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.08);
}
