/* ─────────────────────────────────────────
   BASE
───────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 0.95rem;
  line-height: 1.5;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ─────────────────────────────────────────
   NAVBAR
───────────────────────────────────────── */
.navbar {
  background: #1e293b;
  border-bottom: 1px solid #334155;
  display: flex;
  align-items: center;
  padding: 0.75rem 2rem;
  gap: 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex: 1;
}

.nav-brand {
  font-size: 1.1rem;
  font-weight: 800;
  color: #f8fafc;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 0.25rem;
}

.nav-links a {
  padding: 0.4rem 0.85rem;
  border-radius: 7px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #94a3b8;
  transition: background 0.2s, color 0.2s;
}

.nav-links a:hover {
  background: #334155;
  color: #f8fafc;
}

.nav-links a.active {
  background: #2563eb;
  color: #fff;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
  font-size: 0.82rem;
  color: #64748b;
  white-space: nowrap;
}

.nav-user strong {
  color: #cbd5e1;
}

/* ─────────────────────────────────────────
   CONTAINER
───────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 1.5rem;
}

/* ─────────────────────────────────────────
   PAGE HEADER
───────────────────────────────────────── */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2rem;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.page-header h1 {
  font-size: 1.5rem;
  color: #f8fafc;
  font-weight: 700;
}

/* ─────────────────────────────────────────
   NAVEGAÇÃO DE MÊS
───────────────────────────────────────── */
.mes-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.mes-display {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 7px 14px;
  min-height: 36px;
  cursor: pointer;
  overflow: visible; /* Alterado para visible para garantir que o clique não seja bloqueado */
}

.mes-display:hover {
  border-color: #3b82f6;
}

.btn-mes {
  width: 36px;
  height: 36px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #1e293b;
  color: #e2e8f0;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}

.btn-mes:hover {
  background: #334155;
  border-color: #3b82f6;
}

.btn-mes-icone {
  font-size: 1rem;
  line-height: 1;
}

#mes-legenda {
  font-size: 0.95rem;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  min-width: 130px;
  text-align: center;
}

.mes-form {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  /* Removido opacity: 0 aqui para não bloquear o clique, o input-native já faz isso */
}

.mes-input-native {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0; /* Mantém o input invisível */
  cursor: pointer;
  border: 0;
  background: transparent;
}

.btn-hoje {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  color: #cbd5e1;
  padding: 0.5rem 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-hoje:hover {
  background: #334155;
  color: #f8fafc;
}

/* ─────────────────────────────────────────
   CARDS DE RESUMO
───────────────────────────────────────── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.2rem;
}

.card {
  background: #1e293b;
  border-radius: 12px;
  padding: 1rem 1.2rem;
  border-left: 4px solid transparent;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.card-green {
  border-color: #22c55e;
}

.card-red {
  border-color: #ef4444;
}

.card-blue {
  border-color: #3b82f6;
}

.card-yellow {
  border-color: #facc15;
}

.card-label {
  font-size: 0.72rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.card-valor {
  font-size: 1.4rem;
  font-weight: 800;
  color: #f8fafc;
}

/* ─────────────────────────────────────────
   PAINEL DE PORCENTAGEM
───────────────────────────────────────── */
.pct-section {
  background: #1e293b;
  border-radius: 12px;
  padding: 1.2rem;
  margin-bottom: 1.2rem;
  border: 1px solid #334155;
}

.pct-topo {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.pct-perfil-badge {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  color: #cbd5e1;
}

.pct-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.8rem;
  margin-bottom: 1.2rem;
}

.pct-card {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 0.8rem 1rem;
  text-align: center;
}

.pct-card-label {
  font-size: 0.7rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 0.2rem;
}

.pct-card-valor {
  font-size: 1.5rem;
  font-weight: 800;
  color: #f8fafc;
}

.pct-card-valor.pct-ok {
  color: #22c55e;
}

.pct-card-valor.pct-alerta {
  color: #facc15;
}

.pct-card-valor.pct-perigo {
  color: #ef4444;
}

.pct-card-sub {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 0.2rem;
}

.pct-barra-track {
  width: 100%;
  height: 12px;
  background: #334155;
  border-radius: 6px;
  position: relative;
  overflow: visible;
  margin-top: 2.2rem !important;
  margin-bottom: 1.2rem;
}

.pct-barra-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.5s ease-out;
}

.pct-barra-fill.pct-ok {
  background: #22c55e;
}

.pct-barra-fill.pct-alerta {
  background: #facc15;
}

.pct-barra-fill.pct-perigo {
  background: #ef4444;
}

.pct-barra-marker {
  position: absolute;
  top: 0;
  height: 100%;
  width: 2px;
  background: #64748b;
  transform: translateX(-50%);
}

.pct-barra-marker-max {
  background: #ef4444;
}

.pct-marker-label {
  position: absolute;
  top: -34px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.72rem;
  font-weight: 700;
  color: #cbd5e1;
  white-space: nowrap;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 0.2rem 0.45rem;
  text-align: center;
  line-height: 1.15;
  z-index: 5;
}

.pct-marker-label-max {
  color: #fecaca;
  border-color: #ef4444;
}

.pct-barra-footer {
  font-size: 0.85rem;
  color: #cbd5e1;
  text-align: center;
  margin-top: 1rem;
}

/* ─────────────────────────────────────────
   FORMULÁRIOS
───────────────────────────────────────── */
.form-section {
  background: #1e293b;
  border-radius: 12px;
  padding: 1.2rem;
  margin-bottom: 1.2rem;
  border: 1px solid #334155;
}

.form-section h2 {
  font-size: 1.2rem;
  color: #f8fafc;
  margin-bottom: 1rem;
  font-weight: 700;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

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

.form-group label {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-bottom: 0.4rem;
  font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="time"],
.form-group select {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  color: #e2e8f0;
  font-size: 0.9rem;
  width: 100%;
  transition: border-color 0.2s;
}

.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus,
.form-group input[type="date"]:focus,
.form-group input[type="time"]:focus,
.form-group select:focus {
  outline: none;
  border-color: #3b82f6;
}

.form-group input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
}

.form-group input[type="date"]::-webkit-inner-spin-button,
.form-group input[type="date"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.form-group select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2394a3b8'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  background-size: 1.2em;
  padding-right: 2.5rem;
}

.form-btn {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}

.btn {
  background: #2563eb;
  border: 1px solid #2563eb;
  border-radius: 8px;
  color: #fff;
  padding: 0.6rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.btn:hover {
  background: #3b82f6;
  border-color: #3b82f6;
}

.btn-secondary {
  background: #334155;
  border-color: #334155;
  color: #cbd5e1;
}

.btn-secondary:hover {
  background: #475569;
  border-color: #475569;
  color: #f8fafc;
}

.btn-danger {
  background: #dc2626;
  border-color: #dc2626;
}

.btn-danger:hover {
  background: #ef4444;
  border-color: #ef4444;
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
}

.btn-edit {
  background: #facc15;
  border-color: #facc15;
  color: #1e293b;
}

.btn-edit:hover {
  background: #fde047;
  border-color: #fde047;
}

/* ─────────────────────────────────────────
   TABELAS
───────────────────────────────────────── */
.table-section {
  background: #1e293b;
  border-radius: 12px;
  padding: 1.2rem;
  border: 1px solid #334155;
  overflow-x: auto; /* Para tabelas grandes em telas pequenas */
}

.table-section h2 {
  font-size: 1.2rem;
  color: #f8fafc;
  margin-bottom: 1rem;
  font-weight: 700;
}

.tabela {
  width: 100%;
  border-collapse: collapse;
  min-width: 800px; /* Garante que a tabela não fique muito estreita */
}

.tabela th,
.tabela td {
  padding: 0.7rem 0.8rem;
  text-align: left;
  border-bottom: 1px solid #334155;
  font-size: 0.85rem;
  color: #cbd5e1;
}

.tabela th {
  background: #0f172a;
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: sticky;
  top: 0;
  z-index: 1;
}

.tabela tbody tr:hover {
  background: #2d3a4b;
}

.tabela .vazio {
  text-align: center;
  color: #64748b;
  padding: 1.5rem;
}

.tabela .acoes {
  display: flex;
  gap: 0.5rem;
  white-space: nowrap;
}

.tabela .valor {
  text-align: right;
  font-weight: 600;
}

.tabela .valor.positivo {
  color: #22c55e;
}

.tabela .valor.negativo {
  color: #ef4444;
}

.tabela .linha-receita {
  background-color: rgba(34, 197, 94, 0.05); /* Verde bem suave */
}

.tabela .linha-saida {
  background-color: rgba(239, 68, 68, 0.05); /* Vermelho bem suave */
}

.tabela .linha-paga {
  opacity: 0.7;
}

.btn-status {
  background: none;
  border: none;
  color: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: 5px;
  transition: background 0.2s;
}

.btn-status:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-pago {
  color: #22c55e;
}

.btn-nao-pago {
  color: #ef4444;
}

.badge {
  display: inline-block;
  padding: 0.3em 0.6em;
  border-radius: 5px;
  font-size: 0.75em;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
}

.badge-green {
  background-color: #22c55e;
  color: #fff;
}

.badge-red {
  background-color: #ef4444;
  color: #fff;
}

.badge-cat {
  background-color: #334155;
  color: #cbd5e1;
  padding: 0.3em 0.6em;
  border-radius: 5px;
  font-size: 0.75em;
}

.badge-fixo {
  background-color: #3b82f6;
  color: #fff;
}

.badge-variavel {
  background-color: #facc15;
  color: #1e293b;
}

.badge-parcela {
  background-color: #a855f7;
  color: #fff;
}

/* ─────────────────────────────────────────
   MODAL
───────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-overlay.hidden {
  display: none;
}

.modal {
  background: #1e293b;
  border-radius: 12px;
  padding: 2rem;
  width: 90%;
  max-width: 600px;
  position: relative;
  border: 1px solid #334155;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #94a3b8;
  cursor: pointer;
  transition: color 0.2s;
}

.modal-close:hover {
  color: #f8fafc;
}

.modal h2 {
  font-size: 1.5rem;
  color: #f8fafc;
  margin-bottom: 1.5rem;
  text-align: center;
}

/* ─────────────────────────────────────────
   PERFIL
───────────────────────────────────────── */
.perfil-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 1.5rem;
}

.perfil-opcoes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.8rem;
}

.perfil-opcao {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.perfil-opcao:hover {
  border-color: #3b82f6;
}

.perfil-opcao.perfil-ativo {
  border-color: #3b82f6 !important;
  background: #0c1a3a !important;
}

.perfil-opcao-nome {
  font-size: 0.85rem;
  font-weight: 700;
  color: #f8fafc;
}

.perfil-opcao-faixa {
  font-size: 0.75rem;
  color: #60a5fa;
  font-weight: 600;
}

.perfil-preview {
  position: sticky;
  top: 70px;
}

.perfil-preview-nome {
  font-size: 1.1rem;
  font-weight: 800;
  color: #f8fafc;
  margin-bottom: 0.4rem;
}

.perfil-preview-faixa {
  font-size: 0.82rem;
  color: #64748b;
  margin-bottom: 0.3rem;
}

.perfil-preview-faixa strong {
  color: #60a5fa;
}

.perfil-preview-desc {
  font-size: 0.78rem;
  color: #475569;
  line-height: 1.5;
  margin-bottom: 1rem;
  min-height: 2.5rem;
}

.perfil-legenda {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.perfil-legenda-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  color: #64748b;
}

.perfil-legenda-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ─────────────────────────────────────────
   ALERTA DE ERRO
───────────────────────────────────────── */
.alerta-erro {
  background: #450a0a;
  border: 1px solid #dc2626;
  color: #f87171;
  border-radius: 8px;
  padding: 0.7rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}

/* Sucesso: amarelo suave, discreto */
.alerta-erro.success {
  background: #2a2618;
  border: 1px solid #b08d2a;
  color: #f6e7b5;
}

/* Aviso/info, se usar */
.alerta-erro.info {
  background: #1e293b;
  border: 1px solid #334155;
  color: #cbd5e1;
}

/* ─────────────────────────────────────────
   LOGIN
───────────────────────────────────────── */
body.login-page {
  min-height: 100vh;
  background: #0f172a;
}

.login-screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: #0f172a;
}

.login-box {
  width: min(380px, calc(100vw - 2rem));
  margin: 0;
  background: #1e293b;
  border-radius: 16px;
  padding: 2.2rem 2.5rem;
  border: 1px solid #334155;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
  text-align: center;
}

.login-logo {
  font-size: 2.5rem;
  margin-bottom: 0.4rem;
}

.login-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 0.2rem;
}

.login-sub {
  color: #475569;
  font-size: 0.82rem;
  margin-bottom: 1.4rem;
}

.login-erro {
  background: #450a0a;
  border: 1px solid #dc2626;
  color: #f87171;
  border-radius: 7px;
  padding: 0.55rem 0.9rem;
  font-size: 0.82rem;
  margin-bottom: 0.9rem;
  text-align: left;
}

.login-form {
  text-align: left;
}

.btn-login {
  width: 100%;
  margin-top: 0.5rem;
}

/* ─────────────────────────────────────────
   CHECKBOX
───────────────────────────────────────── */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.5rem 0.7rem;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 7px;
  color: #e2e8f0;
  font-size: 0.88rem;
  transition: border-color 0.2s;
  user-select: none;
}

.checkbox-label:hover {
  border-color: #3b82f6;
}

.checkbox-label input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: #2563eb;
  cursor: pointer;
  flex-shrink: 0;
}

/* ─────────────────────────────────────────
   SCROLLBAR
───────────────────────────────────────── */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: #0f172a;
}

::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* ─────────────────────────────────────────
   FILTRO DE CATEGORIA
───────────────────────────────────────── */
.filtro-bar {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 1rem 1.2rem;
  margin-bottom: 1.2rem;
}

.filtro-form {
  display: flex;
  align-items: flex-end; /* Alterado para flex-end para alinhar os botões */
  gap: 0.8rem;
  flex-wrap: wrap;
}

/* ─────────────────────────────────────────
   ESTILOS PARA OPERAÇÕES
───────────────────────────────────────── */
.tabela th:nth-child(7), /* KM Ida/Volta */
.tabela td:nth-child(7),
.tabela th:nth-child(8), /* Valor KM */
.tabela td:nth-child(8),
.tabela th:nth-child(9), /* Estac. */
.tabela td:nth-child(9),
.tabela th:nth-child(10), /* Pedágio */
.tabela td:nth-child(10),
.tabela th:nth-child(11), /* Auditoria */
.tabela td:nth-child(11),
.tabela th:nth-child(12), /* Hospedagem */
.tabela td:nth-child(12),
.tabela th:nth-child(13), /* Valor NF */
.tabela td:nth-child(13),
.tabela th:nth-child(15), /* Cobrança Cliente */
.tabela td:nth-child(15),
.tabela th:nth-child(16), /* Custo Checker */
.tabela td:nth-child(16),
.tabela th:nth-child(17), /* CVDB Serviços */
.tabela td:nth-child(17) {
  text-align: right;
  white-space: nowrap;
}

.tabela th:nth-child(14), /* Cidade/UF */
.tabela td:nth-child(14) {
  white-space: nowrap;
}

/* ─────────────────────────────────────────
   RESPONSIVO
───────────────────────────────────────── */
@media (max-width: 1200px) {
  .tabela th, .tabela td {
    font-size: 0.75rem;
    padding: 0.4rem 0.6rem;
  }
}

@media (max-width: 900px) {
  .perfil-grid {
    grid-template-columns: 1fr;
  }

  .navbar {
    flex-wrap: wrap;
    padding: 0.7rem 1rem;
    gap: 0.5rem;
  }

  .nav-left {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  .nav-links {
    order: 3;
    width: 100%;
    justify-content: center;
    margin-top: 0.5rem;
  }

  .nav-user {
    margin-left: auto;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .mes-nav {
    width: 100%;
    flex-wrap: wrap;
    justify-content: center;
  }

  .mes-display {
    flex: 1;
    justify-content: center;
  }

  .cards {
    grid-template-columns: 1fr 1fr;
  }

  .pct-cards {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .tabela th, .tabela td {
    font-size: 0.7rem;
    padding: 0.3rem 0.5rem;
  }
}

@media (max-width: 480px) {
  .cards {
    grid-template-columns: 1fr;
  }

  .page-header h1 {
    font-size: 1.2rem;
  }

  .tabela th,
  .tabela td {
    padding: 0.45rem 0.55rem;
    font-size: 0.78rem;
  }

  .modal {
    padding: 1.3rem 1rem;
  }

  .login-box {
    padding: 1.6rem 1.2rem;
  }
}

/* ─────────────────────────────────────────
   MENU LATERAL RECOLHÍVEL - GLOBAL
   Alteração visual do menu principal
───────────────────────────────────────── */
:root {
  --sidebar-expanded-width: 200px;
  --sidebar-collapsed-width: 60px;
  --sidebar-bg: rgba(15, 23, 42, 0.96);
  --sidebar-border: rgba(51, 65, 85, 0.95);
  --sidebar-soft: rgba(30, 41, 59, 0.76);
  --sidebar-soft-hover: rgba(51, 65, 85, 0.78);
  --sidebar-active: rgba(37, 99, 235, 0.86);
  --sidebar-active-border: rgba(96, 165, 250, 0.58);
}

body:not(.login-page) {
  min-height: 100vh;
}

body:not(.login-page) .container {
  width: auto;
  max-width: none;
  margin-left: var(--sidebar-expanded-width);
  padding: 1.5rem;
  transition: margin-left 0.22s ease, padding 0.22s ease;
}

.financeiro-sidebar-collapsed body:not(.login-page) .container {
  margin-left: var(--sidebar-collapsed-width);
}

.navbar.financeiro-sidebar {
  position: fixed !important;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-expanded-width);
  height: 100vh;
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
  padding: 0.85rem 0.75rem;
  background:
    linear-gradient(180deg, rgba(30, 41, 59, 0.97), rgba(15, 23, 42, 0.98));
  border-right: 1px solid var(--sidebar-border);
  border-bottom: 0;
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.18);
  transition: width 0.22s ease, padding 0.22s ease, box-shadow 0.22s ease;
}

.financeiro-sidebar-collapsed .navbar.financeiro-sidebar {
  width: var(--sidebar-collapsed-width);
  padding-left: 0.55rem;
  padding-right: 0.55rem;
}

.financeiro-sidebar .nav-left {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.85rem;
}

.financeiro-sidebar .financeiro-sidebar-topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  min-height: 42px;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid rgba(51, 65, 85, 0.68);
}

.financeiro-sidebar .nav-brand {
  min-width: 0;
  flex: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.98rem;
  font-weight: 900;
  color: #f8fafc;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
}

.financeiro-sidebar .nav-brand-short {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.28);
  border: 1px solid rgba(96, 165, 250, 0.30);
  color: #dbeafe;
  font-weight: 900;
}

.financeiro-sidebar-collapsed .financeiro-sidebar .nav-brand {
  justify-content: center;
  flex: 0 0 auto;
}

.financeiro-sidebar-collapsed .financeiro-sidebar .nav-brand-full {
  display: none;
}

.financeiro-sidebar-collapsed .financeiro-sidebar .nav-brand-short {
  display: inline-flex;
}

.financeiro-sidebar .financeiro-sidebar-toggle {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 9px;
  background: rgba(100, 116, 139, 0.22);
  color: #e5edf8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: none;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.financeiro-sidebar .financeiro-sidebar-toggle:hover {
  background: rgba(100, 116, 139, 0.34);
  border-color: rgba(203, 213, 225, 0.42);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.20);
}

.financeiro-sidebar .financeiro-sidebar-toggle-icon {
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1;
  transform: translateY(-1px);
}

.financeiro-sidebar-collapsed .financeiro-sidebar .financeiro-sidebar-topo {
  justify-content: center;
}

.financeiro-sidebar-collapsed .financeiro-sidebar .financeiro-sidebar-toggle {
  position: absolute;
  top: 0.85rem;
  left: calc(var(--sidebar-collapsed-width) - 17px);
  z-index: 3;
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: 8px;
  background: rgba(100, 116, 139, 0.38);
}

.financeiro-sidebar .nav-links {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0.38rem;
  margin-top: 0.2rem;
  order: initial;
}

.financeiro-sidebar .nav-links a,
.financeiro-sidebar .nav-user-action {
  position: relative;
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.72rem;
  padding: 0.62rem 0.72rem;
  border-radius: 11px;
  background: transparent;
  border: 1px solid transparent;
  color: #cbd5e1;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.financeiro-sidebar .nav-links a:hover,
.financeiro-sidebar .nav-user-action:hover {
  background: var(--sidebar-soft-hover);
  border-color: rgba(96, 165, 250, 0.22);
  color: #f8fafc;
  transform: translateX(1px);
}

.financeiro-sidebar .nav-links a.active {
  background: var(--sidebar-active);
  border-color: var(--sidebar-active-border);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.18);
}

.financeiro-sidebar .nav-link-icon {
  width: 24px;
  min-width: 24px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  font-size: 1.05rem;
  line-height: 1;
}

.financeiro-sidebar .nav-link-text,
.financeiro-sidebar .nav-brand-full,
.financeiro-sidebar .nav-user-name,
.financeiro-sidebar .nav-user-exclamation {
  opacity: 1;
  transition: opacity 0.16s ease, width 0.16s ease;
}

.financeiro-sidebar-collapsed .financeiro-sidebar .nav-link-text,
.financeiro-sidebar-collapsed .financeiro-sidebar .nav-user-name,
.financeiro-sidebar-collapsed .financeiro-sidebar .nav-user-exclamation {
  width: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.financeiro-sidebar-collapsed .financeiro-sidebar .nav-links a,
.financeiro-sidebar-collapsed .financeiro-sidebar .nav-user-action {
  justify-content: center;
  padding-left: 0.45rem;
  padding-right: 0.45rem;
  gap: 0;
}

.financeiro-sidebar-collapsed .financeiro-sidebar .nav-links a::after,
.financeiro-sidebar-collapsed .financeiro-sidebar .nav-user-action::after {
  content: attr(data-menu-title);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: rgba(15, 23, 42, 0.98);
  color: #f8fafc;
  border: 1px solid rgba(96, 165, 250, 0.24);
  border-radius: 8px;
  padding: 0.42rem 0.62rem;
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  z-index: 980;
}

.financeiro-sidebar-collapsed .financeiro-sidebar .nav-links a:hover::after,
.financeiro-sidebar-collapsed .financeiro-sidebar .nav-user-action:hover::after {
  opacity: 1;
  visibility: visible;
}

.financeiro-sidebar .nav-user {
  width: 100%;
  margin-left: 0;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(51, 65, 85, 0.68);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.45rem;
  color: #94a3b8;
  font-size: 0.78rem;
  white-space: nowrap;
}

.financeiro-sidebar .nav-user-name {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 24px;
  padding: 0 0.4rem 0.25rem 0.4rem;
  overflow: hidden;
}

.financeiro-sidebar .nav-user-name strong {
  color: #dbeafe;
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.financeiro-sidebar .nav-user-prefix {
  color: #64748b;
  font-weight: 700;
}

.financeiro-sidebar .nav-user-action {
  margin: 0;
  min-width: 0;
  box-shadow: none !important;
  background: rgba(100, 116, 139, 0.16) !important;
  color: #cbd5e1 !important;
  border-color: rgba(148, 163, 184, 0.18) !important;
}

.financeiro-sidebar .nav-user-action:hover {
  background: rgba(100, 116, 139, 0.26) !important;
  border-color: rgba(203, 213, 225, 0.34) !important;
  color: #f8fafc !important;
}

.financeiro-sidebar-collapsed .financeiro-sidebar .nav-user {
  align-items: center;
}

.financeiro-sidebar-collapsed .financeiro-sidebar .nav-user-action {
  width: 44px;
  min-height: 42px;
}

body.login-page .container {
  margin-left: auto !important;
}

@media (max-width: 900px) {
  body:not(.login-page) .container {
    margin-left: var(--sidebar-collapsed-width);
    padding: 1rem;
  }

  .navbar.financeiro-sidebar {
    width: var(--sidebar-collapsed-width);
    padding-left: 0.55rem;
    padding-right: 0.55rem;
    flex-wrap: nowrap;
  }

  .financeiro-sidebar .nav-left {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: nowrap;
  }

  .financeiro-sidebar .nav-links {
    width: 100%;
    justify-content: flex-start;
    margin-top: 0.2rem;
    order: initial;
  }

  .financeiro-sidebar .nav-brand-full,
  .financeiro-sidebar .nav-link-text,
  .financeiro-sidebar .nav-user-name,
  .financeiro-sidebar .nav-user-exclamation {
    width: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
  }

  .financeiro-sidebar .nav-brand-short {
    display: inline-flex;
  }

  .financeiro-sidebar .nav-links a,
  .financeiro-sidebar .nav-user-action {
    justify-content: center;
    padding-left: 0.45rem;
    padding-right: 0.45rem;
    gap: 0;
  }

  .financeiro-sidebar .financeiro-sidebar-topo {
    justify-content: center;
  }

  .financeiro-sidebar .financeiro-sidebar-toggle {
    position: absolute;
    top: 0.85rem;
    left: calc(var(--sidebar-collapsed-width) - 17px);
    z-index: 3;
    width: 30px;
    height: 30px;
    min-width: 30px;
  }

  .financeiro-sidebar .nav-user {
    margin-left: 0;
    align-items: center;
  }
}

@media print {
  .navbar.financeiro-sidebar {
    display: none !important;
  }

  body:not(.login-page) .container {
    margin-left: 0 !important;
    padding: 0 !important;
  }
}

/* ─────────────────────────────────────────
   AJUSTE MENU RECOLHIDO - CF ACIMA DO BOTÃO
   Mantém o ícone ☰ abaixo do CF no menu recolhido
───────────────────────────────────────── */
.financeiro-sidebar-collapsed .financeiro-sidebar .financeiro-sidebar-topo {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 84px;
  padding-bottom: 0.8rem;
}

.financeiro-sidebar-collapsed .financeiro-sidebar .nav-brand {
  width: 100%;
  justify-content: center;
}

.financeiro-sidebar-collapsed .financeiro-sidebar .financeiro-sidebar-toggle {
  position: static;
  top: auto;
  left: auto;
  z-index: auto;
  width: 34px;
  height: 34px;
  min-width: 34px;
  margin-top: 0.1rem;
  border-radius: 9px;
}

@media (max-width: 900px) {
  .financeiro-sidebar .financeiro-sidebar-topo {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 84px;
    padding-bottom: 0.8rem;
  }

  .financeiro-sidebar .nav-brand {
    width: 100%;
    justify-content: center;
  }

  .financeiro-sidebar .financeiro-sidebar-toggle {
    position: static;
    top: auto;
    left: auto;
    z-index: auto;
    width: 34px;
    height: 34px;
    min-width: 34px;
    margin-top: 0.1rem;
    border-radius: 9px;
  }
}

/* ─────────────────────────────────────────
   PERFIL - CAMPOS DE SENHA
   Ajuste visual exclusivo dos campos senha_atual e nova_senha
───────────────────────────────────────── */
.form-section .form-grid .form-group:has(input[name="senha_atual"]),
.form-section .form-grid .form-group:has(input[name="nova_senha"]) {
  align-self: start;
  min-width: 0;
}

.form-section .form-grid .form-group:has(input[name="senha_atual"]) label,
.form-section .form-grid .form-group:has(input[name="nova_senha"]) label {
  min-height: 18px;
  margin-bottom: 0.45rem;
  color: #93c5fd;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.form-section .form-grid .form-group input[name="senha_atual"],
.form-section .form-grid .form-group input[name="nova_senha"] {
  width: 100%;
  min-height: 38px;
  background: rgba(15, 23, 42, 0.92) !important;
  border: 1px solid rgba(96, 165, 250, 0.24) !important;
  border-radius: 9px;
  padding: 0.58rem 0.78rem;
  color: #f8fafc !important;
  font-size: 0.9rem;
  line-height: 1.2;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.form-section .form-grid .form-group input[name="senha_atual"]::placeholder,
.form-section .form-grid .form-group input[name="nova_senha"]::placeholder {
  color: #64748b;
  opacity: 1;
}

.form-section .form-grid .form-group input[name="senha_atual"]:hover,
.form-section .form-grid .form-group input[name="nova_senha"]:hover {
  border-color: rgba(147, 197, 253, 0.38) !important;
  background: rgba(15, 23, 42, 0.96) !important;
}

.form-section .form-grid .form-group input[name="senha_atual"]:focus,
.form-section .form-grid .form-group input[name="nova_senha"]:focus {
  outline: none;
  border-color: rgba(96, 165, 250, 0.72) !important;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.18) !important;
}

.form-section .form-grid .form-group:has(input[name="senha_atual"]) small,
.form-section .form-grid .form-group:has(input[name="nova_senha"]) small {
  display: block;
  margin-top: 0.42rem;
  color: #94a3b8;
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.35;
}

.form-section .form-grid .form-group:has(input[name="senha_atual"]) .help-text,
.form-section .form-grid .form-group:has(input[name="nova_senha"]) .help-text,
.form-section .form-grid .form-group:has(input[name="senha_atual"]) .form-help,
.form-section .form-grid .form-group:has(input[name="nova_senha"]) .form-help {
  display: block;
  margin-top: 0.42rem;
  color: #94a3b8;
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.35;
}

@media (max-width: 900px) {
  .form-section .form-grid .form-group:has(input[name="senha_atual"]) label,
  .form-section .form-grid .form-group:has(input[name="nova_senha"]) label {
    white-space: normal;
  }
}

/* ─────────────────────────────────────────
   PERFIL - BOTÕES DE AÇÃO
   Ajuste exclusivo do grupo Salvar/Cancelar do formulário de perfil
───────────────────────────────────────── */
.form-section:has(input[name="senha_atual"]) .form-grid .form-btn {
  grid-column: 1 / -1;
  display: flex !important;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.15rem;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(51, 65, 85, 0.72);
}

.form-section:has(input[name="senha_atual"]) .form-grid .form-btn .btn,
.form-section:has(input[name="senha_atual"]) .form-grid .form-btn button,
.form-section:has(input[name="senha_atual"]) .form-grid .form-btn a {
  width: auto !important;
  min-width: 178px;
  max-width: 270px;
  min-height: 42px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.52rem;
  padding: 0.68rem 1.1rem !important;
  border-radius: 12px !important;
  font-size: 0.88rem;
  font-weight: 850;
  line-height: 1.1;
  letter-spacing: 0.005em;
  text-align: center;
  white-space: nowrap;
  flex: 0 0 auto;
  box-shadow: none !important;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, filter 0.18s ease;
}

.form-section:has(input[name="senha_atual"]) .form-grid .form-btn .btn-primary,
.form-section:has(input[name="senha_atual"]) .form-grid .form-btn button[type="submit"] {
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.92), rgba(59, 130, 246, 0.78)) !important;
  border: 1px solid rgba(147, 197, 253, 0.34) !important;
  color: #f8fafc !important;
}

.form-section:has(input[name="senha_atual"]) .form-grid .form-btn .btn-primary:hover,
.form-section:has(input[name="senha_atual"]) .form-grid .form-btn button[type="submit"]:hover {
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 1), rgba(96, 165, 250, 0.88)) !important;
  border-color: rgba(191, 219, 254, 0.50) !important;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.18) !important;
  transform: translateY(-1px);
}

.form-section:has(input[name="senha_atual"]) .form-grid .form-btn .btn-secondary,
.form-section:has(input[name="senha_atual"]) .form-grid .form-btn a.btn-secondary,
.form-section:has(input[name="senha_atual"]) .form-grid .form-btn button.btn-secondary {
  background: rgba(100, 116, 139, 0.20) !important;
  border: 1px solid rgba(148, 163, 184, 0.24) !important;
  color: #dbe3ef !important;
}

.form-section:has(input[name="senha_atual"]) .form-grid .form-btn .btn-secondary:hover,
.form-section:has(input[name="senha_atual"]) .form-grid .form-btn a.btn-secondary:hover,
.form-section:has(input[name="senha_atual"]) .form-grid .form-btn button.btn-secondary:hover {
  background: rgba(100, 116, 139, 0.32) !important;
  border-color: rgba(203, 213, 225, 0.40) !important;
  color: #f8fafc !important;
  box-shadow: 0 10px 24px rgba(100, 116, 139, 0.12) !important;
  transform: translateY(-1px);
}

.form-section:has(input[name="senha_atual"]) .form-grid .form-btn button[type="submit"]::before,
.form-section:has(input[name="senha_atual"]) .form-grid .form-btn .btn-primary::before {
  content: "✓";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
}

.form-section:has(input[name="senha_atual"]) .form-grid .form-btn .btn-secondary::before,
.form-section:has(input[name="senha_atual"]) .form-grid .form-btn a.btn-secondary::before,
.form-section:has(input[name="senha_atual"]) .form-grid .form-btn button.btn-secondary::before {
  content: "↩";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.12);
  color: #cbd5e1;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
}

.form-section:has(input[name="senha_atual"]) .form-grid .form-btn .btn:focus-visible,
.form-section:has(input[name="senha_atual"]) .form-grid .form-btn button:focus-visible,
.form-section:has(input[name="senha_atual"]) .form-grid .form-btn a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.22) !important;
}

@media (max-width: 720px) {
  .form-section:has(input[name="senha_atual"]) .form-grid .form-btn {
    justify-content: stretch;
    flex-direction: column;
    align-items: stretch;
  }

  .form-section:has(input[name="senha_atual"]) .form-grid .form-btn .btn,
  .form-section:has(input[name="senha_atual"]) .form-grid .form-btn button,
  .form-section:has(input[name="senha_atual"]) .form-grid .form-btn a {
    width: 100% !important;
    max-width: none;
  }
}

/* ─────────────────────────────────────────
   PERFIL - BOTÕES SALVAR/CANCELAR - CORREÇÃO FINAL
   Sem depender de :has(), aplicado na tela Meu Perfil
───────────────────────────────────────── */
.container > h1:first-child + .form-section form .form-btn,
.container > h1:first-child + .form-section form .form-actions,
.container > h1:first-child + .form-section form .actions,
.container > h1:first-child + .form-section form .botoes,
.container > h1:first-child + .form-section form .button-group {
  grid-column: 1 / -1 !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 0.75rem !important;
  width: 100% !important;
  margin-top: 1.15rem !important;
  padding-top: 1.1rem !important;
  border-top: 1px solid rgba(51, 65, 85, 0.72) !important;
}

.container > h1:first-child + .form-section form .form-btn .btn,
.container > h1:first-child + .form-section form .form-actions .btn,
.container > h1:first-child + .form-section form .actions .btn,
.container > h1:first-child + .form-section form .botoes .btn,
.container > h1:first-child + .form-section form .button-group .btn,
.container > h1:first-child + .form-section form .form-btn button,
.container > h1:first-child + .form-section form .form-actions button,
.container > h1:first-child + .form-section form .actions button,
.container > h1:first-child + .form-section form .botoes button,
.container > h1:first-child + .form-section form .button-group button,
.container > h1:first-child + .form-section form .form-btn a,
.container > h1:first-child + .form-section form .form-actions a,
.container > h1:first-child + .form-section form .actions a,
.container > h1:first-child + .form-section form .botoes a,
.container > h1:first-child + .form-section form .button-group a,
.container > h1:first-child + .form-section form > button[type="submit"],
.container > h1:first-child + .form-section form > a.btn,
.container > h1:first-child + .form-section form > .btn {
  width: auto !important;
  min-width: 154px !important;
  max-width: 240px !important;
  min-height: 40px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.48rem !important;
  padding: 0.62rem 1.05rem !important;
  border-radius: 12px !important;
  font-size: 0.86rem !important;
  font-weight: 850 !important;
  line-height: 1.1 !important;
  text-align: center !important;
  white-space: nowrap !important;
  flex: 0 0 auto !important;
  box-shadow: none !important;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, filter 0.18s ease !important;
}

.container > h1:first-child + .form-section form .btn-primary,
.container > h1:first-child + .form-section form button[type="submit"] {
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.92), rgba(59, 130, 246, 0.78)) !important;
  border: 1px solid rgba(147, 197, 253, 0.34) !important;
  color: #f8fafc !important;
}

.container > h1:first-child + .form-section form .btn-primary:hover,
.container > h1:first-child + .form-section form button[type="submit"]:hover {
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 1), rgba(96, 165, 250, 0.88)) !important;
  border-color: rgba(191, 219, 254, 0.50) !important;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.18) !important;
  transform: translateY(-1px) !important;
}

.container > h1:first-child + .form-section form .btn-secondary,
.container > h1:first-child + .form-section form a.btn-secondary,
.container > h1:first-child + .form-section form button.btn-secondary {
  background: rgba(100, 116, 139, 0.20) !important;
  border: 1px solid rgba(148, 163, 184, 0.24) !important;
  color: #dbe3ef !important;
}

.container > h1:first-child + .form-section form .btn-secondary:hover,
.container > h1:first-child + .form-section form a.btn-secondary:hover,
.container > h1:first-child + .form-section form button.btn-secondary:hover {
  background: rgba(100, 116, 139, 0.32) !important;
  border-color: rgba(203, 213, 225, 0.40) !important;
  color: #f8fafc !important;
  box-shadow: 0 10px 24px rgba(100, 116, 139, 0.12) !important;
  transform: translateY(-1px) !important;
}

.container > h1:first-child + .form-section form button[type="submit"]::before,
.container > h1:first-child + .form-section form .btn-primary::before {
  content: "✓";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
}

.container > h1:first-child + .form-section form .btn-secondary::before,
.container > h1:first-child + .form-section form a.btn-secondary::before,
.container > h1:first-child + .form-section form button.btn-secondary::before {
  content: "↩";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.12);
  color: #cbd5e1;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
}

.container > h1:first-child + .form-section form .btn:focus-visible,
.container > h1:first-child + .form-section form button:focus-visible,
.container > h1:first-child + .form-section form a:focus-visible {
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.22) !important;
}

@media (max-width: 720px) {
  .container > h1:first-child + .form-section form .form-btn,
  .container > h1:first-child + .form-section form .form-actions,
  .container > h1:first-child + .form-section form .actions,
  .container > h1:first-child + .form-section form .botoes,
  .container > h1:first-child + .form-section form .button-group {
    justify-content: stretch !important;
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .container > h1:first-child + .form-section form .form-btn .btn,
  .container > h1:first-child + .form-section form .form-actions .btn,
  .container > h1:first-child + .form-section form .actions .btn,
  .container > h1:first-child + .form-section form .botoes .btn,
  .container > h1:first-child + .form-section form .button-group .btn,
  .container > h1:first-child + .form-section form .form-btn button,
  .container > h1:first-child + .form-section form .form-actions button,
  .container > h1:first-child + .form-section form .actions button,
  .container > h1:first-child + .form-section form .botoes button,
  .container > h1:first-child + .form-section form .button-group button,
  .container > h1:first-child + .form-section form .form-btn a,
  .container > h1:first-child + .form-section form .form-actions a,
  .container > h1:first-child + .form-section form .actions a,
  .container > h1:first-child + .form-section form .botoes a,
  .container > h1:first-child + .form-section form .button-group a,
  .container > h1:first-child + .form-section form > button[type="submit"],
  .container > h1:first-child + .form-section form > a.btn,
  .container > h1:first-child + .form-section form > .btn {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
  }
}

/* ─────────────────────────────────────────
   PERFIL - BOTÕES SALVAR/CANCELAR - APLICAÇÃO REAL
   JS do base.html move os botões para este wrapper apenas na rota /perfil
───────────────────────────────────────── */
.perfil-acoes-inline-modernas {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 0.72rem !important;
  margin-top: 1.2rem !important;
  padding-top: 1.05rem !important;
  border-top: 1px solid rgba(51, 65, 85, 0.72) !important;
}

.perfil-acoes-inline-modernas .btn,
.perfil-acoes-inline-modernas button,
.perfil-acoes-inline-modernas a,
.perfil-acoes-inline-modernas input[type="submit"],
.perfil-acoes-inline-modernas input[type="button"] {
  width: auto !important;
  min-width: 148px !important;
  max-width: 230px !important;
  min-height: 40px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.48rem !important;
  padding: 0.62rem 1.05rem !important;
  border-radius: 12px !important;
  font-size: 0.86rem !important;
  font-weight: 850 !important;
  line-height: 1.1 !important;
  text-align: center !important;
  white-space: nowrap !important;
  flex: 0 0 auto !important;
  box-shadow: none !important;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, filter 0.18s ease !important;
}

.perfil-acoes-inline-modernas .perfil-btn-salvar-moderno {
  min-width: 210px !important;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.92), rgba(59, 130, 246, 0.78)) !important;
  border: 1px solid rgba(147, 197, 253, 0.34) !important;
  color: #f8fafc !important;
}

.perfil-acoes-inline-modernas .perfil-btn-salvar-moderno:hover {
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 1), rgba(96, 165, 250, 0.88)) !important;
  border-color: rgba(191, 219, 254, 0.50) !important;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.18) !important;
  transform: translateY(-1px) !important;
}

.perfil-acoes-inline-modernas .perfil-btn-cancelar-moderno {
  min-width: 138px !important;
  background: rgba(100, 116, 139, 0.20) !important;
  border: 1px solid rgba(148, 163, 184, 0.24) !important;
  color: #dbe3ef !important;
}

.perfil-acoes-inline-modernas .perfil-btn-cancelar-moderno:hover {
  background: rgba(100, 116, 139, 0.32) !important;
  border-color: rgba(203, 213, 225, 0.40) !important;
  color: #f8fafc !important;
  box-shadow: 0 10px 24px rgba(100, 116, 139, 0.12) !important;
  transform: translateY(-1px) !important;
}

.perfil-acoes-inline-modernas .perfil-btn-salvar-moderno::before {
  content: "✓";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
}

.perfil-acoes-inline-modernas .perfil-btn-cancelar-moderno::before {
  content: "↩";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.12);
  color: #cbd5e1;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
}

.perfil-acoes-inline-modernas .btn:focus-visible,
.perfil-acoes-inline-modernas button:focus-visible,
.perfil-acoes-inline-modernas a:focus-visible,
.perfil-acoes-inline-modernas input:focus-visible {
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.22) !important;
}

@media (max-width: 720px) {
  .perfil-acoes-inline-modernas {
    justify-content: stretch !important;
    flex-direction: column-reverse !important;
    align-items: stretch !important;
  }

  .perfil-acoes-inline-modernas .btn,
  .perfil-acoes-inline-modernas button,
  .perfil-acoes-inline-modernas a,
  .perfil-acoes-inline-modernas input[type="submit"],
  .perfil-acoes-inline-modernas input[type="button"],
  .perfil-acoes-inline-modernas .perfil-btn-salvar-moderno,
  .perfil-acoes-inline-modernas .perfil-btn-cancelar-moderno {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
  }
}

/* ─────────────────────────────────────────
   MENU LATERAL - 20% MAIS FINO + SAIR MELHORADO
   Mantém melhorias anteriores e ajusta somente largura/ações inferiores
───────────────────────────────────────── */
:root {
  --sidebar-expanded-width: 202px;
  --sidebar-collapsed-width: 58px;
}

.financeiro-sidebar-collapsed .navbar.financeiro-sidebar {
  padding-left: 0.45rem;
  padding-right: 0.45rem;
}

.financeiro-sidebar-collapsed .financeiro-sidebar .nav-links a,
.financeiro-sidebar-collapsed .financeiro-sidebar .nav-user-action {
  width: 40px;
  min-height: 40px;
  padding-left: 0.38rem;
  padding-right: 0.38rem;
  border-radius: 10px;
}

.financeiro-sidebar-collapsed .financeiro-sidebar .nav-user-action {
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
}

.financeiro-sidebar-collapsed .financeiro-sidebar .nav-link-icon {
  width: 22px;
  min-width: 22px;
  font-size: 1rem;
}

.financeiro-sidebar-collapsed .financeiro-sidebar .nav-brand-short {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  font-size: 0.84rem;
}

.financeiro-sidebar-collapsed .financeiro-sidebar .financeiro-sidebar-toggle {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 9px;
}

.financeiro-sidebar-collapsed .financeiro-sidebar .financeiro-sidebar-topo {
  min-height: 78px;
  gap: 0.42rem;
}

.financeiro-sidebar .nav-user {
  gap: 0.52rem;
}

.financeiro-sidebar .nav-user-action[href*="perfil"] {
  background: rgba(124, 58, 237, 0.14) !important;
  border-color: rgba(167, 139, 250, 0.20) !important;
  color: #ddd6fe !important;
}

.financeiro-sidebar .nav-user-action[href*="perfil"]:hover {
  background: rgba(124, 58, 237, 0.24) !important;
  border-color: rgba(196, 181, 253, 0.36) !important;
  color: #f5f3ff !important;
}

.financeiro-sidebar .nav-user-action[href*="logout"] {
  background: rgba(239, 68, 68, 0.12) !important;
  border-color: rgba(248, 113, 113, 0.20) !important;
  color: #fecaca !important;
}

.financeiro-sidebar .nav-user-action[href*="logout"]:hover {
  background: rgba(239, 68, 68, 0.22) !important;
  border-color: rgba(252, 165, 165, 0.38) !important;
  color: #fff1f2 !important;
  box-shadow: 0 10px 24px rgba(239, 68, 68, 0.12) !important;
}

.financeiro-sidebar .nav-user-action[href*="logout"] .nav-link-icon {
  font-size: 0;
}

.financeiro-sidebar .nav-user-action[href*="logout"] .nav-link-icon::before {
  content: "↪";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(248, 113, 113, 0.14);
  color: #fecaca;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
  transform: rotate(180deg);
}

.financeiro-sidebar .nav-user-action[href*="logout"]:hover .nav-link-icon::before {
  background: rgba(248, 113, 113, 0.22);
  color: #ffffff;
}

.financeiro-sidebar-collapsed .financeiro-sidebar .nav-user {
  gap: 0.48rem;
}

.financeiro-sidebar-collapsed .financeiro-sidebar .nav-user-action[href*="perfil"],
.financeiro-sidebar-collapsed .financeiro-sidebar .nav-user-action[href*="logout"] {
  border-radius: 11px;
}

@media (max-width: 900px) {
  .navbar.financeiro-sidebar {
    width: var(--sidebar-collapsed-width);
    padding-left: 0.45rem;
    padding-right: 0.45rem;
  }

  body:not(.login-page) .container {
    margin-left: var(--sidebar-collapsed-width);
  }

  .financeiro-sidebar .nav-links a,
  .financeiro-sidebar .nav-user-action {
    width: 40px;
    min-height: 40px;
    padding-left: 0.38rem;
    padding-right: 0.38rem;
    border-radius: 10px;
  }

  .financeiro-sidebar .nav-user-action {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
  }

  .financeiro-sidebar .nav-brand-short {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    font-size: 0.84rem;
  }

  .financeiro-sidebar .financeiro-sidebar-toggle {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 9px;
  }

  .financeiro-sidebar .financeiro-sidebar-topo {
    min-height: 78px;
    gap: 0.42rem;
  }
}

