* {
  box-sizing: border-box;
}

:root {
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --green: #16a34a;
  --red: #dc2626;
  --ink: #1a1a1a;
  --muted: #6b7280;
  --border: #e5e7eb;
  --card: #ffffff;
  --bg: #f4f5f7;
}

body {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, #1c2b3a, #16212c);
  color: white;
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar h1 {
  font-size: 1.15rem;
  margin: 0;
  letter-spacing: 0.01em;
}

.link-btn {
  background: none;
  border: none;
  color: #cfe3ff;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
}

.link-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 1rem 1.1rem 3rem;
}

.add-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}

.add-form textarea {
  padding: 0.7rem 0.8rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
  resize: vertical;
  font-family: inherit;
}

.primary-btn {
  background: var(--blue);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1rem;
  font-size: 0.95rem;
  cursor: pointer;
  align-self: flex-end;
}

.primary-btn:hover {
  background: var(--blue-dark);
}

.secondary-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.8rem;
  cursor: pointer;
}

.danger-btn {
  background: var(--red);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.5rem 0.9rem;
  cursor: pointer;
}

.hint {
  color: var(--muted);
  font-size: 0.9rem;
  font-style: italic;
}

.note-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.note-entry {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.8rem 0.9rem;
}

.note-entry input[type='checkbox'] {
  margin-top: 0.3rem;
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
}

.note-entry.done .note-text {
  text-decoration: line-through;
  color: var(--muted);
}

.note-body {
  flex: 1;
  min-width: 0;
}

.note-meta {
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
}

.note-text {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.note-entry textarea {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-family: inherit;
  resize: vertical;
}

.note-actions {
  display: flex;
  gap: 0.2rem;
  flex-shrink: 0;
}

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--muted);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
}

.icon-btn:hover {
  background: #e5e7eb;
  color: var(--ink);
}

.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #1c2b3a, #16212c);
}

.login-card {
  background: white;
  border-radius: 14px;
  padding: 2rem 1.8rem;
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.login-card h1 {
  margin: 0 0 0.3rem;
  font-size: 1.3rem;
  text-align: center;
}

.login-card label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.login-card input {
  padding: 0.6rem 0.7rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
}

.login-card button {
  background: var(--blue);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.65rem;
  font-size: 1rem;
  cursor: pointer;
  margin-top: 0.3rem;
}

.error {
  color: var(--red);
  font-size: 0.85rem;
  margin: 0;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.confirm-card {
  background: white;
  border-radius: 12px;
  padding: 1.4rem;
  max-width: 320px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1rem;
}
