/* ── Reset & Base ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: system-ui, -apple-system, sans-serif; font-size: 14px;
       background: #f4f6fa; color: #1a1a2e; min-height: 100vh; }
a { color: #3b6cf8; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ─────────────────────────────────────────────── */
body:not(.login-page) { display: flex; }
.sidebar { width: 220px; min-height: 100vh; background: #1a1a2e; color: #cdd2e0;
           display: flex; flex-direction: column; flex-shrink: 0; }
.sidebar-brand { padding: 20px 16px; font-size: 16px; font-weight: 700;
                 color: #fff; border-bottom: 1px solid #2a2a4a; }
.nav-list { list-style: none; flex: 1; padding: 8px 0; }
.nav-list li a { display: block; padding: 10px 20px; color: #cdd2e0; transition: background .15s; }
.nav-list li a:hover, .nav-list li a.active { background: #2d3a6b; color: #fff; text-decoration: none; }
.sidebar-footer { padding: 16px; border-top: 1px solid #2a2a4a; font-size: 12px;
                  display: flex; justify-content: space-between; align-items: center; }
.sidebar-footer a { color: #888; }
.main-content { flex: 1; padding: 28px; overflow-y: auto; }

/* ── Page header ────────────────────────────────────────── */
.page-header { display: flex; justify-content: space-between; align-items: center;
               margin-bottom: 24px; }
.page-header h2 { font-size: 22px; }

/* ── Buttons ────────────────────────────────────────────── */
.btn { display: inline-block; padding: 7px 16px; border-radius: 6px; font-size: 13px;
       cursor: pointer; border: 1px solid #d0d5e8; background: #fff; transition: all .15s; }
.btn:hover { background: #f0f2f9; }
.btn-primary { background: #3b6cf8; color: #fff; border-color: #3b6cf8; }
.btn-primary:hover { background: #2a55d0; }
.btn-secondary { background: #6c757d; color: #fff; border-color: #6c757d; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-block { width: 100%; text-align: center; }
.btn-danger { background: #dc3545; color: #fff; border-color: #dc3545; }

/* ── Forms ──────────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 500; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 8px 10px; border: 1px solid #d0d5e8; border-radius: 6px;
    font-size: 14px; transition: border .15s; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: #3b6cf8; }

/* ── Alerts ─────────────────────────────────────────────── */
.alert { padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; font-size: 13px; }
.alert-danger  { background: #fde8e8; color: #8b1a1a; }
.alert-warning { background: #fff3cd; color: #856404; }
.alert-success { background: #d1fae5; color: #065f46; }

/* ── Table ──────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; background: #fff;
         border-radius: 8px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.07); }
.table th { background: #f0f2f9; text-align: left; padding: 10px 14px;
            font-size: 12px; color: #555; text-transform: uppercase; letter-spacing: .4px; }
.table td { padding: 10px 14px; border-top: 1px solid #eee; }
.table tr:hover td { background: #fafbff; }

/* ── Badges ─────────────────────────────────────────────── */
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11px;
         font-weight: 600; background: #e2e6f0; color: #444; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-danger  { background: #fde8e8; color: #8b1a1a; }
.badge-warning { background: #fff3cd; color: #856404; }

/* ── Stats ──────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
              gap: 16px; margin-bottom: 28px; }
.stat-card { background: #fff; border-radius: 10px; padding: 20px;
             box-shadow: 0 1px 4px rgba(0,0,0,.07); text-align: center; }
.stat-number { display: block; font-size: 32px; font-weight: 700; color: #3b6cf8; }

/* ── Course grid ─────────────────────────────────────────── */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.course-card { background: #fff; border-radius: 10px; overflow: hidden;
               box-shadow: 0 1px 4px rgba(0,0,0,.08); transition: box-shadow .15s; }
.course-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.12); }
.course-card img { width: 100%; height: 130px; object-fit: cover; }
.course-card-body { padding: 14px; }
.course-card-body h3 { font-size: 15px; margin-bottom: 6px; }
.course-card-footer { display: flex; justify-content: space-between; align-items: center;
                      margin-top: 10px; font-size: 12px; color: #888; }

/* ── Progress bar ───────────────────────────────────────── */
.progress-bar { background: #e9ecef; border-radius: 4px; height: 7px; margin: 6px 0; overflow: hidden; }
.progress-fill { height: 100%; background: #3b6cf8; border-radius: 4px; transition: width .3s; }

/* ── Modal ──────────────────────────────────────────────── */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45);
         display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal.hidden { display: none; }
.modal-dialog { background: #fff; border-radius: 10px; width: 480px; max-width: 95vw;
                box-shadow: 0 8px 32px rgba(0,0,0,.18); }
.modal-header { display: flex; justify-content: space-between; align-items: center;
                padding: 16px 20px; border-bottom: 1px solid #eee; }
.modal-header h3 { font-size: 16px; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: #888; }
.modal-body { padding: 20px; }
.modal-footer { padding: 14px 20px; border-top: 1px solid #eee;
                display: flex; justify-content: flex-end; gap: 10px; }

/* ── Toast ──────────────────────────────────────────────── */
.toast { position: fixed; bottom: 24px; right: 24px; padding: 12px 20px;
         border-radius: 8px; background: #1a1a2e; color: #fff; font-size: 13px;
         box-shadow: 0 4px 16px rgba(0,0,0,.2); z-index: 2000; animation: fadeIn .2s; }
.toast-error { background: #dc3545; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; } }

/* ── Login ──────────────────────────────────────────────── */
.login-page { display: flex; align-items: center; justify-content: center;
              min-height: 100vh; background: #f4f6fa; }
.login-card { background: #fff; border-radius: 12px; padding: 36px 32px;
              width: 360px; box-shadow: 0 4px 24px rgba(0,0,0,.10); }
.login-logo { text-align: center; margin-bottom: 24px; }
.login-logo h1 { font-size: 22px; color: #1a1a2e; }
.login-logo p  { color: #888; font-size: 13px; margin-top: 4px; }

/* ── Empty state ─────────────────────────────────────────── */
.empty-state { color: #888; padding: 32px 0; text-align: center; }

/* ── Modules / Lessons ───────────────────────────────────── */
.modules-list { display: flex; flex-direction: column; gap: 16px; margin-bottom: 28px; }
.module-block { background: #fff; border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.07); overflow: hidden; }
.module-header { display: flex; justify-content: space-between; align-items: center;
                 padding: 14px 18px; background: #f0f2f9; }
.module-header h3 { font-size: 15px; color: #1a1a2e; }
.lesson-list { list-style: none; padding: 0; }
.lesson-item { display: flex; align-items: center; gap: 10px; padding: 11px 18px;
               border-top: 1px solid #f0f0f0; transition: background .12s; }
.lesson-item:hover { background: #fafbff; }
.lesson-item.concluida { background: #f0fdf4; }
.lesson-icon { font-size: 16px; flex-shrink: 0; }
.lesson-duration { color: #aaa; font-size: 12px; margin-left: auto; }

/* ── Aula page ───────────────────────────────────────────── */
.aula-content { background: #fff; border-radius: 10px; padding: 24px;
                box-shadow: 0 1px 4px rgba(0,0,0,.07); margin-bottom: 20px; }
.video-wrapper { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: 8px; }
.video-wrapper iframe,
.video-wrapper video { position: absolute; inset: 0; width: 100%; height: 100%; }
.pdf-viewer { width: 100%; height: 70vh; border: none; border-radius: 8px; }
.texto-content { line-height: 1.7; font-size: 15px; }
.texto-content h1, .texto-content h2, .texto-content h3 { margin: 16px 0 8px; }
.texto-content p { margin-bottom: 12px; }
.aula-actions { display: flex; justify-content: space-between; align-items: center;
                flex-wrap: wrap; gap: 12px; }
.nav-aulas { display: flex; gap: 10px; }

/* ── Quiz ────────────────────────────────────────────────── */
.quiz-block { background: #fff; border-radius: 10px; padding: 20px;
              box-shadow: 0 1px 4px rgba(0,0,0,.07); margin-top: 24px; }
.quiz-block h3 { margin-bottom: 8px; }
.question-block { background: #fff; border-radius: 10px; padding: 20px;
                  box-shadow: 0 1px 4px rgba(0,0,0,.07); margin-bottom: 16px; }
.question-text { font-weight: 600; margin-bottom: 12px; font-size: 15px; }
.options-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.options-resposta li label { display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; border: 1px solid #e0e4f0; border-radius: 8px; cursor: pointer;
    transition: background .12s; }
.options-resposta li label:hover { background: #f0f4ff; }
.options-list li.correta { color: #065f46; font-weight: 500; }
.question-admin-block { background: #fff; border-radius: 10px; padding: 18px;
                        box-shadow: 0 1px 4px rgba(0,0,0,.07); margin-bottom: 14px; }
.question-admin-header { display: flex; justify-content: space-between; align-items: flex-start;
                         gap: 10px; margin-bottom: 10px; }
.resultado-card { padding: 32px; border-radius: 12px; text-align: center; }
.resultado-card.aprovado { background: #d1fae5; }
.resultado-card.reprovado { background: #fde8e8; }
.resultado-card h2 { font-size: 28px; margin-bottom: 12px; }
.resultado-card p { font-size: 16px; margin-bottom: 8px; }

/* ── Importação ──────────────────────────────────────────── */
.import-card { background: #fff; border-radius: 10px; padding: 24px;
               box-shadow: 0 1px 4px rgba(0,0,0,.07); max-width: 700px; }
.import-card h3 { margin-bottom: 10px; }
.colunas-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.col-badge { padding: 4px 12px; border-radius: 20px; font-size: 12px;
             background: #e8edf8; color: #333; }
.col-badge.obrigatorio { background: #dbeafe; color: #1d4ed8; font-weight: 600; }
.upload-area { border: 2px dashed #c0caee; border-radius: 10px; padding: 32px;
               text-align: center; transition: background .15s, border-color .15s; }
.upload-area.drag-over { background: #f0f4ff; border-color: #3b6cf8; }
