/* Estilos de la app portable Listados Contabilidad */
* { box-sizing: border-box; }
body { margin: 0; font-family: 'Segoe UI', Calibri, Arial, sans-serif; background: #f4f6fa; color: #1a1a1a; }
header { background: linear-gradient(135deg, #1f4e79, #2e5496); color: #fff; padding: 24px 32px; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
header h1 { margin: 0; font-size: 26px; font-weight: 600; }
header .sub { margin: 6px 0 0; opacity: .85; font-size: 14px; }

main { max-width: 1100px; margin: 28px auto; padding: 0 20px; }

.bloques { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 900px) { .bloques { grid-template-columns: 1fr; } }

.bloque {
  background: #fff; border-radius: 8px; padding: 24px 28px;
  box-shadow: 0 2px 6px rgba(0,0,0,.08); margin-bottom: 20px;
}
.bloque h2 { margin-top: 0; color: #1f4e79; font-size: 18px; }
.numero {
  display: inline-block; width: 28px; height: 28px; line-height: 28px;
  text-align: center; background: #1f4e79; color: #fff;
  border-radius: 50%; margin-right: 8px; font-size: 14px;
}
.bloque p { color: #555; font-size: 14px; }
.bloque code { background: #eef2f7; padding: 1px 6px; border-radius: 3px; font-size: 13px; }

.filebox { display: block; margin: 14px 0; font-size: 14px; color: #333; }
.filebox input[type=file] {
  display: block; margin-top: 6px; padding: 8px;
  background: #f9fafc; border: 1px dashed #c4d0dd; border-radius: 4px;
  width: 100%; font-size: 13px;
}
.filebox small { display: block; color: #999; margin-top: 4px; font-size: 12px; }

button.primario, button.secundario {
  font-size: 15px; padding: 10px 22px; border: 0;
  border-radius: 4px; cursor: pointer; font-weight: 500;
}
button.primario { background: #1f4e79; color: #fff; margin-top: 8px; }
button.primario:hover { background: #163e62; }
button.secundario { background: #f0f0f0; color: #555; margin-top: 12px; }
button.secundario:hover { background: #e0e0e0; }

.nota { font-size: 12px; color: #888; margin-top: 8px; font-style: italic; }

.historico { background: #fff; border-radius: 8px; padding: 24px 28px; box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.historico h2 { margin-top: 0; color: #1f4e79; font-size: 18px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 9px 12px; border-bottom: 1px solid #ebeef2; text-align: left; }
th { background: #f7f9fc; color: #555; font-weight: 600; font-size: 13px; }
tr:hover td { background: #fafcfe; }

.boton-pequeno {
  display: inline-block; padding: 4px 12px; background: #2e7d32;
  color: #fff; border-radius: 3px; text-decoration: none; font-size: 12px;
  border: 0; cursor: pointer;
}
.boton-pequeno:hover { background: #1b5e20; }
.boton-pequeno-sec {
  display: inline-block; padding: 4px 12px; background: #fff; color: #5d4d00;
  border: 1px solid #f9a825; border-radius: 3px; cursor: pointer; font-size: 12px;
  margin-left: 6px;
}
.boton-pequeno-sec:hover { background: #fff8e1; }
.inline { display: inline-block; }

.plantillas-info {
  background: #f4f8fb; padding: 12px 16px; border-radius: 4px;
  margin: 14px 0; font-size: 13px; border-left: 3px solid #1f4e79;
}
.plantillas-info strong { color: #1f4e79; }
.plantillas-info ul { margin: 6px 0 0; padding-left: 20px; }
.plantillas-info code { background: #fff; padding: 1px 5px; border-radius: 2px; font-size: 12px; }

.alerta { padding: 14px 18px; border-radius: 4px; margin-bottom: 20px; font-size: 14px; }
.alerta-ok    { background: #e8f5e9; border-left: 4px solid #2e7d32; color: #1b5e20; }
.alerta-aviso { background: #fff8e1; border-left: 4px solid #f9a825; color: #6d4c00; }
.alerta-error { background: #ffebee; border-left: 4px solid #c62828; color: #911818; }

.stats { list-style: none; padding: 0; }
.stats li { padding: 6px 0; border-bottom: 1px solid #f0f0f0; font-size: 14px; }
.stats li.destacado { color: #1f4e79; font-size: 15px; padding-top: 10px; }

.volver { display: inline-block; margin-bottom: 14px; font-size: 13px; color: #1f4e79; text-decoration: none; }
.volver:hover { text-decoration: underline; }

.vacio { color: #aaa; font-style: italic; }

footer { text-align: center; padding: 24px; color: #999; font-size: 12px; }

/* ---------- Overlay de carga ---------- */
.cargando-overlay {
  position: fixed; inset: 0;
  background: rgba(31, 78, 121, 0.85);
  display: none;
  align-items: center; justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(3px);
}
.cargando-overlay.visible { display: flex; }
.cargando-caja {
  background: #fff; padding: 36px 44px; border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,.28); text-align: center;
  max-width: 440px;
}
.cargando-caja h3 { margin: 18px 0 10px; color: #1f4e79; font-size: 20px; }
.cargando-caja p  { color: #555; font-size: 14px; line-height: 1.5; margin: 4px 0; }
.cargando-caja .cargando-nota { color: #c62828; font-size: 13px; margin-top: 14px; font-weight: 500; }

.spinner {
  width: 56px; height: 56px;
  margin: 0 auto;
  border: 6px solid #e3eaf2;
  border-top-color: #1f4e79;
  border-radius: 50%;
  animation: girar 1s linear infinite;
}
@keyframes girar { to { transform: rotate(360deg); } }

/* Explicación bajo el título "Archivos generados" */
.explica { font-size: 13px; color: #555; background: #f4f8fb;
  padding: 10px 14px; border-left: 3px solid #1f4e79; border-radius: 3px; margin: 8px 0 16px; }

/* Etiquetas de tipo de archivo */
.tipo-tag { display: inline-block; padding: 3px 10px; border-radius: 12px;
  font-size: 12px; font-weight: 500; }
.tipo-principal { background: #d4edda; color: #155724; }
.tipo-riesgo    { background: #fff3cd; color: #856404; }
.row-riesgo td  { background: #fcfaf2; }

/* ===== Layout unificado: 2 uploads en 1 formulario ===== */
.bloque-grande { max-width: 1000px; margin: 0 auto 28px; }
.bloque-grande h2 { font-size: 20px; color: #1f4e79; }
.dos-uploads { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 16px; }
@media (max-width: 800px) { .dos-uploads { grid-template-columns: 1fr; } }
.upload-box { background: #f7f9fc; padding: 18px 20px; border-radius: 6px; border: 1px solid #e3eaf2; }
.upload-box h3 { margin-top: 0; color: #2e5496; font-size: 16px; }

.boton-grande { font-size: 17px; padding: 14px 32px; display: block; margin: 18px auto 4px; }
.centrada { text-align: center; color: #888; font-size: 12px; }
.meta-formato { background: #eaf3fb; padding: 8px 14px; border-radius: 4px; border-left: 3px solid #1f4e79; font-size: 13px; margin-bottom: 14px; color: #1f4e79; }
