/* ==========================================================================
   RE-SA agua y gas - Estilos globales
   Colores de marca:
     Azul:       #1B3A6B (principal)
     Naranja:    #E87722 (acento)
     Azul claro: #D6E4F7
     Gris:       #F5F5F5
   ========================================================================== */

/* --- Reset y base --- */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #F0F4FA;
  color: #222;
  min-height: 100vh;
}

/* --- Header --- */
header {
  background: #1B3A6B;
  color: white;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.header-izq { display: flex; align-items: center; gap: 20px; }
.header-der { display: flex; align-items: center; gap: 14px; }
.logo { font-size: 1.6rem; font-weight: 800; letter-spacing: 1px; }
.logo span { color: #E87722; }
.subtitulo { font-size: 0.85rem; opacity: 0.8; margin-top: 2px; }
.usuario-info { font-size: 0.85rem; opacity: 0.8; }

/* --- Botones header --- */
.btn-header {
  padding: 6px 16px;
  border-radius: 6px;
  color: white;
  font-size: 0.82rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s;
}
.btn-header:hover { opacity: 0.87; }
.btn-admin { background: #E87722; }
.btn-logout { background: rgba(255,255,255,0.2); }

/* --- Layout principal --- */
main { max-width: 1100px; margin: 32px auto; padding: 0 20px; }
main.centrado {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
body.flex-col {
  display: flex;
  flex-direction: column;
}

/* --- Cards --- */
.card {
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(27,58,107,0.1);
  padding: 24px 28px;
  margin-bottom: 22px;
}
.card.login-card {
  padding: 36px 40px;
  width: 100%;
  max-width: 400px;
}

/* --- Titulos --- */
h2 { color: #1B3A6B; margin-bottom: 16px; font-size: 1.1rem; }

/* --- Formularios --- */
.campo { margin-bottom: 18px; }
.campo label,
label.campo-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #1B3A6B;
  margin-bottom: 6px;
}
input[type="text"],
input[type="password"],
input[type="date"] {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid #D6E4F7;
  border-radius: 7px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}
input:focus { border-color: #1B3A6B; }

.form-inline { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.campo-inline { display: flex; flex-direction: column; gap: 4px; }
.campo-inline input { padding: 8px 12px; font-size: 0.9rem; border-radius: 6px; }

/* --- Botones --- */
.btn {
  display: inline-block;
  padding: 9px 22px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: opacity 0.15s;
}
.btn:hover { opacity: 0.87; }
.btn-login {
  width: 100%;
  padding: 11px;
  border-radius: 7px;
  background: #1B3A6B;
  color: white;
  font-size: 1rem;
  font-weight: 700;
}
.btn-crear { background: #1B3A6B; color: white; }
.btn-ir    { background: #217346; color: white; }
.btn-excel { background: #217346; color: white; }
.btn-pdf   { background: #C0392B; color: white; }
.btn-nuevo { background: #1B3A6B; color: white; }
.btn-desde-cero { background: #E87722; color: white; }

/* --- Mensajes --- */
.error {
  background: #FDEDEC;
  border: 1px solid #E74C3C;
  color: #922B21;
  padding: 10px 14px;
  border-radius: 7px;
  font-size: 0.88rem;
  margin-bottom: 18px;
  text-align: center;
}
.mensaje-ok {
  background: #E8F8F5;
  border: 1px solid #1E8449;
  color: #1E8449;
  padding: 10px 14px;
  border-radius: 7px;
  font-size: 0.88rem;
  margin-bottom: 14px;
}
.mensaje-error {
  background: #FDEDEC;
  border: 1px solid #E74C3C;
  color: #922B21;
  padding: 10px 14px;
  border-radius: 7px;
  font-size: 0.88rem;
  margin-bottom: 14px;
}
.alerta {
  margin-top: 14px;
  padding: 10px 16px;
  border-radius: 7px;
  background: #FFF8E1;
  border: 1px solid #FFD54F;
  color: #6D4C00;
  font-size: 0.9rem;
}
.advertencia-precio {
  background: #FDEDEC;
  border: 2px solid #E74C3C;
  color: #922B21;
  padding: 12px 18px;
  border-radius: 8px;
  margin-bottom: 18px;
  font-weight: 700;
  font-size: 0.95rem;
}

/* --- Tablas --- */
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
thead tr { background: #1B3A6B; color: white; }
thead th { padding: 9px 12px; text-align: left; font-weight: 600; }
thead th.num { text-align: right; }
tbody tr:nth-child(even) { background: #D6E4F7; }
tbody tr:hover { background: #C4D8F2; }
tbody td { padding: 7px 12px; border-bottom: 1px solid #E8EEF7; }
tbody td.num { text-align: right; font-variant-numeric: tabular-nums; }
tfoot tr { background: #E87722; color: white; font-weight: 700; }
tfoot td { padding: 9px 12px; }
tfoot td.num { text-align: right; }

/* --- Wizard (pasos para crear usuario) --- */
.wizard-pasos {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 20px;
  padding: 12px 0;
}
.wizard-paso {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #999;
  transition: color 0.2s;
}
.wizard-paso.activo {
  color: #1B3A6B;
}
.wizard-paso-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #D6E4F7;
  color: #999;
  font-size: 0.82rem;
  font-weight: 700;
  transition: background 0.2s, color 0.2s;
}
.wizard-paso.activo .wizard-paso-num {
  background: #1B3A6B;
  color: white;
}
.wizard-paso-linea {
  flex: 1;
  height: 2px;
  background: #D6E4F7;
  margin: 0 14px;
}

/* --- Estados AJAX (loading, error, ok) --- */
.estado-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 7px;
  background: #FFF8E1;
  border: 1px solid #FFD54F;
  color: #6D4C00;
  font-size: 0.88rem;
  font-weight: 600;
}
.estado-error {
  padding: 10px 14px;
  border-radius: 7px;
  background: #FDEDEC;
  border: 1px solid #E74C3C;
  color: #922B21;
  font-size: 0.88rem;
  font-weight: 600;
}
.estado-ok {
  padding: 10px 14px;
  border-radius: 7px;
  background: #E8F8F5;
  border: 1px solid #1E8449;
  color: #1E8449;
  font-size: 0.88rem;
  font-weight: 600;
}

/* --- Spinner --- */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2.5px solid #FFD54F;
  border-top-color: #6D4C00;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- Accordion (detalle de usuario) --- */
.accordion-flecha {
  display: inline-block;
  font-size: 0.7rem;
  margin-right: 6px;
  color: #1B3A6B;
  transition: transform 0.2s;
}
.fila-usuario:hover { background: #EEF4FF !important; }
.detalle-usuario td {
  padding: 0 !important;
  border-bottom: 2px solid #D6E4F7;
}
.detalle-contenido {
  padding: 16px 24px;
  background: #F8FAFD;
}
.detalle-seccion {
  margin-bottom: 14px;
}
.detalle-seccion:last-child { margin-bottom: 0; }
.detalle-seccion h3 {
  font-size: 0.88rem;
  color: #1B3A6B;
  margin-bottom: 8px;
  font-weight: 700;
}
.detalle-nube-info {
  font-size: 0.88rem;
  color: #333;
}
.nube-sin-cuenta {
  color: #999;
  font-style: italic;
  margin-bottom: 6px;
}

/* --- Estados de cuenta nube --- */
.nube-estado {
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 0.76rem;
  font-weight: 700;
}
.nube-activa {
  background: #E8F8F5;
  color: #1E8449;
}
.nube-inactiva {
  background: #F2F3F4;
  color: #999;
}

/* --- Boton eliminar --- */
.btn-eliminar {
  background: #C0392B;
  color: white;
  display: inline-block;
  padding: 5px 14px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s;
}
.btn-eliminar:hover { opacity: 0.87; }

/* --- Boton desvincular --- */
.btn-desvincular {
  background: #E87722;
  color: white;
  display: inline-block;
  padding: 5px 14px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s;
}
.btn-desvincular:hover { opacity: 0.87; }

/* --- Boton cancelar --- */
.btn-cancelar {
  background: #95A5A6;
  color: white;
  display: inline-block;
  padding: 9px 22px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s;
}
.btn-cancelar:hover { opacity: 0.87; }

/* --- Modal de confirmacion --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
}
.modal-contenido {
  background: white;
  border-radius: 10px;
  padding: 28px 32px;
  max-width: 460px;
  width: 90%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}
.modal-contenido h3 {
  color: #C0392B;
  margin-bottom: 12px;
  font-size: 1.1rem;
}
.modal-acciones {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* --- Badges --- */
.badge {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.87rem;
  font-weight: 600;
}
.badge-remito { background: #1B3A6B; color: white; }
.badge-pres   { background: #E87722; color: white; }
.rol-badge {
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 0.76rem;
  font-weight: 700;
}
.rol-admin   { background: #E87722; color: white; }
.rol-cliente { background: #1B3A6B; color: white; }
.tipo-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  background: #1B3A6B;
  color: white;
  white-space: nowrap;
}
.tipo-badge.pres { background: #E87722; }

/* Badges de categoria */
.cat-badge {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.74rem;
  font-weight: 600;
}
.cat-Agua        { background: #D6EAF8; color: #1A5276; }
.cat-Gas         { background: #FEF9E7; color: #7D6608; }
.cat-Calefaccion { background: #FDEDEC; color: #922B21; }
.cat-Desague     { background: #E8F8F5; color: #1E8449; }
.cat-Bano        { background: #EBDEF0; color: #6C3483; }
.cat-Varios      { background: #F2F3F4; color: #555; }

/* --- Filtro por grupo (Informe 6) --- */
.filtro-grupos {
  background: #F8FAFD;
  border: 1px solid #D6E4F7;
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 18px;
}
.filtro-grupos-titulo {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1B3A6B;
  margin-bottom: 10px;
}
.filtro-grupos-opciones {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
}
.filtro-grupo-opcion {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background 0.15s;
}
.filtro-grupo-opcion:hover { background: #EDF3FC; }
.filtro-grupo-opcion input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
  accent-color: #1B3A6B;
}
.filtro-grupo-etiqueta {
  font-size: 0.82rem;
  color: #1B3A6B;
  font-weight: 600;
}
.filtro-grupo-todos-etiqueta {
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* --- Upload / Drop zone --- */
p.intro { color: #555; margin-bottom: 24px; font-size: 0.93rem; line-height: 1.5; }
.drop-zone {
  border: 2.5px dashed #1B3A6B;
  border-radius: 10px;
  padding: 52px 32px;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s;
  background: #F8FAFD;
}
.drop-zone:hover,
.drop-zone.drag-over { background: #D6E4F7; }
.drop-zone .icono { font-size: 3rem; margin-bottom: 14px; }
.drop-zone strong { font-size: 1.05rem; color: #1B3A6B; }
.drop-zone p { color: #777; margin-top: 8px; font-size: 0.88rem; }
#lista-archivos { margin-top: 20px; }
.archivo-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 7px;
  background: #F0F4FA;
  margin-bottom: 7px;
  font-size: 0.88rem;
  color: #333;
}
#btn-procesar {
  margin-top: 22px;
  padding: 11px 28px;
  border-radius: 7px;
  background: #1B3A6B;
  color: white;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: none;
  transition: opacity 0.15s;
}
#btn-procesar:hover { opacity: 0.87; }

/* --- Selector de informes --- */
.resumen { display: flex; gap: 12px; flex-wrap: wrap; }
.grid-informes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.card-informe {
  border: 2.5px solid #D6E4F7;
  border-radius: 9px;
  padding: 16px 18px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  position: relative;
  background: white;
}
.card-informe:hover:not(.proximo) {
  border-color: #1B3A6B;
  box-shadow: 0 3px 12px rgba(27,58,107,0.13);
}
.card-informe.seleccionado {
  border-color: #1B3A6B;
  background: #EEF4FF;
}
.card-informe.proximo { opacity: 0.5; cursor: default; }
.card-informe .num { font-size: 1.5rem; font-weight: 800; color: #E87722; margin-bottom: 4px; }
.card-informe .nombre { font-weight: 700; color: #1B3A6B; font-size: 0.95rem; margin-bottom: 5px; }
.card-informe .desc { font-size: 0.82rem; color: #666; line-height: 1.4; }
.badge-proximo {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #aaa;
  color: white;
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: 8px;
  font-weight: 700;
}
.btn-generar {
  padding: 11px 28px;
  border-radius: 7px;
  background: #1B3A6B;
  color: white;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: none;
  transition: opacity 0.15s;
}
.btn-generar:hover { opacity: 0.87; }

/* --- Opciones de informe --- */
.opciones-panel {
  display: none;
  margin-bottom: 16px;
  padding: 14px 18px;
  background: #F8FAFD;
  border: 2px solid #D6E4F7;
  border-radius: 8px;
}
.opciones-panel label.titulo-opcion {
  font-weight: 700;
  color: #1B3A6B;
  font-size: 0.95rem;
  display: block;
  margin-bottom: 10px;
}
.radio-group { display: flex; gap: 14px; }
.radio-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.9rem;
}
.radio-group input[type="radio"] {
  accent-color: #1B3A6B;
  width: 18px;
  height: 18px;
}
.rango-inputs {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.rango-inputs .campo-inline input[type="date"],
.rango-inputs .campo-inline input[type="text"] {
  width: 200px;
}

/* --- Boton OwnCloud --- */
.btn-owncloud {
  background: #0082C9;
  color: white;
  display: inline-block;
  padding: 9px 22px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: opacity 0.15s;
}
.btn-owncloud:hover { opacity: 0.87; }

/* --- Acciones informe --- */
.acciones { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; align-items: center; }

/* --- Explorador de carpetas (nube) --- */
.nube-breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: #F0F4FA;
  border-radius: 7px;
  margin-bottom: 16px;
  font-size: 0.88rem;
  flex-wrap: wrap;
}
.nube-breadcrumb-link {
  color: #1B3A6B;
  cursor: pointer;
  font-weight: 600;
}
.nube-breadcrumb-link:hover { text-decoration: underline; }
.nube-breadcrumb-sep { color: #999; margin: 0 2px; }
.nube-breadcrumb-actual { color: #E87722; font-weight: 700; }

.nube-contenido {
  border: 2px solid #D6E4F7;
  border-radius: 8px;
  max-height: 420px;
  overflow-y: auto;
}
.nube-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid #E8EEF7;
  font-size: 0.9rem;
  transition: background 0.12s;
}
.nube-item:last-child { border-bottom: none; }
.nube-item-carpeta,
.nube-item-subir { cursor: pointer; }
.nube-item-carpeta:hover,
.nube-item-subir:hover { background: #D6E4F7; }
.nube-item-pdf { background: #FAFBFD; }
.nube-item-archivo { color: #999; }
.nube-icono { font-size: 1.2rem; flex-shrink: 0; width: 28px; text-align: center; }
.nube-nombre { flex: 1; word-break: break-word; }
.nube-tamano { color: #999; font-size: 0.8rem; white-space: nowrap; }
.nube-vacio {
  padding: 32px;
  text-align: center;
  color: #999;
  font-size: 0.9rem;
}
.nube-loading {
  text-align: center;
  padding: 24px;
  color: #1B3A6B;
  font-weight: 600;
  font-size: 0.95rem;
}
.nube-info-pdfs {
  margin-top: 12px;
  padding: 10px 16px;
  background: #E8F8F5;
  border: 1px solid #1E8449;
  border-radius: 7px;
  color: #1E8449;
  font-size: 0.88rem;
  font-weight: 600;
}

/* --- Selector de modo (archivos / carpeta) --- */
.modo-selector {
  display: flex;
  gap: 0;
  margin-bottom: 22px;
  border: 2px solid #D6E4F7;
  border-radius: 8px;
  overflow: hidden;
}
.btn-modo {
  flex: 1;
  padding: 10px 18px;
  border: none;
  background: #F8FAFD;
  color: #666;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn-modo:hover { background: #EEF4FF; }
.btn-modo.activo {
  background: #1B3A6B;
  color: white;
}

/* --- Seleccion multiple de carpetas --- */
.nube-seleccion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  color: #1B3A6B;
  font-size: 0.9rem;
}
.btn-limpiar {
  background: none;
  border: 1px solid #ccc;
  border-radius: 5px;
  padding: 3px 12px;
  font-size: 0.78rem;
  color: #666;
  cursor: pointer;
}
.btn-limpiar:hover { background: #f0f0f0; }
.nube-seleccion-lista {
  border: 2px solid #1B3A6B;
  border-radius: 8px;
  overflow: hidden;
}
.nube-seleccion-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid #D6E4F7;
  font-size: 0.88rem;
  background: #EEF4FF;
}
.nube-seleccion-item:last-child { border-bottom: none; }
.nube-seleccion-ruta {
  flex: 1;
  color: #999;
  font-size: 0.78rem;
  text-align: right;
}
.btn-quitar {
  background: none;
  border: none;
  color: #C0392B;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 4px;
  font-weight: 700;
}
.btn-quitar:hover { color: #922B21; }
.btn-selec-carpeta {
  background: #D6E4F7;
  border: none;
  border-radius: 5px;
  width: 28px;
  height: 28px;
  font-size: 0.9rem;
  cursor: pointer;
  color: #1B3A6B;
  font-weight: 700;
  flex-shrink: 0;
  transition: background 0.15s;
}
.btn-selec-carpeta:hover { background: #1B3A6B; color: white; }
.nube-item-seleccionada {
  background: #EEF4FF !important;
  border-left: 3px solid #1B3A6B;
}
.btn-seleccionado {
  background: #1E8449 !important;
  color: white !important;
}

/* --- Barra de progreso --- */
.progreso-detalle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}
.progreso-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 14px;
  background: #F0F4FA;
  border-radius: 6px;
  font-size: 0.88rem;
}
.progreso-label { color: #666; }
.progreso-valor { font-weight: 700; color: #1B3A6B; }
.barra-progreso-container {
  background: #E8EEF7;
  border-radius: 8px;
  height: 22px;
  overflow: hidden;
  margin-bottom: 6px;
}
.barra-progreso {
  height: 100%;
  background: linear-gradient(90deg, #1B3A6B, #2E5BA7);
  border-radius: 8px;
  transition: width 0.4s ease;
}
.barra-progreso.barra-completada {
  background: linear-gradient(90deg, #1E8449, #27AE60);
}
.barra-progreso.barra-error {
  background: linear-gradient(90deg, #C0392B, #E74C3C);
}
.progreso-porcentaje {
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #1B3A6B;
}

/* --- Resumen de remitos con boton de previsualizacion --- */
.resumen-remitos-lista {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
}
.resumen-remito-fila {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  background: #F5F5F5;
  border-radius: 6px;
  border: 1px solid #E8EEF7;
}
.resumen-remito-info {
  color: #222;
  flex: 1;
}
.btn-pdf-preview {
  background: #1B3A6B;
  color: white;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}
.btn-pdf-preview:hover {
  background: #2E5BA7;
}
.btn-pdf-preview:active {
  transform: translateY(1px);
}

/* --- Modal de previsualizacion de PDF --- */
.pdf-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pdf-modal[hidden] {
  display: none;
}
.pdf-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  cursor: pointer;
}
.pdf-modal-contenido {
  position: relative;
  background: white;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  width: 92vw;
  max-width: 1100px;
  height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.pdf-modal-header {
  background: #1B3A6B;
  color: white;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.pdf-modal-titulo {
  font-weight: 700;
  font-size: 1rem;
}
.pdf-modal-cerrar {
  background: rgba(255, 255, 255, 0.18);
  color: white;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  padding: 4px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}
.pdf-modal-cerrar:hover {
  background: rgba(255, 255, 255, 0.32);
}
.pdf-modal-cuerpo {
  flex: 1;
  position: relative;
  background: #F5F5F5;
  overflow: hidden;
}
.pdf-modal-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}
.pdf-modal-iframe[hidden] {
  display: none;
}
.pdf-modal-cargando,
.pdf-modal-error {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  font-weight: 600;
}
.pdf-modal-cargando {
  color: #1B3A6B;
  font-size: 0.95rem;
}
.pdf-modal-error {
  color: #C0392B;
}
.pdf-modal-cargando[hidden],
.pdf-modal-error[hidden] {
  display: none;
}
@media (max-width: 640px) {
  .pdf-modal-contenido {
    width: 100vw;
    height: 100vh;
    max-width: none;
    border-radius: 0;
  }
  .resumen-remito-fila {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
}
