/**
 * AlmacenTech · Versión 2.0.4
 * Archivo: recursos/css/general.css
 * Autor: no especificado en los archivos aportados.
 * Descripción: Estilos del módulo general.
 * Documentación: documentacion/INDICE.md y documentacion/arquitectura/ESTRUCTURA_Y_COMENTARIOS.md.
 */
/*
 * Responsabilidad: Reglas visuales de la interfaz; no guarda datos de negocio.
 * Diseño: grafito, verde petróleo, tarjetas claras y estados con color.
 * --accent se carga desde la configuración de la BD mediante aplicacion.js.
 * Secciones: estructura, tarjetas, formularios, tablas, auditoría y móvil.
 */
* {
    box-sizing: border-box;
}

/* Estructura general y tipografía */
body {
    margin: 0;
    background: #f2f5f5;
    color: #25343b;
    font:
        15px system-ui,
        sans-serif;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 28px;
    background: white;
    border-bottom: 1px solid #dce4e5;
}

.brand {
    font-size: 23px;
    color: var(--accent, #087f8c);
}

small {
    display: block;
    font-size: 12px;
    color: #647780;
}

nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px 28px;
    background: white;
}

button,
a.button {
    cursor: pointer;
    padding: 10px 14px;
    border: 1px solid #ccd9db;
    border-radius: 8px;
    background: white;
    color: #25343b;
    text-decoration: none;
    font: inherit;
}

.primary,
nav .active {
    background: var(--accent, #087f8c);
    color: white;
    border-color: transparent;
}

main {
    padding: 24px;
    max-width: 1700px;
    margin: auto;
}

h1 {
    margin: 10px 0 6px;
}

h2 {
    font-size: 19px;
}

.muted,
#connection {
    color: #647780;
    font-size: 13px;
}

/* Tarjetas de contadores y rejillas de formularios */
.cards,
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin: 18px 0;
}

.card,
.panel {
    background: white;
    border: 1px solid #dde7e7;
    border-radius: 13px;
    padding: 20px;
    box-shadow: 0 5px 15px #23343b08;
}

.card strong {
    display: block;
    font-size: 32px;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin: 16px 0;
}

/* Controles de edición */
input,
select,
textarea {
    font: inherit;
    padding: 10px;
    border: 1px solid #cbd7da;
    border-radius: 7px;
    background: white;
    max-width: 100%;
}

label {
    display: block;
    font-size: 14px;
}

label > input:not([type="checkbox"]),
label > select,
textarea {
    display: block;
    width: 100%;
    margin: 7px 0;
}

textarea {
    min-height: 80px;
}

/* Listados, paginación y auditoría */
.table-wrap {
    overflow: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th,
td {
    text-align: left;
    padding: 13px;
    border-bottom: 1px solid #e2e9ea;
    white-space: nowrap;
}

th {
    font-size: 12px;
    color: #607780;
}

td small {
    max-width: 300px;
    white-space: normal;
}

.badge {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 20px;
    color: white;
    font-size: 12px;
}

.calendar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.day {
    min-height: 95px;
    text-align: left;
}

.day strong {
    display: block;
    font-size: 24px;
}

.error,
#form-error {
    color: #a32d20;
}

/* Modal de equipo y fondo */
dialog {
    border: 0;
    border-radius: 14px;
    max-width: 850px;
    width: 95%;
    padding: 25px;
}

dialog::backdrop {
    background: #142c3b88;
}

footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

details {
    position: relative;
}

details button {
    display: block;
    margin-top: 5px;
}

.pending {
    border-left: 4px solid #c28c35;
}

.week {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

pre {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 12px;
}

/* Adaptación a pantallas pequeñas */
@media (max-width: 650px) {
    main {
        padding: 12px;
    }

    header {
        padding: 14px;
    }

    .calendar {
        gap: 3px;
    }

    .day {
        padding: 5px;
        font-size: 11px;
    }

    .day strong {
        font-size: 18px;
    }

    .week {
        gap: 3px;
    }

    .week .card {
        padding: 8px;
        font-size: 12px;
    }
}

/* Tarjetas móviles: las mismas filas paginadas se presentan como fichas, sin scroll horizontal. */
[hidden] {
    display: none !important;
}

.paginador {
    justify-content: space-between;
}

button:disabled {
    opacity: 0.45;
    cursor: default;
}

@media (max-width: 760px) {
    .table-wrap {
        overflow: visible;
    }

    .tabla-adaptable,
    .tabla-adaptable tbody {
        display: block;
        width: 100%;
    }

    .tabla-adaptable thead,
    .tabla-adaptable .fila-cabecera {
        display: none;
    }

    .tabla-adaptable tr {
        display: block;
        margin: 12px 0;
        padding: 12px;
        border: 1px solid #dce4e5;
        border-radius: 12px;
        background: white;
        box-shadow: 0 3px 10px #23343b10;
    }

    .tabla-adaptable td {
        display: grid;
        grid-template-columns: 38% 62%;
        white-space: normal;
        overflow-wrap: anywhere;
        padding: 8px 0;
    }

    .tabla-adaptable td::before {
        content: attr(data-label);
        color: #647780;
        font-size: 11px;
        font-weight: 700;
        padding-right: 8px;
    }

    .tabla-adaptable td small {
        grid-column: 2;
    }

    .toolbar input,
    .toolbar select {
        width: 100%;
    }

    .paginador {
        gap: 8px;
    }

    .paginador span {
        width: 100%;
        text-align: center;
        order: 3;
    }
}

/* almacenTech 1.9.0 · Apariencia general y componentes del cuadro de mando.
 * El fondo combina petróleo claro y líneas suaves; las superficies blancas mantienen
 * legibilidad. Iconos SVG locales, rojo para cero y verde para valores positivos. */
body {
    background-color: #eaf1f3;
    background-image:
        radial-gradient(ellipse at 0 0, #cce5e680, transparent 58%),
        radial-gradient(ellipse at 100% 100%, #e9d7b52b, transparent 55%),
        linear-gradient(#23343b03 1px, transparent 1px),
        linear-gradient(90deg, #23343b03 1px, transparent 1px);
    background-size:
        auto,
        auto,
        48px 48px,
        48px 48px;
}

header {
    box-shadow: 0 3px 18px #16394209;
}

body > nav {
    border-bottom: 1px solid #ccdadf;
}

h1 {
    color: #132b34;
    letter-spacing: -0.5px;
}

h2 {
    color: #18353e;
}

.descripcion-inicio {
    color: #111;
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 22px;
}

.icono-panel {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    vertical-align: middle;
}

.titulo-seccion {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 26px;
}

.titulo-seccion .icono-panel {
    color: #087f8c;
}

.cards .contador {
    display: flex;
    align-items: center;
    text-align: left;
    gap: 18px;
    padding: 22px;
    border-left: 4px solid #16834b;
    box-shadow: 0 6px 22px #12343c09;
}

.contador-icono {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: #e5f5ef;
    color: #16734a;
    flex-shrink: 0;
}

.contador strong {
    line-height: 1.15;
    margin-bottom: 6px;
    font-size: 35px;
}

.contador-titulo {
    display: block;
    font-weight: 600;
}

.contador small {
    margin-top: 8px;
}

.cards .contador.sin-registros {
    border-left-color: #c73838;
}

.sin-registros strong {
    color: #b42318;
}

.con-registros strong {
    color: #147849;
}

.contador.sin-registros .contador-icono {
    background: #feeeee;
    color: #b42318;
}

.week .produccion-dia {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
    padding: 20px 14px;
    border-top: 4px solid #16834b;
    min-height: 164px;
}

.produccion-fecha {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 600;
    text-transform: capitalize;
}

.produccion-fecha .icono-panel {
    width: 22px;
    height: 22px;
}

.week .produccion-dia.sin-registros {
    border-top-color: #d45b53;
    background: linear-gradient(#fff6f5, #fff 70%);
}

.week .produccion-dia.con-registros {
    background: linear-gradient(#eaf8f0, #fff 70%);
}

button.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 9px 25px #12343c16;
}

button.card {
    transition:
        transform 0.15s,
        box-shadow 0.15s;
}

.es-hoy {
    outline: 2px solid #087f8c;
    outline-offset: 2px;
}

.produccion-dia small {
    background: #e1f2f4;
    color: #075d68;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 700;
}

button {
    background: #eef4f8;
    color: #224a63;
    border-color: #c6d6e1;
}

/* Paleta de acciones equivalente a botones de un panel de administración. */
button.primary,
a.button.primary {
    background: #087f8c;
    color: white;
    border-color: #087f8c;
}

button.boton-info,
a.button.boton-info {
    background: #e3f2fa;
    color: #075b83;
    border-color: #b7dcea;
}

button.boton-exito {
    background: #e3f4e9;
    color: #14673c;
    border-color: #a8d9bc;
}

button.boton-peligro,
[data-eliminar] {
    background: #fde9e7;
    color: #aa2525;
    border-color: #f0bdb8;
}

button[data-copy] {
    background: #edf2f7;
    color: #334d67;
    border-color: #c7d3df;
    font-size: 12px;
    padding: 6px 9px;
}

button:hover:not(:disabled),
a.button:hover {
    filter: brightness(0.97);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

button:focus-visible,
a.button:focus-visible {
    outline: 3px solid #daaa44;
    outline-offset: 3px;
}

/* Dos barras sincronizadas; cada una puede cambiar página y tamaño. */
.paginador {
    background: #f7fafb;
    border: 1px solid #d8e3e7;
    border-radius: 10px;
    padding: 12px 14px;
    gap: 12px;
    align-items: center;
    margin: 14px 0;
}

.paginador label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 600;
}

.paginador select {
    width: auto;
    min-width: 68px;
    margin: 0;
    padding: 7px 9px;
}

.resumen-paginacion {
    font-size: 13px;
}

.resumen-paginacion strong {
    color: #173f50;
}

/* Calendario laboral: las celdas conservan cinco columnas y fecha explícita. */
.calendario-toolbar {
    background: #fff;
    border: 1px solid #d8e3e7;
    border-radius: 12px;
    padding: 16px;
    align-items: end;
}

.calendario-toolbar label {
    font-weight: 600;
}

.calendario-toolbar input {
    max-width: 230px;
}

.leyenda-calendario {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    font-size: 13px;
}

.leyenda-cero {
    color: #b42318;
}

.leyenda-produccion {
    color: #147849;
}

.calendar {
    gap: 12px;
    padding: 20px;
}

.calendario-cabecera {
    text-align: center;
    color: #fff;
    background: #215460;
    border-radius: 7px;
    padding: 12px 3px;
}

.calendar .day {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-height: 136px;
    border: 1px solid #c4ddd1;
    background: #eef8f2;
    padding: 12px;
}

.calendar .day.sin-registros {
    background: #fff3f1;
    border-color: #efd2cd;
}

.numero-dia {
    align-self: flex-start;
    font-weight: 700;
    font-size: 16px;
}

.day .icono-panel {
    width: 20px;
    height: 20px;
    color: #147849;
}

.day.sin-registros .icono-panel {
    color: #b42318;
}

.calendar .day strong {
    font-size: 30px;
    line-height: 1;
}

.calendar .day:hover {
    box-shadow: 0 5px 15px #16394220;
}

@media (max-width: 760px) {
    .paginador {
        gap: 9px;
        padding: 10px;
    }

    .paginador label {
        flex-wrap: wrap;
    }

    .cards .contador {
        padding: 16px;
    }

    .calendar {
        gap: 5px;
        padding: 10px;
    }

    .calendario-cabecera {
        font-size: 10px;
        padding: 9px 1px;
    }

    .calendar .day {
        min-height: 105px;
        padding: 7px 3px;
        font-size: 10px;
    }

    .calendar .day strong {
        font-size: 23px;
    }

    .calendar .day .icono-panel {
        display: none;
    }

    .numero-dia {
        font-size: 12px;
    }

    .leyenda-calendario {
        gap: 10px;
    }
}

/* La semana pasa a dos columnas en móvil para evitar tarjetas demasiado estrechas. */
.week {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.contador > div {
    min-width: 0;
}

.contador-titulo {
    overflow-wrap: anywhere;
}

@media (max-width: 760px) {
    .week {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
}

@media (max-width: 420px) {
    .week {
        grid-template-columns: 1fr;
    }
}

/* almacenTech 1.10.0 · Navegación, identidad, contraste y notificaciones compartidas. */
:root {
    --texto-boton: #fff;
}

.menu-principal {
    justify-content: center;
    align-items: center;
    padding: 14px 22px;
    gap: 10px;
    box-shadow: 0 4px 18px #132f4e09;
}

.menu-principal .button,
.menu-principal button,
.grupo-menu > summary {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-weight: 700;
    color: #0b2548;
    background: #fff;
    border: 1px solid #d3e0f0;
    border-radius: 9px;
    padding: 11px 14px;
    font-size: 14px;
}

.menu-principal .active,
.menu-principal button.active {
    background: var(--accent, #075bcc);
    color: var(--texto-boton, #fff) !important;
    border-color: transparent;
}

.icono-menu {
    font-size: 18px;
    display: inline-block;
    min-width: 18px;
    text-align: center;
}

.grupo-menu div {
    z-index: 1000;
}

.grupo-menu div .button {
    display: flex;
    margin: 4px 0;
}

.cabecera-aplicacion {
    padding: 18px 30px;
}

.usuario-conectado {
    display: grid;
    grid-template-columns: 38px auto;
    column-gap: 9px;
    align-items: center;
    color: #0b2548;
    font-weight: 700;
}

.avatar-usuario {
    grid-row: span 2;
    background: #e8f0fc;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #075bcc;
}

.usuario-conectado small {
    font-size: 11px;
    font-weight: 500;
    color: #176b42;
}

#estado-conexion i {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: #18a357;
    border-radius: 50%;
    margin-right: 4px;
}

#estado-conexion.sin-conexion {
    color: #9b5b0d;
}

#estado-conexion.sin-conexion i {
    background: #bf821b;
}

button.primary,
a.button.primary {
    background: var(--accent, #075bcc);
    color: var(--texto-boton, #fff) !important;
    border-color: transparent;
    font-weight: 700;
}

button.boton-info {
    background: #e9f1fd;
    color: #164d90 !important;
    font-weight: 600;
}

button.boton-exito {
    color: #135e35 !important;
}

button.boton-peligro,
#cancel,
#cerrar-editor,
[id^="cancelar"] {
    background: #fce9e7;
    color: #a52626 !important;
    border-color: #e8b6b2;
    font-weight: 600;
}

button:disabled {
    opacity: 1 !important;
    background: #edf1f5 !important;
    color: #526277 !important;
    border-color: #d7dee7 !important;
    cursor: not-allowed;
}

.pasos .paso.actual {
    color: white !important;
}

.asistente .pasos .paso:disabled {
    opacity: 1;
}

th,
.fila-cabecera th {
    background: #0b2148 !important;
    color: #fff !important;
    font-weight: 700;
    padding: 14px 12px;
    border-color: #0b2148;
}

#notificaciones {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 3000;
    display: grid;
    gap: 10px;
    max-width: min(420px, calc(100vw - 30px));
}

.notificacion {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border-left: 5px solid #16834b;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 10px 35px #0b254830;
    color: #173e29;
}

.notificacion.error {
    border-color: #b42318;
    color: #8a2017;
}

.notificacion button {
    margin-left: auto;
    border: 0;
    background: transparent !important;
    color: inherit !important;
    font-size: 23px;
    padding: 4px;
}

.confirmacion-moderna {
    max-width: 460px;
    box-shadow: 0 18px 70px #0004;
}

.confirmacion-moderna footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.confirmacion-moderna p {
    line-height: 1.7;
}

@media (max-width: 650px) {
    .cabecera-aplicacion {
        padding: 14px;
        gap: 12px;
    }

    .brand {
        font-size: 19px;
    }

    .menu-principal {
        padding: 10px;
        gap: 7px;
    }

    .menu-principal button,
    .menu-principal .button,
    .grupo-menu > summary {
        font-size: 12px;
        padding: 10px;
    }

    .usuario-conectado {
        font-size: 13px;
    }
}

/* Desplegables comunes: disponibles también fuera de Ayuda. */
.grupo-menu {
    position: relative;
    padding: 0;
    border: 0;
}

.grupo-menu > summary {
    cursor: pointer;
    list-style: none;
}

.grupo-menu > summary::-webkit-details-marker {
    display: none;
}

.grupo-menu > div {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 1000;
    min-width: 240px;
    max-width: calc(100vw - 30px);
    padding: 10px;
    background: #fff;
    border: 1px solid #d2deed;
    border-radius: 12px;
    box-shadow: 0 14px 35px #0b254824;
}

.grupo-menu > div button {
    width: 100%;
    text-align: left;
    justify-content: flex-start;
    margin: 3px 0;
}

/* 1.13 · Encabezados y flechas iguales en todas las tablas, consulta y ayuda. */
table th {
    background: #102b4b !important;
    color: #fff !important;
    font-weight: 700;
}

.flechas-orden {
    display: inline-flex;
    gap: 7px;
    margin-left: 10px;
    vertical-align: middle;
}

.flechas-orden .orden-columna {
    background: transparent !important;
    color: white !important;
    border: 0;
    padding: 3px;
    font-weight: 900;
    min-width: 20px;
}

.flechas-orden .orden-activo {
    color: #62ee98 !important;
    background: #173d51 !important;
}

.boton-pendiente {
    background: #fff1d6 !important;
    color: #9a4800 !important;
    border: 1px solid #edb358 !important;
}

.boton-exito {
    background: #e2f7e8 !important;
    color: #146832 !important;
    border-color: #91cba3 !important;
}

.modal-consulta {
    width: min(1000px, 94vw);
    max-height: 90dvh;
    overflow: auto;
    border: 0;
    border-radius: 18px;
    padding: 24px;
}

.modal-consulta::backdrop {
    background: #10243e99;
}

.modal-consulta header,
.modal-consulta footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.consulta-datos {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.consulta-datos > div {
    padding: 12px;
    background: #edf3fa;
    border-radius: 10px;
}

.consulta-datos dt {
    font-weight: 700;
    color: #183958;
}

.consulta-datos dd {
    margin: 5px 0;
    overflow-wrap: anywhere;
}

.encabezado-version time {
    margin-left: auto;
}

.tecnologias-ayuda {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.tecnologias-ayuda img {
    max-width: 90px;
    height: 65px;
    object-fit: contain;
}

.ayuda-cabecera {
    background: #edf4ff;
    color: #183958;
}

.gestion-compacta {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.gestion-compacta button {
    font-size: 12px;
    white-space: nowrap;
    padding: 6px;
}

.hora-equipo {
    display: block;
    color: #617287;
}

.dato-pendiente {
    color: #9a4800;
}

.estado-equipo {
    border: 0;
    background: transparent;
    padding: 3px;
}

@media (max-width: 700px) {
    .consulta-datos,
    .tecnologias-ayuda {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .modal-consulta {
        padding: 14px;
    }
}

/* 1.14 · Resúmenes ajustados al módulo y objetivo mensual. */
.resumen-compacto {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0;
}

.estado-resumen {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 10px;
}

.estado-resumen strong {
    font-size: 19px;
}

.estado-resumen .icono-panel {
    width: 22px;
    height: 22px;
}

.objetivo-plantillado {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    background: #edf4fc;
    border: 1px solid #c6d8ec;
    border-radius: 13px;
    padding: 14px;
    margin: 14px 0;
}

.objetivo-plantillado > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.objetivo-plantillado progress {
    flex: 1;
    min-width: 120px;
    height: 14px;
    accent-color: #17804b;
}

.objetivo-plantillado .button {
    margin-left: auto;
}

.resumen-busqueda {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px;
    background: #edf6ff;
    border-radius: 10px;
    margin: 16px 0;
}

.inicio-busqueda {
    padding: 30px;
}

.referencia-calendario > summary {
    cursor: pointer;
    font-weight: 700;
    color: #153858;
}

.cabecera-aplicacion .usuario-conectado {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cabecera-aplicacion,
.menu-principal {
    max-width: 100%;
    min-width: 0;
}

.cabecera-aplicacion .brand {
    min-width: 0;
    overflow-wrap: anywhere;
}

@media (max-width: 480px) {
    main {
        padding: 12px;
    }

    .cabecera-aplicacion {
        padding: 12px;
        gap: 10px;
    }

    .cabecera-aplicacion .brand {
        font-size: 20px;
    }

    .cabecera-aplicacion .usuario-conectado {
        font-size: 13px;
    }

    .objetivo-plantillado {
        gap: 10px;
    }

    .objetivo-plantillado progress {
        width: 100%;
        flex-basis: 100%;
    }

    .objetivo-plantillado .button {
        margin-left: 0;
    }

    .estado-resumen {
        flex: 1 1 40%;
        justify-content: space-between;
        font-size: 12px;
    }

    .tabla-adaptable td {
        grid-template-columns: minmax(0, 38%) minmax(0, 62%);
    }

    .tabla-adaptable td > * {
        min-width: 0;
        max-width: 100%;
    }

    .modal-equipo .campos-equipo {
        grid-template-columns: minmax(0, 1fr);
    }

    .toolbar label,
    .paginador label {
        min-width: 0;
        max-width: 100%;
    }

    .ayuda-cabecera {
        padding: 6px 8px;
    }
}

/* 1.14 · Casillas y acciones colectivas compartidas por los listados. */
.seleccion-comun {
    background: #edf4fd;
    border: 1px solid #cbdcf0;
    border-radius: 10px;
    padding: 12px;
}

.tabla-adaptable input[data-seleccion-tabla],
.tabla-adaptable input[data-marcar-pagina] {
    width: 18px;
    height: 18px;
    accent-color: #176bbb;
}

.seleccion-comun strong {
    color: #153958;
}

#dialogo-administracion {
    width: min(800px, 94vw);
    max-height: 92dvh;
    overflow: auto;
    border-radius: 15px;
}

#dialogo-administracion .grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}

#dialogo-administracion input {
    max-width: 100%;
    min-width: 0;
}

#dialogo-administracion footer {
    flex-wrap: wrap;
}

/* 1.15 · Flujo, aviso de reposición y recepción por cantidad. */
.aviso-stock {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid #becfe1;
    margin: 15px 0;
}

.aviso-stock > span {
    font-size: 28px;
}

.aviso-stock p {
    margin: 5px 0;
}

.stock-bajo {
    background: #fff1d6 !important;
    color: #873a00 !important;
    border-color: #e7a44c !important;
}

.stock-normal {
    background: #eaf7ef;
    color: #185b38;
}

.flujo-stock .card > span {
    font-size: 28px;
}

.stock-disponible {
    border-top: 4px solid #246cc4;
}

.stock-preparacion {
    border-top: 4px solid #e19b25;
}

.stock-terminados {
    border-top: 4px solid #25844e;
}

.pasos-flujo {
    padding-left: 24px;
}

.pasos-flujo li {
    margin: 12px 0;
}

.campana-stock,
.boton-flujo {
    padding: 8px;
}

.campana-stock span {
    font-size: 12px;
    font-weight: 700;
}

#entrada-stock {
    display: grid;
    gap: 12px;
    background: #edf4fc;
    padding: 16px;
    border-radius: 12px;
}

#entrada-stock input {
    min-width: 0;
    max-width: 100%;
    width: 100%;
}

#entrada-stock button {
    justify-self: start;
}

.modal-consulta table {
    width: 100%;
}

@media (max-width: 480px) {
    .flujo-stock {
        grid-template-columns: minmax(0, 1fr);
    }

    .aviso-stock {
        padding: 12px;
    }

    .aviso-stock button {
        width: 100%;
    }

    .modal-consulta .pasos-flujo {
        padding-left: 20px;
        font-size: 14px;
    }
}

/* 1.15.1 · Cuatro contadores sin duplicar existencias entre estados. */
.flujo-stock {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.flujo-stock .card {
    min-width: 0;
}

.flujo-stock h3 {
    font-size: 15px;
    margin: 8px 0;
}

.stock-total {
    border-top: 4px solid #102d50;
    background: #eef3fa;
}

.stock-disponible strong {
    color: #2169b4;
}

.stock-preparacion strong {
    color: #a66105;
}

.stock-terminados strong {
    color: #208346;
}

.stock-total strong {
    color: #102d50;
}

.flujo-stock .contador-stock-cero {
    color: #b42318 !important;
}

.contadores-stock-inicio h2 {
    color: #123657;
}

.contadores-stock-inicio {
    margin-bottom: 18px;
}

@media (max-width: 900px) {
    .flujo-stock {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 380px) {
    .flujo-stock {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* 1.16.1 · Campana desplegable y referencia del calendario en primer plano. */
.panel-notificaciones {
    position: fixed;
    z-index: 2200;
    width: min(390px, calc(100vw - 24px));
    max-height: 75dvh;
    overflow: auto;
    background: white;
    border: 1px solid #c9d9eb;
    border-radius: 13px;
    box-shadow: 0 16px 44px #0d2f5933;
    padding: 12px;
}

.panel-notificaciones[hidden] {
    display: none;
}

.panel-notificaciones header {
    padding: 8px;
    background: none;
}

.panel-notificaciones article {
    padding: 12px;
    border-radius: 9px;
    margin: 10px 0;
}

.panel-notificaciones p {
    margin: 8px 0;
}

.panel-notificaciones button {
    margin: 4px 0;
    max-width: 100%;
}

.panel-notificaciones footer {
    padding: 8px;
}

.referencia-calendario {
    border-top: 4px solid #226db6;
    background: #edf5ff;
    margin-bottom: 20px;
}

.referencia-calendario > summary {
    font-size: 20px;
    padding: 10px;
    color: #12395f;
}

.buscar-selector {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin: 5px 0;
    background: #f0f6ff;
    border-color: #8db3df;
}

#error-configuracion {
    color: #b42318;
    font-weight: 600;
}

.acceso-actualizar {
    font-size: 13px;
    padding: 8px;
}

/* 1.16.1 · Campos de Configuración y selector de color con altura legible. */
#settings .grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}

#settings input[type="color"] {
    width: 100%;
    height: 44px;
    min-height: 44px;
    padding: 5px;
}

#settings input {
    max-width: 100%;
    min-width: 0;
}

/* AlmacenTech 1.16.4 · Fila activa uniforme y espacio legible según resolución.
 * No reducir las letras para encajar muchas columnas: el contenedor desplaza la tabla.
 */
table tbody tr:hover > td,
table tr:not(:has(th)):hover > td {
    background: #e0efff !important;
    color: #142d4e;
}

table tbody tr:focus-within > td {
    background: #e0efff !important;
    box-shadow:
        inset 0 1px #85b6e6,
        inset 0 -1px #85b6e6;
}

@media (min-width: 761px) {
    main {
        padding: 18px;
        max-width: none;
    }

    .table-wrap {
        overflow-x: auto;
        max-width: 100%;
        -webkit-overflow-scrolling: touch;
    }

    [data-tabla-equipos] {
        min-width: 1200px;
        table-layout: auto;
    }

    [data-tabla-equipos] th,
    [data-tabla-equipos] td {
        font-size: 13px;
        padding: 11px 9px;
        overflow-wrap: normal;
        word-break: normal;
    }

    [data-tabla-equipos] th {
        white-space: nowrap;
    }

    [data-tabla-equipos] td button {
        white-space: nowrap;
    }

    [data-tabla-equipos] td b {
        overflow-wrap: break-word;
    }

    .table-wrap:has([data-tabla-equipos]) {
        border: 1px solid #cbd9e8;
        border-radius: 10px;
    }
}

@media (max-width: 760px) {
    .tabla-adaptable tr:hover,
    .tabla-adaptable tr:focus-within {
        background: #e0efff;
    }

    .filtros-normales label {
        min-width: 0;
        flex: 1 1 160px;
    }

    .filtros-normales select {
        max-width: 100%;
    }
}

/* 1.16.5 · Estados con texto blanco, incluso al resaltar la fila. */
.badge {
    color: #fff !important;
    font-weight: 700;
}

.badge-pendiente {
    background: #b42318;
}

.badge-preparacion {
    background: #1565c0;
}

/* 1.21.6 · Saldos en una sola banda, sin duplicar el panel de equipos. */
.flujo-stock {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.seguimiento-almacen .resumen-compacto {
    margin: 12px 0;
}

.seguimiento-almacen > .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 500px) {
    .flujo-stock {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .seguimiento-almacen > .cards {
        grid-template-columns: 1fr;
    }
}

/* 1.21.6 · Encabezados y avisos comunes, incluidos los apartados técnicos. */
table th,
.tabla-adaptable th {
    background: #102b4b !important;
    color: #fff !important;
    font-weight: 800 !important;
}

.flechas-orden .orden-columna {
    color: #fff !important;
    background: transparent !important;
    border: 0;
    font-weight: 900;
}

.flechas-orden .orden-columna.orden-activo {
    color: #62ee98 !important;
    background: #173d51 !important;
}

/* Los errores conservan texto blanco sobre rojo, incluida la acción y el cierre. */
.notificacion.error {
    background: #b42318 !important;
    border-color: #7f1d16 !important;
    color: #fff !important;
    border-left: 6px solid #7f1d16;
    border-radius: 12px;
    box-shadow: 0 8px 24px #42110b35;
}

.notificacion.error span,
.notificacion.error button {
    color: #fff !important;
}

.notificacion.error button {
    background: transparent !important;
    border-color: transparent !important;
}

.notificacion.error .button {
    background: #fff !important;
    color: #8e1c13 !important;
}

.notificacion.error .tiempo-notificacion {
    background: #fff !important;
}

.notificacion {
    align-items: center;
}

.notificacion > span:nth-child(2) {
    white-space: normal;
    overflow-wrap: anywhere;
}

/* 1.21.6 · Estado vacío común: también se aplica a módulos y herramientas. */
.estado-vacio-comun {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 210px;
    padding: 32px 18px;
    text-align: center;
    white-space: normal;
    line-height: 1.5;
    background: #fff;
    color: #153858;
    width: 100%;
}

.estado-vacio-comun .icono-estado-vacio {
    font-size: 36px;
    color: #1973ce;
    line-height: 1.2;
}

.estado-vacio-comun strong {
    font-size: 16px;
    color: #173b61;
}

.estado-vacio-comun p {
    margin: 0;
    max-width: 580px;
    font-size: 13px;
    color: #55708c;
}

.estado-vacio-comun .restablecer-estado-vacio {
    background: #ffc857 !important;
    color: #302100 !important;
    border: 1px solid #c98e1c;
    font-weight: 700;
    padding: 9px 14px;
    border-radius: 8px;
    margin-top: 5px;
}

tr[data-empty] > td {
    padding: 0 !important;
}

tr[data-empty] > td:before {
    display: none !important;
}

tr[data-empty] .estado-vacio-comun {
    box-sizing: border-box;
}

.tabla-adaptable tr[data-empty] > td {
    display: table-cell;
    grid-template-columns: none;
}

/* Solo menús/pestañas seleccionados: los botones Guardar y las alertas mantienen su contraste. */
.menu-principal .active,
.menu-principal button.active,
.menu-principal .grupo-menu[open] > summary {
    color: #000 !important;
    background: #dceaff !important;
    border-color: #7ea4d1 !important;
}

.submenu-centrado button.primary,
.submenu-centrado a.primary,
.submenu-centrado [aria-selected="true"],
.pasos-formulario button.primary,
[data-grupo-check].primary {
    color: #000 !important;
}

.submenu-centrado [data-report="eliminados"].primary {
    background: #ffd0c8 !important;
    color: #000 !important;
    border-color: #a52b20 !important;
}

.navegacion-inferior a.active {
    background: #dceaff;
    color: #000;
}

.menu-principal .active .icono-menu,
.submenu-centrado .primary .icono-menu {
    color: inherit !important;
}

@media (max-width: 600px) {
    .estado-vacio-comun {
        min-height: 185px;
        padding: 25px 14px;
    }

    .estado-vacio-comun strong {
        font-size: 15px;
    }
}

.submenu-centrado button.primary:not([data-report]),
.submenu-centrado a.primary,
.pasos-formulario button.primary,
[data-grupo-check].primary {
    background: #dceaff !important;
    border-color: #7ea4d1 !important;
    color: #000 !important;
}

.navegacion-inferior a.inicio-central.active {
    background: #e8b450;
    color: #000;
    outline: 2px solid #ffe3a0;
    outline-offset: -2px;
}

/* 2.0.6.4: desglose de Sin preparar también en módulo Stock. */
.desglose-sin-preparar{display:flex;gap:5px 12px;flex-wrap:wrap;margin:8px 0 6px;font-size:.79rem;}
.desglose-sin-preparar span{display:inline-flex;gap:5px;align-items:center;}
