/* WCAG 2.2 AA — overlays Metronic without editing style.bundle.css. Plan: docs/plan-wcag22.md */

.skip-link {
    position: absolute;
    left: 0.75rem;
    top: 0.75rem;
    z-index: 11000;
    padding: 0.5rem 1rem;
    background-color: #1b1b28;
    color: #fff;
    border-radius: 0.425rem;
    font-weight: 600;
    text-decoration: none;
    transform: translateY(-200%);
}

    .skip-link:focus,
    .skip-link:focus-visible {
        transform: none;
        color: #fff;
        outline: 2px solid #7239ea;
        outline-offset: 2px;
    }

.btn.btn-success {
    background-color: #198754 !important;
    border-color: #157347 !important;
    color: #fff !important;
}

.btn.btn-primary {
    background-color: #0a58ca !important;
    border-color: #0a58ca !important;
    color: #fff !important;
}

.btn.btn-danger,
a.btn.btn-danger {
    background-color: #b02a37 !important;
    border-color: #a52834 !important;
    color: #fff !important;
}

.activity-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
}

.activity-tabs .nav-tabs {
    flex: 1 1 auto;
}

.activity-tabs .nav-link {
    color: #3f4254 !important;
}

.nav-tabs .nav-link {
    color: #3f4254 !important;
}

.accordion-button,
.accordion-item {
    color: #3f4254;
}

/* Encabezado abierto con fondo púrpura del bundle. */
.accordion-button:not(.collapsed),
.accordion-button:not(.collapsed) h5,
.accordion-button:not(.collapsed) span,
.accordion-button:not(.collapsed) .text-muted,
.accordion-button:not(.collapsed) .text-gray-500,
.accordion-button:not(.collapsed) .text-gray-800 {
    color: #fff !important;
}

/* Modal Roles: el acordeón lleva fondo lila (#ebe8f3); el blanco no se lee. */
#modalaroles .accordion-button,
#modalaroles .accordion-button:not(.collapsed),
#modalaroles .accordion-button h5,
#modalaroles .accordion-button span,
#modalaroles .accordion-button .text-gray-800 {
    color: #3f4254 !important;
}

#modalaroles .accordion-button .text-muted,
#modalaroles .accordion-button .text-gray-500 {
    color: #5e6278 !important;
}

#modalaroles .accordion-button i {
    color: #0095e8 !important;
}

.text-muted,
.text-gray-500 {
    color: #5e6278 !important;
}

.btn.btn-color-gray-400,
.btn-color-gray-400 {
    color: #5e6278 !important;
}

.badge.badge-light,
.badge-light {
    color: #3f4254 !important;
    background-color: #e4e6ea !important;
}

.badge.badge-light-warning,
.badge-light-warning {
    color: #6b4f00 !important;
    background-color: #fff3cd !important;
}

.badge.badge-light-success,
.badge-light-success {
    color: #0f5132 !important;
    background-color: #d1e7dd !important;
}

.badge.badge-light-danger,
.badge-light-danger {
    color: #b02a37 !important;
}

/* Botones claros en reposo; hover/activo conservan el relleno sólido de Metronic. */
.btn.btn-light-primary:not(:hover):not(:focus):not(:active):not(.active):not(.show),
.btn.btn-light-primary:not(:hover):not(:focus):not(:active):not(.active):not(.show) i {
    color: #0a58ca !important;
}

.btn.btn-light-danger:not(:hover):not(:focus):not(:active):not(.active):not(.show),
.btn.btn-light-danger:not(:hover):not(:focus):not(:active):not(.active):not(.show) i {
    color: #b02a37 !important;
}

.btn.btn-light-success:not(:hover):not(:focus):not(:active):not(.active):not(.show),
.btn.btn-light-success:not(:hover):not(:focus):not(:active):not(.active):not(.show) i {
    color: #0f5132 !important;
}

.btn.btn-light-warning:not(:hover):not(:focus):not(:active):not(.active):not(.show),
.btn.btn-light-warning:not(:hover):not(:focus):not(:active):not(.active):not(.show) i {
    color: #6b4f00 !important;
}



/* Alertas: Metronic usa el color de marca como texto sobre el fondo pálido. */
.alert.alert-danger,
.alert.alert-danger .text-danger {
    color: #b02a37 !important;
}

/* Asterisco de obligatorio y avisos rojos en campos: #f1416c da ~3.5:1 sobre blanco. */
label .text-danger,
.form-label .text-danger,
.form-control.text-danger,
.form-select.text-danger {
    color: #b02a37 !important;
}

/* Placeholder de Select2: el bundle usa gray-500 (#a1a5b7, ~2.5:1). */
.select2-container .select2-selection__placeholder {
    color: #5e6278 !important;
}

.alert.alert-primary,
.alert.alert-primary .text-primary {
    color: #0a58ca !important;
}

.alert.alert-success,
.alert.alert-success .text-success {
    color: #0f5132 !important;
}

.alert.alert-warning,
.alert.alert-warning .text-warning {
    color: #6b4f00 !important;
}

.badge.badge-light-primary,
.badge-light-primary {
    color: #0a58ca !important;
}

.badge.badge-light-secondary,
.badge-light-secondary {
    color: #3f4254 !important;
}

.poa-periodo-activo-ribbon,
.ribbon-label.bg-warning.poa-periodo-activo-ribbon {
    background-color: #7239ea !important;
    color: #fff !important;
}

#kt_app_sidebar .menu-title,
#kt_app_sidebar .menu-link {
    color: #3f4254 !important;
}

#kt_app_sidebar .menu-link.active,
#kt_app_sidebar .menu-link.active .menu-title {
    color: #3f4254 !important;
}

.nav-link.text-active-primary {
    color: #3f4254 !important;
}

.nav-link.text-active-primary.active,
.nav-link.text-active-primary:hover,
.nav-link.text-active-primary:focus {
    color: #0056b3 !important;
}

#kt_app_content {
    color: #3f4254;
}

.app-footer .menu-gray-600 .menu-link,
.app-footer .menu-link {
    color: #5e6278 !important;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.btn:focus-visible,
.nav-link:focus-visible,
.form-control:focus-visible,
[role="button"]:focus-visible {
    outline: 2px solid #7239ea;
    outline-offset: 2px;
}

/* 2.5.8 Target Size (Minimum): 24×24 px. No reduce botones ya más grandes. */
.btn.btn-icon,
a.btn.btn-icon,
.app-navbar-item [role="button"].btn {
    min-width: 24px;
    min-height: 24px;
}

/* Bajo 992px el bundle fija la raíz en 12px y .fs-8 queda en 10.2px; mínimo legible 11px. */
.fs-8 {
    font-size: max(0.85rem, 11px) !important;
}

.fs-9 {
    font-size: max(0.75rem, 11px) !important;
}

.fs-10 {
    font-size: max(0.5rem, 11px) !important;
}

.badge {
    --bs-badge-font-size: max(0.85rem, 11px);
}

/* Tablas de los controladores con style='font-size:smaller' (~10px). */
table[style*="font-size:smaller"],
table[style*="font-size: smaller"] {
    font-size: max(0.85rem, 11px) !important;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
