/**
 * Cabeçalho padrão de modais — Ágil Fiscal
 * Referência: Docs/modo-escuro.md / .cursor/rules/modo-escuro.md
 *
 * Modais com cabeçalho customizado (gradiente vermelho, etc.):
 * adicionar classe .modal-header--custom no .modal-header
 */

:root {
    --agil-modal-header-bg: #fff;
    --agil-modal-header-title: #05585d;
    --agil-modal-header-border: rgba(15, 23, 42, 0.12);
    --agil-modal-header-close: #64748b;
    --agil-modal-body-bg: #fff;
}

html.agil-theme-dark {
    --agil-modal-header-bg: #1e293b;
    --agil-modal-header-title: #2dd4bf;
    --agil-modal-header-border: rgba(255, 255, 255, 0.1);
    --agil-modal-header-close: #94a3b8;
    --agil-modal-body-bg: #0f172a;
}

/* Cabeçalho padrão */
.modal-content > .modal-header:not(.modal-header--custom) {
    background: var(--agil-modal-header-bg) !important;
    border-bottom: 1px solid var(--agil-modal-header-border) !important;
    padding: 1.25rem 1.5rem !important;
}

.modal-content > .modal-header:not(.modal-header--custom) .modal-title {
    color: var(--agil-modal-header-title) !important;
    font-weight: 700 !important;
    font-size: 1.25rem;
}

.modal-content > .modal-header:not(.modal-header--custom) .modal-title i {
    color: var(--agil-modal-header-title) !important;
}

.modal-content > .modal-header:not(.modal-header--custom) .btn-close {
    filter: none;
    opacity: 0.75;
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%2364748b'%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") center/1em auto no-repeat;
}

html.agil-theme-dark .modal-content > .modal-header:not(.modal-header--custom) .btn-close {
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%2394a3b8'%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") center/1em auto no-repeat;
}

.modal-content > .modal-header:not(.modal-header--custom) .btn-close:hover {
    opacity: 1;
}

/* Corpo ligeiramente mais escuro que o cabeçalho (modo escuro) */
html.agil-theme-dark .modal-content > .modal-body:not(.modal-editar-usuario-body) {
    background-color: var(--agil-modal-body-bg) !important;
}

html.agil-theme-dark .modal-content > .modal-footer:not(.modal-editar-usuario-footer) {
    background-color: var(--agil-modal-body-bg) !important;
    border-top-color: var(--agil-modal-header-border) !important;
}

html.agil-theme-dark .modal-content {
    background-color: var(--agil-modal-body-bg) !important;
    border-color: var(--agil-modal-header-border) !important;
}
