/* ============================================================
   Panel parroquial · Primera Comunión
   CSS mínimo, limpio y profesional
   ============================================================ */

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

body {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: .9rem;
  line-height: 1.55;
  background: #f4f4f0;
  color: #1a1a1a;
  min-height: 100vh;
}

a { color: #2d5a1b; }
a:hover { color: #1a3a10; }

/* ── Header ───────────────────────────────────────────────── */
.panel-header {
  background: #2d3b2a;
  color: #f0ecd8;
  border-bottom: 3px solid #c9a227;
  position: sticky;
  top: 0;
  z-index: 100;
}

.panel-header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: .7rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.panel-logo {
  color: #c9a227;
  font-weight: 700;
  font-size: .95rem;
  text-decoration: none;
  letter-spacing: .03em;
  white-space: nowrap;
  flex-shrink: 0;
}
.panel-logo:hover { color: #e0b840; }

.panel-nav {
  display: flex;
  gap: .25rem;
  flex: 1;
}

.panel-nav a {
  color: #c5c0b0;
  text-decoration: none;
  font-size: .83rem;
  padding: .3rem .65rem;
  border-radius: .3rem;
  transition: background .15s, color .15s;
}
.panel-nav a:hover { background: rgba(255,255,255,.1); color: #fff; }
.panel-nav a.active { background: rgba(201,162,39,.2); color: #c9a227; }

/* ── Main ─────────────────────────────────────────────────── */
.panel-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.75rem 1.5rem 3rem;
}

/* ── Page header ──────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #111;
  line-height: 1.3;
}

.page-subtitle {
  font-size: .82rem;
  color: #6b7280;
  margin-top: .2rem;
}

/* ── Card ─────────────────────────────────────────────────── */
.card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: .5rem;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

/* ── Botones ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .95rem;
  border-radius: .35rem;
  font-size: .84rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.btn:focus-visible { outline: 2px solid #c9a227; outline-offset: 2px; }

.btn-primary { background: #2d3b2a; color: #fff; border-color: #2d3b2a; }
.btn-primary:hover { background: #1e2a1c; border-color: #1e2a1c; color: #fff; }

.btn-gold { background: #c9a227; color: #fff; border-color: #c9a227; }
.btn-gold:hover { background: #b08c1e; border-color: #b08c1e; color: #fff; }

.btn-outline { background: transparent; color: #374151; border-color: #d1d5db; }
.btn-outline:hover { background: #f9fafb; color: #111; }

.btn-danger { background: transparent; color: #dc2626; border-color: #dc2626; }
.btn-danger:hover { background: #fef2f2; }

.btn-sm { padding: .28rem .6rem; font-size: .78rem; }

/* ── Alertas / Flash ──────────────────────────────────────── */
.alert {
  padding: .75rem 1.1rem;
  border-radius: .4rem;
  margin-bottom: 1.1rem;
  font-size: .85rem;
  border-left: 4px solid transparent;
  display: flex;
  align-items: flex-start;
  gap: .6rem;
}

.alert-success { background: #f0fdf4; border-color: #16a34a; color: #14532d; }
.alert-error   { background: #fef2f2; border-color: #dc2626; color: #7f1d1d; }
.alert-warning { background: #fffbeb; border-color: #d97706; color: #78350f; }
.alert-info    { background: #eff6ff; border-color: #2563eb; color: #1e3a8a; }

/* ── Tabla ────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: .855rem; }

thead th {
  background: #f9fafb;
  text-align: left;
  font-size: .71rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #6b7280;
  padding: .65rem .9rem;
  border-bottom: 2px solid #e5e7eb;
  white-space: nowrap;
}

tbody td {
  padding: .7rem .9rem;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #fafaf7; }

/* ── Badges de estado ─────────────────────────────────────── */
.badge {
  display: inline-block;
  font-size: .68rem;
  font-weight: 700;
  padding: .2rem .6rem;
  border-radius: 9999px;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.badge-borrador  { background: #f3f4f6; color: #6b7280; }
.badge-activo    { background: #dcfce7; color: #166534; }
.badge-cerrado   { background: #fee2e2; color: #991b1b; }
.badge-archivado { background: #ede9fe; color: #5b21b6; }

/* Alias para cuando el valor sea "abierto" */
.badge-abierto   { background: #dcfce7; color: #166534; }

/* ── Formularios ──────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.35rem;
}

.form-group { display: flex; flex-direction: column; gap: .32rem; }
.form-group.full { grid-column: 1 / -1; }

label {
  font-size: .82rem;
  font-weight: 600;
  color: #374151;
}
.req { color: #dc2626; margin-left: .15rem; }

input[type="text"],
input[type="date"],
input[type="time"],
input[type="number"],
select,
textarea {
  padding: .48rem .75rem;
  border: 1.5px solid #d1d5db;
  border-radius: .35rem;
  font-size: .875rem;
  font-family: inherit;
  color: #1a1a1a;
  background: #fff;
  width: 100%;
  transition: border-color .15s, box-shadow .15s;
  appearance: auto;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #c9a227;
  box-shadow: 0 0 0 3px hsla(44, 66%, 46%, .12);
}

input.is-invalid,
select.is-invalid,
textarea.is-invalid {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px hsla(0, 84%, 60%, .1);
}

input:disabled, input[readonly] {
  background: #f9fafb;
  color: #9ca3af;
  cursor: not-allowed;
}

.field-hint  { font-size: .74rem; color: #9ca3af; line-height: 1.4; }
.field-error { font-size: .74rem; color: #dc2626; font-weight: 600; }

/* ── Footer del formulario ────────────────────────────────── */
.form-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding-top: 1.35rem;
  border-top: 1px solid #f3f4f6;
  margin-top: 1.35rem;
  flex-wrap: wrap;
}

.form-actions .ml-auto { margin-left: auto; }

/* ── Tarjetas del dashboard ───────────────────────────────── */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.dash-card {
  background: #fff;
  border: 1.5px solid #e5e7eb;
  border-radius: .5rem;
  padding: 1.35rem 1.25rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: .45rem;
  transition: border-color .2s, box-shadow .2s, transform .1s;
}

.dash-card:hover {
  border-color: #c9a227;
  box-shadow: 0 4px 14px hsla(44, 66%, 46%, .12);
  transform: translateY(-1px);
}

.dash-card-icon  { font-size: 1.6rem; }
.dash-card-title { font-weight: 700; font-size: .95rem; color: #111; }
.dash-card-desc  { font-size: .8rem; color: #6b7280; line-height: 1.45; }

/* ── Stat inline ──────────────────────────────────────────── */
.stat-gold { font-weight: 700; color: #b08c1e; font-size: 1rem; }

/* ── Secciones del formulario (Fase 3+) ───────────────────── */
.form-section { margin-bottom: 2rem; }
.form-section:last-of-type { margin-bottom: 0; }

.form-section-title {
  font-size: .73rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #9ca3af;
  padding-bottom: .55rem;
  border-bottom: 2px solid #f3f4f6;
  margin-bottom: 1.15rem;
}

.form-section-title.accent {
  color: #2d3b2a;
  border-color: #c9a227;
}

/* ── Resumen del grupo (cabecera en páginas de menores) ───── */
.grupo-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: center;
}

.grupo-summary-field {
  display: flex;
  flex-direction: column;
  gap: .18rem;
}

.grupo-summary-label {
  font-size: .67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #9ca3af;
}

.grupo-summary-value {
  font-size: .9rem;
  font-weight: 600;
  color: #1a1a1a;
}

.grupo-summary-value.highlight {
  color: #b08c1e;
  font-size: 1.1rem;
}

/* ── Badges de modalidad ──────────────────────────────────── */
.badge-conjunta  { background: #dbeafe; color: #1e40af; }
.badge-separada  { background: #fce7f3; color: #9d174d; }

/* ── Vacío ────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #9ca3af;
}
.empty-state p { margin-bottom: .75rem; font-size: .9rem; }

/* ── Footer ───────────────────────────────────────────────── */
.panel-footer {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.1rem 1.5rem;
  border-top: 1px solid #e5e7eb;
  font-size: .73rem;
  color: #b0b0b0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 640px) {
  .panel-header-inner { padding: .6rem 1rem; gap: 1rem; }
  .panel-main { padding: 1.25rem 1rem 2rem; }
  .form-grid  { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; gap: .75rem; }
  .form-actions { gap: .5rem; }
  .form-actions .ml-auto { margin-left: 0; width: 100%; text-align: right; }
}
