/* =============================================================================
   Redesign '26 — layout do Controle Interno (task) aplicado ao Operating Office.
   Regra desta etapa: SÓ layout/tipografia/componentes. As cores do OO (azul/slate)
   continuam as de style.css — nenhuma cor da marca '26 (rosa) entra aqui.
   Carregado depois de style.css; os tokens --ctl-* / --stat-* / --tbl-* têm os
   mesmos nomes e valores do CI (app/globals.css) para ficar fácil de sincronizar.
   ============================================================================= */

/* Superfícies opacas (colunas/cabeçalhos "grudados" das tabelas): mesmo tom do card, sem transparência */
:root {
    --surface-solid: #1a2436;
    --surface-head: #222c3e;
}
.light-theme {
    --surface-solid: #fbfcfe;
    --surface-head: #eff2f6;
}
/* Barras de rolagem e controles nativos acompanham o tema (antes ficavam brancas no escuro) */
body.dark-theme { color-scheme: dark; }
body.light-theme { color-scheme: light; }

/* Paleta de gráficos e faróis (mesmos valores de paleta.js; documentação em docs/PALETA.md) */
:root {
    --cat-1: #E8395D; --cat-2: #535173; --cat-3: #6FA89E; --cat-4: #C9A227; --cat-5: #B8D4D0;
    --cat-6: #E8D5A0; --cat-7: #F4A6B8; --cat-8: #A8A6B3; --cat-9: #87859D; --cat-10: #C7C4B4;
    --farol-ok: #5FAE7D; --farol-warn: #C99257; --farol-bad: #C24B43;
}

:root {
    --font-ui: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-display: "Fraunces", ui-serif, Georgia, serif;

    /* Raios (2bDS) */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    /* Controles do topo / botões (--ctl-*) */
    --ctl-h: 30px;
    --ctl-fs: 10.5px;
    --ctl-fw: 600;
    --ctl-ls: 0.05em;
    --ctl-px: 14px;
    --ctl-gap: 8px;
    --ctl-icon: 14px;
    --ctl-radius: 9999px;
    --ctl-seg-pad: 2px;
    --ctl-text-nudge: 2px;

    /* Cards de indicador (--stat-*) */
    --stat-pad: 16px;
    --stat-radius: var(--radius-xl);
    --stat-label-fs: 11px;
    --stat-label-fw: 600;
    --stat-label-ls: 0.06em;
    --stat-value-fs: 24px;
    --stat-value-fw: 600;
    --stat-sub-fs: 11px;

    /* Tabelas (--tbl-*) */
    --tbl-radius: var(--radius-xl);
    --tbl-fs: 12px;
    --tbl-head-fw: 600;
    --tbl-pad-y: 10px;
    --tbl-pad-x: 14px;

    --section-title-fs: 18px;
    --section-title-fw: 600;
    --section-title-ls: 0.05em;

    --sidebar-width: 186px;
    --sidebar-width-collapsed: 60px;

    --tbl-head-bg: rgba(255, 255, 255, 0.04);
    --surface-tint: rgba(56, 189, 248, 0.12);
}

.light-theme {
    --tbl-head-bg: rgba(15, 23, 42, 0.04);
    --surface-tint: rgba(56, 189, 248, 0.14);
}

/* ---------- Tipografia ---------- */
* { font-family: var(--font-ui); }
body { font-size: 14px; line-height: 1.5; }
h1, h2, h3, h4 { font-family: var(--font-ui); letter-spacing: 0.05em; }
.font-display { font-family: var(--font-display); font-weight: 300; letter-spacing: 0; }

.section-title {
    font-size: var(--section-title-fs);
    font-weight: var(--section-title-fw);
    letter-spacing: var(--section-title-ls);
    text-transform: uppercase;
    line-height: 1;
}

/* Sem animações de "levitar": layout sóbrio */
.glass-card:hover, .config-section:hover { box-shadow: none; }

/* ---------- Layout / menu lateral ---------- */
.sidebar {
    width: var(--sidebar-width);
    flex: none;
    padding: 16px 12px 12px;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width 0.2s ease, padding 0.2s ease;
}
.app-container.sidebar-collapsed .sidebar { width: var(--sidebar-width-collapsed); padding: 16px 8px 12px; }

.sidebar-header { padding: 0; margin-bottom: 4px; display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.app-container.sidebar-collapsed .sidebar-header { flex-direction: column; gap: 8px; }
.sidebar-header .logo { flex: 1; min-width: 0; justify-content: center; }
.app-container.sidebar-collapsed .sidebar-header .logo .logo-sub { display: none; }
.app-container.sidebar-collapsed .sidebar-header .logo .logo-2b { font-size: 1.15rem !important; }

.sidebar-toggle {
    flex: none; width: 20px; height: 20px; padding: 0;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border-color); border-radius: var(--radius-md);
    background: transparent; color: var(--text-secondary); cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}
.sidebar-toggle:hover { border-color: var(--accent); color: var(--accent); }
.sidebar-toggle svg { width: 12px; height: 12px; transition: transform 0.2s; }
.app-container.sidebar-collapsed .sidebar-toggle svg { transform: rotate(180deg); }

.sidebar-nav { flex: none; padding: 0; margin-top: 12px; gap: 1px; }
.app-container.sidebar-collapsed .sidebar-nav { margin-top: 8px; }

.nav-item {
    position: relative;
    gap: 8px;
    padding: 6px 8px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    transition: background-color 0.15s, color 0.15s;
}
.nav-item:hover { background: var(--surface-tint); color: var(--text-primary); transform: none; }
.nav-item.active { background: var(--surface-tint); color: var(--accent); box-shadow: none; }
.nav-item svg { width: 18px; height: 18px; flex: none; color: var(--text-secondary); }
.nav-item.active svg { color: var(--accent); }
.nav-item .nav-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-container.sidebar-collapsed .nav-item { justify-content: center; padding: 6px 0; }
.app-container.sidebar-collapsed .nav-item .nav-label { display: none; }

/* Alerta visual no menu (ex.: Colaboradores com cadastro a completar) */
.nav-alert {
    margin-left: auto; flex: none;
    min-width: 16px; height: 16px; padding: 2px 4px 0;
    display: none; align-items: center; justify-content: center;
    border-radius: var(--ctl-radius);
    background: var(--farol-warn); color: #1f2937;
    font-size: 10px; font-weight: 700; line-height: 1;
}
.nav-item.has-alert .nav-alert { display: inline-flex; }
.app-container.sidebar-collapsed .nav-alert {
    position: absolute; top: 1px; right: 4px; margin: 0;
    min-width: 8px; width: 8px; height: 8px; padding: 0; font-size: 0;
}

.sidebar-spacer { flex: 1 1 auto; min-height: 8px; }

.sidebar-footer { padding: 10px 0 0; margin-top: 0; border-top: 1px solid var(--border-color); }
.user-profile { gap: 8px; }
.avatar {
    width: 24px; height: 24px; flex: none; border-radius: var(--ctl-radius);
    background: var(--surface-tint); color: var(--accent);
    font-size: 12px; font-weight: 700;
}
.user-info { min-width: 0; flex: 1; }
.user-name { font-size: 12.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-tools { display: flex; align-items: center; justify-content: center; gap: var(--ctl-gap); margin-top: 8px; }
.app-container.sidebar-collapsed .sidebar-tools { flex-direction: column; }
.app-container.sidebar-collapsed .user-profile { flex-direction: column; }
.app-container.sidebar-collapsed .user-info { display: none; }
.sidebar-brand { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-color); text-align: center; }
.app-container.sidebar-collapsed .sidebar-brand { display: none; }

.nav-tip {
    position: fixed; z-index: 60; transform: translateY(-50%); pointer-events: none; white-space: nowrap;
    padding: 4px 8px; border-radius: var(--radius-md);
    background: var(--text-primary); color: var(--bg-dark);
    font-size: 11px; font-weight: 600; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

/* ---------- Área principal + barra do topo (breadcrumb + ações) ---------- */
.main-content { background: var(--bg-dark); overflow: hidden; }

.top-header {
    height: auto; min-height: 40px; flex: none;
    padding: 24px 44px 0;
    gap: 8px 16px; flex-wrap: wrap;
    border-bottom: 0; background: transparent; backdrop-filter: none;
    position: static;
    max-width: 1600px; width: 100%; margin: 0 auto;
}
.breadcrumb { min-width: 0; max-width: 100%; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; }
.breadcrumb li { display: flex; align-items: center; gap: 8px; min-width: 0; }
.breadcrumb li svg { width: 18px; height: 18px; flex: none; color: var(--accent); }
.breadcrumb li .crumb-label { font-weight: 600; color: var(--text-primary); }
.breadcrumb li.crumb-sep svg { width: 12px; height: 12px; color: var(--text-secondary); }
.breadcrumb h1 { font-size: 13px; font-weight: 600; letter-spacing: 0; }

.ctl-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--ctl-gap); min-width: 0; max-width: 100%; }
.header-actions { display: contents; }

.content-area {
    padding: 16px 44px 48px;
    max-width: 1600px; width: 100%; margin: 0 auto;
}
.view-header { margin-bottom: 16px; }

/* ---------- Controles (botões, pílulas, abas, selects) ---------- */
.btn-primary, .btn-secondary, .btn-top-primary, .btn-top-secondary, .btn-top-link,
.ctl-badge, .ctl-icon, .ctl-pill, .ctl-seg > button, .ctl-bar .icon-btn, .ctl-bar .date-display {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: var(--ctl-h);
    border-radius: var(--ctl-radius);
    font-size: var(--ctl-fs); font-weight: var(--ctl-fw); letter-spacing: var(--ctl-ls);
    text-transform: uppercase; white-space: nowrap; line-height: 1;
}
.btn-primary, .btn-secondary, .btn-top-primary, .btn-top-secondary, .btn-top-link,
.ctl-badge, .ctl-pill { padding: var(--ctl-text-nudge) var(--ctl-px) 0; }

.btn-primary, .btn-secondary {
    height: var(--ctl-h) !important;
    min-height: 0 !important;
    padding: var(--ctl-text-nudge) var(--ctl-px) 0 !important;
    border-radius: var(--ctl-radius) !important;
    font-size: var(--ctl-fs) !important; font-weight: var(--ctl-fw) !important; letter-spacing: var(--ctl-ls) !important;
    transform: none !important; box-shadow: none !important;
}
.btn-primary svg, .btn-secondary svg, .btn-top-primary svg, .btn-top-secondary svg, .btn-top-link svg,
.ctl-icon svg, .ctl-badge svg, .ctl-bar .icon-btn svg { width: var(--ctl-icon) !important; height: var(--ctl-icon) !important; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:disabled, .btn-secondary:disabled { cursor: not-allowed; opacity: 0.5; }
.btn-secondary, .btn-top-secondary {
    background: rgba(255, 255, 255, 0.05); color: var(--text-primary);
    border: 1px solid var(--border-color); cursor: pointer;
}
.light-theme .btn-secondary, .light-theme .btn-top-secondary { background: rgba(15, 23, 42, 0.04); }
.btn-secondary:hover, .btn-top-secondary:hover { border-color: var(--text-secondary); }
.btn-top-primary { background: var(--accent); color: #fff; border: 0; cursor: pointer; }
.btn-top-link { color: var(--accent); background: transparent; border: 0; text-decoration: none; padding: var(--ctl-text-nudge) 8px 0; cursor: pointer; }

/* Ícone-botão (40px antigo) → mesma altura dos controles */
.icon-btn { width: var(--ctl-h); height: var(--ctl-h); border-radius: var(--ctl-radius); }
.icon-btn svg { width: var(--ctl-icon); height: var(--ctl-icon); }
.ctl-bar .icon-btn { padding: 0; }

.ctl-icon { width: var(--ctl-h); padding: 0; border: 1px solid var(--border-color); color: var(--text-secondary); background: transparent; cursor: pointer; }
.ctl-icon:hover { border-color: var(--text-secondary); color: var(--text-primary); }
.ctl-label { font-size: var(--ctl-fs); font-weight: 500; letter-spacing: var(--ctl-ls); text-transform: uppercase; color: var(--text-secondary); }

.ctl-pill { cursor: pointer; border: 1px solid var(--border-color); background: transparent; color: var(--text-secondary); }
.ctl-pill:hover { border-color: var(--text-secondary); color: var(--text-primary); }
.ctl-pill[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }

.ctl-seg {
    display: inline-flex; align-items: center; gap: 2px; max-width: 100%;
    height: var(--ctl-h); padding: var(--ctl-seg-pad);
    border: 1px solid var(--border-color); border-radius: var(--ctl-radius);
    overflow-x: auto; scrollbar-width: none;
}
.ctl-seg::-webkit-scrollbar { display: none; }
.ctl-seg > button { flex: none; height: 100%; padding: var(--ctl-text-nudge) calc(var(--ctl-px) - 4px) 0; border: 0; background: transparent; color: var(--text-secondary); cursor: pointer; }
.ctl-seg > button:hover { color: var(--text-primary); }
.ctl-seg > button[aria-pressed="true"] { background: var(--accent); color: #fff; }

/* Selects/inputs que ficam na barra do topo (filtros): pílula de 30px */
.ctl-bar .form-control {
    height: var(--ctl-h); width: auto; min-width: 0;
    padding: var(--ctl-text-nudge) 28px 0 var(--ctl-px);
    border-radius: var(--ctl-radius);
    font-size: var(--ctl-fs); font-weight: var(--ctl-fw); letter-spacing: var(--ctl-ls);
    background-color: transparent;
}
.ctl-bar input.form-control { padding-right: var(--ctl-px); }
.ctl-bar select.form-control { background-position: right 10px center; background-size: 14px; padding-right: 30px !important; }
.ctl-bar .glass-card { padding: 0 !important; background: none; border: 0; flex-direction: row; display: inline-flex; align-items: center; gap: var(--ctl-gap) !important; min-height: 0; }
.ctl-bar .glass-card span { font-size: var(--ctl-fs) !important; letter-spacing: var(--ctl-ls); text-transform: uppercase; }
.ctl-bar .date-display { padding: var(--ctl-text-nudge) var(--ctl-px) 0; background: transparent; border: 1px solid var(--border-color); cursor: default; }
.ctl-bar > a.date-display { cursor: pointer; }
.ctl-bar .badge { text-transform: uppercase; }

/* ---------- Formulários / modais ---------- */
.form-control {
    border-radius: var(--radius-lg);
    padding: 0.625rem 0.875rem;
    font-size: 13px;
}
.form-control:focus { box-shadow: 0 0 0 3px var(--accent-glow); }
select.form-control { background-position: right 0.75rem center; background-size: 1rem; padding-right: 2.25rem; }
.form-group { margin-bottom: 1rem; }
.form-group label { font-size: 12px; font-weight: 600; letter-spacing: 0.02em; }

.modal-content { border-radius: var(--radius-xl); padding: 1.75rem; }
.modal-content h2 { font-size: 18px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 1.25rem !important; }
.modal-content .btn-primary[type="submit"] { width: 100%; }

/* ---------- Cards ---------- */
.glass-card, .config-section {
    border-radius: var(--radius-xl);
    backdrop-filter: none;
    transition: none;
}
.glass-card:hover { border-color: var(--border-color); }
.config-section:hover { border-color: var(--border-color); }
.config-section h3 { font-size: 14px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; }

/* Card de indicador: rótulo em caixa alta, valor Instrument, sem ícone decorativo */
.stat-card {
    min-height: 0;
    justify-content: flex-start;
    gap: 2px;
    padding: var(--stat-pad) !important;
    border-radius: var(--stat-radius);
    text-align: left;
}
.stat-card .stat-icon { display: none; }
.stat-card .stat-header { display: block; margin: 0; }
.stat-card .stat-label, .stat-card .label {
    font-size: var(--stat-label-fs) !important; font-weight: var(--stat-label-fw) !important;
    letter-spacing: var(--stat-label-ls) !important; text-transform: uppercase; color: var(--text-secondary);
}
.stat-card .stat-value, .stat-card .value {
    margin-top: 6px; font-size: var(--stat-value-fs) !important; font-weight: var(--stat-value-fw) !important;
    line-height: 1.25; letter-spacing: 0; font-variant-numeric: tabular-nums;
}
.stat-card .stat-sub, .stat-card small { font-size: var(--stat-sub-fs); color: var(--text-secondary); }

/* ---------- Tabelas ---------- */
table { border-collapse: separate; border-spacing: 0; }
/* Sem !important em tamanho/padding: as grades densas (alocação por mês) definem os próprios inline */
th, td { font-size: var(--tbl-fs); line-height: 1.35; padding: var(--tbl-pad-y) var(--tbl-pad-x); }
th {
    background-color: var(--tbl-head-bg);
    color: var(--text-primary);
    font-weight: var(--tbl-head-fw);
    text-transform: none; letter-spacing: 0;
}
td { border-bottom: 1px solid var(--border-color); }
tbody tr:last-child td { border-bottom: 0; }

/* Tabela dentro de card: o card faz o papel de contorno/raio (ds-flat) */
/* Sem overflow aqui: as listas definem max-height + overflow inline, e "hidden" cortava a rolagem vertical */
.data-table-container { padding: 0 !important; border-radius: var(--radius-xl); }
.data-table-container table { border: 0; }
.data-table-container thead th:first-child { border-top-left-radius: calc(var(--radius-xl) - 1px); }
.data-table-container thead th:last-child { border-top-right-radius: calc(var(--radius-xl) - 1px); }

/* Primeira linha congelada: cabeçalho fixo (opaco) em tabelas com rolagem — usado em Férias */
.sticky-head thead th { position: sticky; top: 0; z-index: 6; background-color: var(--surface-head); }

/* Extrato de Férias: espaçamento padrão de 16px, cards e divisórias */
.modal-content.large { max-height: 92vh; overflow-y: auto; }
.fer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--border-color); }
.fer-title { margin: 0 !important; font-size: 18px; }
.fer-sub { margin-top: 4px; font-size: 12px; color: var(--text-secondary); }
.fer-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.fer-card { padding: 16px !important; margin-bottom: 16px; }
.fer-card:last-child { margin-bottom: 0; }
.fer-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.fer-divider { height: 1px; background: var(--border-color); margin: 12px 0; }
.fer-hint { font-size: 11px; color: var(--text-secondary); margin-bottom: 8px; }
.fer-count { margin-left: 8px; font-size: 11px; font-weight: 500; color: var(--text-secondary); text-transform: none; letter-spacing: 0; }
.fer-form-row { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end; }
.fer-tbl { border: 1px solid var(--border-color); border-radius: var(--radius-lg) !important; }
@media (max-width: 760px) { .fer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ===== Custos de TI (padrão Guide / task) ===== */
.ti-toolbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.ti-filters { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ti-filter-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ti-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-left: auto; }
.ti-toolbar .form-control { height: var(--ctl-h) !important; width: auto; padding: var(--ctl-text-nudge) 28px 0 var(--ctl-px) !important; border-radius: var(--ctl-radius); font-size: var(--ctl-fs) !important; font-weight: var(--ctl-fw); letter-spacing: var(--ctl-ls); background-color: transparent; }
.ti-toolbar select.form-control { background-position: right 10px center; background-size: 14px; }
.ti-toolbar .ti-search { width: min(440px, 100%); padding-right: var(--ctl-px) !important; }
.ti-resumo { font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; }
.ti-resumo strong { color: var(--text-primary); }
.ti-sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.ti-sortable:hover { color: var(--accent) !important; }
.ti-seta { margin-left: 4px; font-size: 9px; color: var(--accent); }
.ti-seta-off { opacity: 0; }
.ti-sortable:hover .ti-seta-off { opacity: 0.45; }
.ti-tabela td.ti-col-nome { position: sticky; left: 0; z-index: 4; min-width: 260px; text-align: left; background: var(--surface-solid); }
.sticky-head thead th.ti-col-nome { left: 0; z-index: 8; text-align: left; }
.ti-nome { display: inline-block; font-size: 14px; font-weight: 600; color: var(--text-primary); cursor: pointer; text-decoration: none; }
.ti-nome:hover { color: var(--accent); }
.ti-forn { margin-top: 2px; font-size: 11px; color: var(--text-secondary); }
.ti-farol { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; line-height: 1.4; white-space: nowrap; }
.ti-farol-ok { background: rgba(95, 174, 125, 0.16); color: #5FAE7D; }
.ti-farol-warn { background: rgba(201, 146, 87, 0.18); color: #C99257; }
.ti-farol-bad { background: rgba(194, 75, 67, 0.18); color: #C24B43; }
.light-theme .ti-farol-ok { color: #3F8A5E; }
.light-theme .ti-farol-warn { color: #9A6A33; }
.light-theme .ti-farol-bad { color: #A23A33; }
.ti-farol-neutro { background: var(--tbl-head-bg); color: var(--text-secondary); }
.ti-leg { margin-left: 10px; font-size: 10px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--text-secondary); }
.ti-leg i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin: 0 4px 0 8px; vertical-align: -1px; }
.ti-clip { display: inline-flex; align-items: center; gap: 2px; color: var(--text-secondary); }
.ti-clip svg { width: 11px; height: 11px; }
.ti-sub { font-size: 12px; color: var(--text-secondary); }
.ti-sub strong { color: var(--text-primary); }
.ti-anexos { display: flex; flex-direction: column; gap: 6px; }
.ti-anexo { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border: 1px solid var(--border-color); border-radius: 8px; font-size: 13px; }
.ti-anexo a, .ti-anexo > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-primary); text-decoration: none; font-weight: 500; }
.ti-anexo a:hover { color: var(--accent); }
.ti-anexo small { color: var(--text-secondary); font-size: 11px; white-space: nowrap; }
.ti-anexo-vazio { font-size: 12px; color: var(--text-secondary); }
.ti-anexo-add { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ti-anexo-add .btn-secondary { width: auto; display: inline-flex; align-items: center; gap: 6px; }
.ti-anexo-dica { font-size: 11px; color: var(--text-secondary); }
.ti-form-rodape .btn-secondary { width: auto; display: inline-flex; align-items: center; gap: 6px; }
/* Relatórios (extrato por mês, estilo app de cartão) */
.ti-car-wrap { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.ti-car-seta { flex: none; width: 34px; height: 34px; border: 1px solid var(--border-color); border-radius: 50%; }
.ti-car { flex: 1; min-width: 0; display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x proximity; padding: 4px 2px 8px; scrollbar-width: thin; outline: none; }
.ti-mes { flex: none; width: 68px; scroll-snap-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px 8px; background: transparent; border: 1px solid transparent; border-radius: 12px; color: var(--text-secondary); cursor: pointer; font: inherit; }
.ti-mes:hover { background: rgba(199, 196, 180, 0.08); }
.ti-mes.sel { border-color: var(--cat-1); background: rgba(232, 57, 93, 0.08); color: var(--text-primary); }
.ti-mes-val { min-height: 14px; font-size: 11px; font-weight: 600; color: var(--text-primary); }
.ti-mes-trilho { display: flex; align-items: flex-end; width: 26px; height: 120px; }
.ti-mes-barra { display: flex; flex-direction: column; width: 100%; border-radius: 6px 6px 3px 3px; overflow: hidden; }
.ti-seg-real { background: var(--cat-3); }
.ti-seg-prev { background: rgba(199, 196, 180, 0.55); }
.ti-mes.sel .ti-seg-real { background: var(--cat-1); }
.ti-mes.sel .ti-seg-prev { background: rgba(232, 57, 93, 0.45); }
.ti-mes-nome { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; }
.ti-mes.atual .ti-mes-nome::after { content: ' •'; color: var(--cat-1); }
.ti-mes-ano { font-size: 10px; opacity: 0.7; }
.ti-rel-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding: 16px 20px; margin-bottom: 12px; }
.ti-rel-mesnome { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); }
.ti-rel-total { font-size: 30px; font-weight: 600; color: var(--text-primary); line-height: 1.2; }
.ti-rel-sub { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--text-secondary); }
.ti-pt { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; }
.ti-pt-real { background: var(--cat-3); }
.ti-pt-prev { background: rgba(199, 196, 180, 0.55); }
.ti-rel-tabela tbody tr { cursor: pointer; }
/* Formulário do contrato: seções com divisórias, campos do tamanho do conteúdo, botões normais */
.modal-content.ti-modal { max-width: 860px; max-height: 92vh; overflow-y: auto; padding: 24px; }
.ti-form-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; padding-bottom: 12px; border-bottom: 1px solid var(--border-color); }
.ti-form-head h2 { margin: 0 !important; }
.ti-sec { padding: 14px 0; border-bottom: 1px solid var(--border-color); }
.ti-sec-titulo { margin-bottom: 10px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-secondary); }
.ti-sec-corpo { display: flex; flex-direction: column; gap: 12px; }
.ti-linha { display: grid; gap: 12px; align-items: end; }
.ti-campo label { display: block; margin-bottom: 4px; font-size: 11px; font-weight: 600; color: var(--text-secondary); }
.ti-campo .form-control { height: 34px; padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.ti-campo select.form-control { padding-right: 28px; }
.ti-campo textarea.form-control { height: auto; resize: vertical; }
.ti-check label { display: flex; gap: 8px; align-items: center; height: 34px; margin: 0; font-size: 12px; font-weight: 500; color: var(--text-primary); }
.ti-form-rodape { display: flex; gap: 8px; align-items: center; margin-top: 4px; padding-top: 16px; }
.ti-excluir { color: #C24B43 !important; }
@media (max-width: 760px) { .ti-linha { grid-template-columns: 1fr 1fr !important; } }

/* Tabela de Colaboradores: cabeçalho e colunas fixas opacos, no padrão das demais tabelas */
.colab-table thead th { position: sticky; top: 0; z-index: 20; background-color: var(--surface-head); }
.colab-table tbody tr:hover td { background-color: rgba(56, 189, 248, 0.04); }
.colab-table tbody tr:hover td[style*="sticky"] { background-color: var(--surface-solid); }

/* Tags de status */
.tag {
    display: inline-flex; align-items: center; border-radius: var(--radius-sm); padding: 2px 8px;
    font-size: 12px; font-weight: 600; line-height: 1.4; white-space: nowrap;
}
.tag-sm { font-size: 10.5px; padding: 1px 5px; }
.tag-positive { background: rgba(95, 174, 125, 0.12); color: var(--farol-ok); }
.tag-warning { background: rgba(201, 146, 87, 0.14); color: var(--farol-warn); }
.tag-danger { background: rgba(194, 75, 67, 0.12); color: var(--farol-bad); }
.tag-neutral { background: var(--tbl-head-bg); color: var(--text-secondary); }
.light-theme .tag-positive { color: #3F8A5E; }
.light-theme .tag-warning { color: #9A6A33; }
.light-theme .tag-danger { color: #A23A33; }

.badge { font-size: 10.5px; letter-spacing: 0.05em; padding: 3px 8px; }

/* Origem CI (clientes/colaboradores vindos do Controle Interno) */
.client-logo {
    width: 22px; height: 22px; flex: none; border-radius: var(--radius-md);
    object-fit: contain; background: #fff; border: 1px solid var(--border-color);
}
.client-logo-ph {
    width: 22px; height: 22px; flex: none; border-radius: var(--radius-md);
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--tbl-head-bg); color: var(--text-secondary);
    font-size: 10px; font-weight: 700;
}
.ci-note { font-size: 11px; color: var(--text-secondary); margin-top: 4px; }

/* ---------- Importação: área de soltar arquivo ---------- */
#import-dropzone.drag-active { border-color: var(--accent) !important; background: rgba(56, 189, 248, 0.08) !important; }

/* ---------- Login ---------- */
.login-card { border-radius: var(--radius-xl); }

/* ---------- Mobile: menu vira gaveta ---------- */
.mobile-bar { display: none; }
.sidebar-scrim { display: none; }

@media (max-width: 767px) {
    .mobile-bar {
        position: fixed; inset: 0 0 auto 0; z-index: 30; height: 56px;
        display: flex; align-items: center; justify-content: space-between; padding: 0 16px;
        background: var(--bg-sidebar); border-bottom: 1px solid var(--border-color);
    }
    .mobile-bar button {
        width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
        border: 1px solid var(--border-color); border-radius: var(--radius-md);
        background: transparent; color: var(--text-primary); font-size: 20px; cursor: pointer;
    }
    .app-container { flex-direction: column; }
    .sidebar {
        position: fixed; left: 0; top: 0; bottom: 0; width: 220px !important; padding: 64px 12px 12px !important;
        transform: translateX(-100%); transition: transform 0.2s ease;
    }
    .app-container.menu-open .sidebar { transform: translateX(0); }
    .app-container.menu-open .sidebar-scrim { display: block; position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, 0.3); }
    .sidebar-toggle { display: none; }
    .app-container.sidebar-collapsed .nav-item .nav-label { display: inline; }
    .app-container.sidebar-collapsed .nav-item { justify-content: flex-start; padding: 6px 8px; }
    .main-content { padding-top: 56px; }
    .top-header { padding: 16px 16px 0; }
    .content-area { padding: 12px 16px 32px; }
    .ctl-bar { justify-content: flex-start; width: 100%; }
    .dashboard-grid, .stats-grid { grid-template-columns: 1fr !important; }
}

/* ---------- Ajustes de grade (conteúdo estreito por causa do menu de 186px) ---------- */
.glass-card, .config-section { min-width: 0; }
.content-area [style*="grid-template-columns: repeat(3, 1fr)"] { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
.content-area [style*="grid-template-columns: repeat(4, 1fr)"] { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
.content-area [style*="grid-template-columns: repeat(2, 1fr)"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.ctl-bar > [data-hoisted] { display: flex !important; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--ctl-gap) !important; }
.ctl-bar .form-control { height: var(--ctl-h) !important; padding-top: var(--ctl-text-nudge) !important; padding-bottom: 0 !important; font-size: var(--ctl-fs) !important; }
@media (max-width: 1100px) {
    .content-area [style*="grid-template-columns: repeat(3, 1fr)"] { grid-template-columns: minmax(0, 1fr) !important; }
}
.glass-card > div[style*="justify-content: space-between"] { flex-wrap: wrap; gap: 8px; }
/* Botões "fantasma" definidos inline (fundo branco a 5%) precisam de texto legível no tema claro */
.light-theme .btn-primary[style*="rgba(255,255,255,0.0"] { color: var(--text-primary) !important; border-color: var(--border-color) !important; }

/* Custos de TI: login, cancelamento e histórico */
.ti-copia { display: flex; gap: 4px; align-items: center; }
.ti-copia .form-control { flex: 1; min-width: 0; }
.ti-copia .icon-btn { flex: none; }
.ti-cancel-painel { margin-top: 0.75rem; padding: 0.75rem; border: 1px solid var(--farol-bad); border-radius: 12px; background: color-mix(in srgb, var(--farol-bad) 8%, transparent); display: grid; gap: 0.5rem; }
.ti-cancel-tit { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-secondary); }
.ti-hist { list-style: none; margin: 0.25rem 0 0; padding: 0; font-size: 12px; color: var(--text-secondary); display: grid; gap: 4px; }
.ti-hist li span { font-variant-numeric: tabular-nums; margin-right: 6px; }
.ti-hist strong { color: var(--text-primary); }

/* Férias: aviso de sobreposição */
.fer-conf { display: grid; gap: 8px; max-height: 40vh; overflow: auto; }
.fer-conf-item { padding: 10px 12px; border: 1px solid var(--border-color); border-radius: 12px; font-size: 13px; }
.fer-conf-area { border-color: var(--farol-warn); background: color-mix(in srgb, var(--farol-warn) 10%, transparent); }
.fer-conf-tag { font-size: 11px; color: var(--text-secondary); margin-left: 6px; }
.fer-conf-sub { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* Férias: calendário mensal */
.fer-vista { display: inline-flex; border: 1px solid var(--border-color); border-radius: 10px; overflow: hidden; }
.fer-vista button { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; font-size: 13px; background: transparent; border: 0; color: var(--text-secondary); cursor: pointer; }
.fer-vista button + button { border-left: 1px solid var(--border-color); }
.fer-vista button.sel { background: color-mix(in srgb, var(--cat-1) 12%, transparent); color: var(--text-primary); font-weight: 600; }
.fer-vista svg { width: 14px; height: 14px; }
.fer-cal-top { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.fer-cal-mes { margin: 0; font-size: 18px; flex: 1; min-width: 160px; }
.fer-cal-leg { display: flex; gap: 12px; font-size: 12px; color: var(--text-secondary); flex-wrap: wrap; }
.fer-cal-leg span { display: inline-flex; align-items: center; gap: 5px; }
.fer-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.fer-dot-fer { background: var(--cat-3); }
.fer-dot-lic { background: var(--farol-warn); }
.fer-dot-col { background: var(--text-secondary); }
.fer-cal-corpo { display: flex; align-items: stretch; gap: 8px; }
.fer-cal-seta { flex: 0 0 38px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border-color); border-radius: 12px; background: transparent; color: var(--text-secondary); cursor: pointer; }
.fer-cal-seta:hover { background: color-mix(in srgb, var(--cat-1) 8%, transparent); color: var(--text-primary); border-color: var(--cat-1); }
.fer-cal-seta svg { width: 20px; height: 20px; }
.fer-cal-grade { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.fer-dow { text-align: center; font-size: 11px; font-weight: 600; color: var(--text-secondary); padding: 4px 0; text-transform: uppercase; letter-spacing: 0.04em; }
.fer-dia { min-height: 96px; padding: 5px; border: 1px solid var(--border-color); border-radius: 10px; display: flex; flex-direction: column; gap: 3px; text-align: left; font: inherit; color: var(--text-primary); background: transparent; min-width: 0; }
.fer-dia-fora { border-color: transparent; background: transparent; }
.fer-dia-fds { background: color-mix(in srgb, var(--text-secondary) 6%, transparent); }
.fer-dia-fer .fer-dia-n { color: var(--farol-bad); }
.fer-dia-hoje { border-color: var(--cat-1); box-shadow: inset 0 0 0 1px var(--cat-1); }
.fer-dia-tem { cursor: pointer; }
.fer-dia-tem:hover { border-color: var(--cat-3); }
.fer-dia-n { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
/* cor SÓLIDA da área (a tinta translúcida deixava tudo parecido); o texto troca entre claro/escuro pelo contraste (--tx) */
.fer-chip { background: var(--ac, var(--cat-3)); color: var(--tx, #FFFEF7); border-radius: 5px; padding: 2px 6px; line-height: 1.2; min-width: 0; overflow: hidden; }
/* licença/afastamento: mesma cor da área, com listras */
.fer-chip-lic { background-image: repeating-linear-gradient(135deg, rgba(0, 0, 0, 0.22) 0 4px, transparent 4px 8px); }
.fer-chip strong { display: block; font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fer-chip span { display: block; font-size: 10px; opacity: 0.85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fer-chip-col { background: transparent; color: var(--text-secondary); border: 1px dashed var(--text-secondary); }
.fer-fer { font-size: 10px; line-height: 1.2; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fer-fer-fac { font-style: italic; opacity: 0.8; }
.fer-mais { font-size: 10px; color: var(--text-secondary); padding-left: 4px; }
@media (max-width: 760px) {
  .fer-dia { min-height: 64px; padding: 3px; }
  /* celular: sem espaço para nomes; vira barrinha colorida (nomes na lista abaixo e no toque no dia) */
  .fer-chip { height: 6px; padding: 0; border: 0; background: var(--ac, var(--cat-3)); border-radius: 3px; }
  .fer-chip-col { background: var(--text-secondary); border: 0; }
  .fer-chip strong, .fer-chip span, .fer-mais { display: none; }
  .fer-fer { font-size: 0; height: 3px; background: var(--text-secondary); opacity: 0.5; border-radius: 2px; }
  .fer-cal-seta { flex-basis: 28px; }
}
