/*
 * teaching.css — identidade visual do Portal do Professor.
 * O tema base (Metronic 8.2) vem do pacote NuGet Codout.Web em /codout/assets.
 * Este arquivo só contém overrides — preferir variáveis CSS (--bs-*) para que
 * os ajustes funcionem em light e dark mode.
 */

/* Logo na sidebar */
.app-sidebar-logo img.app-sidebar-logo-default {
    max-height: 32px;
}

.app-sidebar-logo img.app-sidebar-logo-minimize {
    max-height: 26px;
}

/* Cards de KPI do dashboard: transição suave no hover */
.card.hoverable {
    transition: transform .15s ease, box-shadow .15s ease;
}

.card.hoverable:hover {
    transform: translateY(-2px);
}

/* Grades de lançamento (notas/frequência/diário): células compactas */
.table-grade-entry td,
.table-grade-entry th {
    padding: .5rem .6rem;
    vertical-align: middle;
}

/*
 * FIX select2: o liveSearch.js (pacote Codout.Web) inicializa o select2 com
 * theme:"bootstrap", mas o bundle só estiliza o theme "bootstrap5". Sem casar, o
 * dropdown fica sem estilo (fundo/texto ilegíveis — "todo preto"). Aqui damos ao
 * container --bootstrap o mesmo tratamento do --bootstrap5, usando variáveis do
 * tema para funcionar em claro E escuro. O !important vence o CSS base do select2.
 */
.select2-container--bootstrap .select2-dropdown {
    background-color: var(--bs-dropdown-bg, var(--bs-body-bg)) !important;
    color: var(--bs-body-color) !important;
    border: 0 !important;
    box-shadow: var(--bs-dropdown-box-shadow) !important;
    border-radius: .475rem !important;
    padding: .75rem 0 !important;
}

.select2-container--bootstrap .select2-results__option {
    color: var(--bs-gray-800) !important;
    background-color: transparent !important;
    padding: .65rem 1.25rem !important;
}

.select2-container--bootstrap .select2-results__option--highlighted,
.select2-container--bootstrap .select2-results__option[aria-selected="true"],
.select2-container--bootstrap .select2-results__option--selected {
    background-color: var(--bs-component-hover-bg, var(--bs-primary)) !important;
    color: var(--bs-component-hover-color, #ffffff) !important;
}

.select2-container--bootstrap .select2-results__option--disabled {
    color: var(--bs-gray-400) !important;
}

.select2-container--bootstrap .select2-dropdown .select2-search__field {
    background-color: var(--bs-body-bg) !important;
    color: var(--bs-gray-800) !important;
    border: 1px solid var(--bs-gray-300) !important;
    border-radius: .425rem !important;
    padding: .55rem .75rem !important;
    margin: 0 1rem .5rem !important;
    width: calc(100% - 2rem) !important;
}

/* Rede de segurança: se algum select2 subir SEM o container --bootstrap,
   garante contraste mínimo pelo tema. */
.select2-dropdown {
    background-color: var(--bs-dropdown-bg, var(--bs-body-bg)) !important;
    color: var(--bs-body-color) !important;
}

/* =========================================================================
   Lançamento de Notas — conceito "Caderno Aberto"
   Tudo com variáveis --bs-* para funcionar em claro E escuro.
   ========================================================================= */

.notas-stages {
    display: flex;
    gap: 2px;
    background: var(--bs-gray-100);
    border-radius: 9px;
    padding: 3px;
}

.notas-stage {
    padding: 6px 14px;
    border-radius: 7px;
    font-weight: 700;
    font-size: 12.5px;
    color: var(--bs-gray-600);
}

.notas-stage:hover { color: var(--bs-primary); }

.notas-stage.active {
    background: var(--bs-body-bg);
    color: var(--bs-primary);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .12);
}

.notas-stage.closed { color: var(--bs-gray-500); }
.notas-stage.closed.active { color: var(--bs-gray-700); }

/* Período fechado: célula somente-leitura (visual de travado) */
.notas-in[readonly] {
    background: transparent;
    border-color: transparent;
    color: var(--bs-gray-700);
    cursor: default;
    font-weight: 600;
}
.notas-in[readonly]:focus { background: transparent; border-color: transparent; }

.notas-gridwrap { max-height: calc(100vh - 320px); overflow: auto; }

.notas-grid thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: var(--bs-body-bg);
    text-align: center;
    padding: 8px 6px;
    border-bottom: 1px solid var(--bs-gray-200);
}

.notas-grid thead th.notas-th-stud { text-align: left; padding-left: 2rem; }

.notas-col-title { display: block; font-weight: 800; font-size: 12px; color: var(--bs-gray-800); letter-spacing: .02em; }

.notas-col-cnt {
    display: block;
    font-size: 11px;
    font-weight: 800;
    color: var(--bs-primary);
    cursor: pointer;
    font-variant-numeric: tabular-nums;
}

.notas-col-ass { display: block; font-size: 10px; color: var(--bs-gray-500); font-weight: 500; max-width: 140px; margin: 0 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.notas-grid thead th.colhl { background: var(--bs-primary-light, var(--bs-gray-100)); }
.notas-grid thead th.flash { animation: notas-headflash .9s ease; }
@keyframes notas-headflash { 0% { background: var(--bs-primary); color: #fff; } 100% { background: var(--bs-primary-light, var(--bs-gray-100)); } }

.notas-grid tbody tr.rowhl td { background: color-mix(in srgb, var(--bs-primary) 6%, transparent); }
.notas-grid td { border-bottom: 1px solid var(--bs-gray-200); padding: 4px 6px; }
.notas-td-stud { padding-left: 2rem !important; white-space: nowrap; }
.notas-cell { text-align: center; min-width: 104px; }

.notas-cellbox { position: relative; display: inline-flex; align-items: center; }

.notas-in {
    width: 72px;
    padding: 7px 4px;
    text-align: center;
    font-weight: 700;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    color: var(--bs-gray-900);
    background: var(--bs-gray-100);
    border: 1.5px solid var(--bs-gray-300);
    border-radius: 8px;
    outline: none;
    transition: border-color .12s, background .12s;
}

.notas-in:focus { border-color: var(--bs-primary); background: var(--bs-body-bg); }
.notas-in.low { color: var(--bs-danger); }
.notas-in.err { border-color: var(--bs-danger); background: var(--bs-danger-light, #ffeef3); }
.notas-in.pending { border-color: var(--bs-warning); background: var(--bs-warning-light, #fff8dd); }

.notas-st { position: absolute; right: -15px; width: 13px; font-size: 11px; }
.notas-st.ok { color: var(--bs-success); }
.notas-st.pend { color: var(--bs-warning); }

.notas-ghost {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: -22px;
    white-space: nowrap;
    background: var(--bs-gray-900);
    color: var(--bs-body-bg);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    pointer-events: none;
    z-index: 5;
}

.notas-shake { animation: notas-shake .18s linear 2; }
@keyframes notas-shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }

.notas-avg { text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 80px; }
.notas-avg .b { padding: 3px 10px; border-radius: 7px; }
.notas-avg .ok { background: var(--bs-success-light, #eafff1); color: var(--bs-success); }
.notas-avg .bad { background: var(--bs-danger-light, #ffeef3); color: var(--bs-danger); }
.notas-avg .none { color: var(--bs-gray-400); font-weight: 600; }

.notas-kbd {
    display: inline-block;
    border: 1px solid var(--bs-gray-300);
    border-bottom-width: 2px;
    border-radius: 5px;
    padding: 0 6px;
    font-weight: 700;
    font-size: 11px;
    color: var(--bs-gray-800);
    background: var(--bs-gray-100);
}

.notas-offline { background: var(--bs-warning-light, #fff8dd); border-bottom: 1px solid var(--bs-gray-200); }

.notas-toast {
    position: fixed;
    left: 50%;
    bottom: 26px;
    transform: translateX(-50%) translateY(20px);
    background: var(--bs-gray-900);
    color: var(--bs-body-bg);
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 13px;
    opacity: 0;
    transition: all .25s ease;
    pointer-events: none;
    z-index: 1080;
}
.notas-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.notas-roll-in {
    width: 130px;
    padding: 12px 8px;
    text-align: center;
    font-weight: 800;
    font-size: 26px;
    font-variant-numeric: tabular-nums;
    background: var(--bs-gray-100);
    border: 2px solid var(--bs-gray-300);
    border-radius: 12px;
    outline: none;
    color: var(--bs-gray-900);
}
.notas-roll-in:focus { border-color: var(--bs-primary); }
.notas-roll-done, .notas-roll-queue { max-height: 110px; overflow-y: auto; }

@media (prefers-reduced-motion: reduce) {
    .notas-shake, .notas-grid thead th.flash { animation: none !important; }
}

/* Impressão: esconder o chrome do app */
@media print {
    .app-sidebar,
    .app-header,
    .app-toolbar,
    .app-footer,
    #kt_scrolltop {
        display: none !important;
    }
}
