/* PADRÃO DO SISTEMA — combos de filtro com busca (Select2), estilo do filtro de empresa de /admin/convenios.
   Ver static/js/combo_busca.js. */
select.combo-busca + .select2-container { width: 100% !important; max-width: 100%; min-width: 0; }
.select2-container--bootstrap-5 .select2-selection--single {
    min-height: 44px; height: auto !important; padding: 10px 12px !important; border-radius: 8px !important;
    border: 1px solid #ced4da; overflow: hidden; display: flex; align-items: center;
}
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    padding: 0 !important; padding-right: 34px !important; line-height: 1.5; color: #1f2937;
}
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__placeholder { color: #6b7280; }
.select2-container--bootstrap-5.select2-container--focus .select2-selection,
.select2-container--bootstrap-5.select2-container--open .select2-selection {
    border-color: #66b2b2; box-shadow: 0 0 0 .2rem rgba(0, 128, 128, .18);
}
.select2-container--bootstrap-5 .select2-dropdown { border-color: #66b2b2; border-radius: 8px; overflow: hidden; z-index: 2000; }
.select2-container--bootstrap-5 .select2-search--dropdown .select2-search__field { border-radius: 6px; min-height: 38px; }
/* opção mostra o nome INTEIRO (quebra a linha), na largura toda da lista — nunca corta com "…" */
.select2-container .select2-results__option {
    max-width: none !important; white-space: normal !important; overflow: visible !important; text-overflow: clip !important;
    padding: 10px 14px; font-size: .85rem; line-height: 1.3; word-break: break-word;
    font-weight: 600; color: #1f2937; border-bottom: 1px solid #f3f4f6; transition: background .15s;
}
/* VISUAL PADRÃO DAS OPÇÕES (31/10/2026) = busca de /admin/empresas: fundo branco, linha fina entre as opções,
   passar o mouse = verde-água claro (não mais o fundo verde cheio), escolhida = faixa verde à esquerda */
.select2-container .select2-results__option--highlighted,
.select2-container--bootstrap-5 .select2-results__option--highlighted { background: #f0fdfa !important; color: #1f2937 !important; }
.select2-container .select2-results__option--selected,
.select2-container--bootstrap-5 .select2-results__option--selected {
    background: #e6f2f2 !important; color: #0f3d3d !important; box-shadow: inset 3px 0 0 #008080;
}
.select2-container .select2-results__message { font-weight: 400; color: #9ca3af; text-align: center; border-bottom: 0; padding: 14px; }
.select2-container .select2-results__option--disabled { color: #9ca3af !important; font-weight: 400; }
.combo-op-nome { font-weight: 600; font-size: .85rem; color: #1f2937; }
.combo-op-icone { color: #008080; margin-right: 6px; font-size: .75rem; width: 12px; text-align: center; }
.combo-op-sub { font-size: .72rem; font-weight: 400; color: #64748b; margin-top: 2px; margin-left: 18px; }
.combo-op-sub.sem-icone { margin-left: 0; }
.combo-op-sub.combo-op-doc { font-family: SFMono-Regular, Menlo, Consolas, monospace; font-size: .7rem; }
.select2-container .select2-results > .select2-results__options { max-height: 320px; }
.select2-container--bootstrap-5 .select2-dropdown { box-shadow: 0 8px 24px rgba(0, 0, 0, .12); }
/* versões menores (filtros compactos, ex.: form-select-sm) */
select.combo-busca.form-select-sm + .select2-container .select2-selection--single { min-height: 36px; padding: 6px 10px !important; font-size: .875rem; }
/* grupos (<optgroup>), ex.: Mês/Ano agrupado por ano */
.select2-container .select2-results__option[role="group"] { padding: 0 !important; border-bottom: 0; }
.select2-container .select2-results__group {
    display: block; position: sticky; top: 0; z-index: 1; background: #e6f2f2 !important; color: #006666 !important; font-weight: 800;
    font-size: .8rem; letter-spacing: .04em; padding: .35rem .75rem !important; border-top: 1px solid #b3d9d9;
    border-bottom: 1px solid #b3d9d9;
}
.select2-container .select2-results__options--nested .select2-results__option { padding-left: 1.5rem !important; }
/* VÁRIAS OPÇÕES (select multiple.combo-busca) — 29/10/2026: mesma caixa do combo simples, escolhidas em etiquetas */
.select2-container--bootstrap-5 .select2-selection--multiple {
    min-height: 44px; height: auto !important; padding: 5px 42px 5px 8px !important; border-radius: 8px !important;
    border: 1px solid #ced4da; display: flex; align-items: center; flex-wrap: wrap; background: #fff;
}
.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered {
    display: flex !important; flex-wrap: wrap; gap: 6px; padding: 0 !important; margin: 0; list-style: none; width: auto;
    min-width: 0; max-width: 100%;
}
.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice {
    display: inline-flex !important; align-items: center; gap: 6px; margin: 0 !important; padding: 3px 4px 3px 12px !important;
    background: linear-gradient(180deg, #f0f8f8 0%, #e1f0f0 100%) !important; border: 1px solid #a8d4d4 !important;
    border-radius: 14px !important; color: #0f3d3d !important; font-size: .82rem; font-weight: 600; line-height: 1.3;
    max-width: 100%; box-shadow: 0 1px 2px rgba(0, 80, 80, .08); transition: border-color .15s ease, background .15s ease;
}
.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice:hover { border-color: #66b2b2 !important; }
/* etiqueta que vai sair (mouse no "x"): fica avermelhada para deixar claro o que será removido */
.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice:has(.select2-selection__choice__remove:hover) {
    background: #fdecee !important; border-color: #f1a7af !important; color: #9b1c2c !important;
}
.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice__display { padding: 0 !important; white-space: normal; word-break: break-word; }
/* "x" de cada etiqueta: o tema esconde o "×" (text-indent + span display:none) e desenha um ícone de fundo; aqui
   o "×" fica à DIREITA num círculo de 20px (fácil de clicar/tocar), vermelho ao passar o mouse. Seletor longo = vence o tema. */
.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered .select2-selection__choice .select2-selection__choice__remove {
    position: static !important; order: 2; flex: 0 0 auto; width: 20px !important; height: 20px !important;
    margin: 0 !important; padding: 0 !important; overflow: visible !important; text-indent: 0 !important;
    border: 0 !important; border-radius: 50%; background: rgba(0, 128, 128, .14) !important; color: #006666 !important;
    cursor: pointer; display: inline-flex !important; align-items: center; justify-content: center; font-size: 17px !important;
    transition: background .15s ease, color .15s ease, transform .15s ease;
}
.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered .select2-selection__choice .select2-selection__choice__remove > span {
    display: block !important; color: inherit !important; font-size: 17px !important; font-weight: 700; line-height: 1; margin-top: -2px;
}
.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered .select2-selection__choice .select2-selection__choice__remove:hover,
.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered .select2-selection__choice .select2-selection__choice__remove:focus-visible {
    background: #dc3545 !important; color: #fff !important; transform: scale(1.1); outline: 0;
}
.select2-container--bootstrap-5 .select2-selection--multiple .select2-search--inline { flex: 1 1 40px; min-width: 40px; }
.select2-container--bootstrap-5 .select2-selection--multiple .select2-search__field {
    width: 100% !important; margin: 0 !important; padding: 3px 2px !important; min-height: 28px; height: auto;
    font-size: .95rem; color: #1f2937; border: 0 !important; box-shadow: none !important; outline: 0;
}
.select2-container--bootstrap-5 .select2-selection--multiple .select2-search__field::placeholder { color: #6b7280; }
/* "x" de LIMPAR TODAS: botão redondo de 26px no canto direito, vermelho ao passar o mouse */
.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__clear {
    position: absolute !important; right: 8px !important; top: 50% !important; transform: translateY(-50%);
    width: 26px !important; height: 26px !important; margin: 0 !important; padding: 0 !important;
    overflow: visible !important; text-indent: 0 !important; border: 1px solid #d5dde0 !important; border-radius: 50%;
    background: #f4f7f8 !important; color: #6b7280 !important; cursor: pointer;
    display: inline-flex !important; align-items: center; justify-content: center;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__clear > span {
    display: block !important; color: inherit !important; font-size: 20px !important; font-weight: 600; line-height: 1; margin-top: -2px;
}
.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__clear:hover,
.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__clear:focus-visible {
    background: #dc3545 !important; border-color: #dc3545 !important; color: #fff !important; outline: 0;
}
/* passar o mouse no "limpar todas": todas as etiquetas ficam avermelhadas (todas vão sair) */
.select2-container--bootstrap-5 .select2-selection--multiple:has(.select2-selection__clear:hover) .select2-selection__choice {
    background: #fdecee !important; border-color: #f1a7af !important; color: #9b1c2c !important;
}
/* campo obrigatório vazio / com erro de validação (as telas marcam o <select> original) */
select.combo-busca.missing-field + .select2-container .select2-selection,
select.combo-busca.validation-error + .select2-container .select2-selection,
.select2-missing select.combo-busca + .select2-container .select2-selection,
.select2-validation-error.select2-container .select2-selection {
    border: 2px solid #ef4444 !important; background-color: #fef2f2 !important;
}
/* LISTA ABERTA = cartão solto (31/10/2026, usuário: "quando desce fica meio cortado"): o tema gruda a lista no campo
   (sem borda de cima/cantos retos) e achata os cantos do campo. Igual à busca de /admin/empresas: 4px de folga,
   borda inteira, cantos 8px, sombra; o campo não muda de forma ao abrir. */
.select2-container--bootstrap-5 .select2-dropdown,
.select2-container--bootstrap-5 .select2-dropdown.select2-dropdown--below,
.select2-container--bootstrap-5 .select2-dropdown.select2-dropdown--above {
    border: 1px solid #cfe3e3 !important; border-radius: 8px !important; overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .12) !important;
}
.select2-container--bootstrap-5 .select2-dropdown.select2-dropdown--below { margin-top: 4px; }
.select2-container--bootstrap-5 .select2-dropdown.select2-dropdown--above { margin-top: -4px; }
.select2-container--bootstrap-5.select2-container--open.select2-container--below .select2-selection,
.select2-container--bootstrap-5.select2-container--open.select2-container--above .select2-selection {
    border-radius: 8px !important;
}
.select2-container--bootstrap-5 .select2-dropdown .select2-results__options .select2-results__option:last-child { border-bottom: 0; }
.select2-container--bootstrap-5 .select2-search--dropdown { padding: 8px 8px 4px; }
.select2-container--bootstrap-5 .select2-search--dropdown .select2-search__field:focus {
    border-color: #66b2b2 !important; box-shadow: 0 0 0 .2rem rgba(0, 128, 128, .18) !important; outline: 0;
}

/* 04/11/2026: opção com cor (data-tom) e número (data-qtd) — filtro de supervisores x nº de estagiários vigentes */
.combo-op-qtd { margin-left: auto; padding: 0 8px; border-radius: 999px; font-size: .72rem; font-weight: 800; line-height: 18px;
    background: #e2e8f0; color: #334155; font-variant-numeric: tabular-nums;
    white-space: nowrap; flex: 0 0 auto; min-width: 26px; text-align: center; }  /* nunca quebra "25" em 2 linhas */
.combo-op-nome { display: flex; align-items: center; gap: 6px; }
.combo-op[class*="combo-tom-"] { border-left: 4px solid transparent; padding-left: 8px; margin-left: -4px; }
.combo-tom-cinza { border-left-color: #cbd5e1 !important; }
.combo-tom-verde { border-left-color: #16a34a !important; } .combo-tom-verde .combo-op-qtd { background: #dcfce7; color: #166534; }
.combo-tom-amarelo { border-left-color: #eab308 !important; } .combo-tom-amarelo .combo-op-qtd { background: #fef9c3; color: #854d0e; }
.combo-tom-laranja { border-left-color: #ea580c !important; } .combo-tom-laranja .combo-op-qtd { background: #ffedd5; color: #9a3412; }
.combo-tom-vermelho { border-left-color: #dc2626 !important; } .combo-tom-vermelho .combo-op-qtd { background: #fee2e2; color: #991b1b; }

/* SELO antes do nome (data-selo) e MINI ABAS por tipo (data-abas="tipo") — 05/11/2026, pedido do usuário */
.combo-op-selo { display: inline-flex; align-items: center; font-size: .6rem; font-weight: 800; letter-spacing: .4px; text-transform: uppercase;
  padding: 1px 7px; border-radius: 999px; border: 1px solid; margin-right: 7px; vertical-align: middle; line-height: 1.5; white-space: nowrap; }
.combo-op-selo.selo-estagio { background: #e0e7ff; color: #3730a3; border-color: #a5b4fc; }
.combo-op-selo.selo-clt { background: #ede9fe; color: #5b21b6; border-color: #c4b5fd; }
.combo-op-selo.selo-aprendiz { background: #ffedd5; color: #9a3412; border-color: #fdba74; }
.combo-op-selo.selo-outro { background: #f1f5f9; color: #475569; border-color: #cbd5e1; }
.combo-escolhido { display: inline-flex; align-items: center; min-width: 0; }
.combo-abas { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 10px 6px; border-bottom: 1px solid #e2e8f0; background: #f8fafc; }
.combo-aba { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #cbd5e1; background: #fff; color: #334155; cursor: pointer;
  border-radius: 999px; padding: 3px 11px; font-size: .74rem; font-weight: 700; transition: background .15s, color .15s, border-color .15s; }
.combo-aba:hover { border-color: #008080; color: #006666; }
.combo-aba .combo-aba-n { min-width: 20px; padding: 0 6px; border-radius: 999px; background: #e2e8f0; color: #334155; font-size: .68rem; font-weight: 800; text-align: center; }
.combo-aba.ativa { background: #008080; border-color: #008080; color: #fff; }
.combo-aba.ativa .combo-aba-n { background: rgba(255,255,255,.25); color: #fff; }
.combo-aba.aba-estagio.ativa { background: #4338ca; border-color: #4338ca; }
.combo-aba.aba-clt.ativa { background: #6d28d9; border-color: #6d28d9; }
.combo-aba.aba-aprendiz.ativa { background: #c2410c; border-color: #c2410c; }

/* REDE DE SEGURANÇA (05/11/2026, pedido do usuário: combos nunca crus/em branco em nenhuma página):
   (1) a caixa original some sempre que o Select2 montou, mesmo se o CSS do Select2 não carregar;
   (2) enquanto/se o Select2 não montar, o <select> tem o MESMO visual dos campos do sistema e funciona normal. */
select.select2-hidden-accessible { border: 0 !important; clip: rect(0 0 0 0) !important; height: 1px !important; margin: -1px !important;
  overflow: hidden !important; padding: 0 !important; position: absolute !important; width: 1px !important; white-space: nowrap !important; }
/* 06/11/2026 (auditoria #36: faturamento 2143px, Contratações 2553px, painel da empresa 2348px "ao carregar"): o base dá
   "transition: .15s" (= todas as propriedades) a .form-select/.control. Quando o combo monta, a caixa original vira
   position:absolute e a TRANSIÇÃO vence o !important acima: por 0,15 s a largura anima de 100% da TELA (1400px, medida
   contra a página inteira por ser absolute) até 1px, a partir do lugar do campo — a página estica e volta. A caixa
   escondida nunca anima (vale para Select2 e Tom-Select). */
select.select2-hidden-accessible, select.ts-hidden-accessible, select.tomselected { transition: none !important; }
select.combo-busca:not(.select2-hidden-accessible) {
  display: block; width: 100%; min-height: 40px; padding: 7px 34px 7px 12px; font-size: .95rem; line-height: 1.5; color: #1e293b;
  background-color: #fff; border: 1px solid #cbd5e1; border-radius: 10px; appearance: auto;
  /* 06/11/2026 (auditoria #34: /admin/vagas 2264px, /admin/cursos 1780px ao carregar): o nome mais longo da lista NÃO
     define a largura da caixa antes do combo montar — ela fica no espaço do campo */
  max-width: 100%; min-width: 0; contain: inline-size; }
