:root {
  --pink: #e85d8a;
  --bg: #fff8fa;
  --ink: #2b2230;
  --muted: #8a7f8c;
  --card: #ffffff;
  --border: #f0dbe4;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}

header h1 { font-size: 20px; margin: 0; }

.who { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); }

button {
  background: var(--pink);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
}

button:hover { opacity: 0.9; }

main { max-width: 860px; margin: 0 auto; padding: 24px; }

#loginForm {
  max-width: 320px;
  margin: 80px auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--card);
  padding: 24px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

#loginForm input {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}

.error { color: #c0392b; font-size: 13px; }

.hidden { display: none !important; }

.breadcrumbs { font-size: 14px; color: var(--muted); margin-bottom: 16px; }
.breadcrumbs a { color: var(--pink); cursor: pointer; text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.card:hover { transform: translateY(-2px); border-color: var(--pink); }

.card .emoji { font-size: 24px; }
.card .title { font-weight: 600; margin-top: 6px; }
.card .subtitle { font-size: 13px; color: var(--muted); margin-top: 2px; }

.task-list { display: flex; flex-direction: column; gap: 8px; }

.task-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
}

.task-row .title { font-weight: 500; }
.task-row .notes { font-size: 13px; color: var(--muted); margin-top: 2px; }

.badge {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 600;
  text-transform: capitalize;
}

.badge.active { background: #ffe3ee; color: var(--pink); }
.badge.todo { background: #eef0f5; color: var(--muted); }
.badge.done { background: #dff5e3; color: #2f9e51; }

.empty { color: var(--muted); font-style: italic; padding: 24px 0; text-align: center; }
.loading { color: var(--muted); padding: 24px 0; text-align: center; }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}
.toolbar .breadcrumbs { margin-bottom: 0; }

button.ghost {
  background: transparent;
  color: var(--pink);
  border: 1px solid var(--border);
}

button.icon {
  background: transparent;
  border: none;
  padding: 2px 4px;
  font-size: 14px;
  cursor: pointer;
  opacity: 0.55;
}
button.icon:hover { opacity: 1; }

.card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.row-actions { display: flex; align-items: center; gap: 4px; }
.task-main { min-width: 0; margin-right: 12px; }

button.badge { border: none; cursor: pointer; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(43, 34, 48, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.modal {
  background: var(--card);
  border-radius: 14px;
  padding: 24px;
  width: min(420px, calc(100vw - 48px));
  max-height: calc(100vh - 96px);
  overflow-y: auto;
}

.modal h3 { margin: 0 0 16px; }

.modal form { display: flex; flex-direction: column; gap: 12px; }

.modal label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
}

.modal input,
.modal textarea,
.modal select {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
}

.modal textarea { min-height: 70px; resize: vertical; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}
