/* Títulos de página e cabeçalhos de modal padronizados (ícone em "badge"). */

/* ---------- Título da página ---------- */
.page-title-wrap {
    position: relative;
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    gap: 14px;
    min-width: 0;
    margin-right: 16px;
    padding: 10px 20px 10px 18px;
    border: 1px solid #dbe6f3;
    border-radius: 16px;
    background: linear-gradient(135deg, #ffffff 0%, #eef5fd 100%);
    box-shadow: 0 6px 18px rgba(14, 40, 65, .08);
}

/* O container do título cresce para o cartão ocupar a linha (ao lado dos botões de ação). */
:has(> .page-title-wrap) {
    min-width: 0;
}

.d-flex:has(> .page-title-wrap) {
    flex: 1 1 auto;
}

.page-title-wrap::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    border-radius: 16px 0 0 16px;
    background: linear-gradient(180deg, #3b82c4 0%, #0E2841 100%);
}

.page-title-wrap > h1 {
    margin: 0 !important;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -.01em;
    line-height: 1.2;
    color: var(--sys-brand-blue, #0E2841);
}

.page-title-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    font-size: 1.2rem;
    color: #fff;
    background: linear-gradient(135deg, #1f5a96 0%, #0E2841 100%);
    box-shadow: 0 6px 14px rgba(14, 40, 65, .22);
}

.page-title-wrap .ajuda-tela-container {
    margin-left: .25rem;
    position: relative;
    z-index: 1070;
}

/* ---------- Cabeçalho de modal ---------- */
.modal-content {
    border-radius: 16px;
    overflow: hidden;
}

.modal-header.has-modal-icon {
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
}

.modal-header.has-modal-icon:not(.bg-primary):not(.bg-plumas-w):not(.bg-categoria):not(.ponto-modal-header):not(.modal-bancos-header) {
    background: linear-gradient(180deg, #f5f9ff 0%, #eaf2fb 100%);
    border-bottom: 1px solid #dbe6f3;
}

.modal-header.has-modal-icon .modal-title,
.modal-header.has-modal-icon > h1,
.modal-header.has-modal-icon > h2,
.modal-header.has-modal-icon > h3,
.modal-header.has-modal-icon > h4,
.modal-header.has-modal-icon > h5 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.25;
}

.modal-title-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: .95rem;
    color: #fff;
    background: linear-gradient(135deg, #1f5a96 0%, #0E2841 100%);
    box-shadow: 0 4px 10px rgba(14, 40, 65, .2);
}

.modal-title-icon.is-danger { background: linear-gradient(135deg, #e55353 0%, #b02a2a 100%); }
.modal-title-icon.is-success { background: linear-gradient(135deg, #2fb86b 0%, #1b7f48 100%); }
.modal-title-icon.is-warning { background: linear-gradient(135deg, #f0a232 0%, #b8731a 100%); }

.modal-header.has-modal-icon .close {
    margin: 0 0 0 auto;
    padding: 6px 10px;
    border-radius: 8px;
    opacity: .6;
}

.modal-header.has-modal-icon .close:hover {
    opacity: 1;
    background: rgba(14, 40, 65, .08);
}

/* ---------- Tema escuro ---------- */
[data-theme="dark"] .page-title-wrap {
    background: linear-gradient(135deg, rgba(255, 255, 255, .06) 0%, rgba(255, 255, 255, .02) 100%);
    border-color: var(--sys-border, rgba(255, 255, 255, .12));
    box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}

[data-theme="dark"] .page-title-wrap > h1 {
    color: var(--sys-text, #e6edf5);
}

[data-theme="dark"] .page-title-icon,
[data-theme="dark"] .modal-title-icon {
    background: linear-gradient(135deg, #3b82c4 0%, #1f4f82 100%);
    box-shadow: 0 6px 14px rgba(0, 0, 0, .45);
}

[data-theme="dark"] .modal-header.has-modal-icon:not(.bg-primary):not(.bg-plumas-w):not(.bg-categoria):not(.ponto-modal-header):not(.modal-bancos-header) {
    background: linear-gradient(180deg, rgba(255, 255, 255, .05) 0%, rgba(255, 255, 255, .02) 100%);
    border-bottom-color: var(--sys-border, rgba(255, 255, 255, .12));
}

[data-theme="dark"] .modal-header.has-modal-icon .close:hover {
    background: rgba(255, 255, 255, .1);
}

@media (max-width: 575.98px) {
    .page-title-icon { width: 38px; height: 38px; font-size: 1rem; border-radius: 11px; }
    .page-title-wrap > h1 { font-size: 1.35rem; }
}

@media print {
    .page-title-wrap { border: 0; box-shadow: none; background: none; padding: 0; }
    .page-title-wrap::before { display: none; }
    .page-title-icon { display: none; }
}
