/* Camada visual compartilhada: hierarquia discreta e leitura de números. */
:root {
  --primary: #173b4b;
  --primary-dark: #102b38;
  --primary-light: #e7eef1;
  --sidebar-bg: #152d38;
  --sidebar-w: 232px;
  --success: #157558;
  --success-light: #e7f3ed;
  --danger: #bc4143;
  --danger-light: #fcebec;
  --warning: #a36518;
  --warning-light: #faf0dc;
  --radius: 8px;
  --gray-400: #748395;
  --shadow: 0 1px 2px rgba(27, 47, 62, .035);
}
body { background: #f4f6f8; color: #243746; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
button:focus-visible, a:focus-visible { outline: 3px solid #4085a1; outline-offset: 3px; }
.sidebar { box-shadow: none; border: 0; }
.sidebar-header { padding: 23px 19px; }
.sidebar-brand .brand-icon { background: #244551; border: 0; }
.sidebar-brand .brand-text strong { font-weight: 700; letter-spacing: -.025em; font-size: 1.12rem; }
.sidebar-brand .brand-text span { color: #acbdc6; font-size: .7rem; }
.sidebar-nav { padding: 4px 12px 20px; }
.nav-section { color: #8fa7b2; font-weight: 600; font-size: .63rem; letter-spacing: .1em; margin-top: 18px; margin-bottom: 2px; padding: 0 10px 5px; }
.nav-item { margin: 2px 0; list-style: none; }
.nav-link { padding: 9px 11px; gap: 9px; border-radius: 5px; color: #c0cdd4; font-size: .84rem; font-weight: 500; }
.nav-link .nav-icon { font-size: 19px; width: 23px; color: #a4bbc6; }
.nav-link:hover { background: #203e4c; }
.nav-link.active { background: #2c4c5b; box-shadow: inset 3px 0 0 #88b9c8; }
.nav-link.active .nav-icon { color: #e2f3f7; }
.user-details span { color: #9fb1bd; }
.user-avatar { background: #365360; }
.btn-logout { color: #b0c0c8; }
.topbar { height: 74px; padding: 0 30px; box-shadow: none; }
.topbar-title h2 { font-size: 1.1rem; }
.topbar-title p { color: #607284; font-size: .75rem; }
.topbar-title { min-width: 0; }
.page-content { padding: 26px 30px 38px; width: 100%; max-width: 1680px; margin: 0 auto; }
.card, .table-wrapper, .stat-card { border: 1px solid #dde4e9; box-shadow: var(--shadow); }
.card-header { background: #fff; padding: 17px 20px; }
.card-header h3 { color: #283e4e; font-size: .91rem; text-transform: none; letter-spacing: -.015em; }
.card-caption { font-size: .72rem; color: #607284; margin-top: 3px; }
.card-body { min-width: 0; }
.charts-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; margin-bottom: 18px; }
.charts-grid > .card { min-width: 0; }
.painel-grafico { position: relative; height: 255px; width: 100%; min-width: 0; }
.btn { border-radius: 5px; font-weight: 600; font-size: .82rem; min-height: 36px; }
.btn-primary { background: var(--primary); }
.btn-secondary, .btn-outline { border: 1px solid #d3dde4; background: #fff; color: #304856; }
.btn-secondary:hover, .btn-outline:hover { background: #edf2f5; }
.form-control, .filter-select, .search-box input { min-height: 38px; border-color: #cbd6df; border-radius: 5px; }
.form-control:focus, .filter-select:focus, .search-box input:focus { border-color: #487d92; box-shadow: 0 0 0 3px #e4eef2; }
.form-group label { font-size: .8rem; text-transform: none; letter-spacing: 0; }
.page-toolbar { flex-wrap: wrap; gap: 10px; }
.page-toolbar > *, .caixa-section, .caixa-section-header, .caixa-section-filters { min-width: 0; }
.table-responsive { max-width: 100%; overscroll-behavior-x: contain; }
table { font-size: .82rem; }
thead th { color: #526575; font-weight: 600; font-size: .73rem; letter-spacing: .025em; background: #f7f9fa; }
tbody td { border-color: #edf1f4; }
tbody tr:hover { background: #f7fafb; }
.stat-value, .caixa-kpi-value, .cc-valor, td.nao-quebra { font-variant-numeric: tabular-nums; }
.stat-card { border-left-width: 1px; padding: 18px; border-color: #dde4e9 !important; }
.stat-card:hover { transform: none; box-shadow: var(--shadow); }
.stat-label { text-transform: none; letter-spacing: 0; font-weight: 500; color: #526575; font-size: .78rem; }
.stat-value { font-size: clamp(1.15rem, 1.6vw, 1.65rem); font-weight: 650; letter-spacing: -.045em; line-height: 1.35; }
.stat-sub { color: #657789; font-size: .71rem; line-height: 1.5; margin-top: 5px; }
.stat-icon { width: 35px; height: 35px; font-size: 21px; border-radius: 7px; }
.modal { border-radius: 10px; box-shadow: 0 16px 65px #0e283b30; }
.modal-header { background: #fff; border-bottom: 1px solid #e4eaf0; }
.modal-header h3 { font-size: 1.05rem; }
.modal-footer { background: #f8fafb; }
.modal-body { overscroll-behavior: contain; }
.painel-intro { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.section-eyebrow { color: #527180; font-size: .65rem; font-weight: 650; letter-spacing: .13em; }
.painel-intro h1 { font-size: clamp(1.45rem, 2.3vw, 1.95rem); font-weight: 600; letter-spacing: -.045em; color: #213e4e; margin: 5px 0; }
.painel-intro p { font-size: .83rem; color: #617482; }
.painel-data { text-align: right; color: #385566; font-size: .86rem; font-weight: 600; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.painel-data small { display: block; color: #6b7d89; font-size: .68rem; font-weight: 400; }
.painel-atalhos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.painel-atalhos button { display: flex; align-items: center; gap: 12px; text-align: left; padding: 15px; border: 1px solid #d5e0e5; border-radius: 7px; background: #fff; color: #264a5a; transition: background .15s; }
.painel-atalhos button:hover { background: #eaf1f4; border-color: #789baa; }
.painel-atalhos button > i:first-child { font-size: 23px; }
.painel-atalhos button > i:last-child { margin-left: auto; font-size: 16px; color: #73909e; }
.painel-atalhos strong, .painel-atalhos small { display: block; }
.painel-atalhos strong { font-size: .81rem; font-weight: 600; }
.painel-atalhos small { font-size: .69rem; color: #617482; margin-top: 2px; }
.dash-caixa-status { border-radius: 6px; font-size: .74rem; padding: 11px 14px; margin-bottom: 25px; }
.dash-caixa-status.aberto { background: #edf5f0; border: 1px solid #ccdfd3; color: #386650; }
.dash-caixa-status.nao-aberto { background: #faf5e9; border: 1px solid #e7dac0; }
.dash-status-label { font-size: .7rem; letter-spacing: .025em; font-weight: 600; }
.dash-status-fin { font-size: .73rem; }
.painel-section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 24px 0 12px; }
.painel-section-heading h2 { font-size: .98rem; font-weight: 600; color: #2b4554; letter-spacing: -.02em; }
.painel-section-heading span { color: #697d8b; font-size: .72rem; }
.dash-kpi-financeiro { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.dash-kpi-financeiro .stat-card { display: block; position: relative; padding: 19px 16px; }
.dash-kpi-financeiro .stat-icon { position: absolute; top: 15px; right: 13px; width: 25px; height: 25px; font-size: 16px; background: none; opacity: .7; }
.dash-kpi-financeiro .stat-label { padding-right: 24px; }
.dash-kpi-financeiro .stat-value { margin-top: 13px; }
.painel-atencao { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid #dde4e9; border-radius: 8px; background: white; margin-bottom: 26px; overflow: hidden; }
.painel-pendencia { display: flex; align-items: flex-start; gap: 10px; padding: 16px; text-align: left; background: transparent; border: 0; border-right: 1px solid #e5ebee; border-bottom: 1px solid #e5ebee; color: #3d5563; }
.painel-pendencia:hover { background: #f1f6f8; }
.painel-pendencia .stat-value { font-size: 1.1rem; letter-spacing: -.02em; }
.painel-pendencia .stat-icon { background: #f0f4f6; color: #547687; width: 30px; height: 30px; font-size: 18px; }
.painel-pendencia:last-child { grid-column: span 2; }
.preview-label { display: none; background: #28434f; color: #d2e3eb; padding: 9px; margin-bottom: 12px; border-radius: 4px; font-size: .62rem; letter-spacing: .07em; }
.preview-label small { display: block; font-size: .65rem; letter-spacing: 0; color: #a8bfcb; margin-top: 2px; }
.ambiente-demonstracao .preview-label { display: block; }
#login-screen { background: #e9eff2; }
.login-card { border: 1px solid #d7e1e6; border-top: 4px solid #2e5869; box-shadow: 0 12px 48px #16384912; }
.login-logo .logo-icon { background: #e9f0f3; box-shadow: none; color: #31586b; }
@media (max-width: 1200px) {
  .page-content { padding: 22px; }
  .dash-kpi-financeiro { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .painel-atalhos small { display: none; }
  .charts-grid { grid-template-columns: minmax(0, 1fr); }
  .painel-atencao { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .painel-pendencia:last-child { grid-column: span 2; }
  .dash-status-fin { display: none; }
}
@media (max-width: 768px) {
  .main-wrapper { margin-left: 0; width: 100%; }
  .topbar { padding: 12px 14px; height: auto; min-height: 65px; gap: 10px; }
  .topbar-title p { display: none; }
  .topbar-title h2 { font-size: .95rem; }
  .topbar-actions .btn { font-size: .73rem; padding: 8px 9px; }
  .page-content { padding: 18px 14px 30px; }
  .painel-intro { margin-bottom: 17px; }
  .painel-data { display: none; }
  .painel-atalhos { gap: 7px; }
  .painel-atalhos button { flex-direction: column; align-items: flex-start; padding: 12px 9px; gap: 8px; }
  .painel-atalhos button > i:last-child { display: none; }
  .painel-atalhos strong { font-size: .72rem; line-height: 1.4; }
  .painel-section-heading { flex-direction: column; gap: 3px; }
  .dash-kpi-financeiro { gap: 9px; }
  .dash-kpi-financeiro .stat-card { padding: 14px 12px; }
  .dash-kpi-financeiro .stat-icon { display: none; }
  .dash-kpi-financeiro .stat-label { padding-right: 0; font-size: .72rem; }
  .stat-value { font-size: 1.2rem; }
  .painel-pendencia { padding: 12px; gap: 7px; }
  .painel-pendencia .stat-icon { display: none; }
  .card-header { padding: 15px; flex-wrap: wrap; }
  .card-body { padding: 15px; }
  .modal { max-width: calc(100vw - 20px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; scroll-behavior: auto !important; transition: none !important; }
}

/* Avisos não podem engolir o clique em Salvar/Concluir no rodapé do modal. */
.toast-container > .toast { pointer-events: none; }
.toast-container .toast-close,
.toast-container a { pointer-events: auto; }
body:has(.modal-overlay.show) .toast-container { top: 10px; bottom: auto; }
@media (max-width: 600px) {
  .toast-container { right: 10px; left: 10px; }
  .toast { min-width: 0; max-width: 100%; }
}
