/* ════════════════════════════════════════════════════════════
   Controle de Horas TsTeck — Folha de estilo
   ─────────────────────────────────────────────────────────────
   Origem:
   · CASCA (boot, login, topbar, abas, chip de usuário, botões
     .btn-contorno/.btn-fantasma/.btn-perigo, modal de confirmação
     #modal/.overlay, responsivo) — portada do Almoxarifado TsTeck
     (Almoxarifado/Programa/public/css/styles.css).
   · COMPONENTES (KPIs, control-bar, analytics, tabelas, badges,
     modais .modal-backdrop/.modal-window, formulários, jornada
     .ts-*, timeline, toasts, módulo de horas .hours-*, painel de
     BI .bi-*, relatório da diretoria .board-*, impressão) —
     portados do bloco <style> do sistema original
     (Controle_de_Horas/index.html).

   TEMA CLARO ÚNICO — não existe modo escuro.
   Paleta oficial TsTeck: vermelho #9b1006 · grafite #3C3C3B ·
   branco #FFFFFF. As cores semânticas (verde/âmbar/vermelho/azul/
   roxo) foram mantidas do original porque carregam significado
   (saldo positivo, alerta, débito, informação), não identidade.

   Os NOMES dos tokens seguem o sistema original (o HTML tem
   centenas de style="... var(--primary-light) ..."); os tokens da
   casca do Almoxarifado (--bg, --surface, --text-2, --ok, --err…)
   existem como ALIAS dos originais. Um único :root.
   ════════════════════════════════════════════════════════════ */

/* ── Inter auto-hospedada (mesmos arquivos da lousa) ───────── */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../fonts/inter-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../fonts/inter-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ════════════════════════════════════════════════════════════
   TOKENS — tema claro (único)
   ════════════════════════════════════════════════════════════ */
:root {
    /* Só o tema claro existe: trava os widgets nativos do navegador
       (date picker, select, scrollbar) em claro mesmo com o Windows
       em modo escuro. */
    color-scheme: light;

    /* ── Marca — vermelho oficial #9b1006 ─────────────────── */
    --primary: #9b1006;
    --primary-hover: #7a0d05;
    --primary-dark: #7a0d05;
    /* Superfície CLARA da marca: fundo de cartão selecionado, painel
       de alerta, linha destacada. No original era o azul-claro
       (#eff6ff); aqui é o rosa-pálido da marca. NÃO é cor de hover. */
    --primary-light: #fbeeed;
    --primary-soft: rgba(155, 16, 6, 0.07);
    --primary-soft-2: rgba(155, 16, 6, 0.14);
    --on-primary: #ffffff;
    --primary-ring: 0 0 0 3px rgba(155, 16, 6, 0.14);
    /* Anel de foco único para todo o app (nome do original) */
    --ring: 0 0 0 3px rgba(155, 16, 6, 0.18);

    /* ── Texto — grafite oficial #3C3C3B ──────────────────── */
    --secondary: #5c5c5b;
    --text-main: #3C3C3B;
    --text-muted: #7a7a79;
    /* Alias da casca do Almoxarifado */
    --text: var(--text-main);
    --text-2: var(--secondary);
    --text-3: var(--text-muted);

    /* ── Superfícies ──────────────────────────────────────── */
    --bg-body: #f4f4f4;
    --bg-card: #ffffff;
    --bg-subtle: #fafafa;
    --bg-header: #3C3C3B;
    /* Alias da casca do Almoxarifado */
    --bg: var(--bg-body);
    --surface: var(--bg-card);
    --surface-2: var(--bg-subtle);
    --raised: #ffffff;
    --overlay: rgba(28, 28, 28, 0.45);

    /* ── Bordas (escala neutra derivada do grafite) ───────── */
    --border: #e2e2e1;
    --border-strong: #c9c9c8;
    --border-subtle: #ededec;
    /* Trilhos de barra de progresso e fundos neutros de tabela */
    --track: #e2e2e1;

    /* ── Semânticas (nomes do original) ───────────────────── */
    --success: #15803d;
    --success-light: #dcfce7;
    --warning: #b45309;
    --warning-light: #fef3c7;
    --danger: #b91c1c;
    --danger-light: #fee2e2;
    --info: #0369a1;
    --info-light: #e0f2fe;
    --purple: #6d28d9;
    --purple-light: #f3e8ff;

    /* Semânticas — alias da casca do Almoxarifado */
    --ok: var(--success);
    --ok-soft: rgba(22, 163, 74, 0.10);
    --warn: var(--warning);
    --warn-soft: rgba(202, 138, 4, 0.12);
    --err: #dc2626;
    --err-soft: rgba(220, 38, 38, 0.09);
    --info-soft: rgba(37, 99, 235, 0.10);

    /* Superfícies semânticas e sua tinta: cada caixa colorida do app
       (aviso, alerta, destaque) usa um par surface/border/ink. */
    --info-surface: #eff6ff;   --info-border: #bfdbfe;   --info-ink: #1e40af;
    --ok-surface: #ecfdf5;     --ok-border: #a7f3d0;     --ok-ink: #065f46;
    --warn-surface: #fffbeb;   --warn-border: #fde68a;   --warn-ink: #92400e;
    --danger-surface: #fef2f2; --danger-border: #fecaca; --danger-ink: #991b1b;
    --purple-surface: #f5f3ff; --purple-border: #ddd6fe; --purple-ink: #5b21b6;
    --orange-surface: #fff7ed; --orange-border: #fed7aa; --orange-ink: #9a3412;

    /* ── Sombras (cinza neutro). A hierarquia vem da borda; só o que
       flutua (modal, toast, menu) tem sombra. ─────────────── */
    --shadow-sm: 0 1px 2px rgba(28, 28, 28, 0.05), 0 1px 3px rgba(28, 28, 28, 0.06);
    --shadow-md: 0 4px 10px -2px rgba(28, 28, 28, 0.08), 0 2px 4px -2px rgba(28, 28, 28, 0.05);
    --shadow-lg: 0 12px 28px -8px rgba(28, 28, 28, 0.18);
    --shadow-primary: 0 6px 16px -4px rgba(155, 16, 6, 0.35);

    /* ── Faixa de sinalização (assinatura visual TsTeck) ──── */
    --hazard: repeating-linear-gradient(-55deg,
        var(--primary) 0 14px, var(--primary-dark) 14px 28px);

    /* Fundo do login: grade técnica sutil */
    --login-grid: rgba(28, 28, 28, 0.045);
    --login-glow: rgba(155, 16, 6, 0.09);

    /* ── Tipografia ───────────────────────────────────────── */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'JetBrains Mono', 'Cascadia Code', ui-monospace, Consolas, monospace;

    /* ── Raios ────────────────────────────────────────────── */
    --radius-xs: 6px;
    --radius-sm: 8px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 16px;
    --radius-full: 999px;

    /* ── Movimento / medidas ──────────────────────────────── */
    --transition-fast: 0.12s ease;
    --transition: 0.18s ease;
    --topbar-h: 60px;
}

/* ════════════════════════════════════════════════════════════
   RESET
   O root fica em 16px (padrão do navegador): os componentes do
   original foram desenhados em rem sobre 16px, e são a maior parte
   da tela. A casca do Almoxarifado (que assumia root 14px) recebe
   tamanhos explícitos nas suas regras para manter a proporção.
   ════════════════════════════════════════════════════════════ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { height: 100%; }
body {
    min-height: 100%;
    width: 100%;
    max-width: 100%;
    font-family: var(--font-sans);
    background: var(--bg-body);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    /* Evita "página mais larga que a tela"; "clip" não cria contexto
       de rolagem, então a topbar sticky continua funcionando. */
    overflow-x: hidden;
    overflow-x: clip;
}
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
textarea { font-family: inherit; }
/* Nenhuma mídia embutida pode ultrapassar o container */
img, canvas, video, iframe { max-width: 100%; }
img { display: block; }
h1, h2, h3 { font-weight: 650; letter-spacing: -0.015em; }
a { color: var(--primary); }

/* Foco visível e consistente (teclado), sem poluir o clique de mouse */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* O atributo `hidden` precisa vencer as regras de display do autor.
   Sem !important, um seletor de ID como #view-login (1,0,0) ganha de
   [hidden] (0,1,0) e o elemento continua visível — a tela de login
   não sumiria depois do login, e as ações de um módulo continuariam
   visíveis no outro. */
[hidden] { display: none !important; }

::selection { background: var(--primary-soft-2); }

/* A logo (vermelho #9b1006 + grafite) é usada crua, sem filtro:
   qualquer inversão a deixava com a cor errada. */
.logo-img {
    display: block;
    height: auto;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}

/* Cada módulo é uma página: só a ativa fica no fluxo */
.view[hidden] { display: none; }

/* ════════════════════════════════════════════════════════════
   BOOT SPLASH (some quando o Auth decide login × app)
   ════════════════════════════════════════════════════════════ */
#boot {
    position: fixed; inset: 0; z-index: 300;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-body);
}
.boot-logo { width: 170px; animation: boot-pulse 1.2s ease-in-out infinite; }
@keyframes boot-pulse {
    0%, 100% { opacity: 0.35; }
    50% { opacity: 1; }
}

/* ════════════════════════════════════════════════════════════
   LOGIN
   ════════════════════════════════════════════════════════════ */
#view-login {
    position: relative;
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
    overflow: hidden;
}
.login-bg {
    position: absolute; inset: 0; z-index: 0;
    background:
        radial-gradient(680px 420px at 50% -10%, var(--login-glow), transparent 70%),
        linear-gradient(var(--login-grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--login-grid) 1px, transparent 1px);
    background-size: auto, 34px 34px, 34px 34px;
}
.login-card {
    position: relative; z-index: 1;
    width: 100%; max-width: 400px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 0 36px 30px;
    overflow: hidden;
    animation: card-entra 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes card-entra {
    from { opacity: 0; transform: translateY(14px) scale(0.985); }
    to   { opacity: 1; transform: none; }
}
.hazard-strip {
    height: 7px;
    margin: 0 -36px 30px;
    background: var(--hazard);
}
.login-logo { width: 168px; margin: 0 auto 20px; }
.login-titulo {
    text-align: center;
    font-size: 1.3rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-weight: 800;
    color: var(--text-main);
}
.login-sub {
    text-align: center;
    color: var(--text-2);
    margin: 6px 0 26px;
    font-size: 0.84rem;
}
.campo { display: block; margin-bottom: 16px; }
.campo span {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-2);
    margin-bottom: 6px;
}
.campo input {
    width: 100%;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    font-size: 0.9rem;
    color: var(--text-main);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}
.campo input::placeholder { color: var(--text-3); }
.campo input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--primary-ring);
    background: var(--bg-card);
}
.form-erro {
    background: var(--err-soft);
    color: var(--err);
    border: 1px solid color-mix(in srgb, var(--err) 30%, transparent);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    font-size: 0.82rem;
    margin-bottom: 14px;
}
.login-rodape {
    margin-top: 20px;
    text-align: center;
    font-size: 0.74rem;
    color: var(--text-3);
}

/* ════════════════════════════════════════════════════════════
   BOTÕES
   Duas famílias convivem no HTML: a da casca (.btn-primary,
   .btn-contorno, .btn-fantasma, .btn-perigo, .btn-block, .btn-mini,
   .btn-icone) e a do original (.btn-secondary, .btn-success,
   .btn-board, .btn-sm, .btn-icon, .btn-qa). Mesma base .btn.
   ════════════════════════════════════════════════════════════ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
    padding: 0.5rem 0.9rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
    line-height: 1.2;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color var(--transition-fast), border-color var(--transition-fast),
                color var(--transition-fast), box-shadow var(--transition-fast),
                transform var(--transition-fast);
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn svg { flex: none; }

/* Tamanhos */
.btn-block { width: 100%; padding: 11px 16px; }
.btn-mini { padding: 5px 11px; font-size: 0.78rem; }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.75rem; }
.btn-icon { padding: 0.45rem; }

/* Ação principal — vermelho TsTeck */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    color: var(--on-primary);
    box-shadow: var(--shadow-primary);
}
.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

/* Contorno cinza — .btn-secondary (original) = .btn-contorno (casca);
   .btn-qa era o roxo do painel de testes e vira o mesmo contorno. */
.btn-secondary, .btn-contorno, .btn-qa {
    background-color: var(--bg-card);
    border-color: var(--border-strong);
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
}
.btn-secondary:hover:not(:disabled),
.btn-contorno:hover:not(:disabled),
.btn-qa:hover:not(:disabled) {
    background-color: var(--bg-subtle);
    border-color: var(--primary);
    color: var(--primary);
}

/* Confirmação positiva — verde semântico */
.btn-success {
    background-color: var(--success);
    border-color: var(--success);
    color: #ffffff;
}
.btn-success:hover:not(:disabled) {
    background-color: #166534;
    border-color: #166534;
}

/* Relatório da diretoria — grafite TsTeck com texto branco */
.btn-board {
    background-color: var(--bg-header);
    border-color: var(--bg-header);
    color: #ffffff;
}
.btn-board:hover:not(:disabled) {
    background-color: #4d4d4c;
    border-color: #4d4d4c;
    color: #ffffff;
}

/* Fantasma — texto só, ganha fundo suave no hover (Sair, links) */
.btn-fantasma { color: var(--text-2); box-shadow: none; }
.btn-fantasma:hover:not(:disabled) {
    color: var(--primary);
    background: var(--primary-soft);
}

/* Perigo — contorno vermelho que preenche no hover (confirmar exclusão) */
.btn-perigo {
    background: transparent;
    border-color: color-mix(in srgb, var(--err) 45%, transparent);
    color: var(--err);
}
.btn-perigo:hover:not(:disabled) {
    background: var(--err);
    border-color: var(--err);
    color: #ffffff;
}

/* Botão só-ícone quadrado (fechar, remover) */
.btn-icone {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px;
    border-radius: var(--radius-sm);
    color: var(--text-2);
    transition: color var(--transition-fast), background var(--transition-fast);
}
.btn-icone:hover { color: var(--primary); background: var(--primary-soft); }

/* ════════════════════════════════════════════════════════════
   TOPBAR (branca, logo, abas, chip do usuário)
   ════════════════════════════════════════════════════════════ */
.topbar {
    height: var(--topbar-h);
    display: flex; align-items: center; gap: 28px;
    padding: 0 22px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 50;
}
/* Faixa de sinalização logo abaixo da topbar */
.hazard-linha {
    height: 3px;
    background: var(--hazard);
    position: sticky; top: var(--topbar-h); z-index: 50;
    opacity: 0.9;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-logo { height: 30px; width: auto; }
.brand-sep { width: 1px; height: 22px; background: var(--border-strong); }
.brand-nome {
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.13em;
    font-size: 0.76rem;
    color: var(--text-2);
    white-space: nowrap;
}

/* Abas de tela */
.tabs { display: flex; gap: 4px; margin-right: auto; }
.tab {
    position: relative;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-2);
    white-space: nowrap;
    transition: color var(--transition-fast), background var(--transition-fast);
    display: inline-flex; align-items: center; gap: 7px;
}
.tab:hover { color: var(--text-main); background: var(--bg-subtle); }
.tab.active { color: var(--primary); background: var(--primary-soft); }
.tab.active::after {
    content: '';
    position: absolute; left: 12px; right: 12px; bottom: -2px;
    height: 2px; border-radius: 2px;
    background: var(--primary);
}

/* Pílula pequena vermelha de contagem (aba Equipe) */
.badge-contagem {
    min-width: 19px; height: 19px;
    padding: 0 5px;
    border-radius: var(--radius-full);
    background: var(--primary);
    color: var(--on-primary);
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    display: inline-flex; align-items: center; justify-content: center;
}

/* Lado direito: filtro de equipe (admin) + chip do usuário */
.topbar-acoes { display: flex; align-items: center; gap: 14px; }

.topbar-equipe {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.8rem;
    color: var(--text-2);
    white-space: nowrap;
}
.topbar-equipe > span {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-3);
}
.topbar-equipe select {
    max-width: 200px;
    padding: 6px 28px 6px 10px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-main);
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%237a7a79' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.topbar-equipe select:hover { border-color: var(--border-strong); }
.topbar-equipe select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--primary-ring);
    background-color: var(--bg-card);
}

.user-chip {
    display: flex; align-items: center; gap: 9px;
    padding: 4px 6px 4px 4px;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--bg-subtle);
}
.user-avatar {
    width: 26px; height: 26px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--on-primary);
    font-size: 0.68rem; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
    text-transform: uppercase;
}
.user-nome {
    font-size: 0.8rem; font-weight: 600;
    max-width: 160px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ════════════════════════════════════════════════════════════
   CONTEÚDO / TELAS
   ════════════════════════════════════════════════════════════ */
.conteudo { max-width: 1400px; margin: 0 auto; padding: 26px 22px 60px; }

/* Container do original (fallback para conteúdo gerado pelo JS) */
.container {
    max-width: 1400px;
    margin: 1.5rem auto;
    padding: 0 1.5rem;
    width: 100%;
}

.screen { display: none; animation: screen-entra 0.22s ease both; }
.screen.active { display: block; }
@keyframes screen-entra {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}

.screen-head {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
    margin-bottom: 18px;
}
.screen-head h2 { font-size: 1.2rem; }
.screen-sub { color: var(--text-2); font-size: 0.82rem; margin-top: 3px; }

/* Ações da tela, sempre no mesmo canto do cabeçalho */
.screen-acoes {
    display: flex; flex-wrap: wrap; align-items: center;
    gap: 8px;
    justify-content: flex-end;
    flex: none;
}

/* Nota curta ao lado de filtros/ações ("12 de 40 selecionados") */
.filtro-nota {
    color: var(--text-3);
    font-size: 0.8rem;
    align-self: center;
}

/* ════════════════════════════════════════════════════════════
   KPIs / CARTÕES-RESUMO
   ════════════════════════════════════════════════════════════ */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    transition: border-color 0.15s, background-color 0.15s;
    cursor: pointer;
}

/* Sem "pulo" no hover: só a borda reage */
.kpi-card:hover {
    border-color: var(--border-strong);
}

.kpi-card.active-filter {
    border-color: var(--primary);
    box-shadow: inset 0 0 0 1px var(--primary);
    background: var(--primary-light);
}

.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.kpi-icon {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
}

.kpi-value {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    color: var(--text-main);
}

.kpi-subtext {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ════════════════════════════════════════════════════════════
   CONTROL BAR & FILTROS
   ════════════════════════════════════════════════════════════ */
.control-bar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    align-items: center;
}

.search-group {
    display: flex;
    gap: 0.75rem;
    flex: 1;
    min-width: 280px;
    max-width: 500px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 0.6rem 0.75rem 0.6rem 2.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-main);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.search-input::placeholder { color: var(--text-muted); }

.search-input:focus {
    border-color: var(--primary);
    box-shadow: var(--ring);
}

.search-icon-pos {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.filter-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.filter-select {
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    background: var(--bg-card);
    color: var(--text-main);
    outline: none;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.filter-select:hover { border-color: var(--border-strong); }
.filter-select:focus {
    border-color: var(--primary);
    box-shadow: var(--ring);
}

/* ════════════════════════════════════════════════════════════
   ANALYTICS & GRÁFICOS
   ════════════════════════════════════════════════════════════ */
.analytics-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.analytics-header {
    padding: 1.15rem 1.5rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}
.analytics-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
}

.exec-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border);
}

.exec-metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.exec-metric-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.exec-metric-value {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.exec-metric-desc {
    font-size: 0.72rem;
    color: var(--secondary);
}

.charts-grid {
    display: grid;
    /* minmax(0, 1fr) impede que o canvas do gráfico "empurre" a largura da grade */
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    padding: 1.5rem;
}

.chart-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.chart-header h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

.chart-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.chart-canvas-wrapper {
    position: relative;
    height: 260px;
    width: 100%;
}

/* ════════════════════════════════════════════════════════════
   TABELAS
   ════════════════════════════════════════════════════════════ */
.table-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

/* Tabelas largas rolam AQUI dentro — nunca a página */
.table-responsive {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.875rem;
}

/* ---- Tabela principal de funcionários: largura 100% parametrizada ----
   table-layout fixed + colgroup em % = nunca precisa arrastar para o lado
   para chegar nos botões de ação. */
.employee-table {
    table-layout: fixed;
    width: 100%;
    font-size: 0.8rem;
}

.employee-table .col-emp     { width: 19%; }
.employee-table .col-adm     { width: 8%;  }
.employee-table .col-exp     { width: 16%; }
.employee-table .col-cycle   { width: 11%; }
.employee-table .col-limit   { width: 16%; }
.employee-table .col-status  { width: 14%; }
.employee-table .col-actions { width: 16%; }

.employee-table th,
.employee-table td {
    padding: 0.6rem 0.55rem;
    /* break-word (e não "anywhere") evita partir datas como 19/05/2026 ao meio */
    overflow-wrap: break-word;
    word-break: normal;
}

/* Só as datas da coluna estreita de experiência ficam sem quebra;
   .calc-date também carrega frases, então precisa poder quebrar. */
.employee-table .exp-period strong {
    white-space: nowrap;
}

.employee-table .exp-box .badge,
.employee-table .calc-box .badge {
    white-space: normal;
    text-align: left;
}

thead {
    background-color: var(--bg-subtle);
    border-bottom: 1px solid var(--border);
}

th {
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

/* Cabeçalhos da tabela principal podem quebrar em 2 linhas em vez de esticar a tabela */
.employee-table th {
    white-space: normal;
    font-size: 0.66rem;
    line-height: 1.25;
}

tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background-color 0.15s;
}

tbody tr:hover {
    background-color: var(--bg-subtle);
}

td {
    padding: 1rem;
    vertical-align: middle;
}

/* Coluna de Ações sempre acessível, mesmo se houver rolagem em telas estreitas */
.employee-table th:last-child,
.employee-table td:last-child {
    position: sticky;
    right: 0;
    background: var(--bg-card);
    box-shadow: -6px 0 6px -6px rgba(28, 28, 28, 0.18);
    z-index: 2;
}

.employee-table thead th:last-child {
    background: var(--bg-subtle);
}

.employee-table tbody tr:hover td:last-child {
    background: var(--bg-subtle);
}

/* ── Célula do colaborador (avatar + nome + meta) ──────────── */
.emp-cell {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    min-width: 0;
}

.emp-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--track);
    color: var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.78rem;
    flex-shrink: 0;
}

.emp-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* .emp-nome é o nome usado pelo porte em equipe.js; .emp-name é o do original */
.emp-name, .emp-nome {
    font-weight: 600;
    color: var(--text-main);
}

.emp-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ════════════════════════════════════════════════════════════
   BADGES & TAGS
   ════════════════════════════════════════════════════════════ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-full);
    font-size: 0.73rem;
    font-weight: 500;
    line-height: 1.35;
    white-space: nowrap;
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex: none;
}

.badge-success {
    background-color: var(--success-light);
    color: var(--ok-ink);
}
.badge-success .badge-dot { background-color: var(--ok-ink); }

.badge-warning {
    background-color: var(--warning-light);
    color: var(--warn-ink);
}
.badge-warning .badge-dot { background-color: var(--warn-ink); }

.badge-danger {
    background-color: var(--danger-light);
    color: var(--danger-ink);
}
.badge-danger .badge-dot { background-color: var(--danger-ink); }

.badge-info {
    background-color: var(--info-light);
    color: var(--info-ink);
}
.badge-info .badge-dot { background-color: var(--info-ink); }

.badge-purple {
    background-color: var(--purple-light);
    color: var(--purple-ink);
}
.badge-purple .badge-dot { background-color: var(--purple-ink); }

.badge-neutral {
    background-color: #efefee;
    color: var(--secondary);
}
.badge-neutral .badge-dot { background-color: var(--text-muted); }

/* Badge da marca (destaque em vermelho suave) */
.badge-primary {
    background-color: var(--primary-light);
    color: var(--primary);
}
.badge-primary .badge-dot { background-color: var(--primary); }

/* ── Caixa de cálculo dentro da linha ──────────────────────── */
.calc-box {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.calc-date {
    font-weight: 600;
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
}

.calc-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* ── Caixa de experiência ──────────────────────────────────── */
.exp-box {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.exp-period {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    font-size: 0.7rem;
    padding: 0.15rem 0.35rem;
    background: var(--bg-subtle);
    border-radius: 4px;
    border: 1px solid var(--border-subtle);
}

.exp-period > span {
    color: var(--text-muted);
}

/* ── Botões de ação da linha ───────────────────────────────── */
.action-cell {
    display: flex;
    gap: 0.3rem;
    align-items: center;
    /* Botões só de ícone: cabem na coluna e ainda quebram linha se faltar espaço */
    flex-wrap: wrap;
    justify-content: flex-end;
}

.action-cell .btn {
    padding: 0.4rem;
    border-radius: var(--radius-xs);
    flex: 0 0 auto;
}

.action-cell .btn svg {
    width: 15px;
    height: 15px;
}

/* ── Estado vazio ──────────────────────────────────────────── */
.empty-state {
    padding: 4rem 2rem;
    text-align: center;
    color: var(--text-muted);
}

.empty-state svg {
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3, .empty-state h4 {
    color: var(--text-main);
    font-size: 1rem;
    margin-bottom: 0.35rem;
}

/* Spinner de carregamento (linhas de tabela e botões) */
.spinner {
    display: inline-block;
    width: 17px; height: 17px;
    border: 2px solid var(--border-strong);
    border-top-color: var(--primary);
    border-radius: 50%;
    vertical-align: -4px;
    margin-right: 9px;
    animation: gira 0.7s linear infinite;
}
@keyframes gira { to { transform: rotate(360deg); } }

/* ════════════════════════════════════════════════════════════
   MODAIS DO SISTEMA (cadastro, férias, timeline, relatório…)
   .modal-backdrop + .modal-window — z-index 100
   ════════════════════════════════════════════════════════════ */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(28, 28, 28, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
}

.modal-backdrop.open {
    opacity: 1;
    visibility: visible;
}

.modal-window {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 650px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95);
    transition: transform 0.2s ease-in-out;
    overflow: hidden;
}

.modal-window form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0; /* Essencial para flex child respeitar scroll interno */
    overflow: hidden;
}

.modal-backdrop.open .modal-window {
    transform: scale(1);
}

.modal-window.modal-lg {
    max-width: 900px;
}

.modal-window.modal-xl {
    max-width: 1100px;
    width: 95%;
}

.modal-header {
    padding: 1.1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    background: var(--bg-card);
    flex-shrink: 0;
}

.modal-header h3 {
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.4rem;
    line-height: 1;
    padding: 4px;
    border-radius: var(--radius-xs);
    transition: background-color 0.15s, color 0.15s;
}

.modal-close:hover {
    color: var(--text-main);
    background: var(--bg-subtle);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-subtle);
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* ════════════════════════════════════════════════════════════
   RELATÓRIO DA DIRETORIA (papel do PDF)
   ════════════════════════════════════════════════════════════ */
.board-paper {
    background: var(--bg-card);
    color: var(--text-main);
    padding: 2.5rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    font-size: 0.88rem;
    line-height: 1.5;
    font-family: var(--font-sans);
}

.board-header-banner {
    border-bottom: 2px solid var(--text-main);
    padding-bottom: 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
}

.board-title h2 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.board-meta-badge {
    display: inline-block;
    background: var(--warn-surface);
    border: 1px solid #f59e0b;
    color: var(--warn-ink);
    font-weight: 700;
    font-size: 0.72rem;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.board-section {
    margin-bottom: 1.75rem;
}

.board-section-title {
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--text-main);
    border-left: 4px solid var(--primary);
    padding-left: 8px;
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.board-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    margin-bottom: 1rem;
    table-layout: fixed;
}

.board-table th,
.board-table td {
    word-break: break-word;
    overflow-wrap: anywhere;
}

.board-table th {
    background-color: #efefee;
    color: var(--text-main);
    font-weight: 700;
    border: 1px solid var(--border-strong);
    padding: 6px 8px;
    text-align: left;
    text-transform: uppercase;
    font-size: 0.7rem;
    white-space: normal;
}

.board-table td {
    border: 1px solid var(--border-strong);
    padding: 6px 8px;
    vertical-align: middle;
}

.board-table tbody tr:hover { background: transparent; }

.board-signatures {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px dashed var(--border-strong);
    page-break-inside: avoid;
}

.signature-line {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.signature-border {
    width: 85%;
    border-top: 1px solid var(--text-main);
    margin-bottom: 6px;
}

.signature-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-main);
}

.signature-role {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ════════════════════════════════════════════════════════════
   FORMULÁRIOS
   ════════════════════════════════════════════════════════════ */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.form-full {
    grid-column: 1 / -1;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-width: 0;
}

/* Rótulos em caixa normal: mais legíveis e menos "gritados" que UPPERCASE */
.form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--secondary);
}

.form-label .req {
    color: var(--danger);
}

.form-input, .form-select, .form-textarea {
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-xs);
    background: var(--bg-card);
    color: var(--text-main);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    width: 100%;
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-muted); }
.form-textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
.form-select { cursor: pointer; }

.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--primary);
    box-shadow: var(--ring);
}

.form-input:disabled, .form-select:disabled, .form-textarea:disabled {
    background: var(--bg-subtle);
    color: var(--text-muted);
    cursor: not-allowed;
}

.form-input[readonly] {
    background: var(--bg-subtle);
}

/* Campos nativos que carregam cor da marca */
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); }

/* Texto de ajuda sob um campo */
.form-hint {
    font-size: 0.74rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Blocos de "prévia de cálculo": borda sólida em vez de tracejada */
.calc-preview-card {
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    font-size: 0.85rem;
}

.calc-preview-card h4 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.calc-preview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.preview-item {
    background: var(--bg-card);
    padding: 0.6rem;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
    min-width: 0;
}

.preview-item .label {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.preview-item .val {
    font-weight: 600;
    color: var(--text-main);
    font-variant-numeric: tabular-nums;
    margin-top: 2px;
}

/* ════════════════════════════════════════════════════════════
   CONTROLE DE JORNADA / BANCO DE HORAS (.ts-*)
   ════════════════════════════════════════════════════════════ */
.ts-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    padding: 1rem 1.25rem;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.ts-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
    gap: 0.75rem;
}

.ts-metric {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left-width: 4px;
    border-radius: var(--radius-sm);
    padding: 0.7rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.ts-metric .lbl {
    font-size: 0.66rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
}

.ts-metric .val {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.ts-metric .sub {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.ts-metric.is-banco  { border-left-color: var(--primary); }
.ts-metric.is-extra  { border-left-color: var(--success); }
.ts-metric.is-folha  { border-left-color: var(--danger); }
.ts-metric.is-falta  { border-left-color: var(--warning); }
.ts-metric.is-neutro { border-left-color: var(--secondary); }

.ts-entry-form {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
}

.ts-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr));
    gap: 0.85rem;
    align-items: end;
}

.ts-preview {
    margin-top: 0.9rem;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 0.9rem;
    font-size: 0.8rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    align-items: center;
}

.ts-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 500;
    white-space: nowrap;
}

.ts-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
    table-layout: fixed;
}

.ts-table th {
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 0.5rem;
    font-size: 0.66rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    text-align: left;
    white-space: normal;
}

.ts-table td {
    border-bottom: 1px solid var(--border);
    padding: 0.5rem;
    vertical-align: middle;
    overflow-wrap: break-word;
}

.ts-table tbody tr:hover { background: var(--bg-subtle); }

/* Inputs de hora dentro da tabela de ponto */
.ts-table input[type="time"],
.ts-table input[type="text"],
.ts-table input[type="number"],
.ts-table select {
    width: 100%;
    padding: 0.3rem 0.4rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-xs);
    background: var(--bg-card);
    color: var(--text-main);
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
}
.ts-table input:focus, .ts-table select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--ring);
}

.ts-scroll {
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.ts-legend {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ════════════════════════════════════════════════════════════
   TIMELINE (modal de histórico)
   ════════════════════════════════════════════════════════════ */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: var(--border-strong);
}

.timeline-step {
    position: relative;
    margin-bottom: 1.5rem;
}

.timeline-step:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -2rem;
    top: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 3px solid var(--primary);
}

.timeline-step.completed .timeline-dot {
    background: var(--success);
    border-color: var(--success);
}

.timeline-step.active .timeline-dot {
    background: var(--warning);
    border-color: var(--warning);
    box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.2);
}

.timeline-content {
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
}

.timeline-content h4 {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main);
}

.timeline-content p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ════════════════════════════════════════════════════════════
   TOASTS (classes do original; canto inferior direito; z 200)
   Fundo grafite TsTeck; a faixa esquerda carrega o tom semântico
   em versão clara, para continuar legível sobre o escuro.
   ════════════════════════════════════════════════════════════ */
#toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 200;
    max-width: min(380px, calc(100vw - 3rem));
    pointer-events: none;
}

.toast {
    background: var(--bg-header);
    color: #ffffff;
    padding: 0.8rem 1.15rem;
    border-radius: var(--radius-sm);
    border-left: 3px solid #ffffff;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    line-height: 1.4;
    animation: slideIn 0.3s ease-out;
    max-width: 380px;
    pointer-events: auto;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast-success { border-left-color: #4ade80; }
.toast-warning { border-left-color: #fbbf24; }
.toast-danger  { border-left-color: #f87171; }
.toast-info    { border-left-color: #93c5fd; }

/* Saída: o JS adiciona .toast-out e remove o nó 300ms depois */
.toast-out {
    opacity: 0;
    transform: translateX(24px);
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

/* ════════════════════════════════════════════════════════════
   MODAL DE CONFIRMAÇÃO (substitui window.confirm)
   .overlay 100 · .overlay-modal 120 · #modal.modal 130
   ════════════════════════════════════════════════════════════ */
.overlay {
    position: fixed; inset: 0; z-index: 100;
    background: var(--overlay);
    animation: fade-entra 0.2s ease both;
}
.overlay-modal { z-index: 120; }
@keyframes fade-entra { from { opacity: 0; } to { opacity: 1; } }

.modal {
    position: fixed; z-index: 130;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: min(420px, 92vw);
    background: var(--raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 22px;
    animation: modal-entra 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes modal-entra {
    from { opacity: 0; transform: translate(-50%, -46%) scale(0.97); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.modal h3 { margin-bottom: 8px; font-size: 1.05rem; }
.modal p { color: var(--text-2); line-height: 1.55; font-size: 0.9rem; white-space: pre-line; }
.modal-botoes { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ════════════════════════════════════════════════════════════
   MÓDULO: CONTROLE DE HORAS (página inteira)
   ════════════════════════════════════════════════════════════ */

/* Barra de contexto: competência e setor valem para toda a página */
.hours-context {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    align-items: flex-end;
}

.hours-context-title h2 {
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-main);
}

.hours-context-title p {
    font-size: 0.76rem;
    color: var(--text-muted);
    margin-top: 3px;
    line-height: 1.5;
}

.hours-context-title p strong {
    color: var(--text-main);
    font-weight: 600;
}

.hours-context-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
}

.hours-context-fields .form-group {
    min-width: 150px;
}

/* Sub-abas por rotina de DP — subordinadas às abas da topbar:
   sem pílula de fundo, só o sublinhado sobre a régua contínua. */
.subtabs {
    display: flex;
    gap: 0.35rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.25rem;
    overflow-x: auto;
    scrollbar-width: thin;
}

.subtab {
    appearance: none;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    padding: 0.65rem 0.85rem;
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: color 0.15s, border-color 0.15s;
}

.subtab:hover { color: var(--text-main); }

.subtab.is-active {
    color: var(--primary);
    font-weight: 600;
    border-bottom-color: var(--primary);
}

.subtab .count {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 1px 7px;
    font-variant-numeric: tabular-nums;
}

.subtab.is-active .count {
    color: var(--primary);
    background: var(--primary-light);
    border-color: transparent;
}

.hours-panel[hidden] { display: none; }

.hours-panel {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Bloco padrão de conteúdo dentro da página de horas */
.hours-block {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.hours-block-header {
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.hours-block-header h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

.hours-block-header p {
    font-size: 0.73rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.hours-block-body {
    padding: 1.25rem;
}

.hours-block-body.is-flush { padding: 0; }

/* Tabela do quadro: um colaborador por linha, saldo em destaque */
.roster-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    table-layout: fixed;
}

.roster-table th {
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border);
    padding: 0.6rem 0.75rem;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    text-align: left;
    white-space: nowrap;
}

/* Cabeçalho clicável de ordenação */
.roster-table th.sortable {
    cursor: pointer;
    user-select: none;
}
.roster-table th.sortable:hover { color: var(--text-main); }
.roster-table th .sort-arrow {
    font-size: 0.6rem;
    color: var(--primary);
    margin-left: 2px;
}

.roster-table td {
    border-bottom: 1px solid var(--border);
    padding: 0.6rem 0.75rem;
    vertical-align: middle;
    overflow-wrap: break-word;
}

.roster-table tbody tr:hover { background: var(--bg-subtle); }
.roster-table tbody tr:last-child td { border-bottom: none; }

.roster-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.roster-name {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}

.roster-name .nm {
    font-weight: 600;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.roster-name .meta {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Bloco de extrato do banco de horas: anterior + semana = atual.
   O fundo agrupa as três colunas para que sejam lidas como uma conta só. */
.roster-table th.is-extrato,
.roster-table td.is-extrato {
    background: var(--bg-subtle);
}

.roster-table tbody tr:hover td.is-extrato {
    background: var(--bg-subtle);
}

/* A coluna de resultado fecha o bloco e ganha peso */
.roster-table th.is-total,
.roster-table td.is-total {
    border-right: 1px solid var(--border);
}

.roster-table td.is-total {
    font-weight: 600;
}

.roster-table th.is-extrato:first-of-type {
    border-left: 1px solid var(--border);
}

/* Linha clicável (abre ficha / seleciona) */
.roster-table tr.linha-clicavel,
.linha-clicavel { cursor: pointer; }
.roster-table tr.linha-clicavel:hover { background: var(--primary-soft); }

/* Semáforo do saldo: positivo, devedor, neutro */
.val-pos { color: var(--success); font-weight: 600; }
.val-neg { color: var(--danger); font-weight: 600; }
.val-zero { color: var(--text-muted); }

/* Barra de ações no rodapé da página (exportações e relatórios) */
.hours-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
    justify-content: flex-end;
    padding: 0.9rem 1.25rem;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.hours-actions .hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-right: auto;
}

/* Painel de gráficos dentro do módulo de horas */
.hours-charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: 1.25rem;
}

.hours-chart { min-width: 0; }

.hours-chart h4 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
}

.hours-chart .sub {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

/* Cartões auxiliares (saldo inicial, lançamento rápido, fecho automático) */
.hours-callout {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
}

.hours-callout h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
}

.hours-callout p {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.hours-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
    gap: 1.25rem;
}

/* ════════════════════════════════════════════════════════════
   PAINEL DE BI — blocos narrativos para apresentação de resultados
   ════════════════════════════════════════════════════════════ */
.bi-block {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.bi-block-head {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

/* Numeração do bloco: dá ordem de leitura na apresentação */
.bi-step {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--bg-header);
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bi-block-head h3 {
    font-size: 0.98rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-main);
}

.bi-block-head p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Faixa de indicadores do bloco */
.bi-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr));
    gap: 1px;
    background: var(--border);
    border-bottom: 1px solid var(--border);
}

.bi-kpi {
    background: var(--bg-card);
    padding: 0.95rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.bi-kpi .lbl {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
}

.bi-kpi .val {
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
    color: var(--text-main);
}

.bi-kpi .sub {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Variação contra a competência anterior */
.bi-delta {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.72rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.bi-delta.bom    { color: var(--success); }
.bi-delta.ruim   { color: var(--danger); }
.bi-delta.neutro { color: var(--text-muted); font-weight: 500; }

/* Cartão de indicador do painel: menor que o .bi-kpi, com faixa de cor
   à esquerda marcando a leitura (verde/âmbar/vermelho). */
.bi-ind {
    background: var(--bg-card);
    padding: 0.8rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    border-left: 3px solid transparent;
    min-width: 0;
}

.bi-ind .lbl {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    line-height: 1.3;
}

.bi-ind .val {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    color: var(--text-main);
}

.bi-ind .sub {
    font-size: 0.66rem;
    color: var(--text-muted);
    line-height: 1.35;
}

/* Faixa de abertura: só as taxas que sustentam a decisão, em cartão grande.
   O resto dos números vive na tabela de apoio logo abaixo. */
.bi-hero {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr));
    gap: 1px;
    background: var(--border);
    border-bottom: 1px solid var(--border);
}

.bi-hero .bi-ind {
    padding: 1.25rem 1.4rem;
    gap: 0.25rem;
    border-left-width: 4px;
}

.bi-hero .bi-ind .lbl { font-size: 0.68rem; }
.bi-hero .bi-ind .val { font-size: 2rem; line-height: 1.1; }
.bi-hero .bi-ind .sub { font-size: 0.7rem; }

/* Indicadores complementares: recolhidos por padrão, um clique de distância */
.bi-more {
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
}

.bi-more > summary {
    cursor: pointer;
    list-style: none;
    padding: 0.6rem 1.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.bi-more > summary::-webkit-details-marker { display: none; }

.bi-more > summary::before {
    content: '▸';
    font-size: 0.8rem;
    line-height: 1;
    transition: transform 0.15s ease;
}

.bi-more[open] > summary::before { transform: rotate(90deg); }
.bi-more > summary:hover { color: var(--text-main); }

.bi-mini {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
    gap: 0 2rem;
    padding: 0.25rem 1.25rem 1rem;
}

.bi-mini-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.42rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.74rem;
}

.bi-mini-row .k { color: var(--text-muted); }
.bi-mini-row .k small {
    display: block;
    font-size: 0.66rem;
    opacity: 0.75;
}

.bi-mini-row .v {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: var(--text-main);
}

.bi-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
    gap: 1.5rem;
    padding: 1.25rem;
}

.bi-chart { min-width: 0; }

.bi-chart h4 {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-main);
}

.bi-chart .sub {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

/* Leitura do bloco: a frase que o apresentador fala em voz alta */
.bi-reading {
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--secondary);
    background: var(--bg-subtle);
    border-top: 1px solid var(--border);
    padding: 0.9rem 1.25rem;
}

.bi-reading strong { color: var(--text-main); }

.bi-reading .tag {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-right: 6px;
}

/* ════════════════════════════════════════════════════════════
   UTILITÁRIOS / ESTADOS GENÉRICOS
   ════════════════════════════════════════════════════════════ */
.texto-suave, .txt-fraco { color: var(--text-3); }
.linha-loading td {
    text-align: center;
    padding: 34px;
    color: var(--text-3);
}
.estado-vazio {
    text-align: center;
    padding: 54px 20px;
    color: var(--text-2);
}
.vazio-icone { font-size: 2rem; color: var(--text-3); margin-bottom: 10px; }
.vazio-sub { font-size: 0.84rem; color: var(--text-3); margin-top: 4px; }

/* Barra de progresso simples (trilho neutro, preenchimento da marca) */
.progress-track {
    height: 6px;
    border-radius: 3px;
    background: var(--track);
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    border-radius: 3px;
    background: var(--primary);
    transition: width 0.3s ease;
}

/* Aviso em painel (não bloqueia a ação) */
.aviso {
    display: block;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    line-height: 1.5;
    background: var(--warn-surface);
    color: var(--warn-ink);
    border: 1px solid var(--warn-border);
}
.aviso-info { background: var(--info-surface); color: var(--info-ink); border-color: var(--info-border); }
.aviso-erro { background: var(--danger-surface); color: var(--danger-ink); border-color: var(--danger-border); }
.aviso-ok { background: var(--ok-surface); color: var(--ok-ink); border-color: var(--ok-border); }
.aviso strong { font-weight: 700; }
.aviso ul { margin: 4px 0 0 16px; }

/* Checkbox em linha (filtros "só X") */
.check-linha {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 0.86rem;
    color: var(--text-2);
    cursor: pointer;
}
.check-linha input { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }

/* Código / número em mono (matrícula, competência) */
.codigo-mono {
    font-family: var(--font-mono);
    font-size: 0.84rem;
    font-weight: 600;
    background: var(--primary-soft);
    color: var(--primary);
    border-radius: var(--radius-xs);
    padding: 2px 7px;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

/* Barra de rolagem fina e neutra nas áreas roláveis internas */
.table-responsive, .ts-scroll, .modal-body, .subtabs, .tabs {
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
}

/* ════════════════════════════════════════════════════════════
   RESPONSIVO
   ════════════════════════════════════════════════════════════ */
@media (max-width: 960px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    /* A topbar quebra em duas linhas; as abas viram uma fileira rolável */
    .topbar { flex-wrap: wrap; height: auto; padding: 10px 14px; gap: 10px; }
    .hazard-linha { position: static; }
    .tabs {
        order: 3; width: 100%; margin: 0;
        overflow-x: auto;
        scrollbar-width: thin;
        padding-bottom: 2px;
    }
    .tab.active::after { bottom: 0; }
    .topbar-acoes { margin-left: auto; }
    .brand-nome { display: none; }
    .user-nome { display: none; }
    .topbar-equipe > span { display: none; }
    .topbar-equipe select { max-width: 140px; }

    .conteudo { padding: 18px 12px 50px; }
    .screen-head { flex-direction: column; align-items: stretch; }
    .screen-acoes { justify-content: flex-start; }

    .control-bar { flex-direction: column; align-items: stretch; }
    .search-group { max-width: none; min-width: 0; }
    .analytics-header { flex-direction: column; align-items: stretch; }

    .modal-backdrop { padding: 0.75rem; }
    .modal-window { max-height: 94vh; }
    .modal-body { padding: 1.1rem; }
    .modal-header, .modal-footer { padding: 0.9rem 1.1rem; }

    .board-paper { padding: 1.25rem; }
}

@media (max-width: 768px) {
    .board-signatures {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 720px) {
    .hours-context { flex-direction: column; align-items: stretch; }
    .hours-context-fields .form-group { flex: 1; min-width: 130px; }
    .hours-actions { justify-content: stretch; }
    .hours-actions .hint { width: 100%; margin-right: 0; }
}

@media (max-width: 620px) {
    .form-grid { grid-template-columns: 1fr; }
    .calc-preview-grid { grid-template-columns: 1fr 1fr; }
    .kpi-grid { grid-template-columns: 1fr 1fr; }
    .screen-acoes .btn { flex: 1 1 auto; }
    .modal-footer .btn { flex: 1 1 auto; }
    .login-card { padding: 0 22px 24px; }
    .hazard-strip { margin: 0 -22px 24px; }
    #toast-container { left: 1rem; right: 1rem; bottom: 1rem; max-width: none; }
    .toast { max-width: none; }
}

@media (max-width: 420px) {
    .kpi-grid { grid-template-columns: 1fr; }
    .calc-preview-grid { grid-template-columns: 1fr; }
}

/* Movimento reduzido: respeita a preferência do sistema */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ════════════════════════════════════════════════════════════
   IMPRESSÃO — auditoria de RH e relatório da diretoria
   O papel é sempre claro (não existe tema escuro, mas o fundo do
   body é cinza e precisa virar branco na folha).
   ════════════════════════════════════════════════════════════ */
@media print {
    @page {
        size: A4 portrait;
        margin: 10mm;
    }
    :root {
        --bg-body: #ffffff;
        --bg-card: #ffffff;
        --bg-subtle: #fafafa;
    }
    html, body {
        background: var(--bg-card) !important;
        color: var(--text-main) !important;
        padding: 0 !important;
        font-size: 8.5pt !important;
        /* Nunca recortar conteúdo na impressão */
        overflow: visible !important;
        max-width: none !important;
        width: auto !important;
    }
    /* Casca e controles não vão para o papel */
    #boot, .topbar, .hazard-linha, .screen-head, .screen-acoes,
    .control-bar, .action-cell, .kpi-grid, #toast-container,
    #analyticsSection, .modal-header, .modal-footer, .subtabs, .hours-context,
    .hours-actions, #modal, #modal-overlay,
    #modalEmployee, #modalTakeVacation, #modalTimeline, #modalImportSaldos,
    #modalProbationDecision, #modalAbsenteeism {
        display: none !important;
    }
    /* Todas as telas entram no fluxo (a ativa) sem animação */
    .screen.active { animation: none !important; }
    /* O scroll horizontal da tabela recorta colunas no papel — libera o fluxo */
    .table-responsive, .ts-scroll {
        overflow: visible !important;
        width: 100% !important;
        max-height: none !important;
    }
    /* Coluna sticky de ações não faz sentido no papel */
    .employee-table th:last-child,
    .employee-table td:last-child {
        position: static !important;
        box-shadow: none !important;
    }
    /* Se o modal do relatório da diretoria estiver aberto, imprimir APENAS o documento oficial */
    body:has(#modalBoardReport.open) > *:not(#modalBoardReport) {
        display: none !important;
    }
    body:has(#modalBoardReport.open) #modalBoardReport {
        position: static !important;
        background: transparent !important;
        padding: 0 !important;
        visibility: visible !important;
        opacity: 1 !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
    body:has(#modalBoardReport.open) #modalBoardReport .modal-window {
        position: static !important;
        max-width: 100% !important;
        max-height: none !important;
        box-shadow: none !important;
        border: none !important;
        transform: none !important;
        overflow: visible !important;
        background: var(--bg-card) !important;
    }
    body:has(#modalBoardReport.open) #modalBoardReport .modal-body {
        padding: 0 !important;
        overflow: visible !important;
        max-height: none !important;
        background: var(--bg-card) !important;
    }
    body:has(#modalBoardReport.open) .board-paper {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        width: 100% !important;
    }
    .board-section, .board-signatures, .board-table tr, .charts-preview-row {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }
    .conteudo, .container {
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    .table-card, .hours-block, .analytics-card, .bi-block {
        border: none !important;
        box-shadow: none !important;
    }
    table {
        font-size: 7.5pt !important;
        width: 100% !important;
        table-layout: fixed !important;
        border-collapse: collapse !important;
    }
    th, td {
        padding: 4px 5px !important;
        border: 1px solid var(--border-strong) !important;
        /* Quebra textos longos em vez de estourar a largura do papel */
        white-space: normal !important;
        word-break: break-word !important;
        overflow-wrap: anywhere !important;
    }
    .board-table {
        table-layout: fixed !important;
    }
    tr, .board-section, .exp-box, .calc-box, .emp-cell {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }
}

/* ════════════════════════════════════════════════════════════
   REVISÃO VISUAL (15/09/2026) — ajustes após as capturas em
   1366 / 1024 / 500 px. Ficam no fim para vencer as regras acima.
   ════════════════════════════════════════════════════════════ */

/* Topbar: entre 861 e 1180 px o nome da marca disputava espaço com as abas */
@media (max-width: 1180px) {
    .brand-nome { display: none; }
    .topbar { gap: 16px; }
}

/* Tabelas largas ROLAM dentro do próprio contêiner em vez de espremer
   as colunas (setor quebrando letra a letra, ações cortadas). A página
   nunca rola na horizontal: o overflow fica no .table-responsive. */
.table-responsive { overflow-x: auto; }
.roster-table    { min-width: 1000px; }
.ts-table        { min-width: 820px; }
.employee-table  { min-width: 900px; }
#equipeTabela    { min-width: 900px; }
.hours-block-body.is-flush .table-responsive { border-radius: 0; }

/* Célula de ações do quadro: o badge "Afastado · nada a lançar" quebra
   linha em vez de ser cortado pela borda da tabela */
.roster-table td:last-child { white-space: normal; min-width: 160px; }
.roster-table td:last-child .badge { white-space: normal; line-height: 1.3; }

/* Sub-abas do módulo Horas roláveis em telas estreitas */
.subtabs { overflow-x: auto; scrollbar-width: thin; }
.subtab  { white-space: nowrap; flex-shrink: 0; }

/* Contexto do módulo Horas: em telas estreitas os campos empilham */
@media (max-width: 620px) {
    .hours-context-fields { flex-wrap: wrap; }
    .hours-context-fields .form-group { min-width: 100%; }
    .screen-head { flex-direction: column; align-items: stretch; }
    .screen-acoes { justify-content: flex-start; }
}
