/* P-INST-10A: a UX institucional deixou de ser aba de trabalho e passou a
   viver (a) num teaser compacto dentro do modal "Minha assinatura" e (b) na
   experiência completa (cabeçalho, cards, equipe), aberta a partir do
   teaser, num overlay amplo e independente — não mais espremida em 640px.
   As variáveis de cor precisam existir nos dois pontos de montagem. */
.inst-overlay, #siao-subscription-institucional-section {
    --inst-navy: #0b3c5d;
    --inst-navy-dark: #072b43;
    --inst-amber: #c46a10;
    --inst-green: #1a7a4a;
    --inst-red: #b72020;
    --inst-slate: #5a7a8c;
    --inst-border: #d9e3ea;
    --inst-bg: #f3f6f8;
    color: #172b38;
    font-family: "Segoe UI", Inter, system-ui, sans-serif;
}

.inst-toast-host {
    --inst-navy: #0b3c5d;
    --inst-green: #1a7a4a;
    --inst-red: #b72020;
}

/* Teaser dentro de "Minha assinatura": uma linha discreta com nome da
   organização, selos e um botão que abre a experiência completa no overlay. */
.inst-teaser-msg { margin: 0; color: #64748b; font-size: 12px; line-height: 1.5; }
.inst-teaser-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.inst-teaser-info { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inst-teaser-info strong { color: #0f172a; font-size: 13px; }

/* Overlay amplo aberto a partir do teaser — mesma família visual do modal de
   assinatura (backdrop + painel centralizado), mas dedicado e generoso em
   espaço, sem o limite de ~680px do modal de assinatura. */
.inst-overlay { position: fixed; inset: 0; z-index: 9998; display: grid; place-items: center; padding: 18px; }
.inst-overlay[hidden] { display: none; }
.inst-overlay-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .6); }
.inst-overlay-panel {
    position: relative;
    width: min(1120px, 96vw);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 14px;
    background: var(--inst-bg);
    box-shadow: 0 30px 80px rgba(15, 23, 42, .34);
}
.inst-overlay-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; background: #fff; border-bottom: 1px solid #e2e8f0; }
.inst-overlay-topbar h2 { margin: 2px 0 0; color: var(--inst-navy); font-size: 19px; font-weight: 900; }
.inst-overlay-close { width: 34px; height: 34px; flex: 0 0 auto; border: 1px solid #e2e8f0; border-radius: 9px; background: #fff; color: #475569; cursor: pointer; }
.inst-overlay-close:hover { background: #f1f5f9; }
.inst-overlay-body { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 20px; }

.inst-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    padding: 18px 20px;
    margin-bottom: 14px;
    border: 1px solid #cfdae2;
    border-top: 4px solid var(--inst-navy);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 3px 12px rgba(15, 43, 61, .07);
}
.inst-kicker { color: var(--inst-amber); font-size: 10px; font-weight: 900; letter-spacing: .12em; }
.inst-header h1 { margin: 3px 0 4px; color: var(--inst-navy); font-size: 24px; font-weight: 850; }
.inst-header p { margin: 0; max-width: 720px; color: #607583; font-size: 12px; line-height: 1.45; }
.inst-header__badges { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }

.inst-btn {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 7px 12px;
    border: 1px solid transparent;
    border-radius: 6px;
    font: 700 11px/1.1 "Segoe UI", sans-serif;
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease, transform .16s ease, box-shadow .16s ease;
    white-space: nowrap;
}
.inst-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(15, 43, 61, .14); }
.inst-btn:disabled { opacity: .42; cursor: not-allowed; }
.inst-btn--primary { background: var(--inst-navy); color: #fff; border-color: var(--inst-navy-dark); }
.inst-btn--ghost { background: #fff; color: #34576b; border-color: #afc0cb; }
.inst-btn--danger { color: var(--inst-red); border-color: #e2a9a9; }
.inst-btn--danger:hover:not(:disabled) { background: #fceaea; }

.inst-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; padding: 3px 8px; border: 1px solid; border-radius: 999px; font-size: 9px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
.inst-badge--neutro { background: #eff3f5; border-color: #cad6dc; color: #496574; }
.inst-badge--pendente { background: #fff0e0; border-color: #edc18e; color: #a4550b; }
.inst-badge--ok { background: #e6f4ec; border-color: #a9d4bd; color: #12633b; }
.inst-badge--erro { background: #fceaea; border-color: #e2a9a9; color: var(--inst-red); }

.inst-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-bottom: 14px; }
.inst-mod-card {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
    border: 1px solid #d6e0e6;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 7px rgba(14, 42, 59, .055);
}
.inst-mod-card--bloqueado { background: #fbfbfb; }
.inst-mod-card--em_preparacao { background: #fbfbfb; opacity: .85; }
.inst-mod-card__icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; background: #e6f0f6; color: var(--inst-navy); font-size: 15px; }
.inst-mod-card--bloqueado .inst-mod-card__icon { background: #fceaea; color: var(--inst-red); }
.inst-mod-card--em_preparacao .inst-mod-card__icon { background: #eff3f5; color: var(--inst-slate); }
.inst-mod-card__body { min-width: 0; }
.inst-mod-card__body strong { display: block; margin-bottom: 4px; color: #18374a; font-size: 13px; }
.inst-mod-card__body p { margin: 4px 0 0; color: #718692; font-size: 10.5px; line-height: 1.4; }
.inst-mod-card .inst-btn { align-self: flex-start; margin-top: 2px; }

.inst-equipe { overflow: hidden; border: 1px solid #ccd9e1; border-radius: 10px; background: #fff; box-shadow: 0 3px 12px rgba(15, 43, 61, .07); }
.inst-equipe__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid #d9e3e9; background: #f7f9fa; }
.inst-equipe__bar h2 { margin: 0; color: var(--inst-navy); font-size: 15px; font-weight: 850; }
.inst-equipe__bar h2 small { color: #718692; font-weight: 700; font-size: 11px; }

.inst-form-membro { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid #d9e3e9; background: #f0f5f8; }
.inst-form-membro label { display: flex; flex-direction: column; gap: 4px; font-size: 10px; font-weight: 800; color: #496574; text-transform: uppercase; letter-spacing: .04em; }
.inst-form-membro input, .inst-form-membro select { height: 34px; padding: 0 10px; border: 1px solid #aebfca; border-radius: 6px; background: #fff; color: #17384d; font-size: 12px; min-width: 220px; }
.inst-form-membro__acoes { display: flex; gap: 8px; }

.inst-select { height: 30px; padding: 0 6px; border: 1px solid #aebfca; border-radius: 5px; background: #fff; color: #17384d; font-size: 11px; }

.inst-table-scroll { overflow-x: auto; }
.inst-table { width: 100%; min-width: 640px; border-collapse: separate; border-spacing: 0; font-size: 11.5px; }
.inst-table th { padding: 9px 10px; border-bottom: 1px solid #bccbd4; background: #eaf0f3; color: #274858; font-size: 9px; font-weight: 900; letter-spacing: .025em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.inst-table td { padding: 9px 10px; border-bottom: 1px solid #e2e9ed; background: #fff; vertical-align: middle; }
.inst-table tbody tr:hover td { background: #f2f7fa; }
.inst-table-empty { padding: 26px !important; color: #6b818e; text-align: center !important; }
.inst-cell--acoes { display: flex; gap: 6px; flex-wrap: wrap; }
.inst-self-tag { color: #718692; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.inst-table-note { margin: 0; padding: 8px 14px; color: #718692; font-size: 10.5px; }
.inst-table-note i { margin-right: 5px; color: var(--inst-navy); }

.inst-state, .inst-empty { min-height: 320px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 42px 20px; border: 1px dashed #b9c9d2; border-radius: 12px; background: #fff; color: #657d8b; text-align: center; }
.inst-state > i, .inst-empty > i { color: var(--inst-navy); font-size: 36px; }
.inst-state h2, .inst-empty h2 { max-width: 680px; margin: 0; color: #193b4e; font-size: 19px; }
.inst-state p, .inst-empty p { max-width: 620px; margin: 0 0 8px; font-size: 12px; line-height: 1.5; }
.inst-state--locked > i { color: var(--inst-amber); }
.inst-state--error > i { color: var(--inst-red); }
.inst-empty--compact { min-height: 140px; padding: 20px; }
.inst-spinner { width: 28px; height: 28px; display: inline-block; border: 3px solid #cfdae1; border-top-color: var(--inst-navy); border-radius: 50%; animation: inst-spin .75s linear infinite; }
@keyframes inst-spin { to { transform: rotate(360deg); } }

/* Acima do overlay institucional (9998) e do modal de assinatura (9997),
   para que o toast de uma ação de equipe continue visível nos dois contextos. */
.inst-toast-host { position: fixed; right: 18px; bottom: 18px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.inst-toast { padding: 10px 14px; border-radius: 8px; box-shadow: 0 6px 18px rgba(10, 30, 45, .18); color: #fff; font-size: 12px; font-weight: 700; animation: inst-toast-in .18s ease; }
.inst-toast--sucesso { background: var(--inst-green); }
.inst-toast--erro { background: var(--inst-red); }
@keyframes inst-toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 720px) {
    .inst-header { flex-direction: column; align-items: flex-start; }
    .inst-form-membro input, .inst-form-membro select { min-width: 0; width: 100%; }
    .inst-equipe__bar { flex-direction: column; align-items: flex-start; }
    .inst-overlay { padding: 0; }
    .inst-overlay-panel { width: 100%; max-height: 100vh; height: 100%; border-radius: 0; }
    .inst-teaser-row { flex-direction: column; align-items: flex-start; }
}
