/* beneficiarios.css — estilos da tela /privado/projetos/capes-global/beneficiarios/ */

body { background: var(--color-surface); }

.bn-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px var(--space-md) 80px;
}

.bn-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}
.bn-header h1 { font-size: 22px; font-weight: 500; color: var(--color-text); margin: 0 0 4px; }
.bn-header .subt { font-size: 13px; color: var(--color-text-muted); margin: 0; }

.bn-papel-ativo {
    font-size: 11px;
    color: var(--color-text-muted);
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    white-space: nowrap;
}

.bn-rede-host { margin: 12px 0 20px; }

/* ── KPIs ────────────────────────────────────────────────── */
.bn-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.bn-kpi {
    background: var(--color-bg);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
}
.bn-kpi .label { font-size: 11px; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
.bn-kpi .val { font-size: 22px; font-weight: 600; color: var(--color-text); line-height: 1.2; }
.bn-kpi .sub { font-size: 11px; color: var(--color-text-muted); margin-top: 2px; }
.bn-kpi--alerta .val { color: var(--color-negative); }

/* ── Filtros ─────────────────────────────────────────────── */
.bn-filtros {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.bn-filtros select, .bn-filtros .bn-busca {
    height: 34px;
    padding: 0 12px;
    font-size: 13px;
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-sm);
    background: var(--color-bg);
    color: var(--color-text);
}
.bn-filtros select { min-width: 0; flex: 0 1 auto; max-width: 180px; }
.bn-filtros .bn-busca { flex: 1 1 200px; min-width: 180px; max-width: 280px; }

.bn-acao-row {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}
.bn-btn-novo {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    background: var(--color-primary);
    border: none;
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    cursor: pointer;
    transition: background .2s;
}
.bn-btn-novo:hover { background: var(--color-primary-hover, var(--color-primary)); filter: brightness(0.95); }

/* ── Tabela ──────────────────────────────────────────────── */
.bn-tabela-wrap {
    background: var(--color-bg);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.bn-tabela {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.bn-tabela thead th {
    text-align: left;
    padding: 10px 12px;
    font-size: 11px;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border-light);
    font-weight: 600;
}
.bn-tabela tbody td {
    padding: 12px;
    border-bottom: 1px solid var(--color-border-light);
    vertical-align: middle;
    color: var(--color-text);
}
.bn-tabela tbody tr { cursor: pointer; transition: background .15s; }
.bn-tabela tbody tr:hover { background: var(--color-surface); }
.bn-tabela tbody tr.bn-pendente {
    background: rgba(192, 57, 43, 0.04);
    box-shadow: inset 3px 0 0 var(--color-negative);
}
.bn-tabela tbody tr.bn-pendente:hover { background: rgba(192, 57, 43, 0.08); }

.bn-vazio { text-align: center; padding: 32px 12px !important; color: var(--color-text-muted) !important; }

.bn-nome-cell { display: flex; align-items: center; gap: 10px; }
.bn-avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--color-primary-light, #e6f1fb);
    color: var(--color-primary);
    font-size: 11px;
    font-weight: 600;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.bn-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 500;
    background: var(--color-surface);
    color: var(--color-text-mid);
    border: 1px solid var(--color-border-light);
}
.bn-chip--vinculo-docente  { background: #E6F1FB; color: #0C447C; border-color: transparent; }
.bn-chip--vinculo-discente { background: #EEEDFE; color: #3C3489; border-color: transparent; }
.bn-chip--vinculo-tecnico  { background: #E8F5E9; color: #2E7D32; border-color: transparent; }
.bn-chip--vinculo-externo  { background: #FFF3E0; color: #E65100; border-color: transparent; }

.bn-projetos-cell { display: flex; gap: 4px; flex-wrap: wrap; max-width: 220px; }
.bn-projetos-cell .bn-chip { font-size: 10px; padding: 2px 6px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.bn-check-icon { font-size: 14px; }
.bn-check-icon.ok   { color: var(--color-positive, #2E7D32); }
.bn-check-icon.miss { color: var(--color-negative, #C0392B); }

.bn-bolsa-status { font-size: 11px; }
.bn-bolsa-status.ativa    { color: var(--color-positive, #2E7D32); font-weight: 500; }
.bn-bolsa-status.expirada { color: var(--color-text-muted); }
.bn-bolsa-status.sem      { color: var(--color-text-disabled, var(--color-text-muted)); font-style: italic; }

.bn-acoes { display: flex; gap: 6px; }
.bn-acao-btn {
    background: none;
    border: 1px solid var(--color-border-light);
    color: var(--color-text-muted);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all .15s;
}
.bn-acao-btn:hover { color: var(--color-primary); border-color: var(--color-primary); }
.bn-acao-btn--danger:hover { color: var(--color-negative); border-color: var(--color-negative); }

/* ── Modal ───────────────────────────────────────────────── */
.bn-modal {
    border: none;
    padding: 0;
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: calc(100% - 32px);
    max-height: calc(100vh - 40px);
    background: var(--color-bg);
    color: var(--color-text);
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
.bn-modal::backdrop { background: rgba(0,0,0,0.45); }

.bn-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 24px 12px;
    border-bottom: 1px solid var(--color-border-light);
}
.bn-modal-head h2 { font-size: 17px; margin: 0 0 4px; font-weight: 600; color: var(--color-text); }
.bn-modal-head .sub { font-size: 12px; color: var(--color-text-muted); }
.bn-modal-head .close {
    background: none; border: none; color: var(--color-text-muted);
    font-size: 16px; cursor: pointer; padding: 4px 8px; border-radius: var(--radius-sm);
}
.bn-modal-head .close:hover { color: var(--color-text); background: var(--color-surface); }

.bn-modal-body {
    padding: 16px 24px;
    overflow-y: auto;
    max-height: calc(100vh - 180px);
}

.bn-form-secao { margin-bottom: 18px; }
.bn-form-secao-titulo {
    font-size: 11px;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    margin-bottom: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--color-border-light);
}
.bn-form-secao:first-child .bn-form-secao-titulo { padding-top: 0; border-top: none; }

.bn-form-grupo { margin-bottom: 10px; }
.bn-form-grupo label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 4px;
}
.bn-form-grupo label .req { color: var(--color-negative); }
.bn-form-grupo input,
.bn-form-grupo select,
.bn-form-grupo textarea {
    width: 100%;
    height: 36px;
    padding: 0 12px;
    font-size: 13px;
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-sm);
    background: var(--color-bg);
    color: var(--color-text);
    box-sizing: border-box;
}
.bn-form-grupo input:disabled {
    background: var(--color-surface);
    color: var(--color-text-muted);
    cursor: not-allowed;
}
.bn-form-grupo input[readonly] { background: var(--color-surface); }
.bn-form-grupo .dica { font-size: 11px; color: var(--color-text-muted); margin-top: 4px; line-height: 1.4; }
.bn-form-grupo .erro { font-size: 11px; color: var(--color-negative); margin-top: 4px; display: none; }
.bn-form-grupo.has-erro input,
.bn-form-grupo.has-erro select { border-color: var(--color-negative); }
.bn-form-grupo.has-erro .erro { display: block; }

.bn-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.bn-bolsa-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    user-select: none;
    margin-bottom: 10px;
}
.bn-bolsa-toggle input { width: auto; height: auto; margin: 0; }
.bn-bolsa-campos { display: none; }
.bn-bolsa-campos.open { display: block; }

.bn-projetos-selecionados {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}
.bn-projeto-linha {
    display: grid;
    grid-template-columns: 1fr 160px 32px;
    gap: 8px;
    align-items: center;
}
.bn-projeto-linha button.remover {
    background: none; border: 1px solid var(--color-border-light);
    color: var(--color-negative);
    border-radius: var(--radius-sm);
    cursor: pointer;
    height: 36px;
}
.bn-btn-add-projeto {
    background: none;
    border: 1px dashed var(--color-primary);
    color: var(--color-primary);
    border-radius: var(--radius-sm);
    font-size: 12px;
    padding: 8px 12px;
    cursor: pointer;
    width: 100%;
}

.bn-modal-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 24px;
    border-top: 1px solid var(--color-border-light);
    background: var(--color-surface);
}
.bn-pend-hint { font-size: 11px; color: var(--color-text-muted); flex: 1; }
.bn-pend-hint.has-pend { color: var(--color-negative); }
.bn-modal-foot-btns { display: flex; gap: 8px; }
.bn-btn {
    font-size: 13px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 1px solid transparent;
}
.bn-btn--cancel {
    background: transparent;
    color: var(--color-text-muted);
    border-color: var(--color-border-light);
}
.bn-btn--cancel:hover { color: var(--color-text); }
.bn-btn--primary {
    background: var(--color-primary);
    color: #fff;
}
.bn-btn--primary:hover { filter: brightness(0.95); }
.bn-btn--primary:disabled { opacity: 0.5; cursor: not-allowed; }

.bn-erro-geral {
    margin: 8px 24px 0;
    padding: 10px 12px;
    background: rgba(192, 57, 43, 0.08);
    border: 1px solid var(--color-negative);
    border-radius: var(--radius-sm);
    color: var(--color-negative);
    font-size: 12px;
    display: none;
}
.bn-erro-geral.visivel { display: block; }

/* ── Separador de seção no modal (diversidade) ─────────────── */
.bn-form-separador {
    margin: 20px 0 12px;
    padding: 12px 0 8px;
    border-top: 1px solid var(--color-border-light);
}
.bn-form-separador h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 2px;
}
.bn-form-separador .dica {
    font-size: 11px;
    color: var(--color-text-muted);
    margin: 0;
}

/* ── Badges de diversidade na tabela ─────────────────────── */
.bn-diversidade-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    min-width: 80px;
}
.bn-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 500;
    padding: 2px 7px;
    border-radius: var(--radius-pill);
    white-space: nowrap;
}
.bn-badge-genero {
    background: var(--color-surface);
    color: var(--color-text-muted);
    font-size: 12px;
    padding: 1px 5px;
}
.bn-badge-pcd {
    background: #EEEDFE;
    color: #534AB7;
}
html.darkmode .bn-badge-pcd {
    background: #26215C;
    color: #AFA9EC;
}
.bn-badge-licenca {
    background: #FFF8E1;
    color: #6D4C00;
}
html.darkmode .bn-badge-licenca {
    background: #3A2F00;
    color: #FFD54F;
}

/* ── Dark mode ──────────────────────────────────────────── */
html.darkmode .bn-kpi {
    background: var(--color-surface);
    border-color: var(--color-border);
}
html.darkmode .bn-tabela-wrap {
    background: var(--color-surface);
    border-color: var(--color-border);
}
html.darkmode .bn-tabela thead th {
    background: var(--color-bg);
    border-color: var(--color-border);
}
html.darkmode .bn-tabela tbody td {
    border-color: var(--color-border);
}
html.darkmode .bn-tabela tbody tr:hover {
    background: var(--color-surface-alt, #2D2D2D);
}
html.darkmode .bn-tabela tbody tr.bn-pendente {
    background: rgba(192, 57, 43, 0.10);
}
html.darkmode .bn-tabela tbody tr.bn-pendente:hover {
    background: rgba(192, 57, 43, 0.16);
}

/* Avatar */
html.darkmode .bn-avatar {
    background: rgba(78,201,176,0.15);
    color: #4EC9B0;
}

/* Vínculo badges */
html.darkmode .bn-chip--vinculo-docente {
    background: rgba(78,201,176,0.15);
    color: #4EC9B0;
}
html.darkmode .bn-chip--vinculo-discente {
    background: rgba(159,139,209,0.18);
    color: #B8A9E8;
}
html.darkmode .bn-chip--vinculo-tecnico {
    background: rgba(46,125,50,0.18);
    color: #81C784;
}
html.darkmode .bn-chip--vinculo-externo {
    background: rgba(245,127,23,0.18);
    color: #FFB74D;
}

/* Project chip */
html.darkmode .bn-chip {
    background: var(--color-surface-alt, #2D2D2D);
    border-color: var(--color-border);
    color: var(--color-text-mid);
}

/* Bolsa status */
html.darkmode .bn-bolsa-status.ativa {
    color: #4EC9B0;
}

/* Filtros */
html.darkmode .bn-filtros select,
html.darkmode .bn-filtros .bn-busca {
    background: var(--color-surface);
    border-color: var(--color-border);
    color: var(--color-text);
}

/* Modal */
html.darkmode .bn-modal {
    background: var(--color-surface);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
html.darkmode .bn-modal-head {
    border-color: var(--color-border);
}
html.darkmode .bn-modal-foot {
    background: var(--color-bg);
    border-color: var(--color-border);
}
html.darkmode .bn-form-grupo input,
html.darkmode .bn-form-grupo select,
html.darkmode .bn-form-grupo textarea {
    background: var(--color-bg);
    border-color: var(--color-border);
    color: var(--color-text);
}
html.darkmode .bn-form-grupo input:disabled,
html.darkmode .bn-form-grupo input[readonly] {
    background: var(--color-surface-alt, #2D2D2D);
}
html.darkmode .bn-bolsa-toggle {
    background: var(--color-bg);
    border-color: var(--color-border);
}
html.darkmode .bn-form-separador {
    border-color: var(--color-border);
}
html.darkmode .bn-form-secao-titulo {
    border-color: var(--color-border);
}
html.darkmode .bn-btn--cancel {
    border-color: var(--color-border);
    color: var(--color-text-muted);
}
html.darkmode .bn-btn--cancel:hover {
    color: var(--color-text);
}
html.darkmode .bn-projeto-linha button.remover {
    border-color: var(--color-border);
}
html.darkmode .bn-btn-add-projeto {
    border-color: #4EC9B0;
    color: #4EC9B0;
}
html.darkmode .bn-btn-novo,
html.darkmode .bn-btn--primary {
    background: rgba(78,201,176,0.12);
    color: #4EC9B0;
    border: 1px solid rgba(78,201,176,0.30);
}
html.darkmode .bn-btn-novo:hover,
html.darkmode .bn-btn--primary:hover {
    background: rgba(78,201,176,0.20);
    color: #5ED5BC;
    filter: none;
}

@media (max-width: 720px) {
    .bn-form-row { grid-template-columns: 1fr; }
    .bn-projeto-linha { grid-template-columns: 1fr; }
    .bn-tabela thead th:nth-child(5),
    .bn-tabela thead th:nth-child(6),
    .bn-tabela thead th:nth-child(8),
    .bn-tabela tbody td:nth-child(5),
    .bn-tabela tbody td:nth-child(6),
    .bn-tabela tbody td:nth-child(8) { display: none; }
}
