  :root {
    --ink: #16191D; --ink-2: #1E2227; --ink-3: #2A2F36;
    --paper: #F5F5F3; --surface: #FFFFFF;
    --line: #E1E1DC; --line-soft: #ECEBE7;
    --text: #1D2024; --text-dim: #6B7078; --text-faint: #9CA0A8;
    --accent: #2FAE59; --accent-2: #248C46; --accent-tint: #E4F7EA;
    --money-in: #2F7D4F; --money-in-tint: #E3F1E7;
    --money-out: #A85D22; --money-out-tint: #F5E9DC;
    --gold: #B8862E; --gold-tint: #F2E7D2;
    --danger: #A6392E; --danger-tint: #F6E1DD;
    --radius: 4px;
  }
  * { box-sizing: border-box; }
  html, body { height: 100%; margin: 0; }
  body { font-family: 'IBM Plex Sans', sans-serif; background: var(--paper); color: var(--text); padding-top: env(safe-area-inset-top,0px); padding-bottom: env(safe-area-inset-bottom,0px); -webkit-font-smoothing: antialiased; }
  h1,h2,h3,.brand { font-family: 'Fraunces', serif; letter-spacing: -0.01em; }
  .mono { font-family: 'IBM Plex Mono', monospace; }
  a { color: inherit; } button { font-family: inherit; cursor: pointer; }
  svg.icon { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.6; flex-shrink: 0; }

  #login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 20% 20%, rgba(44,99,172,0.16), transparent 45%), var(--ink); color: #EDEDEA; padding: 24px; }
  .login-card { width: 100%; max-width: 380px; background: var(--ink-2); border: 1px solid var(--ink-3); border-radius: 6px; padding: 40px 36px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.5); }
  .login-mark { width: 38px; height: 38px; border: 1.4px solid #3A414C; border-radius: 4px; display: flex; align-items: center; justify-content: center; margin-bottom: 18px; font-family: 'Fraunces', serif; font-size: 17px; color: var(--accent-2); }
  .login-card .brand { font-size: 25px; margin: 0 0 3px; color: #F4F3EE; font-weight: 600; }
  .login-card .tag { font-size: 13px; color: #838B96; margin: 0 0 30px; }
  .field { margin-bottom: 16px; } .field label { display: block; font-size: 12px; color: #8B92A0; margin-bottom: 6px; }
  .field input { width: 100%; padding: 11px 13px; background: #0F1216; border: 1px solid #333A44; border-radius: var(--radius); color: #EDEDEA; font-size: 14px; }
  .field input:focus { outline: none; border-color: var(--accent-2); }
  .btn-primary { width: 100%; padding: 12px; background: var(--accent); color: #fff; border: none; border-radius: var(--radius); font-size: 14px; font-weight: 500; margin-top: 8px; }
  .btn-primary:hover { background: var(--accent-2); }
  .login-error { color: #DE9280; font-size: 12.5px; margin-top: 14px; min-height: 16px; line-height: 1.5; }

  #app-screen { display: none; min-height: 100vh; } #app-screen.active { display: flex; }
  #app-screen.pdv-collapsed #sidebar { display: none; }
  .pdv-sidebar-toggle { background: none; border: none; color: #EDEDEA; padding: 4px; margin-right: 4px; }
  .pdv-sidebar-toggle:hover { color: var(--accent-2); }
  #sidebar { width: 232px; flex-shrink: 0; background: var(--ink); color: #B7BBC2; display: flex; flex-direction: column; padding: 24px 16px; padding-top: calc(24px + env(safe-area-inset-top,0px)); }
  #sidebar .brand-row { display: flex; align-items: center; gap: 9px; padding: 0 6px 26px; }
  #sidebar .brand-row .mark { width: 26px; height: 26px; border: 1.2px solid #3A414C; border-radius: 4px; display: flex; align-items: center; justify-content: center; font-family: 'Fraunces', serif; font-size: 13px; color: var(--accent-2); flex-shrink: 0; }
  #sidebar .brand-row .brand { color: #F4F3EE; font-size: 17px; font-weight: 600; }
  #sidebar nav { display: flex; flex-direction: column; gap: 1px; flex: 1; overflow-y: auto; }
  #sidebar .nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: #545A63; padding: 14px 10px 6px; }
  #sidebar nav button { display: flex; align-items: center; gap: 10px; text-align: left; background: none; border: none; color: #9BA0A9; padding: 8px 10px; border-radius: var(--radius); font-size: 13px; }
  #sidebar nav button:hover { background: var(--ink-2); color: #EDEDEA; }
  #sidebar nav button.active { background: var(--accent); color: #fff; }
  #sidebar nav button.disabled { opacity: .42; cursor: default; } #sidebar nav button.disabled:hover { background: none; color: #9BA0A9; }
  #sidebar nav button .badge { margin-left: auto; font-size: 9.5px; background: var(--ink-3); color: #9BA0A9; padding: 1px 6px; border-radius: 8px; }
  #sidebar .cash-chip { display: flex; align-items: center; gap: 7px; font-size: 11px; padding: 7px 10px; margin: 6px 0 0; border-radius: var(--radius); background: var(--ink-2); }
  #sidebar .cash-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint); }
  #sidebar .cash-chip.open .dot { background: #59B37D; } #sidebar .cash-chip.open { color: #9FE0B8; }
  /* Base do círculo de iniciais reaproveitado em vários lugares (sidebar, PDV,
     cartão de contato selecionado, cartões de conta bancária) — cada contexto só
     precisa sobrescrever width/height/font-size, o resto já vem daqui. */
  .avatar { border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; flex-shrink: 0; }
  #sidebar .user-chip { display: flex; align-items: center; gap: 9px; border-top: 1px solid var(--ink-3); padding: 14px 8px 0; margin-top: 10px; }
  #sidebar .user-chip .avatar { width: 28px; height: 28px; font-size: 12px; }
  #sidebar .user-chip .who { font-size: 12px; line-height: 1.3; overflow: hidden; }
  #sidebar .user-chip .who .name { color: #E4E3DD; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #sidebar .user-chip .who .role { color: #6E7580; font-size: 11px; text-transform: capitalize; }
  #logout-btn { margin-top: 10px; width: 100%; background: none; border: 1px solid var(--ink-3); color: #9BA0A9; padding: 7px; border-radius: var(--radius); font-size: 12px; }
  #logout-btn:hover { border-color: #4A5158; color: #EDEDEA; }

  #main { flex: 1; padding: 30px 40px 60px; overflow-x: auto; }
  .page-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 26px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
  .page-head h1 { font-size: 24px; margin: 0; font-weight: 600; } .page-head p { color: var(--text-dim); font-size: 13px; margin: 5px 0 0; }
  .head-actions { display: flex; gap: 10px; align-items: center; }

  .btn { padding: 9px 16px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 500; color: var(--text); transition: all .15s ease; }
  .btn:hover { border-color: var(--accent); color: var(--accent); }
  .btn:active { transform: translateY(1px); }
  .btn-solid { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 3px 10px -4px rgba(47,174,89,.5); }
  .btn-solid:hover { background: var(--accent-2); border-color: var(--accent-2); color: #fff; box-shadow: 0 5px 14px -4px rgba(47,174,89,.6); transform: translateY(-1px); }
  .btn-solid:active { transform: translateY(0); }
  /* Botão de destaque (CTA) — pro comando principal de uma tela: maior, mais chamativo, mesma
     cor/padrão em qualquer contexto (ex: "+ Nova conta a pagar" e "+ Nova conta a receber" usam
     o mesmo btn-lg, de propósito, em vez da distinção money-in/money-out — pedido explícito do
     usuário pra essas duas ações específicas terem "mesmo padrão e mesma cor"). */
  .btn-lg { padding: 12px 22px; font-size: 14px; font-weight: 600; border-radius: 7px; letter-spacing: .01em; }
  .btn-money-in { background: var(--money-in-tint); color: var(--money-in); border-color: var(--money-in-tint); } .btn-money-in:hover { background: var(--money-in); color: #fff; }
  .btn-money-out { background: var(--money-out-tint); color: var(--money-out); border-color: var(--money-out-tint); } .btn-money-out:hover { background: var(--money-out); color: #fff; }
  .btn-danger-outline { border-color: var(--danger-tint); color: var(--danger); } .btn-danger-outline:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
  /* Abas em formato de pílula — padrão único pra toda barra de abas do sistema (Financeiro,
     Configurações, sub-abas de Contas, extrato de Bancos, editor de Etiquetas/Produtos…): mesmo
     visual, mesmo hover, mesmo destaque de "ativa" em qualquer tela. */
  .fin-tab, .cfg-tab, .contas-subtab, .ledger-mov-tab, #ledger-filtros-btn, #contas-filtros-btn {
    border-radius: 20px; padding: 9px 18px;
  }
  .fin-tab:hover, .cfg-tab:hover, .contas-subtab:hover, .ledger-mov-tab:hover, #ledger-filtros-btn:hover, #contas-filtros-btn:hover {
    background: var(--accent-tint); border-color: var(--accent-tint); color: var(--accent-2);
  }
  .fin-tab.active, .cfg-tab.active, .contas-subtab.active, .ledger-mov-tab.active, #ledger-filtros-btn.active, #contas-filtros-btn.active {
    background: var(--ink); color: #fff; border-color: var(--ink);
    box-shadow: 0 4px 12px -5px rgba(22,25,29,.5);
  }
  .fin-tab.active:hover, .cfg-tab.active:hover, .contas-subtab.active:hover, .ledger-mov-tab.active:hover, #ledger-filtros-btn.active:hover, #contas-filtros-btn.active:hover {
    background: var(--ink-2); border-color: var(--ink-2); color: #fff;
  }
  .prod-editor-head { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 20px 24px; margin-bottom: 18px; }
  .prod-editor-head h2 { margin: 0 0 4px; font-size: 19px; }
  .prod-editor-head .sub { font-size: 12px; color: var(--text-faint); margin-bottom: 16px; }
  .img-url-row { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 8px; background: var(--surface); }
  .img-url-row .handle { color: var(--text-faint); cursor: grab; }
  .img-url-row img.preview { width: 44px; height: 44px; object-fit: cover; border-radius: 3px; border: 1px solid var(--line); background: var(--paper); }
  .img-url-row input { flex: 1; }
  .url-badge { font-size: 10.5px; padding: 2px 7px; border-radius: 8px; white-space: nowrap; }
  .url-badge.ok { background: var(--money-in-tint); color: var(--money-in); }
  .url-badge.bad { background: var(--danger-tint); color: var(--danger); }
  .url-badge.checking { background: var(--line-soft); color: var(--text-faint); }
  .tag-input-box { display: flex; flex-wrap: wrap; gap: 6px; border: 1px solid var(--line); border-radius: var(--radius); padding: 7px; background: var(--paper); min-height: 40px; align-items: center; }
  .tag-chip { background: var(--accent-tint); color: var(--accent); font-size: 12px; padding: 3px 8px; border-radius: 12px; display: flex; align-items: center; gap: 5px; }
  .tag-chip button { background: none; border: none; color: var(--accent); font-size: 12px; padding: 0; }
  .tag-input-box input { border: none; background: none; flex: 1; min-width: 80px; padding: 4px; }
  .tag-input-box input:focus { outline: none; }
  .dash-grid { display: grid; grid-template-columns: 260px 1fr; gap: 20px; align-items: start; }
  .dash-greet { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 20px; margin-bottom: 16px; }
  .dash-greet .avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; margin-bottom: 10px; }
  .dash-greet .name { font-family: 'Fraunces', serif; font-size: 17px; } .dash-greet .email { font-size: 12px; color: var(--text-dim); }
  .dash-shortcuts { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 8px; }
  .dash-shortcuts .stitle { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); padding: 10px 12px 6px; }
  .dash-shortcuts button { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; padding: 9px 12px; background: none; border: none; font-size: 13px; color: var(--text); border-radius: var(--radius); }
  .dash-shortcuts button:hover { background: var(--accent-tint); color: var(--accent); }
  .dash-summary { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 14px; margin-bottom: 22px; }
  .dash-card { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 18px 20px; }
  .dash-card .dc-title { font-size: 12.5px; font-weight: 600; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
  .dash-card .dc-row { display: flex; justify-content: space-between; font-size: 12.5px; padding: 5px 0; color: var(--text-dim); }
  .dash-card .dc-row b { color: var(--text); font-family: 'IBM Plex Mono', monospace; font-weight: 500; }
  .dash-card .dc-row.total { border-top: 1px solid var(--line-soft); margin-top: 4px; padding-top: 8px; font-weight: 600; color: var(--text); }
  .dash-card-alert { border-color: var(--danger-tint); background: color-mix(in srgb, var(--danger) 6%, var(--surface)); }
  .dash-card-alert .dc-row b { color: var(--danger); }
  .dash-card-alert .dc-row.total { color: var(--danger); }
  .chart-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
  .period-btns { display: flex; gap: 4px; }
  .period-btns button { padding: 5px 11px; font-size: 12px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); color: var(--text-dim); }
  .period-btns button.active { border-color: var(--accent); color: var(--accent); background: var(--accent-tint); }
  .chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .chart-card { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 18px 20px; }
  .chart-card .cc-title { font-size: 12.5px; color: var(--text-dim); margin-bottom: 2px; }
  .chart-card .cc-value { font-family: 'Fraunces', serif; font-size: 24px; font-weight: 600; margin-bottom: 10px; }
  .chart-card canvas { max-height: 190px; }

  .grid-cards { display: grid; grid-template-columns: repeat(auto-fit,minmax(190px,1fr)); gap: 14px; margin-bottom: 30px; }
  .stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 18px 20px; position: relative; }
  .stat-card::before { content:''; position:absolute; top:0; left:0; width:3px; height:100%; background: var(--accent); }
  .stat-card.money-in::before { background: var(--money-in); } .stat-card.money-out::before { background: var(--money-out); }
  .stat-card .num { font-family: 'Fraunces', serif; font-size: 29px; font-weight: 600; line-height: 1.1; }
  .stat-card .label { color: var(--text-dim); font-size: 12px; margin-top: 4px; }

  .panel { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; box-shadow: 0 1px 3px rgba(22,25,29,.04); }
  table { width: 100%; border-collapse: collapse; }
  thead th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-faint); font-weight: 500; padding: 11px 16px; border-bottom: 1px solid var(--line); background: #FBFBFA; }
  tbody td { padding: 12px 16px; font-size: 13.5px; border-bottom: 1px solid var(--line-soft); } tbody tr:last-child td { border-bottom: none; }
  tbody tr:hover { background: var(--accent-tint); }
  .num-cell { font-family: 'IBM Plex Mono', monospace; font-size: 13px; } .cell-main { font-weight: 500; } .cell-sub { color: var(--text-dim); font-size: 12px; }
  .pill { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11px; font-weight: 500; }
  .pill-ok { background: var(--money-in-tint); color: var(--money-in); } .pill-warn { background: var(--gold-tint); color: var(--gold); } .pill-danger { background: var(--danger-tint); color: var(--danger); }
  .pill-in { background: var(--money-in-tint); color: var(--money-in); } .pill-out { background: var(--money-out-tint); color: var(--money-out); }

  /* DRE (Demonstrativo de Resultado) — tabela com uma coluna por mês, que
     rola horizontalmente (com uma barra de rolagem embaixo da tabela).
     Primeira coluna (nome da categoria) fixa, pra não perder a referência ao rolar. */
  .dre-table { min-width: 900px; }
  .dre-table th:first-child, .dre-table td:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 220px; box-shadow: 1px 0 0 var(--line); }
  .dre-table thead th:first-child { background: #FBFBFA; }
  .dre-table tr.dre-row-total td { font-weight: 700; background: var(--accent-tint); }
  .dre-table tr.dre-row-total td:first-child { background: var(--accent-tint); }
  .dre-table tr.dre-row-sub td { background: var(--paper); }
  .dre-table tr.dre-row-sub td:first-child { background: var(--paper); }
  .dre-expand-btn { font-size: 13px; width: 18px; display: inline-flex; align-items: center; justify-content: center; }
  .pill-parcial { background: var(--accent-tint); color: var(--accent-2); }
  .pill-neutral { background: var(--line-soft); color: var(--text-dim); }

  .toolbar { display: flex; gap: 10px; margin-bottom: 16px; align-items: center; }
  .search-box { position: relative; flex: 1; max-width: 320px; }
  .search-box svg.icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-faint); }
  .search-box input { width: 100%; padding: 9px 12px 9px 34px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 13.5px; background: var(--surface); color: var(--text); }
  .search-box input:focus { outline: none; border-color: var(--accent); }

  .modal-backdrop { position: fixed; inset: 0; background: rgba(20,25,29,.6); display: none; align-items: flex-start; justify-content: center; padding: 46px 16px; z-index: 50; overflow-y: auto; }
  .modal-backdrop.active { display: flex; }
  .modal { background: var(--surface); border-radius: 6px; width: 100%; max-width: 640px; box-shadow: 0 30px 60px -25px rgba(0,0,0,.4); }
  .modal.narrow { max-width: 440px; }
  .modal.wide { max-width: 960px; }
  .modal.fullscreen { max-width: 98vw; width: 98vw; }
  .modal.fullscreen .modal-body { max-height: calc(96vh - 172px); }
  .modal-backdrop:has(.modal.fullscreen) { padding: 18px 14px; }
  .modal-header { padding: 22px 28px; border-bottom: 1px solid var(--line); } .modal-header h3 { margin: 0; font-size: 19px; font-weight: 600; }
  .modal-header p { margin: 4px 0 0; font-size: 12.5px; color: var(--text-dim); }
  .modal-body { padding: 22px 28px; max-height: 64vh; overflow-y: auto; }
  .form-section { margin-bottom: 22px; } .form-section:last-child { margin-bottom: 0; }
  .section-title { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); font-weight: 600; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line-soft); }
  .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
  .form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; } .form-row.cols-4 { grid-template-columns: 1fr 1fr 1fr 1fr; } .form-row.full { grid-template-columns: 1fr; }
  .field-wrap label { font-size: 12px; color: var(--text-dim); display: block; margin-bottom: 5px; }
  .field-wrap .hint { font-size: 11px; color: var(--text-faint); margin-top: 3px; }
  .form-row input, .form-row select, .form-row textarea { width: 100%; padding: 8px 11px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 13.5px; background: var(--paper); color: var(--text); }
  .form-row input:focus, .form-row select:focus, .form-row textarea:focus { outline: none; border-color: var(--accent); background: var(--surface); }

  /* Painéis de filtro (Contas a pagar/receber, extrato de Bancos) — antes eram um .panel com
     .field-wrap solto fora de qualquer .form-row, então selects/inputs não herdavam NENHUM
     estilo (ficavam no combobox padrão do navegador, pequenos/genéricos) e o painel era
     estreito demais, cortando campos como "Até". Agora tem largura própria, título de
     destaque e os mesmos inputs/selects robustos do resto do sistema. */
  .filtros-painel { padding: 20px; }
  .filtros-painel .filtros-title { font-size: 14px; font-weight: 700; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line-soft); }
  .filtros-painel select, .filtros-painel input:not([type=checkbox]) { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 13.5px; background: var(--paper); color: var(--text); }
  .filtros-painel select:focus, .filtros-painel input:focus { outline: none; border-color: var(--accent); background: var(--surface); }
  .switch-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
  .switch-row:last-child { border-bottom: none; }
  .switch-row .lbl { font-size: 13px; } .switch-row .sub { font-size: 11.5px; color: var(--text-faint); }
  .switch { width: 36px; height: 20px; border-radius: 12px; background: var(--line); position: relative; border: none; flex-shrink: 0; }
  .switch.on { background: var(--accent); } .switch::after { content:''; width: 16px; height: 16px; background: #fff; border-radius: 50%; position: absolute; top: 2px; left: 2px; transition: left .15s; }
  .switch.on::after { left: 18px; }

  .variant-table { width: 100%; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 8px; }
  .variant-table th { background: #FBFBFA; font-size: 10.5px; text-transform: uppercase; color: var(--text-faint); padding: 7px 8px; text-align: left; border-bottom: 1px solid var(--line); }
  .variant-table td { padding: 5px 6px; border-bottom: 1px solid var(--line-soft); } .variant-table input { width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: 3px; font-size: 12.5px; }
  .link-remove { color: var(--danger); font-size: 15px; background: none; border: none; padding: 4px; }
  .photo-upload { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
  .photo-thumb { width: 64px; height: 64px; border-radius: var(--radius); border: 1px solid var(--line); object-fit: cover; }
  .photo-add-btn { width: 64px; height: 64px; border: 1.5px dashed var(--line); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; color: var(--text-faint); font-size: 22px; background: var(--paper); }
  .photo-add-btn:hover { border-color: var(--accent); color: var(--accent); }
  .modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 18px 28px; border-top: 1px solid var(--line); }
  .empty-state { color: var(--text-dim); font-size: 13.5px; padding: 46px 0; text-align: center; }

  /* Certificado Digital (Preferências → Certificado Digital) */
  .cert-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; display: flex; gap: 20px; align-items: flex-start; }
  .cert-box.cert-ok { background: var(--accent-tint); border-color: var(--accent); }
  .cert-lock { width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: #fff; border: 1.5px solid var(--line); color: var(--text-faint); }
  .cert-box.cert-ok .cert-lock { border-color: var(--accent); color: var(--accent); }
  .cert-lock svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.6; }
  .cert-info { flex: 1; min-width: 0; }
  .cert-valid-title { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
  .cert-box.cert-ok .cert-valid-title { color: var(--accent-2); }
  .cert-chain { list-style: none; margin: 0 0 16px; padding: 0; font-size: 12.5px; color: var(--text-dim); }
  .cert-chain li { margin-bottom: 3px; }
  .cert-chain b { color: var(--text); }
  .cert-dropzone { border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 30px 20px; text-align: center; background: var(--paper); margin-bottom: 16px; }
  .cert-dropzone.drag-over { border-color: var(--accent); background: var(--accent-tint); }
  .cert-dropzone .cert-lock { margin: 0 auto 10px; }
  .cert-dropzone .cert-drop-title { font-size: 13.5px; font-weight: 600; margin-bottom: 3px; }
  .cert-dropzone .cert-drop-sub { font-size: 11.5px; color: var(--text-faint); margin-bottom: 12px; }
  .cert-dropzone input[type=file] { display: none; }
  .cert-file-chip { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 5px 12px; margin-top: 4px; }
  .cert-warning { background: var(--gold-tint); border: 1px solid var(--gold); border-radius: var(--radius); padding: 12px 16px; font-size: 12px; color: var(--ink-2); margin-top: 16px; }
  .cert-warning strong { display: block; margin-bottom: 6px; color: var(--gold); }
  .cert-warning ul { margin: 0; padding-left: 18px; }
  .cert-warning li { margin-bottom: 3px; }

  /* Denominação (contagem de cédulas) */
  .denom-grid { display: grid; grid-template-columns: 1fr 90px 100px; gap: 6px 10px; align-items: center; font-size: 12.5px; }
  .denom-grid .dh { font-size: 10.5px; text-transform: uppercase; color: var(--text-faint); padding-bottom: 4px; }
  .denom-grid input { width: 100%; padding: 5px 8px; border: 1px solid var(--line); border-radius: 3px; font-size: 12.5px; text-align: right; }
  .denom-total { display: flex; justify-content: space-between; font-family: 'Fraunces', serif; font-size: 18px; font-weight: 600; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }

  /* PDV — telas "vivas": cores mais fortes, fontes em negrito e botões chamativos,
     de propósito só aqui (o resto do sistema segue o visual mais discreto/profissional). */
  .pdv-shell { display: flex; flex-direction: column; height: calc(100vh - 60px); margin: -30px -40px -60px; }
  .pdv-topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 28px; background: var(--ink); color: #EDEDEA; border-bottom: 3px solid var(--accent); }
  .pdv-topbar .store-name { font-family: 'Fraunces', serif; font-size: 17px; font-weight: 600; }
  .cash-bar { display: flex; align-items: center; gap: 9px; font-size: 12.5px; font-weight: 700; color: #9BA0A9; background: rgba(255,255,255,.06); padding: 7px 14px; border-radius: 20px; }
  .cash-bar .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-faint); }
  .cash-bar.open { color: #9FE0B8; background: rgba(47,174,89,.16); }
  .cash-bar.open .dot { background: var(--money-in); box-shadow: 0 0 0 3px rgba(47,174,89,.3); }
  .cash-bar-sub { font-weight: 500; opacity: .85; margin-left: 2px; }
  .pdv-stepbar { display: flex; background: var(--surface); border-bottom: 1px solid var(--line); padding: 0 28px; }
  .pdv-step { flex: 1; max-width: 220px; padding: 14px 10px; text-align: center; background: none; border: none; border-bottom: 3px solid transparent; color: var(--text-dim); font-size: 13.5px; font-weight: 600; }
  .pdv-step.active { color: var(--accent-2); border-bottom-color: var(--accent); background: var(--accent-tint); font-weight: 700; }
  .pdv-step .kbd { font-size: 10.5px; color: var(--text-faint); margin-left: 5px; font-family: 'IBM Plex Mono', monospace; }
  .pdv-step.active .kbd { color: var(--accent); opacity: .7; }
  .pdv-body { flex: 1; display: grid; grid-template-columns: 1fr 380px; overflow: hidden; }
  .pdv-main { padding: 26px 32px; overflow-y: auto; }
  .pdv-side { border-left: 1px solid var(--line); background: var(--surface); padding: 22px 24px; overflow-y: auto; display: flex; flex-direction: column; }
  .pdv-side h3 { margin: 0 0 4px; font-size: 16px; font-weight: 700; } .pdv-side .cart-sub { font-size: 11.5px; color: var(--text-faint); margin-bottom: 14px; }
  .pdv-bottombar { display: flex; align-items: center; justify-content: space-between; padding: 16px 28px; border-top: 1px solid var(--line); background: var(--surface); }
  .pdv-bottombar .total-big { font-family: 'Fraunces', serif; font-size: 28px; font-weight: 700; color: var(--accent-2); }
  .pdv-bottombar .total-big .lbl { font-size: 12px; color: var(--text-dim); font-family: 'IBM Plex Sans', sans-serif; font-weight: 400; display: block; text-align: right; }
  .btn-finalize { background: var(--money-in); border-color: var(--money-in); color: #fff; padding: 15px 34px; font-size: 15.5px; font-weight: 700; border-radius: 6px; letter-spacing: .01em; box-shadow: 0 6px 16px -6px rgba(47,174,89,.55); }
  .btn-finalize:hover { background: #256B42; border-color: #256B42; color: #fff; box-shadow: 0 8px 20px -6px rgba(47,174,89,.65); }
  kbd { font-family: 'IBM Plex Mono', monospace; }
  .kbd-inline { font-size: 10.5px; background: rgba(255,255,255,.22); padding: 1px 6px; border-radius: 3px; margin-left: 8px; }
  .pdv-shortcuts-bar { display: flex; gap: 18px; flex-wrap: wrap; padding: 8px 28px; background: var(--ink-2); color: #9BA0A9; font-size: 11.5px; }
  .pdv-shortcuts-bar kbd { background: var(--ink-3); color: #D8DAE0; padding: 1px 6px; border-radius: 3px; margin-right: 5px; }
  .payment-cards { display: grid; grid-template-columns: repeat(auto-fill,minmax(120px,1fr)); gap: 10px; margin-bottom: 16px; }
  .payment-card { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 18px 10px; border: 2px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 12.5px; font-weight: 700; }
  .payment-card:hover { border-color: var(--accent); box-shadow: 0 4px 12px -6px rgba(47,174,89,.4); }
  .payment-card.selected { border-color: var(--accent); background: var(--accent); color: #fff; box-shadow: 0 4px 14px -5px rgba(47,174,89,.55); }
  .payment-card .pm-icon { font-size: 28px; }
  /* Pagamento dividido em 2+ formas: cada forma já lançada vira uma linha bem marcada
     ("✓ Recebido R$ 40,00 · Cartão de Débito"), e logo abaixo um aviso grande em negrito diz
     quanto falta (ou que já está tudo pago) — pra nunca ficar confuso quem já pagou o quê. */
  .payment-line-received { display: flex; align-items: center; gap: 10px; background: var(--money-in-tint); border: 1.5px solid var(--money-in); border-radius: 8px; padding: 10px 14px; margin-top: 8px; }
  .payment-line-received .pl-check { color: var(--money-in); font-size: 16px; font-weight: 700; }
  .payment-line-received .pl-label { text-transform: uppercase; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; color: var(--money-in); }
  .payment-line-received .pl-amount { font-family: 'Fraunces', serif; font-size: 17px; font-weight: 700; color: var(--money-in); }
  .payment-line-received .pl-method { flex: 1; font-weight: 600; color: var(--text); }
  .payment-status { margin-top: 12px; padding: 13px 16px; border-radius: 8px; font-weight: 700; font-size: 15px; text-align: center; }
  .payment-status.pending { background: var(--gold-tint); color: var(--gold); border: 1.5px solid var(--gold); }
  .payment-status.done { background: var(--money-in-tint); color: var(--money-in); border: 1.5px solid var(--money-in); }
  .pix-box { border: 1px solid var(--line); border-radius: 6px; padding: 20px; margin: 4px 0 16px; text-align: center; background: var(--paper); }
  .pix-box #pix-qr { display: flex; justify-content: center; margin-bottom: 14px; }
  .pix-copiaecola { font-family: 'IBM Plex Mono', monospace; font-size: 11px; word-break: break-all; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 10px; margin-bottom: 10px; max-height: 80px; overflow-y: auto; }
  .pdv-search input { width: 100%; padding: 13px 16px 13px 42px; font-size: 15px; font-weight: 500; border: 1.5px solid var(--line); border-radius: 6px; background: var(--surface); }
  .pdv-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
  .pdv-search { position: relative; margin-bottom: 16px; } .pdv-search svg.icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--text-faint); width: 18px; height: 18px; }
  .result-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 8px; padding: 13px 16px; margin-top: 9px; cursor: pointer; transition: border-color .1s, box-shadow .1s; }
  .result-row:hover { border-color: var(--accent); background: var(--accent-tint); box-shadow: 0 4px 14px -8px rgba(47,174,89,.5); }
  #pdv-results .result-info { min-width: 0; }
  #pdv-results .result-info .cell-sub { font-size: 11.5px; color: var(--text-faint); }
  #pdv-results .result-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
  #pdv-results .result-stock { font-size: 11.5px; font-weight: 700; color: var(--money-in); background: var(--money-in-tint); padding: 2px 9px; border-radius: 20px; }
  #pdv-results .result-stock.zero { color: var(--danger); background: var(--danger-tint); }
  #pdv-results .result-price { font-family: 'Fraunces', serif; font-size: 19px; font-weight: 700; color: var(--accent-2); }
  .staged-panel { display: grid; grid-template-columns: 160px 1fr; gap: 24px; margin-top: 22px; }
  .staged-image { width: 160px; height: 160px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); display: flex; align-items: center; justify-content: center; color: var(--text-faint); }
  .staged-image svg { width: 48px; height: 48px; }
  .staged-price { font-family: 'Fraunces', serif; font-size: 30px; font-weight: 700; color: var(--accent-2); margin: 10px 0 18px; }
  .qty-stepper { display: flex; align-items: center; gap: 6px; }
  .qty-stepper button { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font-size: 16px; font-weight: 700; }
  .qty-stepper input { width: 60px; text-align: center; padding: 6px; border: 1px solid var(--line); border-radius: var(--radius); font-weight: 700; }
  .discount-field { display: flex; }
  .discount-field input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
  .discount-toggle { border: 1px solid var(--line); border-left: none; border-top-right-radius: var(--radius); border-bottom-right-radius: var(--radius); padding: 0 12px; background: var(--paper); font-size: 12px; font-weight: 500; }
  .cart-item { display: flex; justify-content: space-between; font-size: 13px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
  .cart-total { display: flex; justify-content: space-between; align-items: baseline; font-family: 'Fraunces', serif; font-size: 22px; font-weight: 700; color: var(--accent-2); padding-top: 14px; margin-top: auto; }
  .customer-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 15px; border: 1px solid var(--line); border-radius: var(--radius); margin-top: 8px; cursor: pointer; }
  .customer-row:hover { border-color: var(--accent); background: var(--accent-tint); }
  .customer-row.selected { border-color: var(--accent); background: var(--accent-tint); }
  #cliente-results .customer-row .avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 11px; flex-shrink: 0; }
  .selected-entity-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1.5px solid var(--accent); background: var(--accent-tint); border-radius: var(--radius); }
  .selected-entity-card .avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; flex-shrink: 0; }
  .bold-section-title { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 2px solid var(--accent); }
  .bold-section-title svg { width: 20px; height: 20px; flex-shrink: 0; }
  .bold-section-title span { font-size: 13px; font-weight: 700; letter-spacing: .02em; }
  .toast { position: fixed; bottom: 26px; right: 26px; background: var(--ink); color: #fff; padding: 12px 20px; border-radius: var(--radius); font-size: 13px; opacity: 0; transform: translateY(8px); transition: all .25s; z-index: 80; box-shadow: 0 10px 30px -10px rgba(0,0,0,.4); }
  .toast.show { opacity: 1; transform: translateY(0); }

  #print-frame { position: fixed; width: 0; height: 0; border: none; opacity: 0; }
  .ops-backdrop { position: fixed; inset: 0; z-index: 55; display: none; }
  .ops-backdrop.active { display: block; }
  .ops-panel { position: absolute; top: 58px; right: 24px; width: 260px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 20px 45px -20px rgba(0,0,0,.35); padding: 8px; }
  .ops-panel .ops-title { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); padding: 8px 10px 4px; }
  .ops-panel button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 9px 10px; background: none; border: none; font-size: 13.5px; color: var(--text); border-radius: var(--radius); }
  .ops-panel button:hover { background: var(--accent-tint); color: var(--accent); }

  /* Ações de linha em tabelas (Editar / Ativar-Desativar) */
  .row-actions { white-space: nowrap; }
  .btn-link { background: none; border: none; padding: 0; font-size: 12.5px; color: var(--accent); cursor: pointer; }
  .btn-link:hover { text-decoration: underline; }
  .btn-link.link-danger { color: var(--danger); margin-left: 10px; }
  .ops-panel hr { border: none; border-top: 1px solid var(--line-soft); margin: 6px 0; }

  /* Extrato bancário (Financeiro → Bancos) — linha de subtotal "Saldo em DD/MM" */
  .ledger-saldo-row td { background: #FBFBFA; border-bottom: 1px solid var(--line); }

  /* Painel lateral do extrato bancário — banner de saldo total em destaque
     (mesmo tom "accent-tint" do .selected-entity-card) e a lista "Saldos por
     conta" como cartões clicáveis em vez de linhas de texto simples. */
  .bank-summary-total { border: 1.5px solid var(--accent); background: var(--accent-tint); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; }
  .bank-summary-total-label { font-size: 12px; color: var(--text-dim); font-weight: 600; margin-bottom: 4px; }
  .bank-summary-total-value { font-size: 22px; font-weight: 700; font-family: 'IBM Plex Mono', monospace; }
  .bank-summary-subtitle { font-weight: 600; font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 10px; }
  .bank-account-list { display: flex; flex-direction: column; gap: 8px; }
  .bank-account-card { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); cursor: pointer; text-align: left; font: inherit; color: inherit; transition: border-color .12s, background .12s; }
  .bank-account-card:hover { border-color: var(--accent); background: var(--accent-tint); }
  .bank-account-card .avatar { width: 32px; height: 32px; font-size: 12px; flex-shrink: 0; }
  .bank-account-card-name { flex: 1; font-weight: 500; font-size: 13.5px; }
  .bank-account-card-balance { font-weight: 600; }
  .bank-account-card-balance.is-negative { color: var(--money-out); }

  /* Editor visual de Etiquetas (Configurações → Etiquetas) */
  .et-palette-group { margin-bottom: 14px; }
  .et-palette-title { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); font-weight: 700; margin-bottom: 6px; }
  .et-palette-item { display: block; width: 100%; text-align: left; padding: 6px 9px; margin-bottom: 4px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font-size: 12px; color: var(--text); cursor: pointer; }
  .et-palette-item:hover { border-color: var(--accent); color: var(--accent); }
  #et-canvas { box-shadow: 0 0 0 1px var(--line), 0 8px 24px -12px rgba(0,0,0,.25); background-color: #fff; background-repeat: repeat; }
  .et-field { position: absolute; border: 1px dashed var(--accent-2); background: rgba(0,0,0,0.02); font-size: 9px; color: var(--text-dim); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding: 1px 2px; cursor: grab; box-sizing: border-box; line-height: 1.15; user-select: none; }
  .et-field:active { cursor: grabbing; }
  .et-field.selected { border: 1.5px solid var(--accent); background: var(--accent-tint); z-index: 2; }
  .et-resize-handle { position: absolute; right: -3px; bottom: -3px; width: 9px; height: 9px; background: var(--accent); border-radius: 50%; cursor: nwse-resize; }
