/* =====================================================================
   REFUERZO · Hoja de estilo única
   Mobile primero. Todo lo que crece hacia arriba está en media queries
   al final de cada bloque.

   Paleta de marca (no inventar colores nuevos):
     --azul     #14364A  color de marca
     --azul-med #1E5470  insignias B y C, textos secundarios
     --naranja  #FF6B35  SOLO acción y urgencia
     --verde    #17B26A  SOLO verificación (escalafón A)
     --gris     #6B7A82  insignias D y E, texto tenue
   ===================================================================== */

:root {
  --azul:      #14364A;
  --azul-med:  #1E5470;
  --azul-claro:#EAF1F5;
  --naranja:   #FF6B35;
  --verde:     #17B26A;
  --gris:      #6B7A82;
  --gris-borde:#D9E1E6;
  --fondo:     #FFFFFF;
  --fondo-alt: #F6F9FB;
  --texto:     #16242D;
  --radio:     10px;
  --sombra:    0 1px 2px rgba(20,54,74,.06), 0 4px 14px rgba(20,54,74,.06);
  --ancho:     1080px;
  --titulo:    'Sora', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --cuerpo:    'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--cuerpo);
  font-size: 16px;
  line-height: 1.55;
  color: var(--texto);
  background: var(--fondo);
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3, h4 { font-family: var(--titulo); line-height: 1.2; margin: 0 0 .5em; color: var(--azul); }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p  { margin: 0 0 1em; }
a  { color: var(--azul-med); }
img { max-width: 100%; height: auto; display: block; }

.contenedor { width: 100%; max-width: var(--ancho); margin: 0 auto; padding: 0 16px; }

.saltar {
  position: absolute; left: -9999px;
  background: var(--azul); color: #fff; padding: 10px 14px; z-index: 100;
}
.saltar:focus { left: 8px; top: 8px; }

/* ------------------------------------------------------------------ */
/* Cabecera                                                            */
/* ------------------------------------------------------------------ */
.cab { background: var(--azul); color: #fff; position: sticky; top: 0; z-index: 40; }
.cab__fila { display: flex; align-items: center; justify-content: space-between; min-height: 58px; }
.marca { color: #fff; text-decoration: none; font-family: var(--titulo); font-weight: 700; font-size: 1.15rem; letter-spacing: -.01em; }
.marca__nombre::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--naranja); margin-right: 8px; vertical-align: middle; }

.cab__menu { background: none; border: 0; padding: 10px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.cab__menu span { display: block; width: 22px; height: 2px; background: #fff; }

.nav { display: none; flex-direction: column; gap: 2px; width: 100%; padding: 10px 0 16px; }
.nav.abierto { display: flex; }
.nav a { color: #fff; text-decoration: none; padding: 10px 0; font-weight: 500; border-bottom: 1px solid rgba(255,255,255,.12); }
.nav a[aria-current="page"] { color: var(--naranja); }
.nav .btn { border-bottom: 0; margin-top: 8px; text-align: center; }

@media (min-width: 860px) {
  .cab__fila { flex-wrap: nowrap; }
  .cab__menu { display: none; }
  .nav { display: flex; flex-direction: row; align-items: center; gap: 20px; width: auto; padding: 0; }
  .nav a { border-bottom: 0; padding: 6px 0; }
  .nav .btn { margin-top: 0; }
}

/* ------------------------------------------------------------------ */
/* Botones                                                             */
/* ------------------------------------------------------------------ */
.btn {
  display: inline-block; padding: 11px 18px; border-radius: var(--radio);
  border: 1px solid transparent; font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer; text-align: center;
}
.btn--accion    { background: var(--naranja); color: #fff; }
.btn--accion:hover { background: #ef5d28; }
.btn--principal { background: var(--azul); color: #fff; }
.btn--principal:hover { background: #0f2b3b; }
.btn--linea     { background: #fff; color: var(--azul); border-color: var(--gris-borde); }
.btn--linea:hover { border-color: var(--azul-med); }
.btn--bloque    { display: block; width: 100%; }
.btn--whatsapp  { background: #25D366; color: #fff; }
.btn--whatsapp:hover { background: #1ebc59; color: #fff; }
.btn[disabled]  { opacity: .5; cursor: not-allowed; }

/* ------------------------------------------------------------------ */
/* Avisos                                                              */
/* ------------------------------------------------------------------ */
.aviso { padding: 12px 14px; border-radius: var(--radio); margin: 16px 0; border-left: 4px solid; font-size: .95rem; }
.aviso--ok      { background: #EAF8F0; border-color: var(--verde); }
.aviso--aviso   { background: #FFF3EC; border-color: var(--naranja); }
.aviso--error   { background: #FDECEC; border-color: #D64545; }
.aviso--info    { background: var(--azul-claro); border-color: var(--azul-med); }

/* Advertencia legal del formulario de publicación */
.legal {
  background: #FFF8F3; border: 1px solid #FFD3BC; border-radius: var(--radio);
  padding: 14px; margin: 16px 0; font-size: .9rem; color: #6B3A22;
}
.legal h3 { color: #8A3E19; font-size: .98rem; margin-bottom: .4em; }

/* ------------------------------------------------------------------ */
/* Insignias de escalafón                                              */
/* El color viene por --insignia desde la tabla `escalafones`.         */
/* El verde es exclusivo del escalafón A: no se escribe acá.           */
/* ------------------------------------------------------------------ */
.insignia {
  display: inline-flex; align-items: center; gap: 6px;
  background: color-mix(in srgb, var(--insignia, var(--gris)) 12%, #fff);
  color: var(--insignia, var(--gris));
  border: 1px solid color-mix(in srgb, var(--insignia, var(--gris)) 35%, #fff);
  padding: 3px 10px; border-radius: 999px;
  font-size: .78rem; font-weight: 600; line-height: 1.6;
}
.insignia::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.insignia--pendiente { background: #F1F4F6; color: var(--gris); border-color: var(--gris-borde); }

.etiqueta { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--azul-claro); color: var(--azul-med); }
.etiqueta--urgente { background: #FFEDE4; color: #C4451A; }
.etiqueta--cubierto { background: #EAF8F0; color: #0E7A48; }
.etiqueta--vencido { background: #F1F4F6; color: var(--gris); }

/* ------------------------------------------------------------------ */
/* Portada                                                             */
/* ------------------------------------------------------------------ */
.hero { background: var(--azul); color: #fff; padding: 40px 0 44px; }
.hero h1 { color: #fff; font-size: 1.85rem; max-width: 18ch; }
.hero p { color: #C9DAE4; max-width: 52ch; }
.hero__acciones { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }
@media (min-width: 700px) {
  .hero { padding: 64px 0 68px; }
  .hero h1 { font-size: 2.5rem; }
  .hero__acciones { flex-direction: row; }
}

.bloque { padding: 36px 0; }
.bloque--alt { background: var(--fondo-alt); }
.bloque__intro { max-width: 60ch; margin-bottom: 22px; }

/* ------------------------------------------------------------------ */
/* Grillas y tarjetas                                                  */
/* ------------------------------------------------------------------ */
.grilla { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grilla--2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .grilla--3 { grid-template-columns: repeat(3, 1fr); } }

.tarjeta {
  background: #fff; border: 1px solid var(--gris-borde);
  border-radius: var(--radio); padding: 16px; box-shadow: var(--sombra);
}
.tarjeta--enlace { text-decoration: none; color: inherit; display: block; }
.tarjeta--enlace:hover { border-color: var(--azul-med); }
.tarjeta__cabecera { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.tarjeta__titulo { font-family: var(--titulo); font-weight: 600; font-size: 1.05rem; color: var(--azul); margin: 0; }
.tarjeta__dato { display: flex; gap: 8px; font-size: .9rem; color: var(--gris); margin: 2px 0; }
.tarjeta__dato strong { color: var(--texto); font-weight: 500; }
.tarjeta__pie { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--gris-borde); display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ */
.filtros { background: var(--fondo-alt); border: 1px solid var(--gris-borde); border-radius: var(--radio); padding: 14px; margin-bottom: 20px; }
.filtros summary { font-weight: 600; font-size: .95rem; color: var(--azul); cursor: pointer; padding: 4px 0; outline: none; list-style: none; display: flex; align-items: center; justify-content: space-between; }
.filtros summary::-webkit-details-marker { display: none; }
.filtros summary::after { content: '▾'; font-size: .85rem; color: var(--gris); }
.filtros[open] summary::after { content: '▴'; }
.filtros[open] summary { margin-bottom: 12px; border-bottom: 1px solid var(--gris-borde); padding-bottom: 8px; }
.filtros__fila { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 700px) {
  .filtros summary { display: none; }
  .filtros__fila { display: grid !important; grid-template-columns: repeat(3, 1fr) auto; align-items: end; }
}

/* ------------------------------------------------------------------ */
/* Formularios                                                         */
/* ------------------------------------------------------------------ */
.campo { margin-bottom: 14px; }
.campo label { display: block; font-weight: 500; font-size: .9rem; margin-bottom: 5px; color: var(--azul); }
.campo .ayuda { font-size: .82rem; color: var(--gris); margin: 4px 0 0; }

input[type=text], input[type=email], input[type=password], input[type=tel],
input[type=date], input[type=time], input[type=number], input[type=file],
select, textarea {
  width: 100%; padding: 11px 12px; font: inherit; color: var(--texto);
  background: #fff; border: 1px solid var(--gris-borde); border-radius: var(--radio);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--azul-med); outline-offset: 1px; border-color: var(--azul-med); }
textarea { min-height: 110px; resize: vertical; }

.opciones { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.opcion { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border: 1px solid var(--gris-borde); border-radius: var(--radio); font-size: .9rem; cursor: pointer; background: #fff; }
.opcion input { width: auto; margin: 0; }
.opcion:hover { border-color: var(--azul-med); }

fieldset { border: 1px solid var(--gris-borde); border-radius: var(--radio); padding: 14px; margin: 0 0 18px; }
legend { font-family: var(--titulo); font-weight: 600; color: var(--azul); padding: 0 6px; font-size: .98rem; }

.form-caja { max-width: 520px; margin: 28px auto; }

/* ------------------------------------------------------------------ */
/* Tablas (paneles)                                                    */
/* ------------------------------------------------------------------ */
.tabla-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 18px; }
table.datos { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 560px; }
table.datos th, table.datos td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--gris-borde); vertical-align: top; }
table.datos th { background: var(--fondo-alt); font-weight: 600; color: var(--azul); white-space: nowrap; }
table.datos tr:hover td { background: #FBFDFE; }

/* ------------------------------------------------------------------ */
/* Paneles                                                             */
/* ------------------------------------------------------------------ */
.panel { padding: 26px 0 40px; }
.panel__cabecera { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.panel__menu { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 22px; }
.panel__menu a { padding: 8px 14px; border-radius: 999px; background: var(--fondo-alt); color: var(--azul-med); text-decoration: none; font-size: .9rem; font-weight: 500; border: 1px solid var(--gris-borde); }
.panel__menu a[aria-current="page"] { background: var(--azul); color: #fff; border-color: var(--azul); }

.metricas { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); margin-bottom: 24px; }
@media (min-width: 780px) { .metricas { grid-template-columns: repeat(4, 1fr); } }
.metrica { background: #fff; border: 1px solid var(--gris-borde); border-radius: var(--radio); padding: 14px; }
.metrica__n { font-family: var(--titulo); font-size: 1.7rem; font-weight: 700; color: var(--azul); line-height: 1; }
.metrica__t { font-size: .82rem; color: var(--gris); margin-top: 6px; }

/* ------------------------------------------------------------------ */
/* Fichas                                                              */
/* ------------------------------------------------------------------ */
.ficha { padding: 26px 0 40px; }
.ficha__grid { display: grid; gap: 22px; grid-template-columns: 1fr; }
@media (min-width: 880px) { .ficha__grid { grid-template-columns: 1fr 320px; align-items: start; } }
.ficha__lateral { position: sticky; top: 74px; }
.migas { font-size: .85rem; color: var(--gris); margin-bottom: 12px; }
.migas a { color: var(--gris); }
.datos-lista { list-style: none; margin: 0 0 18px; padding: 0; }
.datos-lista li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--gris-borde); font-size: .93rem; }
.datos-lista span:first-child { color: var(--gris); }
.datos-lista span:last-child { font-weight: 500; text-align: right; }

.vacio { text-align: center; padding: 40px 16px; color: var(--gris); background: var(--fondo-alt); border-radius: var(--radio); border: 1px dashed var(--gris-borde); }

.paginador { display: flex; gap: 14px; align-items: center; justify-content: center; margin: 24px 0; font-size: .9rem; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 0; }
.chip { background: var(--azul-claro); color: var(--azul-med); border-radius: 999px; padding: 3px 10px; font-size: .78rem; font-weight: 500; }

/* ------------------------------------------------------------------ */
/* Pie                                                                 */
/* ------------------------------------------------------------------ */
.pie { background: var(--azul); color: #C9DAE4; padding: 34px 0 24px; margin-top: 44px; font-size: .9rem; }
.pie__cols { display: grid; gap: 22px; grid-template-columns: 1fr; margin-bottom: 24px; }
@media (min-width: 700px) { .pie__cols { grid-template-columns: 1.4fr 1fr 1fr; } }
.pie a { color: #C9DAE4; text-decoration: none; display: block; padding: 3px 0; }
.pie a:hover { color: #fff; }
.pie__marca { font-family: var(--titulo); font-weight: 700; color: #fff; font-size: 1.1rem; margin-bottom: 4px; }
.pie__lema { font-style: italic; }
.pie__titulo { color: #fff; font-weight: 600; margin-bottom: 6px; }
.pie__independencia { border-top: 1px solid rgba(255,255,255,.15); padding-top: 16px; font-size: .8rem; line-height: 1.5; color: #9FB8C6; }
.pie__copy { font-size: .8rem; color: #7F9AAB; margin: 0; }

/* Utilidades */
.tenue { color: var(--gris); }
.chico { font-size: .85rem; }
.centro { text-align: center; }
.mt { margin-top: 18px; }
.nada { margin: 0; }
