/* ── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Base ──────────────────────────────────────────────────────── */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #0f172a;
  color: #e2e8f0;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }

/* ── Site header ───────────────────────────────────────────────── */
.site-header {
  background: #0a0f1e;
  border-bottom: 1px solid #1e293b;
  padding: 0.75rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.site-header .brand { color: #38bdf8; font-weight: 600; font-size: 0.95rem; }
.header-left { display: flex; gap: 1.25rem; align-items: center; }
.site-header nav { display: flex; gap: 0.9rem; align-items: center; }
.nav-main { color: #94a3b8; font-size: 0.95rem; }
.nav-main:hover { color: #e2e8f0; }
.nav-main.nav-active { color: #e2e8f0; font-weight: 600; }
.nav-user { color: #64748b; font-size: 0.85rem; }
.inline-form { display: inline; }

/* ── Page ──────────────────────────────────────────────────────── */
.page { max-width: 640px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }
.page-title { font-size: 1.3rem; margin-bottom: 0.35rem; }
.page-hint { color: #64748b; font-size: 0.85rem; margin-bottom: 1rem; }
.section-title {
  font-size: 0.78rem; color: #64748b; text-transform: uppercase;
  letter-spacing: 0.07em; margin: 1.75rem 0 0.5rem;
}

/* ── Add form ──────────────────────────────────────────────────── */
.add-form { margin: 1rem 0 1.25rem; }
.add-row { display: flex; gap: 0.5rem; }
.add-row input[type="text"] {
  flex: 1; min-width: 0;
  background: #1e293b; border: 1px solid #334155; border-radius: 6px;
  color: #e2e8f0; padding: 0.6rem 0.75rem; font-size: 0.95rem; font-family: inherit;
}
.add-row select {
  background: #1e293b; border: 1px solid #334155; border-radius: 6px;
  color: #e2e8f0; padding: 0.6rem 0.5rem; font-size: 0.9rem; font-family: inherit;
}
.add-row input:focus, .add-row select:focus, .add-notes textarea:focus {
  outline: none; border-color: #38bdf8;
}
.add-notes { margin-top: 0.5rem; }
.add-notes summary { color: #64748b; font-size: 0.8rem; cursor: pointer; }
.add-notes textarea {
  width: 100%; margin-top: 0.4rem;
  background: #1e293b; border: 1px solid #334155; border-radius: 6px;
  color: #e2e8f0; padding: 0.5rem 0.75rem; font-size: 0.88rem; font-family: inherit;
  resize: vertical;
}

/* ── Filters ───────────────────────────────────────────────────── */
.filter-row { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin-bottom: 1rem; }
.filter-sep { width: 1px; height: 1.1rem; background: #334155; margin: 0 0.35rem; }
.chip {
  color: #94a3b8; font-size: 0.8rem;
  border: 1px solid #334155; border-radius: 999px;
  padding: 0.2rem 0.7rem;
}
.chip:hover { color: #e2e8f0; border-color: #475569; }
.chip-active { color: #0f172a; background: #38bdf8; border-color: #38bdf8; font-weight: 600; }
.chip-active:hover { color: #0f172a; }

/* ── Item list ─────────────────────────────────────────────────── */
.item-list { list-style: none; }
.item {
  display: flex; align-items: center; gap: 0.65rem;
  background: #0a0f1e; border: 1px solid #1e293b; border-radius: 8px;
  padding: 0.6rem 0.75rem; margin-bottom: 0.4rem;
}
.item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; }
.item-title { font-size: 0.95rem; overflow-wrap: anywhere; }
.item-notes { color: #64748b; font-size: 0.8rem; white-space: pre-line; overflow-wrap: anywhere; }
.item-done .item-title { text-decoration: line-through; color: #64748b; }
.item-list-done .item { opacity: 0.75; }

.check {
  width: 1.5rem; height: 1.5rem; flex-shrink: 0;
  border: 1.5px solid #475569; border-radius: 50%;
  background: transparent; color: #34d399;
  font-size: 0.85rem; line-height: 1; cursor: pointer;
}
.check:hover { border-color: #34d399; }
.check.checked { border-color: #34d399; }

.author-chip {
  width: 1.5rem; height: 1.5rem; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: 0.72rem; font-weight: 700;
}
.chip-me { background: rgba(56,189,248,0.16); color: #38bdf8; }
.chip-partner { background: rgba(244,114,182,0.16); color: #f472b6; }

.type-badge {
  flex-shrink: 0; font-size: 0.68rem; text-transform: uppercase;
  letter-spacing: 0.05em; color: #94a3b8;
  border: 1px solid #334155; border-radius: 4px; padding: 0.1rem 0.4rem;
}

.archive-btn { color: #475569; font-size: 0.85rem; }
.archive-btn:hover { color: #f87171; }

.empty-state { color: #64748b; font-size: 0.9rem; padding: 1.5rem 0; text-align: center; }

/* ── Buttons ───────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 0.45rem 1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s;
  font-family: inherit;
}
.btn:hover { opacity: 0.85; }
.btn-primary { background: #38bdf8; color: #0f172a; font-weight: 600; }
.btn-text { background: none; border: none; color: #64748b; font-size: 0.8rem; cursor: pointer; font-family: inherit; padding: 0; }
.btn-text:hover { color: #e2e8f0; }

/* ── Auth card ─────────────────────────────────────────────────── */
.auth-card {
  background: #0a0f1e;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 360px;
}
.auth-brand {
  display: block; text-align: center;
  color: #38bdf8; font-weight: 600; font-size: 1.1rem; margin-bottom: 0.4rem;
}
.auth-subtitle { text-align: center; color: #64748b; font-size: 0.85rem; margin-bottom: 2rem; }

/* ── Form fields ───────────────────────────────────────────────── */
.field { margin-bottom: 1.1rem; }
.field label {
  display: block; font-size: 0.78rem; color: #94a3b8;
  text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 0.4rem;
}
.field input[type="text"],
.field input[type="password"] {
  width: 100%;
  background: #1e293b; border: 1px solid #334155; border-radius: 6px;
  color: #e2e8f0; padding: 0.6rem 0.75rem; font-size: 0.9rem; font-family: inherit;
}
.field input:focus { outline: none; border-color: #38bdf8; }

/* ── Errors ────────────────────────────────────────────────────── */
.errorlist { list-style: none; color: #f87171; font-size: 0.8rem; margin-top: 0.3rem; }
.error-banner {
  background: #450a0a; border: 1px solid #f87171; border-radius: 8px;
  color: #fca5a5; padding: 0.85rem 1.1rem; margin-bottom: 1.5rem;
}

/* ── Confirm modal ─────────────────────────────────────────────── */
#confirm-overlay {
  display: none; position: fixed; inset: 0; z-index: 950;
  background: rgba(0,0,0,0.6); align-items: center; justify-content: center; padding: 1rem;
}
#confirm-overlay.open { display: flex; }
.confirm-box {
  background: #0f172a; border: 1px solid #253351; border-radius: 12px;
  padding: 1.5rem; max-width: 380px; width: 100%;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
}
.confirm-title { font-size: 1rem; font-weight: 600; color: #e6edf8; margin-bottom: 0.5rem; }
.confirm-body { font-size: 0.85rem; color: #8a9bb5; margin-bottom: 1.25rem; line-height: 1.55; }
.confirm-actions { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.confirm-cancel {
  background: transparent; border: 1px solid #253351; color: #8a9bb5;
  padding: 0.45rem 0.9rem; border-radius: 8px; font-size: 0.84rem;
  cursor: pointer; font-family: inherit;
}
.confirm-cancel:hover { color: #e6edf8; border-color: #3f4e6a; }
.confirm-ok {
  background: rgba(248,113,113,0.12); color: #f87171;
  border: 1px solid rgba(248,113,113,0.35);
  padding: 0.45rem 0.9rem; border-radius: 8px; font-size: 0.84rem;
  cursor: pointer; font-family: inherit;
}
.confirm-ok:hover { background: rgba(248,113,113,0.22); }

/* ── Small screens ─────────────────────────────────────────────── */
@media (max-width: 480px) {
  .header-left { gap: 0.9rem; }
  .add-row { flex-wrap: wrap; }
  .add-row input[type="text"] { flex-basis: 100%; }
}
