/* =====================================================================
   Ocorrências — Estilos globais
   ===================================================================== */

:root {
    --brand-blue: #003366;
    --brand-blue-light: #0055a4;
    --bs-primary: var(--brand-blue);
    --bs-primary-rgb: 0, 51, 102;
}

body {
    background-color: #f5f6fa;
    font-family: 'Roboto', system-ui, -apple-system, sans-serif;
}

input, select, textarea, button,
.form-control, .form-select,
.swal2-popup {
    font-family: 'Roboto', system-ui, -apple-system, sans-serif;
}

/* Login */
.login-page {
    background-image: url('/static/imagens/bg_1.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 100vh;
}

.login-card {
    width: 100%;
    max-width: 420px;
    border-radius: 16px;
    border: none;
    background: rgba(255, 255, 255, 0.97);
}

.login-logo img {
    height: 56px;
    width: auto;
}

.btn-google {
    border-color: #dadce0;
    color: #3c4043;
    font-weight: 500;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.btn-google:hover {
    background-color: #f8f9fa;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    border-color: #bdc1c6;
    color: #3c4043;
}

/* Navbar */
.navbar.bg-primary {
    background-color: var(--brand-blue) !important;
}

/* Cards */
.card {
    border-radius: 12px;
}

/* Input de busca refinado (usado em Estudantes e telas similares) */
.search-input {
    border-radius: 0.75rem;
}
.search-input:focus {
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.2);
}

/* Badges */
.badge.rounded-pill {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.35em 0.75em;
}

/* Matriz de permissões */
.perm-select {
    appearance: none;
    border: none;
    border-radius: 6px;
    padding: 0.3rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    min-width: 110px;
    text-align: center;
    transition: opacity 0.15s;
}
.perm-select:focus { outline: 2px solid var(--brand-blue); outline-offset: 1px; }
.perm-select:disabled { opacity: 0.5; cursor: default; }

.perm-select[data-nivel="completo"]    { background:#198754; color:#fff; }
.perm-select[data-nivel="proprio"]     { background:#0dcaf0; color:#000; }
.perm-select[data-nivel="col_fil"]     { background:#ffc107; color:#000; }
.perm-select[data-nivel="seg"]         { background:#fd7e14; color:#fff; }
.perm-select[data-nivel="ser"]         { background:#d96800; color:#fff; }
.perm-select[data-nivel="tur"]         { background:#b85000; color:#fff; }
.perm-select[data-nivel="est"]         { background:#c04040; color:#fff; }
.perm-select[data-nivel="sem_acesso"]  { background:#dc3545; color:#fff; }

.perm-category-header td {
    background: #212529;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    padding: 0.35rem 0.75rem;
}

.perm-table th {
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    background: #f8f9fa;
}

.perm-table td {
    vertical-align: middle;
    padding: 0.45rem 0.65rem;
}

.saving-indicator {
    font-size: 0.78rem;
    min-height: 1.4em;
}

/* Card retrátil de Ocorrências (detalhe do estudante e busca de estudantes) */
#btnToggleOcorrencias .chevron { transition: transform .2s ease; }
#btnToggleOcorrencias:not(.collapsed) .chevron { transform: rotate(90deg); }
.ocorrencia-view-btn { color:#6c757d; }
.ocorrencia-view-btn.active { background:#fff; box-shadow:0 1px 2px rgba(0,0,0,.08); color:var(--brand-blue); }
.ocorrencia-card:hover { border-color:#93c5fd !important; box-shadow:0 .25rem .5rem rgba(0,0,0,.08); }
.ocorrencia-card-relato {
    display:-webkit-box; -webkit-line-clamp:3; line-clamp:3; -webkit-box-orient:vertical; overflow:hidden;
}


/* Conferência de acessos (matriz usuário × escola) */
.acessos-scroll {
    max-height: calc(100vh - 290px);
    min-height: 320px;
    overflow: auto;
}
.acessos-table { font-size: 0.75rem; }
.acessos-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f1f3f7;
    font-weight: 600;
    vertical-align: bottom;
}
.acessos-table .col-usuario {
    position: sticky;
    left: 0;
    z-index: 1;
    background: #fff;
    min-width: 220px;
    max-width: 260px;
}
.acessos-table thead th.col-usuario { z-index: 3; background: #f1f3f7; }
.acessos-table .col-escola { min-width: 150px; }
.acessos-table .col-escola.col-destaque { background: #dbe7f5; }
.acessos-table td { vertical-align: top; }
.celula-escola { background: #f3f9f4; line-height: 1.3; }
.celula-alerta { background: #fdecec; }
.celula-alunos { color: #6c757d; font-size: 0.68rem; margin-top: 2px; }
.celula-alerta .celula-alunos { color: #b02a37; font-weight: 600; }
.acessos-table .col-alertas { min-width: 200px; max-width: 260px; }
.acessos-table td.col-alertas { color: #9a5b00; }
.acessos-table .col-resumo { min-width: 190px; max-width: 240px; font-size: 0.7rem; }
.celula-vazia { color: #ced4da; text-align: center; }
.celula-global { background: #e8eef7; color: var(--brand-blue); font-weight: 500; vertical-align: middle; }


/* ---------------------------------------------------------------------------
   Perfil do aluno — faixa de atalhos e Dados adicionais
   (ícones em app/templates/dados_adicionais/_icones.html; cor via currentColor)
   --------------------------------------------------------------------------- */
.da-atalho {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    width: 100%;
    height: 100%;
    min-height: 128px;
    padding: 1rem .75rem;
    border: none;
    border-radius: .9rem;
    background: #fff;
    color: #374151;
    font-size: .9rem;
    font-weight: 500;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 .125rem .5rem rgba(0, 0, 0, .12);
    transition: transform .15s ease, box-shadow .15s ease;
}
.da-atalho:hover, .da-atalho:focus-visible {
    color: #111827;
    transform: translateY(-2px);
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .18);
}
.da-atalho-icone {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    flex-shrink: 0;
}
.da-atalho-primario { background: var(--brand-blue); color: #fff; font-weight: 600; }
.da-atalho-primario:hover, .da-atalho-primario:focus-visible { color: #fff; }
.da-atalho-primario .da-atalho-icone { background: rgba(255, 255, 255, .2); color: #fff; }
.da-atalho-book-open .da-atalho-icone      { background: #eef2ff; color: #4f46e5; }
.da-atalho-file-text .da-atalho-icone      { background: #ecfdf5; color: #059669; }
.da-atalho-bar-chart .da-atalho-icone      { background: #eff6ff; color: #2563eb; }
.da-atalho-graduation-cap .da-atalho-icone { background: #fffbeb; color: #d97706; }
.da-atalho-info .da-atalho-icone           { background: #f5f3ff; color: #7c3aed; }

/* NPS (badge) e situação financeira (indicador) no card do responsável */
.da-nps { font-size: .6rem; font-weight: 600; }
.da-nps-promotor { background: #dcfce7; color: #166534; }
.da-nps-neutro   { background: #fef9c3; color: #854d0e; }
.da-nps-detrator { background: #fee2e2; color: #991b1b; }
.da-financeiro { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .85); }
.da-financeiro-em_dia       { background: #22c55e; }
.da-financeiro-atencao      { background: #eab308; }
.da-financeiro-inadimplente { background: #ef4444; }

/* Versão implantada — selo discreto no canto, sem ocupar espaço no layout nem capturar cliques */
.app-versao {
    position: fixed;
    right: .5rem;
    bottom: .35rem;
    z-index: 1030;
    font-size: .65rem;
    color: #6c757d;
    opacity: .7;
    pointer-events: none;
}
@media print { .app-versao { display: none; } }
