/* ==========================================================
   CPCREL – Branding Corporativo CRT
   Archivo consolidado y optimizado
   ========================================================== */

/* ==========================
      1. HEADER CRT
   ========================== */
.crt-header {
    background-color: #4a7d75 !important;
    color: #ffffff !important;
    border: none !important;
}

.crt-header * {
    color: #ffffff !important;
}

/* ==========================
      2. FOOTER CRT
   ========================== */
.crt-footer {
    background-color: #606060 !important;
    color: #ffffff !important;
    border: none !important;
}

.crt-footer * {
    color: #ffffff !important;
}

.crt-footer-bottom {
    background-color: #4a4a4a !important;
    color: #ffffff !important;
    border: none !important;
}

.crt-footer-bottom * {
    color: #ffffff !important;
}

/* ========================================
   3. Remoción del verde Materialize (legacy)
   ======================================== */
.green,
.green-text,
.light-green,
.light-green-text,
.green.darken-1,
.green.darken-2 {
    background-color: transparent !important;
    color: inherit !important;
}

/* ==========================================
   4. CHECKBOX PRIMEFACES – CRT
   ========================================== */
.ui-chkbox .ui-chkbox-box {
    border: 2px solid #4a7d75 !important;
    background: #ffffff !important;
    width: 18px !important;
    height: 18px !important;
}

.ui-chkbox .ui-chkbox-box.ui-state-active {
    background: #4a7d75 !important;
    border-color: #4a7d75 !important;
}

.ui-chkbox .ui-chkbox-box.ui-state-active .ui-icon {
    background-image: none !important;
    color: #ffffff !important;
}

/* ==========================================================
   5. BOTONES CRT (Universal PrimeFaces + Materialize)
   ========================================================== */

.ui-button,
.ui-button.ui-state-default,
.ui-dialog .ui-button,
.ui-dialog button.ui-button,
.ui-dialog input.ui-button,
.ui-widget-content .ui-button,
.btn,
.btn-large,
.btn-small {
    background-color: #4a7d75 !important;
    border: 1px solid #3e6c67 !important;
    color: #ffffff !important;
    font-weight: bold !important;
    border-radius: 6px !important;
    padding: 6px 18px !important;
}

.ui-button:hover,
.ui-dialog .ui-button:hover,
.btn:hover,
.btn-large:hover,
.btn-small:hover {
    background-color: #3e6c67 !important;
    border-color: #355c58 !important;
    color: #ffffff !important;
}

/* Elimina degradados/sprites heredados */
.ui-button.ui-state-default,
.ui-button .ui-button-text {
    background-image: none !important;
}

/* ==========================================
   6. MENU LATERAL MATERIALIZE – CRT
   ========================================== */
#slide-out a,
#slide-out a span {
    color: #4a7d75 !important;
    font-weight: bold !important;
}

#slide-out a.menuCober,
#slide-out a.menuPrean,
#slide-out a.menuAyuda {
    background-color: #dbe7e4 !important;
    color: #4a7d75 !important;
}

#slide-out a:hover {
    background-color: #4a7d75 !important;
    color: #ffffff !important;
}

#slide-out a.active,
#slide-out a:focus {
    border-left: 6px solid #4a7d75 !important;
}

/* ==========================================
   7. PESTAÑAS (Materialize & PrimeFaces)
   ========================================== */
.tabs .tab a {
    color: #4a7d75 !important;
    font-weight: bold !important;
}

.tabs .tab a:hover,
.tabs .tab a.active {
    background-color: #4a7d75 !important;
    color: #ffffff !important;
}

.tabs .indicator {
    background-color: #4a7d75 !important;
}

/* ==========================================
   8. TABLAS PRIMEFACES – CRT
   ========================================== */
.ui-datatable thead th,
.ui-datatable .ui-datatable-header {
    background-color: #4a7d75 !important;
    color: #ffffff !important;
    border: none !important;
    text-align: center !important;
    font-weight: bold !important;
}

.ui-datatable-odd {
    background-color: #f3f7f6 !important;
}

.ui-datatable-even {
    background-color: #ffffff !important;
}

/* Checkbox del header */
.ui-datatable thead .ui-chkbox .ui-chkbox-box {
    border: 2px solid #ffffff !important;
    background-color: transparent !important;
}

.ui-datatable thead .ui-chkbox .ui-chkbox-box.ui-state-active {
    background-color: #ffffff !important;
    border-color: #ffffff !important;
}

/* ==========================================
   9. PAGINADOR PRIMEFACES – CRT
   ========================================== */
.ui-paginator {
    background-color: #dbe7e4 !important;
    border: none !important;
}

.ui-paginator a,
.ui-paginator .ui-paginator-page,
.ui-paginator .ui-paginator-next,
.ui-paginator .ui-paginator-prev,
.ui-paginator .ui-paginator-first,
.ui-paginator .ui-paginator-last {
    background-color: #4a7d75 !important;
    color: #ffffff !important;
    border: 1px solid #3e6c67 !important;
    border-radius: 4px !important;
    margin: 2px !important;
    padding: 3px 8px !important;
}

.ui-paginator a:hover,
.ui-paginator .ui-paginator-page:hover {
    background-color: #3e6c67 !important;
    border-color: #355c58 !important;
}

.ui-paginator .ui-state-active {
    background-color: #355c58 !important;
    border-color: #2e504c !important;
    color: #ffffff !important;
}

/* ==========================================
   10. Combos – SelectOneMenu CRT
   ========================================== */
.ui-selectonemenu,
.ui-selectonemenu-label,
.ui-selectonemenu-trigger {
    border-color: #4a7d75 !important;
    color: #4a7d75 !important;
}

.ui-selectonemenu-trigger .ui-icon {
    background-image: none !important;
    color: #4a7d75 !important;
    font-weight: bold !important;
}

/* ==========================================
   11. Íconos y links de ayuda CRT
   ========================================== */
.fa-question-circle,
#Icono_interrogacion,
.green-text,
a.green-text {
    color: #4a7d75 !important;
    font-weight: bold !important;
}

a.green-text {
    text-decoration: underline !important;
}

/* ==========================================
   12. Botoneras especiales (Pre-análisis)
   ========================================== */
.botonesForm .ui-button {
    background-color: #4a7d75 !important;
    border: 1px solid #3e6c67 !important;
    padding: 8px 22px !important;
}
.botonesForm .ui-button:hover {
    background-color: #3e6c67 !important;
    border-color: #355c58 !important;
}

/* ==========================================================
   CORRECCIÓN FINAL DE VERDES RESIDUALES PRIMEFACES – CRT
   ========================================================== */

/* -----------------------------
   1. TABS PrimeFaces (ui-tabs)
   ----------------------------- */

/* Indicador debajo de la pestaña */
.ui-tabs .ui-tabs-nav .ui-state-active {
    border-bottom: 3px solid #4A7D75 !important;
}

/* -----------------------------------
   2. RADIO BUTTON PrimeFaces (FM / AM / TDT)
   ----------------------------------- */

.ui-radiobutton .ui-radiobutton-box {
    border: 2px solid #4A7D75 !important;
    background: white !important;
}

.ui-radiobutton .ui-radiobutton-box.ui-state-active {
    background: #4A7D75 !important;
    border-color: #4A7D75 !important;
}

.ui-radiobutton-icon {
    background-image: none !important;
    color: white !important;
}

/* ------------------------------------
   3. SELECTONE MENU (Combos)
   ------------------------------------ */

.ui-selectonemenu {
    border: 1px solid #4A7D75 !important;
    border-radius: 6px !important;
}

.ui-selectonemenu-label {
    color: #4A7D75 !important;
}

.ui-selectonemenu-trigger {
    background: #4A7D75 !important;
    border-left: 1px solid #3E6C67 !important;
}

.ui-selectonemenu-trigger .ui-icon {
    color: white !important;
    background-image: none !important;
    font-weight: bold !important;
}

/* Al desplegar la lista */
.ui-selectonemenu-panel .ui-selectonemenu-items-wrapper,
.ui-selectonemenu-panel .ui-selectonemenu-list {
    border-color: #4A7D75 !important;
}

.ui-selectonemenu-panel .ui-selectonemenu-item:hover {
    background: #E6EFEA !important;
    color: #4A7D75 !important;
}

/* -----------------------------------
   4. CHECKBOX usados en tablas
   ----------------------------------- */

.ui-selectbooleancheckbox .ui-chkbox-box {
    border: 2px solid #4A7D75 !important;
    background: white !important;
}

.ui-selectbooleancheckbox .ui-chkbox-box.ui-state-active {
    background: #4A7D75 !important;
    border-color: #4A7D75 !important;
}

/* -----------------------------------
   5. LOS ICONOS ? de ayuda
   ----------------------------------- */

.fa-question-circle {
    color: #4A7D75 !important;
    font-weight: bold !important;
}

/* ============================================
   OVERRIDE GLOBAL PRIMEFACES – COLORES CRT
   ============================================ */

/* Estado normal (botones, combos, tabs, radio, etc.) */
body .ui-state-default,
body .ui-widget-content .ui-state-default,
body .ui-widget-header .ui-state-default {
    background: #4A7D75 !important;
    border: 1px solid #3E6C67 !important;
    color: #FFFFFF !important;
    background-image: none !important;
}

/* Hover */
body .ui-state-hover,
body .ui-widget-content .ui-state-hover,
body .ui-widget-header .ui-state-hover,
body .ui-state-focus,
body .ui-widget-content .ui-state-focus,
body .ui-widget-header .ui-state-focus {
    background: #6E9F97 !important;
    border: 1px solid #3E6C67 !important;
    color: #FFFFFF !important;
    background-image: none !important;
}

/* Activo (tab activa, botón presionado) */
body .ui-state-active,
body .ui-widget-content .ui-state-active,
body .ui-widget-header .ui-state-active {
    background: #3E6C67 !important;
    border: 1px solid #2F514D !important;
    color: #FFFFFF !important;
    background-image: none !important;
}

/* Inputs y combos */
body .ui-inputfield,
body .ui-selectonemenu-label {
    border: 1px solid #3E6C67 !important;
    color: #000 !important;
}

body .ui-selectonemenu-trigger {
    background: #4A7D75 !important;
    border: 1px solid #3E6C67 !important;
    border-left: none !important;
}

body .ui-selectonemenu-trigger .ui-icon {
    background-image: none !important;
    border-left: 6px solid #FFFFFF !important;
    border-top: 4px solid transparent !important;
    border-bottom: 4px solid transparent !important;
    width: 0 !important;
    height: 0 !important;
}

/* === Restauración funcional del check (palomita) === */
.ui-chkbox .ui-chkbox-box .ui-icon {
    background-image:url("/CPCREL-web/javax.faces.resource/images/ui-icons_ffffff_256x240.png.xhtml?ln=primefaces-excite-bike") !important;
    background-position:-65px -145px !important;  /* ✔ Palomita del sprite */
    width:16px !important;
    height:16px !important;
    margin-left:1px !important;
    margin-top:1px !important;
}

/* === Restauración funcional del punto interno del radio === */
.ui-radiobutton .ui-radiobutton-box .ui-radiobutton-icon {
    background-image:url("/CPCREL-web/javax.faces.resource/images/ui-icons_ffffff_256x240.png.xhtml?ln=primefaces-excite-bike") !important;
    background-position:-98px -145px !important;  /* ● Punto del sprite */
    width:16px !important;
    height:16px !important;
    margin-left:1px !important;
    margin-top:1px !important;
}

/* ============================================================
   AJUSTE – PESTAÑAS PrimeFaces (comportamiento correcto)
   ============================================================ */

/* --- Pestañas inactivas --- */
.ui-tabs .ui-tabs-nav li:not(.ui-state-active) a {
    background: #4A7D75 !important;      /* Verde CRT (oscuro) */
    color: #FFFFFF !important;           /* Texto blanco */
}

/* --- Pestaña activa --- */
.ui-tabs .ui-tabs-nav li.ui-state-active a {
    background: #E6EFEA !important;      /* Verde clarito */
    color: #4A7D75 !important;           /* Texto verde CRT */
}

/* --- Eliminar interferencia del override global --- */
.ui-tabs .ui-tabs-nav li a.ui-state-default {
    background: inherit !important;
    color: inherit !important;
}

/* ===========================
   CHECKBOX – Comportamiento CRT correcto
   =========================== */

/* Inactivo (sin seleccionar) */
.ui-chkbox .ui-chkbox-box {
    background: #FFFFFF !important;
    border: 2px solid #4A7D75 !important;
}

/* Ícono apagado (sin palomita) */
.ui-chkbox .ui-chkbox-box .ui-icon {
    background-image: none !important;
}

/* Activo: mostrar palomita CRT */
.ui-chkbox .ui-chkbox-box.ui-state-active {
    background: #4A7D75 !important;
    border-color: #4A7D75 !important;
}

.ui-chkbox .ui-chkbox-box.ui-state-active .ui-icon {
    background-image:url("/CPCREL-web/javax.faces.resource/images/ui-icons_ffffff_256x240.png.xhtml?ln=primefaces-excite-bike") !important;
    background-position:-65px -145px !important;
}

/* ===========================
   RADIO BUTTON – Comportamiento CRT correcto
   =========================== */

/* Inactivo: borde verde, centro blanco */
.ui-radiobutton .ui-radiobutton-box {
    background: #FFFFFF !important;
    border: 2px solid #4A7D75 !important;
}

/* Ícono apagado (sin punto) */
.ui-radiobutton .ui-radiobutton-box .ui-radiobutton-icon {
    background-image: none !important;
}

/* Activo: fondo verde CRT + punto blanco */
.ui-radiobutton .ui-radiobutton-box.ui-state-active {
    background: #4A7D75 !important;
    border-color: #4A7D75 !important;
}

.ui-radiobutton .ui-radiobutton-box.ui-state-active .ui-radiobutton-icon {
    background-image:url("/CPCREL-web/javax.faces.resource/images/ui-icons_ffffff_256x240.png.xhtml?ln=primefaces-excite-bike") !important;
    background-position:-98px -145px !important;
}

/* ============================================================
   SELECTONEMENU – Colores personalizados solicitados
   ============================================================ */

/* 1. Primera fila (placeholder: "Seleccione") – verde pastel */

/* 2. Filas normales (todas excepto la primera y la seleccionada) – gris claro */

/* 3. Hover en elementos */
.ui-selectonemenu-panel .ui-selectonemenu-item:hover {
    background-color: #d0e2de !important; /* un poquito más oscuro que #dbdfdc */
    color: #004b40 !important; /* Verde CRT oscuro */
}

/* 4. Fila seleccionada – respetar estilo CRT */
.ui-selectonemenu-panel .ui-selectonemenu-item.ui-state-highlight {
    background-color: #4A7D75 !important; /* Verde CRT */
    color: #FFFFFF !important;
}

/* ===========================
   TABS PrimeFaces – Ajuste final CRT
   =========================== */

/* Inactivas */
.ui-tabs .ui-tabs-nav li:not(.ui-state-active) a {
    background: #4A7D75 !important;    /* Verde CRT oscuro */
    color: #FFFFFF !important;
}

/* Activa */
.ui-tabs .ui-tabs-nav li.ui-state-active a {
    background: #E6EFEA !important;    /* Verde clarito */
    color: #4A7D75 !important;
}

/* Forzar que el <li> también adopte el color claro */
.ui-tabs .ui-tabs-nav li.ui-state-active {
    background: #E6EFEA !important;
}

/* ============================================================
   SELECTONEMENU – Flecha corporativa CRT hacia abajo
   ============================================================ */

body .ui-selectonemenu-trigger .ui-icon {
    background-image: none !important;
    border-top: 6px solid #FFFFFF !important;      /* Flecha ▼ */
    border-left: 4px solid transparent !important;
    border-right: 4px solid transparent !important;
    border-bottom: 0 !important;
    width: 0 !important;
    height: 0 !important;
    margin-top: 6px !important;                    /* Ajuste vertical */
}

/* ============================================
   TABS – Pestaña activa completamente verde claro
   ============================================ */

.ui-tabs .ui-tabs-nav li.ui-state-active a {
    background: #E6EFEA !important;   /* Verde clarito */
    color: #4A7D75 !important;         /* Verde CRT */
}

.ui-tabs .ui-tabs-nav li.ui-state-active {
    background: #E6EFEA !important;    /* Forzar LI */
    border-bottom: 3px solid #4A7D75 !important;
}

body .ui-inputfield { background: #FFFFFF; }



/* ============================================
   SELECTONEMENU – Input de búsqueda original
   ============================================ */
.ui-selectonemenu-panel .ui-selectonemenu-filter {
    background: #FFFFFF !important;  /* Blanco (original) */
    color: #000 !important;
    border: 1px solid #4A7D75 !important;
}

/* ============================================
   SELECTONEMENU – Fila base (normal)
   ============================================ */
.ui-selectonemenu-panel .ui-selectonemenu-item {
    background-color: #eeeeee !important;   /* Gris claro */
    color: #333333 !important;              /* Gris oscuro */
}

/* ============================================
   SELECTONEMENU – Hover (Verde CRT + blanco)
   ============================================ */
.ui-selectonemenu-panel .ui-selectonemenu-item:hover {
    background-color: #4A7D75 !important;   /* Verde CRT */
    color: #FFFFFF !important;              /* Blanco */
    font-weight: bold !important;
}

/* ============================================
   SELECTONEMENU – Seleccionado (gris)
   ============================================ */
.ui-selectonemenu-panel
.ui-selectonemenu-item.ui-state-highlight,
.ui-selectonemenu-panel
.ui-selectonemenu-item.ui-state-active,
.ui-selectonemenu-panel
.ui-selectonemenu-item.ui-state-focus {
    background-color: #eeeeee !important;   /* Gris claro */
    color: #333333 !important;              /* Gris oscuro */
    font-weight: normal !important;
}

/* =====================================================================
   FIX — Mata el amarillo del tema en TODAS sus variantes
   ===================================================================== */

/* =====================================================
   1) Fila normal (gris claro)
   ===================================================== */
body .ui-selectonemenu-panel .ui-selectonemenu-item {
    background-color: #eeeeee !important;
    color: #333 !important;
}

/* =====================================================
   2) Seleccionado EN EL PANEL (gris claro + texto gris)
   ===================================================== */
body .ui-selectonemenu-panel .ui-selectonemenu-item.ui-state-highlight,
body .ui-selectonemenu-panel .ui-selectonemenu-item.ui-state-active,
body .ui-selectonemenu-panel .ui-selectonemenu-item.ui-state-focus {
    background-color: #eeeeee !important;
    color: #333333 !important;
    font-weight: normal !important;
}

/* =====================================================
   3) Hover (verde CRT + texto blanco)
   ===================================================== */
body .ui-selectonemenu-panel .ui-selectonemenu-item:hover {
    background-color: #4A7D75 !important;
    color: #ffffff !important;
    font-weight: bold !important;
}

/* =====================================================================
   4) FIX DURO – Mata el amarillo de Materialize en <span>
   ===================================================================== */
body .dropdown-content li.active > span,
body .dropdown-content li.selected > span,
body .dropdown-content li > span.ui-state-highlight {
    background-color: #eeeeee !important; /* Gris claro */
    color: #333 !important;
}

/* Hover dentro del dropdown (Materialize + PF juntos) */
body .dropdown-content li:hover > span {
    background-color: #4A7D75 !important; /* Verde CRT */
    color: #ffffff !important;
}

/* ================================================
   APLASTA el amarillo del tema (CPCREL original)
   ================================================ */

/* Neutraliza TODOS los .ui-state-highlight heredados */
body .ui-widget .ui-state-highlight,
body .ui-widget-content .ui-state-highlight,
body .ui-widget-header .ui-state-highlight {
    background-color: #eeeeee !important; /* gris claro */
    color: #333 !important;
    font-weight: normal !important;
}

/* Refuerza que el highlight de SelectOneMenu sea gris */
body .ui-selectonemenu-panel .ui-selectonemenu-item.ui-state-highlight {
    background-color: #eeeeee !important;
    color: #333 !important;
}

body .ui-selectonemenu-panel .ui-state-highlight,
body .ui-selectonemenu-item.ui-state-highlight,
body .dropdown-content .active > span,
body .dropdown-content .active > a {
    background: #eeeeee !important;
    color: #333 !important;
}

/* ==========================================
   FIX – Encabezado de las tablas (títulos)
   ========================================== */
.ui-datatable .ui-datatable-header,
.ui-datatable .ui-datatable-header > span {
    color: #000000 !important;        /* Negro */
    font-weight: bold !important;
    /*background: transparent !important;*/
    text-shadow: none !important;     /* Evita opacidad */
}

/* ==========================================================
   FIX – SOLO la tabla del popup "Información sobre clase"
   ========================================================== */

/* Encabezado */
table.striped.green.lighten-2 thead th {
    background-color: #4a7d75 !important; /* Verde CRT */
    color: #ffffff !important;
    font-weight: bold !important;
    text-align: center !important;
}

/* Filas impares → blancas */
table.striped.green.lighten-2 tbody tr:nth-child(odd) td {
    background-color: #ffffff !important;
    color: #000000 !important;
}

/* Filas pares → verde CRT */
table.striped.green.lighten-2 tbody tr:nth-child(even) td {
    background-color: #4a7d75 !important;
    color: #ffffff !important;
}

/* ==========================================================
   ENCABEZADOS DE TABLA
   Verde CRT + texto blanco
   Tabla: tablaFichaTecnicaUsuario
   ========================================================== */

/* Fila 1: "Módulo de Consulta de cobertura" */
.tablaFichaTecnicaUsuario tr:nth-child(1) td {
    background-color: #4A7D75 !important; /* Verde CRT */
    color: #ffffff !important;
}

/* Fila 2: "Criterio / Servicios FM y TDT / Servicio AM" */
.tablaFichaTecnicaUsuario tr:nth-child(2) td {
    background-color: #4A7D75 !important;
    color: #ffffff !important;
}

/* Fila 9: "Módulo de Preanálisis de coberturas" */
.tablaFichaTecnicaUsuario tr:nth-child(9) td {
    background-color: #4A7D75 !important;
    color: #ffffff !important;
}

/* Fila 10: "Criterio / Servicios FM y TDT" */
.tablaFichaTecnicaUsuario tr:nth-child(10) td {
    background-color: #4A7D75 !important;
    color: #ffffff !important;
}

/* Asegurar que h:outputLabel y cualquier hijo mantengan texto blanco */
.tablaFichaTecnicaUsuario tr:nth-child(1) td *,
.tablaFichaTecnicaUsuario tr:nth-child(2) td *,
.tablaFichaTecnicaUsuario tr:nth-child(9) td *,
.tablaFichaTecnicaUsuario tr:nth-child(10) td * {
    color: #ffffff !important;
    font-weight: bold !important;
}

/* ==========================================================
   FIX CONTROLADO – Alineación GRID
   PrimeFaces – CPCREL
   ========================================================== */

/* 1. Wrapper interno: ocupa todo el ancho disponible */
.ui-datatable-tablewrapper {
    width: 100% !important;
}

/* 2. Tabla alineada al margen izquierdo */
.ui-datatable-tablewrapper > table {
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
}

















