/* ====== MATRICULAS ====== */
#matricula { padding: 20px; }

/* TITULO + SUBTITULO + BOTAO */
#matricula .titulo {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 10px 0 20px; margin-bottom: 20px;
}
#matricula .titulo h2 {
    display: flex; align-items: center; gap: 12px;
    font-size: 24px; font-weight: 700; color: #2f0375; margin: 0;
}
#matricula .titulo h2 i { color: #7163ba; font-size: 24px; }
#matricula .subtitulo {
    font-size: 13px; color: #6b7280; margin: 4px 0 0 36px;
}

/* BOTOES MENORES */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    border: none; border-radius: 8px; font-weight: 700;
    cursor: pointer; transition: all 0.2s ease;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(15,23,42,0.08);
}
.btn-sm {
    height: 35px; padding: 0 14px; font-size: 14px; width: 150px;
}
.btn-primary {
    background: linear-gradient(135deg, #8978df 0%, #7163ba 100%);
    color: #fff;
    box-shadow: 0 6px 18px rgba(137, 120, 223, 0.25);
}
.btn-primary:hover { background: linear-gradient(135deg, #7163ba 0%, #635996 100%); transform: translateY(-1px); }
.btn-outline {
    background-color: #f9fafb; color: #6b7280;
    border: 1px solid #d1d5db;
    box-shadow: 0 4px 12px rgba(148,163,184,0.12);
}
.btn-outline:hover { background-color: #f3f4f6; color: #374151; border-color: #9ca3af; }
.btn i { font-size: 16px; }
.modal-matricula .btn-prev,
.modal-matricula .btn-cancel,
.modal-matricula .btn-editar {
    background:#f1f5f9;
    color:#1e293b;
    border:1px solid #dfe7f3;
    box-shadow:0 5px 14px rgba(15,23,42,0.08);
}
.modal-matricula .btn-prev:hover,
.modal-matricula .btn-cancel:hover,
.modal-matricula .btn-editar:hover {
    background:#e2e8f0;
    transform:translateY(-1px);
    box-shadow:0 8px 18px rgba(15,23,42,0.12);
}
.modal-matricula .btn-next,
.modal-matricula .btn-confirm-re,
.modal-matricula .btn-confirm-final {
    box-shadow:0 6px 18px rgba(113,99,186,0.24);
}

/* CARDS MELHORADOS */
#matricula .stats-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px; margin-bottom: 24px;
}
#matricula .stat-card {
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%); /* GRADIENTE SUAVE */
    padding: 18px 20px; border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid #f3f4f6;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
#matricula .stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(137, 120, 223, 0.12);
    border-color: #e5e7eb;
}
#matricula .stat-label { 
    font-size: 12px; color: #6b7280; font-weight: 600; 
    text-transform: uppercase; letter-spacing: 0.4px;
}
#matricula .stat-value { 
    font-size: 28px; font-weight: 700; color: #2f0375; 
    line-height: 1;
}

/* TOOLBAR */
#matricula .toolbar { background: #fff; padding: 14px 16px; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); margin-bottom: 20px; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; }

/* BUSCA CLICAVEL */
#matricula .search-box {
    display: flex; align-items: center; gap: 10px;
    background: #f3f4f6; padding: 0 14px; border-radius: 8px;
    flex: 1 1 300px; height: 38px; cursor: text; border: 1px solid transparent;
}
#matricula .search-box:focus-within { background: #fff; border-color: #8978df; }
#matricula .search-box input {
    border: none; background: transparent; outline: none;
    width: 100%; font-size: 14px; height: 100%;
}
#matricula .filters { display: flex; flex-wrap: wrap; gap: 10px; }
#matricula .filtro select { border: 1px solid #d1d5db; border-radius: 6px; padding: 8px 10px; background: #fff; min-width: 130px; font-size: 13px; }

/* TABELA */
#matricula .table-container { background: #fff; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); overflow-x: auto; }
#matricula .tabela-alunos { width: 100%; border-collapse: collapse; min-width: 900px; }
#matricula .tabela-alunos thead { background: #f9fafb; border-bottom: 1px solid #e5e7eb; }
#matricula .tabela-alunos th {
    padding: 12px 16px; text-align: left; font-weight: 600;
    font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; color: #6b7280;
}
#matricula .tabela-alunos td { padding: 12px 16px; border-bottom: 1px solid #f3f4f6; font-size: 14px; }
#matricula .tabela-alunos tbody tr:hover { background: #f9fafb; }

/* ACOES COLORIDAS */
.btn-icon { background: none; border: none; cursor: pointer; padding: 6px; border-radius: 4px; }
.btn-icon.view { color: #2563eb; } /* Azul */
.btn-icon.edit { color: #d97706; } /* Laranja */
.btn-icon.view:hover { background: #eff6ff; }
.btn-icon.edit:hover { background: #fffbeb; }

/* ESTADO VAZIO */
#matricula .empty-state td { padding: 50px 20px; text-align: center; }
#matricula .empty-content { display: flex; flex-direction: column; align-items: center; gap: 10px; color: #64748b; }
#matricula .empty-content i { font-size: 40px; color: #d1d5db; }
.hidden { display: none !important; }

/* RODAPE PAGINACAO */
#matricula .table-footer {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 16px; background: #fff; border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05); margin-top: 16px; font-size: 13px;
}
.pagination { display: flex; gap: 6px; align-items: center; }
.pagination button {
    border: 1px solid #d1d5db; background: #fff; color: #374151;
    padding: 6px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; min-width: 32px;
}
.pagination button.active { background: #8978df; color: #fff; border-color: #8978df; }
.pagination button:disabled { opacity: 0.5; cursor: not-allowed; }
.pagination.dots { border: none; background: none; cursor: default; padding: 6px 2px; }

/* MENU ACOES BALAO */
.actions-menu {
    position: absolute; display: none; flex-direction: column;
    background: #fff; border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 6px; z-index: 1000; min-width: 160px;
}
.actions-menu button {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; border: none; background: none;
    text-align: left; cursor: pointer; border-radius: 6px;
    font-size: 14px; color: #374151;
}
.actions-menu button:hover { background: #f3f4f6; }
.actions-menu i { width: 16px; color: #7163ba; }

/* BADGES */
.badge { padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fec7c7; color: #920e0e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
#matricula.tabela-alunos tbody tr.linha-inativa { opacity: 0.6; background: #f9fafb; }

.empty-content .btn{
    height: 45px;
    color: #8978df;
    box-shadow: 0 0 15px 0.1px #8978df79;
    width: 200px;
    font-weight: 900;
}
.empty-content .btn i{
    color: #8978df !important;
}
/* ===== MODAL MATRICULA OFFLINE ===== */
.modal-matricula {
position: fixed;
inset: 0;
background: rgba(0,0,0,0.45);
display: none;
align-items: center;
justify-content: center;
z-index: 1050;
backdrop-filter: blur(2px);
}
.modal-matricula.show { display: flex; }

.modal-matricula .modal-content {
background: #fff;
border-radius: 12px;
width: 62%;
max-width: 900px;
max-height: 90vh;
display: flex;
flex-direction: column;
box-shadow: 0 10px 40px rgba(0,0,0,0.2);
resize: both;
overflow: hidden;
position: absolute;
}

.modal-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 12px 16px;
background: #f8f9fa;
border-bottom: 1px solid #e9ecef;
cursor: move;
user-select: none;
}
.modal-title { font-weight: 600; color: #343a40; margin: 0; font-size: 1rem; }
.modal-controls { display: flex; gap: 8px; }
.modal-controls button {
background: transparent; border: none; cursor: pointer; padding: 4px 8px;
border-radius: 4px; color: #6c757d;
}
.modal-controls button:hover { background: #e9ecef; color: #212529; }

.modal-body { padding: 12px; overflow-y: auto; flex: 1; }
.modal-footer {
display: flex; justify-content: flex-end; gap: 10px;
padding: 12px 16px; background: #f8f9fa; border-top: 1px solid #e9ecef;
}

/* Wizard */
.wizard-progress { margin-bottom: 12px; }
.progress-bar { height: 6px; background: #e9ecef; border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: #0d6efd; width: 0%; transition: width 0.4s ease; }
.wizard-steps { display: flex; justify-content: space-between; margin-top: 8px; }
.step-circle {
width: 32px; height: 32px; border-radius: 50%; background: #dee2e6;
display: flex; align-items: center; justify-content: center; color: #6c757d;
cursor: pointer; font-size: 0.9rem;
}
.step-circle.active { background: #0d6efd; color: #fff; }
.step-circle.completed { background: #198754; color: #fff; }

.step-content { display: none; }
.step-content.active { display: block; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.span-3 { grid-column: span 3; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: 0.8rem; font-weight: 600; color: #495057; }
.form-group label .req { color: #dc3545; }
.form-group input, .form-group select {
padding: 6px 10px; border: 1px solid #ced4da; border-radius: 6px; font-size: 0.85rem;
}
.form-group input:focus, .form-group select:focus {
border-color: #86b7fe; outline: 0; box-shadow: 0 0 0 0.25rem rgba(13,110,253,.25);
}
.form-group input.is-invalid, .form-group select.is-invalid { border-color: #dc3545; }
.feedback { font-size: 0.75rem; color: #dc3545; min-height: 16px; }

/* Upload */
.upload-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 12px; }
.upload-item { text-align: center; }
.upload-item label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 0.8rem; }
.upload-item input[type=file] { font-size: 0.75rem; }
.upload-item .preview { width: 90px; height: 90px; border: 1px dashed #ced4da; border-radius: 50%; margin: 6px auto; overflow: hidden; }
.upload-item .preview img { width: 100%; height: 100%; object-fit: cover; }

/* Toasts */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 10px 14px; border-radius: 8px; color: #fff; font-size: 0.85rem; box-shadow: 0 4px 12px rgba(0,0,0,0.15); animation: slideIn 0.3s ease; }
.toast.success { background: #198754; }
.toast.error { background: #dc3545; }
.toast.info { background: #0dcaf0; color: #000; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Actions Menu */
.actions-menu { position: absolute; display: none; flex-direction: column; background: #fff; border: 1px solid #dee2e6; border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); z-index: 1000; }
.actions-menu button { padding: 8px 12px; border: none; background: none; text-align: left; cursor: pointer; font-size: 0.85rem; }
.actions-menu button:hover { background: #f8f9fa; }

/* ===== MATRICULA - ESTILO NOTA - INSTITUCIONAL NEUTRO ===== */
.modal-matricula{position:fixed;inset:0;background:rgba(0,0,0,.45);backdrop-filter:blur(3px);display:none;align-items:center;justify-content:center;z-index:10001}
.modal-matricula.show{display:flex}
.modal-matricula .modal-content{background:#fff;border-radius:12px!important;width:94%;max-width:860px;max-height:92vh;display:flex;flex-direction:column;box-shadow:0 8px 32px rgba(0,0,0,.28);position:absolute;overflow:hidden;border:1px solid #94a3b8}
.modal-drag-header{cursor:grab!important;background:#635996!important;color:#fff!important;padding:10px 12px;border-radius:12px 12px 0 0;display:flex;justify-content:space-between;align-items:center;user-select:none;font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.3px}
.modal-drag-header:active{cursor:grabbing!important}
.modal-close-nota{width:28px;height:28px;border-radius:50%;border:1px solid rgba(255,255,255,.25);background:rgba(255,255,255,.12);color:#fff;font-size:16px;line-height:1;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all .2s ease}
.modal-close-nota:hover{background:#ef4444;border-color:#ef4444;transform:rotate(90deg)}
.modal-body{padding:12px;overflow:auto;background:#fff}
.modal-footer{padding:10px 12px;background:#f8fafc;border-top:1px solid #e2e8f0;display:flex;justify-content:space-between;align-items:center}

/* wizard */
.wizard-progress{margin-bottom:12px}
.progress-bar{height:6px;background:#f1f5f9;border-radius:3px;overflow:hidden;border:1px solid #e2e8f0}
.progress-fill{height:100%;background:#635996;width:0%;transition:width .4s ease}
.wizard-steps{display:flex;justify-content:space-between;margin-top:10px}
.step-circle{width:34px;height:34px;border-radius:50%;background:#fff;border:1px solid #cbd5e1;display:flex;align-items:center;justify-content:center;font-size:12px;cursor:pointer;transition:.2s;color:#475569}
.step-circle.active{background:#635996;color:#fff;border-color:#635996}
.step-circle.completed{background:#10b981;color:#fff;border-color:#10b981}

/* campos etapa 1 - todos personalizados */
.grid-3{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.form-group label{font-size:10px;font-weight:700;text-transform:uppercase;color:#475569;margin-bottom:3px;display:block}
.form-group input,.form-group select{width:100%;padding:7px 8px;border:1px solid #cbd5e1;border-radius:3px;font-size:12px;background:#fff}
.form-group input:focus,.form-group select:focus{outline:2px solid #635996}
.is-invalid{border-color:#ef4444!important;background:#fee2e2!important}
.badge-nota{padding:3px 8px;border-radius:3px;font-size:10px;font-weight:700}
.badge-nota.aprovado{background:#d1fae5;color:#065f46}.badge-nota.reprovado{background:#fee2e2;color:#991b1b}

/* anexos elegantes caixa clicável */
.upload-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-top:12px}
.upload-card-nota{border:1px dashed #94a3b8;border-radius:3px;height:110px;display:flex;flex-direction:column;align-items:center;justify-content:center;cursor:pointer;background:#f8fafc;transition:.2s;position:relative;overflow:hidden}
.upload-card-nota:hover{border-color:#635996;background:#ede9fe;transform:translateY(-1px)}
.upload-card-nota.has-file{border-style:solid;border-color:#10b981;background:#f0fdf4}
.upload-card-nota i{font-size:20px;color:#64748b;margin-bottom:4px}
.upload-card-nota span.label{font-size:10px;font-weight:700;text-transform:uppercase;color:#475569}
.upload-card-nota .preview img{width:64px;height:64px;border-radius:50%;object-fit:cover;border:2px solid #fff;box-shadow:0 2px 6px rgba(0,0,0,.15)}

/* busca com foto */
.resultados-busca{max-height:260px;overflow:auto;border:1px dashed #635996;border-radius:3px;background:#fff;margin-top:8px}
.resultado-item{display:flex;align-items:center;gap:10px;padding:8px 10px;border-bottom:1px solid #f1f5f9;cursor:pointer}
.resultado-item:hover{background:#ede9fe}
.resultado-item img{width:42px;height:42px;border-radius:50%;object-fit:cover;border:1px solid #e2e8f0;flex-shrink:0}

/* tabela com foto */
.tabela-alunos img.avatar{width:32px;height:32px;border-radius:50%;object-fit:cover;border:1px solid #e2e8f0}
.tabela-alunos td.aluno-cell{display:flex;align-items:center;gap:8px}

/* toasts personalizados institucional */
.toast-stack{position:fixed;top:14px;right:14px;z-index:10050;display:flex;flex-direction:column;gap:6px}
.toast-nota{padding:10px 14px;border-radius:3px;font-size:11px;font-weight:700;color:#fff;box-shadow:0 4px 12px rgba(0,0,0,.2);border:1px solid rgba(0,0,0,.1);animation:slideIn .25s}
.toast-nota.success{background:#1e293b;border-color:#0f172a}.toast-nota.error{background:#991b1b}.toast-nota.info{background:#635996}

/* actions menu */
.actions-menu{position:absolute;background:#fff;border:1px solid #94a3b8;border-radius:3px;box-shadow:0 4px 16px rgba(0,0,0,.15);display:none;z-index:10002;min-width:160px;overflow:hidden}
.actions-menu.show{display:block}
.actions-menu .menu-item{padding:8px 10px;font-size:11px;cursor:pointer;display:flex;gap:8px;align-items:center}
.actions-menu .menu-item:hover{background:#f1f5f9}
