/* ================================================================
   Sistema de Avaliação — estilos globais
   Layout: sidebar fixa + main scrollável
   ================================================================ */

:root {
  --sidebar-width: 240px;
  --topbar-height: 56px;
  --sidebar-bg: #1e2a3a;
  --sidebar-text: #c9d1db;
  --sidebar-active-bg: #2e3f55;
  --sidebar-active-text: #ffffff;
  --sidebar-brand-bg: #17222f;
  --primary: #0d6efd;
}

/* ----------------------------------------------------------------
   Layout base
   ---------------------------------------------------------------- */
body.aval-layout {
  display: flex;
  min-height: 100vh;
  background: #f4f6f9;
  font-size: 0.9rem;
}

/* ----------------------------------------------------------------
   Sidebar
   ---------------------------------------------------------------- */
.aval-sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1000;
  overflow-y: auto;
  transition: transform 0.25s ease;
}

.aval-sidebar-brand {
  background: var(--sidebar-brand-bg);
  color: #fff;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  min-height: var(--topbar-height);
}

.aval-sidebar .nav-link {
  color: var(--sidebar-text);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  margin-bottom: 2px;
  font-size: 0.875rem;
  transition: background 0.15s, color 0.15s;
}

.aval-sidebar .nav-link:hover {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
}

.aval-sidebar .nav-link.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  font-weight: 600;
}

/* Mobile: sidebar oculta por padrão */
@media (max-width: 991.98px) {
  .aval-sidebar {
    transform: translateX(-100%);
  }
  .aval-sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0,0,0,.35);
  }
}

/* ----------------------------------------------------------------
   Main area
   ---------------------------------------------------------------- */
.aval-main {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

@media (max-width: 991.98px) {
  .aval-main {
    margin-left: 0;
  }
}

/* ----------------------------------------------------------------
   Topbar
   ---------------------------------------------------------------- */
.aval-topbar {
  height: var(--topbar-height);
  background: #ffffff;
  border-bottom: 1px solid #e3e7ef;
  position: sticky;
  top: 0;
  z-index: 900;
  gap: 0.5rem;
}

/* ----------------------------------------------------------------
   Content
   ---------------------------------------------------------------- */
.aval-content {
  flex: 1;
}

/* ----------------------------------------------------------------
   Cards e tabelas
   ---------------------------------------------------------------- */
.card {
  border: 1px solid #e3e7ef;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}

.card-header {
  background: #fff;
  border-bottom: 1px solid #e3e7ef;
  font-weight: 600;
  font-size: 0.9rem;
}

.table th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6c757d;
  border-top: none;
}

.table td {
  vertical-align: middle;
}

/* ----------------------------------------------------------------
   Badges de status
   ---------------------------------------------------------------- */
.badge-pendente        { background: #ffc107; color: #212529; }
.badge-ativo           { background: #198754; }
.badge-inativo         { background: #6c757d; }
.badge-rascunho        { background: #0dcaf0; color: #212529; }
.badge-finalizada      { background: #198754; }
.badge-aprovado        { background: #198754; }
.badge-reprovado       { background: #dc3545; }
.badge-aprovado_correcoes     { background: #fd7e14; }
.badge-correcoes_obrigatorias { background: #dc3545; }
.badge-detectado       { background: #ffc107; color: #212529; }
.badge-encaminhado     { background: #0d6efd; }
.badge-resolvido       { background: #198754; }

/* ----------------------------------------------------------------
   KPI cards (dashboard)
   ---------------------------------------------------------------- */
.kpi-card {
  border-radius: 10px;
  padding: 1.25rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.kpi-card .kpi-icon {
  font-size: 2rem;
  opacity: 0.85;
}

.kpi-card .kpi-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.kpi-card .kpi-label {
  font-size: 0.8rem;
  opacity: 0.9;
}

/* ----------------------------------------------------------------
   Botões de ação inline (tabelas)
   ---------------------------------------------------------------- */
.btn-action {
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  line-height: 1;
  border-radius: 4px;
}

/* ----------------------------------------------------------------
   Modal
   ---------------------------------------------------------------- */
.modal-header {
  border-bottom: 1px solid #e3e7ef;
}

.modal-footer {
  border-top: 1px solid #e3e7ef;
}

/* ----------------------------------------------------------------
   Avaliação cega — oculta autores
   ---------------------------------------------------------------- */
.aval-blind-mode .autores-info {
  display: none !important;
}

/* ----------------------------------------------------------------
   Página de login / público
   ---------------------------------------------------------------- */
.card-login {
  border-radius: 14px;
  box-shadow: 0 4px 24px rgba(0,0,0,.08);
}

/* ----------------------------------------------------------------
   Responsividade de tabelas
   ---------------------------------------------------------------- */
@media (max-width: 767.98px) {
  .table-responsive-card thead {
    display: none;
  }
  .table-responsive-card tr {
    display: block;
    margin-bottom: 1rem;
    border: 1px solid #e3e7ef;
    border-radius: 8px;
    padding: 0.75rem;
    background: #fff;
  }
  .table-responsive-card td {
    display: flex;
    justify-content: space-between;
    border: none;
    padding: 0.25rem 0;
    font-size: 0.85rem;
  }
  .table-responsive-card td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #6c757d;
    margin-right: 0.5rem;
  }
}
