/* estilos_globales.css - Estructura Base */
:root {
    /* Valores por defecto (se sobrescriben desde estilos_globales.php) */
    --color-empresa-1: #0077CC; 
    --color-empresa-2: #00AEEF;
}

body { margin: 0; font-family: Arial, Helvetica, sans-serif; background: #f4f6f9; }

html, body { max-width: 100%; }
img, canvas { max-width: 100%; }
form { max-width: 100%; }

.sidebar-watermark {
    width: 120px !important;    /* Tamaño controlado */
    margin-top: 15px !important;
    opacity: 0.3;               /* Transparencia para efecto marca de agua */
    filter: grayscale(100%);    /* Opcional: hace que combine mejor con fondos oscuros */
    pointer-events: none;       /* Evita que el usuario pueda arrastrarla o clicarla */
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.sidebar {
    width: 280px; height: 100vh; position: fixed; left: 0; top: 0;
    color: white; display: flex; flex-direction: column;
    justify-content: space-between; overflow-y: auto; z-index: 100;
    background-color: var(--color-empresa-1);
    transition: background-color 0.3s ease;
    box-sizing: border-box;
}

.sidebar-superior { width: 100%; min-width: 0; box-sizing: border-box; }
.sidebar-toggle { display: none; }

/* Restaurar estilo limpio al Sidebar */
.sidebar a, .sidebar .dropdown-btn {
    color: white !important;           /* Letras blancas */
    text-decoration: none !important;  /* Quitar subrayado */
    font-family: sans-serif;
}

/* Estado al pasar el mouse */
.sidebar a:hover, .sidebar .dropdown-btn:hover {
    color: white !important;
    background: rgba(255, 255, 255, 0.1) !important;
}

/* Asegurar que el logo y el texto no tengan problemas */
/* Contenedor del logo */
.logo-container {
    max-width: 200px; /* Tamaño máximo deseado */
    height: auto;
    display: flex;
    align-items: center;
    overflow: hidden;
}

/* El logo dentro */
.logo-container img {
    width: 100%;
    height: auto; /* Mantiene la proporción original */
    object-fit: contain; /* Evita que se estire */
}

/* Ajuste para móviles */
@media (max-width: 768px) {
    .logo-container {
        max-width: 120px; /* Más pequeño en móviles */
    }
    /* Ocultar elementos secundarios del menú si es necesario */
    .menu-opciones {
        font-size: 14px;
    }
}

.sidebar h2 { color: white; }

/* Ajusta la tarjeta para ser más compacta */
.tarjeta { 
    background: white; 
    padding: 20px; /* Reducimos padding interno de 30px a 20px */
    border-radius: 10px;
    box-shadow: 0px 3px 10px rgba(0,0,0,0.05); 
    margin-top: 5px; /* Reducimos el margen superior de 15px a 5px */
    border-top: 4px solid var(--color-empresa-1);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

/* Estándar visual institucional de cada formulario. */
.aq-formulario-estandar,
.contenido > .tarjeta,
.rg-card,
.rs-card,
.rp-card,
.rc-card {
    border-top: 5px solid var(--color-empresa-1) !important;
}

/* Identidad institucional uniforme en todo el submenú de recaudos. */
.rg-card,
.rs-card,
.rp-card,
.rc-card,
.contenido > .tarjeta {
    border-top-color: var(--color-empresa-1) !important;
}
.aq-encabezado-estandar {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 16px;
    margin: 0 0 14px !important;
    padding: 0 0 10px !important;
    border-bottom: 2px solid color-mix(in srgb, var(--color-empresa-1) 18%, #e2e8f0) !important;
}
.aq-encabezado-estandar .titulo-seccion,
.aq-encabezado-estandar h1 { margin: 0 !important; color: #0f172a; }
.aq-encabezado-estandar .header-acciones { margin: 0 0 0 auto !important; padding: 0 !important; border: 0 !important; }
.aq-boton-menu-estandar { margin-left: auto; white-space: nowrap; }

/* El menú lateral usa exclusivamente los dos colores definidos por la empresa. */
.sidebar { background: linear-gradient(180deg, var(--color-empresa-1), var(--color-empresa-1)) !important; }
.sidebar .enlace-directo:hover,
.sidebar .dropdown-btn:hover,
.sidebar .dropdown-btn.active,
.sidebar .dropdown-container a:hover { background: var(--color-empresa-2) !important; }
.sidebar .dropdown-container { background: color-mix(in srgb, var(--color-empresa-1) 82%, #000) !important; }

.logo { text-align: center; padding: 12px 12px 8px; border-bottom: 1px solid rgba(255,255,255,0.15); }
.logo img.logo-empresa-sidebar { width: 84px; height: 84px; object-fit: contain; }
.logo h2 { margin: 6px auto 2px; max-width: 240px; padding: 0 4px; font-size: 15px; line-height: 1.2; overflow-wrap: anywhere; text-shadow: 1px 1px 2px rgba(0,0,0,0.2); }

.dropdown-btn:hover, .enlace-directo:hover { background: var(--color-empresa-2); }

/* BOTONES UNIFICADOS */
.btn { 
    padding: 12px 24px; border-radius: 6px; text-decoration: none !important; 
    font-weight: bold; cursor: pointer; border: none; transition: all 0.2s ease;
    display: inline-flex; align-items: center; justify-content: center;
    box-sizing: border-box;
}
.btn-verde { background-color: var(--color-empresa-1); color: white; }
.btn-verde:hover { opacity: 0.9; }

.btn-gris { background-color: #6c757d; color: white; }
.btn-gris:hover { background-color: #5a6268; }

.panel-botones {
    display: flex; justify-content: center; gap: 15px;
    margin-top: 30px; border-top: 1px solid #eee; padding-top: 20px;
}

/* El resto de tus clases se mantienen igual, solo reemplaza colores duros si quieres */
.tabla-s th { background-color: var(--color-empresa-1); color: white; }
.titulo-panel, .formulario-estandar legend { color: var(--color-empresa-1); }
.mensaje-informativo { border-left: 5px solid var(--color-empresa-1); }

/* Marca de agua (Se mantiene igual) */
.brand-watermark {
    position: fixed; bottom: 20px; right: 25px; text-align: center;
    opacity: 0.25; pointer-events: none; z-index: 10;
}
.brand-watermark img { width: 110px; height: auto; display: block; margin: auto; }
.brand-watermark small { font-size: 9px; font-weight: bold; color: #555; letter-spacing: 1.5px; display: block; margin-top: 4px; text-transform: uppercase; }

/* Reduce el margen superior del contenido principal */
.contenido { 
    margin-left: 280px; 
    padding: 15px 30px; /* Reducimos el padding vertical de 30px a 15px */
    position: relative; 
    min-height: calc(100vh - 60px); 
    box-sizing: border-box;
    max-width: calc(100% - 280px);
}

/* Compactar títulos para ganar espacio */
.titulo-seccion {
    margin: 0 0 5px 0 !important; /* Eliminamos márgenes excesivos */
    padding: 0 !important;
    font-size: 24px; /* Opcional: un poco más pequeño si necesitas más espacio */
}

.subtitulo-seccion {
    margin: 0 0 10px 0 !important;
    color: #666;
    font-size: 16px;
}

/* Estilo para la Alerta de Formulario Crítico */
.alerta-bloqueo-saas {
    background-color: #dc3545; /* Rojo base */
    color: #ffffff;           /* Texto blanco */
    padding: 10px;
    border-left: 5px solid #a71d2a; /* Borde inicial */
    font-weight: bold;
    font-size: 12px;
    border-radius: 4px;
    animation: parpadeo 2s infinite; 
    cursor: help;
}

@keyframes parpadeo {
    0% { border-left-color: #a71d2a; }   /* Rojo oscuro */
    50% { border-left-color: #ff6b6b; }  /* Rojo claro/brillante */
    100% { border-left-color: #a71d2a; } /* Rojo oscuro */
}

/* Forzar el menú vertical */
.menu {
    display: flex;
    flex-direction: column;
    width: 100%;
    flex: 0 0 auto;
    box-sizing: border-box;
}

.menu-item {
    width: 100%;
    flex: 0 0 auto;
    box-sizing: border-box;
}
.form-enlace-menu { margin: 0; width: 100%; }

.congelado {
    pointer-events: none !important;
    opacity: 0.6 !important;
    cursor: not-allowed !important;
}

.enlace-directo, .dropdown-btn, .dropdown-container a {
    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 14px !important;
    line-height: 1.2 !important;
}

.enlace-directo, .dropdown-btn {
    background-color: var(--color-empresa-1) !important;
    color: white !important;
    border: none;
    cursor: pointer;
}

.dropdown-btn {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
}

.enlace-directo:hover, .dropdown-btn:hover, .dropdown-container a:hover {
    background-color: rgba(0, 0, 0, 0.2) !important;
}

.dropdown-container {
    display: none;
    width: 100%;
    padding-left: 10px;
    box-sizing: border-box;
    background-color: rgba(0, 0, 0, 0.1) !important;
}

.dropdown-container[hidden] {
    display: none !important;
}

.dropdown-btn.active + .dropdown-container {
    display: block;
}

.dropdown-container a {
    display: block;
    padding: 10px 20px;
    color: white !important;
    text-decoration: none;
    box-sizing: border-box;
}

/* Fuerza a que los enlaces y botones ocupen todo el ancho disponible */
.enlace-directo, .dropdown-btn {
    display: block; /* Importante para que salten de línea */
    width: 100%;
    box-sizing: border-box; /* Evita que el padding rompa el ancho */
    text-align: left;
    margin: 0;
    padding: 13px 20px;
}

/* Nuevo estándar para encabezados de formulario */
.header-acciones {
    display: flex;
    justify-content: space-between; /* Botones izquierda, buscador derecha */
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.grupo-botones {
    display: flex;
    gap: 10px;
}

.input-buscar {
    flex: 0 0 350px; /* Tamaño fijo para que sea cómodo */
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
}

/* Forzar que la tabla ocupe siempre el 100% de la tarjeta */
.tabla-s {
    width: 100% !important;
    table-layout: auto;
}

.marca-agua-footer {
    position: fixed;
    bottom: 20px;
    right: 20px;
    opacity: 0.2; /* Muy sutil */
    pointer-events: none; /* No estorba al usuario */
    z-index: 1000;
}

.marca-agua-footer img {
    width: 100px; /* Tamaño pequeño para que no distraiga */
}

/* Panel de acciones inferior para formularios */
.footer-acciones {
    margin-top: 30px;
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end; /* Alinea los botones a la derecha */
    gap: 15px;
}

/* Ajuste para que los botones tengan un tamaño consistente */
.btn-ancho {
    padding: 10px 30px;
    font-size: 15px;
    font-weight: 600;
}

/* Espaciado para el grupo de herramientas */
.grupo-herramientas {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Estilo para paginación */
.paginacion {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #666;
}

.btn-pag {
    padding: 5px 12px;
    border: 1px solid #ccc;
    background: #f8f9fa;
    border-radius: 4px;
    cursor: pointer;
}

.btn-pag.disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
    background-color: #eee;
}

/* Botones de acción mejorados */
.btn-azul {
    background-color: #2196F3 !important;
    color: white !important;
    border: none !important;
}

.btn-rojo {
    background-color: #f44336 !important;
    color: white !important;
    border: none !important;
}

/* Efecto hover (opcional pero profesional) */
.btn-azul:hover { background-color: #1976D2 !important; }
.btn-rojo:hover { background-color: #d32f2f !important; }

/* Campo editable: Fondo blanco, borde definido */
input[type="text"], input[type="email"], input[type="password"], input[type="datetime-local"], select, textarea {
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background-color: #ffffff;
    transition: border-color 0.2s;
}

/* Enfoque al hacer clic (feedback visual) */
input:focus, select:focus {
    border-color: var(--color-empresa-1);
    outline: none;
    box-shadow: 0 0 5px rgba(0, 119, 204, 0.2);
}

/* Campo Solo Lectura: Fondo gris claro, texto atenuado, sin borde resaltado */
input[readonly] {
    background-color: #e9ecef;
    border: 1px solid #dee2e6;
    color: #6c757d;
    cursor: not-allowed; /* Indica visualmente que no se puede tocar */
}

/* Opcional: Si quieres que los campos obligatorios resalten un poco más */
input:required {
    border-left: 3px solid var(--color-empresa-1);
}

table {
    border-collapse: collapse;
}
        
th, td {
    border: 1px solid #ccc;
    padding: 5px;
}
        
td input[type="text"] {
    border: none;
    width: 100%;
    box-sizing: border-box;
}
        
td input[type="email"] {
    border: none;
    width: 100%;
    box-sizing: border-box;
}

td input[type="password"] {
    border: none;
    width: 100%;
    box-sizing: border-box;
}
        
td select {
    width: 100%;
    box-sizing: border-box;
    border: none;      /* Opcional */
    outline: none;     /* Opcional */
    background: transparent; /* Opcional */
}
        
h4 {
    margin-top: 5px;
    margin-bottom: 5px;
}

.banner-aviso-global {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-weight: bold;
    text-align: center;
    border: 1px solid rgba(0,0,0,0.1);
}

/* Contenedor base de los avisos */
.aviso-card {
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.1);
    font-weight: 600;
}

input, select, textarea, button {
    max-width: 100%;
    box-sizing: border-box;
}

/* Estilos por tipo */
.aviso-card {
    position: relative; /* Necesario para posicionar la X */
    padding: 15px 35px 15px 15px; /* Más espacio a la derecha para la X */
    margin-bottom: 15px;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.1);
    font-weight: 600;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-wrap: anywhere;
}

.avisos-globales-contenedor {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0 0 15px;
    padding: 0;
    clear: both;
    box-sizing: border-box;
}

.alerta-mantenimiento-global {
    background-color: #d32f2f; /* Rojo sólido */
    color: #ffffff;            /* Letras blancas */
    text-align: center;
    padding: 10px;
    font-weight: bold;
    font-size: 14px;
    width: 100%;
    position: relative;
    z-index: 9999;
    border-bottom: 3px solid #b71c1c;
}

.alerta-mantenimiento-global a {
    color: #ffeb3b; /* Amarillo para resaltar el link */
    text-decoration: underline;
    margin-left: 10px;
}

/* Ajustes de colores para alta legibilidad */
.aviso-info { background-color: #d4edda; color: #155724; border-color: #c3e6cb; }
.aviso-warning { background-color: #fff3cd; color: #856404; border-color: #ffeeba; }
.aviso-danger { background-color: #f8d7da; color: #721c24; border-color: #f5c6cb; }

/* Botón cerrar */
.btn-cerrar {
    position: absolute;
    top: 5px;
    right: 10px;
    cursor: pointer;
    font-weight: bold;
    font-size: 18px;
    opacity: 0.6;
    width: auto;
    padding: 0;
    border: 0;
    color: inherit;
    background: transparent;
}

.alerta-mantenimiento-gracia {
    position: sticky;
    top: 0;
    width: auto;
    color: #5f370e;
    background-color: #fef3c7;
    border-bottom-color: #f59e0b;
    box-shadow: 0 3px 10px rgba(120, 53, 15, 0.18);
}

.alerta-mantenimiento-gracia strong {
    display: inline-block;
    min-width: 52px;
    padding: 2px 7px;
    margin-left: 4px;
    color: #ffffff;
    background: #b45309;
    border-radius: 4px;
    font-variant-numeric: tabular-nums;
}
.btn-cerrar:hover { opacity: 1; }

.badge-rol-dinamica {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 5px;
    font-size: 0.9em;
    color: white;
    background-color: var(--color-empresa-1);
}

.banner-info { background: #e3f2fd; color: #0d47a1; }
.banner-warning { background: #fff3e0; color: #e65100; }
.banner-danger { background: #ffebee; color: #b71c1c; }

.badge { padding: 5px 10px; border-radius: 4px; font-weight: bold; font-size: 12px; }
.badge-rojo { background: #fee; color: #d32f2f; border: 1px solid #d32f2f; }
.badge-verde { background: #efe; color: #2e7d32; border: 1px solid #2e7d32; }

/* =========================================================================
   COMPONENTES DE ALERTAS ESTANDARIZADAS - AQUACLOUD
   ========================================================================= */
.aquacloud-alert-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    margin: 15px 0 25px 0;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    font-family: Arial, sans-serif;
    line-height: 1.5;
    animation: fadeInAlert 0.3s ease-in-out;
}

@keyframes fadeInAlert {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Variantes Semánticas de Alto Impacto */
.alert-danger-block {
    background-color: #fef2f2;
    border-left: 6px solid #dc2626;
    color: #991b1b;
}
.alert-warning-block {
    background-color: #fffbeb;
    border-left: 6px solid #d97706;
    color: #92400e;
}
.alert-success-block {
    background-color: #f0fdf4;
    border-left: 6px solid #16a34a;
    color: #166534;
}
.alert-info-block {
    background-color: #f0f9ff;
    border-left: 6px solid #0284c7;
    color: #075985;
}

/* Contenedores Internos */
.aquacloud-alert-icon {
    font-size: 28px;
    user-select: none;
    line-height: 1;
}
.aquacloud-alert-content {
    flex: 1;
}
.aquacloud-alert-title {
    font-size: 16px;
    font-weight: 800;
    margin: 0 0 6px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.aquacloud-alert-body {
    font-size: 14px;
    margin: 0;
}

/* Módulos comunes de encabezado, búsqueda y formularios */
.encabezado-modulo {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding-bottom: 10px;
    margin-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
}

.encabezado-modulo .header-acciones {
    margin: 0;
    padding: 0;
    border: 0;
}

.grupo-busqueda { margin-left: auto; }
.grupo-busqueda input, .buscador-modulo { width: 350px; max-width: 100%; box-sizing: border-box; }
.acciones-tabla { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.seccion-modulo { margin-top: 24px; }
.titulo-seccion-card { margin: 0 0 12px; color: #334155; font-size: 18px; }
.text-center { text-align: center; }
.mensaje-vacio { text-align: center; padding: 20px !important; color: #64748b; }
.btn-icono { background: transparent; border: 0; padding: 3px; cursor: pointer; font-size: 16px; }
.btn-icono:hover { transform: scale(1.08); }

@media (max-width: 900px) {
    .encabezado-modulo, .header-acciones { align-items: stretch; flex-direction: column; }
    .grupo-botones, .grupo-herramientas, .acciones-tabla { flex-wrap: wrap; }
    .grupo-busqueda { width: 100%; margin-left: 0; }
    .grupo-busqueda input, .buscador-modulo { width: 100%; }
}

/* =========================================================================
   PRESENTACIÓN RESPONSIVA PARA CELULARES Y TABLETAS
   ========================================================================= */
@media (max-width: 768px) {
    body { min-width: 0; overflow-x: hidden; }

    .sidebar {
        position: relative;
        left: auto;
        top: auto;
        width: 100%;
        height: auto;
        max-height: none;
        overflow: visible;
        z-index: 1000;
    }

    .sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        min-height: 48px;
        padding: 11px 16px;
        color: #fff;
        background: var(--color-empresa-1);
        border: 0;
        border-bottom: 1px solid rgba(255,255,255,.25);
        font-size: 16px;
        font-weight: 700;
        cursor: pointer;
    }

    .sidebar-superior { display: none; }
    .sidebar.menu-movil-abierto .sidebar-superior { display: block; }

    .logo {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 12px;
        padding: 10px 14px;
    }
    .logo img.logo-empresa-sidebar { width: 58px !important; height: 58px; max-height: 58px; }
    .logo h2 { margin: 0; font-size: 15px; line-height: 1.2; }

    .contenido {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        padding: 12px;
        min-height: auto;
    }

    .tarjeta { padding: 14px; border-radius: 8px; }
    .titulo-seccion { font-size: 21px; line-height: 1.25; }
    .subtitulo-seccion { font-size: 14px; line-height: 1.4; }

    .header-acciones,
    .encabezado-modulo,
    .footer-acciones,
    .panel-botones,
    .grupo-botones,
    .grupo-herramientas {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .header-acciones .btn,
    .encabezado-modulo .btn,
    .footer-acciones .btn,
    .panel-botones .btn,
    .grupo-botones .btn,
    .grupo-herramientas .btn {
        width: 100%;
    }

    .tabla-s {
        display: block;
        width: 100% !important;
        max-width: 100%;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        -webkit-overflow-scrolling: touch;
    }

    .tabla-s th, .tabla-s td { min-width: 118px; }
    .tabla-s th.text-center, .tabla-s td.text-center { min-width: 82px; }

    .aquacloud-alert-card { gap: 10px; padding: 14px; }
    .aquacloud-alert-icon { font-size: 23px; }
    .aquacloud-alert-title { font-size: 14px; }
    .aquacloud-alert-body { font-size: 13px; overflow-wrap: anywhere; }

    .alerta-mantenimiento-global {
        position: sticky;
        top: 0;
        padding: 9px 12px;
        font-size: 12px;
    }

    .marca-agua-footer { display: none; }
    .modal-contenedor, .ccm-modal-box { max-width: calc(100vw - 24px) !important; }

    .info-usuario {
        padding: 12px;
        background: #f8fafc;
        border-radius: 7px;
        overflow-wrap: anywhere;
    }
    .info-usuario p { margin: 6px 0; }
}

@media (max-width: 420px) {
    .contenido { padding: 8px; }
    .tarjeta { padding: 11px; }
    .titulo-seccion { font-size: 19px; }
    .btn { padding: 10px 14px; }
}
/* Grids inteligentes: ordenamiento accesible y filtros monetarios reutilizables. */
table.grid-inteligente th.grid-ordenable {
    cursor: pointer;
    user-select: none;
}

table.grid-inteligente th.grid-ordenable::after {
    content: " ↕";
    color: #94a3b8;
    font-size: 0.82em;
    white-space: nowrap;
}

table.grid-inteligente th.grid-ordenable.grid-orden-asc::after {
    content: " ↑";
    color: #38bdf8;
}

table.grid-inteligente th.grid-ordenable.grid-orden-desc::after {
    content: " ↓";
    color: #38bdf8;
}

table.grid-inteligente th.grid-ordenable:focus-visible {
    outline: 2px solid #38bdf8;
    outline-offset: -3px;
}

.grid-filtro-monetario-global {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    margin: 7px 0;
    padding: 6px 8px;
    border: 1px solid #dbe4ee;
    border-radius: 6px;
    background: #f8fafc;
    color: #475569;
    font-size: 10px;
}

.grid-filtro-monetario-global label {
    font-weight: 700;
    white-space: nowrap;
}

.grid-filtro-monetario-global select,
.grid-filtro-monetario-global input {
    min-height: 30px;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    background: #fff;
    color: #0f172a;
    font-size: 11px;
}

.grid-filtro-monetario-global select { max-width: 190px; padding: 4px 7px; }
.grid-filtro-monetario-global input { width: 130px; padding: 4px 8px; }
.grid-filtro-monetario-global input[aria-invalid="true"] { border-color: #dc2626; background: #fff7f7; }
.grid-filtro-monetario-global span { color: #64748b; white-space: nowrap; }
.grid-oculto-por-valor { display: none !important; }
.grid-oculto-por-texto { display: none !important; }

/* Filtro reutilizable de grids: cada columna se habilita desde su encabezado. */
.grid-filtro-columnas {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 9px 10px;
    margin: 0 0 8px;
    border: 1px solid #cddbea;
    border-radius: 6px;
    background: #f7fbff;
    font-size: 12px;
}
.grid-filtro-columnas > label { font-weight: 700; color: #1e3a5f; white-space: nowrap; }
.grid-filtro-columnas input[type="search"] {
    flex: 1 1 280px;
    min-width: 180px;
    padding: 7px 9px;
    border: 1px solid #b7c9dc;
    border-radius: 4px;
    background: #fff;
}
.grid-btn-columnas {
    padding: 6px 9px;
    border: 1px solid #7896b5;
    border-radius: 4px;
    background: #fff;
    color: #174f85;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}
.grid-btn-columnas:hover { background: #e4f1fc; }
.grid-estado-columnas { color: #57718e; margin-left: auto; white-space: nowrap; }
.grid-estado-columnas.grid-estado-advertencia { color: #b42318; font-weight: 700; }
.grid-selector-columna {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin-left: 5px;
    cursor: pointer;
}
.grid-selector-columna input { width: 14px; height: 14px; margin: 0; accent-color: #36a9e1; cursor: pointer; }

/* Preferencia SaaS por empresa: se define desde configuracion_visual_empresa.php. */
body table.grid-inteligente,
body table.grid-inteligente th,
body table.grid-inteligente td,
body table.hoja-datos,
body table.hoja-datos th,
body table.hoja-datos td,
body .grid-consulta-contenedor table,
body .grid-consulta-contenedor th,
body .grid-consulta-contenedor td,
body .grid-altura-limitada table,
body .grid-altura-limitada th,
body .grid-altura-limitada td,
body .contenedor-tabla table,
body .contenedor-tabla th,
body .contenedor-tabla td {
    font-size: var(--tamano-fuente-grid, 11px) !important;
}

.grid-consulta-contenedor {
    max-height: min(27vh, 250px);
    overflow: auto;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
}
.grid-consulta-contenedor > table { margin: 0; }
.grid-consulta-contenedor > table thead th { position: sticky; top: 0; z-index: 3; }

/* Altura estándar de grids: encabezado y cerca de cinco filas visibles.
   Cada formulario conserva su buscador y sus acciones fuera del desplazamiento. */
.grid-altura-limitada {
    max-height: min(27vh, 250px) !important;
    overflow: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}
.grid-altura-limitada > table { margin: 0; }
.grid-altura-limitada > table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
}

/* La columna operativa permanece siempre visible dentro del scroll del grid. */
table.grid-acciones-fijas th.grid-columna-acciones,
table.grid-acciones-fijas td.grid-columna-acciones {
    position: sticky !important;
    right: 0;
    box-sizing: border-box;
    min-width: 128px !important;
    width: 128px !important;
    overflow: visible !important;
    box-shadow: -5px 0 8px -7px rgba(15, 23, 42, .75);
}
table.grid-acciones-fijas col.grid-columna-acciones-col {
    width: 128px !important;
    min-width: 128px !important;
}
table.grid-acciones-fijas th.grid-columna-acciones {
    z-index: 7 !important;
    background: var(--color-empresa-1, #0077cc);
}
table.grid-acciones-fijas td.grid-columna-acciones {
    z-index: 2;
    background: #fff;
}
table.grid-acciones-fijas tbody tr:nth-child(even) td.grid-columna-acciones {
    background: #f8fafc;
}
table.grid-acciones-fijas tbody tr:hover td.grid-columna-acciones {
    background: #edf7ff;
}

/* Botones de grids: 11 px es el patrón visual de "Aplicar rango".
   La especificidad evita que módulos antiguos vuelvan a reducirlos a 8, 9 o 10 px. */
html body table button[class]:not(.btn-icono),
html body table button:not(.btn-icono),
html body table a[class][class*="btn"],
html body table a[class][class*="boton"],
html body table input[type="button"][class],
html body table input[type="submit"][class],
html body table input[type="button"],
html body table input[type="submit"],
html body .grid-filtro-columnas button[class],
html body .grid-filtro-columnas a[class][class*="btn"],
html body .grid-filtro-columnas a[class][class*="boton"],
html body .grid-altura-limitada button[class]:not(.btn-icono),
html body .grid-altura-limitada button:not(.btn-icono),
html body .grid-altura-limitada a[class][class*="btn"],
html body .grid-altura-limitada a[class][class*="boton"],
html body .acciones-tabla button:not(.btn-icono),
html body .acciones-tabla a[class][class*="btn"],
html body .padron-toolbar-actions button:not(.btn-icono),
html body .padron-toolbar-actions a[class][class*="btn"],
html body .facturas-herramientas button:not(.btn-icono),
html body .facturas-herramientas a[class][class*="btn"],
html body .sp-lote-acciones button:not(.btn-icono),
html body .sp-lote-acciones a[class][class*="btn"],
html body [class*="-filtros"] button:not(.btn-icono),
html body [class*="-filtros"] a[class][class*="btn"],
html body [class*="-filtros"] a[class][class*="boton"],
html body [class*="-herramientas"] button:not(.btn-icono),
html body [class*="-herramientas"] a[class][class*="btn"],
html body [class*="-herramientas"] a[class][class*="boton"],
html body [class*="acciones"]:not(.header-acciones):not(.footer-acciones):not(.dashboard-alerta-acciones):not(.confirmacion-ciclo-acciones) button:not(.btn-icono),
html body [class*="acciones"]:not(.header-acciones):not(.footer-acciones):not(.dashboard-alerta-acciones):not(.confirmacion-ciclo-acciones) a[class][class*="btn"],
html body [class*="acciones"]:not(.header-acciones):not(.footer-acciones):not(.dashboard-alerta-acciones):not(.confirmacion-ciclo-acciones) a[class][class*="boton"] {
    font-size: 11px !important;
    line-height: 1.2 !important;
}

/* Variantes del estándar cuando cada módulo ya posee un contenedor propio. */
.padron-grid.grid-altura-limitada { height:20vh; min-height:165px; max-height:235px !important; }
.contenedor-grid-fijo.grid-altura-limitada,
.grid-medidores-contenedor.grid-altura-limitada { max-height:min(55vh, 520px) !important; }
.rg-scroll.grid-altura-limitada { min-height:420px; max-height:calc(100vh - 275px) !important; }
.sp-scroll.grid-altura-limitada { min-height:430px; max-height:calc(100vh - 245px) !important; }
/* Los módulos migrados al filtro estándar conservan una única barra de búsqueda. */
.padron-toolbar .filtro-grid { display:none; }
.sp-tools:has(#filtroSuspensiones) .sp-search { display:none; }
#ficha-suscriptor { max-height:calc(100vh - 245px); overflow:auto; }
body:has(#tabla-suscriptores-ajuste) .panel-flex-header > div:first-child { display:none; }

/* Centros de informes: fichas para separar grupos sin alargar la pantalla. */
.aq-informes-fichas { margin-top:16px; border:1px solid #cbd5e1; border-radius:7px; background:#fff; overflow:hidden; }
.aq-informes-tabs { display:flex; flex-wrap:wrap; gap:0; border-bottom:1px solid #cbd5e1; background:#eef6ff; }
.aq-informes-tab { border:0; border-right:1px solid #cbd5e1; background:transparent; color:#174f85; padding:10px 14px; font-weight:700; font-size:13px; cursor:pointer; }
.aq-informes-tab:hover { background:#dceeff; }
.aq-informes-tab.activa { background:var(--color-empresa-1, #0077cc); color:#fff; }
.aq-informes-panel { display:none; padding:16px; }
.aq-informes-panel.activa { display:block; }
.aq-informes-panel > table:first-child { margin-top:0; }
.aq-informes-acciones { margin-top:16px; padding:16px; border:1px solid #cbd5e1; border-radius:7px; background:#fff; }
.aq-informes-acciones > .titulo-grupo-informe { margin-top:0; }

@media (max-width:700px) {
    .aq-informes-tabs { display:grid; grid-template-columns:1fr; }
    .aq-informes-tab { border-right:0; border-bottom:1px solid #cbd5e1; text-align:left; }
    .aq-informes-panel { padding:10px; overflow-x:auto; }
}

@media (max-width: 700px) {
    .grid-filtro-monetario-global {
        display: grid;
        grid-template-columns: 1fr 1fr;
        justify-content: stretch;
    }

    .grid-filtro-monetario-global label,
    .grid-filtro-monetario-global span { grid-column: 1 / -1; }
    .grid-filtro-monetario-global select,
    .grid-filtro-monetario-global input { width: 100%; max-width: none; }
    .grid-filtro-columnas { align-items: stretch; }
    .grid-filtro-columnas > label,
    .grid-filtro-columnas input[type="search"],
    .grid-estado-columnas { width: 100%; margin-left: 0; }
}

/* Contexto multiempresa usado por las herramientas SUI del SUPERADMIN. */
.sui-contexto-banner {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
    margin:12px 0;
    padding:12px 14px;
    border:1px solid #7dd3fc;
    border-left:5px solid #0284c7;
    border-radius:8px;
    background:#ecfeff;
    color:#0f3f65;
}
.sui-contexto-banner small,
.sui-contexto-banner strong,
.sui-contexto-banner span { display:block; }
.sui-contexto-banner small { color:#64748b;font-weight:750; }
.sui-contexto-banner strong { margin:2px 0;font-size:16px; }
.sui-contexto-banner span { font-size:11px; }
.sui-contexto-banner > a { white-space:nowrap;font-weight:850;color:#0369a1; }
@media(max-width:700px){.sui-contexto-banner{align-items:flex-start;flex-direction:column}}
.aq-sui-contexto-sidebar{margin:4px 10px 10px;padding:9px 10px;border:1px solid rgba(255,255,255,.38);border-left:4px solid #7dd3fc;border-radius:7px;background:rgba(255,255,255,.13);color:#fff;overflow:hidden}.aq-sui-contexto-sidebar small,.aq-sui-contexto-sidebar strong,.aq-sui-contexto-sidebar span{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.aq-sui-contexto-sidebar small{font-size:9px;text-transform:uppercase;opacity:.78}.aq-sui-contexto-sidebar strong{margin:2px 0;font-size:12px}.aq-sui-contexto-sidebar span{font-size:10px;opacity:.9}.sidebar .dropdown-container .aq-menu-enlace-deshabilitado{display:flex;align-items:center;gap:5px;padding:10px 12px 10px 36px;color:rgba(255,255,255,.72);font-size:12px;cursor:not-allowed}.sidebar .dropdown-container .aq-menu-enlace-deshabilitado small{margin-left:auto;padding:2px 5px;border-radius:9px;background:rgba(255,255,255,.15);font-size:8px;text-transform:uppercase}
