/* ============================================================
   Ruta. — estilos del panel de administración.
   Extiende styles.css: aquí solo va lo que la app del participante no necesita.
   ============================================================ */

.panel { padding-bottom: 40px; }
.panel main { padding-bottom: 60px; }

.envoltura-ancha {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

.tabs-panel {
  position: sticky;
  top: 58px;
  z-index: 30;
  background: rgba(7,7,16,.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.tabs-fila {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs-fila::-webkit-scrollbar { display: none; }
.tabs-fila button {
  padding: 13px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
}
.tabs-fila button[aria-current="true"] { color: var(--blue-bright); border-bottom-color: var(--blue); }

.encabezado-seccion {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  margin: 24px 0 18px;
}
.encabezado-seccion h1 { font-family: var(--ff-serif); font-size: 32px; font-weight: 600; }
.encabezado-seccion p { color: var(--text-dim); font-size: 14px; margin-top: 2px; }
.encabezado-seccion .acciones { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Rejillas ---------- */
.rejilla { display: grid; gap: 12px; }
.rejilla-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.rejilla-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.rejilla-4 { grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); }

/* ---------- Cifras ---------- */
.cifra {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
}
.cifra .valor {
  font-family: var(--ff-mono);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
}
.cifra .rotulo { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }
.cifra.azul .valor { color: var(--blue-bright); }
.cifra.verde .valor { color: #6ee7b7; }
.cifra.ambar .valor { color: #fcd34d; }

/* ---------- Tablas ---------- */
.tabla-envoltura {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
}
table.datos { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
table.datos th {
  text-align: left;
  padding: 11px 14px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.datos td { padding: 11px 14px; border-bottom: 1px solid rgba(255,255,255,.045); vertical-align: middle; }
table.datos tr:last-child td { border-bottom: 0; }
table.datos tr:hover td { background: rgba(255,255,255,.02); }
table.datos .num { font-family: var(--ff-mono); text-align: right; }

/* ---------- Tarjeta de estación en el panel ---------- */
.estacion-panel {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 14px;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.estacion-panel .lamina {
  width: 92px; height: 118px;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--text-muted);
  font-size: 11px;
  text-align: center;
}
.estacion-panel .lamina img { width: 100%; height: 100%; object-fit: cover; }
.estacion-panel h3 { font-family: var(--ff-serif); font-size: 21px; font-weight: 600; }
.estacion-panel .acciones { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }

.insignia {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
}
.insignia.activa { background: rgba(16,185,129,.16); color: #6ee7b7; }
.insignia.borrador { background: rgba(245,158,11,.16); color: #fcd34d; }
.insignia.archivada { background: rgba(255,255,255,.07); color: var(--text-muted); }
.insignia.fuera { background: rgba(239,68,68,.16); color: #fca5a5; }

.codigo-impreso {
  font-family: var(--ff-mono);
  font-size: 15px;
  letter-spacing: .2em;
  color: var(--cream);
  background: rgba(255,255,255,.05);
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  padding: 3px 10px;
  display: inline-block;
}

/* ---------- Modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(3,3,8,.75);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: start center;
  overflow-y: auto;
  padding: 20px;
}
.modal-caja {
  width: 100%;
  max-width: 760px;
  background: var(--bg-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 24px;
  margin: 20px 0 60px;
  animation: entra .22s ease both;
}
.modal-caja h2 { font-family: var(--ff-serif); font-size: 27px; font-weight: 600; margin-bottom: 4px; }
.modal-barra {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.modal-barra .cerrar { margin-left: auto; }

/* ---------- Editor ---------- */
.grupo {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  background: rgba(255,255,255,.015);
}
.grupo > h4 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.campos-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 560px) { .campos-2 { grid-template-columns: 1fr; } }

.zona-archivo {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.zona-archivo:hover { border-color: var(--blue); background: rgba(59,130,246,.05); }
.zona-archivo.tiene { border-style: solid; padding: 10px; }
.zona-archivo img, .zona-archivo video { max-height: 190px; margin: 0 auto; border-radius: 10px; }

.barra-progreso {
  height: 6px;
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,.08);
  overflow: hidden;
  margin-top: 10px;
}
.barra-progreso i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--blue), var(--blue-bright));
  transition: width .25s ease;
}

.pregunta-editor {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  background: rgba(255,255,255,.02);
}
.opcion-editor { display: flex; gap: 8px; align-items: center; margin-bottom: 7px; }
.opcion-editor input[type=text] { flex: 1; }
.opcion-editor input[type=radio] { width: 20px; height: 20px; accent-color: var(--blue); flex: 0 0 20px; }

/* ---------- Barras del tablero ---------- */
.barra-dato { display: grid; grid-template-columns: 1fr 46px; gap: 10px; align-items: center; margin-bottom: 8px; }
.barra-dato .riel { height: 22px; border-radius: 6px; background: rgba(255,255,255,.05); overflow: hidden; position: relative; }
.barra-dato .riel i { display: block; height: 100%; background: rgba(59,130,246,.45); }
.barra-dato .riel span {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.barra-dato .cifra-lado { font-family: var(--ff-mono); font-size: 13px; text-align: right; color: var(--text-dim); }

.sparkline { display: flex; align-items: flex-end; gap: 2px; height: 60px; }
.sparkline i {
  flex: 1;
  background: rgba(59,130,246,.5);
  border-radius: 2px 2px 0 0;
  min-height: 2px;
}
.sparkline i.hoy { background: var(--blue-bright); }

/* barra-angosta */
/* En pantalla angosta la barra del panel no cabe con todo: medido a 375 px, el
   botón "Salir" quedaba pegado al borde derecho y se cortaba. Lo que se va es lo
   que no es un camino: la etiqueta "Panel" (que solo dice dónde estás, y eso ya
   lo dice el título) y el nombre de quien entró. Se quedan los dos botones que
   sirven para moverse: "Ir a la app" y "Salir". */
@media (max-width: 620px) {
  .barra-fila > .pastilla:not(#btn-app):not(#btn-salir) { display: none; }
}
