﻿/**
 * ════════════════════════════════════════════════════════════════════════════════
 * COMPLIANCE360 — CSS GLOBAL FIXES (VERSIÓN AGRESIVA v2.0)
 * 
 * Soluciones globales para conflictos de CSS entre DevExpress y custom styles
 * Aplica a todas las páginas que hereden de Root.master
 * 
 * Ubicación: ~/Content/compliance360-global-fixes.css
 * ════════════════════════════════════════════════════════════════════════════════
 */

/* ═══════════════════════════════════════════════════════════════════════════════
   RESET GLOBAL DE BOTONES — SOBRESCRIBIR TODO
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════════════════
   TOKENS --c360-*  (FALTABAN: el master define --primary/--text-dark/--border/…
   sin el prefijo c360-, pero varias páginas usan var(--c360-*). Aquí los
   definimos para que esas referencias resuelvan en TODA la app. Es aditivo:
   antes estaban indefinidos, así que esto solo agrega color donde faltaba.)
   ═══════════════════════════════════════════════════════════════════════════════ */
:root {
    --c360-primary: #F87C1D;
    --c360-primary-dark: #ba5d15;
    --c360-primary-soft: #fde9d8;
    --c360-text: #2c3e50;
    --c360-muted: #6b7280;
    --c360-border: #bdc3c7;
    --c360-card: #ffffff;
    --c360-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Resetear TODOS los botones y enlaces */
button,
input[type="button"],
input[type="submit"],
a[class*="btn"],
.dxbButton,
.btn-action,
.btn-evaluar,
.btn-ver,
.btn-pdf,
.btn-disabled {
    /* Display */
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    /* Visibilidad de texto */
    font-size: 12px !important;
    color: white !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    /* Accesibilidad */
    cursor: pointer !important;
    pointer-events: auto !important;
    text-decoration: none !important;
    /* Spacing */
    padding: 5px 12px !important;
    margin: 0 !important;
    /* Border */
    border-radius: 4px !important;
    border: 1px solid !important;
    /* Transiciones */
    transition: all 0.15s !important;
    /* CRÍTICO: Prevenir text-indent y clip que ocultan texto */
    text-indent: 0 !important;
    clip: auto !important;
    clip-path: none !important;
    width: auto !important;
    height: auto !important;
    min-height: auto !important;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   FIX: botones "sutiles" de fondo claro (texto tenue) — p. ej. "Todo aquí"
   en la Forma de pago (.cpg-btn-llenar) de DetalleMatriz.
   El reset global de arriba fuerza color:white + border blanco en TODO <button>,
   lo que los vuelve invisibles (blanco sobre blanco). Aquí se restauran.
   La clase tiene mayor especificidad que 'button', así que con !important gana.
   ═══════════════════════════════════════════════════════════════════════════════ */
.cpg-btn-llenar {
    background: #fff !important;
    color: var(--c360-muted, #6b7280) !important;
    border: 1px solid var(--c360-border, #e0e0e0) !important;
    font-size: 11px !important;
    padding: 4px 8px !important;
    min-width: 0 !important; /* anula el min-width:80px global que descuadra la col 90px */
}

    .cpg-btn-llenar:hover {
        background: var(--c360-primary, #f87c1d) !important;
        color: #fff !important;
        border-color: var(--c360-primary, #f87c1d) !important;
    }

/* FIX: enlace "← Volver" de DetalleMatriz (.mt-btn-volver). Su clase contiene
   "btn", así que el reset global (a[class*="btn"]) le forzaba texto blanco y lo
   volvía invisible. Se restaura el estilo claro con borde. a.mt-btn-volver iguala
   la especificidad de a[class*="btn"] y, al ir después, gana. */
a.mt-btn-volver {
    background: #fff !important;
    color: #6c757d !important;
    border: 1px solid #ccc !important;
    font-size: 13px !important;
    padding: 6px 14px !important;
    min-width: 0 !important;
}

    a.mt-btn-volver:hover {
        background: #f8f9fa !important;
        color: #212529 !important;
        border-color: #ccc !important;
    }

/* FIX: enlace "Editar" de la columna Opciones (GridViewCommandColumn) en los
   reportes RESU (intervinientes y transacciones). El reset global pinta los
   .dxbButton de blanco; aquí se restaura para que el enlace sea visible y
   clicable. (La columna usa ButtonRenderMode="Link" con texto "Editar".) */
.dxgvCommandColumn a.dxbButton,
.dxgvCommandColumn a.dxbButton span,
.dxgvCommandColumn a {
    color: var(--c360-primary, #0d6efd) !important;
    background: transparent !important;
    border: none !important;
    min-width: 0 !important;
    padding: 2px 6px !important;
    text-decoration: underline !important;
    font-weight: 600 !important;
}

    .dxgvCommandColumn a.dxbButton:hover,
    .dxgvCommandColumn a.dxbButton:hover span,
    .dxgvCommandColumn a:hover {
        color: var(--c360-primary-dark, #0056b3) !important;
    }

/* ═══════════════════════════════════════════════════════════════════════════════
   BOTONES DE ACCIÓN EN GRILLAS (ListaMatrices, etc.)
   ═══════════════════════════════════════════════════════════════════════════════ */

/* Botón evaluar (naranja) */
.btn-evaluar,
a.btn-evaluar {
    background: #f87c1d !important;
    color: white !important;
    border-color: #f87c1d !important;
}

    .btn-evaluar:hover,
    a.btn-evaluar:hover {
        background: #ba5d15 !important;
        border-color: #ba5d15 !important;
        color: white !important;
    }

/* Botón ver (blanco/naranja) */
.btn-ver,
a.btn-ver {
    background: white !important;
    color: #f87c1d !important;
    border-color: #f87c1d !important;
}

    .btn-ver:hover,
    a.btn-ver:hover {
        background: #f87c1d !important;
        color: white !important;
        border-color: #f87c1d !important;
    }

/* Botón PDF (rojo) */
.btn-pdf,
a.btn-pdf {
    background: white !important;
    color: #c0392b !important;
    border-color: #c0392b !important;
    margin-left: 4px !important;
}

    .btn-pdf:hover,
    a.btn-pdf:hover {
        background: #c0392b !important;
        color: white !important;
        border-color: #c0392b !important;
    }

/* Botón deshabilitado */
.btn-disabled,
a.btn-disabled {
    background: #f5f5f5 !important;
    color: #888 !important;
    border-color: #ddd !important;
    cursor: not-allowed !important;
    font-style: italic !important;
}

/* Botón UAFE primario (Generar Archivo Excel TRA/INT) — naranja sólido.
   Sin esta regla caía en el reset genérico (texto blanco + borde blanco)
   con fondo transparente por usar var(--c360-primary) → quedaba invisible. */
.btn-uafe,
a.btn-uafe {
    background: #f87c1d !important;
    color: #ffffff !important;
    border-color: #f87c1d !important;
}

    .btn-uafe:hover,
    a.btn-uafe:hover {
        background: #ba5d15 !important;
        border-color: #ba5d15 !important;
        color: #ffffff !important;
    }

/* Botón "Volver al listado" — secundario claro: texto oscuro, borde gris.
   El reset genérico lo dejaba con texto y borde blancos sobre fondo blanco. */
.btn-back,
a.btn-back {
    background: #ffffff !important;
    color: #2c3e50 !important;
    border-color: #bdc3c7 !important;
}

    .btn-back:hover,
    a.btn-back:hover {
        background: #f5f5f5 !important;
        color: #2c3e50 !important;
        border-color: #95a5a6 !important;
    }

/* ═══════════════════════════════════════════════════════════════════════════════
   BOTONES ASP.NET Y DEVEXPRESS
   ═══════════════════════════════════════════════════════════════════════════════ */

/* Botones de submit/button ASP.NET */
input[type="button"],
input[type="submit"],
button[type="button"],
button[type="submit"],
button {
    display: inline-block !important;
    min-width: 80px !important;
    text-align: center !important;
    white-space: normal !important;
    word-wrap: break-word !important;
}

/* DevExpress Button */
.dxbButton,
.dxbImageButton,
.dxbEditorButton {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    text-indent: 0 !important;
}

/* LinkButton y botones genéricos */
a[role="button"],
a.button,
a.btn {
    display: inline-block !important;
}

/* Spans y texto dentro de botones */
button span,
input[type="button"] span,
input[type="submit"] span,
a.btn-action span,
a.btn-evaluar span,
a.btn-ver span,
a.btn-pdf span,
.dxbButton span {
    display: inline !important;
    visibility: visible !important;
    opacity: 1 !important;
    font-size: 12px !important;
    color: inherit !important;
    font-weight: inherit !important;
    text-indent: 0 !important;
    clip: auto !important;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   FUERZA VISIBILIDAD EN CONTENEDORES Y CELDAS
   ═══════════════════════════════════════════════════════════════════════════════ */

/* Celdas de DevExpress GridView */
.dxgvDataRow > td,
.dxgvDataRow_Office365 > td,
.dxgvFooterRow > td,
.dxgvFooterRow_Office365 > td {
    overflow: visible !important;
    z-index: 1 !important;
    display: table-cell !important;
}

/* Links y botones dentro de celdas */
.dxgvDataRow a,
.dxgvDataRow_Office365 a,
.dxgvDataRow button,
.dxgvDataRow_Office365 button {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Contenedores de botones */
.btn-container,
.button-container,
.action-container,
.form-actions,
.modal-footer {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   ARREGLOS PARA DEVEXPRESS GRID
   ═══════════════════════════════════════════════════════════════════════════════ */

/* Pager visible */
.dxgvPager_Office365,
.dxgvPager {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Grid sin conflictos */
.dxgvControl_Office365,
.dxgvControl {
    border: none !important;
    width: 100% !important;
}

/* Filas normales */
.dxgvDataRow,
.dxgvDataRow_Office365,
.dxgvGroupRow {
    display: table-row !important;
    visibility: visible !important;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   BADGES Y ETIQUETAS
   ═══════════════════════════════════════════════════════════════════════════════ */

.badge,
[class*="badge-"],
.badge-alto,
.badge-medio,
.badge-normal,
.badge-pendiente,
.badge-evaluado,
.badge-manual {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   REMOVE ANY CONFLICTING STYLES
   ═══════════════════════════════════════════════════════════════════════════════ */

/* Prevenir width: 0 o similar */
button,
input[type="button"],
input[type="submit"],
a[class*="btn"] {
    width: auto !important;
    min-height: auto !important;
    height: auto !important;
    overflow: visible !important;
}

/* Prevenir text-indent que oculta texto */
button,
input[type="button"],
input[type="submit"],
a[class*="btn"] {
    text-indent: 0 !important;
    clip: auto !important;
    clip-path: none !important;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   PRINT STYLES
   ═══════════════════════════════════════════════════════════════════════════════ */

@media print {
    .btn-action,
    .btn-evaluar,
    .btn-ver,
    .btn-pdf,
    button,
    input[type="button"],
    input[type="submit"] {
        display: none !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   FIX: editores de DevExpress en modo EDICIÓN inline (combos y textbox)
   El reset global de arriba fuerza inline-flex / borde / padding / color:white
   sobre `button` y `.dxbButton`. `.dxbButton` es la clase del botón desplegable
   del combo de DevExpress, así que el reset lo descuadra y deja el combo sin
   abrir. Aquí se restaura el comportamiento NATIVO de los editores de edición,
   sin afectar los botones de acción de la app. Va al final para ganar prioridad.
   ═══════════════════════════════════════════════════════════════════════════════ */

/* Estructura interna del combo/buttonedit: layout de tabla nativo, sin borde/flex */
.dxeButtonEdit,
.dxeButtonEdit_Office365,
.dxgvDataRow .dxeButtonEdit,
.dxgvDataRow_Office365 .dxeButtonEdit {
    display: inline-table !important;
    border: 1px solid #ccc !important;
    width: 100% !important;
}

/* Botón desplegable del combo: que sea clickeable y con su tamaño nativo */
.dxeButtonEditButton,
.dxeButtonEditButton.dxbButton,
td.dxeButtonEditButton,
.dxgvDataRow .dxeButtonEditButton {
    display: table-cell !important;
    border: 0 !important;
    padding: 0 !important;
    min-width: 0 !important;
    width: auto !important;
    color: inherit !important;
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* Área editable de cualquier editor (combo y textbox): escribible/seleccionable */
.dxeEditArea,
input.dxeEditArea,
textarea.dxeEditArea,
.dxgvDataRow input.dxeEditArea,
.dxgvDataRow textarea.dxeEditArea {
    display: inline-block !important;
    border: 0 !important;
    color: inherit !important;
    pointer-events: auto !important;
    -webkit-user-select: text !important;
    user-select: text !important;
}
