:root {
  --bg: #eef3f9;
  --surface: #ffffff;
  --surface-soft: #f8fbff;
  --border: #dbe5f0;
  --text: #102033;
  --muted: #62748a;
  --blue: #2563eb;
  --blue-600: #1d4ed8;
  --blue-50: #eaf2ff;
  --green: #16a34a;
  --green-50: #eaf8ef;
  --red: #dc2626;
  --red-50: #fef2f2;
  --amber: #d97706;
  --amber-50: #fff7ed;
  --shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 32%),
    linear-gradient(180deg, #f5f8fc 0%, var(--bg) 100%);
  color: var(--text);
  font: 16px/1.5 Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

button, input, textarea, select { font: inherit; }

.back-row {
  padding: 12px 20px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.back-btn:hover {
  color: var(--blue-600);
  border-color: #bfd3f5;
}

.reminders-main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 8px 20px 40px;
}

.hero-card,
.list-shell {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(219, 229, 240, 0.92);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.hero-card {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
}

.hero-card h1 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.1;
}

.hero-text {
  max-width: 620px;
  margin: 10px 0 0;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 16px;
}

.hero-stats {
  display: flex;
  gap: 12px;
}

.stat-pill {
  min-width: 102px;
  padding: 12px 14px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 16px;
  text-align: center;
}

.stat-label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
}

.stat-pill strong {
  display: block;
  font-size: 1.4rem;
  margin-top: 2px;
}

.primary-btn,
.ghost-btn,
.card-action,
.pin-toggle,
.modal-btn {
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.primary-btn {
  padding: 12px 18px;
  background: linear-gradient(135deg, var(--blue) 0%, #3b82f6 100%);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.24);
}

.primary-btn:hover,
.ghost-btn:hover,
.card-action:hover,
.pin-toggle:hover,
.modal-btn:hover {
  transform: translateY(-1px);
}

.list-shell {
  padding: 18px;
}

.reminders-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.empty-state {
  padding: 54px 18px;
  text-align: center;
  color: var(--muted);
}

.empty-state h2 {
  margin: 0 0 6px;
  color: var(--text);
}

.reminder-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
}

.reminder-card:hover {
  border-color: #bfd3f5;
  box-shadow: 0 14px 36px rgba(37, 99, 235, 0.08);
}

.reminder-card.pinned {
  border-color: #bfd3f5;
  background: linear-gradient(180deg, #ffffff 0%, #f4f8ff 100%);
}

.reminder-card.done {
  opacity: 0.75;
  background: linear-gradient(180deg, #fafafa 0%, #f2f4f7 100%);
}

.reminder-main {
  min-width: 0;
}

.reminder-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--muted);
}

.meta-pill.pinned-pill {
  background: var(--blue-50);
  color: var(--blue);
  border-color: #cfe0ff;
}

.meta-pill.done-pill {
  background: var(--green-50);
  color: var(--green);
  border-color: #ccefd8;
}

.meta-pill.deadline-pill.overdue {
  background: var(--red-50);
  color: var(--red);
  border-color: #fecaca;
}

.meta-pill.deadline-pill.upcoming {
  background: var(--amber-50);
  color: var(--amber);
  border-color: #fed7aa;
}

.reminder-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.reminder-title.placeholder-title {
  color: var(--muted);
}

.reminder-description {
  margin: 8px 0 12px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-word;
}

.reminder-bike {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 8px 10px;
  border-radius: 12px;
  background: #f8fbff;
  border: 1px solid var(--border);
  color: var(--text);
}

.bike-label {
  font-size: 0.82rem;
  color: var(--muted);
}

.bike-value {
  font-weight: 600;
}

.reminder-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.pin-toggle {
  min-width: 42px;
  min-height: 42px;
  padding: 0 12px;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--muted);
}

.pin-toggle.pinned {
  color: var(--blue);
  border-color: #bfd3f5;
  background: var(--blue-50);
}

.card-action {
  min-width: 132px;
  padding: 11px 14px;
  font-weight: 700;
}

.card-action.done-action {
  background: var(--blue);
  color: #fff;
}

.card-action.delete-action {
  background: #ef4444;
  color: #fff;
}

.created-at {
  font-size: 0.8rem;
  color: var(--muted);
}

.list-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 18px 8px 8px;
}

.list-status {
  font-size: 0.9rem;
  color: var(--muted);
}

.ghost-btn {
  padding: 10px 16px;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 600;
}

.scroll-sentinel {
  width: 100%;
  height: 2px;
}

.toast-root {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1200;
}

.toast {
  min-width: 220px;
  max-width: 320px;
  padding: 12px 14px;
  background: rgba(16, 32, 51, 0.96);
  color: #fff;
  border-radius: 14px;
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.22);
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.42);
  z-index: 1300;
}

.modal-card {
  width: min(680px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border-radius: 24px;
  border: 1px solid var(--border);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 22px 22px 14px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.35rem;
}

.modal-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
}

.modal-body {
  padding: 18px 22px 22px;
}

.form-grid {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  font-weight: 600;
  color: var(--text);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  outline: none;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: #bfd3f5;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.field textarea {
  min-height: 132px;
  resize: vertical;
}

.field-note {
  font-size: 0.82rem;
  color: var(--muted);
}

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

.modal-btn {
  padding: 11px 16px;
  font-weight: 700;
}

.modal-btn.secondary {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
}

.modal-btn.primary {
  background: var(--blue);
  color: #fff;
}

@media (max-width: 860px) {
  .hero-card {
    flex-direction: column;
  }

  .hero-actions {
    align-items: stretch;
  }

  .hero-stats {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .reminders-main {
    padding-left: 14px;
    padding-right: 14px;
  }

  .list-shell,
  .hero-card {
    border-radius: 20px;
  }

  .reminder-card {
    grid-template-columns: 1fr;
  }

  .reminder-actions {
    align-items: stretch;
  }

  .card-action,
  .pin-toggle {
    width: 100%;
  }

  .modal-header,
  .modal-body {
    padding-left: 16px;
    padding-right: 16px;
  }

  .modal-actions {
    flex-direction: column-reverse;
  }

  .modal-btn {
    width: 100%;
  }
}
