/* === Cores institucionais — sobrescreve o primary padrão do Bootstrap ===
   #2C5290: azul institucional principal (botões e interativos)
   #1a3a5c: azul navy escuro (topbar / sidebar)
   ================================================================== */
:root {
  --ingressa-primary: #2C5290;
  --ingressa-primary-hover: #24457a;
  --ingressa-font-scale: 1;
  font-size: calc(16px * var(--ingressa-font-scale));
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 2000;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus,
.skip-link:focus-visible {
  width: auto;
  height: auto;
  padding: 0.75rem 1rem;
  margin: 0;
  overflow: visible;
  clip: auto;
  clip-path: none;
  color: var(--ingressa-primary);
  background: #fff;
  border: 2px solid var(--ingressa-primary);
  border-radius: 0.375rem;
  outline: 3px solid #fff;
  outline-offset: 2px;
  text-decoration: none;
}

.app-layout #conteudo-principal {
  scroll-margin-top: 5rem;
}

body.high-contrast .skip-link:focus,
body.high-contrast .skip-link:focus-visible {
  color: var(--hc-accent-text) !important;
  background: var(--hc-accent) !important;
  border-color: var(--hc-border) !important;
  outline-color: var(--hc-border);
}

/* Garante que o input de horário (type=time) sempre tenha largura suficiente
   para exibir HH:MM por completo, mesmo em colunas estreitas do accordion de turmas.
   Especificidade elevada (.input-group > .form-control.turma-horario-input) é necessária
   para sobrepor a regra do Bootstrap ".input-group > .form-control { min-width: 0 }",
   que permite o item flex encolher livremente e cortar os minutos exibidos. */
.input-group > .turma-horario-input.form-control {
  flex: 0 0 auto;
  width: auto;
  min-width: 6.5rem;
}

/* === Alto contraste — cinza escuro + branco + amarelo ===
   Paleta baseada no padrão SIJEE:
   - Fundos em tons de cinza escuro / preto
   - Texto branco para leitura, amarelo para destaques
   - Botões de ação em amarelo com texto preto
   =========================================================== */
:root {
  --hc-bg: #1c1c1c;        /* fundo principal */
  --hc-bg-alt: #2b2b2b;    /* painéis / cards */
  --hc-bg-dark: #000;      /* topbar */
  --hc-border: #fff;       /* bordas de contraste */
  --hc-text: #fff;         /* texto padrão */
  --hc-accent: #ff0;       /* amarelo de destaque */
  --hc-accent-text: #000;  /* texto sobre amarelo */
}

body.high-contrast {
  background-color: var(--hc-bg-dark) !important;
  color: var(--hc-text) !important;
}

body.high-contrast *,
body.high-contrast *::before,
body.high-contrast *::after {
  box-shadow: none !important;
  text-shadow: none !important;
}

body.high-contrast p,
body.high-contrast span,
body.high-contrast li,
body.high-contrast td,
body.high-contrast th,
body.high-contrast label,
body.high-contrast small,
body.high-contrast div,
body.high-contrast dt,
body.high-contrast dd {
  color: var(--hc-text) !important;
}

body.high-contrast h1,
body.high-contrast h2,
body.high-contrast h3,
body.high-contrast h4,
body.high-contrast h5,
body.high-contrast h6 {
  color: var(--hc-accent) !important;
}

body.high-contrast a:not(.btn),
body.high-contrast a:not(.btn):link,
body.high-contrast a:not(.btn):visited,
body.high-contrast .btn-link {
  color: var(--hc-accent) !important;
  text-decoration: none !important;
}

body.high-contrast a:not(.btn):hover,
body.high-contrast a:not(.btn):focus-visible {
  text-decoration: underline !important;
}

/* Botões de ação — amarelo com texto preto (inclui âncoras .btn e btn-sm) */
body.high-contrast .btn.btn-primary,
body.high-contrast a.btn.btn-primary:link,
body.high-contrast a.btn.btn-primary:visited,
body.high-contrast .btn.btn-success,
body.high-contrast a.btn.btn-success:link,
body.high-contrast .btn.btn-danger,
body.high-contrast a.btn.btn-danger:link,
body.high-contrast .btn.btn-warning,
body.high-contrast .btn.btn-info,
body.high-contrast .btn.btn-secondary {
  background-color: var(--hc-accent) !important;
  color: var(--hc-accent-text) !important;
  border: 2px solid var(--hc-accent) !important;
  text-decoration: none !important;
}

body.high-contrast .btn.btn-primary i,
body.high-contrast .btn.btn-success i,
body.high-contrast .btn.btn-danger i,
body.high-contrast .btn.btn-warning i,
body.high-contrast .btn.btn-info i,
body.high-contrast .btn.btn-secondary i {
  color: var(--hc-accent-text) !important;
}

/* Botões outline — contorno branco, texto branco, hover amarelo */
body.high-contrast .btn-outline-primary,
body.high-contrast .btn-outline-secondary,
body.high-contrast .btn-outline-light,
body.high-contrast .btn-outline-danger {
  background-color: transparent !important;
  color: var(--hc-text) !important;
  border: 2px solid var(--hc-border) !important;
}

body.high-contrast .btn-outline-primary:hover,
body.high-contrast .btn-outline-secondary:hover,
body.high-contrast .btn-outline-light:hover,
body.high-contrast .btn-outline-danger:hover,
body.high-contrast .btn-outline-primary:focus,
body.high-contrast .btn-outline-secondary:focus,
body.high-contrast .btn-outline-light:focus {
  background-color: var(--hc-accent) !important;
  color: var(--hc-accent-text) !important;
  border-color: var(--hc-accent) !important;
}

body.high-contrast .form-control,
body.high-contrast .form-select,
body.high-contrast .form-check-input {
  background-color: var(--hc-bg-dark) !important;
  color: var(--hc-text) !important;
  border: 2px solid var(--hc-border) !important;
}

/* Placeholders legíveis (cinza claro, não escuro) */
body.high-contrast .form-control::placeholder,
body.high-contrast .form-select::placeholder,
body.high-contrast input::placeholder,
body.high-contrast textarea::placeholder {
  color: #cfcfcf !important;
  opacity: 1 !important;
}

/* Opção padrão dos selects e ícone da seta */
body.high-contrast .form-select option {
  background-color: var(--hc-bg-dark) !important;
  color: var(--hc-text) !important;
}

body.high-contrast .form-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
}

body.high-contrast .form-check-input:checked {
  background-color: var(--hc-accent) !important;
  border-color: var(--hc-accent) !important;
}

body.high-contrast .topbar {
  background-color: var(--hc-bg) !important;
  border-bottom: 2px solid var(--hc-border) !important;
}

body.high-contrast .sidebar {
  background-color: var(--hc-bg) !important;
  border-right: 2px solid var(--hc-border) !important;
}

body.high-contrast .nav-link,
body.high-contrast .sidebar a.nav-link,
body.high-contrast .sidebar .nav-link {
  color: var(--hc-text) !important;
}

body.high-contrast .sidebar a.nav-link .sidebar-icon,
body.high-contrast .sidebar a.nav-link .sidebar-label {
  color: var(--hc-text) !important;
}

body.high-contrast .nav-link:hover,
body.high-contrast .nav-link:focus-visible,
body.high-contrast .sidebar .nav-link:hover,
body.high-contrast .sidebar .nav-link:focus-visible {
  background-color: var(--hc-accent) !important;
  color: var(--hc-accent-text) !important;
}

body.high-contrast .sidebar .nav-link:hover .sidebar-icon,
body.high-contrast .sidebar .nav-link:hover .sidebar-label,
body.high-contrast .sidebar .nav-link:focus-visible .sidebar-icon,
body.high-contrast .sidebar .nav-link:focus-visible .sidebar-label {
  color: var(--hc-accent-text) !important;
}

/* Item selecionado — sem destaque amarelo, texto preto sobre fundo claro */
body.high-contrast .nav-link.active,
body.high-contrast .sidebar .nav-link.active {
  background-color: var(--hc-text) !important;
  color: var(--hc-accent-text) !important;
  text-decoration: none !important;
}

body.high-contrast .sidebar .nav-link.active .sidebar-icon,
body.high-contrast .sidebar .nav-link.active .sidebar-label {
  color: var(--hc-accent-text) !important;
}

body.high-contrast .card,
body.high-contrast .accordion-item,
body.high-contrast .accordion-button,
body.high-contrast .modal-content,
body.high-contrast .dropdown-menu,
body.high-contrast .table,
body.high-contrast .list-group-item {
  background-color: var(--hc-bg-alt) !important;
  color: var(--hc-text) !important;
  border: 2px solid var(--hc-border) !important;
}

body.high-contrast .dropdown-item {
  color: var(--hc-text) !important;
}

body.high-contrast .dropdown-item:hover,
body.high-contrast .dropdown-item:focus {
  background-color: var(--hc-accent) !important;
  color: var(--hc-accent-text) !important;
}

body.high-contrast .accordion-button::after {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
}

body.high-contrast .table > :not(caption) > * > * {
  background-color: var(--hc-bg-alt) !important;
  color: var(--hc-text) !important;
  border-color: var(--hc-border) !important;
}

/* Cabeçalhos de coluna ordenáveis — brancos e sem sublinhado */
body.high-contrast .table a:not(.btn),
body.high-contrast .table a:not(.btn):link,
body.high-contrast .table a:not(.btn):visited {
  color: var(--hc-text) !important;
  text-decoration: none !important;
}

body.high-contrast .table thead th a i,
body.high-contrast .table thead th a:hover i {
  color: var(--hc-text) !important;
}

body.high-contrast .badge {
  background-color: var(--hc-accent) !important;
  color: var(--hc-accent-text) !important;
  border: 1px solid var(--hc-accent) !important;
}

/* Paginação */
body.high-contrast .pagination .page-link {
  background-color: var(--hc-bg-alt) !important;
  color: var(--hc-text) !important;
  border: 2px solid var(--hc-border) !important;
}

body.high-contrast .pagination .page-link:hover,
body.high-contrast .pagination .page-link:focus {
  background-color: var(--hc-accent) !important;
  color: var(--hc-accent-text) !important;
  border-color: var(--hc-accent) !important;
}

body.high-contrast .pagination .page-item.active .page-link {
  background-color: var(--hc-accent) !important;
  color: var(--hc-accent-text) !important;
  border-color: var(--hc-accent) !important;
}

body.high-contrast .pagination .page-item.disabled .page-link {
  background-color: var(--hc-bg-dark) !important;
  color: #8a8a8a !important;
  border-color: #5a5a5a !important;
}

/* Breadcrumb */
body.high-contrast .breadcrumb-item,
body.high-contrast .breadcrumb-item.active {
  color: var(--hc-text) !important;
}

body.high-contrast .breadcrumb-item a {
  color: var(--hc-accent) !important;
}

body.high-contrast .breadcrumb-item + .breadcrumb-item::before {
  color: var(--hc-text) !important;
}

body.high-contrast .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}

body.high-contrast .topbar-avatar {
  background-color: var(--hc-accent) !important;
  color: var(--hc-accent-text) !important;
  border: 2px solid var(--hc-accent) !important;
}

body.high-contrast .topbar-user-menu .topbar-greeting,
body.high-contrast .topbar-user-menu .topbar-role {
  color: var(--hc-text) !important;
}

/* Card de perfil em alto contraste */
body.high-contrast .topbar-profile-menu {
  background-color: var(--hc-bg-alt) !important;
  border: 2px solid var(--hc-border) !important;
}

body.high-contrast .topbar-profile-header {
  background-color: var(--hc-bg-dark) !important;
  border-bottom: 2px solid var(--hc-border) !important;
}

body.high-contrast .topbar-profile-name,
body.high-contrast .topbar-profile-role {
  color: var(--hc-text) !important;
}

body.high-contrast .topbar-profile-avatar {
  background-color: var(--hc-accent) !important;
  color: var(--hc-accent-text) !important;
}

body.high-contrast .topbar-profile-logout {
  background-color: var(--hc-bg-alt) !important;
  color: var(--hc-text) !important;
  border: 0 !important;
}

body.high-contrast .topbar-user-menu .topbar-user-btn:hover,
body.high-contrast .topbar-user-menu .topbar-user-btn:focus {
  color: var(--hc-text) !important;
  background-color: var(--hc-bg-dark) !important;
}

body.high-contrast .topbar-profile-logout:hover,
body.high-contrast .topbar-profile-logout:focus {
  background-color: var(--hc-accent) !important;
  color: var(--hc-accent-text) !important;
}

body.high-contrast .topbar-divider {
  background-color: var(--hc-border) !important;
}

body.high-contrast .app-footer {
  background-color: var(--hc-bg) !important;
  color: var(--hc-text) !important;
  border-top: 2px solid var(--hc-border) !important;
}

/* Controles de acessibilidade no topbar em alto contraste — outline clean */
body.high-contrast .topbar-accessibility .btn,
body.high-contrast .topbar .sidebar-toggle,
body.high-contrast .topbar-notify,
body.high-contrast .topbar-user-menu .dropdown-toggle {
  background-color: transparent !important;
  color: var(--hc-text) !important;
  border: 2px solid var(--hc-border) !important;
}

body.high-contrast .topbar-accessibility .btn:hover,
body.high-contrast .topbar .sidebar-toggle:hover,
body.high-contrast .topbar-notify:hover,
body.high-contrast .topbar-user-menu .dropdown-toggle:hover,
body.high-contrast .topbar-accessibility .btn:focus,
body.high-contrast .topbar .sidebar-toggle:focus,
body.high-contrast .topbar-notify:focus,
body.high-contrast .topbar-user-menu .dropdown-toggle:focus {
  background-color: var(--hc-accent) !important;
  color: var(--hc-accent-text) !important;
  border-color: var(--hc-accent) !important;
}

body.high-contrast .topbar-accessibility .btn i,
body.high-contrast .topbar .sidebar-toggle i,
body.high-contrast .topbar-notify i,
body.high-contrast .topbar-user-menu .dropdown-toggle i {
  color: inherit !important;
}

/* Alterna as logos conforme o modo */
.topbar .navbar-brand img.topbar-logo,
.topbar-logo {
  width: 150px !important;
  height: 64px !important;
  max-width: 150px !important;
  max-height: 64px !important;
  object-fit: contain;
}

.topbar-brand {
  flex: 0 0 auto;
  min-width: 170px;
}

.btn-primary {
  --bs-btn-bg: #2C5290;
  --bs-btn-border-color: #2C5290;
  --bs-btn-hover-bg: #24457a;
  --bs-btn-hover-border-color: #24457a;
  --bs-btn-active-bg: #24457a;
  --bs-btn-active-border-color: #24457a;
  --bs-btn-focus-shadow-rgb: 44, 82, 144;
  --bs-btn-disabled-bg: #2C5290;
  --bs-btn-disabled-border-color: #2C5290;
}

.btn.btn-primary,
.btn.btn-primary:hover,
.btn.btn-primary:focus,
.btn.btn-primary:active,
.btn.btn-primary:focus-visible,
.btn.btn-primary.btn-sm,
.btn.btn-primary.btn-sm:hover,
.btn.btn-primary.btn-sm:focus,
.btn.btn-primary.btn-sm:active,
.btn.btn-primary.btn-sm:focus-visible {
  background-color: #2C5290 !important;
  border-color: #2C5290 !important;
  color: #fff !important;
}

.btn.btn-primary i,
.btn.btn-primary.btn-sm i {
  color: inherit;
}

.btn-outline-primary {
  --bs-btn-color: #2C5290;
  --bs-btn-border-color: #2C5290;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #2C5290;
  --bs-btn-hover-border-color: #2C5290;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #2C5290;
  --bs-btn-active-border-color: #2C5290;
  --bs-btn-disabled-color: #2C5290;
  --bs-btn-disabled-border-color: #2C5290;
  --bs-btn-focus-shadow-rgb: 44, 82, 144;
}

/* Links de ordenação da tabela e links gerais — exclui sidebar e navbar */
main a:not(.btn),
.page-link {
  color: #2C5290;
}
main a:not(.btn):hover,
.page-link:hover {
  color: #24457a;
}

/* Badge status homologado */
.badge.bg-primary {
  background-color: #2C5290 !important;
}

/* Paginação — página ativa */
.page-item.active .page-link {
  background-color: #2C5290;
  border-color: #2C5290;
  color: #fff;
}

/* Itens do dropdown (Editar, Publicar, Excluir etc.) */
.dropdown-item.text-primary,
.text-primary {
  color: #2C5290 !important;
}

/* Borda dos inputs e selects — cor institucional */
.form-control,
.form-select {
  border-color: #2C5290;
}

/* Autocomplete dropdown — ícone não intercepta cliques e remove caret padrão do Bootstrap em inputs */
.dropdown .js-autocomplete + .bi-chevron-down,
.dropdown .js-filter-dropdown-options + .bi-chevron-down {
  pointer-events: none;
}

input.dropdown-toggle::after,
.js-autocomplete::after,
.js-filter-dropdown-options::after {
  display: none !important;
}

/* Asterisco de campo obrigatório — vermelho */
.asteriskField {
  color: #dc3545;
  margin-left: 0.15rem;
}

/* Formulário de cadastro — labels azul institucional e largura dos campos */
.form-cadastro .form-label,
.form-cadastro label {
  color: #2C5290;
  font-weight: 500;
}

.form-cadastro .form-control:not(textarea),
.form-cadastro .form-select {
  max-width: 280px;
}

.form-cadastro .slug-readonly-input {
  background-color: #e9ecef !important;
  color: #495057;
  cursor: not-allowed;
}

/* Cadastro de oferta — campos em linha única preenchem a coluna (espaçamento uniforme) */
#form-oferta-cadastro .form-control:not(textarea),
#form-oferta-cadastro .form-select {
  max-width: none;
}

/* Botões Avançar da oferta — visual mais leve como no wireframe */
#form-oferta-cadastro #btn-avancar-oferta,
#form-oferta-cadastro #btn-avancar-documentos {
  font-weight: 400;
}

/* Focus dos inputs e selects — mesma família de cor institucional */
.form-control:focus,
.form-select:focus {
  border-color: #2C5290;
  box-shadow: 0 0 0 0.25rem rgba(44, 82, 144, 0.2);
}

main {
    min-height: calc(100vh - 9.6em);
}

.app-layout .site-main {
    min-height: auto;
    min-width: 0;
}

.site-main {
    padding: 1.5rem 2.5rem;
}

.app-layout .sidebar {
    min-height: 100%;
}

nav.navbar {
    background-color: #2C5290;
}

nav.navbar:not(.topbar) .navbar-brand img {
    width: auto;
    height: 64px;
    max-height: 64px;
}

footer div.footer-logos > img {
    max-height: 3em;
}

/* Footer dentro do layout base_app (com sidebar) */
.app-footer {
  background-color: #2C5290;
  color: rgba(255, 255, 255, 0.85);
  padding: 1.25rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  flex-wrap: wrap;
  flex-shrink: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.footer-info {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
  flex: 1 1 auto;
  min-width: 0;
}

.footer-version {
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.footer-name {
  font-size: 0.85rem;
  font-weight: 500;
}

.footer-logos {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1.5rem;
  flex-wrap: wrap;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
}

.app-footer .footer-logo {
  height: 2.25rem;
  max-height: 2.25rem;
  width: auto;
  max-width: 120px;
  flex-shrink: 0;
  /* Cada marca tem proporção própria (Codata ≈6:1, IngressaPB ≈4,3:1): todas
     usam a mesma caixa e o `contain` desenha dentro dela sem esticar. */
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.landing-public-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.landing-public-page > .container-fluid {
  flex: 1 0 auto;
}

.landing-public-page .app-footer {
  padding: 1rem 2.5rem;
}

.landing-public-page .footer-logos {
  gap: 1.25rem;
}

/* Botão Voltar — exibido ao final do conteúdo, antes do footer */
.app-voltar {
  margin: 1.5rem 0 0;
  padding-bottom: 0.5rem;
}

/* === Phase 2: Layout base_app — sidebar + topbar === */

.topbar {
  background-color: #2C5290; /* Azul institucional IngressaPB */
  min-height: 72px;
  z-index: 100;
}

.app-messages {
  position: fixed;
  top: 84px;
  right: 1.5rem;
  width: min(420px, calc(100vw - 2rem));
  z-index: 1080;
}

.app-messages:empty {
  display: none;
}

.app-messages .alert {
  margin-bottom: 0.75rem;
  box-shadow: 0 10px 24px rgba(15, 47, 78, 0.18);
}

.topbar-actions {
  line-height: 1;
}

.topbar :is(a[href], button):focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

.topbar .topbar-accessibility .btn:focus-visible {
  outline-offset: -3px;
}

.topbar .topbar-profile-menu :is(a[href], button):focus-visible,
.mobile-drawer .topbar-user-btn:focus-visible,
.mobile-drawer .topbar-accessibility .btn:focus-visible,
.mobile-drawer .topbar-profile-link:focus-visible,
.mobile-drawer .topbar-profile-logout:focus-visible {
  outline: 3px solid var(--ingressa-primary);
  outline-offset: -3px;
}

body.high-contrast .topbar :is(a[href], button):focus-visible,
body.high-contrast .mobile-drawer .topbar-user-btn:focus-visible,
body.high-contrast .mobile-drawer .topbar-accessibility .btn:focus-visible,
body.high-contrast .mobile-drawer .topbar-profile-link:focus-visible,
body.high-contrast .mobile-drawer .topbar-profile-logout:focus-visible {
  outline-color: currentColor;
}

.topbar-accessibility .btn {
  --bs-btn-color: #fff;
  --bs-btn-border-color: rgba(255, 255, 255, 0.35);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: rgba(255, 255, 255, 0.15);
  --bs-btn-hover-border-color: rgba(255, 255, 255, 0.6);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: rgba(255, 255, 255, 0.25);
  --bs-btn-active-border-color: #fff;
  font-size: 0.75rem;
  padding: 0.2rem 0.45rem;
  border-radius: 0.375rem;
}

.topbar-accessibility .btn-link {
  text-decoration: none;
  border: 0;
}

.topbar-accessibility .btn-group .btn {
  border-radius: 0;
}
.topbar-accessibility .btn-group .btn:first-child {
  border-top-left-radius: 0.375rem;
  border-bottom-left-radius: 0.375rem;
}
.topbar-accessibility .btn-group .btn:last-child {
  border-top-right-radius: 0.375rem;
  border-bottom-right-radius: 0.375rem;
}

.topbar-notify {
  opacity: 0.85;
}

/* Divisor vertical entre grupos do topbar */
.topbar-divider {
  width: 1px;
  height: 24px;
  background-color: rgba(255, 255, 255, 0.3);
  margin: 0 0.25rem;
}

/* Toggle de acessibilidade — abre/fecha os controles */
.accessibility-toggle {
  display: inline-flex;
  align-items: center;
  text-decoration: none !important;
}

.accessibility-chevron {
  font-size: 0.75rem;
  transition: transform 0.2s ease-in-out;
}

.accessibility-controls {
  overflow: hidden;
  max-width: 640px;
  opacity: 1;
  transition: max-width 0.25s ease-in-out, opacity 0.2s ease-in-out;
}

.accessibility-controls.is-collapsed {
  max-width: 0;
  opacity: 0;
  gap: 0 !important;
  pointer-events: none;
}

.accessibility-toggle[aria-expanded="false"] .accessibility-chevron {
  transform: rotate(180deg);
}

/* Grupo de tamanho de fonte com divisores */
.font-size-group .btn {
  border-color: rgba(255, 255, 255, 0.35);
}
.font-size-group .btn + .btn {
  border-left-width: 1px;
}
.font-size-reset {
  font-weight: 700;
}

/* Botão de perfil — sem sublinhado, texto branco */
.topbar-user-btn {
  color: #fff;
  border: 0;
  text-decoration: none !important;
  box-shadow: none !important;
}
.topbar-user-btn:hover,
.topbar-user-btn:focus {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.12);
}

.topbar-user-menu .dropdown-toggle::after {
  margin-left: 0.5rem;
  vertical-align: middle;
}

.topbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

.topbar-greeting {
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
}

.topbar-role {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  opacity: 0.85;
  white-space: nowrap;
  text-decoration: none;
}

/* Dropdown de perfil — card com cabeçalho azul (image 2) */
.topbar-profile-menu {
  padding: 0;
  min-width: 240px;
  overflow: hidden;
  border: 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.topbar-profile-header {
  background-color: #2C5290;
  color: #fff;
  padding: 1.25rem 1rem 1rem;
  text-align: center;
}

.topbar-profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.topbar-profile-name {
  font-size: 1rem;
  font-weight: 700;
}

.topbar-profile-role {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  opacity: 0.9;
}

.topbar-profile-group {
  padding: 0.5rem 1rem 0.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6c7a8b;
  background: transparent;
}

.topbar-profile-group ~ .topbar-profile-link {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

/* Opções de acesso do menu de perfil — ícone em "badge" com hover */
.topbar-profile-menu .topbar-profile-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  color: #1f2d3d;
  font-weight: 500;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.topbar-profile-menu .topbar-profile-link i.bi {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin: 0 !important;
  border-radius: 0.6rem;
  font-size: 1rem;
  color: var(--ingressa-primary);
  background: #eef3fb;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.topbar-profile-menu .topbar-profile-link:hover,
.topbar-profile-menu .topbar-profile-link:focus {
  background-color: #f4f8fd;
  color: var(--ingressa-primary);
}

.topbar-profile-menu .topbar-profile-link:hover i.bi,
.topbar-profile-menu .topbar-profile-link:focus i.bi {
  background: var(--ingressa-primary);
  color: #fff;
}

.topbar-profile-logout {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.75rem 1rem;
  color: #dc3545;
  font-weight: 500;
  background-color: #fff;
  border: 0;
  border-radius: 0;
  text-align: left;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.topbar-profile-logout:hover,
.topbar-profile-logout:focus {
  background-color: #f1aeb5 !important;
  color: #842029 !important;
}

.topbar-user {
  font-size: 0.95rem;
  font-weight: 500;
  white-space: nowrap;
}

.topbar-logout {
  padding: 0.4rem 0.8rem;
}

.topbar-user-dropdown {
  padding: 0.4rem 0.8rem;
  border-radius: 2rem;
}

.topbar-user-dropdown::after {
  margin-left: 0.5rem;
}

.dropdown-item-text i,
.dropdown-item i {
  color: inherit;
}

.topbar .sidebar-toggle {
  width: 40px;
  height: 40px;
  padding: 0;
  line-height: 1;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.topbar .sidebar-toggle:hover,
.topbar .sidebar-toggle:focus {
  box-shadow: none;
}

.sidebar-toggle-icon {
  font-size: 1rem;
}

/* Largura em rem para acompanhar o A+/A- (:root escala com --ingressa-font-scale).
   Em px o texto estourava a caixa e era cortado pelo overflow (issue #455).
   16.25rem = 260px na escala padrão. */
.sidebar {
  background: #ffffff;
  width: 16.25rem;
  min-width: 16.25rem;
  min-height: 0; /* necessário para flex-grow funcionar */
  border-right: 1px solid #d9e2ef;
  box-shadow: 2px 0 10px rgba(15, 47, 78, 0.08);
  overflow: hidden;
  transition: width 0.22s ease, min-width 0.22s ease;
}

.sidebar .nav-link {
  color: #2C5290;
  border-radius: 0.5rem;
  padding: 0.8rem 0.9rem;
  font-weight: 500;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  white-space: nowrap;
}

.sidebar .nav-link:hover {
  background-color: #2C5290;
  color: #fff;
  transform: translateX(1px);
}

.sidebar .nav-link:hover .sidebar-icon,
.sidebar .nav-link:hover .sidebar-label {
  color: #fff;
}

.sidebar .nav-pills .nav-link.active,
.sidebar .nav-link.active {
  background-color: #d9e6f6;
  color: #2C5290 !important;
  font-weight: 600;
}

.sidebar .nav-link.active .sidebar-icon,
.sidebar .nav-link.active .sidebar-label {
  color: #2C5290 !important;
}

.sidebar .sidebar-submenu {
  margin-left: -0.75rem;
  margin-right: -0.75rem;
}

.sidebar .sidebar-submenu .nav-link {
  border-radius: 0;
  padding-left: 2.25rem;
  padding-right: 0.75rem;
  display: block;
  width: 100%;
}

.sidebar .sidebar-submenu .nav-item {
  margin-bottom: 0;
}

.sidebar .sidebar-submenu .nav-link:hover {
  transform: none;
}

.sidebar .sidebar-submenu .nav-link.active {
  background-color: #d9e6f6;
  font-weight: 600;
}

.sidebar .nav-item:has(.sidebar-submenu .nav-link.active) > .nav-link {
  font-weight: 600;
}

.sidebar .sidebar-icon {
  font-size: 1.1rem;
  min-width: 1.1rem;
  text-align: center;
}

.sidebar .sidebar-label {
  display: inline;
  opacity: 1;
  transition: opacity 0.18s ease;
}

.sidebar .nav-item {
  border-bottom: 1px solid #e8eef7;
}

.sidebar .nav-item:last-child {
  border-bottom: 0;
}

/* 5.25rem = 84px na escala padrão; acompanha o A+/A- junto com o ícone (1.1rem). */
body.sidebar-collapsed .sidebar {
  width: 5.25rem;
  min-width: 5.25rem;
}

body.sidebar-collapsed .sidebar .nav-link {
  justify-content: center;
}

body.sidebar-collapsed .sidebar .nav-link:hover {
  background-color: #2C5290;
  color: #fff;
}

body.sidebar-collapsed .sidebar .sidebar-label {
  display: none;
  opacity: 0;
}

body.sidebar-collapsed .sidebar .sidebar-submenu {
  display: none !important;
}

body.sidebar-collapsed .topbar .sidebar-toggle-icon {
  font-size: 1rem;
}

/* Separador visual entre seções do sidebar se necessário */
.sidebar .nav-divider {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin: 0.5rem 0;
}

/* Espaço inferior reduzido para evitar que dropdowns sejam cortados
   sem criar grande área em branco abaixo das tabelas */
.table-responsive {
  padding-bottom: 1rem;
}

/* === Breadcrumb — ícone de home + separador chevron (image 3) === */
.app-breadcrumb {
  --bs-breadcrumb-divider: '>';
  align-items: center;
  margin-bottom: 0;
  font-size: 0.85rem;
}

.app-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
  color: #7a8aa0;
  font-weight: 400;
  padding-right: 0.3rem;
}

.app-breadcrumb .breadcrumb-item + .breadcrumb-item {
  padding-left: 0.3rem;
}

.app-breadcrumb .breadcrumb-item a {
  color: #2C5290;
  font-weight: 400;
  text-decoration: none;
}

.app-breadcrumb .breadcrumb-item a:hover {
  text-decoration: underline;
}

.app-breadcrumb .breadcrumb-item.active {
  color: #1f2d3d;
  font-weight: 500;
}

.app-breadcrumb .breadcrumb-home a {
  display: inline-flex;
  align-items: center;
  font-size: 0.9rem;
  line-height: 1;
}

/* ==========================================================================
   Painel do candidato
   ========================================================================== */
.candidate-dashboard-welcome {
  padding: 1.25rem 1.5rem;
  color: #fff;
  background: linear-gradient(135deg, #1e3a66 0%, var(--ingressa-primary) 100%);
  border-radius: 1rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.candidate-dashboard .card {
  border: 1px solid #e2e8f0;
  border-radius: 0.875rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.candidate-dashboard .card:not(.offer-card):hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.offer-card {
  display: block;
  color: inherit;
  border: 1px solid #e2e8f0;
}

.offer-card:hover {
  box-shadow: 0 8px 20px rgba(44, 82, 144, 0.12);
  transform: translateY(-2px);
  border-color: #b8d4f3;
}

.offer-card .card-title {
  color: #1e293b;
  font-weight: 600;
}

.offer-card .stretched-link {
  pointer-events: none;
}

.offer-card .btn-outline-primary:hover {
  color: #fff;
  background: var(--ingressa-primary);
  border-color: var(--ingressa-primary);
}

.candidate-dashboard .badge {
  white-space: nowrap;
}

/* Alto contraste — painel do candidato (aplica em todas as larguras) */
body.high-contrast .candidate-dashboard-welcome {
  color: var(--hc-text) !important;
  background: var(--hc-bg-alt) !important;
  border: 2px solid var(--hc-border) !important;
  background-image: none !important;
}

body.high-contrast .candidate-dashboard-welcome h1,
body.high-contrast .candidate-dashboard-welcome .h4 {
  color: var(--hc-accent) !important;
}

body.high-contrast .candidate-dashboard .card,
body.high-contrast .offer-card {
  color: var(--hc-text) !important;
  background: var(--hc-bg-alt) !important;
  border: 2px solid var(--hc-border) !important;
}

body.high-contrast .offer-card .card-title {
  color: var(--hc-accent) !important;
}

/* Alto contraste — ícones "badge" das opções de perfil */
body.high-contrast .topbar-profile-menu .topbar-profile-link i.bi {
  background: transparent !important;
  color: inherit !important;
}

body.high-contrast .topbar-profile-menu .topbar-profile-link:hover i.bi,
body.high-contrast .topbar-profile-menu .topbar-profile-link:focus i.bi {
  background: transparent !important;
  color: var(--hc-accent-text) !important;
}

/* ==========================================================================
   Responsividade — mobile / tablet
   ========================================================================== */

.mobile-drawer {
  display: none;
}

@media (max-width: 991.98px) {
  #desktop-sidebar-slot {
    display: none;
  }

  .topbar-actions {
    display: none !important;
  }

  html,
  body {
    overflow-x: hidden;
  }

  .mobile-drawer-toggle {
    position: fixed;
    top: 1rem;
    right: auto;
    left: 1rem;
    z-index: 1110;
    width: 44px;
    height: 44px;
    margin: 0 !important;
    border-radius: 50%;
    background: var(--ingressa-primary);
    border-color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.24);
  }

  body.mobile-drawer-open .mobile-drawer-toggle {
    display: none;
  }

  .mobile-drawer {
    --bs-offcanvas-width: min(360px, calc(100vw - 32px));
    --bs-offcanvas-zindex: 1100;
    --bs-offcanvas-border-width: 0;
    --bs-offcanvas-transition: transform 0.2s ease-in-out;
    position: fixed;
    inset: 0 auto 0 0;
    display: flex;
    flex-direction: column;
    max-width: 100%;
    padding: 1rem;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    color: #1f2d3d;
    background: #fff;
    box-shadow: 8px 0 24px rgba(0, 0, 0, 0.22);
  }

  body.mobile-drawer-open > .offcanvas-backdrop {
    z-index: 1090;
  }

  body.mobile-drawer-open > .offcanvas-backdrop.show {
    opacity: 0.55;
  }

  .mobile-drawer::-webkit-scrollbar {
    display: none;
  }

  .mobile-drawer-header,
  .mobile-drawer-section,
  .mobile-drawer-logout {
    margin-bottom: 1.25rem;
  }

  .topbar-brand {
    margin-left: 60px;
    align-self: center;
  }

  .mobile-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    padding: 0 0.5rem 1rem 0;
    border-bottom: 1px solid #d9e2ef;
  }

  .mobile-drawer-title,
  .mobile-drawer-section-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
  }

  .mobile-drawer-section-title {
    margin-bottom: 0.5rem;
    color: var(--ingressa-primary);
  }

  .mobile-drawer-section {
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #d9e2ef;
  }

  .mobile-drawer-profile-card {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    width: 100%;
    padding: 0.875rem 1rem;
    text-align: left;
    color: #1f2d3d;
    border: 1px solid #d9e2ef;
    border-radius: 0.75rem;
    background: #f8fafc;
  }

  .mobile-drawer-profile-card .topbar-avatar {
    flex: 0 0 auto;
    width: 2.5rem;
    height: 2.5rem;
    background: var(--ingressa-primary);
  }

  .mobile-drawer-profile-card .topbar-greeting,
  .mobile-drawer-profile-card .topbar-role {
    color: inherit;
    line-height: 1.3;
  }

  .mobile-drawer-profile-card .topbar-role {
    font-size: 0.75rem;
    text-transform: uppercase;
    opacity: 0.8;
  }

  .mobile-drawer .topbar-user-btn .text-start {
    display: block !important;
    color: #1f2d3d !important;
  }

  .mobile-drawer-section .sidebar {
    position: static;
    display: flex;
    width: 100% !important;
    min-width: 0 !important;
    padding: 0;
    box-shadow: none;
    border: 0;
  }

  .mobile-drawer-section .sidebar .nav {
    width: 100%;
  }

  .mobile-drawer-section .sidebar .sidebar-label {
    display: inline !important;
    opacity: 1 !important;
  }

  .mobile-drawer-section .sidebar > .nav {
    gap: 0.5rem;
  }

  .mobile-drawer-section .sidebar .nav-link,
  .mobile-drawer .topbar-profile-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 3rem;
    padding: 0.75rem 1rem !important;
    border: 1px solid #d9e2ef;
    border-radius: 0.75rem;
    background: #f8fafc;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  }

  .mobile-drawer-section .sidebar .nav-link {
    justify-content: flex-start !important;
  }

  .mobile-drawer-section .sidebar .nav-link:hover,
  .mobile-drawer-section .sidebar .nav-link:focus-visible,
  .mobile-drawer .topbar-profile-link:hover,
  .mobile-drawer .topbar-profile-link:focus-visible {
    color: var(--ingressa-primary) !important;
    background: #eef3fb !important;
    border-color: var(--ingressa-primary) !important;
    transform: none !important;
  }

  .mobile-drawer-section .sidebar .nav-link:hover .sidebar-icon,
  .mobile-drawer-section .sidebar .nav-link:hover .sidebar-label,
  .mobile-drawer-section .sidebar .nav-link:focus-visible .sidebar-icon,
  .mobile-drawer-section .sidebar .nav-link:focus-visible .sidebar-label {
    color: var(--ingressa-primary) !important;
  }

  .mobile-drawer-section .sidebar .nav-link.active {
    color: #fff !important;
    background: var(--ingressa-primary) !important;
    border-color: var(--ingressa-primary) !important;
  }

  .mobile-drawer-section .sidebar .nav-link.active .sidebar-icon,
  .mobile-drawer-section .sidebar .nav-link.active .sidebar-label {
    color: #fff !important;
  }

  .mobile-drawer-section .sidebar-submenu {
    margin: 0.5rem 0 0.5rem 1.25rem;
    padding: 0.25rem 0 0.25rem 0.75rem;
    border-left: 2px solid #d9e2ef;
  }

  .mobile-drawer .mobile-drawer-section .sidebar .sidebar-submenu.collapse.show {
    display: block !important;
  }

  .mobile-drawer-section .sidebar-submenu > .nav {
    gap: 0.375rem;
  }

  .mobile-drawer-section .sidebar-submenu .nav-link {
    min-height: 2.5rem;
    padding: 0.5rem 0.75rem !important;
    border: 0;
    border-radius: 0.5rem;
    background: transparent;
  }

  .mobile-drawer-section .sidebar-submenu .nav-link:hover,
  .mobile-drawer-section .sidebar-submenu .nav-link:focus-visible {
    background: #eef3fb !important;
  }

  .mobile-drawer-section .sidebar-submenu .nav-link.active {
    color: var(--ingressa-primary) !important;
    background: #d9e6f6 !important;
  }

  .mobile-drawer .topbar-user-menu,
  .mobile-drawer .topbar-accessibility {
    display: block !important;
  }

  .mobile-drawer .topbar-profile-menu {
    position: static;
    display: block !important;
    width: 100%;
    min-width: 0;
    padding: 0;
    margin-top: 0.625rem;
    box-shadow: none;
    border: 0;
    border-radius: 0;
    background: transparent;
    overflow: visible;
  }

  .mobile-drawer .topbar-profile-group {
    display: block;
    padding: 0.5rem 0.25rem 0.25rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #7a8ba1;
  }

  .mobile-drawer .topbar-profile-menu .dropdown-divider {
    display: none;
  }

  .mobile-drawer .topbar-profile-header {
    display: none;
  }

  .mobile-drawer .topbar-profile-link {
    gap: 0.75rem;
  }

  .mobile-drawer .topbar-profile-link + .topbar-profile-link {
    margin-top: 0.625rem;
  }

  .mobile-drawer .topbar-profile-link:hover i.bi,
  .mobile-drawer .topbar-profile-link:focus-visible i.bi {
    background: var(--ingressa-primary) !important;
    color: #fff !important;
  }

  .mobile-drawer .topbar-profile-logout {
    width: 100%;
    text-align: left;
    color: #dc3545;
    background: #fff;
    border: 0;
    border-radius: 0.5rem;
    padding: 0.625rem 0.75rem;
    transition: background-color 0.15s ease, color 0.15s ease;
  }

  .mobile-drawer .topbar-profile-logout:hover,
  .mobile-drawer .topbar-profile-logout:focus-visible {
    background-color: #f1aeb5 !important;
    color: #842029 !important;
  }

  .mobile-drawer .accessibility-toggle {
    display: none;
  }

  .mobile-drawer .accessibility-controls {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    max-width: none;
    gap: 0.5rem !important;
  }

  .mobile-drawer .topbar-accessibility .btn,
  .mobile-drawer .vlibras-link {
    width: 100%;
    color: #1f2d3d;
    border-color: #9aa9bb;
    text-align: left;
  }

  .mobile-drawer .font-size-group {
    width: 100%;
  }

  .mobile-drawer .font-size-group .btn {
    flex: 1;
  }

  .mobile-drawer .topbar-divider,
  .mobile-drawer .dropdown-toggle::after {
    display: none;
  }

  .site-main {
    padding: 1rem 1.25rem;
  }

  .app-footer {
    padding: 1rem 1.25rem;
  }

  body.high-contrast .mobile-drawer {
    color: var(--hc-text);
    background: var(--hc-bg-alt);
    border-right: 2px solid var(--hc-border);
  }

  body.high-contrast .mobile-drawer-header {
    border-color: var(--hc-border);
  }

  body.high-contrast .mobile-drawer-section-title {
    color: var(--hc-accent);
  }

  body.high-contrast .mobile-drawer .topbar-user-btn,
  body.high-contrast .mobile-drawer .topbar-user-btn:hover,
  body.high-contrast .mobile-drawer .topbar-user-btn:focus,
  body.high-contrast .mobile-drawer .topbar-user-menu .topbar-user-btn:hover,
  body.high-contrast .mobile-drawer .topbar-user-menu .topbar-user-btn:focus {
    color: var(--hc-text) !important;
    background: var(--hc-bg-dark) !important;
    border-color: var(--hc-border) !important;
  }

  body.high-contrast .mobile-drawer-section {
    border-color: var(--hc-border);
  }

  body.high-contrast .mobile-drawer .topbar-greeting,
  body.high-contrast .mobile-drawer .topbar-role {
    color: var(--hc-text) !important;
  }

  body.high-contrast .mobile-drawer .topbar-avatar {
    background: var(--hc-accent);
    color: var(--hc-accent-text);
  }

  body.high-contrast .mobile-drawer .topbar-accessibility .btn {
    color: var(--hc-text);
    border-color: var(--hc-border);
  }

  body.high-contrast .mobile-drawer .sidebar {
    background: transparent !important;
  }

  body.high-contrast .mobile-drawer-section .sidebar .nav-link,
  body.high-contrast .mobile-drawer .topbar-profile-link {
    color: var(--hc-text) !important;
    background: var(--hc-bg-dark) !important;
    border-color: var(--hc-border) !important;
  }

  body.high-contrast .mobile-drawer-section .sidebar .nav-link.active {
    color: var(--hc-accent-text) !important;
    background: var(--hc-accent) !important;
    border-color: var(--hc-accent) !important;
  }

  body.high-contrast .mobile-drawer-section .sidebar .nav-link:hover,
  body.high-contrast .mobile-drawer-section .sidebar .nav-link:focus-visible,
  body.high-contrast .mobile-drawer .topbar-profile-link:hover,
  body.high-contrast .mobile-drawer .topbar-profile-link:focus-visible {
    color: var(--hc-accent-text) !important;
    background: var(--hc-accent) !important;
    border-color: var(--hc-accent) !important;
  }

  body.high-contrast .mobile-drawer-section .sidebar .nav-link:hover .sidebar-icon,
  body.high-contrast .mobile-drawer-section .sidebar .nav-link:hover .sidebar-label,
  body.high-contrast .mobile-drawer-section .sidebar .nav-link:focus-visible .sidebar-icon,
  body.high-contrast .mobile-drawer-section .sidebar .nav-link:focus-visible .sidebar-label {
    color: var(--hc-accent-text) !important;
  }

  body.high-contrast .mobile-drawer .topbar-profile-menu {
    background: transparent !important;
    border: 0 !important;
  }

  body.high-contrast .mobile-drawer .topbar-profile-logout {
    color: var(--hc-text) !important;
    background: var(--hc-bg-dark) !important;
    border: 2px solid var(--hc-border) !important;
  }

  body.high-contrast .mobile-drawer .topbar-profile-logout:hover,
  body.high-contrast .mobile-drawer .topbar-profile-logout:focus-visible {
    color: var(--hc-accent-text) !important;
    background: var(--hc-accent) !important;
    border-color: var(--hc-accent) !important;
  }
}

@media (max-width: 575.98px) {
  .topbar-brand .topbar-logo {
    width: 110px;
    height: auto;
  }

  .topbar .accessibility-controls {
    display: none;
  }

  .topbar-divider {
    display: none;
  }

  /* Upload pós-inscrição — reflow local conforme o wireframe mobile. */
  .documentos-upload-table {
    display: block;
    width: 100%;
    max-width: 100%;
    margin-bottom: 0;
    border: 0;
  }

  .documentos-upload-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .documentos-upload-table tbody {
    display: block;
    width: 100%;
    border: 0;
  }

  .documentos-upload-table tbody tr {
    display: block;
    width: 100%;
    padding: 0.75rem 0;
    border-bottom: 1px solid #d8e1ef;
  }

  .documentos-upload-table tbody tr:first-child {
    border-top: 1px solid #d8e1ef;
  }

  .documentos-upload-table tbody td {
    display: block;
    width: 100%;
    min-width: 0;
    padding: 0.25rem 0;
    border: 0;
    overflow-wrap: anywhere;
  }

  .documentos-upload-table tbody tr[data-doc-pk] td:first-child {
    padding-bottom: 0.5rem;
    font-weight: 600;
  }

  .documentos-upload-table .documentos-upload-mobile-label {
    font-weight: 600;
    color: #2C5290;
  }

  .documentos-upload-table .upload-badge {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: left;
    line-height: 1.25;
  }

  .documentos-upload-table .btn-upload {
    display: block;
    width: 100%;
    max-width: 100%;
    margin-top: 0.25rem;
    white-space: normal;
  }

  body.high-contrast .documentos-upload-table tbody tr {
    border-color: var(--hc-border);
  }

  body.high-contrast .documentos-upload-table .documentos-upload-mobile-label {
    color: var(--hc-accent);
  }
}

@media (max-width: 767.98px) {
  .site-main {
    padding: 0.75rem 1rem;
  }

  .app-footer {
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
  }

  .footer-info {
    align-items: center;
    text-align: center;
  }

  .footer-logos {
    justify-content: center;
  }

  .app-footer .footer-logo {
    height: 1.75rem;
    max-height: 1.75rem;
    max-width: 90px;
  }

  /* Campos de filtro empilham em largura total no mobile */
  .filter-fields > .col-12 {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .filter-fields > .col-12 h6 {
    white-space: nowrap;
  }

  .filter-fields .col-auto {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .filter-fields .col-auto input,
  .filter-fields .col-auto select {
    width: 100%;
  }

  .filter-fields #menu-status .form-check-input,
  .filter-fields #menu-oferta .form-check-input {
    width: 1em;
  }

  .filter-fields .col-auto .form-control,
  .filter-fields .col-auto .form-select {
    min-width: 0 !important;
  }
}

/* ==========================================================================
   Tabelas responsivas — cards em mobile
   ========================================================================== */
.mobile-card-header {
  display: none;
}

@media (max-width: 767.98px) {
  .table-responsive {
    overflow: visible !important;
  }

  .table-responsive .table thead {
    display: none;
  }

  .table-responsive .table,
  .table-responsive .table tbody,
  .table-responsive .table tr,
  .table-responsive .table td {
    display: block;
  }

  .table-responsive .table,
  .table-responsive .table tbody {
    width: 100%;
  }

  .table-responsive .table td {
    width: 100%;
    box-sizing: border-box;
  }

  .table-responsive .table tr {
    position: relative;
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
    border: 1px solid #d8e1ef;
    border-radius: 0.5rem;
    padding: 0;
    overflow: visible;
    background-color: #fff;
  }

  .table-responsive .table td {
    position: relative;
    text-align: left !important;
    border: none;
    padding: 0.5rem 1rem;
  }

  .table-responsive .table td::before {
    content: attr(data-label) ": ";
    font-weight: 600;
    color: #2C5290;
    margin-right: 0.5rem;
  }

  .table-responsive .table td[data-label=""],
  .table-responsive .table td[data-label="Ação"],
  .table-responsive .table td[data-label="Ações"] {
    text-align: right !important;
  }

  .table-responsive .table td[data-label=""]::before,
  .table-responsive .table td[data-label="Ação"]::before,
  .table-responsive .table td[data-label="Ações"]::before {
    display: none;
  }

  .table-responsive .table td .dropdown,
  .table-responsive .table td .btn-group {
    justify-content: flex-end;
  }

  .table-responsive .table td.mobile-card-header {
    width: auto;
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: #fff;
    background-color: #2C5290;
    text-align: left !important;
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
  }

  .table-responsive .table td.mobile-card-header::before {
    display: none;
  }

  .table-responsive .table td.mobile-card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    margin-top: auto;
    border-top: 1px solid #d8e1ef;
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
    background-color: #f8fafc;
    text-align: right !important;
  }

  .table-responsive .table td.mobile-card-actions::before {
    display: none;
  }

  .table-responsive .table td.mobile-card-actions .btn,
  .table-responsive .table td.mobile-card-actions .dropdown {
    flex: 0 0 auto;
  }
}

/* Alto contraste — ajustes para cards de tabela */
body.high-contrast .table-responsive .table tr {
  background-color: var(--hc-bg-alt) !important;
  border-color: var(--hc-border) !important;
}

body.high-contrast .table-responsive .table td::before {
  color: var(--hc-accent) !important;
}
