/*
 * TM01GPT — Adaptação ao TM Branding Universal
 * Mantém os estilos específicos fora da biblioteca central.
 */

.tm-branding-active #tm-global-header {
    width: 100%;
}

/* Preservar o menu de autenticação no Header universal */
.tm-branding-active
.tm-global-header
.tm-branding-user-menu {
    display: flex !important;
    align-items: center;
    gap: 10px;
    color: inherit;
    font-size: 13px;
    white-space: nowrap;
}

.tm-branding-active
.tm-global-header
.tm-user-logout {
    color: inherit;
    background: transparent;
    border: 1px solid var(--tm-border, #454550);
}

/* Não interferir com o cabeçalho interno do Chat */
.tm-branding-chat .tm-workstation-header {
    display: flex;
}

@media (max-width: 900px) {
    .tm-branding-active
    .tm-global-header
    .tm-branding-user-menu {
        gap: 6px;
        font-size: 12px;
    }

    .tm-branding-active
    .tm-global-header
    .tm-user-logout {
        padding: 6px 8px;
    }
}

@media (max-width: 480px) {
    .tm-branding-active
    .tm-global-header
    .tm-branding-user-menu > span {
        display: none;
    }
}


/* TM01GPT BRANDING FOOTER FIX V1 */

/* Permitir scroll nas páginas normais com Branding */
html:has(body.tm-branding-active:not(.tm-branding-chat)),
body.tm-branding-active:not(.tm-branding-chat) {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Organizar Header, conteúdo e Footer */
body.tm-branding-active:not(.tm-branding-chat) .tm-app {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    height: auto;
    overflow: visible;
}

/* Remover a altura fixa herdada do Chat */
body.tm-branding-active:not(.tm-branding-chat) .tm-main {
    flex: 1 0 auto;
    height: auto;
    min-height: 0;
    overflow: visible;
}

/* Footer no fim do conteúdo */
body.tm-branding-active:not(.tm-branding-chat) #tm-global-footer {
    display: block;
    flex-shrink: 0;
    width: 100%;
}

/* O Footer nunca deve ficar sobreposto ao conteúdo */
body.tm-branding-active:not(.tm-branding-chat) .tm-global-footer {
    position: relative;
}


/* TM01GPT DASHBOARD CONTRAST V1 */

/* Fundo e texto da página inicial */
body.tm-branding-active:not(.tm-branding-chat) {
    background: #0d1117;
    color: #f5f5f7;
}

/* Variáveis específicas do tema */
body.tm-branding-active:not(.tm-branding-chat) {
    --tm-bg: #0d1117;
    --tm-panel: #151920;
    --tm-text: #f5f5f7;
    --tm-muted: #b8bec9;
    --tm-soft: #d1d5db;
    --tm-border: #343a46;
    --tm-accent: #e62ca6;
}

/* Conteúdo principal */
body.tm-branding-active:not(.tm-branding-chat) .tm-main {
    background: #0d1117;
    color: #f5f5f7;
}

/* Títulos e textos */
body.tm-branding-active:not(.tm-branding-chat) .tm-main h1,
body.tm-branding-active:not(.tm-branding-chat) .tm-main h2,
body.tm-branding-active:not(.tm-branding-chat) .tm-main h3,
body.tm-branding-active:not(.tm-branding-chat) .tm-main strong {
    color: #ffffff;
}

/* Cartões */
body.tm-branding-active:not(.tm-branding-chat) .tm-card {
    background: #151920;
    color: #f5f5f7;
    border-color: #343a46;
}

/* Texto secundário */
body.tm-branding-active:not(.tm-branding-chat) .tm-muted {
    color: #b8bec9;
}


/* TM01GPT CHAT CONTRAST V1 */

/* Paleta específica do Chat */
body.tm-branding-active.tm-branding-chat {
    --tm-bg: #0d1117;
    --tm-panel: #151920;
    --tm-text: #f5f5f7;
    --tm-muted: #b8bec9;
    --tm-soft: #d1d5db;
    --tm-border: #343a46;
    --tm-accent: #e62ca6;

    background: #0d1117;
    color: #f5f5f7;
}

/* Área principal */
body.tm-branding-chat .tm-main,
body.tm-branding-chat .tm-chat-shell {
    color: #f5f5f7;
}

/* Títulos */
body.tm-branding-chat .tm-main h1,
body.tm-branding-chat .tm-main h2,
body.tm-branding-chat .tm-main h3,
body.tm-branding-chat .tm-main h4,
body.tm-branding-chat .tm-main strong {
    color: #ffffff;
}

/* Texto dos painéis */
body.tm-branding-chat .tm-chat-shell,
body.tm-branding-chat .tm-chat-shell section,
body.tm-branding-chat .tm-chat-shell aside {
    color: #f5f5f7;
}

/* Texto secundário */
body.tm-branding-chat .tm-muted,
body.tm-branding-chat .tm-workstation-status,
body.tm-branding-chat .tm-workstation-subtitle {
    color: #b8bec9;
}

/* Campos de escrita */
body.tm-branding-chat textarea,
body.tm-branding-chat input,
body.tm-branding-chat select {
    color: #f5f5f7;
}

/* Texto de ajuda nos campos */
body.tm-branding-chat textarea::placeholder,
body.tm-branding-chat input::placeholder {
    color: #929ba9;
}

/* Links */
body.tm-branding-chat .tm-main a {
    color: #e6e8ed;
}

/* Manter os destaques magenta */
body.tm-branding-chat .tm-main button:hover,
body.tm-branding-chat .tm-main a:hover {
    border-color: #e62ca6;
}
