/* ============================================
   Portal ETEC Araçatuba — Estilos Globais
   ============================================ */

:root {
    --primary: #0056b3;
    --primary-dark: #003d82;
    --secondary: #6c757d;
    --success: #28a745;
    --info: #17a2b8;
    --warning: #ffc107;
    --danger: #dc3545;
}

/* ---------- Base ---------- */
body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #f4f6f9;
}

/* ---------- Modernização de painéis e tabelas ---------- */
.admin-panel {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.table-modern thead th {
    background: #0d6efd;
    color: #ffffff;
    border: 0;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.table-modern tbody tr:hover {
    background-color: #f1f5ff;
}

.table-modern td,
.table-modern th {
    vertical-align: middle;
    padding: 0.85rem 1rem;
}

.report-card {
    border: 0;
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
    transition: transform 0.15s ease;
}

.report-card:hover {
    transform: translateY(-2px);
}

/* ---------- Modernização global ---------- */
.card {
    border: 0;
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.table {
    border-radius: 12px;
    overflow: hidden;
}

.table thead th {
    background: #0d6efd;
    color: #ffffff;
    border: 0;
    font-weight: 600;
}

.table tbody tr:hover {
    background-color: #f1f5ff;
}

.btn {
    border-radius: 10px;
    font-weight: 600;
}

.form-control,
.form-select {
    border-radius: 10px;
    border-color: #d9e2f3;
}

.form-control:focus,
.form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.alert {
    border-radius: 12px;
    border: 0;
}

.badge {
    border-radius: 999px;
    font-weight: 600;
}

.sidebar .nav-link {
    border-radius: 10px;
    margin-bottom: 4px;
}

.sidebar .nav-link:hover {
    background: #eef4ff;
    color: #0d6efd;
}

/* ---------- Banco de questões ---------- */
.qb-page {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.qb-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #0d6efd;
}

.qb-page-title {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #0f172a;
    margin: 0.15rem 0 0.2rem;
}

.qb-page-sub {
    color: #64748b;
    margin: 0;
}

.qb-disciplines {
    background: #ffffff;
    border: 1px solid #e8edf5;
    border-radius: 16px;
    padding: 0.85rem 1rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.qb-disciplines-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 0.6rem;
}

.qb-disciplines-track {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.15rem;
    scrollbar-width: thin;
}

.qb-discipline {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.8rem;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #f8fafc;
    color: #334155;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;
    transition: 0.15s ease;
}

.qb-discipline:hover {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
}

.qb-discipline.is-active {
    background: #0d6efd;
    border-color: #0d6efd;
    color: #ffffff;
    box-shadow: 0 6px 14px rgba(13, 110, 253, 0.25);
}

.qb-discipline-count {
    padding: 0.02rem 0.45rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    font-size: 0.72rem;
    font-weight: 700;
}

.qb-discipline.is-active .qb-discipline-count {
    background: rgba(255, 255, 255, 0.24);
}

.qb-discipline-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.qb-discipline-identity {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.qb-discipline-icon {
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    border: 1px solid #dbeafe;
    border-radius: 14px;
    background: linear-gradient(135deg, #e0edff, #eef4ff);
    color: #0d6efd;
    font-size: 1.4rem;
}

.qb-discipline-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
}

.qb-discipline-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 0.1rem 0 0;
    color: #64748b;
    font-size: 0.85rem;
}

.qb-panel {
    background: #ffffff;
    border: 1px solid #e8edf5;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
    overflow: hidden;
}

.qb-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border-bottom: 1px solid #eef2f7;
}

.qb-panel-title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
}

.qb-panel-sub {
    margin: 0.15rem 0 0;
    font-size: 0.78rem;
    color: #94a3b8;
}

.qb-count-pill {
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    background: #eef4ff;
    color: #1d4ed8;
    font-size: 0.78rem;
    font-weight: 700;
}

.qb-panel-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.85rem 1.1rem 0;
}

.qb-panel-body {
    padding: 1rem 1.1rem;
}

.qb-panel-foot {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.7rem 1.1rem;
    border-top: 1px solid #eef2f7;
    background: #fbfdff;
    color: #94a3b8;
    font-size: 0.78rem;
}

@media (min-width: 992px) {
    .qb-category-panel {
        position: sticky;
        top: 1rem;
    }
}

@media (max-width: 991.98px) {
    .qb-workspace-col {
        order: -1;
    }
}

.qb-switch {
    display: inline-flex;
    gap: 0.25rem;
    padding: 0.25rem;
    margin-bottom: 1rem;
    border-radius: 12px;
    background: #eef2f7;
}

.qb-switch-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.95rem;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #64748b;
    font-size: 0.88rem;
    font-weight: 600;
    transition: 0.15s ease;
}

.qb-switch-btn:hover {
    color: #0d6efd;
}

.qb-switch-btn.active {
    background: #ffffff;
    color: #0d6efd;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.qb-switch-count {
    padding: 0.02rem 0.4rem;
    border-radius: 999px;
    background: #e2e8f0;
    color: #475569;
    font-size: 0.72rem;
}

.qb-switch-btn.active .qb-switch-count {
    background: #dbeafe;
    color: #1d4ed8;
}

#banco-questao-form {
    padding: 1.1rem;
}

.qb-form-section {
    padding: 1rem 0;
    border-bottom: 1px dashed #e2e8f0;
}

.qb-form-section:first-of-type {
    padding-top: 0;
}

.qb-form-section:last-of-type {
    padding-bottom: 0.5rem;
    border-bottom: 0;
}

.qb-form-section-head {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    margin-bottom: 0.9rem;
}

.qb-form-section-head h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
}

.qb-form-section-head p {
    margin: 0.1rem 0 0;
    font-size: 0.78rem;
    color: #94a3b8;
}

.qb-step {
    display: grid;
    place-items: center;
    flex: 0 0 1.75rem;
    width: 1.75rem;
    height: 1.75rem;
    border: 1px solid #dbeafe;
    border-radius: 50%;
    background: #eef4ff;
    color: #0d6efd;
    font-size: 0.8rem;
    font-weight: 700;
}

.qb-form-footer {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding-top: 1rem;
}

.qb-list-panel {
    padding: 1.1rem;
}

.qb-list-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 0.9rem;
}

.qb-search-field {
    position: relative;
    flex: 1 1 260px;
}

.qb-search-field > i,
.qb-select-wrap > i {
    position: absolute;
    top: 50%;
    left: 0.85rem;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

.qb-search-field .form-control {
    padding-left: 2.3rem;
    border-radius: 10px;
    background: #f8fafc;
}

.qb-filter-form {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.qb-select-wrap {
    position: relative;
}

.qb-select-wrap .form-select {
    min-width: 210px;
    max-width: 320px;
    padding-left: 2.1rem;
    border-radius: 10px;
}

.qb-list-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid #eef2f7;
}

.qb-list-count {
    color: #64748b;
    font-size: 0.82rem;
}

.qb-list-count strong {
    color: #0f172a;
}

.qb-list-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.qb-question-list {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.qb-question-card {
    padding: 1rem 1.1rem;
    border: 1px solid #e8edf5;
    border-radius: 14px;
    background: #ffffff;
    transition: 0.18s ease;
}

.qb-question-card:hover {
    border-color: #cfe0ff;
    box-shadow: 0 10px 24px rgba(13, 110, 253, 0.08);
}

.qb-question-card[hidden] {
    display: none;
}

.qb-question-top {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}

.qb-question-id {
    color: #94a3b8;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.qb-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.72rem;
    font-weight: 600;
}

.qb-chip-category {
    background: #eef4ff;
    color: #1d4ed8;
}

.qb-question-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.qb-question-text {
    margin: 0 0 0.75rem;
    color: #1e293b;
    font-size: 0.95rem;
    line-height: 1.55;
}

.qb-question-image-link {
    display: inline-block;
    margin-bottom: 0.75rem;
}

.qb-option-list {
    display: grid;
    gap: 0.4rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.qb-option {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.45rem 0.6rem;
    border: 1px solid transparent;
    border-radius: 9px;
    background: #f8fafc;
    color: #475569;
    font-size: 0.85rem;
}

.qb-option.is-correct {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
    font-weight: 600;
}

.qb-option-letter {
    display: grid;
    place-items: center;
    flex: 0 0 1.5rem;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: #e2e8f0;
    color: #475569;
    font-size: 0.72rem;
    font-weight: 700;
}

.qb-option.is-correct .qb-option-letter {
    background: #16a34a;
    color: #ffffff;
}

.qb-option-text {
    flex: 1;
}

.qb-option-check {
    margin-top: 0.15rem;
    color: #16a34a;
}

.qb-empty-state {
    padding: 3rem 1.5rem;
    border: 1px dashed #dbe3ee;
    border-radius: 16px;
    background: #ffffff;
    text-align: center;
}

.qb-empty-state > i {
    color: #94a3b8;
    font-size: 2.25rem;
}

.qb-empty-state h2 {
    margin: 0.75rem 0 0.35rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
}

.qb-empty-state p {
    max-width: 36rem;
    margin: 0 auto 1rem;
    color: #64748b;
    font-size: 0.9rem;
}

.qb-empty-state-sm {
    padding: 2rem 1rem;
    border: 0;
    background: transparent;
}

.question-category-tree {
    padding: 0.25rem 0;
}

.question-category-row {
    padding: 0.35rem 0.5rem;
    border-radius: 8px;
    transition: background 0.15s;
}

.question-category-row:hover {
    background: #f1f5ff;
}

.question-category-name {
    font-weight: 600;
    color: #1e293b;
}

.question-category-tree-root > li {
    margin-bottom: 0.25rem;
}

.question-option-number {
    border-radius: 10px 0 0 10px;
    font-weight: 700;
    color: #475569;
}

.question-option-correct {
    cursor: pointer;
}

.question-prompt-image-list {
    max-height: 180px;
    border-radius: 10px;
    object-fit: contain;
}

#questao-editar-modal .qb-eyebrow {
    margin-bottom: 0.2rem;
}

#questao-editar-adicionar-alternativa {
    white-space: nowrap;
}

main {
    flex: 1;
}

footer {
    margin-top: auto;
}

/* ---------- Topbar ---------- */
.topbar {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    height: 36px;
    font-size: 0.82rem;
}

.topbar-links {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.topbar-auth {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.topbar-link {
    color: #495057;
    text-decoration: none;
    padding: 2px 0;
    transition: color 0.15s;
    white-space: nowrap;
}

.topbar-link:hover,
.topbar-link.active {
    color: var(--primary);
}

.topbar-user {
    color: #6c757d;
    font-size: 0.8rem;
}

/* ---------- Navbar ---------- */
.navbar-brand {
    font-weight: 700;
    font-size: 1.3rem;
}

@media (min-width: 992px) {
    .navbar .dropdown:hover .dropdown-menu {
        display: block;
        margin-top: 0;
    }
    .navbar .dropdown-menu {
        border-top: 2px solid var(--primary);
        border-radius: 0 0 0.25rem 0.25rem;
    }
}

@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1rem;
    }
}

/* ---------- Cards gerais ---------- */
.card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12) !important;
}

/* ---------- Home: Hero ---------- */
.hero-banner {
    min-height: 220px;
}

/* ---------- Home: Cards de acesso rápido ---------- */
.home-card {
    border-radius: 12px !important;
}

.home-card .home-icon {
    line-height: 1;
}

/* ---------- Conteúdo de página CMS ---------- */
.conteudo-pagina {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #333;
}

.conteudo-pagina img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.conteudo-pagina h1, .conteudo-pagina h2, .conteudo-pagina h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.conteudo-pagina table {
    width: 100%;
    margin-bottom: 1rem;
    border-collapse: collapse;
}

.conteudo-pagina table th,
.conteudo-pagina table td {
    padding: 0.5rem 0.75rem;
    border: 1px solid #dee2e6;
}

.conteudo-pagina blockquote {
    border-left: 4px solid var(--primary);
    padding: 0.5rem 1rem;
    background: #f0f4ff;
    margin: 1rem 0;
    border-radius: 0 4px 4px 0;
}

/* ---------- Tabelas admin ---------- */
.table-actions .btn {
    padding: 0.2rem 0.5rem;
    font-size: 0.85rem;
}

/* ---------- Badge status ---------- */
.badge-status {
    font-size: 0.8rem;
    padding: 0.3em 0.6em;
}

/* ---------- Notificações dropdown ---------- */
.notif-dropdown {
    min-width: 340px;
    max-height: 420px;
    overflow-y: auto;
}

.notif-item {
    border-left: 3px solid transparent;
    transition: background 0.15s;
}

.notif-item.nao-lida {
    background-color: #f0f7ff;
    border-left-color: var(--primary);
}

.notif-item:hover {
    background-color: #e9ecef;
}

/* ---------- AMS / Portfólio ---------- */
.status-badge {
    font-size: 0.78rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* ---------- Simulado: prova ---------- */
.simulado-nav-questao {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 1rem;
}

.simulado-nav-questao .btn {
    min-width: 38px;
    padding: 4px 8px;
    font-size: 0.8rem;
}

/* ---------- Biblioteca ---------- */
.biblioteca-card img {
    object-fit: cover;
    height: 180px;
}

/* ---------- Footer ---------- */
footer {
    background: #212529 !important;
    color: #adb5bd;
}

footer a,
.footer-link {
    color: #adb5bd;
    text-decoration: none;
    transition: color 0.15s;
}

footer a:hover,
.footer-link:hover {
    color: #fff;
}

/* ---------- Utilidades extras ---------- */
.cursor-pointer {
    cursor: pointer;
}

.text-overflow-ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- Admin sidebar ---------- */
.sidebar .nav-link {
    color: #495057;
    padding: 0.4rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: background 0.15s, color 0.15s;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background: #e9ecef;
    color: var(--primary);
}

.sidebar .nav-link i {
    width: 20px;
    margin-right: 6px;
}

.simulado-select-checkbox {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #495057;
    background-color: #fff;
    cursor: pointer;
}

.simulado-select-checkbox:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.simulado-select-checkbox:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.simulado-select-checkbox:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.simulado-stat-icon {
    display: flex;
    flex: 0 0 3.5rem;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
}
