:root {
  --navy: #0e2a4d;
  --navy-dark: #081a30;
  --navy-soft: #eef2f7;
  --border: #e4e9f0;
  --text: #1c2b3a;
  --text-muted: #66748a;
  --radius: 10px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Inter, Tahoma, Geneva, Verdana, sans-serif;
  background: #ffffff;
  color: var(--text);
}

/* ---------- Login ---------- */

.login-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  padding: 24px;
}

.login-brand {
  margin-bottom: 32px;
}

.brand-logo {
  height: 36px;
  width: auto;
}

.login-card {
  background: #ffffff;
  width: 100%;
  max-width: 380px;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 32px;
  box-shadow: 0 12px 32px rgba(14, 42, 77, 0.08);
  text-align: center;
}

.login-subtitle {
  margin-top: 0;
  margin-bottom: 28px;
  font-size: 14px;
  color: var(--text-muted);
}

.login-error {
  background: #fdecea;
  color: #b3261e;
  border: 1px solid #f5c2c0;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 20px;
  text-align: left;
}

.btn-microsoft {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  background: #ffffff;
  border: 1px solid #d3d9e0;
  border-radius: 8px;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.btn-microsoft:hover {
  border-color: var(--navy);
  box-shadow: 0 2px 10px rgba(14, 42, 77, 0.12);
}

.ms-icon {
  flex-shrink: 0;
}

.login-hint {
  margin-top: 24px;
  font-size: 12px;
  color: var(--text-muted);
}

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

/* ---------- Aviso de conta sem cargo ---------- */

.aviso-icone {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: #fff4e0;
  color: #b7791f;
  font-size: 26px;
  font-weight: 700;
}

.aviso-titulo {
  margin: 0 0 12px;
  font-size: 19px;
  color: var(--navy);
}

.aviso-conta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 24px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--navy-soft);
}

.aviso-conta-nome {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.aviso-conta-email {
  font-size: 12px;
  color: var(--text-muted);
}

/* ---------- Painel / dashboard ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 16px 32px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 40px;
}

.brand-logo-small {
  height: 26px;
  width: auto;
  display: block;
}

.main-nav {
  display: flex;
  gap: 24px;
}

.main-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 4px 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.main-nav a:hover {
  color: var(--navy);
}

.main-nav a.active {
  color: var(--navy);
  border-bottom-color: var(--navy);
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 16px;
}

.nav-dropdown-trigger {
  display: inline-block;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  padding: 4px 2px;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  user-select: none;
}

.nav-dropdown:hover .nav-dropdown-trigger,
.nav-dropdown-trigger.active {
  color: var(--navy);
  border-bottom-color: var(--navy);
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 8px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(14, 42, 77, 0.14);
  min-width: 170px;
  padding: 6px;
  z-index: 20;
}

.nav-dropdown:hover .nav-dropdown-menu {
  display: block;
}

.nav-dropdown-menu a {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.nav-dropdown-menu a:hover {
  background: var(--navy-soft);
  color: var(--navy);
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  color: var(--text);
}

.btn-logout {
  background: var(--navy-soft);
  color: var(--navy);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s ease;
}

.btn-logout:hover {
  background: #e2e9f2;
}

.content {
  width: 96%;
  max-width: 1680px;
  margin: 40px auto;
  padding: 0 24px;
  color: var(--text);
  box-sizing: border-box;
}

@media (max-width: 640px) {
  .content {
    width: 100%;
    margin: 20px auto;
    padding: 0 14px;
  }
}

.content h2 {
  margin-bottom: 8px;
  color: var(--navy);
}

.content-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 24px;
}

.alert-success {
  background: #eaf7ee;
  color: #1e7a3c;
  border: 1px solid #cdedd6;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  margin-bottom: 20px;
}

.aviso-reprovacao {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fdecea;
  color: #8a2c22;
  border: 1px solid #f5c2c0;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 14px;
  margin-bottom: 12px;
}

.aviso-reprovacao-texto {
  line-height: 1.4;
}

.btn-fechar-aviso {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: #8a2c22;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.btn-fechar-aviso:hover {
  color: #b3261e;
}

.aviso-notificacao {
  background: var(--navy-soft);
  color: var(--navy);
  border: 1px solid #d7e0ec;
}

.aviso-notificacao .btn-fechar-aviso {
  color: var(--navy);
}

.aviso-notificacao .btn-fechar-aviso:hover {
  color: #0a1e38;
}

.aviso-notificacao a {
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}

.aviso-notificacao a:hover {
  text-decoration: underline;
}

/* ---------- Painel inicial (dashboard) ---------- */

.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.dash-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 22px;
  margin-bottom: 20px;
}

.dash-grid .dash-card {
  margin-bottom: 0;
}

.dash-card-avisos {
  padding: 18px 22px;
}

.dash-card-titulo {
  font-size: 15px;
  color: var(--navy);
  margin-bottom: 14px;
}

.dash-card-subtitulo {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.dash-total-horas {
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 18px;
}

.dash-card .chart-title {
  margin-top: 18px;
}

.dash-card .chart-title:first-of-type {
  margin-top: 0;
}

.dash-lista-links {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dash-lista-links li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  background: var(--navy-soft);
  border-radius: 8px;
  font-size: 13px;
}

.dash-lista-links a {
  color: var(--navy);
  font-weight: 600;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-lista-links a:hover {
  text-decoration: underline;
}

.dash-lista-meta {
  color: var(--text-muted);
  font-size: 12px;
  flex-shrink: 0;
}

.dash-card .bar-row {
  grid-template-columns: 150px 1fr auto;
}

.dash-card .bar-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendario-semana-horizontal {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 12px;
}

.calendario-dia-coluna {
  flex: 0 0 140px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--navy-soft);
}

.calendario-dia-coluna-hoje {
  background: #ffffff;
  box-shadow: 0 0 0 2px var(--navy) inset;
}

.calendario-dia-coluna-cabecalho {
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
  text-align: center;
  line-height: 1.3;
  padding-bottom: 6px;
  margin-bottom: 2px;
  border-bottom: 1px solid var(--border);
}

.calendario-dia-coluna-vazio {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin: 0;
}

.calendario-evento-chip {
  background: var(--navy);
  color: #ffffff;
  border-radius: 6px;
  padding: 4px 6px;
  cursor: default;
}

.calendario-evento-chip-horario {
  display: block;
  font-size: 10px;
  font-weight: 700;
}

.calendario-evento-chip-titulo {
  display: block;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-link-outlook {
  margin-top: 4px;
}

/* ---------- Tabela ---------- */

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: 12px;
}

.horas-salvar-wrap {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.btn-save-grande {
  padding: 12px 48px;
  font-size: 15px;
}

.table {
  width: 100%;
  min-width: max-content;
  border-collapse: collapse;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.table th,
.table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  white-space: nowrap;
}

.table td {
  padding-left: 4px;
  padding-right: 4px;
}

/* O truque max-width:0 + overflow:hidden só funciona (e só é necessário)
   em tabelas com table-layout:fixed, como a do Financeiro — nas tabelas com
   layout automático (Usuários, Centro de Custo), aplicar isso globalmente
   distorcia a distribuição de largura entre colunas. */
.table-financeiro .linha-visualizacao td {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 0;
}

.table-financeiro .linha-visualizacao td.table-actions {
  overflow: visible;
  max-width: none;
}

.table td.text-center {
  text-align: center;
}

.table th {
  background: var(--navy-soft);
  color: var(--navy);
  font-weight: 600;
  font-size: 13px;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 32px 16px;
}

.btn-save {
  background: var(--navy-soft);
  color: var(--navy);
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-save:hover {
  background: #e2e9f2;
}

/* Dentro de containers que já têm fundo navy-soft, o botão claro some —
   mantém o estilo escuro original só nesses casos, para preservar contraste. */
.form-inline .btn-save,
.form-vertical .btn-save {
  background: var(--navy);
  color: #ffffff;
}

.form-inline .btn-save:hover,
.form-vertical .btn-save:hover {
  background: var(--navy-dark);
}

.btn-delete {
  background: #fdecea;
  color: #b3261e;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-delete:hover {
  background: #fadbd8;
}

.inline-form {
  display: inline-block;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.valor-sigiloso {
  filter: blur(5px);
  transition: filter 0.15s ease;
  user-select: none;
}

tr.mostrar-salario .valor-sigiloso {
  filter: none;
  user-select: auto;
}

input.valor-sigiloso:focus {
  filter: none;
}

.btn-eye-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: var(--navy-soft);
  color: var(--navy);
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-eye-row:hover {
  background: #e2e9f2;
}

.info-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--navy-soft);
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
  cursor: default;
}

.info-tooltip {
  display: none;
  position: fixed;
  padding: 10px 12px;
  background: var(--navy);
  color: #ffffff;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.6;
  border-radius: 8px;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(14, 42, 77, 0.25);
  z-index: 30;
}

.valor-final-hover {
  cursor: default;
}

.table td input[type="text"],
.table td input[type="number"],
.table td input[type="date"],
.table td select {
  width: 90%;
  margin: 0 auto;
  display: block;
  box-sizing: border-box;
  padding: 7px 9px;
  border: 1px solid #d3d9e0;
  border-radius: 6px;
  font-size: 14px;
  color: var(--text);
  background: #ffffff;
}

.table-actions .btn-save,
.table-actions .btn-delete {
  padding: 8px 12px;
}

.table-actions .btn-editar-linha {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}

/* table-layout: fixed para as larguras abaixo serem respeitadas de verdade
   (com layout auto, o navegador ignora o width sugerido e alarga a coluna
   pelo conteúdo mínimo do input). Descrição (3ª coluna) fica sem largura
   definida de propósito, para absorver o espaço que sobra na linha. */
.table-financeiro {
  table-layout: fixed;
  width: 100%;
}

.table-financeiro td {
  padding-left: 2px;
  padding-right: 2px;
}

.table-financeiro td input[type="text"],
.table-financeiro td input[type="number"],
.table-financeiro td input[type="date"],
.table-financeiro td select {
  width: 97%;
}

.table-financeiro th:nth-child(1),
.table-financeiro td:nth-child(1) {
  width: 100px;
}

.table-financeiro th:nth-child(2),
.table-financeiro td:nth-child(2) {
  width: 225px;
}

.table-financeiro th:nth-child(4),
.table-financeiro td:nth-child(4) {
  width: 100px;
}

.table-financeiro th:nth-child(5),
.table-financeiro td:nth-child(5) {
  width: 70px;
}

.table-financeiro th:nth-child(6),
.table-financeiro td:nth-child(6) {
  width: 110px;
}

.table-financeiro th:nth-child(7),
.table-financeiro td:nth-child(7) {
  width: 90px;
}

.table-financeiro th:nth-child(8),
.table-financeiro td:nth-child(8) {
  width: 110px;
}

.table-financeiro th:nth-child(9),
.table-financeiro td:nth-child(9) {
  width: 34px;
}

.table-financeiro th:nth-child(10),
.table-financeiro td:nth-child(10) {
  width: 50px;
}

.input-unit-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.input-unit-group .unit {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.table td input[type="text"]:focus,
.table td input[type="number"]:focus,
.table td input[type="date"]:focus,
.table td select:focus {
  outline: none;
  border-color: var(--navy);
}

/* ---------- Formulário inline (criação) ---------- */

.form-inline {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 28px;
  padding: 20px;
  background: var(--navy-soft);
  border-radius: 12px;
}

.form-vertical {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 480px;
  margin: 0 auto 28px;
  padding: 24px;
  background: var(--navy-soft);
  border-radius: 12px;
}

.form-vertical .form-group input:not([type="checkbox"]),
.form-vertical .form-group select {
  width: 100%;
}

.filtro-acoes {
  flex-basis: 100%;
  display: flex;
  gap: 12px;
  margin-top: 4px;
}

.form-collapsible {
  display: none;
}

.form-collapsible.form-visivel {
  display: flex;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.form-group input:not([type="checkbox"]),
.form-group select {
  padding: 8px 10px;
  border: 1px solid #d3d9e0;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  background: #ffffff;
  min-width: 200px;
}

.form-group input:not([type="checkbox"]):focus,
.form-group select:focus {
  outline: none;
  border-color: var(--navy);
}

.input-padrao {
  padding: 8px 10px;
  border: 1px solid #d3d9e0;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  background: #ffffff;
}

.input-padrao:focus {
  outline: none;
  border-color: var(--navy);
}

/* ---------- Financeiro ---------- */

#form-novo-lancamento #novo-tipo {
  width: 140px;
  min-width: 0;
}

#form-novo-lancamento #novo-cc {
  width: 260px;
  min-width: 0;
}

#form-novo-lancamento #novo-descricao {
  width: 260px;
  min-width: 0;
}

#form-novo-lancamento #novo-contraparte {
  width: 180px;
  min-width: 0;
}

#form-novo-lancamento #novo-data {
  width: 160px;
  min-width: 0;
}

#form-novo-lancamento #novo-valor {
  width: 140px;
  min-width: 0;
}

#form-novo-lancamento #novo-imposto {
  width: 80px;
  min-width: 0;
}

.saldo-card {
  display: flex;
  width: fit-content;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 20px 28px;
  border-radius: 12px;
  margin-bottom: 24px;
  background: var(--navy-soft);
}

.saldo-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.saldo-valor-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.saldo-card .btn-eye-row {
  background: transparent;
}

.saldo-card .btn-eye-row:hover {
  background: rgba(11, 11, 11, 0.06);
}

.saldo-card.mostrar-saldo .valor-sigiloso {
  filter: none;
}

.saldo-valor {
  font-size: 28px;
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1;
}

.saldo-positivo.table-saldo-valor {
  color: #1e7a3c;
}

.saldo-negativo.table-saldo-valor {
  color: #b3261e;
}

.valor-entrada {
  color: #1e7a3c;
  font-weight: 700;
}

.valor-saida {
  color: #b3261e;
  font-weight: 700;
}

.valor-imposto {
  color: #b5790a;
  font-weight: 700;
}

/* ---------- Dashboard / gráficos ---------- */

.dashboard-top {
  display: flex;
  align-items: stretch;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.chart-card {
  flex: 1;
  min-width: 260px;
  max-width: 360px;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
}

.chart-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 14px;
}

.chart-empty {
  font-size: 13px;
  color: var(--text-muted);
}

.bar-chart,
.diverging-chart {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  align-items: center;
  gap: 8px;
}

.bar-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.bar-track {
  position: relative;
  height: 10px;
  background: var(--navy-soft);
  border-radius: 4px;
  cursor: default;
}

.bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.2s ease;
}

.bar-entrada {
  background: #1e7a3c;
}

.bar-imposto {
  background: #b5790a;
}

.bar-saida {
  background: #b3261e;
}

.bar-horas {
  background: var(--navy);
}

.bar-value {
  font-size: 12px;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.diverging-row {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  align-items: center;
  gap: 8px;
  cursor: default;
}

.diverging-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diverging-track {
  position: relative;
  height: 10px;
  background: var(--navy-soft);
  border-radius: 4px;
  overflow: hidden;
}

.diverging-zero {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
  z-index: 1;
}

.diverging-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 4px;
}

.diverging-value {
  font-size: 12px;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.table tfoot td {
  border-bottom: none;
  border-top: 2px solid var(--border);
  background: var(--navy-soft);
  font-weight: 700;
  white-space: normal;
}

.saldo-resumo {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 28px;
}

.table-saldo-label {
  color: var(--navy);
}

.table-saldo-valor {
  font-size: 14px;
}

.table td details {
  cursor: pointer;
}

.table td details summary {
  list-style: none;
  white-space: nowrap;
}

.table td details summary::-webkit-details-marker {
  display: none;
}

.table td details[open] {
  white-space: normal;
}

.table td details label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 8px;
  margin-bottom: 4px;
}

.table td details input[type="number"] {
  max-width: 100px;
}

/* ---------- Lançamento de Horas ---------- */

.horas-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.banco-horas-badge {
  padding: 10px 20px;
  border: none;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  background: var(--navy-soft);
  color: var(--navy);
  cursor: pointer;
  transition: filter 0.15s ease;
}

.banco-horas-badge:hover {
  filter: brightness(0.96);
}

.banco-horas-badge.saldo-positivo {
  background: #e5f3ea;
  color: #1e7a3c;
}

.banco-horas-badge.saldo-negativo {
  background: #fbe9e8;
  color: #b3261e;
}

.btn-toolbar {
  display: inline-flex;
  align-items: center;
  padding: 9px 16px;
  border: none;
  border-radius: 8px;
  background: var(--navy-soft);
  color: var(--navy);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-toolbar:hover {
  background: #e2e9f2;
}

.table-export-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  margin-bottom: 6px;
}

.btn-exportar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  opacity: 0.55;
  cursor: pointer;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.btn-exportar:hover {
  opacity: 1;
  background: var(--navy-soft);
  color: var(--navy);
}

.btn-toolbar-alerta {
  background: #fdecea;
  color: #b3261e;
}

.btn-toolbar-alerta:hover {
  background: #fadbd8;
}

.btn-icone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 8px;
  background: var(--navy-soft);
  color: var(--navy);
  text-decoration: none;
  font-weight: 700;
  font-family: inherit;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-icone:hover {
  background: #e2e9f2;
}

.ir-para-semana input {
  padding: 7px 10px;
  border: 1px solid #d3d9e0;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
}

.total-dia-cabecalho {
  display: inline-block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 700;
  color: var(--navy);
}

.subtitulo-secundario {
  font-size: 15px;
  color: var(--navy);
  margin: 28px 0 12px;
}

.semana-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.semana-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
}

.btn-semana {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--navy-soft);
  color: var(--navy);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s ease;
}

.btn-semana:hover {
  background: #e2e9f2;
}

.table-horas {
  table-layout: fixed;
  width: 100%;
}

/* Alinha os totais pelo rodapé do cabeçalho, já que a coluna Total
   tem uma linha a menos que as colunas de dia. */
.table-horas thead th {
  vertical-align: bottom;
}

.total-semana-cabecalho {
  font-size: 13px;
}

.table-horas th:nth-child(1),
.table-horas td:nth-child(1) {
  width: 34px;
}

.table-horas th:nth-child(2),
.table-horas td:nth-child(2) {
  width: 34px;
}

.table-horas th:nth-child(3),
.table-horas td:nth-child(3) {
  width: 240px;
}

.table-horas th:nth-child(4),
.table-horas td:nth-child(4) {
  width: 142px;
}

.table-horas th:nth-child(n+5):nth-child(-n+11),
.table-horas td:nth-child(n+5):nth-child(-n+11) {
  width: 94px;
}

.table-horas th:nth-child(12),
.table-horas td:nth-child(12) {
  width: 46px;
}

.table-horas th:nth-child(13),
.table-horas td:nth-child(13) {
  width: 90px;
}

.table-horas td.coluna-cc,
.table-horas td.coluna-atividade {
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-horas th.coluna-fora-padrao {
  background: #e4ddca;
  color: #7a6a3c;
}

.table-horas td.coluna-fora-padrao {
  background: #faf6ec;
}

.table-horas td {
  padding-left: 0;
  padding-right: 0;
}

/* Células de texto (não os inputs de hora) mantêm o mesmo padding do
   cabeçalho, para o texto ficar alinhado com "Centro de Custo", "Atividade"
   e "Total" no th. */
.table-horas td.coluna-cc,
.table-horas td.coluna-atividade,
.table-horas td.coluna-total {
  padding-left: 8px;
  padding-right: 8px;
}

.table-horas td input[type="time"] {
  width: 90%;
  margin: 0 auto;
  display: block;
  background: #ffffff;
  border: 1.5px solid #d3d9e0;
  border-radius: 8px;
  padding: 6px 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.table-horas td input[type="time"]:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(14, 42, 77, 0.1);
}

.table-horas td input[type="time"]::-webkit-calendar-picker-indicator {
  opacity: 0.45;
  cursor: pointer;
}

.table-horas td input[type="time"]::-webkit-calendar-picker-indicator:hover {
  opacity: 0.9;
}

.table-horas td.hora-pendente {
  background: #ffffff;
}

.table-horas td.hora-pendente input {
  color: #2a78d6;
  border-color: #bcd6f2;
}

.table-horas td.hora-aprovada {
  background: #ffffff;
}

.table-horas td.hora-aprovada input {
  color: #1e7a3c;
  border-color: #b9dcc4;
}

/* Feriado / fim de semana mantém o fundo destacado mesmo com lançamento. */
.table-horas td.coluna-fora-padrao.hora-pendente,
.table-horas td.coluna-fora-padrao.hora-aprovada {
  background: #faf6ec;
}

.hora-celula {
  position: relative;
}

.hora-comentario-dot {
  position: absolute;
  top: 4px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--navy);
  cursor: pointer;
}

.btn-favorito {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #c3c8d1;
  font-size: 16px;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.btn-favorito:hover {
  background: var(--navy-soft);
  color: #eda100;
}

.btn-favorito.favorito-ativo {
  color: #eda100;
}

/* ---------- Status (Despesas) ---------- */

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-neutro {
  background: var(--navy-soft);
  color: var(--navy);
}

.status-pendente {
  background: #e3edfa;
  color: #2a78d6;
}

.status-aguardando {
  background: #fdf2df;
  color: #b5790a;
}

.status-pago {
  background: #e5f3ea;
  color: #1e7a3c;
}

.status-recusado {
  background: #fdecea;
  color: #b3261e;
}

/* ---------- Dropdown de status com checkbox (Despesas) ---------- */

.status-dropdown {
  position: relative;
}

.status-dropdown-trigger {
  padding: 8px 10px;
  border: 1px solid #d3d9e0;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  background: #ffffff;
  min-width: 160px;
  text-align: left;
  cursor: pointer;
}

.status-dropdown-trigger:hover {
  border-color: var(--navy);
}

.status-dropdown-painel {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 20;
  background: #ffffff;
  border: 1px solid #d3d9e0;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(14, 42, 77, 0.12);
  padding: 10px;
  min-width: 200px;
}

.status-dropdown.aberto .status-dropdown-painel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.status-dropdown-painel label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
  font-weight: 400;
  white-space: nowrap;
}

.coluna-total {
  font-weight: 700;
  color: var(--navy);
}

.form-group-dia {
  min-width: 70px;
}

.form-group-dia label {
  white-space: nowrap;
}

.input-dia-nova-linha {
  width: 70px;
  min-width: 0;
}

/* ---------- Modal do calendário ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 11, 11, 0.45);
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-caixa {
  background: #ffffff;
  border-radius: 14px;
  padding: 24px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.modal-caixa-larga {
  max-width: 820px;
  max-height: 85vh;
  overflow-y: auto;
}

.saldo-projetado-aviso {
  margin-bottom: 16px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--navy-soft);
  font-size: 13px;
  color: var(--text);
}

.table-banco-horas th,
.table-banco-horas td {
  white-space: nowrap;
}

.atividades-templates-aplicar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  padding: 12px;
  background: var(--navy-soft);
  border-radius: 10px;
}

.atividades-templates-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 4px;
}

.btn-toolbar-pequeno {
  padding: 6px 12px;
  font-size: 13px;
}

.form-aplicar-template {
  display: flex;
}

.form-aplicar-template .btn-toolbar {
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(14, 42, 77, 0.06);
}

.form-aplicar-template .btn-toolbar:hover {
  background: var(--navy-soft);
  border-color: var(--navy);
}

.atividades-checklist {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 20px;
  margin: 12px 0 16px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.form-group-atividades .atividades-checklist {
  margin: 0;
}

.atividades-checklist-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}

.form-nova-atividade {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.form-nova-atividade input[type="text"] {
  padding: 8px 10px;
  border: 1px solid #d3d9e0;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
}

.atividades-lista-editavel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.form-editar-atividade {
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-editar-atividade form:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.form-editar-atividade input[type="text"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d3d9e0;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  box-sizing: border-box;
}

/* Segundo slot da linha (Excluir ou "Em uso"): largura fixa, para o campo de
   texto ficar do mesmo tamanho em todas as linhas independente do conteúdo. */
.form-editar-atividade > :nth-child(2) {
  flex: 0 0 90px;
  text-align: center;
}

.form-editar-atividade > :nth-child(2) .btn-delete {
  width: 100%;
}

.atividade-sem-exclusao {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  padding: 6px 10px;
  background: var(--navy-soft);
  border-radius: 8px;
  white-space: nowrap;
  box-sizing: border-box;
}

.modal-cabecalho {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.modal-cabecalho h3 {
  font-size: 16px;
  color: var(--navy);
}

.btn-fechar-modal {
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
}

.calendario-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.calendario-grade {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 16px;
}

.calendario-cabecalho-dia {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  padding-bottom: 4px;
}

.calendario-dia {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
}

.calendario-dia-vazio {
  background: transparent;
}

.cor-incompleto {
  background: #c3c8d1;
  color: #52596b;
}

.cor-pendente {
  background: #2a78d6;
}

.cor-aprovado {
  background: #1e7a3c;
}

.cor-feriado {
  background: #6b7280;
}

.cor-ausencia {
  background: #b7791f;
}

.calendario-legenda {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legenda-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text);
}

.legenda-cor {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex-shrink: 0;
}

/* ---------- RDO ---------- */

.rdo-totais-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
}

.rdo-totais-grid > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rdo-total-label {
  font-size: 12px;
  color: var(--text-muted);
}

.rdo-total-valor {
  font-size: 18px;
  font-weight: 600;
  color: var(--navy);
}

.rdo-total-destaque {
  color: var(--verde, #1e8a4c);
}

.rdo-acoes-topo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.rdo-dias {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rdo-dia {
  border: 1px solid #e4e9f0;
  border-radius: 10px;
  padding: 12px 16px;
  background: #fff;
}

.rdo-dia-especial {
  background: #fafbfd;
  border-color: #dbe2ec;
}

.rdo-dia-cabecalho {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.rdo-dia-data {
  font-weight: 600;
  color: var(--navy);
  font-size: 14px;
  min-width: 110px;
}

.rdo-dia-resumo {
  font-size: 12px;
  color: var(--text-muted);
}

.rdo-dia-itens {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.rdo-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13px;
  padding: 6px 10px;
  background: var(--navy-soft);
  border-radius: 8px;
}

.rdo-item-horario {
  font-weight: 600;
  color: var(--navy);
  flex-shrink: 0;
  width: 100px;
}

.rdo-item-descricao {
  flex: 1;
  color: var(--text);
  white-space: pre-wrap;
  padding-top: 1px;
}

.rdo-item .rdo-item-horario {
  padding-top: 1px;
}

.rdo-item .btn-fechar-aviso {
  font-size: 16px;
  padding: 0 2px;
}

.rdo-dia-form {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.rdo-dia-form input[type="time"] {
  padding: 6px 8px;
  border: 1px solid #d3d9e0;
  border-radius: 6px;
  font-size: 13px;
}

.rdo-dia-form textarea {
  flex: 1;
  min-width: 180px;
  padding: 6px 10px;
  border: 1px solid #d3d9e0;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  min-height: 30px;
  line-height: 1.4;
}

.rdo-checkbox-deslocamento {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ============================================================
   Layout mobile — tudo abaixo é só ADITIVO (@media), o desktop
   (telas acima de 860px) fica exatamente como já estava.
   ============================================================ */

.nav-hamburger {
  display: none;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  background: var(--navy-soft);
  color: var(--navy);
  cursor: pointer;
}

.nav-hamburger:hover {
  background: #e2e9f2;
}

.nav-hamburger svg {
  width: 20px;
  height: 20px;
}

@media (max-width: 860px) {
  /* ---- Topo / navegação ---- */

  .nav-hamburger {
    display: inline-flex;
  }

  .topbar {
    align-items: flex-start;
    padding: 14px 18px;
  }

  .topbar-left {
    flex-wrap: wrap;
    row-gap: 12px;
    gap: 14px;
  }

  .topbar-user {
    padding-top: 3px;
  }

  .main-nav {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    width: 100%;
    order: 3;
    margin-top: 4px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
  }

  .main-nav.nav-aberto {
    display: flex;
  }

  .main-nav a {
    padding: 10px 10px;
    border-radius: 8px;
    border-bottom: none;
  }

  .main-nav a.active {
    background: var(--navy-soft);
  }

  .nav-dropdown {
    width: 100%;
  }

  .nav-dropdown::after {
    content: none;
  }

  .nav-dropdown-trigger {
    display: block;
    padding: 10px 10px;
    border-radius: 8px;
  }

  .nav-dropdown-trigger.active {
    background: var(--navy-soft);
  }

  .nav-dropdown-menu {
    display: none;
    position: static;
    margin-top: 2px;
    padding: 0 0 4px 14px;
    border: none;
    box-shadow: none;
    background: transparent;
    min-width: 0;
  }

  .nav-dropdown.nav-dropdown-aberto .nav-dropdown-menu {
    display: block;
  }

  .nav-dropdown-menu a {
    padding: 9px 10px;
  }

  .topbar-user {
    gap: 12px;
    font-size: 13px;
  }

  /* ---- Conteúdo / formulários ---- */

  .form-inline,
  .form-vertical {
    padding: 16px;
  }

  .form-inline {
    flex-direction: column;
    align-items: stretch;
  }

  .form-inline .form-group {
    width: 100%;
  }

  .form-group input:not([type="checkbox"]),
  .form-group select {
    min-width: 0;
    width: 100%;
    height: 44px;
    padding-top: 0;
    padding-bottom: 0;
    box-sizing: border-box;
  }

  /* input de data/mês/hora usa o widget nativo do celular — forçar
     width:100% + padding apertado espreme esse widget e quebra a exibição
     dos dígitos no Safari/iOS. Deixa a largura natural, só limitando pra
     não estourar a tela. A altura fixa (igual aos outros campos) evita que
     o Safari deixe esse campo mais alto que os campos de texto ao lado. */
  .form-group input[type="date"],
  .form-group input[type="month"],
  .form-group input[type="time"] {
    width: auto;
    max-width: 100%;
    min-width: 0;
    height: 44px;
  }

  .filtro-acoes {
    flex-direction: column;
  }

  .filtro-acoes .btn-save,
  .filtro-acoes .btn-icone,
  .filtro-acoes a {
    width: 100%;
    text-align: center;
  }

  .horas-toolbar,
  .semana-nav,
  .dashboard-top {
    flex-wrap: wrap;
  }

  .saldo-card {
    width: 100%;
  }

  /* ---- Tabelas: mantém rolagem horizontal já existente, texto no tamanho
     padrão do desktop (sem reduzir nem forçar maior) — quem precisar ler
     mais de perto usa o zoom do próprio navegador. ---- */

  .table-wrap {
    -webkit-overflow-scrolling: touch;
  }

  /* ---- Botões / alvos de toque ---- */

  .btn-save,
  .btn-delete,
  .btn-logout,
  .btn-toolbar,
  .banco-horas-badge {
    padding: 10px 16px;
  }

  .btn-icone,
  .btn-eye-row {
    width: 38px;
    height: 38px;
  }

  /* ---- Modais ---- */

  .modal-caixa {
    max-width: 92vw;
    max-height: 88vh;
    overflow-y: auto;
    padding: 20px;
  }

  .modal-caixa-larga {
    max-width: 94vw;
  }
}

@media (max-width: 480px) {
  .content {
    padding: 0 10px;
  }

  .brand-logo-small {
    height: 22px;
  }

  .dash-total-horas {
    font-size: 19px;
  }
}
