/* SGTC v22.7 - Ajuste fino do botão Sair */

html, body { max-width: 100%; overflow-x: hidden !important; }
body { overflow-x: hidden !important; }

.topbar.mob-topbar.sgtc-topbar-v22 {
    min-height: 86px !important;
    height: auto !important;
    padding: 6px 14px 0 !important;
    display: flex !important;
    align-items: flex-end !important;
    gap: 12px !important;
    overflow: visible !important;
}

.sgtc-brand-v22 {
    flex: 0 0 388px !important;
    min-width: 388px !important;
    max-width: 388px !important;
    gap: 12px !important;
    align-self: center !important;
    padding-bottom: 9px !important;
    text-decoration: none !important;
}

.brand-logo-shell-v23 {
    width: 58px;
    height: 58px;
    min-width: 58px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    overflow: hidden;
    background: transparent !important;
    box-shadow: 0 10px 24px rgba(0,0,0,.22);
    border: 1px solid rgba(255,255,255,.14);
}

.brand-logo-icon-img-v23 {
    width: 58px;
    height: 58px;
    display: block;
    object-fit: cover;
    object-position: center;
    border-radius: 16px;
    background: transparent !important;
}

.sgtc-brand-text-v22 strong {
    display: block;
    font-size: 15px !important;
    line-height: 1.0 !important;
    font-weight: 900 !important;
    color: #ffffff !important;
    letter-spacing: -.15px;
    margin-bottom: 4px;
    white-space: nowrap !important;
}

.sgtc-brand-text-v22 small {
    display: block;
    font-size: 11px !important;
    line-height: 1.1;
    color: #d7efe7 !important;
    font-weight: 700;
    white-space: nowrap !important;
}

.sgtc-main-menu-v22 {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    height: auto !important;
    align-self: flex-end !important;
    padding-bottom: 7px !important;
    gap: 6px !important;
    justify-content: flex-start !important;
    margin-left: 14px !important;
}

.sgtc-main-menu-v22 > a,
.sgtc-main-menu-v22 .menu-trigger {
    height: 42px !important;
    padding: 0 11px !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    border-radius: 12px !important;
    white-space: nowrap !important;
}

/* Usuário no topo e Sair alinhado com a linha do menu */
.sgtc-userbox-v22 {
    margin-left: auto !important;
    width: 136px !important;
    min-width: 136px !important;
    max-width: 136px !important;
    height: 76px !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: 24px 42px !important;
    align-items: end !important;
    justify-items: end !important;
    align-self: flex-end !important;
    padding: 0 0 7px 0 !important;
    white-space: nowrap;
    flex: 0 0 136px !important;
    position: relative;
    top: 0 !important;
}

.user-meta-v23 {
    grid-row: 1 !important;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-end;
    line-height: 1.0;
    max-width: 136px;
    margin: 0 2px 7px 0;
}

.user-meta-v23 strong {
    display: block;
    color: #ffffff;
    font-size: 15px;
    font-weight: 900;
    margin: 0 0 2px 0;
    max-width: 136px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-meta-v23 small {
    display: block;
    color: #d3ece5;
    font-size: 9px;
    font-weight: 700;
    line-height: 1.02;
    margin: 0;
    max-width: 136px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-logout-btn-v22 {
    grid-row: 2 !important;
    justify-self: end !important;
    align-self: end !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 42px;
    padding: 0 16px;
    border-radius: 14px;
    text-decoration: none;
    color: #ffffff !important;
    font-weight: 900;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.16);
    box-shadow: 0 10px 22px rgba(0,0,0,.15);
    transition: transform .15s ease, background .15s ease;
    transform: translateY(-5px);
}
.user-logout-btn-v22:hover { transform: translateY(-6px); background: rgba(255,255,255,.18); }

.dashboard-hero-v9 { position: relative !important; overflow: hidden !important; }
.dashboard-hero-v9::after {
    content: "";
    position: absolute;
    right: 28px;
    bottom: 18px;
    width: min(44vw, 600px);
    height: 160px;
    background: url('../img/sgtc-brand-banner-soft.png') no-repeat center / contain;
    pointer-events: none;
    z-index: 1;
}
.dashboard-hero-v9 > * { position: relative; z-index: 2; }

.topbar, .page, .dashboard-hero-v9, .content-grid, .panel, .table-wrap, .filter-bar, .form-card, .form-grid {
    overflow-x: clip;
}

@media (max-width: 1440px) {
    .sgtc-brand-v22 { flex-basis: 372px !important; min-width: 372px !important; max-width: 372px !important; }
    .sgtc-brand-text-v22 strong { font-size: 14px !important; }
    .sgtc-main-menu-v22 { margin-left: 10px !important; }
    .sgtc-main-menu-v22 > a, .sgtc-main-menu-v22 .menu-trigger { padding: 0 10px !important; font-size: 12.5px !important; }
    .sgtc-userbox-v22 { width: 130px !important; min-width: 130px !important; max-width: 130px !important; flex-basis: 130px !important; }
    .user-meta-v23, .user-meta-v23 strong, .user-meta-v23 small { max-width: 130px; }
}

@media (max-width: 1260px) {
    .topbar.mob-topbar.sgtc-topbar-v22 {
        min-height: auto !important;
        padding: 12px !important;
        align-items: stretch !important;
        flex-wrap: wrap !important;
    }
    .sgtc-brand-v22, .sgtc-userbox-v22 {
        width: 100% !important; max-width: 100% !important; flex: 1 1 100% !important;
        justify-content: space-between; padding-bottom: 0 !important; padding-top: 0 !important; top: 0;
    }
    .sgtc-userbox-v22 {
        height: auto !important;
        grid-template-columns: 1fr auto !important;
        grid-template-rows: 1fr !important;
        align-items: center !important;
    }
    .user-meta-v23 { grid-row: 1 !important; align-items: flex-start; max-width: none; justify-self: start; margin: 0; }
    .user-logout-btn-v22 { grid-row: 1 !important; transform: none; }
    .user-logout-btn-v22:hover { transform: translateY(-1px); }
    .sgtc-main-menu-v22 {
        width: 100%; order: 3; padding-bottom: 2px !important; margin-left: 0 !important;
        overflow-x: auto !important; scrollbar-width: thin;
    }
}

@media (max-width: 800px) {
    .sgtc-brand-text-v22 strong { font-size: 13px !important; }
    .sgtc-brand-text-v22 small, .user-meta-v23 small { font-size: 10px !important; }
    .brand-logo-shell-v23, .brand-logo-icon-img-v23 { width: 50px; height: 50px; min-width: 50px; }
    .dashboard-hero-v9::after { opacity: .7; width: 80vw; height: 90px; right: 10px; bottom: 10px; }
}
