/* Padrão visual compartilhado para identificação e navegação */
.session-identity-wrap {
    display: flex;
    justify-content: flex-end;
    width: min(1080px, calc(100% - 32px));
    margin: -40px auto 0;
    padding: 0 0 12px;
}

.session-identity {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.session-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: 50%;
    background: #eaf3fc;
    color: #23649b;
    font-size: 13px;
    font-weight: 800;
}

.session-user-text {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    line-height: 1.25;
}

.session-user-label {
    color: #687986;
    font-size: 11px;
}

.session-user-text strong {
    color: #20313e;
    font-size: 14px;
    font-weight: 700;
}

header .user {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

header .user a,
a.back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 14px;
    border: 1px solid #cbd8e2;
    border-radius: 10px;
    background: #fff;
    color: #23649b !important;
    font-weight: 600;
    line-height: 1.25;
    text-decoration: none !important;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}

header .user a.back::before,
a.back::before {
    content: "←";
    margin-right: 8px;
    font-size: 18px;
    line-height: 1;
}

header .user a[href*="password"] {
    border-color: #23649b;
    background: #23649b;
    color: #fff !important;
}

header .user form {
    margin: 0;
}

header .user form button {
    min-height: 40px;
    padding: 8px 16px;
    border: 1px solid #dce3e8;
    border-radius: 10px;
    background: #fff;
    color: #334653;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}

header .user a:hover,
a.back:hover,
header .user form button:hover {
    border-color: #23649b;
    background-color: #f0f6fb;
    box-shadow: 0 2px 8px #20313e12;
}

header .user a[href*="password"]:hover {
    background: #194e79;
    color: #fff !important;
}

header .user a:focus-visible,
a.back:focus-visible,
header .user form button:focus-visible {
    outline: 3px solid #78aede;
    outline-offset: 2px;
}

@media (max-width: 640px) {
    .session-identity-wrap { margin-top: 0; }
    header .user {
        width: 100%;
        gap: 8px;
    }

    header .user a,
    header .user form,
    header .user form button {
        flex: 1 1 auto;
    }
}

/* Ajuste da identificação nos cabeçalhos */
.session-identity-wrap {
    margin-top: -34px;
}

header:not(:has(> .wrap)) .session-identity-wrap {
    width: calc(100% - 32px);
    max-width: none;
}

@media (max-width: 640px) {
    .session-identity-wrap {
        margin-top: 0;
    }
}

header .session-identity-wrap.session-identity-wide {
    width: calc(100% - 32px);
    max-width: none;
}

/* Alinha a identificação à largura do cabeçalho SAP Medidores */
body.meter-report-page header .session-identity-wrap {
    width: min(1250px, calc(100% - 32px));
    max-width: 1250px;
    margin-left: auto;
    margin-right: auto;
}


/* Cabeçalho compartilhado: identificação alinhada aos mesmos limites dos botões */
.app-header__container > .session-identity-wrap {
    width: 100%;
    max-width: none;
    margin: -34px 0 0;
}

/* Mantém logo e título alinhados no cabeçalho compartilhado */
.app-header .brand {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.app-header .brand img {
    display: block;
    width: 200px;
    max-width: 100%;
    height: auto;
    flex-shrink: 0;
}
