/* ==========================================================================
   CSS Global - Padrão Moderno (ERP SIGPUB)
   ========================================================================== */

/* 1. Variáveis Globais (Design System) */
:root {
    /* Paleta Principal da Identidade Visual */
    --color-primary: #be1522;
    --color-primary-light: #ebebeb;
    --color-primary-dark: #686868;

    --color-secondary: #00b2e8;
    --color-secondary-light: #f5fdff;
    --color-secondary-dark: #000000;

    /* Paleta Neutra para Painéis Administrativos */
    --color-bg-body: #f4f7f6;
    --color-bg-surface: #ffffff;
    --color-text-main: #1f2937;
    --color-text-muted: #6b7280;
    --color-border: #d1d5db;

    /* Status Colors */
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-info: #3b82f6;

    /* Aliases SEMÂNTICOS de status do módulo Gestão de Tarefas (atrasada/a-vencer/
       em execução/concluída/aguardando) — GLOBAIS no :root para que QUALQUER página
       possa consumir LED/timeline/prazo-cor sem redeclarar por escopo (antes viviam
       só em .gt-painel/.gt-drawer/.gt-historico/… e "apagavam" fora deles — bug real
       do LED do gantt na Ver demanda e da timeline no Histórico). Regra: token
       reusado entre escopos/páginas sobe para cá. Derivam dos tokens acima → dark
       mode automático (as cores de status não mudam no escuro). */
    --gt-cor-atrasada: var(--color-danger);
    --gt-cor-a-vencer: var(--color-warning);
    --gt-cor-em-execucao: var(--color-info);
    --gt-cor-concluida: var(--color-success);
    --gt-cor-aguardando: color-mix(in srgb, var(--color-warning) 72%, var(--color-success));

    /* Tipografia (System Fonts carregam instantaneamente) */
    --font-sans: 'Roboto', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-relatorios: Arial, Helvetica, sans-serif;
    --line-height-body: 1.5;
    --line-height-heading: 1.2;

    /* Espaçamento e Bordas */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-pill: 999px;
    --transition-speed: 0.2s;

    /* Elevação (Material — SPEC V41): sombras suaves para superfícies que "levantam".
       Aditivo ao design system; módulos CONSOMEM com fallback. Dark mode reforça no
       bloco [data-theme="dark"]. */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.10);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.06), 0 6px 16px rgba(0, 0, 0, 0.10);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.13), 0 2px 6px rgba(0, 0, 0, 0.07);

    /* Escala de densidade — ESPAÇAMENTO (fonte única; módulos CONSOMEM, não replicam).
       Densidade ERP: espaçamento consistente e enxuto. Ver frontend-css-design §1c. */
    --space-1: 0.25rem;   /* 4px  */
    --space-2: 0.5rem;    /* 8px  */
    --space-3: 0.75rem;   /* 12px */
    --space-4: 1rem;      /* 16px */
    --space-5: 1.5rem;    /* 24px */
    --space-6: 2rem;      /* 32px */

    /* Escala de densidade — TIPOGRAFIA (idem). Base do corpo dos módulos densos = --fs-md
       (13px); os módulos aplicam `font-size: var(--fs-md)` no próprio seletor raiz. */
    --fs-xxs: 0.625rem;   /* 10px — micro-metadados */
    --fs-xs: 0.6875rem;   /* 11px — rótulos maiúsculos, metadados discretos */
    --fs-sm: 0.75rem;     /* 12px — metadados, tags, chips */
    --fs-md: 0.8125rem;   /* 13px — corpo padrão dos módulos densos */
    --fs-lg: 0.9375rem;   /* 15px — títulos de card / drawer */
    --fs-xl: 1.0625rem;   /* 17px — números de indicadores */

    /* Layout */
    --sidebar-width: 250px;
    --header-height: 64px;
    /* Barra inferior (rodapé): sidebar-footer + page-footer compartilham esta altura para
       formarem UMA barra alinhada (espelha o topo header/topbar em --header-height). */
    --footer-height: 36px;
}

/* 2. Reset Moderno */
*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
    font: inherit;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    text-rendering: optimizeSpeed;
    line-height: var(--line-height-body);
    font-family: var(--font-sans);
    color: var(--color-text-main);
    background-color: var(--color-bg-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    flex-direction: column;
}

/* 4. Elementos de Mídia Responsivos */
img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

/* 5. Tipografia Global */
h1,
h2,
h3,
h4,
h5,
h6 {
    line-height: var(--line-height-heading);
    color: var(--color-primary);
    font-weight: 600;
}

h1 {
    font-size: 1.75rem;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}

a {
    color: var(--color-secondary);
    text-decoration: none;
    transition: color var(--transition-speed) ease;
}

a:hover {
    color: var(--color-secondary-dark);
}

b {
    font-weight: bold;
}

/* 6. Acessibilidade (A11y) */
@media (prefers-reduced-motion: reduce) {
    html:focus-within {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

:focus-visible {
    outline: 2px solid var(--color-secondary);
    outline-offset: 2px;
}

/* 7. Estrutura de Layout Base (App Shell)
   Rolagem INTERNA (SPEC V15 §1): o shell tem altura de viewport e SÓ o .page-content
   rola; assim o .topbar (irmão fixo no topo do .main-wrapper) fica sempre visível ao
   rolar. Antes o `overflow-x:hidden` no .app-layout virava scroll-container e quebrava
   o `position:sticky` do topbar. */
.app-layout {
    display: flex;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100vh;
    overflow: hidden;
    /* Previne overflow no flexbox */
    padding-left: var(--sidebar-width);
    transition: padding-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-layout.sidebar-collapsed .main-wrapper {
    padding-left: 80px;
}

.page-content {
    flex: 1;
    min-height: 0;          /* permite o flex-child encolher e rolar */
    overflow-y: auto;       /* a rolagem da página vive aqui */
    padding: 2rem;
    background-color: var(--color-bg-body);
}

/* Rodapé global: barra inferior FIXA (não rola — irmã flex do .page-content, que é quem rola),
   alinhada com o .sidebar-footer (mesma --footer-height) para formar uma barra contínua embaixo.
   Discreto: fundo/linha/texto neutros. Copyright à direita. */
.page-footer {
    flex-shrink: 0;
    height: var(--footer-height);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 var(--space-6, 1.5rem);
    background-color: var(--color-bg-surface);
    border-top: 1px solid var(--color-border);
}

.page-footer__copy {
    font-size: var(--fs-xxs, 0.7rem);
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Órgão da instância ("Configurado para <órgão>"): reforço só de PESO — o reset
   global (`* { font: inherit }`) anula o bold nativo do <strong>, então o peso
   precisa ser explícito aqui. Cor segue a do copy (discrição do rodapé). */
.page-footer__orgao {
    font-weight: 600;
}

.page-footer__sep {
    margin: 0 var(--space-1, 0.25rem);
}

/* Chrome de tela: o rodapé não vai para o papel (regra de shell — ver frontend-css-design §print). */
@media print {
    .page-footer {
        display: none !important;
    }
}

/* ── Responsivo (Mobile) ── */
@media (max-width: 1024px) {
    .main-wrapper {
        padding-left: 0;
    }

    .app-layout.sidebar-collapsed .main-wrapper {
        padding-left: 0;
    }
}

/* ── Elementos de Formulário Globais (Inputs, Selects, Textareas) ── */
.form-control,
input,
select,
textarea {
    color: var(--color-text-main);
    background-color: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    transition: border-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb, 10, 37, 53), 0.1);
}

.form-control-sm,
.form-select-sm {
    width: 200px !important;
}

/* 8. Classes Utilitárias Globais */
.surface-card {
    background-color: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--transition-speed) ease;
}

.btn-highlight {
    box-shadow: 0 0px 6px rgba(0, 0, 0, 0.1);
}

/* Estado GLOBAL "em requisição" (2026-07-22) — fonte única do padrão que vivia
   duplicado por escopo (drawer, demanda-menu, gerenciadores, todos com o mesmo
   opacity+pointer-events; os blocos locais foram removidos — regra §Variáveis
   reusadas do CLAUDE.md, no espírito: o que é reusado sobe para o global).

   Aplicado por JS (guarda anti duplo-submit do layout.js e os handlers AJAX). Além
   de travar o clique, agora INFORMA: um spinner (::after) diz "já estou tentando" —
   era exatamente o que faltava quando a rede trava e o usuário re-clicava, duplicando
   a ação. `currentColor` deixa o spinner correto em qualquer botão (primary branco,
   secondary, danger…) e nos dois temas, sem cor nova. */
.is-loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

button.is-loading::after,
input[type="submit"].is-loading::after {
    content: "";
    display: inline-block;
    width: 0.9em;
    height: 0.9em;
    margin-left: var(--space-2, 0.5rem);
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: btn-spinner 0.7s linear infinite;
    vertical-align: -0.1em;
    flex-shrink: 0;
}

@keyframes btn-spinner {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    button.is-loading::after,
    input[type="submit"].is-loading::after {
        animation: none;
        border-right-color: currentColor;
        opacity: 0.4;
    }
}

.btn-primary {
    background-color: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--color-primary-dark);
    color: white;
}

.btn-secondary {
    background-color: var(--color-secondary);
    color: white;
}

.btn-secondary:hover {
    background-color: var(--color-secondary-dark);
}

/* ==========================================================================
   AÇÃO EM PILL — `.gt-acao` (PADRÃO DE BOTÃO DO SISTEMA, decisão do usuário
   em 2026-08-03)
   --------------------------------------------------------------------------
   Nasceu como `.gt-coluna-acao` no cabeçalho de coluna do painel (2026-07-24),
   substituindo os `.btn` cheios que pesavam demais para ações de rotina. O
   desenho pegou, ganhou consumidores fora do painel e agora é o PADRÃO: **todo
   botão NOVO usa `.gt-acao`**, salvo motivo explícito.

   Hairline + radius pill + `fs-sm`/600: um botão que se lê como controle, não
   como CTA de campanha. As variantes tingem SEM encher (a cor fica na borda e
   no texto), o que deixa três pesos conviverem na mesma linha sem competir.

   ⚠️ Os `.btn`/`.btn-primary`/`.btn-secondary` acima continuam válidos onde já
   estão — a migração é por CONTATO (quem tocar na tela troca), não por varredura
   (decisão do usuário: trocar os 143 usos de uma vez mudaria telas que ninguém
   ia conferir, inclusive confirmações destrutivas).
   ========================================================================== */
.gt-acao {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    flex: 0 0 auto;
    padding: 0.1875rem var(--space-2, 0.5rem);
    background-color: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill, 999px);
    font-family: inherit;
    font-size: var(--fs-sm, 0.875rem);
    font-weight: 600;
    color: var(--color-text-muted);
    white-space: nowrap;
    cursor: pointer;
    transition: border-color var(--transition-speed) ease, color var(--transition-speed) ease,
        background-color var(--transition-speed) ease;
}

.gt-acao i {
    font-size: var(--fs-md);
}

.gt-acao:hover,
.gt-acao:focus-visible {
    border-color: var(--color-primary);
    color: var(--color-primary);
    outline: none;
}

.gt-acao:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Ação PRINCIPAL da superfície (ex.: "Nova" no cabeçalho de coluna): tinta
   discreta na cor secundária da marca. */
.gt-acao--destaque {
    background-color: color-mix(in srgb, var(--color-secondary) 12%, transparent);
    border-color: color-mix(in srgb, var(--color-secondary) 45%, transparent);
    color: var(--color-secondary);
}

.gt-acao--destaque:hover,
.gt-acao--destaque:focus-visible {
    background-color: color-mix(in srgb, var(--color-secondary) 22%, transparent);
    border-color: color-mix(in srgb, var(--color-secondary) 70%, transparent);
    color: var(--color-secondary);
}

/* Mesmo gesto na cor PRIMÁRIA — existe para quando duas ações precisam ser
   distinguíveis entre si na mesma faixa (ex.: "Gerenciar checklist" ×
   "Gerenciar prompts" no painel Editar tarefa). */
.gt-acao--primaria {
    background-color: color-mix(in srgb, var(--color-primary) 12%, transparent);
    border-color: color-mix(in srgb, var(--color-primary) 45%, transparent);
    color: var(--color-primary);
}

.gt-acao--primaria:hover,
.gt-acao--primaria:focus-visible {
    background-color: color-mix(in srgb, var(--color-primary) 22%, transparent);
    border-color: color-mix(in srgb, var(--color-primary) 70%, transparent);
    color: var(--color-primary);
}

.table-responsive {
    overflow-x: auto;
    background: var(--color-bg-surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0;
}

th,
td {
    padding: 1rem;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
}

th {
    background-color: #f9fafb;
    font-weight: 600;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

tr:hover td {
    background-color: #f9fafb;
}

/* ==========================================================================
   Dark Mode — Ativado via data-theme="dark" no <html>
   Sobrescreve apenas as variáveis de cor neutras.
   As cores da identidade visual (primary/secondary) são IMUTÁVEIS.
   ========================================================================== */
[data-theme="dark"] {
    --color-bg-body: #0f1117;
    --color-bg-surface: #1a1d27;
    --color-text-main: #e2e8f0;
    --color-text-muted: #94a3b8;
    --color-border: #2d3748;
    --color-secondary-light: #0a2535;
    --color-primary-light: #2d2d2d;
    --color-primary-dark: #9a9a9a;
    /* Elevação mais forte no escuro (sombras precisam de mais opacidade — SPEC V41). */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.45);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.55);
    --shadow-lg: 0 10px 28px rgba(0, 0, 0, 0.65);
}

[data-theme="dark"] th {
    background-color: #1e2130;
}

[data-theme="dark"] tr:hover td {
    background-color: #1e2130;
}

/* ==========================================================================
   Painel de Ações Flutuante (Universal App Action Panel)
   ========================================================================== */

.app-action-panel {
    position: fixed;
    z-index: 500;
    min-width: 220px;
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.13), 0 2px 6px rgba(0, 0, 0, 0.07);
    overflow: hidden;
    /* Estado inicial: invisível */
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.app-action-panel.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.app-action-panel__header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg-body);
}

.app-action-panel__header>i {
    color: var(--color-primary);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.app-action-panel__nome {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 185px;
}

.app-action-panel__list {
    list-style: none;
    padding: 0.3rem 0;
    margin-bottom: 0;
}

.app-action-panel__list li a {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 1rem;
    font-size: 0.875rem;
    color: var(--color-text-main);
    text-decoration: none;
    transition: background-color 0.12s;
}

.app-action-panel__list li a:hover {
    background: var(--color-bg-body);
}

.app-action-panel__list li a i {
    font-size: 1rem;
    color: var(--color-text-muted);
    transition: color 0.12s;
}

.app-action-panel__list li a:hover i {
    color: var(--color-primary);
}

/* ==========================================================================
   BADGES — componentes GLOBAIS de design system
   Status/situação: `.badge` + `.badge--<estado>`. Localização (setor/área/função):
   `.loc-badge` + `.loc-badge--<tipo>`. Padronizados aqui no BASE para valerem em
   qualquer módulo (ex.: modal de perfil global aberto pelo header, tabela do RH).
   Cores por TOKEN + color-mix → dark-mode safe. Antes viviam em recursos_humanos.css
   (não global) com HEX fixo — o perfil quebrava fora do RH.
   ========================================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1, 0.25rem);
    padding: 0.2rem 0.65rem;
    border-radius: 9999px;
    font-size: var(--fs-xs, 0.75rem);
    font-weight: 600;
    letter-spacing: 0.03em;
    line-height: 1.5;
}

/* Situação do funcionário — tokens semânticos (verde/vermelho/âmbar), dark-mode safe. */
.badge--ativo {
    color: var(--color-success);
    background: color-mix(in srgb, var(--color-success) 14%, var(--color-bg-surface));
}
.badge--inativo {
    color: var(--color-danger);
    background: color-mix(in srgb, var(--color-danger) 14%, var(--color-bg-surface));
}
.badge--afastado {
    color: var(--color-warning);
    background: color-mix(in srgb, var(--color-warning) 16%, var(--color-bg-surface));
}

/* Badge de LOCALIZAÇÃO (setor / área / função): pill com ícone, cor por `--loc-badge-cor`.
   Setor = neutro; Área = info (azul); Função = azul+primário (violeta), afastados das cores
   de situação/LED. Pode ser <span> (só leitura, ex.: perfil) OU <button> (gatilho de tooltip,
   ex.: tabela do RH — o hover/cursor só valem no button). */
.loc-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    max-width: 100%;
    padding: 0.08rem 0.5rem;
    border-radius: 9999px;
    font-family: inherit;
    font-size: var(--fs-xxs, 0.7rem);
    font-weight: 600;
    line-height: 1.6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--loc-badge-cor, var(--color-text-muted));
    background: color-mix(in srgb, var(--loc-badge-cor, var(--color-text-muted)) 12%, var(--color-bg-surface));
    border: 1px solid color-mix(in srgb, var(--loc-badge-cor, var(--color-border)) 32%, transparent);
}
button.loc-badge {
    cursor: pointer;
    transition: background-color var(--transition-speed);
}
button.loc-badge:hover {
    background: color-mix(in srgb, var(--loc-badge-cor, var(--color-text-muted)) 22%, var(--color-bg-surface));
}
.loc-badge i {
    font-size: var(--fs-xs, 0.75rem);
    flex-shrink: 0;
}
.loc-badge--setor { --loc-badge-cor: var(--color-text-muted); }
.loc-badge--area { --loc-badge-cor: var(--color-info); }
.loc-badge--funcao { --loc-badge-cor: color-mix(in srgb, var(--color-info) 45%, var(--color-primary)); }

/* ==========================================================================
   UTILITY CLASSES (Vanilla Substitutes for Bootstrap/Tailwind)
   ========================================================================== */

/* Border Classes */
.border-bottom {
    border-bottom: 1px solid var(--color-border);
}

.border-none {
    border: none;
}

/* Margins & Padding */
.m-0 {
    margin: 0;
}

.p-0 {
    padding: 0;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mt-4 {
    margin-top: 2rem;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

/* Flexbox */
.d-flex,
.d-flex-row {
    display: flex;
}

.d-flex-column {
    display: flex;
    flex-direction: column;
}

.align-items-center {
    align-items: center;
}

.justify-content-between {
    justify-content: space-between;
}

.gap-1 {
    gap: 0.25rem;
}

.gap-2 {
    gap: 0.5rem;
}

/* Typography & Colors */
.text-center {
    text-align: center;
}

.text-primary {
    color: var(--color-primary);
}

.text-danger {
    color: var(--color-danger);
}

.text-muted {
    color: var(--color-text-muted);
}

/* Avatar Utilities */
.btn-danger {
    background: var(--color-danger);
    color: white;
    border: 1px solid var(--color-danger);
}

.btn-danger:hover {
    background: #b02a37;
    /* vermelho mais escuro */
}

.btn-outline-danger {
    background: transparent;
    color: var(--color-danger);
    border: 1px solid var(--color-danger);
}

.btn-outline-danger:hover {
    background: var(--color-danger);
    color: white;
}

.btn-outline-primary {
    background: transparent;
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
}

.btn-outline-primary:hover {
    background: var(--color-primary);
    color: white;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-radius: 0.2rem;
}

/* Padrão GLOBAL de grupos de botões de ação do sistema (SPEC V16 §1).
   Promovido do RH (.rh-actions-container/.rh-actions-wrapper). Uma faixa de
   ações com largura natural, agrupadas; no mobile (≤640px) empilham em coluna
   ocupando a largura total. Módulos que precisam de comportamento extra (ex.: o
   RH, com dropdown "Ações" no ≤768px) mantêm suas próprias classes ao lado. */
.actions-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.actions-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

@media (max-width: 640px) {
    .actions-wrapper {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .actions-wrapper > .btn {
        width: 100%;
        justify-content: center;
    }
}

.avatar-edit-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.avatar-actions {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0.5rem;
}

.avatar-action-btn {
    padding: 0.2rem 0.5rem !important;
    font-size: 0.8rem !important;
    cursor: pointer;
}

.d-none {
    display: none !important;
}

.btn-upload-foto {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    text-align: center;
    padding: 0.2rem 0;
    font-size: 0.9rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.perfil-foto-wrapper:hover .btn-upload-foto {
    opacity: 1;
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.app-toast {
    padding: 1rem 1.5rem;
    background: white;
    color: var(--color-text-main);
    border-left: 5px solid var(--color-primary);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-weight: 500;
    min-width: 250px;
    max-width: 350px;
    animation: slideInRight 0.3s ease forwards;
}

.app-toast.error {
    border-color: var(--color-danger);
}

.app-toast.success {
    border-color: var(--color-success);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
    }
}

/* ==========================================================================
   Global Utilities (Modals & Header)
   ========================================================================== */

.page-header-block {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.page-header-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-text-main);
    margin: 0;
}

.breadcrumb-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    color: var(--color-text-muted);
}

.breadcrumb-item a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.breadcrumb-item a:hover {
    color: var(--color-primary-dark, #0056b3);
    text-decoration: underline;
}

.breadcrumb-separator {
    font-size: 0.75rem;
    margin-left: 0.5rem;
    color: var(--color-border);
}

.breadcrumb-active {
    color: var(--color-text-main);
    font-weight: 500;
}

.modal-sm .modal-content {
    max-width: 400px;
}

.modal-footer-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 1.5rem;
}

.dropdown-item-logout {
    width: 100%;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font: inherit;
    padding: 0;
    margin: 0;
}

/* ==========================================================================
   Paginação Global
   ========================================================================== */
.pagination-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 1.5rem;
    gap: 0.5rem;
}

.pagination {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 0.25rem;
}

.page-item .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 0.5rem;
    border-radius: var(--radius-sm);
    background-color: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text-main);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all var(--transition-speed) ease;
    cursor: pointer;
}

.page-item:not(.disabled):not(.active) .page-link:hover {
    background-color: var(--color-bg-body);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.page-item.active .page-link {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
    font-weight: 500;
}

.page-item.disabled .page-link {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: var(--color-bg-body);
}

.pagination-info {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}