/* ==========================================================================
   Panel de administración — Colegio Campos del Ranco
   ========================================================================== */

.admin-body { background: var(--papel); }

/* ------------------------------------------------------------ Acceso ----- */
.acceso {
  min-height: 100dvh; display: grid; place-items: center; padding: 6vw 5vw;
  background: var(--verde-900);
}
.acceso__caja {
  width: min(430px, 100%); background: var(--blanco);
  border-radius: var(--r-lg); padding: clamp(30px, 4vw, 46px);
  box-shadow: var(--sh-2);
}
.acceso__logo { margin-bottom: 30px; }
.acceso__logo img { height: 56px; width: auto; }
.acceso h1 { font-size: 1.5rem; margin-bottom: 8px; }
.acceso p { font-size: .9rem; color: var(--gris); margin-bottom: 28px; }

/* ------------------------------------------------------------ Marco ------ */
.panel { display: grid; grid-template-columns: 252px 1fr; min-height: 100dvh; }

.lateral {
  background: var(--verde-900); color: rgba(255,255,255,.72);
  padding: 26px 18px; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100dvh; overflow-y: auto;
}
.lateral__logo { padding: 0 8px 26px; }
.lateral__logo img { height: 44px; width: auto; }
.lateral nav { display: flex; flex-direction: column; gap: 3px; }
.lateral button.tab {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left; background: none; border: 0; cursor: pointer;
  padding: 11px 13px; border-radius: var(--r);
  font-size: .885rem; font-weight: 500; color: rgba(255,255,255,.72);
  transition: background .22s var(--ease), color .22s var(--ease);
}
.lateral button.tab svg { width: 17px; height: 17px; flex: none; }
.lateral button.tab:hover { background: rgba(255,255,255,.08); color: #fff; }
.lateral button.tab.activa { background: var(--verde-700); color: #fff; }
.lateral__contador {
  margin-left: auto; font-family: var(--dato); font-size: .68rem;
  background: var(--oro); color: #fff; padding: 2px 7px; border-radius: 20px;
}
.lateral__pie { margin-top: auto; padding-top: 26px; border-top: 1px solid rgba(255,255,255,.12); }
.lateral__usuario { font-size: .78rem; color: rgba(255,255,255,.55); margin-bottom: 12px; word-break: break-all; }

.contenido { padding: clamp(22px, 3vw, 40px); min-width: 0; }
.contenido__head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; margin-bottom: 26px;
}
.contenido__head h1 { font-size: 1.75rem; }
.contenido__head p { font-size: .885rem; color: var(--gris); margin-top: 6px; }

.vista { display: none; }
.vista.activa { display: block; }

/* ------------------------------------------------------------ Resumen ---- */
.metricas { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 34px; }
@media (max-width: 1100px) { .metricas { grid-template-columns: repeat(2, 1fr); } }
.metrica {
  background: var(--blanco); border: 1px solid var(--linea);
  border-radius: var(--r-lg); padding: 22px 24px;
}
.metrica__rotulo {
  font-family: var(--dato); font-size: .66rem; letter-spacing: .13em;
  text-transform: uppercase; color: var(--gris); margin-bottom: 12px;
}
.metrica__valor {
  font-family: var(--display); font-size: 2.35rem; font-weight: 600;
  line-height: 1; letter-spacing: -.03em; color: var(--verde-800);
}
.metrica__nota { font-size: .78rem; color: var(--gris-claro); margin-top: 9px; }

/* ------------------------------------------------------------ Barra ------ */
.barra {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px;
}
.barra input[type="search"], .barra select {
  padding: 10px 13px; border: 1px solid var(--linea); border-radius: var(--r);
  background: var(--blanco); font-size: .875rem; min-width: 190px;
}
.barra input[type="search"]:focus, .barra select:focus {
  outline: none; border-color: var(--verde-600); box-shadow: 0 0 0 3px rgba(30,99,71,.12);
}

.btn-chico {
  padding: 9px 15px; font-size: .82rem; border-radius: var(--r);
  border: 1px solid var(--linea); background: var(--blanco); color: var(--verde-800);
  cursor: pointer; font-weight: 600; display: inline-flex; align-items: center; gap: 7px;
  transition: border-color .22s var(--ease), background .22s var(--ease);
}
.btn-chico svg { width: 15px; height: 15px; }
.btn-chico:hover { border-color: var(--verde-600); background: var(--verde-50); }
.btn-chico--oro { background: var(--oro); border-color: var(--oro); color: #fff; }
.btn-chico--oro:hover { background: var(--oro-600); border-color: var(--oro-600); }
.btn-chico--peligro { color: var(--error); }
.btn-chico--peligro:hover { border-color: var(--error); background: #FBEDEA; }

/* ------------------------------------------------------------ Tabla ------ */
.datos-envoltura {
  background: var(--blanco); border: 1px solid var(--linea);
  border-radius: var(--r-lg); overflow: hidden;
}
.datos-scroll { overflow-x: auto; }
table.datos { min-width: 760px; font-size: .875rem; }
table.datos th {
  background: var(--verde-50); text-align: left; padding: 13px 16px;
  font-family: var(--dato); font-size: .65rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--gris); border-bottom: 1px solid var(--linea);
  white-space: nowrap;
}
table.datos td {
  padding: 14px 16px; border-bottom: 1px solid var(--linea);
  color: var(--gris); vertical-align: middle;
}
table.datos tbody tr:last-child td { border-bottom: 0; }
table.datos tbody tr:hover { background: var(--verde-50); }
table.datos td strong { color: var(--tinta); font-weight: 600; }
.celda-acciones { display: flex; gap: 6px; justify-content: flex-end; }

.marca {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-family: var(--dato); font-size: .66rem; letter-spacing: .07em;
  text-transform: uppercase; white-space: nowrap;
}
.marca--nueva      { background: var(--oro-100); color: var(--oro-600); }
.marca--contactada { background: #E2ECF7; color: #2A5A8C; }
.marca--proceso    { background: #EDE7F6; color: #5B4B8A; }
.marca--matriculada{ background: var(--verde-100); color: var(--verde-800); }
.marca--descartada { background: #EFEFEF; color: #6C6C6C; }
.marca--nuevo      { background: var(--oro-100); color: var(--oro-600); }
.marca--leido      { background: #E2ECF7; color: #2A5A8C; }
.marca--respondido { background: var(--verde-100); color: var(--verde-800); }
.marca--publicado  { background: var(--verde-100); color: var(--verde-800); }
.marca--borrador   { background: #EFEFEF; color: #6C6C6C; }

/* ------------------------------------------------------------ Modal ------ */
.modal {
  position: fixed; inset: 0; z-index: 200; display: none;
  background: rgba(13,26,21,.6); padding: 4vh 4vw; overflow-y: auto;
}
.modal.abierto { display: block; }
.modal__caja {
  background: var(--blanco); width: min(720px, 100%); margin-inline: auto;
  border-radius: var(--r-lg); box-shadow: var(--sh-2);
}
.modal__head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 22px 26px; border-bottom: 1px solid var(--linea);
}
.modal__head h2 { font-size: 1.25rem; }
.modal__cerrar {
  background: none; border: 1px solid var(--linea); border-radius: var(--r);
  padding: 8px; cursor: pointer; color: var(--gris); line-height: 0;
}
.modal__cerrar svg { width: 17px; height: 17px; }
.modal__cerrar:hover { border-color: var(--verde-600); color: var(--verde-700); }
.modal__cuerpo { padding: 26px; }
.modal__pie {
  padding: 18px 26px; border-top: 1px solid var(--linea);
  display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap;
}

.detalle dl { display: grid; grid-template-columns: 190px 1fr; gap: 1px; }
.detalle dt {
  font-family: var(--dato); font-size: .66rem; letter-spacing: .11em;
  text-transform: uppercase; color: var(--gris); padding: 12px 0;
  border-top: 1px solid var(--linea);
}
.detalle dd { padding: 12px 0; border-top: 1px solid var(--linea); color: var(--tinta); font-size: .9rem; }
.detalle dt:first-of-type, .detalle dd:first-of-type { border-top: 0; }
@media (max-width: 620px) {
  .detalle dl { grid-template-columns: 1fr; }
  .detalle dd { padding-top: 0; border-top: 0; }
}

/* ------------------------------------------------------------ Subida ----- */
.subida {
  border: 1px dashed var(--linea); border-radius: var(--r);
  padding: 18px; text-align: center; background: var(--verde-50);
}
.subida input[type="file"] { display: none; }
.subida__boton {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-size: .85rem; font-weight: 600; color: var(--verde-700);
}
.subida__boton svg { width: 16px; height: 16px; }
.subida__nota { font-size: .77rem; color: var(--gris-claro); margin-top: 8px; }
.subida__previa { margin-top: 14px; }
.subida__previa img { max-height: 150px; border-radius: var(--r); margin-inline: auto; }
.subida__barra { height: 3px; background: var(--linea); border-radius: 3px; margin-top: 12px; overflow: hidden; display: none; }
.subida__barra.activa { display: block; }
.subida__barra span { display: block; height: 100%; background: var(--verde-600); width: 0; transition: width .25s var(--ease); }

/* ------------------------------------------------------------ Aviso ------ */
.aviso {
  position: fixed; right: 20px; bottom: 20px; z-index: 300;
  background: var(--verde-800); color: #fff; padding: 13px 20px;
  border-radius: var(--r); font-size: .875rem; box-shadow: var(--sh-2);
  transform: translateY(120%); transition: transform .35s var(--ease); max-width: 340px;
}
.aviso.visible { transform: none; }
.aviso.error { background: var(--error); }

/* ------------------------------------------------------------ Móvil ------ */
.panel__toggle {
  display: none; position: fixed; left: 14px; bottom: 14px; z-index: 120;
  background: var(--verde-800); color: #fff; border: 0; border-radius: var(--r);
  padding: 12px 14px; cursor: pointer; box-shadow: var(--sh-2);
}
.panel__toggle svg { width: 20px; height: 20px; }

@media (max-width: 900px) {
  .panel { grid-template-columns: 1fr; }
  .lateral {
    position: fixed; inset: 0 auto 0 0; width: 258px; z-index: 130;
    transform: translateX(-100%); transition: transform .32s var(--ease);
  }
  .lateral.abierta { transform: none; }
  .panel__toggle { display: block; }
  .contenido { padding-bottom: 84px; }
}

/* ---------- Notas de apoyo en formularios ---------- */
.campo__nota {
  margin: 6px 0 0;
  font-size: .78rem; line-height: 1.5; color: var(--gris-claro);
}
.campo__nota code {
  font-family: var(--dato); font-size: .74rem;
  background: var(--verde-50); color: var(--verde-700);
  padding: 1px 5px; border-radius: 2px;
}

/* Nota secundaria dentro de una celda de tabla */
.celda-nota {
  display: block; margin-top: 3px;
  font-family: var(--dato); font-size: .68rem; letter-spacing: .06em;
  text-transform: uppercase; color: var(--gris-claro);
}

/* ==========================================================================
   Editor de textos y fotos
   ========================================================================== */
.ed-barra {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 16px 18px; margin-bottom: 14px;
  background: var(--blanco); border: 1px solid var(--linea); border-radius: 6px;
}
.ed-label { font-size: .82rem; font-weight: 600; color: var(--tinta); }
.ed-select {
  padding: 9px 12px; border: 1px solid var(--linea); border-radius: 4px;
  font-family: inherit; font-size: .92rem; background: #fff; min-width: 190px;
}
.ed-barra__botones { margin-left: auto; display: flex; gap: 10px; }

.ed-estado {
  margin: 0 0 16px; padding: 12px 16px;
  border-left: 4px solid var(--verde-600); background: var(--verde-50);
  font-size: .88rem; color: var(--verde-800); border-radius: 0 4px 4px 0;
}
.ed-estado--pendiente {
  border-color: var(--oro); background: #FDF6E7; color: #7A5510; font-weight: 600;
}

.ed-zona { display: flex; gap: 16px; align-items: flex-start; }
.ed-marco {
  flex: 1; min-width: 0; height: 74vh; min-height: 520px;
  border: 1px solid var(--linea); border-radius: 6px; background: #fff;
}

.ed-cuadro {
  width: 348px; flex: none;
  background: var(--blanco); border: 1px solid var(--linea); border-radius: 6px;
  position: sticky; top: 20px; max-height: 74vh; display: flex; flex-direction: column;
}
.ed-cuadro__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--linea);
}
.ed-cuadro__head h2 { margin: 0; font-size: 1.02rem; }
.ed-cuadro__cerrar {
  width: 30px; height: 30px; display: grid; place-items: center;
  background: none; border: 0; cursor: pointer; color: var(--gris); border-radius: 50%;
}
.ed-cuadro__cerrar svg { width: 16px; height: 16px; }
.ed-cuadro__cerrar:hover { background: var(--verde-50); color: var(--tinta); }
.ed-cuadro__cuerpo { padding: 16px; overflow-y: auto; }

.ed-ayuda { margin: 0 0 12px; font-size: .81rem; line-height: 1.55; color: var(--gris-claro); }
.ed-area, .ed-input {
  width: 100%; padding: 11px 13px; margin-bottom: 14px;
  border: 1px solid var(--linea); border-radius: 4px;
  font-family: inherit; font-size: .92rem; line-height: 1.55; color: var(--tinta);
  resize: vertical;
}
.ed-area:focus, .ed-input:focus { outline: 2px solid var(--oro); outline-offset: -1px; }
.ed-rango { width: 100%; margin-bottom: 8px; accent-color: var(--oro); }
.ed-previa {
  width: 100%; aspect-ratio: 16/9; object-fit: cover;
  border-radius: 4px; margin-bottom: 14px; background: var(--verde-50);
}
.ed-subir {
  display: block; padding: 14px; margin-bottom: 12px; text-align: center; cursor: pointer;
  border: 2px dashed var(--linea); border-radius: 4px;
  font-size: .86rem; font-weight: 600; color: var(--verde-700);
}
.ed-subir:hover { border-color: var(--oro); background: var(--verde-50); }
.ed-progreso { height: 6px; background: var(--verde-50); border-radius: 3px; margin-bottom: 14px; }
.ed-progreso span { display: block; height: 100%; width: 0; background: var(--oro); border-radius: 3px; transition: width .2s; }
.ed-acciones { display: flex; gap: 10px; flex-wrap: wrap; }
.ed-acciones .btn-chico { flex: 1; justify-content: center; }

@media (max-width: 1100px) {
  .ed-zona { flex-direction: column; }
  .ed-cuadro { width: 100%; position: static; max-height: none; }
  .ed-marco { width: 100%; height: 60vh; }
}

/* ==========================================================================
   Avisos e instructivo
   ========================================================================== */
.aviso-caja {
  padding: 16px 18px; margin-bottom: 20px;
  background: #FDF6E7; border-left: 4px solid var(--oro); border-radius: 0 4px 4px 0;
}
.aviso-caja--calma { background: var(--verde-50); border-color: var(--verde-600); }
.aviso-caja strong { display: block; margin-bottom: 8px; font-size: .95rem; color: var(--tinta); }
.aviso-caja p { margin: 0 0 8px; font-size: .87rem; line-height: 1.62; color: var(--gris); }
.aviso-caja p:last-child { margin-bottom: 0; }
.aviso-caja a { color: var(--verde-700); font-weight: 600; text-decoration: underline; }

.guia {
  background: var(--blanco); border: 1px solid var(--linea); border-radius: 6px;
  padding: 24px 26px; margin-bottom: 18px;
}
.guia h2 { margin: 0 0 6px; font-size: 1.16rem; }
.guia__intro { margin: 0 0 14px; font-size: .9rem; color: var(--gris); }
.guia__pasos { margin: 0 0 16px; padding-left: 22px; }
.guia__pasos > li {
  margin-bottom: 10px; font-size: .92rem; line-height: 1.62; color: var(--tinta);
}
.guia__pasos ul { margin: 8px 0 0; padding-left: 18px; }
.guia__pasos ul li { margin-bottom: 5px; font-size: .88rem; color: var(--gris); }
.guia__pasos code {
  font-family: var(--dato); font-size: .82rem;
  background: var(--verde-50); color: var(--verde-700); padding: 1px 5px; border-radius: 2px;
}
.guia__aviso {
  padding: 13px 16px; margin-bottom: 16px;
  background: var(--verde-50); border-left: 3px solid var(--verde-600);
  font-size: .86rem; line-height: 1.6; color: var(--verde-800); border-radius: 0 4px 4px 0;
}
.guia__faq p { font-size: .9rem; line-height: 1.65; color: var(--gris); margin: 0 0 14px; }
.guia__faq p b { color: var(--tinta); }

.lateral__rol {
  font-size: .74rem; color: rgba(255,255,255,.5); margin: 2px 0 0;
}

/* El menú no se muestra hasta saber qué puede ver la persona.
   Así no alcanza a aparecer una opción que después se esconde. */
#menuLateral:not(.listo) .tab { display: none; }

/* Bloque "ocultar esta fila/tarjeta" dentro del cuadro de edición */
.ed-bloque {
  margin-top: 18px; padding-top: 16px;
  border-top: 1px solid var(--linea);
}
.ed-bloque .btn-chico { width: 100%; justify-content: center; }

/* ---------- Carrusel de la portada ---------- */
.ed-carrusel {
  background: var(--blanco); border: 1px solid var(--linea); border-radius: 6px;
  padding: 18px 20px; margin-bottom: 16px;
}
.ed-carrusel__head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 18px; flex-wrap: wrap; margin-bottom: 16px;
}
.ed-carrusel__head h2 { margin: 0 0 4px; font-size: 1.02rem; }
.ed-carrusel__head p { margin: 0; font-size: .83rem; color: var(--gris-claro); }

.ed-carrusel__lista {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px;
}
.ed-foto {
  border: 1px solid var(--linea); border-radius: 5px; overflow: hidden;
  background: var(--verde-50);
}
.ed-foto img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.ed-foto__acciones {
  display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
  padding: 9px 10px; background: var(--blanco);
}
.ed-foto__num {
  width: 22px; height: 22px; flex: none;
  display: grid; place-items: center;
  background: var(--verde-800); color: #fff;
  font-size: .72rem; font-weight: 700; border-radius: 50%;
}
.ed-foto__acciones .btn-chico { padding: 5px 9px; font-size: .76rem; }
.ed-foto__acciones .btn-chico:disabled { opacity: .35; cursor: default; }
