:root {
  --violet: #6d28d9;
  --violet-dark: #5b21b6;
  --violet-soft: #ede9fe;
  --gold: #f59e0b;
  --green: #16a34a;
  --bg: #f6f5fb;
  --card: #ffffff;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #ececf3;
  --danger: #dc2626;
  --radius: 18px;
  --shadow: 0 6px 20px rgba(76, 29, 149, 0.08);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  padding-bottom: 96px;
}

/* ---- Topbar ---- */
.topbar {
  background: linear-gradient(135deg, var(--violet), var(--violet-dark));
  color: #fff;
  padding: calc(env(safe-area-inset-top) + 18px) 16px 18px;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 4px 16px rgba(76, 29, 149, 0.25);
}
.topbar__inner { max-width: 640px; margin: 0 auto; }
.topbar h1 { margin: 0; font-size: 1.3rem; }
.topbar__sub { margin: 2px 0 0; font-size: 0.82rem; opacity: 0.85; }

/* ---- Layout ---- */
.container { max-width: 640px; margin: 0 auto; padding: 16px; }

/* ---- Próxima destacada ---- */
.proxima {
  background: linear-gradient(135deg, #fff, #faf5ff);
  border: 1.5px solid var(--violet-soft);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.proxima::before {
  content: "PRÓXIMA BENDICIÓN";
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--violet);
  background: var(--violet-soft);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.proxima h2 { margin: 0 0 4px; font-size: 1.35rem; }

/* ---- Tabs ---- */
.tabs {
  display: flex;
  gap: 6px;
  background: #eceaf4;
  padding: 5px;
  border-radius: 14px;
  margin-bottom: 16px;
}
.tab {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 10px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--muted);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
}
.tab.is-active { background: #fff; color: var(--violet); box-shadow: 0 1px 4px rgba(0,0,0,0.08); }

/* ---- Cards ---- */
.lista { display: flex; flex-direction: column; gap: 12px; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 15px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.card--hecha { opacity: 0.72; }

.card__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.card__title { margin: 0; font-size: 1.1rem; line-height: 1.25; }

.badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge--cat { background: var(--violet-soft); color: var(--violet-dark); }
.badge--hoy { background: #fee2e2; color: var(--danger); }
.badge--pronto { background: #fef3c7; color: #92400e; }
.badge--lejos { background: #e0e7ff; color: #3730a3; }
.badge--paso { background: #f3f4f6; color: var(--muted); }
.badge--hecha { background: #dcfce7; color: #166534; }

.meta { margin: 10px 0 0; display: flex; flex-direction: column; gap: 5px; font-size: 0.88rem; color: var(--muted); }
.meta a { color: var(--violet); text-decoration: none; font-weight: 600; }
.card__desc { margin: 10px 0 0; font-size: 0.9rem; color: #374151; }

/* ---- Asistentes ---- */
.asis { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.asis__lbl { font-size: 0.78rem; color: var(--muted); margin-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  background: #f1f0f8;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chip button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 0.9rem; padding: 0; line-height: 1; }

/* ---- Acciones ---- */
.card__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.btn {
  border: 0;
  border-radius: 11px;
  padding: 9px 13px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn--primary { background: var(--violet); color: #fff; width: 100%; justify-content: center; padding: 13px; font-size: 1rem; }
.btn--voy { background: var(--green); color: #fff; }
.btn--ghost { background: #f1f0f8; color: var(--ink); }
.btn--done { background: #dcfce7; color: #166534; }
.btn--del { background: transparent; color: var(--danger); margin-left: auto; }
.btn:active { transform: scale(0.97); }

/* ---- FAB ---- */
.fab {
  position: fixed;
  right: 18px;
  bottom: calc(env(safe-area-inset-bottom) + 18px);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 0;
  background: linear-gradient(135deg, var(--violet), var(--violet-dark));
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  box-shadow: 0 8px 24px rgba(109, 40, 217, 0.45);
  cursor: pointer;
  z-index: 30;
}
.fab:active { transform: scale(0.92); }

/* ---- Vacío ---- */
.vacio { text-align: center; color: var(--muted); padding: 40px 16px; font-size: 0.95rem; }

/* ---- Modal ---- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(31, 41, 55, 0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 40;
  animation: fade 0.2s;
}
@keyframes fade { from { opacity: 0; } }
.modal__sheet {
  background: #fff;
  width: 100%;
  max-width: 640px;
  border-radius: 22px 22px 0 0;
  padding: 18px 18px calc(env(safe-area-inset-bottom) + 24px);
  max-height: 92vh;
  overflow-y: auto;
  animation: up 0.25s ease;
}
.modal__sheet--sm { border-radius: 22px; margin: auto 12px; align-self: center; }
@keyframes up { from { transform: translateY(40px); opacity: 0.5; } }
.modal__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal__head h2 { margin: 0; font-size: 1.15rem; }
.modal__close { border: 0; background: #f1f0f8; width: 34px; height: 34px; border-radius: 50%; font-size: 1rem; cursor: pointer; }

/* ---- Form ---- */
.form { display: flex; flex-direction: column; gap: 13px; }
.form label { display: flex; flex-direction: column; gap: 5px; font-size: 0.82rem; font-weight: 600; color: #374151; }
.form input, .form textarea {
  border: 1.5px solid var(--line);
  border-radius: 11px;
  padding: 12px;
  font-size: 1rem;
  font-family: inherit;
  background: #fbfbfe;
}
.form input:focus, .form textarea:focus { outline: none; border-color: var(--violet); background: #fff; }
.form__row { display: flex; gap: 10px; }
.form__row label { flex: 1; }

/* ---- Toast ---- */
.toast {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom) + 90px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 11px 18px;
  border-radius: 12px;
  font-size: 0.88rem;
  z-index: 50;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  animation: up 0.2s;
}
