/* ============================================================================
   ATENEA MODERN — capa visual (2026-10-16)
   Se carga DESPUES de atenea-brand.css y no cambia estructura ni clases de las
   vistas: solo tipografia, superficies, radios, sombras, foco y estados.
   El Tailwind del proyecto esta precompilado, por eso aqui no se inventan
   clases nuevas: se redefinen las que la app ya usa.
   ========================================================================== */

:root {
    --atx-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                "Helvetica Neue", Arial, "Noto Sans", sans-serif;

    /* escala azul Atenea (linea grafica de ateneax.com) */
    --atx-50:  #EFF5FE;
    --atx-100: #DEEAFD;
    --atx-200: #C9DCFB;
    --atx-300: #AFC9F8;
    --atx-400: #93B8F6;
    --atx-500: #6D9CF0;
    --atx-600: #5A8DEE;
    --atx-700: #1F458E;
    --atx-800: #16336B;
    --atx-900: #0F2550;

    --atx-primary: #5A8DEE;
    --atx-primary-hover: #3F72D8;
    --atx-deep: #1F458E;

    /* superficies claras */
    --atx-bg: #F3F6FC;
    --atx-surface: #FFFFFF;
    --atx-surface-2: #F8FAFF;
    --atx-border: #E6EBF5;
    --atx-border-soft: #EEF2F9;

    --atx-text: #0F172A;
    --atx-text-2: #475569;
    --atx-muted: #7C8AA3;

    --atx-radius: 16px;
    --atx-radius-sm: 10px;
    --atx-radius-xs: 8px;

    --atx-shadow-1: 0 1px 2px rgba(16, 24, 40, .04);
    --atx-shadow-2: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px -10px rgba(16, 24, 40, .14);
    --atx-shadow-3: 0 2px 4px rgba(16, 24, 40, .04), 0 18px 40px -18px rgba(16, 24, 40, .22);
    --atx-shadow-primary: 0 10px 22px -10px rgba(63, 114, 216, .75);

    --atx-ring: 0 0 0 3px rgba(90, 141, 238, .20);
    --atx-speed: .18s;
}

/* modo oscuro: se conservan los tonos que ya usa toda la app */
html.dark {
    --atx-bg: #0F172A;
    --atx-surface: #1E293B;
    --atx-surface-2: #172135;
    --atx-border: #334155;
    --atx-border-soft: #273449;

    --atx-text: #E5E7EB;
    --atx-text-2: #CBD5E1;
    --atx-muted: #94A3B8;

    --atx-shadow-1: 0 1px 2px rgba(0, 0, 0, .35);
    --atx-shadow-2: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 26px -12px rgba(0, 0, 0, .7);
    --atx-shadow-3: 0 2px 6px rgba(0, 0, 0, .4), 0 20px 44px -20px rgba(0, 0, 0, .8);
    --atx-ring: 0 0 0 3px rgba(90, 141, 238, .32);
}

/* ---------------------------------------------------------------- 1. BASE */

/* solo selectores de ELEMENTO: cualquier clase de iconos (.fas, .ri-...)
   tiene mas peso y conserva su tipografia */
body, h1, h2, h3, h4, h5, h6, p, span, div, a, li, td, th, label,
input, select, textarea, button {
    font-family: var(--atx-font);
}

body {
    background: var(--atx-bg) !important;
    color: var(--atx-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 { letter-spacing: -.015em; }

/* los titulos de pagina venian a 48px (md:text-5xl): se bajan a escala actual */
main h1, main > .w-full > h1 {
    font-size: 1.6rem !important;
    line-height: 1.25 !important;
    font-weight: 700 !important;
    letter-spacing: -.02em;
    margin-bottom: .25rem;
}
@media (min-width: 1280px) {
    main h1 { font-size: 1.75rem !important; }
}

a { transition: color var(--atx-speed) ease; }

::selection { background: var(--atx-200); color: var(--atx-900); }
html.dark ::selection { background: #2a4578; color: #E5E7EB; }

/* --------------------------------------------------------- 2. BARRA SUPERIOR */

nav.hide-on-print {
    background: rgba(255, 255, 255, .82) !important;
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--atx-border-soft) !important;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .04) !important;
}
html.dark nav.hide-on-print {
    background: rgba(17, 24, 39, .88) !important;
    border-bottom-color: #1F2937 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .5) !important;
}

nav.hide-on-print button,
nav.hide-on-print a {
    border-radius: var(--atx-radius-sm);
    transition: background var(--atx-speed) ease, color var(--atx-speed) ease;
}
nav.hide-on-print button:hover,
nav.hide-on-print a:hover { background: var(--atx-50); }
html.dark nav.hide-on-print button:hover,
html.dark nav.hide-on-print a:hover { background: #1F2937; }

/* ------------------------------------------------------------- 3. SIDEBAR */

#menu-sidebar {
    background: var(--atx-surface) !important;
    border-right: 1px solid var(--atx-border-soft) !important;
    box-shadow: 1px 0 3px rgba(16, 24, 40, .03) !important;
}
html.dark #menu-sidebar {
    background: #111827 !important;
    border-right-color: #1F2937 !important;
}

/* el logo deja de tener la linea dura de separacion */
#menu-sidebar > div > div > a[href] { border-bottom: 1px solid var(--atx-border-soft) !important; }
html.dark #menu-sidebar > div > div > a[href] { border-bottom-color: #1F2937 !important; }

#menu-sidebar ul a {
    border-radius: 12px !important;
    font-weight: 600 !important;
    letter-spacing: -.005em;
    position: relative;
    transition: background var(--atx-speed) ease, color var(--atx-speed) ease,
                transform var(--atx-speed) ease, box-shadow var(--atx-speed) ease;
}

/* inactivo: sin relleno gris, el color inline (#374151) se neutraliza */
#menu-sidebar ul a.bg-gray-50 { background: transparent !important; }
#menu-sidebar ul a[style*="#374151"] { color: var(--atx-text-2) !important; }
#menu-sidebar ul a.bg-gray-50:hover {
    background: var(--atx-50) !important;
    color: var(--atx-deep) !important;
    transform: translateX(2px);
}
html.dark #menu-sidebar ul a.bg-gray-50:hover { background: #1F2937 !important; color: var(--atx-400) !important; }

/* activo: degradado de marca + acento lateral */
#menu-sidebar ul a.bg-green-600 {
    background: linear-gradient(135deg, var(--atx-600), var(--atx-primary-hover)) !important;
    box-shadow: var(--atx-shadow-primary) !important;
    color: #fff !important;
}
#menu-sidebar ul a.bg-green-600::before {
    content: "";
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 22px;
    border-radius: 999px;
    background: var(--atx-600);
}

#menu-sidebar .menu-ico svg { stroke-width: 1.8; }

/* -------------------------------------------------- 4. CONTENIDO Y PIE */

main.flex-grow { padding-top: .25rem; }

footer.footer {
    background: transparent !important;
    border-top: 1px solid var(--atx-border-soft);
    color: var(--atx-muted);
    font-size: .8rem;
}
html.dark footer.footer { border-top-color: #1F2937; }

/* ------------------------------------------------------- 5. TARJETAS */

.card,
main .bg-white.rounded-2xl,
main .bg-white.rounded-xl,
main .bg-white.shadow-md,
main .bg-white.shadow,
main .bg-white.shadow-lg {
    background: var(--atx-surface);
    border: 1px solid var(--atx-border-soft);
    border-radius: var(--atx-radius) !important;
    box-shadow: var(--atx-shadow-2) !important;
}
html.dark .card,
html.dark main .bg-white.rounded-2xl,
html.dark main .bg-white.shadow-md {
    border-color: var(--atx-border) !important;
}

.card { overflow: hidden; }
.card-header {
    background: var(--atx-surface-2);
    border-bottom: 1px solid var(--atx-border-soft);
    font-weight: 650;
}
html.dark .card-header { background: var(--atx-surface-2); border-bottom-color: var(--atx-border); }

/* ---------------------------------------------------------- 6. TABLAS */

.table {
    border-collapse: separate;
    border-spacing: 0;
    font-size: .875rem;
}
.table thead th {
    background: var(--atx-surface-2) !important;
    color: var(--atx-muted) !important;
    font-size: .72rem !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: .055em;
    border-bottom: 1px solid var(--atx-border) !important;
    border-top: 0 !important;
    padding: .7rem .75rem !important;
    white-space: nowrap;
}
html.dark .table thead th { background: #0B1220 !important; color: var(--atx-400) !important; }

.table tbody td {
    padding: .7rem .75rem !important;
    border-top: 0 !important;
    border-bottom: 1px solid var(--atx-border-soft) !important;
    vertical-align: middle;
}
html.dark .table tbody td { border-bottom-color: #253149 !important; }

.table tbody tr { transition: background var(--atx-speed) ease; }
.table tbody tr:hover { background: var(--atx-50) !important; }
html.dark .table tbody tr:hover { background: #1b2740 !important; }
.table tbody tr:last-child td { border-bottom: 0 !important; }

/* el rayado de Bootstrap compite con el hover: se suaviza */
.table-striped tbody tr:nth-of-type(odd) { background-color: rgba(243, 246, 252, .6); }
html.dark .table-striped tbody tr:nth-of-type(odd) { background-color: rgba(23, 33, 53, .55); }

/* --------------------------------------------------------- 7. FORMULARIOS */

input[type="text"], input[type="password"], input[type="email"], input[type="number"],
input[type="search"], input[type="tel"], input[type="url"], input[type="date"],
input[type="datetime-local"], input[type="time"], input[type="month"],
select, textarea, .form-control {
    border-radius: var(--atx-radius-sm) !important;
    border: 1px solid var(--atx-border);
    background: var(--atx-surface);
    color: var(--atx-text);
    transition: border-color var(--atx-speed) ease, box-shadow var(--atx-speed) ease,
                background var(--atx-speed) ease;
}
input[type="text"]:hover, input[type="password"]:hover, input[type="email"]:hover,
select:hover, textarea:hover, .form-control:hover { border-color: var(--atx-300); }

input:focus, select:focus, textarea:focus, .form-control:focus {
    border-color: var(--atx-600) !important;
    box-shadow: var(--atx-ring) !important;
    outline: none !important;
}
input::placeholder, textarea::placeholder { color: #A3AEC2; }
html.dark input::placeholder, html.dark textarea::placeholder { color: #64748B; }

label { font-weight: 600; color: var(--atx-text-2); }

/* select2, que usa el proyecto en varios modulos */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    border-radius: var(--atx-radius-sm) !important;
    border-color: var(--atx-border) !important;
    min-height: 38px;
}
.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--atx-600) !important;
    box-shadow: var(--atx-ring);
}
.select2-dropdown { border-radius: var(--atx-radius-sm) !important; border-color: var(--atx-border) !important; overflow: hidden; }

/* ---------------------------------------------------------- 8. BOTONES */

.btn, button, a.btn {
    border-radius: var(--atx-radius-sm) !important;
    font-weight: 600;
    transition: transform var(--atx-speed) ease, box-shadow var(--atx-speed) ease,
                background var(--atx-speed) ease, filter var(--atx-speed) ease;
}
.btn:active, button:active { transform: translateY(1px); }

/* primarios de marca: la app los pinta con .bg-green-600 / .btn-primary
   (ya repintados a azul por atenea-brand.css) */
.btn-primary, .btn-success,
button.bg-green-600, a.bg-green-600, .bg-green-600.text-white,
button.bg-green-500, a.bg-green-500 {
    background-image: linear-gradient(135deg, var(--atx-600), var(--atx-primary-hover)) !important;
    border: 0 !important;
    color: #fff !important;
    box-shadow: var(--atx-shadow-primary) !important;
}
.btn-primary:hover, .btn-success:hover,
button.bg-green-600:hover, a.bg-green-600:hover,
button.bg-green-500:hover, a.bg-green-500:hover {
    filter: brightness(1.06);
    box-shadow: 0 14px 26px -12px rgba(63, 114, 216, .9) !important;
}
.btn:focus-visible, button:focus-visible, a:focus-visible {
    outline: none;
    box-shadow: var(--atx-ring) !important;
}

/* secundarios de borde */
.btn-outline-primary, .btn-outline-success {
    border: 1px solid var(--atx-600) !important;
    color: var(--atx-deep) !important;
    background: transparent !important;
}
.btn-outline-primary:hover, .btn-outline-success:hover {
    background: var(--atx-50) !important;
}

/* ------------------------------------------------ 9. PILDORAS Y ETIQUETAS */

.badge {
    border-radius: 999px !important;
    font-weight: 650;
    letter-spacing: .01em;
    padding: .32em .7em;
}

/* pestañas tipo pill que usa Gestion de cobros */
[role="tab"] { transition: color var(--atx-speed) ease, border-color var(--atx-speed) ease; }

/* --------------------------------------------- 10. MODALES Y DESPLEGABLES */

#modal-main .bg-white,
[data-modal-backdrop] .bg-white,
.modal-content {
    border-radius: 18px !important;
    box-shadow: var(--atx-shadow-3) !important;
    border: 1px solid var(--atx-border-soft);
}
html.dark #modal-main .bg-white,
html.dark [data-modal-backdrop] .bg-white,
html.dark .modal-content { border-color: var(--atx-border); }

#modal-main:not(.hidden) {
    background: rgba(15, 23, 42, .45) !important;
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

.dropdown-menu {
    border-radius: var(--atx-radius-sm) !important;
    border: 1px solid var(--atx-border) !important;
    box-shadow: var(--atx-shadow-2) !important;
    padding: .35rem;
}
.dropdown-item { border-radius: var(--atx-radius-xs); }
.dropdown-item:hover { background: var(--atx-50); color: var(--atx-deep); }
html.dark .dropdown-item:hover { background: #1F2937; color: var(--atx-400); }

/* avisos */
.alert {
    border: 0;
    border-radius: var(--atx-radius-sm) !important;
    border-left: 3px solid transparent;
    box-shadow: var(--atx-shadow-1);
    font-size: .9rem;
}
.alert-danger { background: #FEF2F2; color: #991B1B; border-left-color: #EF4444; }
.alert-success { background: var(--atx-50) !important; color: var(--atx-800) !important; border-left-color: var(--atx-600); }
.alert-warning { background: #FFFBEB; color: #92400E; border-left-color: #F59E0B; }
html.dark .alert-danger { background: #3A1C1C !important; color: #FCA5A5 !important; }
html.dark .alert-warning { background: #3A2E12 !important; color: #FBBF24 !important; }

/* ------------------------------------------------------- 11. SCROLLBARS */

* { scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: #D4DCEC;
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: #BBC8E0; background-clip: content-box; }
html.dark ::-webkit-scrollbar-thumb { background: #334155; background-clip: content-box; }

/* -------------------------------------------- 12. MOVIMIENTO REDUCIDO */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}

/* ============================================================================
   13. LOGIN  (todo bajo .atx-auth: no afecta al resto de la aplicacion)
   ========================================================================== */

body.atx-auth-body {
    margin: 0;
    overflow: auto !important;
    background: var(--atx-surface) !important;
}

.atx-auth {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    min-height: 100vh;
    min-height: 100dvh;
}

/* ---- lado izquierdo: marca ---- */

.atx-auth__brand {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: 3.5rem;
    background: linear-gradient(145deg, #0F2550 0%, #1F458E 46%, #2E63C8 100%);
    color: #fff;
    isolation: isolate;
}

/* resplandores suaves del fondo */
.atx-auth__glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: .5;
    z-index: -1;
    pointer-events: none;
}
.atx-auth__glow--1 { width: 460px; height: 460px; top: -140px; right: -120px; background: #5A8DEE; }
.atx-auth__glow--2 { width: 380px; height: 380px; bottom: -130px; left: -90px;  background: #6D9CF0; opacity: .35; }
.atx-auth__glow--3 { width: 260px; height: 260px; top: 46%; right: 18%; background: #93B8F6; opacity: .22; }

/* retícula tenue, da profundidad sin cargar la pantalla */
.atx-auth__brand::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgba(255, 255, 255, .055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .055) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 72%);
    mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 72%);
}

.atx-auth__brandinner { max-width: 440px; }

.atx-auth__logo {
    width: 84px;
    height: 84px;
    border-radius: 20px;
    object-fit: cover;
    box-shadow: 0 18px 38px -16px rgba(0, 0, 0, .65);
    margin-bottom: 1.75rem;
}

.atx-auth__title {
    font-size: 2.6rem;
    font-weight: 700;
    letter-spacing: -.03em;
    line-height: 1.05;
    margin: 0 0 .75rem;
    color: #fff;
}

.atx-auth__tagline {
    font-size: 1.02rem;
    line-height: 1.6;
    color: rgba(226, 236, 255, .82);
    margin: 0 0 2.25rem;
}

.atx-auth__feats { list-style: none; margin: 0; padding: 0; display: grid; gap: .95rem; }
.atx-auth__feats li {
    display: flex;
    align-items: center;
    gap: .8rem;
    font-size: .95rem;
    color: rgba(226, 236, 255, .92);
}
.atx-auth__feats svg { width: 18px; height: 18px; flex: 0 0 18px; }
.atx-auth__featicon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .16);
}

/* ---- lado derecho: formulario ---- */

.atx-auth__panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 2rem;
    background: var(--atx-surface);
}

.atx-auth__card { width: 100%; max-width: 384px; }

.atx-auth__mark {
    display: none;
    width: 64px;
    height: 64px;
    border-radius: 18px;
    object-fit: cover;
    margin: 0 auto 1.25rem;
    box-shadow: var(--atx-shadow-2);
}

.atx-auth__welcome {
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: -.025em;
    color: var(--atx-text);
    margin: 0 0 .4rem;
}
.atx-auth__sub {
    font-size: .92rem;
    color: var(--atx-muted);
    margin: 0 0 1.9rem;
}

.atx-auth__field { display: block; margin-bottom: 1.1rem; }
.atx-auth__label {
    display: block;
    font-size: .82rem;
    font-weight: 600;
    color: var(--atx-text-2);
    margin-bottom: .45rem;
}

.atx-auth__wrap { position: relative; display: block; }
.atx-auth__icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: #9AA7BF;
    pointer-events: none;
    transition: color var(--atx-speed) ease;
}
.atx-auth__wrap:focus-within .atx-auth__icon { color: var(--atx-600); }

.atx-auth__input {
    width: 100%;
    height: 48px;
    padding: 0 2.9rem 0 2.75rem;
    font-size: .95rem;
    color: var(--atx-text);
    background: var(--atx-surface-2);
    border: 1px solid var(--atx-border);
    border-radius: 12px !important;
    transition: border-color var(--atx-speed) ease, box-shadow var(--atx-speed) ease,
                background var(--atx-speed) ease;
}
.atx-auth__input:hover { border-color: var(--atx-300); }
.atx-auth__input:focus {
    background: var(--atx-surface);
    border-color: var(--atx-600) !important;
    box-shadow: var(--atx-ring) !important;
    outline: none;
}

/* ojo para mostrar/ocultar la contraseña */
.atx-auth__eye {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: #9AA7BF;
    border-radius: 9px !important;
    cursor: pointer;
    box-shadow: none !important;
}
.atx-auth__eye:hover { color: var(--atx-600); background: var(--atx-50); }
.atx-auth__eye svg { width: 19px; height: 19px; }

.atx-auth__submit {
    width: 100%;
    height: 48px;
    margin-top: .35rem;
    font-size: .97rem;
    font-weight: 650;
    color: #fff !important;
    background-image: linear-gradient(135deg, var(--atx-600), var(--atx-primary-hover)) !important;
    border: 0 !important;
    border-radius: 12px !important;
    box-shadow: var(--atx-shadow-primary) !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
}
.atx-auth__submit:hover { filter: brightness(1.06); box-shadow: 0 16px 30px -14px rgba(63, 114, 216, .95) !important; }
.atx-auth__submit:active { transform: translateY(1px); }
.atx-auth__submit[disabled] { opacity: .75; cursor: default; filter: none; }

.atx-auth__spinner {
    display: none;
    width: 17px;
    height: 17px;
    border: 2px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: atx-spin .7s linear infinite;
}
.atx-auth__submit.is-loading .atx-auth__spinner { display: block; }
@keyframes atx-spin { to { transform: rotate(360deg); } }

.atx-auth__links { margin-top: 1.5rem; text-align: center; }
.atx-auth__forgot {
    font-size: .88rem;
    font-weight: 600;
    color: var(--atx-deep);
    text-decoration: none;
}
.atx-auth__forgot:hover { color: var(--atx-600); text-decoration: underline; }

.atx-auth__foot {
    margin-top: 2.5rem;
    text-align: center;
    font-size: .76rem;
    color: #9AA7BF;
}
.atx-auth__foot a { color: var(--atx-muted); text-decoration: none; }
.atx-auth__foot a:hover { color: var(--atx-600); }

/* mensajes de error de Laravel / jsvalidator dentro del login */
.atx-auth .alert { margin-bottom: 1.1rem; }
.atx-auth .alert ul { margin: 0; padding-left: 0; list-style: none; }
.atx-auth label.error,
.atx-auth .invalid-feedback {
    display: block;
    margin-top: .4rem;
    font-size: .8rem;
    font-weight: 500;
    color: #DC2626;
}

/* ---- adaptacion a pantallas pequeñas ---- */

@media (max-width: 900px) {
    .atx-auth { grid-template-columns: 1fr; }
    .atx-auth__brand { display: none; }
    .atx-auth__mark { display: block; }
    .atx-auth__panel {
        padding: 2.25rem 1.25rem 3rem;
        background:
            radial-gradient(900px 420px at 50% -16%, var(--atx-50), transparent 70%),
            var(--atx-surface);
        align-items: flex-start;
    }
    .atx-auth__card { padding-top: 1.5rem; }
    .atx-auth__welcome, .atx-auth__sub { text-align: center; }
}

/* ---- login en modo oscuro ---- */

html.dark body.atx-auth-body,
html.dark .atx-auth__panel { background: #0F172A !important; }
html.dark .atx-auth__input { background: #172135; border-color: #334155; color: #E5E7EB; }
html.dark .atx-auth__input:focus { background: #1E293B; }
html.dark .atx-auth__eye:hover { background: #1F2937; }
html.dark .atx-auth__welcome { color: #E5E7EB; }
html.dark .atx-auth__forgot { color: var(--atx-400); }

/* modal de recuperar contraseña */
#reset-password-modal .bg-white { border-radius: 18px !important; box-shadow: var(--atx-shadow-3) !important; }
#reset-password-modal input { height: 46px; border-radius: 12px !important; }
#reset-password-modal button[type="submit"] {
    height: 46px;
    border-radius: 12px !important;
    background-image: linear-gradient(135deg, var(--atx-600), var(--atx-primary-hover)) !important;
    border: 0 !important;
    box-shadow: var(--atx-shadow-primary) !important;
}

/* ============================================================================
   14. AJUSTES FINOS (verificados en pantalla, 2026-10-16)
   ========================================================================== */

/* 14.1 El tema viejo (style_revo.css) fija `body{min-width:921px}`, lo que
   obliga a desplazamiento horizontal en cualquier telefono — en TODA la app,
   no solo en el login. Se libera para que la capa responsive sirva de algo. */
body { min-width: 0 !important; }

/* 14.2 El normalizador de modo oscuro (script __melloDarkSweep del sidebar)
   marca las superficies claras con la clase `mello-dsurf`. Al renombrar la
   hoja de marca quedo sin regla: se cubren ambos nombres. */
html.dark .mello-dsurf,
html.dark .atenea-dsurf {
    background: #1E293B !important;
    background-image: none !important;
}

/* 14.3 En oscuro, los items inactivos del menu quedaban con relleno propio:
   la regla generica `html.dark .bg-gray-50` gana por especificidad, asi que
   aqui se iguala el peso. */
html.dark #menu-sidebar ul a.bg-gray-50 { background: transparent !important; }

/* 14.4 Titulo de pagina: era azul de marca a 48px (parecia un enlace).
   Se pasa a texto principal; el acento de marca queda para enlaces y botones. */
main h1, main h1.text-green-600 { color: var(--atx-text) !important; }
html.dark main h1, html.dark main h1.text-green-600 { color: #E5E7EB !important; }

/* 14.5 El boton "Volver" de la barra superior venia con un margen negativo
   en linea que lo descolocaba respecto al resto de la barra. */
nav.hide-on-print a[style*="margin-top: -15px"] {
    margin-top: 0 !important;
    margin-left: 4px !important;
}

/* 14.6 Red de seguridad para el login en pantallas estrechas */
.atx-auth, .atx-auth__panel { max-width: 100%; }
.atx-auth__card { max-width: min(384px, 100%); }

/* ---- 14.7 En movil la barra superior se parte en dos filas (66px -> 106px)
   y tapaba el titulo de la pagina, porque `main` tiene un margen fijo de 80px.
   El quiebre real medido esta entre 600px y 560px de ancho. */
@media (max-width: 599.98px) {
    main.flex-grow { margin-top: 122px !important; }
}

/* ---- 14.8 Boton "Volver" de la barra superior.
   Venia con el icono y una etiqueta posicionada en absoluto que se montaba
   encima; se convierte en un boton normal con icono y texto en linea. */
nav.hide-on-print a[onclick*="Volver"],
nav.hide-on-print a[onclick*="volver"] {
    position: relative !important;
    display: inline-flex !important;
    align-items: center;
    gap: .45rem;
    padding: .4rem .7rem !important;
    margin: 0 0 0 4px !important;
    border-radius: 10px !important;
    color: var(--atx-text-2) !important;
    font-weight: 600;
}
nav.hide-on-print a[onclick*="Volver"]:hover,
nav.hide-on-print a[onclick*="volver"]:hover {
    background: var(--atx-50) !important;
    color: var(--atx-deep) !important;
}
html.dark nav.hide-on-print a[onclick*="Volver"]:hover,
html.dark nav.hide-on-print a[onclick*="volver"]:hover {
    background: #1F2937 !important;
    color: var(--atx-400) !important;
}
nav.hide-on-print a[onclick*="Volver"] i.ri-2x,
nav.hide-on-print a[onclick*="volver"] i.ri-2x {
    font-size: 1.2rem !important;
    line-height: 1;
    color: inherit !important;
}
nav.hide-on-print a[onclick*="Volver"] span[style*="position: absolute"],
nav.hide-on-print a[onclick*="volver"] span[style*="position: absolute"] {
    position: static !important;
    bottom: auto !important;
    margin-left: 0 !important;
    font-size: .85rem;
    white-space: nowrap;
}
@media (max-width: 599.98px) {
    nav.hide-on-print a[onclick*="Volver"] span[style*="position: absolute"],
    nav.hide-on-print a[onclick*="volver"] span[style*="position: absolute"] { display: none; }
}

/* ---- 14.9 Cabecera de marca del menu lateral (logo + nombre) */
#menu-sidebar .atx-brand {
    gap: .7rem;
    padding: .25rem .55rem 1rem !important;
    margin-bottom: .85rem !important;
    border-bottom: 1px solid var(--atx-border-soft);
    text-decoration: none;
}
html.dark #menu-sidebar .atx-brand { border-bottom-color: #1F2937; }

#menu-sidebar .atx-brand__logo {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: 11px;
    object-fit: cover;
    box-shadow: 0 6px 14px -8px rgba(16, 24, 40, .55);
}

#menu-sidebar .atx-brand__name {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--atx-text);
}
#menu-sidebar .atx-brand__name small {
    font-size: .64rem;
    font-weight: 600;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--atx-muted);
    margin-top: .18rem;
}
html.dark #menu-sidebar .atx-brand__name { color: #E5E7EB; }
html.dark #menu-sidebar .atx-brand__name small { color: #94A3B8; }

/* ---- 14.10 Barra de acciones de Gestión de cobros.
   Los 4 botones + el de carga medían ~953px y, sumados al buscador, no cabían
   por debajo de ~1580px de ancho: el naranja saltaba solo a una segunda fila y
   dejaba una banda vacía. Se compactan para que entren en una sola línea en
   pantallas normales (1366/1440) sin tocar los textos ni el marcado. */

.mello-toolbar { gap: 6px !important; row-gap: 6px !important; }

.mello-toolbar > a,
.mello-toolbar > button,
.mello-toolbar > div > a,
.mello-toolbar > div > button {
    margin-left: 0 !important;
    height: 42px !important;
    padding: 0 11px !important;
    font-size: 13px !important;
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    border-width: 1px !important;
}

/* los iconos venían a ri-xl (1.5em): se igualan al texto */
.mello-toolbar i { font-size: 1.05rem !important; line-height: 1 !important; }

/* el buscador no necesita tanto ancho en esta barra */
.mello-search-wrap { flex: 0 1 260px !important; }

/* menos aire entre la barra y los filtros de abajo */
.mello-toolbar-row { margin-top: 2px !important; padding-bottom: 2px !important; }

/* si aun así tuviera que partirse (pantallas muy angostas), que no deje hueco */
@media (max-width: 1100px) {
    .mello-toolbar { justify-content: flex-start !important; }
}

/* ---- 14.11 El bloque de botones era un flex-item que se ENCOGIA (739px de los
   1048 disponibles) y por eso el ultimo boton saltaba de fila aunque sobrara
   sitio. Se fija su ancho natural y que ceda el buscador, no los botones. */
.mello-toolbar-row { flex-wrap: wrap !important; gap: 8px; align-items: center; }
.mello-toolbar-row > div:first-child { flex: 1 1 240px; min-width: 0; }
.mello-toolbar-row > div:last-child  { flex: 0 0 auto; }

/* ---- 14.12 El "no encoger" solo vale en escritorio: en tablet/movil el bloque
   de botones debe ocupar su propia linea y envolverse, o queda cortado. */
@media (max-width: 1023.98px) {
    .mello-toolbar-row > div:last-child { flex: 1 1 100% !important; }
    .mello-toolbar {
        justify-content: flex-start !important;
        flex-wrap: wrap !important;
        margin-right: 0 !important;
    }
    .mello-toolbar-row > div:first-child { flex: 1 1 100%; }
}

/* ---- 14.13 La fila es `justify-between` con TRES bloques (buscador, filtro y
   botones), asi que todo el espacio sobrante se repartia en los dos huecos: en
   una pantalla ancha quedaban ~280px entre la lupa y el icono de filtros.
   Se agrupan buscador + filtro a la izquierda y los botones se van al borde
   derecho con `margin-left:auto`. */
@media (min-width: 1024px) {
    .mello-toolbar-row { justify-content: flex-start !important; }
    .mello-toolbar-row > div:last-child { margin-left: auto !important; }
    /* el icono de filtros pegado al buscador */
    .mello-toolbar-row > div:nth-child(2) { margin-left: 0 !important; }
    .mello-toolbar-row > div:nth-child(2) button { margin-left: 2px !important; }
}

/* ---- 14.14 Entre 1024 y 1440px faltaban ~35px para que los botones cupieran
   junto al buscador: se recorta el buscador y el relleno de los botones. */
@media (min-width: 1024px) and (max-width: 1440px) {
    .mello-search-wrap { flex: 0 1 215px !important; }
    .mello-toolbar { gap: 5px !important; }
    .mello-toolbar > a,
    .mello-toolbar > button,
    .mello-toolbar > div > a,
    .mello-toolbar > div > button { padding: 0 9px !important; font-size: 12.5px !important; }
    .mello-toolbar-row > div:nth-child(2) button { margin-left: 0 !important; }
}

/* ---- 14.15 Varias pantallas (Financiero) usan <table class="table"> como
   maquetación de FORMULARIO, no como listado. El resaltado de fila al pasar el
   ratón ahí despista: se desactiva cuando la fila contiene campos. */
.table tbody tr:hover:has(select, input, textarea, button) { background: transparent !important; }
html.dark .table tbody tr:hover:has(select, input, textarea, button) { background: transparent !important; }
