/* ========================================
   Patient Banner Sticky (cabeçalho compacto)
   ======================================== */
.pep-patient-banner {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid #dee2e6;
    border-left: 5px solid #0d6efd;
    border-radius: .5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    padding: .75rem 1rem;
    top: 0;
    z-index: 1020;
}
.pep-patient-banner.sticky-top {
    /* Compensa eventual navbar fixa do base.html */
    top: 0;
}
.pep-banner-row {
    display: grid;
    /* Colunas: foto (auto) | id | alerts | actions.
       A coluna da foto é opcional — quando .pep-banner-photo está
       ausente do markup, o auto colapsa para 0 e o grid se ajusta. */
    grid-template-columns: auto minmax(0, 1.2fr) minmax(0, 1.5fr) auto;
    gap: 1rem;
    align-items: center;
}
.pep-banner-photo {
    /* O avatar circular tem tamanho fixo definido inline (64px) — manter
       a coluna sem crescer e centralizada verticalmente. */
    display: flex;
    align-items: center;
    justify-content: center;
}
.pep-banner-id .pep-banner-name {
    font-size: 1.15rem;
    margin: 0 0 .15rem 0;
    color: #212529;
    font-weight: 600;
}
.pep-banner-id .pep-banner-name .bi {
    color: #0d6efd;
}
.pep-banner-meta {
    font-size: .8rem;
    color: #6c757d;
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}
.pep-banner-meta strong {
    color: #495057;
    font-weight: 600;
}
.pep-banner-meta code {
    color: #495057;
    background: rgba(0,0,0,.05);
    padding: 0 .3rem;
    border-radius: .2rem;
}
.pep-banner-clinical {
    font-size: .82rem;
    color: #495057;
    display: flex;
    flex-wrap: wrap;
    gap: .9rem;
    padding-top: .35rem;
    border-top: 1px dashed #dee2e6;
    margin-top: .35rem;
}
.pep-banner-clinical strong {
    color: #212529;
    font-weight: 600;
}
.pep-banner-clinical code {
    color: #198754;
    background: rgba(25,135,84,.08);
    padding: 0 .35rem;
    border-radius: .25rem;
    font-weight: 600;
}
.pep-banner-clinical .bi {
    margin-right: .15rem;
}
.pep-banner-alerts {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    min-width: 0;
}
.pep-alert-chip {
    display: flex;
    align-items: center;
    gap: .35rem;
    flex-wrap: wrap;
    padding: .3rem .55rem;
    border-radius: .35rem;
    font-size: .82rem;
    line-height: 1.2;
}
.pep-alert-chip strong { margin-right: .15rem; }
.pep-alert-chip .badge { font-weight: 500; }
.pep-chip-allergy { background: #fff3cd; border-left: 3px solid #ffc107; color: #664d03; }
.pep-chip-problem { background: #cff4fc; border-left: 3px solid #0dcaf0; color: #055160; }
.pep-chip-ok      { background: #d1e7dd; border-left: 3px solid #198754; color: #0a3622; }
.pep-chip-risk    { background: #f8d7da; border-left: 3px solid #dc3545; color: #58151c; }
.pep-banner-actions {
    display: flex;
    gap: .35rem;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
}

@media (max-width: 991.98px) {
    .pep-banner-row {
        /* No mobile, foto + id ficam na mesma linha; alerts e actions
           empilham embaixo cada um em sua linha (col-span). */
        grid-template-columns: auto 1fr;
        gap: .5rem .75rem;
    }
    .pep-banner-alerts,
    .pep-banner-actions {
        grid-column: 1 / -1;  /* ocupa as duas colunas */
    }
    .pep-banner-actions {
        justify-content: flex-start;
    }
}

