/* ====================================================================
   SISTEMA DE GESTÃO ESCOLAR — ESTILOS GLOBAIS
   Versão: 2.0 — Layout profissional + Mobile-First
   ==================================================================== */

/* ── Reset & Base ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f2f5;
    color: #2c3e50;
    line-height: 1.6;
    font-size: 0.9rem;
}

a {
    text-decoration: none;
    color: #2e86c1;
    transition: color 0.2s;
}
a:hover { color: #1a5276; }

/* ── Layout Principal ─────────────────────────────────────────────── */
.navbar {
    position: fixed !important;
    top: 0 !important; left: 0 !important; right: 0 !important;
    height: 60px !important;
    z-index: 1030 !important;
}

.sidebar {
    position: fixed !important;
    top: 0 !important; left: 0 !important;
    height: 100vh !important;
    width: 260px !important;
    padding-top: 60px !important;
    z-index: 1020 !important;
    background: linear-gradient(180deg, #1a2a3a 0%, #2c3e50 100%);
    color: white;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 3px 0 15px rgba(0,0,0,0.15);
    transition: transform 0.3s ease;
}

.main-content {
    margin-left: 260px !important;
    margin-top: 60px !important;
    padding: 24px !important;
    min-height: calc(100vh - 60px) !important;
    width: calc(100% - 260px) !important;
    overflow-y: auto;
    overflow-x: auto;
}

/* ── Scrollbar ────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 4px; }
::-webkit-scrollbar-thumb { background: #b0bec5; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #78909c; }
* { scrollbar-width: thin; scrollbar-color: #b0bec5 #f1f1f1; }

/* ── Sidebar ──────────────────────────────────────────────────────── */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); }

.menu-section { padding: 6px 12px; margin-bottom: 4px; }

.menu-title {
    color: #f39c12;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    padding: 10px 8px 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.menu-link {
    display: flex;
    align-items: center;
    padding: 7px 10px;
    margin: 1px 0;
    color: rgba(255,255,255,0.82);
    border-radius: 7px;
    font-size: 0.8rem;
    font-weight: 400;
    transition: background 0.18s, color 0.18s, padding-left 0.18s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    gap: 8px;
}

.menu-link:hover {
    background: rgba(255,255,255,0.12);
    color: #ffffff;
    padding-left: 14px;
}

.menu-link.active {
    background: rgba(46,134,193,0.85);
    color: #ffffff;
    font-weight: 600;
    box-shadow: inset 3px 0 0 #f39c12;
}

.menu-link i {
    width: 16px;
    text-align: center;
    font-size: 0.82rem;
    flex-shrink: 0;
    opacity: 0.85;
}

.menu-icon { margin-right: 0; }

.logout-section {
    padding: 12px;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 8px;
}

.logout-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 0;
    font-size: 0.82rem;
    font-weight: 700;
    background: linear-gradient(90deg, #c0392b, #e74c3c);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.18s, transform 0.18s;
    width: 100%;
    text-align: center;
}
.logout-link:hover { opacity: 0.88; transform: translateY(-1px); color: #fff; }

/* Home link (standalone, fora do accordion) */
.menu-home {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    margin: 8px 12px 2px;
    color: rgba(255,255,255,0.85);
    border-radius: 7px;
    font-size: 0.82rem;
    font-weight: 500;
    transition: background 0.18s, color 0.18s;
    white-space: nowrap;
}
.menu-home:hover { background: rgba(255,255,255,0.10); color: #ffffff; }
.menu-home.active { background: rgba(46,134,193,0.85); color: #ffffff; font-weight: 600; box-shadow: inset 3px 0 0 #f39c12; }
.menu-home i { width: 16px; text-align: center; font-size: 0.82rem; flex-shrink: 0; }

/* Accordion toggle (cabeçalho de seção clicável) */
.menu-toggle { cursor: pointer; user-select: none; }
.menu-toggle:hover { background: rgba(255,255,255,0.06); border-radius: 6px; }

/* Seta chevron — rotaciona quando aberto */
.menu-arrow {
    font-size: 0.60rem;
    opacity: 0.50;
    margin-left: auto;
    transition: transform 0.25s ease, opacity 0.25s ease;
    flex-shrink: 0;
}
.menu-toggle[aria-expanded="true"] .menu-arrow { transform: rotate(180deg); opacity: 0.85; }

/* Sub-itens recuados (Editar, Histórico etc.) */
.menu-sub { padding-left: 32px !important; font-size: 0.76rem; opacity: 0.80; }
.menu-sub:hover { opacity: 1; }

/* Contêiner de logout no rodapé da sidebar */
.sidebar-logout {
    padding: 12px;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 8px;
}

/* ── Tipografia Padrão ────────────────────────────────────────────── */
h2 {
    color: #1a3a5c;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0;
}

/* ── Page Header — padrão de título para todas as páginas ─────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e8ecf0;
}

.page-header h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a3a5c;
    margin: 0;
}

.page-header h2 i { color: #2e86c1; font-size: 1.1rem; }

.page-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ── Cards Gerais ─────────────────────────────────────────────────── */
.card-clean {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    border: 1px solid #edf0f4;
}

/* ── Toolbar / Ações de Página ────────────────────────────────────── */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 10px;
    flex-wrap: wrap;
}

.toolbar-left, .toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ── Botões — Sistema Padronizado ─────────────────────────────────── */
/* Botões de ação de tabela (tamanho consistente) */
.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1.5px solid;
    transition: transform 0.12s, box-shadow 0.12s, background 0.12s;
    cursor: pointer;
    white-space: nowrap;
    min-height: 32px;
}
.btn-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}

/* Bootstrap override para btn-sm em mobile */
.btn-sm {
    min-height: 32px;
    padding: 5px 10px;
    font-size: 0.78rem;
}

/* Ícone de ação */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    font-size: 0.9rem;
    border: 1.5px solid;
    transition: transform 0.12s, box-shadow 0.12s;
    cursor: pointer;
}
.btn-icon:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(0,0,0,0.15); }

/* Customização base da cor primary para o tema */
.btn-primary, .btn-primary:focus {
    background: #1a3a5c;
    border-color: #1a3a5c;
    color: white;
}
.btn-primary:hover { background: #154870; border-color: #154870; }

/* ── Classe .button — sistema de botões unificado ─────────────────── */
.button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, background 0.15s, opacity 0.15s;
    text-decoration: none !important;
    white-space: nowrap;
    line-height: 1.4;
    vertical-align: middle;
}
.button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.button:active { transform: translateY(0); box-shadow: none; }

.button.btn-primary {
    background: linear-gradient(135deg, #1a3a5c 0%, #2e86c1 100%);
    border-color: transparent;
    color: #fff !important;
}
.button.btn-primary:hover { opacity: 0.9; color: #fff !important; }

.button.btn-secondary {
    background: #fff;
    border-color: #ccd5de;
    color: #1a3a5c !important;
}
.button.btn-secondary:hover {
    background: #f0f4f8;
    border-color: #1a3a5c;
    color: #1a3a5c !important;
}

.button.btn-danger {
    background: #e74c3c;
    border-color: transparent;
    color: #fff !important;
}
.button.btn-danger:hover { background: #c0392b; color: #fff !important; }

.button.btn-info {
    background: #2e86c1;
    border-color: transparent;
    color: #fff !important;
}
.button.btn-info:hover { background: #1a6fa8; color: #fff !important; }

.button.btn-success {
    background: #27ae60;
    border-color: transparent;
    color: #fff !important;
}
.button.btn-success:hover { background: #1e8449; color: #fff !important; }

.button.btn-warning {
    background: #f39c12;
    border-color: transparent;
    color: #fff !important;
}
.button.btn-warning:hover { background: #d68910; color: #fff !important; }

/* Tamanho pequeno */
.button.btn-sm {
    padding: 5px 13px;
    font-size: 0.78rem;
    border-radius: 6px;
}

/* Bootstrap .btn — arredondamento consistente */
.btn { border-radius: 8px !important; }
.btn.btn-sm { border-radius: 6px !important; }

/* ── Formulários ──────────────────────────────────────────────────── */
.form-aluno, .form-usuario, .form-rfo, .form-ocorrencia, .form-import {
    background: white;
    border-radius: 10px;
    padding: 24px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    max-width: 900px;
    margin: 0 auto;
}

.form-section {
    margin-bottom: 20px;
    padding: 16px;
    border: 1px solid #e8ecf0;
    border-radius: 8px;
    background: #fafbfc;
}

.section-title {
    color: #1a3a5c;
    border-bottom: 2px solid #2e86c1;
    padding-bottom: 8px;
    margin-bottom: 16px;
    font-size: 0.95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 7px;
}
.section-title i { color: #2e86c1; }

.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.input-group-custom {
    flex: 1;
    min-width: 200px;
}

.form-group { margin-bottom: 16px; }

.form-group label,
.input-group-custom label,
label.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #34495e;
    font-size: 0.82rem;
}

.required { color: #e74c3c; font-weight: 700; }

/* Evita zoom no iOS (inputs < 16px disparam zoom automático) */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="search"],
textarea,
select {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid #d1d8e0;
    border-radius: 7px;
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    color: #2c3e50;
    background: white;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #2e86c1;
    box-shadow: 0 0 0 3px rgba(46,134,193,0.12);
}

textarea { resize: vertical; min-height: 90px; }
.help-text { display: block; margin-top: 4px; color: #7f8c8d; font-size: 0.78rem; }

/* Telefones dinâmicos */
.telefone-container { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.telefone-container .telefone-input { flex-grow: 1; }
.btn-add-telefone {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 7px 12px; background: #27ae60; color: white;
    border: none; border-radius: 6px; cursor: pointer;
    font-size: 0.8rem; font-weight: 600; margin-top: 8px;
    transition: background 0.18s;
}
.btn-add-telefone:hover { background: #1e8449; }

.btn-remove {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; background: #e74c3c; color: white;
    border: none; border-radius: 6px; cursor: pointer; flex-shrink: 0;
    font-size: 0.9rem; transition: background 0.18s;
}
.btn-remove:hover { background: #c0392b; }

/* Password toggle */
.password-container { position: relative; }
.password-container input { padding-right: 44px; }
.toggle-password {
    position: absolute; right: 13px; top: 50%;
    transform: translateY(-50%); cursor: pointer;
    color: #95a5a6; transition: color 0.2s;
}
.toggle-password:hover { color: #2e86c1; }

/* ── Tabelas ──────────────────────────────────────────────────────── */
.table-wrapper {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    overflow: hidden;
}

.table-responsive-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Cabeçalho de tabela padrão */
.table > thead > tr > th {
    background: #1a3a5c;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 12px;
    border: none;
    white-space: nowrap;
}

.table > tbody > tr > td {
    padding: 9px 12px;
    font-size: 0.82rem;
    vertical-align: middle;
    border-bottom: 1px solid #f0f3f7;
    color: #2c3e50;
}

.table > tbody > tr:hover { background: #f7f9fc; }
.table > tbody > tr:last-child > td { border-bottom: none; }

/* ── Tabelas → Cards em Mobile ────────────────────────────────────── */
/*
  Uso: adicionar classe "table-mobile-cards" na <table>
  Nas <td>, adicionar atributo data-label="Nome da Coluna"
  O <thead> some em mobile e cada linha vira um card
*/
@media (max-width: 768px) {
    .table-mobile-cards thead { display: none; }

    .table-mobile-cards tbody tr {
        display: block;
        background: white;
        border: 1px solid #e8ecf0;
        border-radius: 10px;
        margin-bottom: 10px;
        padding: 10px 12px;
        box-shadow: 0 1px 4px rgba(0,0,0,0.07);
    }

    .table-mobile-cards tbody td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 10px;
        border: none;
        padding: 5px 0;
        font-size: 0.82rem;
    }

    .table-mobile-cards tbody td::before {
        content: attr(data-label);
        font-weight: 700;
        color: #555;
        font-size: 0.72rem;
        text-transform: uppercase;
        letter-spacing: 0.3px;
        white-space: nowrap;
        min-width: 90px;
        flex-shrink: 0;
    }

    .table-mobile-cards tbody td.td-actions {
        justify-content: flex-end;
        padding-top: 8px;
        border-top: 1px solid #f0f3f7;
        margin-top: 4px;
        gap: 6px;
    }
    .table-mobile-cards tbody td.td-actions::before { display: none; }
}

/* ── Badges ───────────────────────────────────────────────────────── */
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-status.pendente {
    background: #fff3cd; color: #856404; border: 1px solid #ffc107;
}
.badge-status.tratado {
    background: #d4edda; color: #155724; border: 1px solid #28a745;
}
.badge-status.cancelado {
    background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb;
}

.badge-falta {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}
.badge-falta.leve    { background: #d4edda; color: #155724; }
.badge-falta.média   { background: #fff3cd; color: #856404; }
.badge-falta.grave   { background: #f8d7da; color: #721c24; }
.badge-falta.indefinida { background: #e8ecf0; color: #555; }

.badge-reincidencia { display: inline-block; padding: 3px 9px; border-radius: 10px; font-size: 0.72rem; font-weight: 700; }
.badge-reincidencia.sim { background: #f8d7da; color: #721c24; }
.badge-reincidencia.nao { background: #d4edda; color: #155724; }

.badge-nivel {
    padding: 4px 10px; border-radius: 12px;
    font-size: 0.72rem; font-weight: 700; white-space: nowrap;
}
.nivel-1 { background: #e74c3c; color: white; }
.nivel-2 { background: #f39c12; color: white; }
.nivel-3 { background: #2e86c1; color: white; }
.nivel-4 { background: #95a5a6; color: white; }

.badge-current {
    background: #2e86c1; color: white;
    padding: 2px 7px; border-radius: 10px;
    font-size: 0.7rem; font-weight: 700; margin-left: 6px;
}

/* ── Paginação ────────────────────────────────────────────────────── */
.pagination {
    display: flex; justify-content: center; align-items: center;
    gap: 10px; margin-top: 20px; flex-wrap: wrap;
}
.page-link-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 7px 14px; background: #2e86c1; color: white;
    border-radius: 6px; font-weight: 600; font-size: 0.82rem;
    transition: background 0.18s, transform 0.12s;
    border: none; cursor: pointer;
}
.page-link-btn:hover { background: #1a6fa8; transform: translateY(-1px); color: white; }
.page-link-btn.disabled { background: #b0bec5; cursor: not-allowed; pointer-events: none; }
.page-number { font-weight: 600; color: #34495e; font-size: 0.85rem; }

/* ── Flash Messages ───────────────────────────────────────────────── */
.messages {
    position: fixed; top: 70px; right: 16px;
    z-index: 2000; max-width: 360px; min-width: 260px;
}
.msg {
    padding: 12px 16px; border-radius: 8px; margin-bottom: 8px;
    font-weight: 600; font-size: 0.85rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    display: flex; align-items: center; gap: 10px;
    animation: slideInRight 0.25s ease;
}
.msg i { font-size: 1rem; flex-shrink: 0; }
.msg-success { background: #d4edda; color: #155724; border-left: 4px solid #28a745; }
.msg-danger  { background: #f8d7da; color: #721c24; border-left: 4px solid #e74c3c; }
.msg-warning { background: #fff3cd; color: #856404; border-left: 4px solid #ffc107; }
.msg-info    { background: #d1ecf1; color: #0c5460; border-left: 4px solid #17a2b8; }

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

/* ── RFO / Disciplinar ────────────────────────────────────────────── */
.rfo-container {
    display: flex; gap: 24px; max-width: 1200px; margin: 0 auto;
    background: white; padding: 24px; border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}
.rfo-details {
    flex: 1; min-width: 300px; padding-right: 20px;
    border-right: 1px solid #e8ecf0;
}
.rfo-form-area { flex: 2; }

.rfo-details h3, .rfo-form-area h3, .rfo-form-area h4 {
    color: #1a3a5c; font-size: 1rem;
    border-bottom: 2px solid #2e86c1;
    padding-bottom: 8px; margin-bottom: 16px;
}

.detail-item { margin-bottom: 12px; font-size: 0.85rem; color: #34495e; }
.detail-item strong { display: block; color: #1a3a5c; margin-bottom: 2px; font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.3px; }

.rfo-id-display {
    text-align: center; padding: 12px; background: #f0f4f8;
    border-radius: 8px; margin-bottom: 20px; border: 1px solid #d1d8e0;
}
.rfo-id-display h3 { margin: 0; font-size: 1.3rem; color: #1a3a5c; border: none; padding: 0; }
.rfo-id-display span { color: #e74c3c; font-weight: 700; }

/* Autocomplete */
.autocomplete { position: relative; display: inline-block; width: 100%; }
.autocomplete-items {
    position: absolute; z-index: 1050; top: 100%; left: 0; right: 0;
    background: white; border: 1px solid #d1d8e0;
    border-radius: 0 0 7px 7px; max-height: 220px; overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.autocomplete-items div {
    padding: 9px 12px; cursor: pointer; font-size: 0.82rem;
    border-bottom: 1px solid #f0f3f7; color: #2c3e50;
    transition: background 0.1s;
}
.autocomplete-items div:hover, .autocomplete-active {
    background: #e8f4fd; color: #1a3a5c;
}

.info-display {
    padding: 0; margin-top: 8px; border-left: 3px solid #2e86c1;
    background: #f0f7fd; border-radius: 5px; font-size: 0.82rem;
    color: #34495e; opacity: 0; max-height: 0; overflow: hidden;
    transition: all 0.25s ease-in-out;
}
.info-display.show { opacity: 1; max-height: 100px; padding: 9px 12px; }

/* ── Busca / Search ───────────────────────────────────────────────── */
.search-input {
    padding: 8px 14px; border: 1.5px solid #d1d8e0;
    border-radius: 7px; font-size: 0.82rem; transition: border-color 0.2s;
}
.search-input:focus { border-color: #2e86c1; outline: none; box-shadow: 0 0 0 3px rgba(46,134,193,0.12); }

/* ── Erros de Importação ──────────────────────────────────────────── */
.table-errors th, .table-errors td { border: 1px solid #e0e0e0; padding: 10px; font-size: 0.82rem; }
.table-errors tbody tr:hover { background: #fff3cd; }
.error-msg { color: #e74c3c; font-weight: 500; }

/* ── Info Boxes ───────────────────────────────────────────────────── */
.info-box {
    background: #eaf4fd; border: 1px solid #2e86c1;
    border-radius: 8px; margin-bottom: 20px; overflow: hidden;
}
.info-header {
    background: #2e86c1; color: white;
    padding: 12px 20px; display: flex; align-items: center; gap: 8px;
}
.info-header h3 { margin: 0; font-size: 0.95rem; color: white; border: none; padding: 0; }
.info-content { padding: 16px 20px; }

/* ── Login ────────────────────────────────────────────────────────── */
.login-container {
    display: flex; justify-content: center; align-items: center;
    min-height: 100vh; padding: 20px;
}
.login-box {
    background: white; padding: 36px; border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15); width: 100%; max-width: 420px;
    animation: fadeIn 0.4s ease;
}
.login-header { margin-bottom: 24px; text-align: center; }
.login-header h2 { color: #1a3a5c; font-size: 1.4rem; margin: 8px 0 4px; border: none; padding: 0; }
.login-header p { color: #7f8c8d; font-size: 0.85rem; }
.login-form .form-group { text-align: left; }
.btn-login {
    width: 100%; padding: 12px; background: linear-gradient(135deg, #1a3a5c, #2e86c1);
    color: white; border: none; border-radius: 8px; font-size: 1rem;
    font-weight: 600; cursor: pointer; transition: opacity 0.2s, transform 0.15s;
}
.btn-login:hover { opacity: 0.92; transform: translateY(-1px); }
.login-footer { margin-top: 20px; padding-top: 16px; border-top: 1px solid #f0f0f0; text-align: center; }
.forgot-link { color: #2e86c1; font-weight: 600; font-size: 0.9rem; }
.forgot-link:hover { color: #1a5276; text-decoration: underline; }

/* ── Pontuação Status ─────────────────────────────────────────────── */
.badge-nivel { padding: 4px 10px; border-radius: 12px; font-size: 0.72rem; font-weight: 700; }
.nivel-1 { background: #e74c3c; color: white; }
.nivel-2 { background: #f39c12; color: white; }
.nivel-3 { background: #2e86c1; color: white; }
.nivel-4 { background: #95a5a6; color: white; }

/* ── Upload de Arquivo ────────────────────────────────────────────── */
.file-upload-wrapper { position: relative; overflow: hidden; display: inline-block; width: 100%; }
.file-upload-wrapper input[type="file"] { position: absolute; left: 0; top: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.custom-file-upload {
    border: 2px dashed #d1d8e0; background: #fafbfc; color: #555;
    padding: 12px 16px; border-radius: 7px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    font-size: 0.85rem; transition: border-color 0.2s, background 0.2s;
}
.custom-file-upload:hover { border-color: #2e86c1; background: #f0f7fd; }

/* ── Saudação de Usuário ──────────────────────────────────────────── */
.saudacao-usuario {
    background: linear-gradient(90deg, #1a3a5c, #2e86c1);
    color: #fff; font-weight: 600; font-size: 0.9rem;
    border-radius: 8px; padding: 7px 14px; margin-bottom: 12px;
    display: flex; align-items: center; gap: 7px;
    box-shadow: 0 2px 8px rgba(26,58,92,0.15);
}

/* ── Animações ────────────────────────────────────────────────────── */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.fade-in { animation: fadeIn 0.4s ease; }

/* ── Danger Zone ──────────────────────────────────────────────────── */
.danger-zone {
    background: #fff5f5; border: 2px dashed #e74c3c;
    border-radius: 8px; padding: 14px; margin-top: 20px; text-align: center;
}
.danger-zone p { color: #721c24; font-weight: 600; margin-bottom: 8px; font-size: 0.85rem; }

/* ── Tabelas de Listagem (com scroll horizontal em mobile) ─────────── */
.table-scroll-wrapper {
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    background: white; border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    margin-bottom: 20px;
}

/* ── Responsividade Global ────────────────────────────────────────── */
@media (max-width: 768px) {
    /* Sidebar overlay mobile */
    .sidebar {
        transform: translateX(-100%);
        z-index: 1040 !important;
        width: 240px !important;
    }
    .sidebar.show { transform: translateX(0); }

    /* Main content ocupa tela toda */
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 14px !important;
    }

    /* Evitar zoom no iOS */
    input[type="text"],
    input[type="number"],
    input[type="email"],
    input[type="password"],
    input[type="date"],
    input[type="time"],
    input[type="search"],
    textarea,
    select {
        font-size: 16px !important;
    }

    /* Formulários em coluna */
    .form-row { flex-direction: column; gap: 0; }
    .input-group-custom { min-width: 100%; }

    /* Botões maiores para toque (min 44px) */
    .btn, .btn-sm, .btn-action {
        min-height: 40px;
        padding: 8px 14px;
        font-size: 0.82rem;
    }
    .btn-icon { width: 38px; height: 38px; }

    /* Toolbar empilhada */
    .toolbar { flex-direction: column; align-items: stretch; }
    .toolbar-left, .toolbar-right { width: 100%; }

    /* Page header empilhado */
    .page-header { flex-direction: column; align-items: flex-start; }

    /* RFO container empilhado */
    .rfo-container { flex-direction: column; padding: 16px; }
    .rfo-details {
        border-right: none; padding-right: 0;
        border-bottom: 1px solid #e8ecf0; padding-bottom: 16px; margin-bottom: 16px;
        min-width: auto;
    }

    h2 { font-size: 1.1rem; }
    .page-header h2 { font-size: 1.05rem; }

    /* Mensagens centralizadas */
    .messages { max-width: 92%; left: 50%; transform: translateX(-50%); right: auto; top: 68px; }
}

@media (max-width: 480px) {
    .main-content { padding: 10px !important; }
    .form-aluno, .form-usuario, .form-rfo { padding: 14px; }
    .form-section { padding: 12px; }
}

/* ── Impressão ────────────────────────────────────────────────────── */
@media print {
    .sidebar, .sidebar-overlay, .navbar, nav, .no-print, header {
        display: none !important;
    }
    .main-content {
        margin: 0 !important; padding: 0 !important;
        width: 100% !important; height: auto !important;
        overflow: visible !important;
    }
    body { background: white !important; }
}

/* ── Badges de Classificação ICC ─────────────────────────────────── */
.badge-icc {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
.icc-ouro       { background: #fff4cc; color: #7a6000; border: 1px solid #e6c200; }
.icc-prata      { background: #f0f0f0; color: #444;    border: 1px solid #aaa; }
.icc-bronze     { background: #fdebd0; color: #7d3c00; border: 1px solid #c8782a; }
.icc-observacao { background: #fde8e8; color: #b02020; border: 1px solid #e57373; }

/* ── Utility classes — substitutos para style= inline (CSP ADR-003) ─────── */
.u-mt-6  { margin-top: 6px  !important; }
.u-mt-8  { margin-top: 8px  !important; }
.u-mt-10 { margin-top: 10px !important; }
.u-mt-12 { margin-top: 12px !important; }
.u-fs-75 { font-size: .75rem !important; }
.u-fs-78 { font-size: .78rem !important; }
.u-fs-80 { font-size: .80rem !important; }
.u-fs-82 { font-size: .82rem !important; }
.u-fs-85 { font-size: .85rem !important; }
.u-fs-87 { font-size: .87rem !important; }
.u-fs-88 { font-size: .88rem !important; }
.u-fs-90 { font-size: .90rem !important; }
.u-mw-120 { min-width: 120px !important; }
.u-mw-140 { min-width: 140px !important; }
.u-mw-150 { min-width: 150px !important; }
.u-mw-200 { min-width: 200px !important; }
.u-mw-220 { min-width: 220px !important; }
.u-mxw-220 { max-width: 220px !important; }
.u-w-100px { width: 100px !important; }
.u-color-gray { color: var(--gray) !important; }
.u-color-888  { color: #888 !important; }
.u-flex-1 { flex: 1 !important; }
.u-pos-rel { position: relative !important; }

/* ── Utility classes — 2ª passagem (CSP ADR-003) ────────────────────────── */
/* Single-property simples */
.u-mw-250 { min-width: 250px !important; }
.u-mw-300 { min-width: 300px !important; }
.u-mxw-200 { max-width: 200px !important; }
.u-mxw-520 { max-width: 520px !important; }
.u-mxw-600 { max-width: 600px !important; }
.u-mxw-700 { max-width: 700px !important; }
.u-w-40   { width: 40px  !important; }
.u-w-110  { width: 110px !important; }
.u-w-120  { width: 120px !important; }
.u-w-130  { width: 130px !important; }
.u-w-160  { width: 160px !important; }
.u-w-auto { width: auto  !important; }
.u-mb-18  { margin-bottom: 18px !important; }
.u-mt-20  { margin-top: 20px   !important; }
.u-mt-24  { margin-top: 24px   !important; }
.u-flex-2 { flex: 2 !important; }
.u-fs-70  { font-size: .70rem  !important; }
.u-fs-72  { font-size: .72rem  !important; }
.u-fs-11  { font-size: 11px    !important; }
.u-fs-13  { font-size: 13px    !important; }
.u-fs-2r  { font-size: 2rem    !important; }
.u-fs-95e { font-size: 0.95em  !important; }
.u-img-cover-300 { max-height: 300px; object-fit: cover !important; }

/* Multi-property compostos (4+ usos) */
.u-w-full-box  { width: 100%; box-sizing: border-box !important; }
.u-w-full-frame { width: 100%; border: 0; min-height: 700px !important; }
.u-flex-row-wrap { display: flex; gap: 8px; align-items: center; flex-wrap: wrap !important; }
.u-flex-1-mw180 { flex: 1; min-width: 180px; text-align: center !important; }
.u-scroll-200  { max-height: 200px; overflow-y: auto !important; }
.u-signature   { height: 40px; border-bottom: 1px solid #000; margin-bottom: 6px !important; }
.u-badge-sm    { font-size: 0.75rem; padding: 4px 8px !important; }
.u-w40-center  { width: 40px; text-align: center !important; }
.u-link-help   { text-decoration: none; cursor: help !important; }
.u-bg-light-border { background: #f8f9fa; border: 1px solid #dee2e6 !important; }

/* ── Utility classes — 3ª passagem ──────────────────────────────────────── */
.u-mb-8   { margin-bottom: 8px !important; }
.u-mb-15  { margin-bottom: 15px !important; }
.u-ml-5   { margin-left: 5px !important; }
.u-ml-8   { margin-left: 8px !important; }
.u-mr-4   { margin-right: 4px !important; }
.u-mr-12  { margin-right: 12px !important; }
.u-mt-16  { margin-top: 16px !important; }
.u-fs-55  { font-size: .55rem !important; }
.u-fs-70r { font-size: 0.7rem !important; }
.u-fs-76  { font-size: 0.76rem !important; }
.u-fs-80e { font-size: 0.8em !important; }
.u-fs-9pt { font-size: 9pt !important; }
.u-fs-10pt { font-size: 10pt !important; }
.u-ls-05  { letter-spacing: .05em !important; }
.u-ls-06  { letter-spacing: .06em !important; }
.u-tt-upper { text-transform: uppercase !important; }
.u-cursor-ns { cursor: pointer; user-select: none !important; }
.u-color-gold2  { color: #e6a817 !important; }
.u-color-orange { color: #e67e22 !important; }
.u-color-green2 { color: #27ae60 !important; }
.u-flex-0-150 { flex: 0 0 150px !important; }
.u-flex-0-100 { flex: 0 0 100px !important; }
.u-border-blue  { border-left: 4px solid #0d6efd !important; }
.u-border-gold  { border-color: var(--gold); background: #fffdf0 !important; }
.u-btn-dark { background: #0B1F3A; border-radius: 12px; padding: 14px 22px; display: inline-block; margin-bottom: 8px !important; }
/* Grupos flex */
.u-flex-gap10  { gap: 10px; flex-wrap: wrap !important; }
.u-flex-gap6   { gap: 6px; margin-left: 8px !important; }
.u-flex-center { display: flex; gap: 8px; justify-content: center; align-items: center !important; }
.u-flex-end    { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px !important; }
.u-flex-none-col { display: none; flex-direction: column; gap: 4px !important; }
/* Misc compostos */
.u-tag-fade    { color: #6c757d; font-size: 0.75rem; transition: transform 0.2s !important; }
.u-bar-bg      { background: #e9ecef; height: 26px; flex: 1; border-radius: 4px !important; }
.u-num-right   { width: 42px; font-size: .82rem; text-align: right !important; }
.u-col-label   { width: 110px; font-size: .85rem; font-weight: 600 !important; }
.u-col-label2  { width: 160px; font-size: .85rem; font-weight: 600 !important; }
.u-scroll-280  { max-height: 280px; overflow: auto; margin-left: 16px !important; }
.u-img-thumb   { max-width: 100%; max-height: 120px; border: 1px solid #ddd; padding: 4px !important; }
.u-info-box    { padding: 10px 16px; border: 1px solid #ddd; background: #f7f7f7; border-radius: 6px; cursor: pointer !important; }
.u-green-border { color: #27ae60; border-color: #27ae60 !important; }
.u-nowrap-85   { white-space: nowrap; font-size: 0.85rem !important; }
.u-badge-xs    { font-size: .75rem; letter-spacing: .06em !important; }
.u-fs-76-mt4   { font-size: 0.76rem; margin: 4px 0 0 !important; }

/* ── Utility classes — 4ª passagem (finalização count>=2) ───────────────── */
.u-color-orange2 { color: #f39c12 !important; }
.u-color-blue2   { color: #1a3a5c !important; }
.u-color-blue3   { color: #2e86c1 !important; }
.u-color-gray2   { color: #7f8c8d !important; }
.u-bg-navy       { background: #1a3a5c !important; }
.u-bg-navy-white { background-color: #1a3a5c; color: #fff !important; }
.u-bg-purple     { background: #7b2fbe; color: #fff !important; }
.u-w-80   { width: 80px !important; }
.u-w-90   { width: 90px !important; }
.u-w-60x60 { width: 60px; height: 60px !important; }
.u-h-18   { height: 18px !important; }
.u-mt-0   { margin-top: 0 !important; }
.u-mt-4   { margin-top: 4px !important; }
.u-mt-14  { margin-top: 14px !important; }
.u-mt-18  { margin-top: 18px !important; }
.u-mt-30  { margin-top: 30px !important; }
.u-mb-12  { margin-bottom: 12px !important; }
.u-mr-5   { margin-right: 5px !important; }
.u-mr-6   { margin-right: 6px !important; }
.u-m-18-0 { margin: 18px 0 !important; }
.u-m-6-0  { margin: 6px 0 0 !important; }
.u-fw-700 { font-weight: 700 !important; }
.u-fs-93  { font-size: .93rem !important; }
.u-fs-8pt-888 { font-size: 8pt; color: #888; text-align: left; max-width: 160px !important; }
.u-fs-80d-link { font-size: 0.8rem; text-decoration: none !important; }
.u-wrap-pre { white-space: pre-wrap !important; }
.u-cursor-default { cursor: default !important; }
.u-cursor-grab    { cursor: grab !important; }
.u-mw-28  { min-width: 28px !important; }
.u-mw-360 { max-width: 360px !important; }
.u-mw-680 { max-width: 680px !important; }
.u-mw-720 { max-width: 720px; margin-left: auto; margin-right: auto !important; }
.u-mw-1200 { max-width: 1200px; margin: 20px auto !important; }
.u-mh-50b  { min-height: 50px; display: block !important; }
.u-mh-80b  { min-height: 80px; display: block !important; }
.u-mh-220  { min-height: 220px; background: #fff !important; }
.u-img-80  { max-width: 80px; margin-right: 6px; vertical-align: middle !important; }
.u-img-80n { max-width: 80px; vertical-align: middle !important; }
.u-card-white { background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.04) !important; }
.u-card-btn   { padding: 10px 16px; border: 1px solid #ddd; background: #fff; border-radius: 6px; cursor: pointer !important; }
.u-pad-text   { padding: 10px 14px; color: #888; font-size: .9em !important; }
.u-modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 9999; align-items: center; justify-content: center !important; }
.u-modal-box  { background: #fff; border-radius: 8px; padding: 28px 32px; width: 100%; max-width: 500px; box-shadow: 0 8px 32px rgba(0,0,0,.18) !important; }
.u-italic-gray { margin-top: 8px; color: #7f8c8d; font-size: 0.85em; font-style: italic !important; }
.u-gray-mt5   { color: #7f8c8d; margin-top: 5px !important; }
.u-border-row { border-color: #e8eaed; margin: 12px 0 !important; }
.u-flex-end-mb { display: flex; justify-content: flex-end; margin-bottom: 12px !important; }
.u-flex-gap10-mb { display: flex; gap: 10px; margin-bottom: 15px !important; }
.u-flex-end-mt10 { display: flex; gap: 10px; justify-content: flex-end; margin-top: 10px !important; }
.u-flex-center2  { display: flex; justify-content: space-around; margin-top: 30px !important; }
.u-flex-center3  { margin-top: 14px; display: flex; align-items: center; justify-content: center; gap: 10px !important; }
.u-btn-navy { background: #0B1F3A; border-radius: 12px; padding: 14px 22px; display: inline-block; margin-bottom: 8px !important; }
