/* TMessage (components/TMessage, e o TMessageError de include/TError): card no visual da caixa "Consultas Diversas", titulo claro com o icone do
   tipo num quadrado e a barra tingidos na cor do tipo (troca o gif) e o botao no acabamento do Voltar do conteudo.
   Marcacao: table.table_Tmessage > td > table > linhas th (titulo), td img + td (mensagem), td hr, td input (botoes).
   Usa as variaveis do alfa.css. Ao mudar, subir o ?vN no TMessage::show() e no TMessageError::show().
   "separate" porque o border-radius nao vale com o collapse global de table */
.table_Tmessage {
    width: 480px;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    background: var(--fundo);
    border: 1px solid var(--borda);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(15, 35, 70, 0.06), 0 8px 24px rgba(15, 35, 70, 0.08);
    text-align: left;
}

.table_Tmessage > tbody > tr > td {
    padding: 0;
}

.table_Tmessage table {
    border-collapse: collapse;
}

/* cor do tipo (escolhida pelo gif que o TMessage poe na mensagem): --tm-cor no quadrado do icone, --tm-tinta no fundo
   da barra de titulo e --tm-texto no titulo. Info e o padrao */
.table_Tmessage {
    --tm-cor: #3a6ea5;
    --tm-tinta: rgba(58, 110, 165, 0.10);
    --tm-texto: var(--titulo);
    --tm-icone: '\f05a';
}

.table_Tmessage:has(img[src$="sys.images/error.gif"]) {
    --tm-cor: #c0392b;
    --tm-tinta: rgba(192, 57, 43, 0.10);
    --tm-texto: #8a1c1c;
    --tm-icone: '\f057';
}

.table_Tmessage:has(img[src$="sys.images/warning.png"]) {
    --tm-cor: #d99a00;
    --tm-tinta: rgba(240, 180, 0, 0.16);
    --tm-texto: #7a5600;
    --tm-icone: '\f071';
}

.table_Tmessage:has(img[src$="sys.images/success.gif"]) {
    --tm-cor: #2e8b57;
    --tm-tinta: rgba(46, 139, 87, 0.11);
    --tm-texto: #1f6b42;
    --tm-icone: '\f058';
}

:root[data-theme="dark"] .table_Tmessage {
    --tm-cor: #5b8fd0;
    --tm-tinta: rgba(91, 143, 208, 0.16);
}

:root[data-theme="dark"] .table_Tmessage:has(img[src$="sys.images/error.gif"]) {
    --tm-cor: #e06666;
    --tm-tinta: rgba(224, 102, 102, 0.16);
    --tm-texto: #f0b4b0;
}

:root[data-theme="dark"] .table_Tmessage:has(img[src$="sys.images/warning.png"]) {
    --tm-cor: #e0a800;
    --tm-tinta: rgba(224, 168, 0, 0.16);
    --tm-texto: #f0d080;
}

:root[data-theme="dark"] .table_Tmessage:has(img[src$="sys.images/success.gif"]) {
    --tm-cor: #4caf7a;
    --tm-tinta: rgba(76, 175, 122, 0.16);
    --tm-texto: #9fd8b4;
}

.table_Tmessage th {
    padding: 12px 18px 10px;
    background: var(--tm-tinta);
    border-bottom: 1px solid var(--tm-tinta);
    color: var(--tm-texto);
    font-size: 12pt;
    font-weight: 600;
    text-align: left;
    vertical-align: middle;
}

.table_Tmessage th::before {
    content: var(--tm-icone);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-right: 10px;
    border-radius: 7px;
    background: var(--tm-cor);
    color: #FFFFFF;
    font-family: 'FontAwesome';
    font-size: 15px;
    font-weight: normal;
    vertical-align: middle;
}

/* o icone ja esta no titulo: some a coluna do gif */
.table_Tmessage td:has(> img[src$="sys.images/error.gif"]),
.table_Tmessage td:has(> img[src$="sys.images/success.gif"]),
.table_Tmessage td:has(> img[src$="sys.images/info.gif"]),
.table_Tmessage td:has(> img[src$="sys.images/warning.png"]) {
    display: none;
}

/* mensagem */
.table_Tmessage table > tbody > tr > td {
    padding: 14px 18px;
    color: var(--texto);
    font-size: 13px;
    line-height: 1.45;
}

/* a linha do <hr> vira a borda de cima da faixa dos botoes */
.table_Tmessage hr {
    display: none;
}

.table_Tmessage table > tbody > tr > td:has(> hr) {
    padding: 0;
    border-top: 1px solid var(--borda);
}

.table_Tmessage table > tbody > tr > td:has(> input[type="button"]) {
    padding: 12px 18px 14px;
    background: var(--fundo-suave);
    text-align: center;
}

/* Sim/Nao ficam em linhas proprias: a segunda cola na primeira */
.table_Tmessage table > tbody > tr:has(> td > input[type="button"]) + tr > td:has(> input[type="button"]) {
    padding-top: 0;
}

.table_Tmessage input[type="button"] {
    min-width: 96px;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--link);
    background: var(--fundo-modulo);
    border: 1px solid var(--borda-modulo);
    border-radius: 6px;
    transition: background 0.13s, color 0.13s, border-color 0.13s;
}

.table_Tmessage input[type="button"]:hover {
    color: var(--link-hover);
    background: var(--fundo-destaque);
    border-color: var(--azul);
}

.table_Tmessage input[type="button"]:focus-visible {
    outline: 2px solid var(--azul);
    outline-offset: 1px;
}

/* Dentro do modal (TMessage via AJAX: TAjax::message) o modal ja tem moldura e barra azul:
   a caixa interna perde a dela (a barra de titulo tingida fica), para nao ficar uma caixa dentro da outra */
.modalDialog_contentDiv .table_Tmessage,
.modalDialog2_contentDiv .table_Tmessage {
    width: 100%;
    max-width: none;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.modalDialog_contentDiv .table_Tmessage th,
.modalDialog2_contentDiv .table_Tmessage th {
    font-size: 11pt;
}

.modalDialog_contentDiv .table_Tmessage td:has(> input[type="button"]),
.modalDialog2_contentDiv .table_Tmessage td:has(> input[type="button"]) {
    background: none;
}
