/* Estandar visual para botones en todo CGA */
.cga-page-title {
    align-items: center;
    display: flex;
    gap: 0.45rem;
    justify-content: center;
}

.cga-page-title .cga-page-title-icon {
    flex: 0 0 auto;
    font-size: 0.95em;
    line-height: 1;
}

.btn {
    align-items: center;
    border-radius: 0.375rem;
    display: inline-flex;
    font-weight: 400;
    gap: 0.35rem;
    justify-content: center;
    line-height: 1.2;
    min-height: 38px;
}

button.btn,
a.btn,
.modal .btn,
.modal-footer .btn {
    font-weight: 400 !important;
}

/* Fondo unificado para todos los modales del sistema. */
.modal-backdrop {
    background-color: #6c757d !important;
}

.modal-backdrop.show {
    opacity: 0.25 !important;
}

.modal .btn-close,
.modal .btn.btn-close,
.modal-header .btn-close,
.modal-header .btn.btn-close {
    background-color: transparent;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e");
    background-position: center;
    background-repeat: no-repeat;
    background-size: 0.85rem;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    height: 38px !important;
    min-height: 38px !important;
    min-width: 38px !important;
    opacity: 1;
    padding: 0 !important;
    width: 38px !important;
    filter: none;
}

.modal .btn-close:hover,
.modal .btn.btn-close:hover,
.modal-header .btn-close:hover,
.modal-header .btn.btn-close:hover {
    background-color: transparent;
    border-color: transparent;
    opacity: 1;
}

.modal .btn-close:focus,
.modal .btn.btn-close:focus,
.modal-header .btn-close:focus,
.modal-header .btn.btn-close:focus {
    box-shadow: none;
}

.alert .btn-close,
.alert-dismissible .btn-close {
    background-color: transparent;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e");
    background-position: center;
    background-repeat: no-repeat;
    background-size: 0.85rem;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    height: 38px;
    min-height: 38px;
    min-width: 38px;
    opacity: 0.55;
    padding: 0;
    position: relative;
    transition: opacity 0.15s ease-in-out;
    width: 38px;
}

.alert .btn-close:hover,
.alert-dismissible .btn-close:hover {
    background-color: transparent;
    border-color: transparent;
    opacity: 1;
}

.alert .btn-close::before,
.alert-dismissible .btn-close::before {
    content: none;
}

.alert-dismissible {
    position: relative;
    padding-right: 3rem;
}

.alert-dismissible .btn-close {
    position: absolute !important;
    right: 0.45rem !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
}

.alert .btn-close:focus,
.alert-dismissible .btn-close:focus,
.alert .btn-close:active,
.alert-dismissible .btn-close:active {
    background-color: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
    opacity: 1 !important;
    outline: none !important;
}

.btn.btn-icon-only {
    min-width: 38px;
    padding: 0.375rem 0.6rem;
}

.btn.btn-icon-only > i {
    margin: 0;
}

.btn.cga-back-button {
    align-items: center;
    display: inline-flex;
    flex: 0 1 auto;
    gap: 0.45rem;
    justify-content: center;
    padding: 0.375rem 0.75rem;
    white-space: nowrap;
}

.btn.cga-back-button > i {
    flex: 0 0 auto;
    font-size: 1rem;
    line-height: 1;
    margin: 0;
}

.btn-group .btn,
.d-flex .btn,
.btn-toolbar .btn {
    white-space: nowrap;
}

/* Estandar para barras de acciones en cabecera de pagina. */
.cga-actions-toolbar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
}

.cga-actions-toolbar > .btn,
.cga-actions-toolbar > a.btn {
    white-space: nowrap;
}

@media (max-width: 767.98px) {
    .cga-actions-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .cga-actions-toolbar > .btn,
    .cga-actions-toolbar > a.btn {
        width: 100%;
    }
}

/* Estandar para acciones en tablas: botones icono-only */
table td .d-grid.gap-2.d-flex,
table td .btn-group,
table td .cga-table-actions {
	align-items: center;
	display: flex;
	gap: 0.45rem !important;
}

table td .d-grid.gap-2.d-flex .btn,
table td .btn-group .btn,
table td .cga-table-actions .btn {
    align-items: center !important;
    display: inline-flex !important;
    height: 38px;
    justify-content: center !important;
    min-height: 38px;
    min-width: 38px;
    padding: 0 !important;
    width: 38px;
}

table td .d-grid.gap-2.d-flex .btn > i,
table td .btn-group .btn > i,
table td .cga-table-actions .btn > i {
    display: inline-block;
    font-size: 1rem;
    line-height: 1;
    margin: 0;
    vertical-align: 0;
}

/* Si el botón trae icono + texto, forzar visual solo icono en acciones */
table td .d-grid.gap-2.d-flex .btn,
table td .btn-group .btn,
table td .cga-table-actions .btn {
    font-size: 0;
}

table td .d-grid.gap-2.d-flex .btn > i,
table td .btn-group .btn > i,
table td .cga-table-actions .btn > i {
    font-size: 1rem;
}

@media (min-width: 768px) {
    table td .d-grid.gap-2.d-flex {
        flex-wrap: nowrap;
    }
}

@media (max-width: 767px) {
    .btn {
        min-height: 36px;
    }

    table td .d-grid.gap-2.d-flex {
        flex-wrap: wrap;
    }
}
