@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=Work+Sans:wght@400;500;600&display=swap');

:root {
  --verde-club: #316864;
  --verde-oscuro: #234A47;
  --verde-salvia: #7A9C96;
  --lavanda: #9F97C2;
  --naranja: #C47B50;
  --crema: #FBF7F1;
  --tinta: #22201D;
  --rojo-suave: #B9524A;
  --borde: rgba(35, 74, 71, 0.18);
  --radio: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Work Sans', sans-serif;
  background: var(--crema);
  color: var(--tinta);
  min-height: 100vh;
}

h1, h2, h3, .serif {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  margin: 0;
  color: var(--verde-oscuro);
}

.oculto { display: none !important; }

.pantalla-centrada {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.tarjeta-login {
  background: #fff;
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 40px 32px;
  max-width: 380px;
  width: 100%;
  text-align: center;
}

.tarjeta-login .logo {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
}

.tarjeta-login h1 {
  font-size: 1.5rem;
  margin-bottom: 4px;
}

.subtitulo {
  color: var(--verde-salvia);
  font-size: 0.92rem;
  margin-bottom: 24px;
}

label {
  display: block;
  text-align: left;
  font-size: 0.85rem;
  color: var(--verde-oscuro);
  margin: 14px 0 6px;
}

input, select {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--borde);
  border-radius: 9px;
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--crema);
  color: var(--tinta);
}

input:focus, select:focus, button:focus-visible {
  outline: 2px solid var(--verde-salvia);
  outline-offset: 1px;
}

button {
  cursor: pointer;
  font-family: 'Work Sans', sans-serif;
  font-weight: 500;
  border: none;
  border-radius: 9px;
  padding: 12px 18px;
  font-size: 0.95rem;
  transition: transform 0.06s ease;
}

button:active { transform: scale(0.98); }

.boton-principal {
  background: var(--verde-club);
  color: #fff;
  width: 100%;
  margin-top: 22px;
}

.boton-principal:hover { background: var(--verde-oscuro); }

.boton-mini {
  padding: 6px 10px;
  font-size: 0.78rem;
  background: var(--verde-club);
  color: #fff;
}
.boton-mini:hover { background: var(--verde-oscuro); }

.boton-secundario {
  background: transparent;
  color: var(--verde-oscuro);
  border: 1px solid var(--borde);
}

.boton-chico {
  padding: 7px 12px;
  font-size: 0.82rem;
}

.error-msg {
  color: var(--rojo-suave);
  font-size: 0.85rem;
  margin-top: 12px;
  min-height: 1em;
}

/* --- Carnet --- */

.pagina-carnet {
  max-width: 480px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

.encabezado-carnet {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.carnet {
  background: var(--verde-club);
  border-radius: 22px;
  padding: 30px 24px 26px;
  position: relative;
  overflow: hidden;
  color: #fff;
  text-align: center;
  box-shadow: 0 18px 34px -18px rgba(35, 74, 71, 0.55);
}

.carnet-sello {
  width: 74px;
  height: 74px;
  margin: 0 auto 16px;
  display: block;
}

.carnet-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  margin: 0 auto;
  background: var(--lavanda);
  color: var(--verde-oscuro);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fraunces', serif;
  font-size: 1.3rem;
  font-weight: 600;
  border: 3px solid rgba(255,255,255,0.6);
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  position: relative;
}

.carnet-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carnet-avatar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(35,74,71,0.35);
  opacity: 0;
  transition: opacity 0.12s ease;
}

.carnet-avatar:hover::after,
.carnet-avatar:focus-visible::after {
  opacity: 1;
}

.acciones-foto {
  text-align: center;
  margin: 8px 0 18px;
  min-height: 1.1em;
}

.link-chico {
  background: none;
  border: none;
  padding: 0;
  color: rgba(255,255,255,0.85);
  font-size: 0.76rem;
  text-decoration: underline;
  cursor: pointer;
}

.carnet-filas {
  display: flex;
  flex-direction: column;
  gap: 9px;
  text-align: left;
}

.carnet-fila {
  background: rgba(255,255,255,0.94);
  border-radius: 8px;
  padding: 9px 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.fila-label {
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  color: var(--verde-salvia);
  white-space: nowrap;
}

.fila-valor {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--tinta);
  text-align: right;
}

.fila-valor .venc-detalle {
  display: block;
  font-size: 0.72rem;
  font-weight: 400;
  color: #776f68;
  margin-top: 1px;
}

.estado-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
}

.estado-pill.al-dia { background: #E3ECDD; color: var(--verde-oscuro); }
.estado-pill.deuda,
.estado-pill.vencida { background: #F5DEDB; color: var(--rojo-suave); }
.estado-pill.sin-datos { background: #EFECE6; color: #857c73; }

.estado-pill .punto {
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor;
}

.seccion-entrega {
  margin-top: 28px;
}

.seccion-entrega h2 {
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.seccion-entrega p {
  color: #665f58;
  font-size: 0.88rem;
  margin: 0 0 16px;
}

.lista-fechas {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.opcion-fecha {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  border: 1px solid var(--borde);
  border-radius: 11px;
  background: #fff;
  cursor: pointer;
}

.opcion-fecha.seleccionada {
  border-color: var(--verde-oscuro);
  background: #F1F4EE;
}

.opcion-fecha.no-disponible {
  opacity: 0.45;
  cursor: not-allowed;
}

.opcion-fecha .fecha-texto { font-weight: 500; }
.opcion-fecha .fecha-chip { font-size: 0.78rem; color: var(--verde-salvia); }

.vacio {
  border: 1px dashed var(--borde);
  border-radius: 11px;
  padding: 24px;
  text-align: center;
  color: #7a7169;
  font-size: 0.9rem;
}

.barra-superior {
  display: flex;
  justify-content: flex-end;
}

/* --- Admin --- */

.layout-admin {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 220px;
  background: var(--verde-club);
  color: #fff;
  padding: 26px 18px;
  display: flex;
  flex-direction: column;
}

.admin-sidebar .logo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 30px;
}

.admin-sidebar .logo-row img { width: 32px; height: 32px; }
.admin-sidebar .logo-row span { font-family: 'Fraunces', serif; font-size: 1.05rem; }

.nav-item {
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.92rem;
  margin-bottom: 4px;
  color: #E4E7E0;
}

.nav-item:hover { background: rgba(255,255,255,0.08); }
.nav-item.activo { background: rgba(255,255,255,0.16); color: #fff; }

.admin-main {
  flex: 1;
  padding: 32px 40px;
  max-width: 1000px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.panel {
  background: #fff;
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 22px 24px;
  margin-bottom: 22px;
}

.panel h3 { font-size: 1.05rem; margin-bottom: 14px; }

.form-linea {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  align-items: end;
}

.form-linea label { margin: 0 0 6px; }

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

th, td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--borde);
}

th { color: var(--verde-salvia); font-weight: 500; font-size: 0.78rem; }

td .fila-acciones { display: flex; gap: 6px; }

.chip-si { color: var(--verde-oscuro); font-weight: 500; }
.chip-no { color: var(--rojo-suave); font-weight: 500; }

.avatar-mini {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.avatar-mini-vacio {
  background: var(--lavanda);
  color: var(--verde-oscuro);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fraunces', serif;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
}

.toggle-al-dia {
  cursor: pointer;
  border: 1px solid var(--borde);
  background: #fff;
}

@media (max-width: 720px) {
  .layout-admin { flex-direction: column; }
  .admin-sidebar { width: 100%; flex-direction: row; align-items: center; overflow-x: auto; }
  .admin-sidebar .logo-row { margin-bottom: 0; margin-right: 14px; }
  .admin-main { padding: 22px 16px; }
}
