/* =========================================================================
   Holerite - novo visual (design system Apolo)
   -------------------------------------------------------------------------
   Carregado por view/holerite.php DEPOIS dos CSS antigos, para vencer os
   empates de especificidade com o Bootstrap 2.

   Todos os seletores usam o prefixo .hl-, portanto este arquivo nao afeta
   nenhuma tela que ainda use a marcacao antiga.

   Os componentes que disputam com o Bootstrap sao escritos como
   "body .hl-x" (especificidade 0,1,1) para vencer .btn (0,1,0) e
   input/a/button (0,0,1) sem precisar de !important.
   ========================================================================= */

/* -------------------------------------------------------------------------
   TEMA

   Nenhuma cor é escrita direto nas regras: tudo passa por token, e o tema
   escuro só redefine os tokens. Se alguma cor voltar a ser fixa aqui embaixo,
   ela vaza para o tema escuro — a checagem (i) da seção 7 do REFATORACAO.md
   existe para pegar isso.

   O tema efetivo vem do atributo `data-hl-tema` no <html>, escrito pelo script
   embutido no <head> de view/holerite.php ANTES de qualquer pintura. O script
   resolve a preferência do sistema operacional em JavaScript, então aqui só
   existe UM bloco escuro — não é preciso repetir a paleta dentro de um
   @media (prefers-color-scheme: dark).

   A escolha manual fica em localStorage: zero requisição ao backend, o que
   mantém a regra da seção 5 ("só estilização, nada de requisição").
   ------------------------------------------------------------------------- */
:root {
    /* marca */
    --hl-primary: #0d71f0;
    --hl-primary-hover: #0b60cc;
    --hl-primary-fg: #ffffff;
    --hl-primary-suave: rgba(13, 113, 240, .1);
    --hl-primary-suave2: rgba(13, 113, 240, .05);
    --hl-primary-borda: rgba(13, 113, 240, .3);
    --hl-primary-ring: rgba(13, 113, 240, .35);
    --hl-primary-texto: rgba(13, 113, 240, .75);

    /* gradiente da marca: logo do login e faixa "Olá," do Início.
       Separado do --hl-primary porque no escuro o primário vira azul claro
       (#8ab4f8) e texto branco por cima dele seria ilegível. */
    --hl-grad-de: #0d71f0;
    --hl-grad-ate: #0950a9;
    --hl-grad-fg: #ffffff;
    --hl-grad-fg-suave: rgba(255, 255, 255, .8);

    /* superfícies */
    --hl-bg: #ffffff;
    --hl-fg: #252525;
    --hl-fg-suave: #3f3f3f;
    --hl-card: #ffffff;
    --hl-card-sutil: rgba(250, 250, 250, .7);
    --hl-border: #e5e5e5;
    --hl-muted-fg: #8a8a8a;
    --hl-muted-bg: #fafafa;
    --hl-sidebar-bg: #fafafa;
    --hl-sidebar-accent: #f0f0f0;

    /* status: ok / provento */
    --hl-ok: #059669;
    --hl-ok-bg: #ecfdf5;
    --hl-ok-borda: #6ee7b7;
    --hl-ok-fg: #065f46;
    --hl-ok-suave: rgba(16, 185, 129, .1);
    --hl-dot-prov: #10b981;

    /* status: aviso */
    --hl-aviso-bg: #fffbeb;
    --hl-aviso-borda: #fcd34d;
    --hl-aviso-fg: #78350f;
    --hl-aviso-suave: rgba(245, 158, 11, .12);
    --hl-aviso-icone: #b45309;

    /* status: erro / desconto */
    --hl-desc: #d92d20;
    --hl-destructive: #d92d20;
    --hl-desc-suave: rgba(225, 29, 72, .09);
    --hl-dot-desc: #f43f5e;
    --hl-erro-bg: #fef2f2;
    --hl-erro-borda: #fca5a5;
    --hl-erro-borda-forte: #f04438;
    --hl-erro-fg: #b42318;

    /* sombras e véus */
    --hl-sombra-1: 0 1px 2px rgba(16, 24, 40, .06);
    --hl-sombra-2: 0 6px 16px rgba(16, 24, 40, .08);
    --hl-sombra-3: 0 12px 32px rgba(16, 24, 40, .17);
    --hl-sombra-4: 0 20px 44px rgba(16, 24, 40, .24);
    --hl-backdrop: rgba(16, 24, 40, .5);
    --hl-backdrop-solido: #101828;

    /* medidas e tipografia — não mudam com o tema */
    --hl-radius: 0.875rem;
    --hl-radius-lg: 1rem;
    --hl-sidebar-w: 16rem;
    --hl-header-h: 4rem;
    --hl-font: 'Inter Variable', Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --hl-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* Tema escuro. Paleta do protótipo, _ds_bundle.css:7359 — #121212 de fundo,
   #1e1e1e nos cards, #8ab4f8 de primário, #181818 na sidebar, #2a2a2a nas
   bordas. Os derivados (tintas, status, sombras) foram recalculados: sobre
   fundo escuro as tintas precisam de mais opacidade e os textos de status
   invertem — o escuro vai para o fundo e o claro para a letra. */
:root[data-hl-tema="escuro"] {
    --hl-primary: #8ab4f8;
    --hl-primary-hover: #a7c8fa;
    --hl-primary-fg: #0c0c0c;
    --hl-primary-suave: rgba(138, 180, 248, .14);
    --hl-primary-suave2: rgba(138, 180, 248, .08);
    --hl-primary-borda: rgba(138, 180, 248, .35);
    --hl-primary-ring: rgba(138, 180, 248, .45);
    --hl-primary-texto: rgba(138, 180, 248, .85);

    --hl-grad-de: #17457c;
    --hl-grad-ate: #0f2f57;
    --hl-grad-fg: #e8e8e8;
    --hl-grad-fg-suave: rgba(232, 232, 232, .72);

    --hl-bg: #121212;
    --hl-fg: #e8e8e8;
    --hl-fg-suave: #cfcfcf;
    --hl-card: #1e1e1e;
    --hl-card-sutil: rgba(255, 255, 255, .03);
    --hl-border: #2a2a2a;
    --hl-muted-fg: #a6a6a6;
    --hl-muted-bg: #242424;
    --hl-sidebar-bg: #181818;
    --hl-sidebar-accent: #262626;

    --hl-ok: #34d399;
    --hl-ok-bg: rgba(16, 185, 129, .12);
    --hl-ok-borda: rgba(16, 185, 129, .4);
    --hl-ok-fg: #6ee7b7;
    --hl-ok-suave: rgba(16, 185, 129, .14);
    --hl-dot-prov: #34d399;

    --hl-aviso-bg: rgba(245, 158, 11, .12);
    --hl-aviso-borda: rgba(245, 158, 11, .4);
    --hl-aviso-fg: #fcd34d;
    --hl-aviso-suave: rgba(245, 158, 11, .16);
    --hl-aviso-icone: #fbbf24;

    --hl-desc: #f87171;
    --hl-destructive: #f87171;
    --hl-desc-suave: rgba(244, 63, 94, .14);
    --hl-dot-desc: #fb7185;
    --hl-erro-bg: rgba(240, 68, 56, .12);
    --hl-erro-borda: rgba(240, 68, 56, .4);
    --hl-erro-borda-forte: #f97066;
    --hl-erro-fg: #fda29b;

    --hl-sombra-1: 0 1px 2px rgba(0, 0, 0, .5);
    --hl-sombra-2: 0 6px 16px rgba(0, 0, 0, .5);
    --hl-sombra-3: 0 12px 32px rgba(0, 0, 0, .55);
    --hl-sombra-4: 0 20px 44px rgba(0, 0, 0, .6);
    --hl-backdrop: rgba(0, 0, 0, .7);
    --hl-backdrop-solido: #000000;
}

/* =========================================================================
   Regras globais do body herdadas do visual antigo, neutralizadas apenas
   nas telas ja migradas:
     holerite.css:9    border-top azul de 4px
     holerite.css:10   overflow-y: scroll (barra sempre visivel)
     bootstrap.css:140 padding-top: 60px (reserva do navbar fixo antigo)
   ========================================================================= */
body:has(.hl-login),
body:has(.hl-shell) {
    border-top: 0;
    overflow-y: auto;
    padding-top: 0;
    /* holerite.css:8 tem "background-color: #FFFFFF !important" no body, e
       style.css:1 tem #F1F1F1. Com !important dos dois lados quem decide é a
       especificidade: body:has(.hl-x) é 0,1,1 contra 0,0,1 da regra antiga.
       Sem isto o tema escuro pintaria só os cards, sobre fundo branco. */
    background-color: var(--hl-bg) !important;
    /* bootstrap.css:138 fixa color:#333 no body. Vale para o que fica fora dos
       wrappers .hl-*, como o holerite_rodape.php. */
    color: var(--hl-fg);
}
body:has(.hl-shell) {
    padding-left: var(--hl-sidebar-w);
}

/* Rodapé legado (holerite_rodape.php, ainda incluído por holerite.php:62).
   Não foi redesenhado — item 6 da seção 11 —, mas no tema escuro ele ficava
   ilegível: texto #333 sobre #121212. Aqui só o mínimo para acompanhar. */
body:has(.hl-shell) .rodape {
    margin-top: 2rem;
    padding: 1rem 0;
    border-top: 1px solid var(--hl-border);
    font-family: var(--hl-font);
    color: var(--hl-muted-fg);
}
body:has(.hl-shell) .rodape p { color: var(--hl-muted-fg); font-size: 0.75rem; }

/* =========================================================================
   Base
   ========================================================================= */
.hl-login,
.hl-shell,
.hl-page {
    font-family: var(--hl-font);
    -webkit-font-smoothing: antialiased;
    color: var(--hl-fg);
}
.hl-login, .hl-login *, .hl-login *::before, .hl-login *::after,
.hl-shell, .hl-shell *, .hl-shell *::before, .hl-shell *::after,
.hl-page,  .hl-page *,  .hl-page *::before,  .hl-page *::after {
    box-sizing: border-box;
}

/* Itens de grid/flex têm min-width:auto, isto é, não encolhem abaixo do
   min-content do próprio conteúdo. A tabela do espelho de ponto tem
   min-width:760px (rola dentro do card, como no protótipo), e sem os
   min-width:0 abaixo essa largura propaga para cima: o card fica mais largo
   que a tela e o overflow-x:hidden do holerite.css corta a direita. */
.hl-grid > *,
.hl-detalhe,
.hl-detalhe > *,
.hl-doc,
.hl-doc > *,
.hl-home > *,
.hl-home__baixo > * {
    min-width: 0;
}
.hl-scroll {
    min-width: 0;
    max-width: 100%;
}

/* Células de grade: sem isso o conteúdo empurra a coluna além da largura da
   tela. As colunas usam minmax(0, 1fr) — "1fr" puro equivale a
   minmax(auto, 1fr), e o mínimo "auto" é o min-content, então uma descrição
   longa estoura a grade. No mobile o holerite.css aplica overflow-x:hidden no
   body, então o estouro não virava barra de rolagem: era recorte à direita. */
.hl-tab__head > span,
.hl-tab__row > span,
.hl-tab__total > span,
.hl-esp__head > span,
.hl-esp__row > span {
    min-width: 0;
    overflow-wrap: break-word;
}

/* linha informativa dentro da tabela: valor exibido mas fora do total */
.hl-tab__row--info { background: var(--hl-muted-bg); }
.hl-nota {
    font-size: 0.75rem;
    font-style: italic;
    color: var(--hl-muted-fg);
    white-space: nowrap;
}
@media (max-width: 640px) {
    /* "(valor não descontado)" é longo: no celular pode quebrar */
    .hl-nota { white-space: normal; display: block; }
}

.hl-r { text-align: right; }
.hl-muted { color: var(--hl-muted-fg); }
.hl-forte { font-weight: 500; }
.hl-mono {
    font-family: var(--hl-mono);
    font-size: 0.8125rem;
}

/* =========================================================================
   Botoes
   ========================================================================= */
body .hl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 2.5rem;
    margin: 0;
    padding: 0 1rem;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: normal;
    border: 0;
    border-radius: var(--hl-radius-lg);
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    transition: background-color .15s ease, transform .05s ease;
}
body .hl-btn--sm { height: 2.25rem; padding: 0 0.875rem; font-weight: 500; }
body .hl-btn--lg { height: 2.75rem; padding: 0 1.25rem; }
body .hl-btn--block { width: 100%; }
body .hl-btn--primary {
    background: var(--hl-primary);
    background-image: none;
    color: var(--hl-primary-fg);
    text-shadow: none;
    filter: none;
    box-shadow: var(--hl-sombra-1);
}
body .hl-btn--primary:hover {
    background: var(--hl-primary-hover);
    color: var(--hl-primary-fg);
    text-decoration: none;
}
body .hl-btn--ghost {
    border: 1px solid var(--hl-border);
    background: var(--hl-card);
    color: var(--hl-fg);
}
body .hl-btn--ghost:hover { background: var(--hl-muted-bg); text-decoration: none; }
body .hl-btn:active { transform: scale(.99); }
body .hl-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--hl-primary-ring);
}

body .hl-iconbtn {
    display: grid;
    place-items: center;
    height: 2rem;
    width: 2rem;
    flex-shrink: 0;
    border: 0;
    border-radius: 0.5rem;
    background: none;
    color: var(--hl-muted-fg);
    cursor: pointer;
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease;
}
body .hl-iconbtn:hover {
    background: var(--hl-sidebar-accent);
    color: var(--hl-fg);
    text-decoration: none;
}

body .hl-avatar {
    display: grid;
    place-items: center;
    height: 2.25rem;
    width: 2.25rem;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--hl-primary-suave);
    color: var(--hl-primary);
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
}
body .hl-avatar--sm { height: 1.75rem; width: 1.75rem; font-size: 0.6875rem; }

/* =========================================================================
   LOGIN
   ========================================================================= */
.hl-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: var(--hl-bg);
}
.hl-login__card { width: 100%; max-width: 24rem; padding: 1.5rem 0; }
.hl-login__brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}
.hl-login__logo {
    display: grid;
    place-items: center;
    height: 4rem;
    width: 4rem;
    border-radius: var(--hl-radius-lg);
    background: linear-gradient(135deg, var(--hl-grad-de), var(--hl-grad-ate));
    color: var(--hl-grad-fg);
    font-size: 1.875rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: var(--hl-sombra-1);
}
.hl-login__title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.25;
}
.hl-login__subtitle { font-size: 0.875rem; color: var(--hl-muted-fg); margin-top: 0.125rem; }
.hl-login__lead { margin: 0; text-align: center; font-size: 0.875rem; color: var(--hl-muted-fg); }
.hl-login__form { margin: 2rem 0 0; }
.hl-login__footer {
    margin: 2rem 0 0;
    text-align: center;
    font-size: 0.75rem;
    color: var(--hl-muted-fg);
}
.hl-login__forgot { display: flex; justify-content: flex-end; margin-bottom: 1rem; }
body .hl-login__forgot a {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--hl-primary);
    cursor: pointer;
    text-decoration: none;
}
body .hl-login__forgot a:hover { color: var(--hl-primary-hover); text-decoration: none; }

/* campos */
.hl-field { margin-bottom: 1rem; }
body .hl-label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--hl-fg);
}
body .hl-input {
    display: block;
    width: 100%;
    height: 2.75rem;
    /* margin/line-height explicitos: bootstrap.css:636 aplica
       margin-bottom:9px e line-height:18px em todo input */
    margin: 0;
    padding: 0 0.875rem;
    font-family: inherit;
    font-size: 0.875rem;
    line-height: normal;
    color: var(--hl-fg);
    background: var(--hl-card);
    border: 1px solid var(--hl-border);
    border-radius: var(--hl-radius);
    outline: none;
    box-shadow: none;
    transition: box-shadow .15s ease, border-color .15s ease;
}
body .hl-input::placeholder { color: var(--hl-muted-fg); }
body .hl-input:focus {
    border-color: var(--hl-primary);
    box-shadow: 0 0 0 2px var(--hl-primary-ring);
}
/* type=number preservado para nao alterar o comportamento; spinners escondidos */
body .hl-input::-webkit-outer-spin-button,
body .hl-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
body .hl-input[type=number] { -moz-appearance: textfield; appearance: textfield; }

/* mensagens devolvidas pelo servidor (.senhaincorreta / .esquecisenha) */
body .hl-msg {
    display: block;
    margin: 0 0 0.5rem;
    font-size: 0.8125rem;
    line-height: 1.4;
    font-weight: 500;
}
body .hl-msg:empty { display: none; }
/* holerite.css:17 e :23 fixam height:25px em .esquecisenha/.senhaincorreta, o que
   cortaria mensagem de duas linhas no layout novo */
body .hl-msg.senhaincorreta,
body .hl-msg.esquecisenha { height: auto; margin-left: 0; margin-right: 0; }
body .hl-msg--error { color: var(--hl-destructive); }
body .hl-msg--info { color: var(--hl-primary); }

@media (max-width: 480px) {
    .hl-login { padding: 1.25rem; align-items: flex-start; }
    .hl-login__card { padding-top: 2.5rem; }
}

/* =========================================================================
   SHELL: sidebar + header
   ========================================================================= */
.hl-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1030;
    display: flex;
    flex-direction: column;
    width: var(--hl-sidebar-w);
    background: var(--hl-sidebar-bg);
    border-right: 1px solid var(--hl-border);
    color: var(--hl-fg);
}
.hl-sidebar__brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    height: var(--hl-header-h);
    padding: 0 1.25rem;
    border-bottom: 1px solid var(--hl-border);
    flex-shrink: 0;
}
.hl-sidebar__logo {
    display: grid;
    place-items: center;
    height: 2.25rem;
    width: 2.25rem;
    flex-shrink: 0;
    border-radius: 0.75rem;
    background: var(--hl-primary);
    color: var(--hl-primary-fg);
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1;
}
.hl-sidebar__brandtext { min-width: 0; flex: 1; }
.hl-sidebar__brandname { font-size: 0.875rem; font-weight: 700; line-height: 1; }
.hl-sidebar__brandsub { font-size: 0.6875rem; color: var(--hl-muted-fg); margin-top: 0.25rem; }
.hl-sidebar__close {
    display: none;
    padding: 0;
    border: 0;
    background: none;
    color: var(--hl-muted-fg);
    cursor: pointer;
}

.hl-nav { flex: 1; padding: 0.75rem; overflow-y: auto; }
body .hl-nav__item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    margin-bottom: 0.25rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--hl-muted-fg);
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}
body .hl-nav__item svg { flex-shrink: 0; }
body .hl-nav__item:hover {
    background: var(--hl-sidebar-accent);
    color: var(--hl-fg);
    text-decoration: none;
}
body .hl-nav__item--ativo,
body .hl-nav__item--ativo:hover {
    background: var(--hl-sidebar-accent);
    color: var(--hl-fg);
    font-weight: 600;
}

.hl-sidebar__user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-top: 1px solid var(--hl-border);
    flex-shrink: 0;
}
.hl-sidebar__userinfo { min-width: 0; flex: 1; }
.hl-sidebar__username {
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hl-sidebar__usermeta {
    font-size: 0.6875rem;
    color: var(--hl-muted-fg);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hl-header {
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    gap: 1rem;
    height: var(--hl-header-h);
    padding: 0 1.25rem;
    background: var(--hl-bg);
    border-bottom: 1px solid var(--hl-border);
}
.hl-header__burger {
    display: none;
    padding: 0;
    border: 0;
    background: none;
    color: var(--hl-fg);
    cursor: pointer;
}
.hl-header__titles { min-width: 0; flex: 1; }
body .hl-header__title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.3;
    color: var(--hl-fg);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
body .hl-header__sub {
    margin: 0;
    font-size: 0.75rem;
    color: var(--hl-muted-fg);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hl-header__user {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.25rem 0.75rem 0.25rem 0.25rem;
    border: 1px solid var(--hl-border);
    border-radius: 0.75rem;
    background: var(--hl-bg);
}
.hl-header__username { font-size: 0.875rem; font-weight: 500; color: var(--hl-fg); }
.hl-header__exit { display: none; }

/* Botão de tema. O protótipo (linha 166) o diferencia dos demais ícones do
   header com borda e fundo de card — h-9 w-9 rounded-xl border bg-card. */
body .hl-tema {
    height: 2.25rem;
    width: 2.25rem;
    border: 1px solid var(--hl-border);
    border-radius: 0.75rem;
    background: var(--hl-card);
}
body .hl-tema:hover { background: var(--hl-sidebar-accent); color: var(--hl-fg); }

/* Mostra o destino do clique, não o estado atual: lua enquanto está claro,
   sol enquanto está escuro (protótipo 168 e 171). */
.hl-tema__sol { display: none; }
:root[data-hl-tema="escuro"] .hl-tema__sol { display: block; }
:root[data-hl-tema="escuro"] .hl-tema__lua { display: none; }

.hl-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1025;
    background: var(--hl-backdrop);
}

@media (max-width: 767px) {
    body:has(.hl-shell) { padding-left: 0; }
    .hl-sidebar {
        transform: translateX(-100%);
        transition: transform .2s ease;
        box-shadow: var(--hl-sombra-3);
    }
    .hl-shell--aberto .hl-sidebar { transform: translateX(0); }
    .hl-shell--aberto .hl-overlay { display: block; }
    .hl-sidebar__close,
    .hl-header__burger { display: block; }
    .hl-header__user { display: none; }
    .hl-header__exit { display: grid; }
}

/* =========================================================================
   PAGINAS DE CONTEUDO
   ========================================================================= */
.hl-page { padding: 1.5rem 1.25rem 3rem; }
@media (min-width: 640px) {
    .hl-page { padding: 1.5rem 2rem 3rem; }
}
.hl-grid { display: grid; gap: 1.5rem; }
@media (min-width: 1024px) {
    .hl-grid { grid-template-columns: 320px minmax(0, 1fr); align-items: start; }
}
.hl-detalhe > * + * { margin-top: 1rem; }

/* cards */
body .hl-card {
    border: 1px solid var(--hl-border);
    border-radius: var(--hl-radius-lg);
    background: var(--hl-card);
    overflow: hidden;
}
.hl-card__head {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--hl-border);
    font-size: 0.875rem;
    font-weight: 600;
}

/* lista de competencias */
.hl-comp__list { display: flex; flex-direction: column; }
body .hl-comp__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--hl-border);
    color: var(--hl-fg);
    text-decoration: none;
    transition: background-color .15s ease;
}
.hl-comp__item:first-child { border-top: 0; }
body .hl-comp__item:hover {
    background: var(--hl-muted-bg);
    color: var(--hl-fg);
    text-decoration: none;
}
body .hl-comp__item--sel,
body .hl-comp__item--sel:hover { background: var(--hl-primary-suave); }
.hl-comp__info { min-width: 0; }
.hl-comp__mes { font-size: 0.875rem; font-weight: 600; }
.hl-comp__mes span { color: var(--hl-muted-fg); font-weight: 400; }
.hl-comp__tipo { font-size: 0.6875rem; color: var(--hl-muted-fg); margin-top: 0.125rem; }
/* coluna direita: valor em cima, flag de confirmação embaixo */
.hl-comp__dir {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    flex-shrink: 0;
}
.hl-comp__valor { font-size: 0.875rem; font-weight: 500; white-space: nowrap; }

/* Flag de confirmação na lista de competências (Holerite e Ponto).
   O dado sai do próprio DadosGrid, que já é "select *" — nenhuma consulta
   nova. Confirmado é == 1, igual ao que o <script> de cada view faz com o
   input escondido; qualquer outro valor conta como pendente. */
.hl-flag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.4375rem;
    border-radius: 999px;
    font-size: 0.625rem;
    font-weight: 600;
    line-height: 1.5;
    letter-spacing: .01em;
    white-space: nowrap;
}
.hl-flag svg { flex-shrink: 0; }
.hl-flag--ok   { background: var(--hl-ok-suave);    color: var(--hl-ok-fg); }
.hl-flag--pend { background: var(--hl-aviso-suave); color: var(--hl-aviso-icone); }
/* os dois ícones estão sempre no HTML; o modificador decide qual aparece.
   É o que permite a confirmação por AJAX virar a flag sem montar SVG em JS. */
.hl-flag__ok, .hl-flag__pend { display: none; }
.hl-flag--ok .hl-flag__ok { display: block; }
.hl-flag--pend .hl-flag__pend { display: block; }
/* o texto também é o alvo do hlVirarFlag() das duas views */
.hl-flag__txt { flex-shrink: 0; }

/* -------------------------------------------------------------------------
   Competências como gaveta (Holerite e Ponto)

   Abaixo de 1024px o .hl-grid perde a segunda coluna e a lista de
   competências passa a ficar EMPILHADA ACIMA do documento. Com 12+ meses ela
   toma a tela inteira e o holerite só aparece depois de muita rolagem.

   Nessa faixa a lista vira uma gaveta que desliza pela direita, e no lugar
   dela fica a .hl-compbar, que mostra qual competência está aberta.

   O corte é 1024px, e não um "é celular", porque é exatamente onde a coluna
   deixa de existir: em tablet o problema é o mesmo. É também a razão de o
   drawer vir da DIREITA — entre 768 e 1023px o menu do shell ainda é uma
   barra fixa à esquerda, e os dois se sobreporiam.

   Isto é só CSS + uma classe trocada por JS: não muda marcação de dado, nem
   os ganchos .hl-comp__item--sel / hlVirarFlag() das duas views.
   ------------------------------------------------------------------------- */
.hl-compbar { display: none; }
.hl-compback { display: none; }
/* o botão de fechar é um .hl-iconbtn, e `body .hl-iconbtn` (linha 323) já
   declara display — por isso estas duas precisam de `body` para empatar em
   especificidade e vencer pela ordem, como manda a seção 4.2 do REFATORACAO. */
body .hl-comp__close { display: none; }

@media (max-width: 1023px) {
    .hl-compbar {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        width: 100%;
        margin: 0; /* o CSS antigo dá margem a controles de formulário — seção 6 */
        padding: 0.75rem 1rem;
        border: 1px solid var(--hl-border);
        border-radius: var(--hl-radius-lg);
        background: var(--hl-card);
        color: var(--hl-fg);
        font: inherit;
        text-align: left;
        cursor: pointer;
    }
    .hl-compbar__ico,
    .hl-compbar__chev { flex-shrink: 0; color: var(--hl-muted-fg); }
    .hl-compbar__txt { flex: 1; min-width: 0; }
    .hl-compbar__label {
        display: block;
        font-size: 0.6875rem;
        color: var(--hl-muted-fg);
    }
    .hl-compbar__valor {
        display: block;
        font-size: 0.875rem;
        font-weight: 600;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* A gaveta em si. z-index acima da .hl-sidebar (1030) do shell e abaixo
       do .hl-docmodal (1060), para nunca cobrir o documento aberto.

       Precisa do prefixo `body`: o <aside> também é .hl-card, e `body .hl-card`
       (0,1,1) declara border e border-radius. Sem o `body` aqui, `.hl-comp`
       (0,1,0) perderia e a gaveta ficaria com borda e cantos arredondados
       colados na lateral da tela. Media query não soma especificidade. */
    body .hl-comp {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        z-index: 1040;
        display: flex;
        flex-direction: column;
        width: min(20rem, 85vw);
        border: 0;
        border-radius: 0;
        box-shadow: var(--hl-sombra-3);
        transform: translateX(100%);
        transition: transform .2s ease;
    }
    /* idem: precisa empatar com a regra acima e vencer pela ordem */
    body .hl-comp--aberto { transform: translateX(0); }

    /* o cabeçalho fica parado e só a lista rola: com muitos meses a gaveta
       inteira rolaria e o botão de fechar sairia da tela. */
    .hl-comp .hl-card__head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        flex-shrink: 0;
    }
    body .hl-comp__close { display: grid; }
    .hl-comp__list {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .hl-compback {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1039;
        background: var(--hl-backdrop);
        opacity: 0;
        pointer-events: none;
        transition: opacity .2s ease;
    }
    .hl-compback--aberto { opacity: 1; pointer-events: auto; }
}

/* alertas */
.hl-alerta { border: 1px solid; border-radius: var(--hl-radius-lg); padding: 1rem; }
.hl-alerta__inner { display: flex; flex-direction: column; gap: 0.75rem; }
@media (min-width: 640px) {
    .hl-alerta__inner { flex-direction: row; align-items: center; }
}
.hl-alerta svg { flex-shrink: 0; }
body .hl-alerta__texto { margin: 0; flex: 1; font-size: 0.875rem; line-height: 1.5; }
.hl-alerta--aviso { border-color: var(--hl-aviso-borda); background: var(--hl-aviso-bg); color: var(--hl-aviso-fg); }
.hl-alerta--ok {
    border-color: var(--hl-ok-borda);
    background: var(--hl-ok-bg);
    color: var(--hl-ok-fg);
    padding: 0.625rem 1rem;
}
.hl-alerta--erro {
    border-color: var(--hl-erro-borda);
    background: var(--hl-erro-bg);
    color: var(--hl-erro-fg);
}

/* cabecalho de documento */
.hl-doc__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem;
    border-bottom: 1px solid var(--hl-border);
}
.hl-doc__head--compact { align-items: center; gap: 0.75rem; }
.hl-doc__tipo {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--hl-muted-fg);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.hl-doc__comp {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-top: 0.125rem;
}
.hl-doc__emp { font-size: 0.875rem; color: var(--hl-muted-fg); margin-top: 0.25rem; }
.hl-doc__titulo { font-size: 0.9375rem; font-weight: 600; }
.hl-doc__periodo { font-size: 0.75rem; color: var(--hl-muted-fg); margin-top: 0.125rem; }
.hl-doc__liq { text-align: right; }
.hl-doc__liqlabel { font-size: 0.75rem; color: var(--hl-muted-fg); }
.hl-doc__liqvalor {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--hl-primary);
    letter-spacing: -0.02em;
}

/* faixa de 3 colunas */
.hl-strip { display: grid; gap: 1px; background: var(--hl-border); }
@media (min-width: 640px) {
    .hl-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 640px) {
    .hl-strip--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.hl-strip__cel { background: var(--hl-card); padding: 1rem; }
.hl-strip__label { font-size: 0.6875rem; color: var(--hl-muted-fg); }
.hl-strip__valor { font-size: 0.875rem; font-weight: 500; margin-top: 0.125rem; }

/* corpo do documento */
.hl-doc__body { padding: 1.25rem; }
.hl-doc__body > * + * { margin-top: 1.5rem; }
.hl-sec { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.hl-dot { height: 0.625rem; width: 0.625rem; border-radius: 50%; flex-shrink: 0; }
.hl-dot--prov { background: var(--hl-dot-prov); }
.hl-dot--desc { background: var(--hl-dot-desc); }
body .hl-sec__titulo {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--hl-fg);
}

/* tabela de proventos/descontos */
.hl-tab { border: 1px solid var(--hl-border); border-radius: var(--hl-radius); overflow: hidden; }
.hl-tab__head,
.hl-tab__row {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) 90px 120px;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
}
.hl-tab__head {
    background: var(--hl-muted-bg);
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--hl-muted-fg);
    padding: 0.5rem 0.75rem;
}
.hl-tab__row { border-top: 1px solid var(--hl-border); font-size: 0.875rem; }
.hl-tab__total {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
    border-top: 1px solid var(--hl-border);
    font-size: 0.875rem;
    font-weight: 600;
}
.hl-tab__total--prov { background: var(--hl-ok-bg); }
.hl-tab__total--prov span:last-child { color: var(--hl-ok); }
.hl-tab__total--desc { background: var(--hl-desc-suave); }
.hl-tab__total--desc span:last-child { color: var(--hl-desc); }
/* variante de 3 colunas (recibo de férias: sem coluna de referência) */
.hl-tab--3 .hl-tab__head,
.hl-tab--3 .hl-tab__row { grid-template-columns: 64px minmax(0, 1fr) 120px; }

@media (max-width: 640px) {
    .hl-tab__head,
    .hl-tab__row { grid-template-columns: 48px minmax(0, 1fr) 70px 92px; font-size: 0.8125rem; }
    .hl-tab--3 .hl-tab__head,
    .hl-tab--3 .hl-tab__row { grid-template-columns: 48px minmax(0, 1fr) 100px; }
    .hl-tab__total { grid-template-columns: minmax(0, 1fr) 92px; }
}
/* telas estreitas: só o minmax evita o estouro, mas a descrição fica sem
   espaço. Aqui as colunas fixas e o respiro encolhem para sobrar largura. */
@media (max-width: 480px) {
    .hl-tab__head,
    .hl-tab__row,
    .hl-tab__total {
        gap: 0.25rem;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        font-size: 0.75rem;
    }
    .hl-tab__head,
    .hl-tab__row { grid-template-columns: 40px minmax(0, 1fr) 56px 76px; }
    .hl-tab--3 .hl-tab__head,
    .hl-tab--3 .hl-tab__row { grid-template-columns: 40px minmax(0, 1fr) 84px; }
    .hl-tab__total { grid-template-columns: minmax(0, 1fr) 76px; }
    .hl-doc__body,
    .hl-doc__head,
    .hl-doc__foot { padding-left: 1rem; padding-right: 1rem; }
    .hl-page { padding-left: 0.875rem; padding-right: 0.875rem; }
}

/* rodapé do documento quando também é o fim do card */
.hl-doc__foot--fim { border-radius: 0 0 var(--hl-radius-lg) var(--hl-radius-lg); }

/* tiles */
.hl-tiles { display: grid; gap: 0.75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) {
    .hl-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.hl-tile { background: var(--hl-muted-bg); border-radius: var(--hl-radius); padding: 0.75rem; }
.hl-tile__label { font-size: 0.6875rem; color: var(--hl-muted-fg); }
.hl-tile__valor { font-size: 0.875rem; font-weight: 600; margin-top: 0.125rem; }
.hl-tile--liq { background: var(--hl-primary-suave); }
.hl-tile--liq .hl-tile__label { color: var(--hl-primary-texto); }
.hl-tile--liq .hl-tile__valor { color: var(--hl-primary); font-weight: 700; }

/* cards de saldo (ponto) */
.hl-saldos { display: grid; gap: 1rem; grid-template-columns: repeat(1, minmax(0, 1fr)); }
@media (min-width: 640px) {
    .hl-saldos { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.hl-saldo {
    border: 1px solid var(--hl-border);
    border-radius: var(--hl-radius-lg);
    background: var(--hl-card);
    padding: 1.25rem;
}
.hl-saldo__label { font-size: 0.75rem; color: var(--hl-muted-fg); }
.hl-saldo__valor { font-size: 1.5rem; font-weight: 700; margin-top: 0.25rem; }
.hl-saldo--final { border-color: var(--hl-primary-borda); background: var(--hl-primary-suave2); }
.hl-saldo--final .hl-saldo__label { color: var(--hl-primary-texto); }
.hl-saldo--final .hl-saldo__valor { color: var(--hl-primary); }

/* espelho de ponto */
.hl-scroll { overflow-x: auto; }
.hl-esp { min-width: 760px; }
.hl-esp__head,
.hl-esp__row {
    display: grid;
    grid-template-columns: 92px 78px minmax(0, 1fr) 116px 92px 78px 78px 84px;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
}
.hl-esp__head {
    background: var(--hl-muted-bg);
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--hl-muted-fg);
    padding: 0.5rem 1rem;
}
.hl-esp__row { border-top: 1px solid var(--hl-border); font-size: 0.875rem; }

/* Celular: em vez de rolar 8 colunas na horizontal, cada marcação empilha.
   O original mostrava só Data e Marcações no telefone; aqui mantemos os oito
   valores, cada um com o rótulo vindo do data-rot, já que o cabeçalho sai. */
@media (max-width: 767px) {
    .hl-esp { min-width: 0; }
    .hl-esp__head { display: none; }
    .hl-esp__row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem 0.75rem;
        padding: 0.875rem 1rem;
        font-size: 0.8125rem;
    }
    /* Marcações e Horário ocupam a linha inteira */
    .hl-esp__row > span:nth-child(3),
    .hl-esp__row > span:nth-child(4) { grid-column: 1 / -1; }
    /* empilhado não faz sentido alinhar à direita */
    .hl-esp__row > span.hl-r { text-align: left; }
    .hl-esp__row > span::before {
        content: attr(data-rot);
        display: block;
        font-family: var(--hl-font);
        font-size: 0.625rem;
        font-weight: 500;
        font-style: normal;
        text-transform: uppercase;
        letter-spacing: .04em;
        color: var(--hl-muted-fg);
    }
    /* a data é a âncora visual da linha */
    .hl-esp__row > span:nth-child(1) { font-weight: 600; }
}

/* blocos de dados */
.hl-block { border: 1px solid var(--hl-border); border-radius: var(--hl-radius); overflow: hidden; }
.hl-block__head {
    padding: 0.5rem 0.75rem;
    background: var(--hl-muted-bg);
    border-bottom: 1px solid var(--hl-border);
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--hl-muted-fg);
    text-transform: uppercase;
    letter-spacing: .05em;
}
.hl-block__grid {
    display: grid;
    gap: 1px;
    background: var(--hl-border);
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 640px) {
    .hl-block__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .hl-block__grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .hl-block__cel--wide { grid-column: span 2; }
}
.hl-block__cel { background: var(--hl-card); padding: 0.75rem; min-width: 0; }
.hl-block__label { font-size: 0.6875rem; color: var(--hl-muted-fg); }
.hl-block__valor {
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: 0.125rem;
    overflow-wrap: break-word;
}
.hl-block__valor--prov { color: var(--hl-ok); font-weight: 600; }
.hl-block__valor--desc { color: var(--hl-desc); font-weight: 600; }
.hl-block__valor--liq { color: var(--hl-primary); font-weight: 700; }

/* rodape de documento */
.hl-doc__foot {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--hl-border);
    background: var(--hl-muted-bg);
}
@media (min-width: 640px) {
    .hl-doc__foot { flex-direction: row; align-items: center; justify-content: space-between; }
}
.hl-doc__cod { font-size: 0.75rem; color: var(--hl-muted-fg); }
.hl-doc__cod .hl-mono { font-weight: 500; color: var(--hl-fg); }
.hl-doc__auten { margin-top: 0.25rem; max-width: 32rem; line-height: 1.45; }

/* estado vazio */
.hl-empty {
    max-width: 30rem;
    margin: 3rem auto;
    padding: 2.5rem 1.5rem;
    border: 1px solid var(--hl-border);
    border-radius: var(--hl-radius-lg);
    background: var(--hl-card);
    text-align: center;
    color: var(--hl-muted-fg);
}
body .hl-empty__title {
    margin: 1rem 0 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--hl-fg);
}
body .hl-empty__text { margin: 0.375rem 0 0; font-size: 0.875rem; }

/* =========================================================================
   Documento em coluna unica

   Usada por Rendimentos, Ferias e Perfil - as tres telas em que o conteudo
   nao preenche a largura. Holerite e Ponto nao usam .hl-doc: eles montam
   .hl-grid, com a coluna de competencias ao lado, e ocupam a linha inteira.

   O max-width vem do max-w-3xl do prototipo (linhas 467, 555 e 620), que la
   fica encostado a esquerda. Aqui a caixa e centralizada: encostada, sobrava
   uma faixa vazia grande a direita nos monitores largos.
   ========================================================================= */
.hl-doc {
    max-width: 48rem;
    margin-left: auto;
    margin-right: auto;
}
.hl-doc > * + * { margin-top: 1.25rem; }

.hl-rend__topo {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1.25rem;
}
.hl-rend__sec { padding: 1.25rem; }
.hl-rend__sec--nested { border-bottom: 1px solid var(--hl-border); }
body .hl-rend__titulo {
    margin: 0 0 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--hl-fg);
}
.hl-card__head--sec {
    background: var(--hl-card-sutil);
    line-height: 1.4;
}

/* pares rótulo/valor */
.hl-kv {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(1, minmax(0, 1fr));
}
@media (min-width: 640px) {
    .hl-kv { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .hl-kv--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hl-kv__cel--2 { grid-column: span 2; }
    .hl-kv__cel--3 { grid-column: span 3; }
    .hl-kv--2 .hl-kv__cel--2 { grid-column: span 2; }
}
.hl-kv__label { font-size: 0.6875rem; color: var(--hl-muted-fg); }
.hl-kv__valor {
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: 0.125rem;
    overflow-wrap: break-word;
}

/* linhas numeradas do informe */
.hl-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--hl-border);
    font-size: 0.875rem;
    line-height: 1.45;
}
.hl-item:first-of-type { border-top: 0; }
.hl-card__head + .hl-item { border-top: 0; }
.hl-item__d { display: block; }
.hl-item__n {
    display: inline-block;
    min-width: 1.5rem;
    color: var(--hl-muted-fg);
}
.hl-item__v {
    font-weight: 500;
    white-space: nowrap;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.hl-tag {
    flex-shrink: 0;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    background: var(--hl-aviso-bg);
    border: 1px solid var(--hl-aviso-borda);
    color: var(--hl-aviso-fg);
    font-size: 0.6875rem;
    font-weight: 600;
}

/* =========================================================================
   Início — painel
   ========================================================================= */
.hl-home > * + * { margin-top: 1.5rem; }

.hl-hero {
    border: 1px solid var(--hl-border);
    border-radius: var(--hl-radius-lg);
    padding: 1.5rem;
    color: var(--hl-grad-fg);
    background: linear-gradient(135deg, var(--hl-grad-de), var(--hl-grad-ate));
}
@media (min-width: 640px) {
    .hl-hero { padding: 2rem; }
}
.hl-hero__data { margin: 0; font-size: 0.875rem; color: var(--hl-grad-fg-suave); }
.hl-hero__ola {
    margin: 0.25rem 0 0;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--hl-grad-fg);
}
@media (min-width: 640px) {
    .hl-hero__ola { font-size: 1.875rem; }
}
.hl-hero__sub { margin: 0.375rem 0 0; font-size: 0.875rem; color: var(--hl-grad-fg-suave); }

.hl-cards {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(1, minmax(0, 1fr));
}
@media (min-width: 640px) {
    .hl-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1280px) {
    .hl-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
body .hl-stat {
    display: block;
    padding: 1.25rem;
    border: 1px solid var(--hl-border);
    border-radius: var(--hl-radius-lg);
    background: var(--hl-card);
    color: var(--hl-fg);
    text-decoration: none;
    transition: box-shadow .15s ease, transform .15s ease;
}
body .hl-stat:hover {
    box-shadow: var(--hl-sombra-2);
    transform: translateY(-2px);
    text-decoration: none;
    color: var(--hl-fg);
}
.hl-stat__topo { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.hl-stat__label { font-size: 0.75rem; font-weight: 500; color: var(--hl-muted-fg); }
.hl-stat__icone {
    display: grid;
    place-items: center;
    height: 2rem;
    width: 2rem;
    flex-shrink: 0;
    border-radius: 0.5rem;
}
.hl-stat__icone--azul  { background: var(--hl-primary-suave); color: var(--hl-primary); }
.hl-stat__icone--verde { background: var(--hl-ok-suave); color: var(--hl-ok); }
.hl-stat__icone--ambar { background: var(--hl-aviso-suave); color: var(--hl-aviso-icone); }
.hl-stat__valor {
    margin-top: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}
.hl-stat__valor--verde { color: var(--hl-ok); }
.hl-stat__valor--desc { color: var(--hl-desc); }
.hl-stat__valor--vazio { color: var(--hl-muted-fg); font-weight: 500; }
.hl-stat__meta { margin-top: 0.25rem; font-size: 0.75rem; color: var(--hl-muted-fg); }
.hl-stat__meta--ok { color: var(--hl-ok); font-weight: 500; }

.hl-home__baixo {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(1, minmax(0, 1fr));
}
@media (min-width: 1024px) {
    .hl-home__baixo { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .hl-home__pend { grid-column: span 2; }
}
.hl-home__pend,
.hl-home__lgpd { padding: 1.25rem; }
.hl-home__pendtopo { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
body .hl-home__titulo { margin: 0; font-size: 1rem; font-weight: 600; color: var(--hl-fg); }
.hl-home__fonte { font-size: 0.75rem; color: var(--hl-muted-fg); }
.hl-home__lista { margin-top: 1rem; }
.hl-home__lista > * + * { margin-top: 0.75rem; }
body .hl-aviso {
    display: flex;
    gap: 0.75rem;
    padding: 0.875rem;
    border: 1px solid var(--hl-border);
    border-radius: var(--hl-radius);
    color: var(--hl-fg);
    text-decoration: none;
    transition: background-color .15s ease;
}
body .hl-aviso:hover { background: var(--hl-muted-bg); text-decoration: none; color: var(--hl-fg); }
.hl-aviso__dot {
    margin-top: 0.3rem;
    height: 0.5rem;
    width: 0.5rem;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--hl-primary);
}
.hl-aviso__titulo { font-size: 0.875rem; font-weight: 500; }
.hl-aviso__texto { font-size: 0.75rem; color: var(--hl-muted-fg); margin-top: 0.125rem; }
.hl-aviso__data { font-size: 0.6875rem; color: var(--hl-muted-fg); margin-top: 0.25rem; }

.hl-home__ok,
.hl-home__pendente {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: var(--hl-radius);
    font-size: 0.875rem;
}
.hl-home__ok { background: var(--hl-ok-suave); color: var(--hl-ok-fg); }
.hl-home__pendente { background: var(--hl-aviso-bg); color: var(--hl-aviso-fg); }
.hl-home__ok svg,
.hl-home__pendente svg { flex-shrink: 0; }
.hl-home__lgpdtexto {
    margin: 0.75rem 0 0;
    font-size: 0.75rem;
    color: var(--hl-muted-fg);
    line-height: 1.55;
}
body .hl-home__link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--hl-primary);
    cursor: pointer;
    text-decoration: none;
}
body .hl-home__link:hover { color: var(--hl-primary-hover); text-decoration: none; }

/* =========================================================================
   Perfil — formulário
   ========================================================================= */
.hl-perfil__topo {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
}
.hl-perfil__avatar {
    display: grid;
    place-items: center;
    height: 4rem;
    width: 4rem;
    flex-shrink: 0;
    border-radius: var(--hl-radius-lg);
    background: var(--hl-primary-suave);
    color: var(--hl-primary);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
}
.hl-perfil__nome { font-size: 1.125rem; font-weight: 700; }
.hl-perfil__meta { font-size: 0.875rem; color: var(--hl-muted-fg); }
.hl-perfil__meta2 { font-size: 0.75rem; color: var(--hl-muted-fg); margin-top: 0.125rem; }
.hl-perfil__sec { padding: 1.5rem; }
.hl-perfil__acoes {
    display: flex;
    justify-content: flex-end;
    margin-top: 1.25rem;
}
/* O ID #confirmar-perfil foi mantido do formulário antigo (ver seção 5 do
   REFATORACAO.md), e o holerite.css o posiciona com margem negativa para
   compensar o float:right que existia lá:
     holerite.css:583  margin-right: -53px !important   @media max-width 415px
     holerite.css:796  margin-right: -136px             @media max-width 767px
   No layout novo o botão é alinhado por flexbox, então essas margens jogavam
   ele para fora da tela no celular. O !important aqui é necessário porque só
   !important vence !important. */
body .hl-perfil__acoes #confirmar-perfil {
    margin-right: 0 !important;
    margin-left: 0;
}

.hl-form {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(1, minmax(0, 1fr));
}
@media (min-width: 640px) {
    .hl-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hl-form--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .hl-field--2 { grid-column: span 2; }
    .hl-form--3 .hl-field--2 { grid-column: span 1; }
}
/* dentro do grid o espaçamento vem do gap, não da margem do campo */
.hl-form .hl-field { margin-bottom: 0; }
/* .control-group e .controls existem no markup porque o Validacao3 depende
   deles (helpers/Validacao3.php:18,34,42): addClass("errortoltip"), limpar o
   erro ao digitar e focar o primeiro campo inválido. Aqui só neutralizamos
   o espaçamento que o Bootstrap aplica nessas classes. */
/* .control-group e .controls existem no markup porque o Validacao3 depende deles,
   e o holerite.css os dimensiona para o formulário antigo dentro das media
   queries de celular. Sem neutralizar, a grade do perfil quebra:
     holerite.css:564  .form-horizontal .controls  width: 270px !important  (<=415px)
     holerite.css:771  .form-horizontal .controls  width: 369px             (<=767px)
     holerite.css:577  .control-group              max-width: 285px         (<=415px)
     holerite.css:790  .control-group              max-width: 285px         (<=767px)
   O !important abaixo é obrigatório para vencer o !important da linha 564. */
.hl-form .control-group {
    margin-bottom: 0;
    max-width: none;
}
.hl-form .controls {
    margin-left: 0;
    width: auto !important;
}
/* bootstrap.css:1207 aplica padding vertical em .form-horizontal .control-group */
.hl-form.form-horizontal .control-group,
.form-horizontal .hl-form .control-group { padding-top: 0; padding-bottom: 0; }

/* o espaçamento do .hl-doc não alcança dentro do <form>, então os cards do
   perfil precisam da própria regra */
.hl-perfil__sec + .hl-perfil__sec { margin-top: 1.25rem; }

/* Mensagem de erro de validação.
   O style.css a define como position:absolute, e como os cards têm
   overflow:hidden ela era recortada pela borda. Aqui vira bloco estático
   logo abaixo do campo, então nada corta e o texto longo quebra em linhas. */
.hl-form .tooltip-error {
    position: static;
    display: block;
    margin: 0.375rem 0 0;
    padding: 0.375rem 0.625rem;
    background: var(--hl-erro-bg);
    border: 1px solid var(--hl-erro-borda);
    border-radius: 0.5rem;
    color: var(--hl-erro-fg);
    font-family: var(--hl-font);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.4;
    white-space: normal;
    overflow-wrap: break-word;
    box-shadow: none;
}
.hl-form .tooltip-error:before,
.hl-form .tooltip-error:after { display: none; }

/* campo com erro */
.hl-form .control-group.errortoltip .hl-input {
    border-color: var(--hl-erro-borda-forte);
}
.hl-form .control-group.errortoltip .hl-label {
    color: var(--hl-erro-fg);
}
body .hl-input[readonly] {
    background: var(--hl-muted-bg);
    color: var(--hl-muted-fg);
    cursor: not-allowed;
}

/* =========================================================================
   Modal de documentos LGPD (#lgpd2)
   Abre/fecha por $('#lgpd2').show()/.hide(), então o CSS não declara display
   no overlay: o .hide() põe display:none inline e o .show() o remove.
   O diálogo é centralizado por margin auto, que funciona tanto se o jQuery
   restaurar display:block quanto se deixar o valor da folha de estilo.
   ========================================================================= */
.hl-modal2 {
    position: fixed;
    inset: 0;
    z-index: 1060;
    padding: 1rem;
    overflow-y: auto;
    background: var(--hl-backdrop);
    font-family: var(--hl-font);
    -webkit-font-smoothing: antialiased;
}
.hl-modal2, .hl-modal2 *, .hl-modal2 *::before, .hl-modal2 *::after { box-sizing: border-box; }
.hl-modal2__dialog {
    width: 100%;
    max-width: 28rem;
    margin: 6vh auto;
    border: 1px solid var(--hl-border);
    border-radius: var(--hl-radius-lg);
    background: var(--hl-card);
    box-shadow: var(--hl-sombra-4);
    overflow: hidden;
}
.hl-modal2__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--hl-border);
}
body .hl-modal2__titulo {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--hl-fg);
}
body .hl-modal2__sub {
    margin: 0.125rem 0 0;
    font-size: 0.75rem;
    color: var(--hl-muted-fg);
}
.hl-modal2__body {
    padding: 0.75rem;
    max-height: 70vh;
    overflow-y: auto;
}
/* variante de texto corrido (#lgpdaceite), em vez da lista de links */
.hl-modal2__body--texto { padding: 1.25rem; }
.hl-modal2__ok {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.875rem;
    border-radius: var(--hl-radius);
    background: var(--hl-ok-suave);
    color: var(--hl-ok-fg);
    font-size: 0.875rem;
    font-weight: 500;
}
body .hl-modal2__texto {
    margin: 0.75rem 0 0;
    font-size: 0.8125rem;
    line-height: 1.55;
    color: var(--hl-muted-fg);
}
.hl-modal2__foot {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--hl-border);
    background: var(--hl-muted-bg);
}
body .hl-doclink {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: var(--hl-radius);
    font-size: 0.875rem;
    color: var(--hl-fg);
    text-decoration: none;
    transition: background-color .15s ease;
}
body .hl-doclink:hover {
    background: var(--hl-muted-bg);
    color: var(--hl-fg);
    text-decoration: none;
}
.hl-doclink__icone {
    display: grid;
    place-items: center;
    height: 2.25rem;
    width: 2.25rem;
    flex-shrink: 0;
    border-radius: 0.5rem;
    background: var(--hl-primary-suave);
    color: var(--hl-primary);
}
.hl-doclink__nome { flex: 1; font-weight: 500; }
.hl-doclink__seta { flex-shrink: 0; color: var(--hl-muted-fg); }

@media print {
    .hl-modal2 { display: none !important; }
}

/* =========================================================================
   Modal (#msg-plrdemitidos)
   O posicionamento continua vindo do .modal do Bootstrap; aqui apenas a
   aparencia acompanha o novo visual.
   ========================================================================= */
.hl-modal {
    font-family: var(--hl-font);
    /* bootstrap.css:3658 fixa background-color:#ffffff no .modal — no tema
       escuro a caixa ficaria branca. */
    background-color: var(--hl-card);
    color: var(--hl-fg);
    border-radius: var(--hl-radius-lg);
    border: 1px solid var(--hl-border);
    box-shadow: var(--hl-sombra-3);
    overflow: hidden;
}
.hl-modal .modal-header { border-bottom: 1px solid var(--hl-border); }
.hl-modal .modal-header h3 {
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--hl-fg);
}
.hl-modal .modal-body {
    font-size: 0.875rem;
    line-height: 1.55;
    color: var(--hl-fg-suave);
}
.hl-modal .modal-body h5 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--hl-fg);
}
.hl-modal .modal-footer {
    background: var(--hl-muted-bg);
    border-top: 1px solid var(--hl-border);
}
body .hl-modal .modal-footer .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2.25rem;
    padding: 0 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--hl-primary-fg);
    background: var(--hl-primary);
    background-image: none;
    border: 0;
    border-radius: 0.75rem;
    box-shadow: none;
    text-shadow: none;
    filter: none;
}
body .hl-modal .modal-footer .btn:hover {
    background: var(--hl-primary-hover);
    color: var(--hl-primary-fg);
    text-decoration: none;
}

/* =========================================================================
   Apprise - dialogo de confirmar / avisar (js/apprise-1.5.full.js)

   O DOM e montado pelo proprio JS, entao aqui so ha CSS: nenhuma funcao,
   texto ou callback muda. A estrutura gerada e

     .appriseOverlay
     .appriseOuter > .appriseInner > (texto solto) [+ .aInput] + .aButtons
                                                        > button[value=ok|cancel]

   Duas ressalvas que explicam o formato das regras:

   1. Escopo. .appriseOuter e global e as telas antigas (holerite_usuarios,
      form.js, menu.js) tambem chamam apprise(). Por isso o body:has(), no
      mesmo padrao do resto do arquivo - fora das telas migradas o dialogo
      continua exatamente como era.

   2. !important. O apprise aplica estilo INLINE de posicionamento em
      .appriseOuter (top/left/margin negativa calculada em JS) e de tamanho
      em .appriseOverlay (height/width do documento). Inline so e vencido por
      !important - o "body .hl-x" usado no resto do arquivo nao alcanca. Os
      !important abaixo estao limitados a essas propriedades; a aparencia
      (cor, borda, tipografia) usa especificidade normal.

      Trocar a margem negativa por translate(-50%,-50%) tambem corrige um bug
      do apprise: ele calcula a margem ANTES de anexar .aButtons, entao o
      dialogo ficava deslocado meia altura de botao para baixo.
   ========================================================================= */
body:has(.hl-login) .appriseOverlay,
body:has(.hl-shell) .appriseOverlay {
    height: 100% !important;
    width: 100% !important;
    background: var(--hl-backdrop);
}
body:has(.hl-login) .appriseOuter,
body:has(.hl-shell) .appriseOuter {
    top: 50% !important;
    left: 50% !important;
    margin: 0 !important;
    transform: translate(-50%, -50%);
    width: calc(100% - 2rem);
    max-width: 26rem;
    min-width: 0;
    min-height: 0;
    border: 1px solid var(--hl-border);
    border-radius: var(--hl-radius-lg);
    background: var(--hl-card);
    box-shadow: var(--hl-sombra-4);
    font-family: var(--hl-font);
    -webkit-font-smoothing: antialiased;
}
body:has(.hl-login) .appriseInner,
body:has(.hl-shell) .appriseInner {
    padding: 1.75rem 1.5rem 1.375rem;
    font-size: 0.9375rem;
    line-height: 1.55;
    text-align: center;
    color: var(--hl-fg);
    text-shadow: none;
}
body:has(.hl-login) .aButtons,
body:has(.hl-shell) .aButtons {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 1.375rem 0 0;
}
body:has(.hl-login) .aButtons button,
body:has(.hl-shell) .aButtons button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 6rem;
    height: 2.5rem;
    margin: 0;
    padding: 0 1.125rem;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: normal;
    border: 0;
    border-radius: var(--hl-radius-lg);
    background: var(--hl-primary);
    background-image: none;
    color: var(--hl-primary-fg);
    text-shadow: none;
    filter: none;
    box-shadow: var(--hl-sombra-1);
    cursor: pointer;
    transition: background-color .15s ease;
}
body:has(.hl-login) .aButtons button:hover,
body:has(.hl-shell) .aButtons button:hover { background: var(--hl-primary-hover); }
body:has(.hl-login) .aButtons button[value="cancel"],
body:has(.hl-shell) .aButtons button[value="cancel"] {
    border: 1px solid var(--hl-border);
    background: var(--hl-card);
    color: var(--hl-fg);
    box-shadow: none;
}
body:has(.hl-login) .aButtons button[value="cancel"]:hover,
body:has(.hl-shell) .aButtons button[value="cancel"]:hover { background: var(--hl-muted-bg); }
body:has(.hl-login) .aButtons button:focus-visible,
body:has(.hl-shell) .aButtons button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--hl-primary-ring);
}
/* .aInput/.aTextbox nao sao usados hoje nas telas migradas; ficam alinhados
   para o caso de algum apprise({'input':...}) aparecer. */
body:has(.hl-login) .aInput,
body:has(.hl-shell) .aInput { margin: 1.125rem 0 0; text-align: center; }
body:has(.hl-login) .aTextbox,
body:has(.hl-shell) .aTextbox {
    width: 100%;
    height: 2.5rem;
    padding: 0 0.875rem;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 400;
    border: 1px solid var(--hl-border);
    border-radius: var(--hl-radius);
    box-shadow: none;
}

/* =========================================================================
   Modal do documento (#myModalIframe, montado por helpers/Form.php)

   Mostra o PDF gerado pelas rotas imprimir* dentro de um iframe. A API
   publica continua sendo modalIframe.open(url) - as quatro views migradas
   chamam exatamente isso.
   ========================================================================= */
.hl-docmodal {
    position: fixed;
    inset: 0;
    z-index: 1070;
    display: none;
    padding: 1.5rem;
    font-family: var(--hl-font);
    -webkit-font-smoothing: antialiased;
}
.hl-docmodal, .hl-docmodal *, .hl-docmodal *::before, .hl-docmodal *::after { box-sizing: border-box; }
.hl-docmodal--aberto { display: block; }
.hl-docmodal__fundo {
    position: absolute;
    inset: 0;
    background: var(--hl-backdrop);
}
.hl-docmodal__dialog {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 68rem;
    height: 100%;
    margin: 0 auto;
    border: 1px solid var(--hl-border);
    border-radius: var(--hl-radius-lg);
    background: var(--hl-card);
    box-shadow: var(--hl-sombra-4);
    overflow: hidden;
}
.hl-docmodal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-shrink: 0;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--hl-border);
}
body .hl-docmodal__titulo {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--hl-fg);
}
body .hl-docmodal__x {
    display: grid;
    place-items: center;
    height: 2rem;
    width: 2rem;
    flex-shrink: 0;
    padding: 0;
    border: 0;
    border-radius: 0.5rem;
    background: transparent;
    background-image: none;
    box-shadow: none;
    text-shadow: none;
    filter: none;
    color: var(--hl-muted-fg);
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}
body .hl-docmodal__x:hover { background: var(--hl-muted-bg); color: var(--hl-fg); }
.hl-docmodal__body {
    position: relative;
    flex: 1;
    min-height: 0;
    background: var(--hl-muted-bg);
}
body .hl-docmodal__frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}
/* Overlay de carregamento: visivel so enquanto o iframe nao disparou load.
   O gif antigo vinha de http://gazin.com.br/admin/img/loader3.gif, host
   externo bloqueado pelo CSP default-src 'self' de public/.htaccess - ou
   seja, era imagem quebrada. Aqui o spinner e CSS. */
.hl-docmodal__load {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    z-index: 1;
    background: var(--hl-muted-bg);
    font-size: 0.8125rem;
    color: var(--hl-muted-fg);
}
.hl-docmodal--carregando .hl-docmodal__load { display: flex; }
.hl-docmodal__spin {
    height: 1.75rem;
    width: 1.75rem;
    border: 2px solid var(--hl-border);
    border-top-color: var(--hl-primary);
    border-radius: 50%;
    animation: hl-girar .7s linear infinite;
}
@keyframes hl-girar { to { transform: rotate(360deg); } }
.hl-docmodal__foot {
    display: flex;
    justify-content: flex-end;
    flex-shrink: 0;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--hl-border);
    background: var(--hl-muted-bg);
}
@media (max-width: 640px) {
    .hl-docmodal { padding: 0; }
    .hl-docmodal__dialog { border: 0; border-radius: 0; }
}

/* =========================================================================
   "Aguarde..." do ajax.js (#modalblock + #loading)

   Mesmo caso do apprise: o HTML e montado em js/ajax.js e nao e tocado. O
   gif original continua carregando, mas fica oculto - o spinner e CSS, para
   nao depender de uma imagem com caminho relativo a rota.

   Os !important daqui tambem cobrem estilo inline do ajax.js: opacity e
   background-color no #modalblock (linhas 102 e 138) e font-family/size/
   weight no <strong> do #loading.

   ATENCAO ao html:has() em vez do body:has() usado no resto do arquivo. Sao
   tres origens para o MESMO #loading e elas nao concordam sobre onde anexar:

     ajax.js:32,67,102,138   $('html').append(...)  -> irmao do <body>
     form.js:46,103,186      $('html').append(...)  -> irmao do <body>
     Util.php:187,196        $('body').append(...)  -> dentro do <body>

   body:has() perderia as duas primeiras. html:has() alcanca as tres, porque
   quem esta dentro do body tambem e descendente do html.

   Pelo mesmo motivo o backdrop e selecionado por .modal-backdrop e nao por
   #modalblock: o do Util.php nao tem id nenhum.
   ========================================================================= */
html:has(.hl-login) .modal-backdrop,
html:has(.hl-shell) .modal-backdrop {
    background-color: var(--hl-backdrop-solido) !important;
    opacity: .45 !important;
}
/* Variante canto superior direito (ajax.envia / ajax.enviaAsync): o inline
   traz top:59px, que ficava por cima da borda do header de 4rem. */
html:has(.hl-shell) #loading {
    top: calc(var(--hl-header-h) + 0.75rem) !important;
    right: 1rem !important;
}
/* Variante centralizada (enviaBlockScreen*, redirecionaModal, reloadModal):
   o inline aplica margin -64px/-28px, medida da caixa antiga de 128x56. Com
   a caixa nova isso descentraliza, entao a margem sai e quem centraliza e o
   translate. O seletor de irmao distingue as duas variantes - so a
   centralizada e precedida por um backdrop. */
html:has(.hl-login) .modal-backdrop ~ #loading,
html:has(.hl-shell) .modal-backdrop ~ #loading {
    top: 50% !important;
    left: 50% !important;
    right: auto !important;
    margin: 0 !important;
    transform: translate(-50%, -50%);
}
html:has(.hl-login) #loading .alert,
html:has(.hl-shell) #loading .alert {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin: 0;
    padding: 0.75rem 1.125rem;
    border: 1px solid var(--hl-border);
    border-radius: var(--hl-radius);
    background: var(--hl-card);
    background-image: none;
    box-shadow: var(--hl-sombra-3);
    color: var(--hl-fg);
    text-shadow: none;
}
html:has(.hl-login) #loading .alert img,
html:has(.hl-shell) #loading .alert img { display: none; }
html:has(.hl-login) #loading .alert::before,
html:has(.hl-shell) #loading .alert::before {
    content: "";
    height: 1.125rem;
    width: 1.125rem;
    flex-shrink: 0;
    border: 2px solid var(--hl-border);
    border-top-color: var(--hl-primary);
    border-radius: 50%;
    animation: hl-girar .7s linear infinite;
}
html:has(.hl-login) #loading .alert strong,
html:has(.hl-shell) #loading .alert strong {
    font-family: var(--hl-font) !important;
    font-size: 0.8125rem !important;
    font-weight: 500 !important;
    color: var(--hl-fg);
}

/* =========================================================================
   Impressao
   ========================================================================= */
@media print {
    /* Impressão é sempre no tema claro: fundo #121212 gasta toner e, com
       "imprimir cores de fundo" desligado no navegador — o padrão —, o texto
       claro sairia quase branco sobre papel branco. Redeclarar os tokens aqui
       basta: nenhuma regra tem cor fixa.

       Isto NÃO afeta os PDFs. As rotas imprimir* renderizam por views próprias
       via dompdf, fora do layout holerite.php, e não carregam este arquivo. */
    :root[data-hl-tema="escuro"] {
        --hl-primary: #0d71f0;
        --hl-primary-fg: #ffffff;
        --hl-primary-suave: rgba(13, 113, 240, .1);
        --hl-primary-texto: rgba(13, 113, 240, .75);
        --hl-bg: #ffffff;
        --hl-fg: #252525;
        --hl-fg-suave: #3f3f3f;
        --hl-card: #ffffff;
        --hl-card-sutil: rgba(250, 250, 250, .7);
        --hl-border: #e5e5e5;
        --hl-muted-fg: #8a8a8a;
        --hl-muted-bg: #fafafa;
        --hl-ok: #059669;
        --hl-ok-bg: #ecfdf5;
        --hl-ok-fg: #065f46;
        --hl-dot-prov: #10b981;
        --hl-desc: #d92d20;
        --hl-desc-suave: rgba(225, 29, 72, .09);
        --hl-dot-desc: #f43f5e;
        --hl-erro-fg: #b42318;
        --hl-sombra-1: none;
        --hl-sombra-2: none;
        --hl-sombra-3: none;
        --hl-sombra-4: none;
    }
    /* os tokens acima já valem aqui, então var(--hl-bg) resolve para branco */
    body:has(.hl-login),
    body:has(.hl-shell) { background-color: var(--hl-bg) !important; color: var(--hl-fg); }

    .hl-shell,
    .hl-comp,
    .hl-compbar,
    .hl-compback,
    .hl-alerta,
    .hl-btn,
    .hl-docmodal,
    .appriseOverlay,
    .appriseOuter,
    #modalblock,
    #loading { display: none !important; }
    body:has(.hl-shell) { padding-left: 0; }
    .hl-grid { display: block; }
    .hl-scroll { overflow: visible; }
    .hl-esp { min-width: 0; }
}
