/* ── Variables Element & Style ─────────────────────────────────────────── */
:root {
  --es-purple: #682AAA;
  --es-deep:   #2D1245;
  --es-pink:   #F9A8D4;
  --es-lilac:  #C084FC;
  --es-bg:     #fdfaff;
  --p-03:  rgba(104,42,170,.03);
  --p-06:  rgba(104,42,170,.06);
  --p-10:  rgba(104,42,170,.10);
  --p-20:  rgba(104,42,170,.20);
  --p-40:  rgba(104,42,170,.40);
  --p-55:  rgba(104,42,170,.55);
}

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

body {
  font-family: 'Outfit', system-ui, sans-serif;
  background: var(--es-bg);
  color: var(--es-deep);
  min-height: 100dvh;
}

/* ── Google Fonts ────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=Playfair+Display:ital,wght@0,400;0,500;1,400;1,500&display=swap');

/* ── Header ──────────────────────────────────────────────────────────────── */
.app-header {
  background: #fff;
  border-bottom: 1px solid var(--p-06);
  padding: 0 32px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 12px rgba(104,42,170,.06);
}
.app-header img { height: 22px; width: auto; }
.app-header .title {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  color: var(--es-deep);
  font-weight: 400;
  letter-spacing: -0.01em;
}
.app-header .spacer { flex: 1; }
.app-header .badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--p-40);
}

/* ── Main container ──────────────────────────────────────────────────────── */
.app-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* ── Page title ──────────────────────────────────────────────────────────── */
.page-top {
  display: flex;
  align-items: baseline;
  gap: 20px;
  margin-bottom: 32px;
}
.page-top h1 {
  font-family: 'Playfair Display', serif;
  font-size: 36px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--es-deep);
  line-height: 1;
}
.page-top .spacer { flex: 1; }

/* ── Botón nuevo informe ─────────────────────────────────────────────────── */
.btn-new {
  appearance: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--es-purple);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 9999px;
  transition: opacity .15s, transform .1s;
  white-space: nowrap;
}
.btn-new:hover { opacity: .88; }
.btn-new:active { transform: scale(.97); }
.btn-new svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ── Estado vacío ────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 72px 24px;
  color: var(--p-40);
}
.empty-state .icon {
  width: 56px; height: 56px;
  background: var(--p-06);
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.empty-state .icon svg { width: 26px; height: 26px; opacity: .6; }
.empty-state h2 {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 400;
  color: var(--es-deep);
  margin-bottom: 8px;
}
.empty-state p { font-size: 14px; color: var(--p-55); }

/* ── Grid de tarjetas ────────────────────────────────────────────────────── */
.reports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 20px;
}

/* ── Tarjeta ─────────────────────────────────────────────────────────────── */
.report-card {
  background: #fff;
  border: 1px solid var(--p-06);
  border-radius: 18px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  transition: box-shadow .18s, border-color .18s, transform .12s;
  position: relative;
}
.report-card:hover {
  box-shadow: 0 8px 32px rgba(104,42,170,.12);
  border-color: var(--p-20);
  transform: translateY(-2px);
}
.report-card .card-season {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.report-card .season-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.report-card .season-name {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--p-40);
}
.report-card .client-name {
  font-family: 'Playfair Display', serif;
  font-size: 26px;
  font-weight: 400;
  color: var(--es-deep);
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.report-card .client-name.empty {
  color: var(--p-20);
  font-style: italic;
}
.report-card .card-meta {
  font-size: 12px;
  color: var(--p-40);
  display: flex;
  align-items: center;
  gap: 10px;
}
.report-card .card-meta .dot { color: var(--p-20); }
.report-card .card-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.card-btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 9999px;
  transition: opacity .12s;
}
.card-btn.primary {
  background: var(--es-purple);
  color: #fff;
  flex: 1;
}
.card-btn.primary:hover { opacity: .85; }
.card-btn.ghost {
  background: var(--p-06);
  color: var(--p-55);
}
.card-btn.ghost:hover { background: var(--p-10); }

/* ── Delete confirm overlay ──────────────────────────────────────────────── */
.delete-confirm {
  position: absolute;
  inset: 0;
  background: rgba(253,250,255,.96);
  border-radius: inherit;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
  z-index: 2;
}
.delete-confirm.visible { display: flex; }
.delete-confirm p {
  font-size: 14px;
  color: var(--es-deep);
  line-height: 1.4;
}
.delete-confirm .del-actions { display: flex; gap: 8px; }
.delete-confirm .btn-cancel {
  background: var(--p-06);
  color: var(--p-55);
}
.delete-confirm .btn-confirm-del {
  background: #b3261e;
  color: #fff;
}

/* ── Loading spinner ─────────────────────────────────────────────────────── */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px;
}
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--p-10);
  border-top-color: var(--es-purple);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast ───────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--es-deep);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 9999px;
  opacity: 0;
  transition: opacity .2s, transform .2s;
  pointer-events: none;
  white-space: nowrap;
  z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .app-header { padding: 0 18px; }
  .app-main { padding: 32px 16px 60px; }
  .page-top h1 { font-size: 28px; }
  .reports-grid { grid-template-columns: 1fr; }
}
