/* ============================================================
   SS_System - Web App
   ============================================================ */


* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    color: #1b2330;
    background: #eef1f6;
}
button, input, select { font: inherit; color: inherit; }
h1, h2 { margin: 0; line-height: 1.25; }

/* ---------- Controles ---------- */
label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; color: #2c3647; }
input[type="text"], input[type="password"], input[type="search"], input[type="email"], input[type="tel"], input[type="date"], select, textarea {
    width: 100%;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #d6dce5;
    border-radius: 6px;
    background: #fff;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus { border-color: #1f4fa8; box-shadow: 0 0 0 3px rgba(31, 79, 168, .15); }
input.invalido { border-color: #b83227; }
.solo-lectura, input[readonly] { background: #f4f6f9; color: #5d6878; }
.centrado { text-align: center; }
.mayus { text-transform: uppercase; }
.req { color: #b83227; }
.ayuda { color: #5d6878; font-size: 12px; }

label.check {
    display: inline-flex; align-items: center;
    font-weight: 400; margin: 0; cursor: pointer;
}
label.check.fuerte { font-weight: 600; }
label.check input { width: 16px; height: 16px; margin: 0; }
label.check small { color: #5d6878; }

.btn {
    display: inline-flex; align-items: center; justify-content: center;
    height: 36px; padding: 0 16px;
    border: 1px solid #d6dce5; border-radius: 6px;
    background: #fff; cursor: pointer; font-weight: 600;
    transition: background .15s, border-color .15s;
}
.btn:hover:not(:disabled) { background: #f3f5f9; border-color: #c3cbd8; }
.btn:focus { outline: 3px solid rgba(31, 79, 168, .3); outline-offset: 1px; }
.btn.primario { background: #1f4fa8; border-color: #1f4fa8; color: #fff; }
.btn.primario:hover:not(:disabled) { background: #173d84; }
.btn.peligro { color: #b83227; }
.btn.peligro:hover:not(:disabled) { background: #fbeeed; border-color: #eab6b1; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.botones { display: flex; flex-wrap: wrap; margin-top: 20px; }

.alerta {
    padding: 10px 12px; border-radius: 6px; margin-bottom: 16px;
    border: 1px solid; font-weight: 500;
}
.alerta.error { background: #fbeeed; border-color: #efc1bc; color: #b83227; }
.alerta.aviso { background: #fdf6e7; border-color: #efd9a8; color: #9a6a12; }
.alerta.ok { background: #e9f6ef; border-color: #b8e0cb; color: #1d7d52; }

/* ============================================================
   LOGIN (jfLogin)
   ============================================================ */
.pagina-login {
    display: flex; align-items: center; justify-content: center; min-height: 100%;
    padding: 24px 16px;
    background: linear-gradient(160deg, #15213a 0%, #1f4fa8 100%);
}
.login-caja {
    width: 100%; max-width: 360px;
    background: #ffffff; border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .3);
    overflow: hidden;
}
.login-cabecera {
    text-align: center; padding: 24px 24px 12px;
    background: #f4f6fa; border-bottom: 1px solid #d6dce5;
}
.login-candado { width: 96px; height: auto; display: block; margin: 0 auto 8px; }
.login-cabecera h1 { font-size: 22px; color: #0b1f66; font-style: italic; }
.login-cabecera p { margin: 4px 0 0; color: #5d6878; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.login-caja form { padding: 20px 24px 24px; }
.login-caja form > label { margin-top: 12px; }
.login-caja form > label:first-of-type { margin-top: 0; }
.login-caja label.check { margin-top: 12px; }
.aviso-mayus { color: #e0002c; font-weight: 700; font-size: 13px; margin-top: 6px; }
.login-caja .botones { margin-top: 20px; }
.login-caja .botones .btn { flex: 1; }
/* multi-sucursal: el usuario elige la sucursal a la que entra */
.login-caja a.btn { text-decoration: none; color: #2c3647; }
.login-pregunta { margin: 0 0 12px; font-weight: 600; color: #2c3647; text-align: center; }
.login-sucursales { display: flex; flex-direction: column; }
.login-sucursal { height: auto; min-height: 44px; margin-bottom: 8px; padding: 8px 14px; text-align: left; justify-content: flex-start; line-height: 1.25; }
.login-sucursal-num { display: inline-block; min-width: 30px; margin-right: 10px; padding: 2px 6px; border-radius: 4px; background: rgba(255, 255, 255, .22); text-align: center; }

/* ============================================================
   PRINCIPAL: menu fijo + area de contenido
   ============================================================ */
/* Alto de la ventana: en el celular 100vh es el alto SIN descontar las barras del navegador (arriba y abajo), y lo de abajo del menu queda tapado y sin
   poder subir a el. 100dvh es el alto visible de verdad; si el navegador no lo conoce, principal.jsp pone el alto con window.innerHeight. */
.pagina-principal { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }

.menu {
    width: 272px; flex: 0 0 272px;
    display: flex; flex-direction: column;
    background: #15213a; color: #c9d3e6;
    height: 100vh; height: 100dvh;
}
.menu-marca {
    display: flex; align-items: center; justify-content: space-between;
    height: 56px; padding: 0 18px; border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.marca { color: #fff; text-decoration: none; font-size: 20px; font-weight: 800; letter-spacing: .02em; }
.marca span { color: #7fa6ff; font-weight: 600; }
.menu-cerrar { display: none; background: none; border: 0; color: #c9d3e6; font-size: 26px; cursor: pointer; }

.menu-usuario {
    display: flex; align-items: center;
    padding: 14px 18px; border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.avatar {
    width: 38px; height: 38px; border-radius: 50%; flex: none;
    display: flex; align-items: center; justify-content: center;
    background: #2a4a8f; color: #fff; font-weight: 700;
}
.usuario-nombre { color: #fff; font-weight: 600; line-height: 1.2; }
.usuario-perfil { color: #7f8ca6; font-size: 12px; margin-top: 2px; }
/* multi-sucursal: la sucursal con la que trabaja el usuario (y, si puede, el cambio) */
.menu-sucursal { padding: 10px 18px 12px; border-bottom: 1px solid rgba(255, 255, 255, .06); font-size: 12px; color: #7f8ca6; }
.menu-sucursal strong { display: block; color: #cfe0ff; font-size: 13px; font-weight: 600; margin-top: 2px; }
.menu-sucursal select { width: 100%; margin-top: 6px; height: 30px; padding: 0 8px; border: 1px solid #2a3c63; border-radius: 6px; background: #1c2b4a; color: #fff; font-size: 13px; }
.barra-sucursal { margin-right: 16px; padding: 3px 10px; border-radius: 12px; background: #e8efff; color: #1f4fa8; font-size: 12px; font-weight: 600; white-space: nowrap; }

.menu-grupos { flex: 1; overflow-y: auto; padding: 8px 8px 16px; }

.opcion-inicio, .grupo-titulo {
    display: flex; align-items: center; width: 100%;
    padding: 9px 10px; border: 0; border-radius: 6px;
    background: none; color: #c9d3e6; text-decoration: none; text-align: left;
    cursor: pointer; font-weight: 600;
}
.opcion-inicio:hover, .grupo-titulo:hover:not(:disabled) { background: #1c2b4a; color: #fff; }
.opcion-inicio.seleccionada { background: #1f4fa8; color: #fff; }
.ico { width: 20px; text-align: center; flex: none; }
.grupo-titulo .txt { flex: 1; }
.flecha { font-size: 11px; transition: transform .15s; color: #7f8ca6; }
.grupo.abierto > .grupo-titulo .flecha, .sub.abierto > .sub-titulo .flecha { transform: rotate(90deg); }
.grupo.abierto > .grupo-titulo { color: #fff; }
.grupo-titulo:disabled { opacity: .4; cursor: not-allowed; }

.items, .sub ul { list-style: none; margin: 0; padding: 0; display: none; }
.grupo.abierto > .items { display: block; padding: 2px 0 6px 30px; }
.sub.abierto > ul { display: block; padding-left: 12px; border-left: 1px solid #2a3857; margin-left: 8px; }

.opcion, .sub-titulo {
    display: flex; align-items: center; justify-content: space-between; width: 100%;
    padding: 6px 10px; border: 0; border-radius: 5px;
    background: none; color: #c9d3e6; text-decoration: none; text-align: left;
    font-size: 13px; cursor: pointer;
}
.opcion:hover, .sub-titulo:hover:not(:disabled) { background: #1c2b4a; color: #fff; }
.opcion.seleccionada { background: #1f4fa8; color: #fff; }
.opcion.activa-modulo::after { content: "web"; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 10px; background: #2a4a8f; color: #cfe0ff; }
.opcion.seleccionada.activa-modulo::after { background: rgba(255, 255, 255, .2); color: #fff; }
.opcion.deshabilitado, .sub-titulo:disabled { color: #56627b; cursor: not-allowed; }
.opcion.deshabilitado:hover { background: none; color: #56627b; }

/* Pie del menu: Chat / Notas / Ayuda en lista y, siempre visibles abajo, Cambiar Usuario y Salir lado a lado */
.menu-pie { display: flex; flex-wrap: wrap; flex: none; border-top: 1px solid rgba(255, 255, 255, .06); }
.menu-pie .salir {
    flex: 1 1 50%; min-width: 0; text-align: center; padding: 12px 8px;
    color: #c9d3e6; text-decoration: none; font-size: 13px; font-weight: 600;
}
.menu-pie .salir { white-space: nowrap; }
.menu-pie .salir.extra { flex: 1 1 100%; padding: 8px 18px; text-align: left; border-bottom: 1px solid rgba(255, 255, 255, .04); }
.menu-pie .salir:not(.extra) + .salir:not(.extra) { border-left: 1px solid rgba(255, 255, 255, .06); }
.menu-pie .salir:not(.extra) { border-top: 1px solid rgba(255, 255, 255, .06); }
.menu-pie .salir:hover { background: #1c2b4a; color: #fff; }

.area { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.barra {
    height: 56px; flex: none; display: flex; align-items: center;
    padding: 0 20px; background: #ffffff; border-bottom: 1px solid #d6dce5;
}
.barra h2 { font-size: 16px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barra-fecha { color: #5d6878; font-size: 13px; text-transform: capitalize; white-space: nowrap; }
.menu-abrir { display: none; background: none; border: 0; font-size: 22px; cursor: pointer; }
#contenido { flex: 1; width: 100%; border: 0; background: #eef1f6; }
/* Pie de pagina de la ventana principal: queda fijo debajo de las pantallas (que se desplazan dentro del iframe) */
.pie-sistema { flex: none; padding: 7px 16px; background: #ffffff; border-top: 1px solid #d6dce5; color: #5d6878; font-size: 12px; line-height: 1.4; text-align: center; }
.pie-sistema .nowrap { white-space: nowrap; }
.velo { display: none; }

@media (max-width: 860px) {
    .menu { position: fixed; left: 0; top: 0; z-index: 20; transform: translateX(-100%); transition: transform .2s; width: 288px; max-width: 86vw; flex-basis: auto; }
    .menu-visible .menu { transform: none; }
    /* en el celular el menu entero (marca, usuario, grupos y pie con Cambiar Usuario / Salir) se desplaza como una sola lista: asi nada queda fuera de la pantalla */
    .menu { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
    .menu-grupos { flex: none; overflow: visible; }
    .menu-visible .velo { display: block; position: fixed; top: 0; right: 0; bottom: 0; left: 0; background: rgba(0, 0, 0, .4); z-index: 10; }
    .menu-cerrar, .menu-abrir { display: block; }
    .barra { padding: 0 12px; }
    .barra-fecha { display: none; }
}

/* ============================================================
   PANTALLAS dentro del iframe
   ============================================================ */
.pantalla { padding: 24px; min-height: 100%; }

.bienvenida h1 { font-size: 24px; }
.bienvenida p { color: #5d6878; margin: 6px 0 0; }
.accesos { display: flex; flex-wrap: wrap; margin: 24px -8px 0; max-width: 916px; }
.accesos .acceso { flex: 1 1 260px; margin: 0 8px 16px; }
.accesos .nota { margin: 0 8px; }
.acceso {
    display: flex; align-items: center; padding: 18px;
    background: #ffffff; border: 1px solid #d6dce5; border-radius: 8px;
    color: inherit; text-decoration: none; box-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .06);
    transition: border-color .15s, transform .15s;
}
.acceso:hover { border-color: #1f4fa8; transform: translateY(-1px); }
.acceso-ico { font-size: 26px; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; background: #e5edfb; border-radius: 10px; }
.acceso-txt { display: flex; flex-direction: column; }
.acceso-txt small { color: #5d6878; }
.nota { color: #5d6878; }

/* Inicio: los botones de afuera de Principal (Panel de Accesos y Sub-Botones); sin permiso quedan deshabilitados como en el escritorio */
.panel-accesos { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 14px; max-width: 1060px; margin: 26px 0 18px; }
.sub-botones { display: flex; flex-wrap: wrap; gap: 14px; max-width: 1060px; }
.pa-btn, .sb-btn {
    display: flex; align-items: center; color: #1b2a41; text-decoration: none; cursor: pointer;
    background: linear-gradient(180deg, #ffffff 0%, #f6f9fe 100%); border: 1px solid #d9e0ec; border-radius: 12px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 6px 18px rgba(31, 79, 168, .08);
    transition: border-color .15s, transform .15s, box-shadow .15s;
}
.pa-btn { height: 68px; padding: 0 18px 0 12px; font-size: 16px; font-weight: 700; letter-spacing: .1px; }
.pa-btn span { min-width: 0; line-height: 1.15; overflow-wrap: anywhere; }
.pa-btn.pa-largo { padding-right: 10px; font-size: 14.5px; }
.pa-btn.pa-largo img { margin-right: 10px; }
.pa-btn img { flex: none; width: 48px; height: 48px; padding: 8px; margin-right: 12px; box-sizing: border-box; object-fit: scale-down; background: #e8f0fd; border-radius: 12px; transition: background .15s; }
.sb-btn { flex-direction: column; justify-content: center; width: 116px; min-height: 92px; padding: 10px 8px 9px; text-align: center; font-size: 13px; font-weight: 700; line-height: 1.2; }
.sb-btn img { flex: none; width: 46px; height: 46px; padding: 7px; margin-bottom: 7px; box-sizing: border-box; object-fit: scale-down; background: #e8f0fd; border-radius: 12px; transition: background .15s; }
.sb-btn span { display: block; }
.pa-btn:hover, .sb-btn:hover { border-color: #1f4fa8; transform: translateY(-2px); box-shadow: 0 2px 4px rgba(16, 24, 40, .08), 0 10px 24px rgba(31, 79, 168, .16); }
.pa-btn:hover img, .sb-btn:hover img { background: #d5e4fb; }
.pa-btn:focus-visible, .sb-btn:focus-visible { outline: none; border-color: #1f4fa8; box-shadow: 0 0 0 3px rgba(31, 79, 168, .28), 0 6px 18px rgba(31, 79, 168, .12); }
.pa-btn.deshabilitado, .sb-btn.deshabilitado { opacity: .5; filter: grayscale(1); cursor: not-allowed; box-shadow: none; }
.pa-btn.deshabilitado:hover, .sb-btn.deshabilitado:hover { border-color: #d9e0ec; transform: none; box-shadow: none; }
.pa-btn.deshabilitado:hover img, .sb-btn.deshabilitado:hover img { background: #e8f0fd; }
.vacio { max-width: 520px; margin: 60px auto; text-align: center; }
.vacio-ico { font-size: 48px; }
.vacio h1 { font-size: 20px; margin-top: 8px; }
.vacio p { color: #5d6878; }

.tarjeta {
    background: #ffffff; border: 1px solid #d6dce5; border-radius: 8px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .06); padding: 24px; max-width: 1100px;
}
.tarjeta-cabecera {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid #d6dce5;
}
.tarjeta-cabecera h1 { font-size: 18px; }
.tarjeta-cabecera p { margin: 4px 0 0; color: #5d6878; font-size: 13px; }

.rejilla { display: flex; flex-wrap: wrap; margin: 0 -8px; }
.rejilla .campo { width: 25%; padding: 0 8px; margin-bottom: 16px; }
.rejilla .campo.ancho { width: 50%; }
.rejilla .campo.ancho2 { width: 50%; }
.campo.alinear-abajo { display: flex; align-items: flex-end; padding-bottom: 8px; }
.campo .ayuda { display: block; margin-top: 4px; }

@media (max-width: 900px) {
    .rejilla .campo { width: 50%; }
    .rejilla .campo.ancho, .rejilla .campo.ancho2 { width: 100%; }
}
@media (max-width: 560px) {
    .pantalla { padding: 12px; }
    .tarjeta { padding: 16px; }
    .rejilla .campo, .rejilla .campo.ancho, .rejilla .campo.ancho2 { width: 100%; }
    .tarjeta-cabecera { flex-direction: column; }
}

/* ---------- Perfil de Seguridad ---------- */
.grupos-permisos {
    display: flex; flex-wrap: wrap; align-items: flex-start; margin-left: -8px; margin-right: -8px;
    margin-top: 20px; align-items: start;
}
.grupo-permisos { flex: 1 1 300px; margin: 0 8px 16px; padding: 0; border: 1px solid #d6dce5; border-radius: 8px; background: #fbfcfe; }
.grupo-permisos legend {
    display: flex; justify-content: space-between; align-items: center; width: 100%;
    float: left; padding: 10px 14px; margin: 0;
    background: #f0f3f8; border-bottom: 1px solid #d6dce5; border-radius: 8px 8px 0 0;
    font-weight: 700; color: #0b1f66;
}
.grupo-permisos legend + * { clear: both; }
.todos-grupo { font-size: 12px; color: #5d6878; font-weight: 600; }
.permisos { display: flex; flex-wrap: wrap; padding: 12px 8px 6px 14px; }
.permisos label.check { width: 50%; padding-right: 8px; margin-bottom: 8px; }
.permisos label.check { font-size: 13px; align-items: flex-start; }
.permisos label.check input { margin-top: 1px; flex: none; }

/* ---------- Dialogo de busqueda ---------- */
.dialogo {
    width: 720px; max-width: 95%; max-height: 92%;
    padding: 20px; border: 0; border-radius: 12px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}
.dialogo-cabecera { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.dialogo-cabecera h2 { font-size: 17px; }
.cerrar { background: none; border: 0; font-size: 24px; cursor: pointer; color: #5d6878; line-height: 1; }
.buscar { margin-bottom: 12px; }
.tabla-caja { max-height: 50vh; overflow: auto; border: 1px solid #d6dce5; border-radius: 6px; }
.tabla { width: 100%; border-collapse: collapse; }
.tabla th, .tabla td { padding: 8px 12px; text-align: left; border-bottom: 1px solid #eef1f5; white-space: nowrap; }
.tabla th { position: sticky; top: 0; background: #f0f3f8; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: #5d6878; }
.tabla tbody tr { cursor: pointer; }
.tabla tbody tr:hover { background: #f5f8fd; }
.tabla tbody tr.sel { background: #e5edfb; box-shadow: inset 3px 0 0 #1f4fa8; }
.tabla td:first-child { color: #5d6878; width: 60px; }

/* ---------- Aviso flotante ---------- */
.toast {
    position: fixed; left: 50%; top: 20px; transform: translateX(-50%);
    background: #2a2f3a; color: #fff; padding: 10px 18px; border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .25); z-index: 1000; font-weight: 500;
    transition: opacity .4s;
}
.toast.fuera { opacity: 0; }

/* ---------- Alertas de la esquina inferior derecha (js/alertas.js): se quitan solas, se apilan hacia arriba ---------- */
.alertas-esquina {
    position: fixed; right: 16px; bottom: 16px; z-index: 2000;
    display: flex; flex-direction: column; align-items: flex-end; justify-content: flex-end;
    width: min(380px, calc(100vw - 24px));
    pointer-events: none;
}
.alerta-esq {
    position: relative; width: 100%; margin-top: 10px; padding: 12px 14px 15px 16px;
    background: #fff; color: #1b2330; border: 1px solid #d6dce5; border-left: 5px solid #d99a1a; border-radius: 8px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .28); overflow: hidden; pointer-events: auto;
    animation: alerta-entra .28s ease-out;
    transition: opacity .28s, transform .28s;
}
.alerta-esq.info { border-left-color: #1f4fa8; }
.alerta-esq.error { border-left-color: #b83227; }
.alerta-esq.ok { border-left-color: #1d7d52; }
.alerta-esq.saliendo { opacity: 0; transform: translateX(24px); }
.alerta-cab { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.alerta-cab strong { font-size: 13px; color: #5d6878; }
.alerta-x { border: 0; background: transparent; cursor: pointer; font-size: 20px; line-height: 1; padding: 0 2px; color: #5d6878; }
.alerta-x:hover { color: #b83227; }
.alerta-texto { font-size: 14px; line-height: 1.4; word-break: break-word; }
.alerta-esq.enlace { cursor: pointer; }
.alerta-esq.enlace .alerta-texto { color: #1f4fa8; font-weight: 600; }
.alerta-esq.enlace:hover .alerta-texto, .alerta-esq.enlace:focus .alerta-texto { text-decoration: underline; font-style: italic; }
.alerta-esq.enlace:focus { outline: 3px solid rgba(31, 79, 168, .3); outline-offset: -3px; }
.alerta-pista { margin-top: 3px; font-size: 12px; color: #5d6878; }
.alerta-accion { margin-top: 8px; padding: 4px 12px; border: 1px solid #1f4fa8; border-radius: 6px; background: #1f4fa8; color: #fff; font-weight: 600; cursor: pointer; }
.alerta-accion:hover { background: #173d84; }
/* Consejos de la IA: varios botones, reacciones (Util / No me interesa / Pausar) y color propio */
.alerta-acciones { margin-top: 8px; }
.alerta-acciones .alerta-accion { margin-top: 0; margin-right: 6px; margin-bottom: 4px; }
.alerta-accion.sec { background: #fff; color: #1f4fa8; }
.alerta-accion.sec:hover { background: #eef3fb; }
.alerta-reac { margin-top: 6px; font-size: 12px; color: #5d6878; }
.alerta-reac.gracias { color: #1d7d52; font-weight: 600; }
.alerta-mini { margin-right: 6px; margin-bottom: 4px; padding: 2px 8px; border: 1px solid #c9d2df; border-radius: 12px; background: #f7f9fc; color: #2c3647; font-size: 12px; cursor: pointer; }
.alerta-mini:hover { background: #e9eef6; border-color: #1f4fa8; }
.alerta-esq.consejo { border-left-color: #6a4bb5; }
.alerta-esq.consejo .alerta-barra { background: rgba(106, 75, 181, .35); }
.alerta-esq.ok .alerta-barra { background: rgba(29, 125, 82, .35); }
.alerta-barra { position: absolute; left: 0; bottom: 0; height: 4px; width: 100%; background: rgba(31, 79, 168, .35); transform-origin: left; animation: alerta-cuenta 15s linear forwards; }
.alerta-esq.error .alerta-barra { background: rgba(184, 50, 39, .35); }
.alerta-esq:hover .alerta-barra { animation-play-state: paused; }
@keyframes alerta-entra { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
@keyframes alerta-cuenta { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* Espaciados (en lugar de "gap", para compatibilidad con el editor de NetBeans) */
label.check input { margin-right: 8px; }
.btn .ico-btn, .botones .btn { margin-right: 8px; margin-bottom: 4px; }
.menu-usuario .avatar { margin-right: 12px; }
.opcion-inicio .ico, .grupo-titulo .ico { margin-right: 10px; }
.barra .menu-abrir { margin-right: 12px; }
.acceso .acceso-ico { margin-right: 14px; }
.tarjeta-cabecera > div { margin-right: 16px; }
.grupo-permisos legend span { margin-right: 12px; }
.login-caja .botones .btn:last-child { margin-right: 0; }
label.check small { margin-left: 6px; }

/* ============================================================
   CUENTAS X COBRAR
   ============================================================ */
textarea { height: auto; padding: 8px 10px; resize: vertical; line-height: 1.4; }
input.numero, .num { text-align: right; }
.tarjeta.angosta { max-width: 720px; }
.tarjeta.ancha { max-width: 1280px; }
.rejilla .campo.completo { width: 100%; }
.rejilla .campo.corto { width: 25%; }
.opciones { display: flex; flex-wrap: wrap; align-items: center; min-height: 36px; }
.opciones > * { margin-right: 14px; }
.opciones.columna { flex-direction: column; align-items: stretch; }
.opciones.columna > * { margin: 0 0 6px 0; }
.centrado-flex { justify-content: center; }
.btn.chico { height: 30px; padding: 0 10px; font-size: 12px; font-weight: 600; }
.btn small { font-weight: 400; opacity: .75; margin-left: 4px; }
.con-boton { display: flex; }
.con-boton input { flex: 1; min-width: 0; }
.con-boton .btn { margin-left: 6px; height: 36px; }
.subtitulo { font-size: 14px; margin: 20px 0 8px; color: #2c3647; }
.etiqueta { display: inline-block; margin-left: 8px; padding: 2px 10px; border-radius: 12px; background: #e5edfb; color: #1f4fa8; font-size: 13px; vertical-align: middle; }
.sep { margin-top: 12px; }
.dialogo-cuerpo { margin-bottom: 4px; }
.dialogo-cuerpo label { margin-top: 8px; }
.ayuda { color: #5d6878; font-size: 12px; }

/* Pestanas (jtpMovimientos) */
.pestanas { display: flex; border-bottom: 1px solid #d6dce5; margin-bottom: 16px; }
.pestana { background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 16px; font-weight: 600; color: #5d6878; cursor: pointer; }
.pestana.activa { color: #1f4fa8; border-bottom-color: #1f4fa8; }
.pestana:disabled { opacity: .4; cursor: not-allowed; }

/* Clientes */
.cliente-grid { display: flex; align-items: flex-start; }
.cliente-grid > div { flex: 1; min-width: 0; }
.cliente-lado { width: 220px; flex: none; margin-left: 20px; }
.foto-caja { width: 180px; height: 200px; margin: 0 auto 10px; border: 1px dashed #c3cbd8; border-radius: 8px; display: flex; align-items: center; justify-content: center; overflow: hidden; background: #f7f9fc; color: #8a94a6; }
.foto-caja img { max-width: 100%; max-height: 100%; }
.datos-cliente { margin: 16px 0 0; }
.datos-cliente dt { font-size: 12px; color: #5d6878; margin-top: 8px; }
.datos-cliente dd { margin: 2px 0 0; font-weight: 600; }
.datos-cliente .balance { font-size: 20px; color: #0b1f66; }
.aviso-cedula { margin-top: 14px; color: #9a6a12; }
.filtros-mov { display: flex; flex-wrap: wrap; }
.filtros-mov label.check { margin: 0 16px 8px 0; }
.botones.izquierda { margin-top: 0; margin-bottom: 12px; align-items: center; }
.balance-mov { margin-left: auto; }
.tabla-caja.media { max-height: 42vh; margin-top: 12px; }
.tabla-caja.alta { max-height: 60vh; }
.tabla td.num, .tabla th.num { text-align: right; }
.tabla td.centro { text-align: center; }
.tabla td.fuerte { font-weight: 700; }
.tabla tbody tr.abonada { background: #eef8f2; }
.tabla tbody tr.inactivo td { color: #b83227; }
.tabla .vacio-tabla { text-align: center; color: #8a94a6; padding: 20px; cursor: default; }
.tabla tr.mov4 td:nth-child(3) { color: #1d7d52; }
.tabla tr.mov5 td:nth-child(3), .tabla tr.mov8 td:nth-child(3) { color: #b83227; }
.tabla tr.mov6 td:nth-child(3) { color: #9a6a12; }

/* Contribuyentes */
.barra-busqueda { display: flex; margin-bottom: 16px; }
.barra-busqueda input { flex: 1; margin-right: 8px; }

/* Autorizacion de credito */
.resumen-montos { display: flex; flex-wrap: wrap; margin: 16px -6px 0; }
.resumen-montos > div { flex: 1 1 160px; margin: 0 6px 10px; padding: 12px 14px; border: 1px solid #d6dce5; border-radius: 8px; background: #fbfcfe; }
.resumen-montos span { display: block; font-size: 12px; color: #5d6878; }
.resumen-montos strong { display: block; font-size: 20px; margin-top: 4px; color: #0b1f66; }
.resumen-montos strong.negativo { color: #b83227; }
.estado-aut { margin: 12px 0 0; padding: 10px 12px; border-radius: 6px; background: #fdf6e7; color: #9a6a12; }
.estado-aut.ok { background: #e9f6ef; color: #1d7d52; }

/* Recibos / Notas */
.linea-abono { display: flex; flex-wrap: wrap; align-items: flex-end; margin-top: 16px; padding: 12px; background: #f4f6fa; border-radius: 8px; }
.linea-abono .campo { width: 180px; margin-right: 10px; }
.linea-abono .btn { margin-right: 8px; }
.pie-recibo { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-top: 14px; }
.adjunto { display: flex; align-items: center; }
.foto-mini { width: 90px; height: 70px; margin-right: 10px; border: 1px dashed #c3cbd8; border-radius: 6px; display: flex; align-items: center; justify-content: center; overflow: hidden; font-size: 11px; color: #8a94a6; background: #f7f9fc; cursor: pointer; }
.foto-mini img { max-width: 100%; max-height: 100%; }
.impresion label { display: inline-flex; margin-right: 12px; }
/* lista "Impresora" de los formularios (comboImpresoras): elegir una la deja como predeterminada del servidor */
select.sel-impresora { width: auto; min-width: 170px; max-width: 260px; height: 30px; font-size: 13px; margin-left: 4px; vertical-align: middle; }
/* lista desplegable junto a un boton extra de las listas en dialogo (formularios.js lista(): Enviar Pedido a otra sucursal); la altura de los botones */
.botones select.sel-destino { width: auto; min-width: 170px; max-width: 270px; margin-right: 8px; margin-bottom: 4px; }
.total-grande { text-align: right; }
.total-grande span { color: #5d6878; margin-right: 8px; }
.total-grande strong { font-size: 26px; color: #0b1f66; }

@media (max-width: 900px) {
    .cliente-grid { flex-direction: column; }
    .cliente-lado { width: 100%; margin: 16px 0 0; }
    .rejilla .campo.corto { width: 50%; }
}
@media (max-width: 560px) {
    .rejilla .campo.corto { width: 100%; }
    .linea-abono .campo { width: 100%; margin-right: 0; }
    .pie-recibo > * { width: 100%; margin-bottom: 10px; }
}

/* Ajustes generales */
[hidden] { display: none !important; }
.opciones > label.check, .opciones > .btn, .opciones > * { margin-right: 16px; }
input:disabled, select:disabled, textarea:disabled { background: #f4f6f9; color: #8a94a6; cursor: not-allowed; }

/* ---- Alertas del login, paneles flotantes y chat ---- */
.menu-pie .salir.extra { display: block; width: 100%; text-align: left; background: transparent; border: 0; cursor: pointer; font: inherit; }
.insignia { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: #b83227; color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.insignia[hidden] { display: none; }
.panel-flotante { position: fixed; z-index: 40; width: 300px; background: #fffbe6; border: 1px solid #e4d58a; border-radius: 8px; box-shadow: 0 6px 20px rgba(0, 0, 0, .18); }
.panel-flotante[hidden] { display: none; }
.panel-flotante .panel-titulo { padding: 6px 10px; font-weight: 700; font-size: 13px; background: #f3e6a1; border-radius: 8px 8px 0 0; cursor: move; user-select: none; }
.panel-flotante textarea { display: block; width: 100%; height: 280px; border: 0; resize: both; padding: 8px 10px; background: transparent; font: inherit; box-sizing: border-box; }

/* ---------- Ayuda: panel movible con la guia de cada opcion del menu (indice por modulo, buscador y guia) ---------- */
.panel-ayuda { width: 440px; height: 540px; min-width: 300px; min-height: 280px; max-width: calc(100vw - 20px); max-height: calc(100vh - 20px); display: flex; flex-direction: column; background: #fff; border-color: #b9c8e2; resize: both; overflow: hidden; }
.panel-ayuda .panel-titulo { flex: none; display: flex; align-items: center; justify-content: space-between; background: #dfe8f7; }
.hlp-x { border: 0; background: transparent; font-size: 20px; line-height: 1; padding: 0 4px; cursor: pointer; color: #34507f; }
.hlp-x:hover { color: #b83227; }
.hlp-cuerpo { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding: 8px 10px 6px; }
.hlp-cuerpo input[type="search"] { flex: none; }
.hlp-contenido { flex: 1; min-height: 0; overflow-y: auto; padding-right: 4px; line-height: 1.45; }
.hlp-pie { flex: none; border-top: 1px solid #e3e8f0; padding-top: 6px; font-size: 12px; color: #5d6878; }
.hlp-pie a { color: #1f4fa8; font-weight: 600; }
.hlp-intro, .hlp-vacio { margin: 2px 0 10px; color: #5d6878; font-size: 13px; }
.hlp-grupo { border: 1px solid #e3e8f0; border-radius: 6px; margin-bottom: 6px; overflow: hidden; }
.hlp-grupo-titulo { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border: 0; background: #f3f6fb; font-weight: 700; color: #243b66; cursor: pointer; text-align: left; }
.hlp-grupo-titulo:hover { background: #e9eff9; }
.hlp-grupo-titulo small { background: #dfe8f7; border-radius: 10px; padding: 1px 8px; font-weight: 600; color: #34507f; }
.hlp-items { display: flex; flex-direction: column; }
.hlp-item { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; padding: 7px 10px 7px 16px; border: 0; border-top: 1px solid #eef1f6; background: #fff; text-align: left; cursor: pointer; color: #1f4fa8; }
.hlp-item:hover, .hlp-item:focus { background: #f3f6fb; outline: none; }
.hlp-item.sin-acceso { color: #8793a6; }
.hlp-item.sin-acceso .hlp-item-t::after { content: " \1F512"; font-size: 11px; }
.hlp-item-g { color: #7a8699; font-size: 11px; }
.hlp-volver { border: 0; background: transparent; color: #1f4fa8; font-weight: 600; cursor: pointer; padding: 2px 0 6px; }
.hlp-titulo { margin: 0 0 2px; font-size: 17px; color: #243b66; }
.hlp-ruta { margin: 0 0 8px; font-size: 12px; color: #7a8699; }
.hlp-sirve { margin: 0 0 10px; }
.hlp-aviso { margin: 0 0 10px; padding: 6px 10px; border-radius: 6px; background: #fdf6e7; border: 1px solid #efd9a8; color: #9a6a12; font-size: 13px; }
.hlp-abrir { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.hlp-abrir-b { height: 30px; padding: 0 12px; font-size: 13px; }
.hlp-sec { margin: 12px 0 4px; font-size: 13px; color: #243b66; text-transform: uppercase; letter-spacing: .03em; }
.hlp-pasos, .hlp-reglas { margin: 0; padding-left: 20px; }
.hlp-pasos li, .hlp-reglas li { margin-bottom: 5px; white-space: pre-line; }
.hlp-meta { margin: 10px 0 0; font-size: 12px; color: #5d6878; }
.hlp-chip { margin: 2px 4px 2px 0; padding: 1px 8px; border: 1px solid #c9d3e3; border-radius: 10px; background: #f3f6fb; color: #1f4fa8; font-size: 12px; cursor: pointer; }
.hlp-chip:hover { background: #e9eff9; }
.chat-lista { height: 46vh; overflow: auto; border: 1px solid #d6dce5; border-radius: 6px; padding: 8px 10px; margin: 8px 0; background: #fff; }
.chat-msg { padding: 4px 0; border-bottom: 1px solid #f0f2f6; white-space: pre-wrap; word-break: break-word; }
.chat-msg.mio { color: #1f4fa8; }
.chat-msg.pendiente { color: #b83227; }

.registro-proceso { max-height: 160px; overflow: auto; background: #f7f9fc; border: 1px solid #d6dce5; border-radius: 6px; padding: 8px 10px; font-size: 12px; margin: 6px 0 12px; white-space: pre-wrap; }
.tabla tr.fila-sel td { background: #e3ecfb; }

/* Busqueda de articulos de Inventario (Formularios.buscarArticulo) */
.tabla tbody tr.sinex td { color: #b83227; }
.tabla tbody tr.combo td { color: #1d6b2f; }
.tabla tbody tr.resaltado td { background: #cdf5cd; }
.tabla tbody tr.resaltado.sel td { background: #bfe3f7; }
.dos-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.dos-cols input { height: 32px; }
@media (max-width: 700px) { .dos-cols { grid-template-columns: 1fr; } }

/* ---------- Tema de color: selector de la barra de arriba (Claro / Oscuro / Gris, ver Clases.Tema y css/tema.css) ---------- */
.tema-sel { position: relative; display: inline-flex; align-items: center; flex: none; margin-right: 16px; padding: 3px; border: 1px solid #d6dce5; border-radius: 999px; background: #f4f6fa; }
.tema-pulgar { position: absolute; top: 3px; bottom: 3px; left: 3px; width: 0; border-radius: 999px; background: #1f4fa8; box-shadow: 0 1px 3px rgba(16, 24, 40, .25); transition: left .28s ease, width .28s ease, background-color .28s ease; pointer-events: none; }
.tema-op { position: relative; z-index: 1; display: inline-flex; align-items: center; height: 28px; padding: 0 12px 0 10px; border: 0; border-radius: 999px; background: none; color: #5d6878; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: color .2s; }
.tema-op svg { width: 16px; height: 16px; margin-right: 6px; flex: none; }
.tema-op[aria-checked="true"] { color: #fff; }
.tema-op:not([aria-checked="true"]):hover { color: #1f4fa8; }
.tema-op:focus-visible { outline: 2px solid rgba(31, 79, 168, .45); outline-offset: 1px; }
.tema-sel:not(.con-pulgar) .tema-op[aria-checked="true"] { background: #1f4fa8; }
/* al cambiar de tema todo cambia de color con suavidad (la clase la pone la ventana principal unos instantes) */
html.tema-anim, html.tema-anim *, html.tema-anim *::before, html.tema-anim *::after { transition: background-color .3s ease, color .3s ease, border-color .3s ease, box-shadow .3s ease, fill .3s ease !important; }
@media (max-width: 860px) {
    .tema-sel { margin-right: 8px; }
    .tema-op { padding: 0 9px; }
    .tema-op span { display: none; }
    .tema-op svg { margin-right: 0; }
}
