/* 
.container
.volver
.volver a
.volver a:hover
.espaciador-footer
footer

Blanco: ffffff
Gris Claro: #eeeeee
Gris Oscuro: #888888
Negro: 000000
Rojo Claro: #ffeaea
Rojo: dc272c
Verde Claro: #e7ffe7
Verde Medio: #20b820
Verde Oscuro: #16691c

*/
/* dame css completo de los dos codigo que te he dado, ordenado y detallado y el del php  */


/* xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx */
/* xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx */
/* xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx */
/* xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx */
/* ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ */


/* ***************************** ESTILO GLOBAL ***************************** */
/* ========================= FORMULARIOS GENERALES ========================= */
/* ************************************************************************* */

html {
    height: 100%;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    background: #ffffff;
    font-family: Arial, sans-serif;
    overflow-x: hidden;
}
body {
    min-height: 100vh;
    margin: 0;
    padding: 0;
    background: #eeeeee;
    font-family: Arial, sans-serif;
}
.container {
    max-width: 900px;
    width: 100%;
    background: #ffffff;
    border: 2px solid #000000;
    border-radius: 14px;
    box-shadow: 0 2px 16px #000000;
    padding: 34px 24px 24px 24px;
    box-sizing: border-box;
    text-align: center;
    margin: 40px auto 0 auto; /* Auto horizontal centra SIEMPRE *
    /* No necesita display:flex, ni margin auto */
}
.centrado-wrapper {
    min-height: 100vh;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}
.container form label,
.container-index form label,
.container form input[type="file"],
.container-index form input[type="file"],
.container form input[type="text"],
.container-index form input[type="text"],
.container form input[type="password"],
.container-index form input[type="password"],
.container form select,
.container-index form select,
.container form button,
.container-index form button,
.container form input[type="submit"],
.container-index form input[type="submit"] {
    width: 100%;
    margin-bottom: 0px;
    font-size: 20px;
}
.container form input:focus,
.container form select:focus {
    border-color: #dc272c;
    outline: none;
}
.container button,
.container input[type="submit"] {
    background: #dc272c;
    color: white;
    font-weight: bold;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    padding: 12px;
    transition: background 0.3s;
}
.container button:hover,
.container input[type="submit"]:hover {
    background: #dc272c;
}
.table-wrap{
  border: 2px solid #000;
  border-radius: 14px;
  overflow: hidden;              /* recorta las esquinas de la tabla y celdas */
  background: #fff;
  box-shadow: 0 2px 16px #00000055;
}

.tabla-admin{
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;     /* importante */
  border-spacing: 0;
  background: transparent;       /* el fondo lo pone el wrapper */
}
td {
    border: 1px solid #eeeeee;
    padding: 8px 10px;
    text-align: center;
    vertical-align: middle;
    overflow: hidden;
}
th {
    border: 1px solid #ffffff;
    background: #dc272c;
    color: white;
    cursor: pointer;
    user-select: none;
    position: relative;
    white-space: nowrap;
    font-weight: bold;
    text-align: center;
    text-overflow: ellipsis;
}
td.codigo {
    width: 70px;
    white-space: nowrap;
    text-overflow: ellipsis;
}
th.codigo {
    width: 70px;
    white-space: nowrap;
    text-overflow: ellipsis;
}
h1 {
    color: #dc272c;
    margin-bottom: 15px;
    text-align: center;
    font-size: 1.2em;
}
h2 {
    color: #000000;
    margin-bottom: 15px;
    font-size: 1em;
}
h4 {
    color: #000000;
    margin: 12px 0 7px 0;
    font-size: 0.93em;
}
tr:hover {
    background-color: #eeeeee;
    cursor: pointer;
}
.msg {
    background: #e7ffe7;
    color: #16691c;
    border: 1px solid #20b820;
    border-radius: 14px;
    padding: 13px 16px;
    text-align: center;
    margin-bottom: 18px;
    font-weight: bold;
    font-size: 1.08em;
}
.barra-scan {
    background: #eeeeee;
    padding: 16px;
    border-radius: 14px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.barra-scan label {
    font-weight: bold;
    flex-shrink: 0;
}
.barra-scan input[type="text"] {
    flex-grow: 1;
    font-size: 1.1em;
    padding: 10px 14px;
    border-radius: 14px;
    border: 1px solid #eeeeee;
}
.barra-scan button {
    background: #dc272c;
    color: #ffffff;
    border: none;
    border-radius: 14px;
    padding: 12px 20px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease;
}
.barra-scan button:hover {
    background: #dc272c;
}
tbody tr {
    background: #ffffff;
}
.mensaje {
    background: #ffeaea;
    color: #dc272c;
    text-align: center;
    margin-bottom: 18px;
    border-radius: 14px;
    padding: 8px;
    font-size: 1.08em;
}

/* ===================== MOBILE FIRST (por defecto para todos) ===================== */

button, .btn, input[type="submit"] {
    width: 100%;
    background: #dc272c;
    color: #ffffff;
    border: none;
    border-radius: 14px;
    padding: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: background 0.18s;
    margin-bottom: 3px;
}
button:hover, .btn:hover, input[type="submit"]:hover {
    background: #dc272c;
}
body.login-bg {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    overflow-y: auto;
    margin: 0;
    padding: 0;
}
.login-outer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 96vw;
    max-width: 340px;
    border: 0px solid red;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    flex: 1 0 auto;
    background: #ffffff;
}
.login-logo {
    display: block;
    width: 88vw;
    object-fit: contain;
    transition: max-width 0.2s, width 0.2s;
    margin: 0 auto 22px auto; /* Centrado + separación abajo */
    max-width: 220px;         /* O el tamaño que prefieras */
    height: auto;
}

.login-box {
    width: 95vw;
    max-width: 300px;
    min-width: 0;
    margin: 0 0 0 0;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 2px 16px #000000;
    padding: 12px 6px 10px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    overflow-x: hidden;
}
.login-box form {
    width: 100%;
    max-width: 270px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.login-box input {
    width: 100%;
    max-width: 240px;
    padding: 7px;
    margin: 6px 0 11px 0;
    border-radius: 14px;
    border: 1px solid #eeeeee;
    font-size: 14px;
    box-sizing: border-box;
    display: block;
    text-align: center;
}
.error {
    color: red;
    margin-bottom: 8px;
    font-weight: bold;
    text-align: center;
    font-size: 0.95em;
}

/* ===================== SOLO SOBRESCRIBE EN ESCRITORIO ===================== */
@media (min-width: 993px) {
h1 {
    margin-bottom: 24px;
    font-size: 2.2em;
}
h2 {
    margin-bottom: 24px;
    font-size: 1.3em;
}
h4 {
    margin: 20px 0 14px 0;
    font-size: 1.11em;
}
button,
.btn,
input[type="submit"] {
    padding: 12px;
    font-size: 30px;
    margin-bottom: 4px;
}
.login-outer {
    width: 900px;
    max-width: 900px;
}
.login-logo {
    width:100%;
    max-width:400px;
    margin-bottom: 24px;
    height: auto;
}
.login-box {
    width: 800px;
    max-width: 800px;
    padding: 36px 28px 28px 28px;
}
.login-box form {
    width: 700px;
    max-width: 700px;
}
.login-box input {
    width: 700px;
    max-width: 700px;
    padding: 12px;
    margin: 8px 0 17px 0;
    font-size: 30px;
}
.error {
    margin-bottom: 14px;
    font-size: 1.1em;
}
}

@media (max-width: 400px) {
.container {
    width: 100%;
    max-width: 100%;
    margin: 10px 5px 10px 5px;
    background: #ffffff;
    border: 2px solid #000000;
    border-radius: 14px;
    display: block;
    padding: 4px !important;
    box-shadow: 0 2px 16px #000000;
    box-sizing: border-box;
}
.comparar-contenedor {
    flex-direction: column;    /* En móvil: vertical */
    gap: 2px;                  /* Menos espacio entre input y botón */
}
.comparar {
    width: 35px !important;
    height: 35px !important;
    font-size: 12px !important;
    margin: 0 auto;
}
.comparar-contenedor input[type="number"] {
    width: 38px;
    font-size: 11px;
    margin-bottom: 0;
}
}
/* *************************** FIN ESTILO GLOBAL *************************** */
/* ======================= FIN FORMULARIOS GENERALES ======================= */
/* ************************************************************************* */

/* =============================== INDEX.PHP =============================== */

.container-index {
    max-width: 390px;
    width: 100%;
    margin: 10px auto;  /* Cambia esto: auto centra horizontalmente */
    margin-bottom:18px; 
    background: #ffffff;
    border: 2px solid #000000;
    border-radius: 14px;
    display: block;
    padding: 34px 24px 24px 24px;
    box-shadow: 0 2px 16px #000000;
    box-sizing: border-box;
    text-align: center;
    vertical-align: middle;
    font-size:17px;
}

@media (max-width: 400px) {
.container-index {
    max-width: 350px;
    width: 100%;
    margin: 10px 10px 10px 10px;
    background: #ffffff;
    border: 2px solid #000000;
    border-radius: 14px;
    display: block;
    padding: 34px 34px 24px 34px;
    box-shadow: 0 2px 16px #000000;
    box-sizing: border-box;
    text-align: center;
    vertical-align: middle;
}
}

/* ============================= FIN INDEX.PHP ============================= */
/* ============================= DASHBOARD.PHP ============================= */

body.dashboard {
  padding: 0;
  background: #eeeeee;
  font-family: Arial, sans-serif;
  min-height: 100vh;
  margin: 0;
}

/* Panel */
.panel-control {
  width: 850px;
  margin: 10px 5px;
  background: #ffffff;
  border-radius: 14px;
  border: 2px solid #000000;
  box-shadow: 0 2px 16px #000000;
  padding: 34px 24px 24px 24px;
}
.panel-control h2 {
  color: #dc272c;
  margin-bottom: 24px;
}

/* Menú */
.menu {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  justify-content: center;
  margin-bottom: 12px;
  width: 100%;
  max-width: 850px;
  background: transparent;
  box-shadow: none;
  border-radius: 14px;
  padding: 0;
}

/* Botones (activos y desactivados comparten base) */
.menu a,
.menu .boton-desactivado {
  background: #ffffff;
  color: #000000;
  border-radius: 6px;
  border: 2px solid #dc272c;
  text-decoration: none;
  text-align: center;
  font-weight: bold;
  font-size: 1.1em;
  transition: background .15s, color .15s, border-color .18s, transform .08s;
  box-sizing: border-box;
  margin: 0;
  box-shadow: 0 2px 16px #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 56px;
  padding: 0 10px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation; /* mejora respuesta táctil */
}

/* Desactivados (sin permiso) */
.menu .boton-desactivado {
  background: #f0f0f0 !important;
  color: #888888 !important;
  border: 2px solid #bbbbbb !important;
  box-shadow: none !important;
  cursor: not-allowed;
  pointer-events: none;
  filter: grayscale(100%);
}

/* Hover SOLO en dispositivos con ratón */
@media (hover: hover) and (pointer: fine) {
  .menu a:hover { background: #888888; color: #ffffff; }
}

/* Activo/foco en táctiles Y fallback general */
.menu a:active,
.menu a:focus-visible,
.menu a.is-pressed { /* .is-pressed la pone JS en móvil */
  background: #888888;
  color: #ffffff;
  outline: none;
}

/* Garantiza que los desactivados nunca cambian */
.menu .boton-desactivado:hover,
.menu .boton-desactivado:active,
.menu .boton-desactivado:focus-visible,
.menu .boton-desactivado.is-pressed {
  background: #f0f0f0 !important;
  color: #888888 !important;
  border-color: #bbbbbb !important;
}

/* Botón cerrar sesión */
.menu-cerrar {
  grid-column: 1 / -1;
  display: block;
  padding: 0;
  background: transparent;
  box-shadow: none;
  border: none;
  margin: 10px 0 0 0;
  width: 100%;
}
.menu-cerrar a {
  background: #dc272c !important;
  color: #ffffff !important;
  border: 2px solid #000000;
  font-size: 1.15em;
  width: 100%;
  border-radius: 6px;
  display: block;
  text-align: center;
  padding: 18px 0;
  font-weight: bold;
  margin: 0;
}

/* ===== Móvil <= 400px ===== */
@media (max-width: 400px) {
  .panel-control {
    max-width: 100%;
    width: 100%;
    margin: 10px;
    padding: 34px 24px 24px 24px;
  }
  .panel-control h2 { font-size: 1em; margin-bottom: 8px; }

  .menu { grid-template-columns: 1fr !important; gap: 14px; }

  .menu a,
  .menu .boton-desactivado {
    width: 100%;
    padding: 16px 0;
    border-radius: 14px;
    font-size: 1.08em;
    display: block;
  }

  .menu-cerrar a {
    font-size: 1.12em;
    margin-top: 8px;
    padding: 16px 0;
    border-radius: 14px;
  }
}

/* =========================== FIN DASHBOARD.PHP =========================== */
/* ======================== 1 LISTADO_INVENTARIO.PHP ======================== */

.tabla-productos {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    font-size: 16px;
    box-shadow: 0 2px 16px #00000018;
    margin-bottom: 22px;
    border-radius: 14px;
    overflow: hidden;
    border: 2px solid #dc272c;
}
.tabla-productos th, .tabla-productos td {
    padding: 10px 8px;
    border: none;
    text-align: center;
    vertical-align: middle;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: #fff;
}
.tabla-productos th:not(:last-child),
.tabla-productos td:not(:last-child) {
    border-right: 1px solid #eeeeee;
}
.tabla-productos tr:not(:last-child) td,
.tabla-productos tr:not(:last-child) th {
    border-bottom: 1px solid #eeeeee;
}
.tabla-productos th {
    background: #dc272c;
    color: #fff;
    font-weight: bold;
    text-align: center;
}
.tabla-productos th:first-child { border-top-left-radius: 12px; }
.tabla-productos th:last-child { border-top-right-radius: 12px; }
.tabla-productos tr:last-child td:first-child { border-bottom-left-radius: 12px; }
.tabla-productos tr:last-child td:last-child { border-bottom-right-radius: 12px; }
.tabla-productos tr:hover td { background: #eeeeee; }
.no-productos td {
    text-align: center !important;
    font-size: 1.1em;
    color: #888888;
    padding: 18px 0;
    background: #fff;
}
.btn-guardar {
    background: #dc272c;
    color: #fff;
    padding: 15px 16px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    margin: 8px 0 0 0;
    min-width: 158px;
    transition: background 0.17s, color 0.15s, box-shadow 0.17s;
    box-shadow: 0 2px 8px #00000026;
    display: inline-block;
    text-align: center;
}
.btn-guardar:hover,
.btn-guardar:focus {
    background: #b92122;
    color: #fff;
    outline: none;
    box-shadow: 0 2px 18px #dc272c66;
}
.btn-eliminar {
    background: #fff;
    color: #dc272c;
    padding: 8px 16px;
    border: 2px solid #dc272c;
    border-radius: 8px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    margin: 8px 0 0 0;
    min-width: 110px;
    transition: background 0.17s, color 0.15s, box-shadow 0.17s, border 0.16s;
    box-shadow: 0 2px 8px #00000026;
    display: inline-block;
    text-align: center;
}
.btn-eliminar:hover,
.btn-eliminar:focus {
    background: #dc272c;
    color: #fff;
    border: 2px solid #b92122;
    outline: none;
    box-shadow: 0 2px 18px #dc272c66;
}

/* ========== ANCHO POR COLUMNA EN PC ========== */
.tabla-productos th.col-id, .tabla-productos td.col-id                   { width: 8%; }
.tabla-productos th.col-descripcion, .tabla-productos td.col-descripcion { width: 54%; }
.tabla-productos th.col-fecha, .tabla-productos td.col-fecha             { width: 18%; }
.tabla-productos th.col-botones, .tabla-productos td.col-botones         { width: 20%; }

@media (max-width: 400px) {
.btn-guardar,
.btn-eliminar {
    font-size: 12px;
    min-width: 64px;
    padding: 6px 7px;
  }
  .tabla-productos th.col-id, .tabla-productos td.col-id                   { width: 18% !important; display: inline-block; vertical-align: top; }
  .tabla-productos th.col-descripcion, .tabla-productos td.col-descripcion { width: 48% !important; display: inline-block; vertical-align: top; }
  .tabla-productos th.col-fecha, .tabla-productos td.col-fecha             { width: 18% !important; display: inline-block; vertical-align: top; }
  .tabla-productos th.col-botones, .tabla-productos td.col-botones         { width: 16% !important; display: inline-block; vertical-align: top; }
  .tabla-productos th, .tabla-productos td {
    white-space: normal !important;
    box-sizing: border-box;
    text-align: left;
    min-width: 0 !important;
    max-width: 100% !important;
    padding: 6px 3px;
  }
}

.btn-parpadeo {
    animation: parpadeo 1s infinite;
    background: #22c55e !important;
    border-color: #16a34a !important;
    color: #fff !important;
}

@keyframes parpadeo {
    0%   { opacity: 1; }
    50%  { opacity: 0.4; }
    100% { opacity: 1; }
}

/* ===================== 1 FIN LISTADO_INVENTARIOS.PHP ===================== */
/* SUBFAMILIA */
/* ========================= 1-1 VER.INVENTARIO.PHP ========================= */

/* === BLOQUEO TOTAL Y EXCLUSIVO SOLO PARA ESTA TABLA === */
.tabla-inventario-unica, 
.tabla-inventario-unica th, 
.tabla-inventario-unica td, 
.tabla-inventario-unica col {
    all: unset;
    box-sizing: border-box;
}

.tabla-inventario-unica {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    background: #000000;
    font-size: 16px;
    box-shadow: 0 2px 8px #0002;
    border-radius: 14px;
    overflow: hidden;
    border: 0;
    margin-bottom: 22px;
}
.tabla-inventario-unica th, .tabla-inventario-unica td {
    padding: 10px 8px;
    text-align: center;
    vertical-align: middle;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: #fff;
    border: none;
}
.tabla-inventario-unica th {
    background: #dc272c;
    color: #fff;
    font-weight: bold;
    user-select: none;
}
th.col-descripcion-inv, td.col-descripcion-inv {
    text-align: left !important;
    padding-left: 14px;
}
.tabla-inventario-unica th:not(:last-child),
.tabla-inventario-unica td:not(:last-child) {
    border-right: 1px solid #eeeeee;
}
.tabla-inventario-unica tr:not(:last-child) td,
.tabla-inventario-unica tr:not(:last-child) th {
    border-bottom: 1px solid #eeeeee;
}
/* Esquinas redondeadas solo primera/última columna */
.tabla-inventario-unica th:first-child { border-top-left-radius: 7px; }
.tabla-inventario-unica th:last-child { border-top-right-radius: 7px; }
.tabla-inventario-unica tr:last-child td:first-child { border-bottom-left-radius: 7px; }
.tabla-inventario-unica tr:last-child td:last-child { border-bottom-right-radius: 7px; }
.tabla-inventario-unica tr:hover td { background: #eeeeee; }
.no-productos-inv td {
    text-align: center !important;
    font-size: 1.1em;
    color: #888888;
    padding: 18px 0;
    background: #fff;
}
/* ---------- RESPONSIVE Y SCROLL ----------- */

/* Responsive solo tabla */
@media (max-width: 900px) {
    .tabla-inventario-unica th, .tabla-inventario-unica td { font-size: 13px; padding: 5px 2px; }
}

/* Bloqueo máximo en móvil */
@media (max-width: 400px) {
    .tabla-inventario-unica th, .tabla-inventario-unica td, .tabla-inventario-unica col {
        min-width: 0 !important;
        width: auto !important;
        max-width: none !important;
        font-size: 13px !important;
        white-space: normal !important;
        padding: 5px 2px !important;
        box-sizing: border-box !important;
    }
    .col-codigo-inv, .col-descripcion-inv, .col-alm1-inv, .col-alm2-inv, .col-alm3-inv {
        width: auto !important; max-width: none !important;
    }
    .col-descripcion-inv { text-align: center !important; padding-left: 0 !important; }
}

/* ======================= 1-1 FIN VER_INVENTARIO.PHP ======================= */
/* SUBFAMILIA */
/* ========================= 1-2 COMPARAR_STOCK.PHP ========================= */

/***************************************************************
 * ESTILOS UNIFICADOS – comparar_stock.php
 * - Mantiene tu diseño original
 * - Añade control de ancho por columna (.col-*)
 * - Ordenado por secciones y con media queries al final
 ****************************************************************/

/* =========================
   1) BLOQUES DE INFORMACIÓN
   ========================= */
/***************************************************************
 * ESTILOS – comparar_stock.php (100% ancho del container)
 * - Tabla siempre al 100% del contenedor
 * - Columnas con anchos en % (desktop y móvil)
 * - Títulos "Stock actual"/"Actual" según viewport
 ****************************************************************/

/* =========================
   1) BLOQUES DE INFORMACIÓN
   ========================= */
.datos {
    font-size: 17px;
    margin-bottom: 18px;
    background: #eeeeee;
    padding: 10px;
    border-radius: 14px;
    margin-bottom: 20px;
}

/* =========================
   2) MINI FORMULARIO SUPERIOR
   ========================= */
.mini-form {
    margin-bottom: 28px;
}
.mini-form form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
.mini-form input[type="text"] {
    width: 240px;
    max-width: 96vw;
    font-size: 1em;
    border-radius: 14px;
    border: 1px solid #eeeeee;
    padding: 9px;
}
.mini-form button {
    background: #dc272c;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1em;
}
.mini-form button:hover {
    background: #dc272c; /* efecto plano */
}

/* =========================
   3) TABLA DE RECUENTO (BASE)
   ========================= */
.table-recuento {
    width: 100%;              /* 100% del container */
    min-width: 480px;         /* mantiene legibilidad en pantallas angostas */
    border-collapse: collapse;
    background: #000000;
    table-layout: fixed;      /* reparte el ancho según width de columnas */
    box-shadow: 0 2px 16px #000000;
    margin-bottom: 20px;
    font-size: 16px;
}
.table-recuento th,
.table-recuento td {
    padding: 8px 6px;
    border: 1px solid #eeeeee;
    vertical-align: middle;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.table-recuento th {
    background: #dc272c;
    color: #ffffff;
    font-weight: bold;
    text-align: center;
}
.table-recuento td {
    text-align: left;
    background: #ffffff;
}
.table-recuento td:last-child,
.table-recuento th:last-child {
    text-align: center;
}

/* Mostrar texto distinto en desktop vs móvil para el th de Stock */
.table-recuento .label-desktop { display: inline; }
.table-recuento .label-mobile  { display: none; }

/* Inputs numéricos dentro de la tabla */
.table-recuento td input[type="number"] {
    width: 60px;
    font-size: 1em;
    border-radius: 14px;
    border: 1px solid #eeeeee;
    padding: 7px 8px;
    text-align: center;
    background: #eeeeee;
}

/* Botón eliminar fila */
.table-recuento button[type="submit"][name="eliminar_fila"] {
    background: #dc272c;
    color: #ffffff;
    border: none;
    padding: 4px 12px;
    border-radius: 14px;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.15s;
    line-height: 1;
    min-width: 34px;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.table-recuento button[type="submit"][name="eliminar_fila"]:hover {
    background: #dc272c;
}

/* Contenedor de acciones (si lo usas) */
.comparar-contenedor {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Botón "comparar" (si lo usas) */
.comparar {
    background: #16691c;
    color: #ffffff;
    border: none;
    border-radius: 14px;
    width: 38px;
    height: 34px;
    font-weight: bold;
    font-size: 1.3em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.comparar:hover {
    background: #16691c;
}

/* Eliminar desde bloque comparar (si lo usas) */
.eliminar-fila-btn {
    background: #dc272c;
    color: #ffffff;
    border: none;
    border-radius: 14px;
    width: 38px;
    height: 34px;
    font-size: 1.1em;
    margin-left: 7px;
    cursor: pointer;
    padding: 0;
}
.eliminar-fila-btn:hover {
    background: #dc272c;
}

/* ========================
   4) BOTONES DE GUARDADO
   ======================== */
.guardar-btn,
.btn-guardar-recuento {
    background: #16691c;
    color: #ffffff;
    border: none;
    border-radius: 14px;
    font-size: 1.08em;
    font-weight: bold;
    padding: 10px 22px;
    cursor: pointer;
    margin: 14px auto 0 auto;
    display: block;
    transition: background 0.17s;
}
.guardar-btn:hover,
.btn-guardar-recuento:hover {
    background: #16691c;
}

/* ==============================================
   5) CONTROL DE ANCHO POR COLUMNA (CLASES .col-*)
   ============================================== */
/* — Escritorio / PC —
   Porcentajes relativos al 100% de la tabla.
   La descripción queda flexible y rellena el resto.
*/
.table-recuento .col-codigo      { width: 12%; }
.table-recuento .col-referencia  { width: 12%; }
.table-recuento .col-descripcion { width: auto; }  /* flexible */
.table-recuento .col-stock       { width: 11%; text-align: center; }
.table-recuento .col-recuento    { width: 11%; text-align: center; }
.table-recuento .col-eliminar    { width: 8%;  text-align: center; }

/* Asegurar el recorte con ellipsis por columna */
.table-recuento td.col-codigo,
.table-recuento td.col-referencia,
.table-recuento td.col-descripcion,
.table-recuento td.col-stock,
.table-recuento td.col-recuento,
.table-recuento td.col-eliminar {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Input algo más proporcional en recuento */
.table-recuento td.col-recuento input[type="number"] {
    width: 70%;
    max-width: 90px;
}

/* ==================================================
   6) MEDIA QUERIES: TABLET Y MÓVIL (prioridad al final)
   ================================================== */

/* ====== <= 700px ====== */
@media (max-width: 700px) {

    .table-recuento {
        min-width: 390px;
        font-size: 13px;
    }
    .table-recuento th,
    .table-recuento td {
        font-size: 12px;
        padding: 6px 3px;
    }

    /* OCULTAR COLUMNA REFERENCIA EN MÓVIL (manteniendo tu enfoque) */
    .table-recuento th:nth-child(2),
    .table-recuento td:nth-child(2) {
        display: none !important;
    }

    /* Reparto de ancho en % con referencia oculta */
    .table-recuento .col-codigo      { width: 12%; }
    .table-recuento .col-descripcion { width: auto; }
    .table-recuento .col-stock       { width: 11%; text-align: center; }
    .table-recuento .col-recuento    { width: 11%; text-align: center; }
    .table-recuento .col-eliminar    { width: 11%; text-align: center; }

    /* Inputs más compactos en móvil medio */
    .comparar-contenedor input[type="number"] {
        width: 50px;
        font-size: 12px;
    }
    .guardar-btn,
    .btn-guardar-recuento {
        font-size: 1em;
        padding: 8px 13px;
    }
}

/* ====== <= 400px ====== */
@media (max-width: 400px) {

    .table-recuento {
        min-width: 280px;
        font-size: 10.6px;
    }
    .table-recuento th,
    .table-recuento td {
        font-size: 10.8px;
        padding: 4px 2px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 60px; /* límite general móvil pequeño */
    }

    /* Mantener "Actual" en móvil pequeño */
    .table-recuento .label-desktop { display: none; }
    .table-recuento .label-mobile  { display: inline; }

    /* Mantener oculto Referencia y (si existe) 6ª columna adicional */
    .table-recuento th:nth-child(2),
    .table-recuento td:nth-child(2) {
        display: none !important;
    }
    .table-recuento th:nth-child(6),
    .table-recuento td:nth-child(6) {
        display: none !important;
    }
    
/* Forzar solo los datos de la columna Descripción a la izquierda */
    .table-recuento td.col-descripcion {
    padding: 4px 1px !important;
    text-align: left !important;
}

/* Reparto ajustado en % (sin referencia) */
    .table-recuento .col-codigo      { width: 19%; }
    .table-recuento .col-descripcion { width: auto; }
    .table-recuento .col-stock       { width: 10%; text-align: center; }
    .table-recuento .col-recuento    { width: 17%; text-align: center; }

    /* Inputs aún más compactos */
    .table-recuento td input[type="number"] {
        width: 30px;
        font-size: 9.8px;
        min-width: 0;
        max-width: 100%;
    }
    .comparar-contenedor input[type="number"] {
        width: 36px;
        font-size: 9.8px;
    }

    .guardar-btn,
    .btn-guardar-recuento {
        font-size: 0.98em;
        padding: 7px 3px;
    }

    .table-recuento td.col-recuento input[type="number"] {
        width: 46px;
    }
}

/* ======================= 1-2 FIN COMPARAR_STOCK.PHP ======================= */
/* SUBFAMILIA */
/* ======================= 1-3 DIFERENCIAS_STOCK.PHP ======================= */

/* --------- TABLA ESTILO PRINCIPAL --------- */
.tabla-productos-diferencias-stock {
    width: 100%;
    border-collapse: collapse;
    margin: 28px auto 18px auto;
    font-size: 12px;
    background: #fafbfc;
    box-shadow: 0 2px 16px #000000;
    border-radius: 14px;
    overflow-x: auto;
}
.tabla-productos-diferencias-stock th,
.tabla-productos-diferencias-stock td {
    border: 1px solid #bbb;
    padding: 10px 12px;
    text-align: center;
    vertical-align: middle;
    font-family: inherit;
    font-size: 1em;
    box-sizing: border-box;
    min-width: 48px;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: background 0.13s, color 0.13s;
}
.tabla-productos-diferencias-stock th {
    background: #dc272c;
    color: #fff;
    font-weight: bold;
    font-size: 12px;
    letter-spacing: .5px;
    border-bottom: 2.5px solid #c0171d;
}

/* Filas / hover */
.tabla-productos-diferencias-stock tbody tr:nth-child(even) { background: #f6f1f1; }
.tabla-productos-diferencias-stock tbody tr:nth-child(odd)  { background: #fff; }
.tabla-productos-diferencias-stock tbody tr:hover           { background: #eeeeee; }

.tabla-productos-diferencias-stock tr.no-productos-diferencias-stock td {
    text-align: center;
    font-style: italic;
    color: #888;
    background: #f6eaea;
}
.tabla-productos-diferencias-stock th a,
.tabla-productos-diferencias-stock td a {
    color: #dc272c;
    text-decoration: underline;
    font-weight: bold;
}

/* ------ ANCHOS INDIVIDUALES EN ESCRITORIO/TABLET ------- */
.tabla-productos-diferencias-stock th:nth-child(1),  .tabla-productos-diferencias-stock td:nth-child(1) { width: 13%; } /* Código */
.tabla-productos-diferencias-stock th:nth-child(2),  .tabla-productos-diferencias-stock td:nth-child(2) { width: 21%; text-align: left; } /* Descripción */
.tabla-productos-diferencias-stock th:nth-child(3),  .tabla-productos-diferencias-stock td:nth-child(3)  { width: 7%; }  /* Exi 1 */
.tabla-productos-diferencias-stock th:nth-child(4),  .tabla-productos-diferencias-stock td:nth-child(4)  { width: 8%; }  /* Real 1 */
.tabla-productos-diferencias-stock th:nth-child(5),  .tabla-productos-diferencias-stock td:nth-child(5)  { width: 7%; }  /* Dif 1 */
.tabla-productos-diferencias-stock th:nth-child(6),  .tabla-productos-diferencias-stock td:nth-child(6)  { width: 7%; }
.tabla-productos-diferencias-stock th:nth-child(7),  .tabla-productos-diferencias-stock td:nth-child(7)  { width: 8%; }
.tabla-productos-diferencias-stock th:nth-child(8),  .tabla-productos-diferencias-stock td:nth-child(8)  { width: 7%; }
.tabla-productos-diferencias-stock th:nth-child(9),  .tabla-productos-diferencias-stock td:nth-child(9)  { width: 7%; }
.tabla-productos-diferencias-stock th:nth-child(10), .tabla-productos-diferencias-stock td:nth-child(10) { width: 8%; }
.tabla-productos-diferencias-stock th:nth-child(11), .tabla-productos-diferencias-stock td:nth-child(11) { width: 7%; }

/* -------- BOTÓN VOLVER, MENSAJES Y CONTENEDOR -------- */
.tabla-productos-diferencias-stock .volver a,
.volver a {
    background: #000;
    color: #fff;
    padding: 9px 20px;
    border-radius: 14px;
    text-decoration: none;
    font-size: 1.08em;
    font-weight: bold;
    display: inline-block;
    margin-top: 16px;
    transition: background 0.14s, color 0.12s;
}
.tabla-productos-diferencias-stock .volver a:hover,
.volver a:hover {
    background: #888;
    color: #fff;
}

.tabla-productos-diferencias-stock .mensaje {
    padding: 14px 0;
    background: #e7ffe7;
    border: 1.5px solid #20b820;
    color: #16691c;
    border-radius: 14px;
    margin-bottom: 14px;
    text-align: center;
    font-size: 1.14em;
}

.tabla-productos-diferencias-stock {
    text-align: center;
    margin-top: 30px;
}

/* ---------- RESPONSIVE Y SCROLL ----------- */
.tabla-scroll-x-diferencias-stock { width: 100%; overflow-x: auto; }

@media (max-width: 700px) {
  .tabla-productos-diferencias-stock th, .tabla-productos-diferencias-stock td { padding: 5px 2px; font-size: 0.95em; }
  .tabla-productos-diferencias-stock th:nth-child(1), .tabla-productos-diferencias-stock td:nth-child(1) { min-width: 70px; width: 18%; }
  .tabla-productos-diferencias-stock th:nth-child(2), .tabla-productos-diferencias-stock td:nth-child(2) { min-width: 80px; width: 22%;
}

  #scroll-buttons { right: 8px; bottom: 54px; }
  #scroll-buttons button { width: 38px; height: 38px; font-size: 1.25em; }
}

@media (max-width: 400px) {
  /* Asegura que todas las columnas estén visibles por defecto,
     por si hay reglas previas que oculten algo */
  .tabla-productos-diferencias-stock th,
  .tabla-productos-diferencias-stock td {
    display: table-cell !important;
    width: auto !important;
    min-width: 0 !important;
}

  /* Descripción más legible en móvil */
  .tabla-productos-diferencias-stock td:nth-child(2) {
    text-align: left !important;
    white-space: normal !important;
    word-break: break-word;
    padding-left: 6px;
  }
}

/* ====== Mensajes de finalización ====== */
.fondo-verde { background: #e7ffe7 !important; color: #16691c !important; }
.msg-finalizado {
    background:#e7ffe7;
    border:1.5px solid #20b820;
    color:#16691c;
    font-weight:bold;
    padding:12px 0;
    margin:10px 0 14px 0;
    text-align:center;
    border-radius:14px;
}
.info-finalizado {
    color:#16691c;
    font-weight: bold;
    margin-top: 20px;
    margin-bottom: 10px;
    background: #e7ffe7;
    border: 1.5px solid #20b820;
    padding: 12px 0;
    border-radius: 14px;
    text-align: center;
    font-size: 1.1em;
}

/* -------- BOTONES FLOTANTES SUBIR/BAJAR -------- */
#scroll-buttons {
    position: fixed;
    right: 22px;
    bottom: 62px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    z-index: 999;
}
#scroll-buttons button {
    background: #ffffff;
    color: #000000;
    border: 2px solid #dc272c;
    border-radius: 14px;
    box-shadow: 0 2px 16px #000000;
    font-size: 1.9em;
    font-family: Arial, sans-serif;
    font-weight: bold;
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.18s, color 0.15s, border-color 0.18s, box-shadow 0.18s;
    outline: none;
    padding: 0;
    margin: 0;
}
#scroll-buttons button:hover {
    background: #000000;
    color: #ffffff;
    border-color: #000000;
    box-shadow: 0 2px 16px #000000;
}

/* ======================= FIN DIFERENCIAS_STOCK.PHP ======================= */

/* ======================= 2 ARREGLAR_ARTICULOS_+.PHP ======================= */

/* =======================
   LISTADO DE ERRORES
   ======================= */

/* Contador y notas */
.contador-errores {
  margin: 8px 0 10px 0;
  font-weight: bold;
  color: #234;
}
.info {
  margin-bottom: 10px;
  font-size: 0.93rem;
  color: #000;
}

/* ---------- Tabla ---------- */
#tablaErrores {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  background: #fafbfc;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 16px #000000;
}

/* Celdas */
#tablaErrores th,
#tablaErrores td {
  border: 1px solid #bbb;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 1em;
  vertical-align: middle;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Encabezado */
#tablaErrores th {
  background: #dc272c;
  color: #fff;
  font-weight: bold;
  letter-spacing: .5px;
  border-bottom: 2.5px solid #c0171d;
  position: relative; /* para la flecha de orden */
}

/* Alternancia y hover de filas */
#tablaErrores tbody tr:nth-child(even) { background: #f6f1f1; }
#tablaErrores tbody tr:nth-child(odd)  { background: #fff; }
#tablaErrores tbody tr:hover {
  background: #eeeeee;
  cursor: pointer; /* porque las filas se pueden borrar al tocarlas */
}

/* Columnas: anchos base (2 columnas) */
#tablaErrores th.col-codigo,
#tablaErrores td.col-codigo { width: 40%; font-weight: bold; text-align: left; }

#tablaErrores th.col-descripcion,
#tablaErrores td.col-descripcion { width: 60%; text-align: left; }

/* Cabecera ordenable por código */
th.sortable { user-select: none; cursor: pointer; }
th.sortable::after {
  content: "▲";
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1em;
  color: #fff;
  transition: transform .2s ease;
  pointer-events: none;
}
th.sortable.desc::after { content: "▼"; }

/* Buscador (opcional si lo usas como inline) */
#buscadorCodigo {
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  padding: 6px 8px;
}

/* ---------- Botones subir/bajar ---------- */
#scroll-buttons {
  position: fixed;
  right: 22px;
  bottom: 74px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 999;
}
#scroll-buttons button {
  width: 56px;
  height: 56px;
  background: #fff;
  color: #dc272c;
  border: 2px solid #dc272c;
  border-radius: 14px;
  font-size: 2.1em;
  font-weight: bold;
  box-shadow: 0 2px 16px #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .18s, color .15s, border-color .18s, transform .12s;
  outline: none;
  padding: 0;
  margin: 0;
}
#scroll-buttons button:hover {
  background: #000;
  color: #fff;
  border-color: #000;
  transform: scale(1.08);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  #tablaErrores th, #tablaErrores td { font-size: .98em; padding: 8px 6px; }
}

@media (max-width: 600px) {
  #tablaErrores th, #tablaErrores td { font-size: .95em; padding: 5px 6px; }
  #tablaErrores th.col-codigo, #tablaErrores td.col-codigo { width: 45%; }
  #tablaErrores th.col-descripcion, #tablaErrores td.col-descripcion { width: 55%; }
}

@media (max-width: 400px) {
  /* En móvil pequeño, que la descripción pueda saltar de línea y quede pegada a la izquierda */
  #tablaErrores td.col-descripcion {
    white-space: normal;
    word-break: break-word;
    padding-left: 6px;
  }

  /* Botones flotantes más compactos */
  #scroll-buttons { right: 12px; top: 20px; }
  #scroll-buttons button { width: 40px; height: 40px; font-size: 1.4em; }
}

/* Ajustes del formulario de filtros en móviles estrechos */
@media (max-width: 375px) {
  #filtroForm { display: flex; flex-direction: column !important; gap: 0; }
  #filtroForm label, #filtroForm select {
    width: 100% !important;
    margin-bottom: 12px !important;
    display: block !important;
  }
}

/* ===================== 2 FIN ARREGLAR_ARTICULOS_+.PHP ===================== */
/* ============================ 3 ETIQUETAS.PHP ============================ */ 

         /* Estilo base */
        #tablaCodigos {
            width: 100%;
            border-collapse: collapse;
            table-layout: fixed;
            background: #fff;
            font-size: 16px;
            box-shadow: 0 2px 8px #0002;
            border-radius: 14px;
            overflow: hidden;
            border: 2px solid #dc272c;
        }

        #tablaCodigos th,
        #tablaCodigos td {
            padding: 10px 8px;
            border: none;
            text-align: center;
            vertical-align: middle;
            font-size: 15px;
            background: #fff;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        #tablaCodigos th {
            background: #dc272c;
            color: #fff;
            font-weight: bold;
            font-size: 15px;
            user-select: none;
        }

        /* Inputs y selects ajustados al ancho */
        .fila-input input[type="text"],
        .fila-input select {
            width: 100%;
            padding: 6px 8px;
            box-sizing: border-box;
            font-size: 15px;
        }

        /* === RESPONSIVE === */
        @media (min-width: 500px) {
            #tablaCodigos {
                width: 100%;
                border-collapse: collapse;
                table-layout: fixed;
            }

            #tablaCodigos th,
            #tablaCodigos td {
                padding: 10px;
                border: 1px solid #ccc;
                font-size: 15px;
                text-align: left;
                vertical-align: middle;
            }
        }

        @media (max-width: 400px) {
            .col-codigo {
                width: 52%;
            }
            .col-tamano {
                width: 40%;
            }
            .col-accion {
                width: 8%;
                text-align: center;
            }

            #tablaCodigos th,
            #tablaCodigos td {
                font-size: 13px;
                padding: 8px 4px;
            }
        }
        
/* ========================== 3 FIN ETIQUETAS.PHP ========================== */ 

/* ======================== 4 SOLICITAR_FACTURAS.PHP ======================== */

/* La tabla debe respetar los % */
.tabla-admin{ width:100%; table-layout:fixed; }
.tabla-admin th, .tabla-admin td{ box-sizing:border-box; }

/* ===== VISTA ADMIN (6 columnas) — suma 100% ===== */
.tabla-admin--admin th.nombre-col,  .tabla-admin--admin td.nombre-col  { width:18% !important; }
.tabla-admin--admin th.desc-col,    .tabla-admin--admin td.desc-col    { width:36% !important; }
.tabla-admin--admin th.fecha-col,   .tabla-admin--admin td.fecha-col   { width:18% !important; }
.tabla-admin--admin th.estado-col,  .tabla-admin--admin td.estado-col  { width:12% !important; }
.tabla-admin--admin th.user-col,    .tabla-admin--admin td.user-col    { width:10% !important; }
.tabla-admin--admin th.eliminar-col,.tabla-admin--admin td.eliminar-col{ width: 6% !important; text-align:center; }

/* ===== VISTA NORMAL (5 columnas) — suma 100% ===== */
.tabla-admin--normal th.nombre-col,  .tabla-admin--normal td.nombre-col  { width:22% !important; }
.tabla-admin--normal th.desc-col,    .tabla-admin--normal td.desc-col    { width:40% !important; }
.tabla-admin--normal th.fecha-col,   .tabla-admin--normal td.fecha-col   { width:20% !important; }
.tabla-admin--normal th.estado-col,  .tabla-admin--normal td.estado-col  { width:12% !important; }
.tabla-admin--normal th.eliminar-col,.tabla-admin--normal td.eliminar-col{ width: 6% !important; text-align:center; }

.mensaje {
    background-color:#d4edda; color:#155724; border:1px solid #c3e6cb;
    padding:10px 14px; margin:16px 0; border-radius:6px; font-size:15px; font-weight:500;
}
    /* Centrar 'Eliminar' en su columna */
.tabla-admin th.eliminar-col,
.tabla-admin td.eliminar-col { 
  text-align: center; 
}

/* El form no debe ocupar todo el ancho de la celda */
.tabla-admin td.eliminar-col form {
  display: inline-block;
  margin: 0; /* ya lo tenías, lo mantenemos */
}

/* El botón de eliminar no a ancho completo aquí */
.tabla-admin td.eliminar-col .btn-eliminar {
  width: auto;      /* sobrescribe el 100% global */
  min-width: 50px;  /* mantiene el tamaño mínimo que quieres */
}

/* ===== SOLO ≤ 400px ===== */
@media (max-width:400px){

  /* Ocultar columna ESTADO en móvil */
  .tabla-admin th.estado-col,
  .tabla-admin td.estado-col {
    display: none !important;
    width: 0 !important;
    padding: 0 !important;
    border: 0 !important;
  }

  /* ===== VISTA ADMIN (Estado oculto → 5 columnas) suma 100% ===== */
  .tabla-admin--admin th.nombre-col,  .tabla-admin--admin td.nombre-col  { width:26% !important; }
  .tabla-admin--admin th.desc-col,    .tabla-admin--admin td.desc-col    { width:50% !important; }
  .tabla-admin--admin th.fecha-col,   .tabla-admin--admin td.fecha-col   { width:14% !important; }
  .tabla-admin--admin th.user-col,    .tabla-admin--admin td.user-col    { width: 8% !important; }
  .tabla-admin--admin th.eliminar-col,.tabla-admin--admin td.eliminar-col{ width: 2% !important; text-align:center; }

  /* ===== VISTA NORMAL (Estado oculto → 4 columnas) suma 100% ===== */
  .tabla-admin--normal th.nombre-col,  .tabla-admin--normal td.nombre-col  { width:30% !important; }
  .tabla-admin--normal th.desc-col,    .tabla-admin--normal td.desc-col    { width:56% !important; }
  .tabla-admin--normal th.fecha-col,   .tabla-admin--normal td.fecha-col   { width:12% !important; }
  .tabla-admin--normal th.eliminar-col,.tabla-admin--normal td.eliminar-col{ width: 2% !important; text-align:center; }
}

/* ====================== 4 FIN SOLICITAR_FACTURAS.PHP ====================== */
/* ============================ 5 ALMACENES.PHP ============================ */ 

.almacenes-tabla th.modificar-col,
.almacenes-tabla td.modificar-col {
    width: 110px;
    min-width: 80px;
    max-width: 130px;
    text-align: center;
}
.almacenes-tabla th.eliminar-col,
.almacenes-tabla td.eliminar-col {
    width: 110px;
    min-width: 70px;
    max-width: 130px;
    text-align: center;
}

.almacenes-tabla th {
    background: #dc272c;
    color: #ffffff;
    font-weight: bold;
    text-align: center;
    font-size: 1.07em;
}
.almacenes-tabla td input[type="text"] {
    width: 95%;
    padding: 7px;
    border: 1px solid #eeeeee;
    border-radius: 14px;
    font-size: 1em;
}
.almacenes-tabla button[type="submit"] {
    background: #dc272c;
    color: #ffffff;
    border: none;
    border-radius: 14px;
    padding: 8px 18px;
    font-weight: bold;
    cursor: pointer;
    font-size: 1em;
    box-shadow: 0 2px 16px #000000;
    transition: background 0.18s;
    min-width: 86px;
    margin: 0 auto;
    display: block;
}
.almacenes-tabla button[type="submit"]:hover {
    background: #dc272c;
}
.almacenes-tabla a {
    color: #dc272c;
    font-weight: bold;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 14px;
    transition: background 0.13s, color 0.13s;
    font-size: 1em;
    display: block;
    min-width: 86px;
    margin: 0 auto;
    text-align: center;
}
.almacenes-tabla a:hover {
    background: #ffeaea;
    color: #dc272c;
}
.almacenes-tabla .mensaje {
    padding: 14px 0;
    background: #e7ffe7;
    border: 1px solid #20b820;
    color: #16691c;
    border-radius: 14px;
    margin-bottom: 16px;
    text-align: center;
    font-size: 1.08em;
}
.almacenes-tabla {
    text-align: center;
    margin-top: 30px;
}
.almacenes-tabla a {
    background: #000000;
    color: #ffffff;
    display: inline-block;
    padding: 11px 26px;
    border-radius: 14px;
    text-decoration: none;
    font-size: 1.06em;
    margin: 0 auto;
    margin-top: 0;
    transition: background 0.14s;
}
.almacenes-tabla a:hover {
    background: #888888;
    color: #ffffff;
}
/* Responsive: scroll horizontal si hace falta y tamaño fuente menor */
@media (max-width: 850px) {
    .almacenes-tabla {
        padding: 12px 2px 18px 2px;
        max-width: 98vw;
    }
    .almacenes-tabla table {
        display: block;
        overflow-x: auto;
        min-width: 420px;
        font-size: 0.96em;
    }
    .almacenes-tabla th, .almacenes-tabla td {
        min-width: 90px;
        font-size: 0.96em;
        padding: 8px 5px;
    }
}

/* =========================== FIN ALMACENES.PHP =========================== */ 
/* ========================= 6 CAMBIAR_PASSWORD.PHP ========================= */

label {
    font-weight: bold;
}

/* ======================== FIN CAMBIAR_PASSWORD.PHP ======================== */
/* ======================= 7 IMPORTAR_INVENTARIOS.PHP ======================= */

/* TABLA DE PREVISUALIZACIÓN DE IMPORTACIÓN */
.tabla-importar {
    border-collapse: collapse;
    width: 100%;
    background: #ffffff;
    font-size: 16px;
    table-layout: auto;
}
.tabla-importar th, .tabla-importar td {
    border: 1px solid #888888;
    padding: 5px 8px;
    text-align: left;
    vertical-align: middle;
    white-space: pre-line;      /* Respeta saltos de línea */
    max-width: 420px;           /* Puedes ajustar este valor */
    overflow-wrap: break-word;
}
.tabla-importar thead tr {
    background-color: #eeeeee;
    font-weight: bold;
}
.tabla-importar tbody tr:nth-child(even) {
    background: #eeeeee;
}
.tabla-importar tbody tr:nth-child(odd) {
    background: #ffffff;
}

/* BLOQUE DE INSTRUCCIONES IMPORTACIÓN */
.info-importacion {
    margin: 22px 0 18px 0;
    padding: 16px 22px 18px 22px;
    background: #eeeeee;
    border-radius: 14px;
    border: 1px solid #000000;
    box-shadow: 0 2px 16px #000000;
    color: #000000;
    font-size: 1.05em;
}

.info-importacion h3 {
    margin-top: 0;
    font-size: 1.18em;
    color: #dc272c;
}

.info-importacion ul {
    margin-top: 10px;
    margin-bottom: 18px;
    padding-left: 20px;
}

.info-importacion ul li span {
    color: #dc272c;
    font-weight: bold;
}
.tabla-instrucciones-csv {
    overflow-x: auto;
    margin-bottom: 12px;
    display: flex;
    justify-content: center;
}
.tabla-instrucciones-csv table {
    border-collapse: collapse;
    width: 100%;
    max-width: 600px;
    background: #000000;
    border: 1px solid #000000;
    box-shadow: 0 2px 16px #000000;
    margin-bottom: 0;
    text-align: center;
}
.tabla-instrucciones-csv th,
.tabla-instrucciones-csv td {
    padding: 7px 8px;
    border: 1px solid #000000;
    font-size: 1em;
    text-align: center;
}

.tabla-instrucciones-csv th {
    background: #ffeaea;
    font-weight: bold;
    color: #000000;
}

/* ====================== FIN IMPORTAR_INVENTARIOS.PHP ====================== */
/* ======================= 8 IMPORTAR_ARTICULOS_+.PHP ======================= */

.ayuda {
    font-size: 0.95em;
    color: #888888;
    background: #eeeeee;
    border-left: 3px solid #dc272c;
    padding: 8px 12px;
    margin-bottom: 18px;
}
/* ====================== FIN IMPORTAR_ARTICULOS_+.PHP ====================== */
/* ============================== 10 ROLES.PHP ============================== */

.leyenda-roles {
    margin-top: 24px;
    font-size: 1.02em;
    background: #eeeeee;
    border-radius: 14px;
    padding: 13px 14px;
    color: #000000;
}
.leyenda-roles ul {
    margin: 15px 0 0 24px;
    padding-left: 0;
    line-height: 1.7;
}
.leyenda-roles li {
    margin-bottom: 3px;
}
.roles-tabla {}
.roles-tabla h2 {
    text-align: center;
    margin-bottom: 26px;
}
.roles-tabla-wrapper {
    width: 100%;
    overflow-x: auto;
}
.roles-tabla table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 2px 16px #000000;
    overflow: hidden;
    table-layout: fixed;
    min-width: 580px; /* Garantiza buen comportamiento en responsive */
}
.roles-tabla th, .roles-tabla td {
    border: 1px solid #eeeeee;
    padding: 9px 8px;
    text-align: left;
    font-size: 1em;
    word-break: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
}
.roles-tabla th {
    background: #dc272c;
    color: #ffffff;
    font-weight: bold;
    border: 1px solid #dc272c;
    white-space: nowrap;
}
.roles-tabla td {
    background: #ffffff;
    border: 1px solid #ffffff;
}
.roles-tabla tr:nth-child(even) td {
    background: #ffffff;
}
.roles-tabla form {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    margin: 0;
}
.roles-tabla select {
    width: 100%;
    min-width: 90px;
    max-width: 99%;
    padding: 7px;
    border-radius: 14px;
    border: 1px solid #eeeeee;
    font-size: 1em;
    box-sizing: border-box;
}
.roles-tabla button {
    background: #dc272c;
    color: #ffffff;
    border: none;
    border-radius: 14px;
    padding: 7px 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.15s;
}
.roles-tabla button:hover {
    background: #dc272c;
}

/* Suma exacta 100% (ajusta a tus necesidades) */
.roles-tabla th:nth-child(1), .roles-tabla td:nth-child(1) { width: 18%; min-width: 80px; }
.roles-tabla th:nth-child(2), .roles-tabla td:nth-child(2) { width: 18%; min-width: 120px;}
.roles-tabla th:nth-child(3), .roles-tabla td:nth-child(3) { width: 23%; min-width: 90px; }
.roles-tabla th:nth-child(4), .roles-tabla td:nth-child(4) { width: 41%; min-width: 120px; }

/* Responsive: permite scroll horizontal en móvil si hace falta */
@media (max-width: 750px) {
  .roles-tabla-wrapper {
    overflow-x: auto;
  }
  .roles-tabla table {
    min-width: 460px;
    font-size: 0.96em;
  }
  .roles-tabla th, .roles-tabla td {
    min-width: 110px;
    font-size: 0.98em;
  }
}
/* ============================= FIN ROLES.PHP ============================= */
/* ============================ 11 USUARIOS.PHP ============================ */

        /* Garantiza que la tabla no se desborde */
        .container-admin {
            max-width: 100%;
            overflow-x: auto;
        }
        .tabla-admin {
            width: 100%;
            table-layout: fixed;
            border-collapse: collapse;
            font-size: 15px !important;
        }
        .tabla-admin th, .tabla-admin td {
            text-align: center;
            width: 100% !important;
            vertical-align: middle;
            font-size: 15px !important;
            padding: 9px 6px;
            word-break: break-word;
        }
        /* Columna ID más pequeña */
        .tabla-admin th.id-col, .tabla-admin td.id-col {
            width: 36px !important;
            min-width: 32px !important;
            max-width: 44px !important;
        }
        /* Resto de columnas medidas fijas y responsivas */
.tabla-admin th.usuario-col,
.tabla-admin td.usuario-col {
    width: 98px;
    min-width:80px;
    max-width:120px;
}
.tabla-admin th.nombre-col,
.tabla-admin td.nombre-col {
    width: 105px;
    min-width:105px;
    max-width:190px;
}
.tabla-admin th.rol-col,
.tabla-admin td.rol-col {
    width: 60px;
    min-width:70px;
    max-width:100px;
}
.tabla-admin th.almacen-col,
.tabla-admin td.almacen-col {
    width: 130px;
    min-width:80px;
    max-width:150px;
}
.tabla-admin th.actualizar-col,
.tabla-admin td.actualizar-col {
    width: 108px;
    min-width:88px;
    max-width:120px;
}
.tabla-admin th.pass-col,
.tabla-admin td.pass-col {
    width: 160px;
    min-width:122px;
    max-width:220px;
}
.tabla-admin th.eliminar-col,
.tabla-admin td.eliminar-col {
    width: 90px;
    min-width:70px;
    max-width:110px;
}

        .tabla-admin input, .tabla-admin select, .tabla-admin button, .tabla-admin a.btn-eliminar {
            font-size: 15px !important;
        }
        /* Mantener botones centrados y tamaño igual */
        .tabla-admin .btn-actualizar,
        .tabla-admin .btn-guardar,
        .tabla-admin .btn-eliminar {
            width: 98px;
            min-width: 88px;
            margin: 0 auto;
            display: inline-block;
            font-size: 15px !important;
        }
        .tabla-admin input[type="password"] {
            width: 98px;
            min-width: 70px;
            font-size: 15px !important;
        }
        /* Responsive: permite scroll horizontal si es necesario */
        @media (max-width: 1100px) {
            .container-admin {
                padding: 0;
            }
            .tabla-admin th, .tabla-admin td {
                font-size: 14px !important;
                padding: 7px 4px;
            }
            .tabla-admin .btn-actualizar,
            .tabla-admin .btn-guardar,
            .tabla-admin .btn-eliminar {
                width: 86px;
                min-width: 76px;
                font-size: 14px !important;
            }
        }
/* ============================ FIN USUARIOS.PHP ============================ */
/* ============================ 12 PERMISOS.PHP ============================ */

.grid-permisos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px 22px;
    margin: 24px 0 20px 0;
}
.perm-item label {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 1.06em;
    padding: 7px 4px;
    background: #eeeeee;
    border-radius: 14px;
    border: 1px solid #eeeeee;
    box-shadow: 0 2px 16px #000000;
    cursor: pointer;
    transition: background 0.17s;
}
.perm-item label:hover {
    background: #eeeeee;
}
.perm-nombre {
    min-width: 92px;
    font-weight: 500;
    color: #000000;
}
.perm-mini {
    color: #888888;
    font-size: 0.94em;
    margin-left: 2px;
}
/* ============================ FIN PERMISOS.PHP ============================ */
/* ***************************** ESTILO GLOBAL ***************************** */
/* ======================= BOTON PARA VOLVER A ATRAS ======================= */
/* ************************************************************************* */
.volver {
    text-align: center;
    margin-top: 30px;
    width: 100%;
    padding: 0;
}
.volver a {
    display: block;
    text-transform: none !important;
    background: #000000;
    color: #ffffff;
    text-decoration: none;
    width: 100%;
    max-width: 100%;
    padding: 13px 0;
    border-radius: 6px;
    font-size: 1.09em;
    font-weight: bold;
    box-sizing: border-box;
    margin: 0 auto;
    transition: background 0.14s, color 0.14s;
}
.volver a:hover {
    background: #000000;
    color: #ffffff;
}

@media (max-width: 700px) {
    .volver {
        margin-top: 20px;
        padding: 0;
    }
    .volver a {
        font-size: 1em;
        padding: 15px 0;
    }
}

/* ***************************** ESTILO GLOBAL ***************************** */
/* ================ ESPACIO ENTRE EL CONTENEDOR Y EL FOOTER ================ */
/* ************************************************************************* */

.espaciador-footer {
    height: 70px;
    display: block;
}

/* ***************************** ESTILO GLOBAL ***************************** */
/* =============================== FOOTER.PHP =============================== */
/* ************************************************************************* */

footer {
    text-align: center;
    background-color: #000000;
    color: #ffffff;
    font-size: 14px;
    border-top: 1px solid #eeeeee;
    position: fixed;
    bottom: 0;
    width: 100%;
    padding: 20px;
}

/* ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑ */
/* xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx */
/* xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx */
/* xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx */
/* xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx */

/* ===== FIX REAL IPHONE X ===== */
@media (max-width: 577px){

    .container{
        margin: 10px 0 0 0 !important;
        padding: 15px !important;
        border-width: 2px;
        width: 100%;
        max-width: 100%;
    }

    .centrado-wrapper{
        padding: 0 10px;
        box-sizing: border-box;
    }
    .tabla-listado-inventarios{
        width:100%;
        min-width:0;
        table-layout: fixed;
    }

    .tabla-listado-inventarios th,
    .tabla-listado-inventarios td{
        white-space: normal !important;
        word-break: break-word;
        font-size:12px;
        padding:6px 4px;
    }

    .tabla-listado-inventarios .col-id{
        width:15%;
    }

    .tabla-listado-inventarios .col-fecha{
        width:25%;
    }

    .tabla-listado-inventarios .col-acciones{
        width:40%;
    }

    .acciones{
        display:flex;
        flex-direction:column;
        gap:4px;
    }

    .acciones .btn-guardar,
    .acciones .btn-eliminar{
        font-size:11px;
        padding:6px 4px;
    }
}

