/* ============================================================
   GESTÃO FINANCEIRA & DRE — style.css
   Design System: Azul Escuro | Verde | Vermelho | Cinza
   ============================================================ */

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:       #1e40af;
  --primary-light: #3b82f6;
  --primary-dark:  #1e3a8a;
  --success:       #16a34a;
  --success-light: #22c55e;
  --danger:        #dc2626;
  --danger-light:  #ef4444;
  --warning:       #d97706;
  --warning-light: #f59e0b;
  --neutral:       #64748b;
  --neutral-light: #94a3b8;

  --bg:            #f1f5f9;
  --bg-card:       #ffffff;
  --bg-sidebar:    #0f172a;
  --bg-sidebar-hover: #1e293b;
  --bg-sidebar-active: #1e40af;

  --text-primary:  #0f172a;
  --text-secondary:#475569;
  --text-muted:    #94a3b8;
  --text-white:    #f8fafc;

  --border:        #e2e8f0;
  --border-focus:  #3b82f6;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow:        0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg:     0 10px 25px rgba(0,0,0,.1), 0 4px 10px rgba(0,0,0,.07);
  --shadow-xl:     0 20px 50px rgba(0,0,0,.15);

  --sidebar-w:     260px;
  --topbar-h:      64px;
  --radius:        12px;
  --radius-sm:     8px;
  --radius-lg:     16px;
  --transition:    0.2s ease;
}

html { font-size: 15px; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--neutral-light); }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  height: 100vh;
  position: fixed;
  top: 0; left: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--transition);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.brand-icon {
  width: 42px; height: 42px;
  background: var(--primary);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  color: #fff;
  flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-size: .95rem; font-weight: 700; color: var(--text-white); letter-spacing: -.3px; }
.brand-sub  { font-size: .7rem; color: var(--text-muted); font-weight: 400; }
.brand-logo-wrap { overflow: hidden; background: transparent; padding: 2px; }
.sidebar-logo-img { width: 100%; height: 100%; object-fit: contain; border-radius: 4px; }

.sidebar-nav { flex: 1; padding: 12px 0; }
.nav-group { margin-bottom: 4px; }
.nav-label {
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 14px 20px 6px;
  display: block;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: #94a3b8;
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  border-radius: 0;
  position: relative;
  transition: all var(--transition);
  cursor: pointer;
}
.nav-item i { width: 18px; text-align: center; font-size: .9rem; }
.nav-item:hover  { color: #fff; background: var(--bg-sidebar-hover); }
.nav-item.active {
  color: #fff;
  background: var(--bg-sidebar-active);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--primary-light);
  border-radius: 0 2px 2px 0;
}
.badge-pending {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  min-width: 20px;
  text-align: center;
  display: none;
}
.badge-pending.visible { display: block; }

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,.07);
}
.sidebar-month-selector label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.sidebar-month-selector select {
  width: 100%;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  color: #e2e8f0;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: .8rem;
  margin-bottom: 6px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}
.sidebar-month-selector select option { background: #1e293b; color: #e2e8f0; }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 99;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin var(--transition);
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}
.topbar-left  { display: flex; align-items: center; gap: 14px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.1rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.sidebar-toggle:hover { background: var(--bg); color: var(--primary); }

.page-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -.3px;
}
.topbar-period {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg);
  padding: 5px 12px;
  border-radius: 99px;
  border: 1px solid var(--border);
}

/* ============================================================
   SYNC INDICATOR — indicador de sincronização Supabase
   ============================================================ */
.sync-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--bg);
  white-space: nowrap;
  transition: all .3s ease;
  cursor: default;
}
.sync-indicator i { font-size: .75rem; }
.sync-indicator span { display: none; }
@media (min-width: 900px) { .sync-indicator span { display: inline; } }

/* Estados */
.sync-syncing { color: #d97706; border-color: #fef3c7; background: #fffbeb; }
.sync-syncing i { animation: fa-spin 1s linear infinite; }
.sync-synced  { color: #16a34a; border-color: #dcfce7; background: #f0fdf4; }
.sync-offline { color: #6b7280; border-color: var(--border); background: var(--bg); }
.sync-error   { color: #dc2626; border-color: #fee2e2; background: #fef2f2; }

/* ============================================================
   PAGES
   ============================================================ */
.page {
  display: none;
  padding: 24px;
  flex-direction: column;
  gap: 20px;
  animation: fadeIn .25s ease;
}
.page.active { display: flex; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.card-header h3 {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-header h3 i { color: var(--primary-light); }
.card-body { padding: 20px; }

/* ============================================================
   KPI CARDS
   ============================================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}
.kpi-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}
.kpi-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.kpi-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.kpi-receita      .kpi-icon { background: #dbeafe; color: var(--primary); }
.kpi-despesa      .kpi-icon { background: #fee2e2; color: var(--danger); }
.kpi-investimento .kpi-icon { background: #ede9fe; color: #6366f1; }
.kpi-lucro        .kpi-icon { background: #dcfce7; color: var(--success); }
.kpi-pendente     .kpi-icon { background: #fef3c7; color: var(--warning); }
.kpi-investimento .kpi-value { color: #6366f1; }
.kpi-info { display: flex; flex-direction: column; min-width: 0; }
.kpi-label {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.kpi-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kpi-sub { font-size: .72rem; color: var(--text-muted); margin-top: 2px; }
.kpi-lucro.positive .kpi-value { color: var(--success); }
.kpi-lucro.negative .kpi-value { color: var(--danger); }

/* ============================================================
   HEALTH BAR
   ============================================================ */
.health-bar-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
}
.health-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.health-status {
  font-size: .78rem;
  padding: 3px 12px;
  border-radius: 99px;
  font-weight: 700;
}
.health-status.excelente { background: #dcfce7; color: var(--success); }
.health-status.bom       { background: #dbeafe; color: var(--primary); }
.health-status.regular   { background: #fef3c7; color: var(--warning); }
.health-status.critico   { background: #fee2e2; color: var(--danger); }
.health-bar {
  height: 10px;
  background: var(--bg);
  border-radius: 99px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.health-fill {
  height: 100%;
  border-radius: 99px;
  transition: width .6s ease, background .3s;
  background: var(--success);
}

/* ============================================================
   CHARTS
   ============================================================ */
.charts-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
}
.chart-card .card-body { position: relative; }
.chart-card-wide { grid-column: 1 / -1; }

/* ============================================================
   INVEST DASH GRID (Dashboard)
   ============================================================ */
.invest-dash-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 16px;
}
.invest-total-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(99,102,241,.1), rgba(139,92,246,.08));
  border: 1px solid rgba(99,102,241,.2);
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
}
.invest-total-label { font-size:.72rem; font-weight:700; color:#6366f1; text-transform:uppercase; letter-spacing:.04em; }
.invest-total-val   { font-size:1.4rem; font-weight:800; color:#6366f1; letter-spacing:-.5px; }
.invest-count-badge {
  font-size:.72rem; font-weight:700;
  padding: 4px 12px;
  background: rgba(99,102,241,.15);
  color: #6366f1;
  border-radius: 99px;
}
.invest-cats { display: flex; flex-direction: column; gap: 8px; }
.invest-cat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: .82rem;
}
.invest-cat-info {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.invest-cat-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.invest-cat-nome {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}
.invest-cat-count {
  font-size:.7rem;
  color: var(--text-muted);
  flex-shrink: 0;
}
.invest-cat-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  min-width: 100px;
}
.invest-cat-val { font-weight:700; color:#6366f1; font-size:.82rem; }
.invest-cat-bar {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.invest-cat-bar div {
  height: 100%;
  border-radius: 3px;
  transition: width .4s ease;
}

/* ============================================================
   BOTTOM GRID (Dashboard)
   ============================================================ */
.bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 16px;
}
.link-ver-todos {
  font-size: .78rem;
  color: var(--primary-light);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}
.link-ver-todos:hover { text-decoration: underline; }

/* Alertas */
.alerta-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-size: .82rem;
}
.alerta-despesa { background: #fff7ed; border-left: 3px solid var(--warning); }
.alerta-receita { background: #fef2f2; border-left: 3px solid var(--danger); }
.alerta-item i  { font-size: .9rem; color: var(--warning); }
.alerta-item strong { font-weight: 700; }

/* Ultimos lancamentos */
.recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: .82rem;
}
.recent-item:last-child { border-bottom: none; }
.recent-left { display: flex; align-items: center; gap: 10px; }
.recent-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.recent-dot.receita  { background: var(--success); }
.recent-dot.despesa  { background: var(--danger); }
.recent-desc { font-weight: 600; color: var(--text-primary); }
.recent-cat  { font-size: .7rem; color: var(--text-muted); }
.recent-val.receita  { font-weight: 700; color: var(--success); }
.recent-val.despesa  { font-weight: 700; color: var(--danger); }

/* ============================================================
   FILTERS BAR
   ============================================================ */
.filters-bar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 16px 20px;
  flex-wrap: wrap;
}
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.filter-group label {
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.filter-input,
.filter-select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .82rem;
  color: var(--text-primary);
  background: var(--bg);
  transition: border-color var(--transition);
  height: 36px;
}
.filter-input { width: 200px; }
.filter-select { min-width: 120px; }
.filter-input:focus,
.filter-select:focus {
  outline: none;
  border-color: var(--border-focus);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}

/* Summary Investimento */
.summary-invest .summary-value { color: #6366f1; }

/* Lancamentos summary — 5 colunas quando investimento visível */
.lancamentos-summary {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.summary-item {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 14px 18px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--shadow-sm);
}
.summary-label { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.summary-value { font-size: 1.05rem; font-weight: 800; }
.summary-receita  .summary-value { color: var(--success); }
.summary-despesa  .summary-value { color: var(--danger); }
.summary-saldo    .summary-value { color: var(--primary); }
.summary-count    .summary-value { color: var(--text-primary); }

/* ============================================================
   DATA TABLE
   ============================================================ */
.table-card .card-header { flex-wrap: wrap; gap: 8px; }
.table-actions { display: flex; gap: 8px; align-items: center; }
.table-wrapper { overflow-x: auto; padding: 0; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}
.data-table thead tr {
  background: var(--bg);
}
.data-table th {
  padding: 11px 14px;
  text-align: left;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  cursor: default;
}
.data-table th[onclick] { cursor: pointer; user-select: none; }
.data-table th[onclick]:hover { color: var(--primary); }
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: #f8fafc; }
.empty-row {
  text-align: center;
  padding: 48px 20px !important;
  color: var(--text-muted);
  font-size: .85rem;
  line-height: 2;
}

/* Table column widths */
.col-data  { width: 100px; }
.col-desc  { min-width: 200px; }
.col-cat   { width: 140px; }
.col-tipo  { width: 90px; }
.col-valor { width: 130px; text-align: right; }
.col-pgto  { width: 130px; }
.col-status{ width: 110px; }
.col-acoes { width: 120px; }

td.text-right { text-align: right; }
.text-right { text-align: right !important; }

/* Tipo Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 700;
  white-space: nowrap;
}
.badge-receita      { background: #dcfce7; color: #15803d; }
.badge-despesa      { background: #fee2e2; color: #b91c1c; }
.badge-investimento { background: #ede9fe; color: #5b21b6; }
.badge-pago         { background: #dbeafe; color: #1d4ed8; }
.badge-pendente     { background: #fef3c7; color: #92400e; }
.badge-parcial      { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.badge-vencido      { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; animation: pulse-vencido 2s infinite; }
/* v8.5.17 — lançamento estornado (item devolvido/cancelado) */
.badge-estornado    { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }

@keyframes pulse-vencido {
  0%, 100% { opacity: 1; }
  50%       { opacity: .65; }
}

/* ============================================================
   STATUS ROW COLORS — linha colorida na tabela por status
   ============================================================ */
.lancamento-row.status-row-vencido  td:first-child { border-left: 3px solid var(--danger); }
.lancamento-row.status-row-parcial  td:first-child { border-left: 3px solid #f97316; }
.lancamento-row.status-row-pendente td:first-child { border-left: 3px solid var(--warning); }
.lancamento-row.status-row-pago     td:first-child { border-left: 3px solid var(--success); }

/* Action buttons in table */
.action-btns {
  display: flex;
  gap: 4px;
  align-items: center;
}
.action-btn {
  width: 28px; height: 28px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem;
  transition: all var(--transition);
  background: transparent;
  color: var(--text-muted);
}
.action-btn:hover                { background: var(--bg); }
.action-btn.btn-edit:hover       { color: var(--primary); background: #dbeafe; }
.action-btn.btn-dup:hover        { color: var(--warning); background: #fef3c7; }
.action-btn.btn-toggle:hover     { color: var(--success); background: #dcfce7; }
.action-btn.btn-del:hover        { color: var(--danger); background: #fee2e2; }
.action-btn.btn-pagar            { color: #15803d; }
.action-btn.btn-pagar:hover      { background: #dcfce7; color: #14532d; }
.action-btn.btn-hist             { color: #6366f1; }
.action-btn.btn-hist:hover       { background: #ede9fe; color: #4338ca; }
/* Botão Desfazer Pagamento */
.action-btn.btn-desfazer         { color: #d97706; }
.action-btn.btn-desfazer:hover   { background: #fef3c7; color: #92400e; }

/* Valor cell */
.valor-receita { font-weight: 700; color: var(--success); }
.valor-despesa { font-weight: 700; color: var(--danger); }

/* Pagination */
.table-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  font-size: .8rem;
  color: var(--text-muted);
}
.page-btn {
  width: 30px; height: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  cursor: pointer;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.page-btn:hover  { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ============================================================
   DRE
   ============================================================ */
.dre-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.dre-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dre-period-selector { display: flex; align-items: center; gap: 8px; }
.dre-period-selector label { font-size: .82rem; font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
.dre-period-label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg);
  padding: 3px 12px;
  border-radius: 99px;
  border: 1px solid var(--border);
}

.dre-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
}
.dre-table th {
  background: var(--bg);
  padding: 10px 16px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.dre-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}
.dre-table tr:last-child td { border-bottom: none; }

/* DRE row types */
.dre-row-section td {
  background: #f1f5f9;
  font-weight: 700;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
}
.dre-row-item td:first-child { padding-left: 28px; }
.dre-row-subtotal td {
  background: #f8fafc;
  font-weight: 700;
  color: var(--primary-dark);
  border-top: 2px solid var(--border);
  border-bottom: 2px solid var(--border);
}
.dre-row-total td {
  background: var(--primary-dark);
  color: #fff;
  font-weight: 800;
  font-size: .95rem;
}
.dre-row-total td:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.dre-row-total td:last-child  { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.dre-row-positivo td { background: #f0fdf4; }
.dre-row-negativo td { background: #fff5f5; }
.dre-valor-pos { color: var(--success) !important; font-weight: 700; }
.dre-valor-neg { color: var(--danger)  !important; font-weight: 700; }
.dre-pct { color: var(--text-muted); font-size: .78rem; }

/* ============================================================
   RELATÓRIOS
   ============================================================ */
.relatorios-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 16px;
}

/* ============================================================
   CATEGORIAS
   ============================================================ */
.categorias-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  align-items: start;
}
.categorias-form-card { position: sticky; top: calc(var(--topbar-h) + 24px); }
.categorias-list-wrapper { display: flex; flex-direction: column; gap: 14px; }

.cat-group-card { border: 1px solid var(--border); }
.cat-header-receita         .card-header { background: #f0fdf4; border-bottom: 1px solid #bbf7d0; }
.cat-header-investimento .card-header { background: #f5f3ff; border-bottom: 1px solid #ddd6fe; }
.cat-header-investimento h3 i { color: #6366f1; }
.cat-header-custo-variavel  .card-header { background: #fff7ed; border-bottom: 1px solid #fed7aa; }
.cat-header-custo-fixo      .card-header { background: #fef3c7; border-bottom: 1px solid #fde68a; }
.cat-header-despesa-op      .card-header { background: #fdf2f8; border-bottom: 1px solid #fbcfe8; }
.cat-header-receita         h3 i { color: var(--success); }
.cat-header-custo-variavel  h3 i { color: var(--warning); }
.cat-header-custo-fixo      h3 i { color: #ca8a04; }
.cat-header-despesa-op      h3 i { color: #a855f7; }

.cat-count {
  font-size: .72rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 99px;
  background: rgba(0,0,0,.08);
  color: var(--text-secondary);
}
.cat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.cat-item:last-child { border-bottom: none; }
.cat-color-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.cat-icon { font-size: .9rem; color: var(--text-muted); width: 20px; text-align: center; }
.cat-name { flex: 1; font-weight: 600; font-size: .85rem; }
.cat-item-actions { display: flex; gap: 4px; }
.cat-empty { color: var(--text-muted); font-size: .82rem; text-align: center; padding: 16px 0; font-style: italic; }

/* ============================================================
   DRE LAYOUT
   ============================================================ */
.dre-main-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 16px;
  align-items: start;
}
.dre-side-charts { display: flex; flex-direction: column; gap: 16px; }

/* DRE KPI Cards */
.dre-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.dre-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}
.dre-kpi-card:hover { box-shadow: var(--shadow); }
.dre-kpi-icon { font-size:1.2rem; flex-shrink:0; width:38px; height:38px; display:flex; align-items:center; justify-content:center; border-radius:var(--radius-sm); background:var(--bg); }
.dre-kpi-label { font-size:.68rem; font-weight:600; color:var(--text-muted); text-transform:uppercase; letter-spacing:.04em; margin-bottom:2px; }
.dre-kpi-val { font-size:.88rem; font-weight:800; letter-spacing:-.3px; }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.form-group:last-child { margin-bottom: 0; }
.form-label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: .02em;
}
.form-control {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .87rem;
  color: var(--text-primary);
  background: var(--bg-card);
  transition: border-color var(--transition), box-shadow var(--transition);
  font-family: inherit;
  width: 100%;
}
.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}
textarea.form-control { resize: vertical; min-height: 70px; }
.color-picker { height: 40px; padding: 4px 6px; cursor: pointer; }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-row .flex-2 { grid-column: span 1; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }

/* Tipo / Status Toggle */
.tipo-toggle,
.status-toggle {
  display: flex;
  gap: 8px;
}
.tipo-btn,
.status-btn {
  flex: 1;
  padding: 9px 8px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  display: flex; align-items: center; justify-content: center; gap: 6px;
  color: var(--text-secondary);
}
.tipo-btn:hover   { border-color: var(--primary-light); color: var(--primary); }
.status-btn:hover { border-color: var(--primary-light); color: var(--primary); }

#tipo-receita-btn.active  { border-color: var(--success); background: #f0fdf4; color: var(--success); }
#tipo-despesa-btn.active  { border-color: var(--danger);  background: #fef2f2; color: var(--danger);  }
#status-pago-btn.active   { border-color: var(--primary); background: #dbeafe; color: var(--primary); }
#status-pendente-btn.active { border-color: var(--warning); background: #fef3c7; color: var(--warning); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: .84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
  font-family: inherit;
}
.btn-sm { padding: 6px 14px; font-size: .78rem; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 2px 8px rgba(30,64,175,.3); }
.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-outline:hover { background: var(--bg); color: var(--text-primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.55);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(3px);
  animation: fadeIn .2s ease;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: slideUp .25s ease;
}
.modal-sm  { max-width: 400px; }
/* v8.0.0 — modal largo para lista completa de lançamentos do cartão */
.modal-reemb-lista-modal { max-width: 1020px; width: 96vw; }

/* v8.1.0 — barra de filtros do modal de lançamentos do cartão */
.reemb-lista-filtros-bar {
  background: var(--bg-secondary, #f8fafc);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
}
.reemb-lista-filtros-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.reemb-filtro-label {
  display: block;
  font-size: .68rem;
  color: var(--text-muted);
  margin-bottom: 3px;
  font-weight: 500;
  white-space: nowrap;
}
.form-control-sm {
  font-size: .78rem !important;
  padding: 4px 7px !important;
  height: auto !important;
}
.reemb-lista-contador {
  font-size: .74rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  min-height: 18px;
}
.reemb-lista-table { font-size: .79rem; }
.reemb-lista-table thead th {
  white-space: nowrap;
  user-select: none;
}
.reemb-lista-table thead th:hover { background: var(--bg-secondary); }
.reemb-sort-icon { color: #6366f1; font-size: .65rem; }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 {
  font-size: 1rem;
  font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.modal-header h2 i { color: var(--primary-light); }
.modal-close {
  width: 30px; height: 30px;
  border: none;
  background: var(--bg);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-muted);
  font-size: .9rem;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.modal-close:hover { background: #fee2e2; color: var(--danger); }
.modal-body { padding: 24px; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  min-width: 280px;
  max-width: 380px;
  pointer-events: all;
  animation: toastIn .3s ease;
  font-size: .84rem;
  font-weight: 500;
}
.toast.removing { animation: toastOut .3s ease forwards; }
.toast-icon { font-size: 1rem; flex-shrink: 0; }
.toast-success { border-left: 4px solid var(--success); }
.toast-success .toast-icon { color: var(--success); }
.toast-error   { border-left: 4px solid var(--danger); }
.toast-error   .toast-icon { color: var(--danger); }
.toast-warning { border-left: 4px solid var(--warning); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info    { border-left: 4px solid var(--primary); }
.toast-info    .toast-icon { color: var(--primary); }

@keyframes toastIn  { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toastOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(120%); opacity: 0; } }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  color: var(--text-muted);
  font-size: .85rem;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.empty-state i { font-size: 2rem; opacity: .4; }

/* ============================================================
   RESUMO MENSAL TABLE
   ============================================================ */
#table-resumo-mensal td, #table-resumo-mensal th { padding: 10px 14px; }
.row-positivo td { color: var(--success); }
.row-negativo td { color: var(--danger); }
.mes-cell { font-weight: 600; }

/* ============================================================
   TOP CATEGORIES LIST
   ============================================================ */
.top-cat-item {
  margin-bottom: 12px;
}
.top-cat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  font-size: .82rem;
}
.top-cat-name  { font-weight: 600; color: var(--text-primary); }
.top-cat-value { font-weight: 700; color: var(--danger); }
.top-cat-bar   { height: 6px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.top-cat-fill  { height: 100%; border-radius: 99px; background: var(--danger); transition: width .5s ease; }

/* ============================================================
   SIDEBAR USER CARD
   ============================================================ */
.sidebar-user {
  margin: 0 12px 4px;
  padding: 10px 12px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}
.su-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: .82rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: -.5px;
}
.su-info   { flex: 1; min-width: 0; }
.su-name   { display: block; font-size: .8rem; font-weight: 700; color: #e2e8f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.su-empresa{ display: block; font-size: .68rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.su-menu-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  font-size: .75rem;
  flex-shrink: 0;
  transition: all var(--transition);
}
.su-menu-btn:hover { color: #fff; background: rgba(255,255,255,.1); }

/* Dropdown */
.su-dropdown {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0; right: 0;
  background: #1e293b;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 -8px 24px rgba(0,0,0,.3);
  z-index: 200;
}
.su-dropdown.open { display: block; }
.su-dropdown button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  text-align: left;
}
.su-dropdown button i { width: 16px; text-align: center; font-size: .8rem; color: var(--text-muted); }
.su-dropdown button:hover { background: rgba(255,255,255,.06); color: #fff; }
.su-dropdown .logout-btn { color: #fca5a5 !important; }
.su-dropdown .logout-btn:hover { background: rgba(220,38,38,.15) !important; }
.su-dropdown .logout-btn i { color: #fca5a5 !important; }

/* ============================================================
   TOPBAR USER
   ============================================================ */
.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 6px;
  border-radius: 99px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg);
}
.topbar-user:hover { background: var(--bg); border-color: var(--primary-light); }
.topbar-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
.topbar-username {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ============================================================
   PERFIL PAGE
   ============================================================ */
.perfil-layout {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
  align-items: start;
}
.perfil-avatar-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 20px;
}
.perfil-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
.perfil-nome-display  { font-size: 1rem; font-weight: 700; color: var(--text-primary); }
.perfil-email-display { font-size: .8rem; color: var(--text-muted); margin-top: 2px; }

/* Data info grid */
.data-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 4px;
}
.data-info-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.di-label { font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.di-val   { font-size: 1rem; font-weight: 800; color: var(--text-primary); }

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

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
  .sidebar, .topbar, .btn, .filters-bar,
  .dre-controls, .toast-container { display: none !important; }
  .main-content { margin-left: 0 !important; }
  .page { display: flex !important; }
  .page:not(#page-dre) { display: none !important; }
  #page-dre { padding: 0; }
  .card { box-shadow: none; border: 1px solid #ccc; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1200px) {
  .kpi-grid         { grid-template-columns: repeat(3, 1fr); }
  .dre-kpi-grid     { grid-template-columns: repeat(3, 1fr); }
  .dre-main-grid    { grid-template-columns: 1fr; }
  .dre-side-charts  { flex-direction: row; flex-wrap: wrap; }
  .dre-side-charts .card { flex: 1; min-width: 280px; }
  .invest-dash-grid { grid-template-columns: 1fr; }
  .relatorios-grid  { grid-template-columns: 1fr; }
}

@media (max-width: 1024px) {
  .charts-grid { grid-template-columns: 1fr; }
  .bottom-grid { grid-template-columns: 1fr; }
  .invest-dash-grid { grid-template-columns: 1fr; }
  .categorias-layout { grid-template-columns: 1fr; }
  .categorias-form-card { position: static; }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 260px; }

  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay.open { display: block; }
  .sidebar-toggle { display: flex; }

  .main-content { margin-left: 0; }
  .topbar { padding: 0 16px; }

  .page { padding: 16px; gap: 14px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .dre-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .lancamentos-summary { grid-template-columns: repeat(2, 1fr); }
  .filters-bar { gap: 8px; }
  .filter-input { width: 100%; }
  .dre-main-grid { grid-template-columns: 1fr; }
  .dre-side-charts { flex-direction: column; }
  .invest-dash-grid { grid-template-columns: 1fr; }

  .form-row { grid-template-columns: 1fr; }
  .modal { border-radius: var(--radius); }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .dre-kpi-grid { grid-template-columns: 1fr 1fr; }
  .lancamentos-summary { grid-template-columns: 1fr; }
  .kpi-value { font-size: 1.1rem; }
}

/* ============================================================
   MODAL PAGAMENTO
   ============================================================ */
.modal-pagamento { max-width: 540px; }

.pgto-resumo-card {
  background: linear-gradient(135deg, #f0f4ff 0%, #e8f5e9 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.pgto-resumo-desc {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
  word-break: break-word;
}
.pgto-resumo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.pgto-resumo-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pgto-resumo-label {
  font-size: .67rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
}
.pgto-resumo-val {
  font-size: .95rem;
  font-weight: 800;
  color: var(--text-primary);
}
.pgto-resumo-val.pgto-pago   { color: var(--success); }
.pgto-resumo-val.pgto-saldo  { color: var(--danger); }

.pgto-diff-info {
  min-height: 28px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: .8rem;
  margin: 8px 0 4px;
  border: 1px solid var(--border);
}

/* Histórico de pagamentos no modal de pagamento */
.pgto-hist-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 14px;
}
.pgto-hist-title {
  font-size: .75rem;
  font-weight: 700;
  color: #6366f1;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 8px;
}
.pgto-hist-item {
  display: grid;
  grid-template-columns: 56px 70px 1fr auto auto auto;
  gap: 8px;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  font-size: .8rem;
}
.pgto-hist-item:last-child { border-bottom: none; }

/* ============================================================
   PAGAMENTO v2 — seletor de modo e múltiplas formas
   ============================================================ */

/* Largura do modal aumentada para múltiplas formas */
.modal-pagamento { max-width: 580px; }

/* Seletor Uma / Múltiplas formas */
.pgto-modo-wrap {
  margin: 12px 0 10px;
}
.pgto-modo-label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
  display: block;
  margin-bottom: 7px;
}
.pgto-modo-btns {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.pgto-modo-opt {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: .82rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg);
  transition: border-color .15s, background .15s, color .15s;
  user-select: none;
}
.pgto-modo-opt input[type="radio"] { display: none; }
.pgto-modo-opt:has(input:checked) {
  border-color: var(--primary);
  background: #eff6ff;
  color: var(--primary);
  font-weight: 600;
}
.pgto-modo-opt i { font-size: .85rem; }

/* Header da tabela de formas múltiplas */
.pgto-multi-header {
  display: grid;
  grid-template-columns: 1fr 130px 36px;
  gap: 8px;
  padding: 5px 4px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.pgto-multi-col-forma  {}
.pgto-multi-col-valor  {}
.pgto-multi-col-acao   {}

/* Linha de forma de pagamento */
.pgto-multi-row {
  display: grid;
  grid-template-columns: 1fr 130px 36px;
  gap: 8px;
  align-items: center;
  margin-bottom: 7px;
}
.pgto-multi-row .form-control { margin: 0; }
.pgto-rm-btn {
  width: 34px; height: 34px;
  padding: 0;
  display: flex; align-items: center; justify-content: center;
  border-color: #fca5a5;
  color: var(--danger);
  font-size: .8rem;
  flex-shrink: 0;
}
.pgto-rm-btn:hover { background: #fef2f2; border-color: var(--danger); }

/* Botão adicionar forma */
.pgto-add-btn {
  margin-top: 4px;
  font-size: .78rem;
  padding: 5px 12px;
  height: 32px;
}

/* Total em tempo real */
.pgto-multi-total-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: .85rem;
  color: var(--text-muted);
}
.pgto-multi-total-val {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
}

/* Info de diff (juros / desconto / ok) */
.pgto-info-juros    { color: #dc2626; display: flex; align-items: center; gap: 5px; }
.pgto-info-desconto { color: #16a34a; display: flex; align-items: center; gap: 5px; }
.pgto-info-ok       { color: var(--success); display: flex; align-items: center; gap: 5px; }

/* Badges de forma no histórico do modal */
.pgto-forma-badge {
  display: inline-block;
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 7px;
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 1px 3px 1px 0;
}

/* Novo layout do pgto-hist-item — colunas: nº, data, formas, valor, extras, botão 🗑 */
.pgto-hist-num    { color: var(--text-muted); font-size: .72rem; }
.pgto-hist-data   { color: var(--text-muted); font-size: .78rem; }
.pgto-hist-formas { font-size: .78rem; }
.pgto-hist-valor  { font-size: .82rem; font-weight: 700; white-space: nowrap; }
.pgto-hist-extra  { font-size: .72rem; }
.pgto-hist-juros  { color: #dc2626; white-space: nowrap; font-weight: 600; }
.pgto-hist-desc   { color: #16a34a; white-space: nowrap; font-weight: 600; }

/* ============================================================
   HISTÓRICO DE PAGAMENTOS NA TABELA (linha expandível)
   ============================================================ */
.historico-row td {
  background: #f8faff;
  border: none;
  padding: 0 !important;
}
.historico-pagamentos {
  padding: 12px 20px;
  border-top: 2px dashed #6366f1;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(to right, #f8f8ff, #fff);
}
.hist-title {
  font-size: .78rem;
  font-weight: 700;
  color: #6366f1;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.hist-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .78rem;
  margin-bottom: 8px;
}
.hist-table th {
  background: #ede9fe;
  color: #5b21b6;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 5px 10px;
  text-align: left;
  font-weight: 700;
}
.hist-table td {
  border-bottom: 1px solid #e9e9f0;
  vertical-align: middle;
}
.hist-footer {
  display: flex;
  gap: 20px;
  font-size: .78rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  padding-top: 4px;
  align-items: center;
}
/* Botão desfazer dentro do histórico expandido */
.hist-desfazer-btn {
  margin-left: auto;
  font-size: .75rem;
  padding: 4px 12px;
  height: 28px;
  border-color: #fde68a;
  color: #92400e;
  background: #fffbeb;
}
.hist-desfazer-btn:hover { background: #fef3c7; border-color: #f59e0b; }

/* Botão .btn-warning genérico (usado no modal de desfazer) */
.btn-warning {
  background: #f59e0b;
  color: #fff;
  border: none;
}
.btn-warning:hover { background: #d97706; }

/* ============================================================
   ALERTAS DE VENCIMENTO NO DASHBOARD
   ============================================================ */
.venc-group {
  margin-bottom: 10px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}
.venc-group-title {
  font-size: .73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.venc-vencida .venc-group-title  { background: #fee2e2; color: #991b1b; }
.venc-hoje    .venc-group-title  { background: #fef3c7; color: #92400e; }
.venc-prox    .venc-group-title  { background: #dbeafe; color: #1e40af; }
.venc-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 12px;
  font-size: .8rem;
  cursor: pointer;
  transition: background var(--transition);
  border-top: 1px solid var(--border);
}
.venc-item:hover { background: var(--bg); }
.venc-desc { flex: 1; font-weight: 600; color: var(--text-primary); }
.venc-data { color: var(--text-muted); font-size: .72rem; white-space: nowrap; }
.venc-val  { font-weight: 800; color: var(--danger); white-space: nowrap; }

/* ============================================================
   PARCELAMENTO — linha extra no modal de lançamento
   ============================================================ */
#parcelas-row {
  background: #f0f4ff;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--primary-light);
  margin-bottom: 4px;
}
#parcelas-row .form-group {
  margin-bottom: 0;
}

/* ============================================================
   RESPONSIVE — novos elementos
   ============================================================ */
@media (max-width: 768px) {
  .pgto-resumo-grid      { grid-template-columns: 1fr 1fr; }
  .pgto-hist-item        { grid-template-columns: 50px 60px 1fr auto; }
  .pgto-hist-item .pgto-hist-extra  { grid-column: 1 / -1; }
  .hist-footer           { gap: 10px; }
  .modal-pagamento       { max-width: 100%; }
  .pgto-modo-btns        { flex-direction: column; gap: 6px; }
  .pgto-multi-row        { grid-template-columns: 1fr 100px 34px; }
  .pgto-multi-header     { grid-template-columns: 1fr 100px 34px; }
}

/* ============================================================
   NOVAS FUNCIONALIDADES v5.2
   Clone rápido / Recorrência / Controle de sequências
   ============================================================ */

/* Botão clone na tabela */
.action-btn.btn-clone             { color: #0891b2; }
.action-btn.btn-clone:hover       { background: #cffafe; color: #0e7490; }

/* Badges de recorrência e sequência */
.badge-recorrente {
  display: inline-flex; align-items: center; gap: 3px;
  background: #f0fdf4; color: #15803d;
  font-size: .65rem; font-weight: 700;
  padding: 2px 7px; border-radius: 99px;
  border: 1px solid #bbf7d0;
  margin-top: 2px;
}
.badge-seq {
  display: inline-flex; align-items: center; gap: 3px;
  background: #eff6ff; color: #1d4ed8;
  font-size: .65rem; font-weight: 700;
  padding: 2px 7px; border-radius: 99px;
  border: 1px solid #bfdbfe;
  margin-top: 2px;
}

/* Modal de sequência */
.seq-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.seq-opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  font-size: .88rem;
}
.seq-opt:hover {
  background: var(--bg);
  border-color: var(--primary-light);
}
.seq-opt input[type="radio"] {
  margin-top: 2px;
  accent-color: var(--primary);
  flex-shrink: 0;
}
.seq-opt input[type="radio"]:checked ~ span {
  color: var(--primary);
}

/* Info de recorrência na tabela */
.recorr-info {
  font-size: .68rem;
  color: #0891b2;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
}

@media (max-width: 768px) {
  .seq-options { gap: 8px; }
  .seq-opt { padding: 8px 10px; font-size: .82rem; }
}

/* ============================================================
   EXCLUIR PAGAMENTO INDIVIDUAL — botão 🗑 na linha do histórico
   ============================================================ */

/* Botão de excluir pagamento individual (compacto, apenas ícone) */
.btn-pgto-del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: 1px solid transparent;
  background: transparent;
  color: #dc2626;
  cursor: pointer;
  font-size: .75rem;
  transition: all .15s;
  padding: 0;
  flex-shrink: 0;
}
.btn-pgto-del:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}
.btn-pgto-del:active {
  background: #fecaca;
}

/* Versão inline dentro do bloco pgto-hist-item no modal */
.pgto-del-inline {
  width: 22px;
  height: 22px;
  font-size: .7rem;
  grid-column: auto; /* ocupa sua própria coluna no grid */
}

/* Ajuste do grid pgto-hist-item para incluir a coluna do botão de exclusão
   (já definido na regra base — este bloco é reservado para overrides pontuais) */

/* Card de detalhe do pagamento no modal de confirmação */
.excluir-pgto-detalhe {
  margin: 6px 0 4px;
}
.excluir-pgto-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.excluir-pgto-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .82rem;
}
.excluir-pgto-label {
  color: var(--text-muted);
  font-size: .75rem;
  min-width: 80px;
  flex-shrink: 0;
}
.excluir-pgto-data {
  color: var(--text-secondary);
  font-size: .78rem;
}

/* Coluna do botão 🗑 na tabela hist-table do histórico expandido */
.hist-table td:last-child,
.hist-table th:last-child {
  width: 32px;
  text-align: center;
  padding: 4px 2px !important;
}

/* Responsive para excluir-pgto-row (btn de exclusão já tratado no bloco @media 768px acima) */
@media (max-width: 768px) {
  .excluir-pgto-row { flex-wrap: wrap; }
  .excluir-pgto-card { padding: 8px 10px; }
}

/* ============================================================
   MODAL CONFIRMAR JUROS / DESCONTO — #modal-confirma-diff
   ============================================================ */

/* Overlay com z-index superior para ficar acima de qualquer outro modal aberto */
#modal-confirma-diff {
  z-index: 400;
}

/* Largura máxima do modal */
.modal-confirma-diff { max-width: 480px; }

/* Bloco de resumo da diferença (ícone + texto) */
.cdiff-resumo {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 16px;
}

/* Ícone circular central */
.cdiff-icone {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.cdiff-icone-juros    { background: #fee2e2; color: #dc2626; }
.cdiff-icone-desconto { background: #dcfce7; color: #16a34a; }

/* Opções de radio Sim / Não */
.cdiff-opcoes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.cdiff-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: .88rem;
  transition: all var(--transition);
}
.cdiff-opt:hover { background: var(--bg); border-color: var(--primary-light); }
.cdiff-opt input[type="radio"] { accent-color: var(--primary); flex-shrink: 0; }
.cdiff-opt input[type="radio"]:checked ~ span { color: var(--primary); font-weight: 600; }

/* Aviso contextual embaixo das opções */
.cdiff-aviso {
  font-size: .78rem;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin: 0;
}
.cdiff-aviso-juros    { background: #fef2f2; color: #b91c1c; border-left: 3px solid #dc2626; }
.cdiff-aviso-desconto { background: #f0fdf4; color: #15803d; border-left: 3px solid #22c55e; }

/* ============================================================
   JUROS / DESCONTO NA LINHA EXPANDÍVEL DO HISTÓRICO
   ============================================================ */

/* Classes para exibição de juros (vermelho) e desconto (verde) na tabela de lançamentos */
.hist-diff-juros {
  color: #dc2626;
  font-size: .72rem;
  font-weight: 600;
  white-space: nowrap;
}
.hist-diff-desconto {
  color: #16a34a;
  font-size: .72rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Também atualiza pgto-info-desconto para verde consistente (definição canônica acima) */

@media (max-width: 768px) {
  .modal-confirma-diff { max-width: 100%; }
  .cdiff-resumo        { flex-direction: column; gap: 10px; }
  .cdiff-icone         { width: 36px; height: 36px; font-size: 1rem; }
}

/* ============================================================
   INDICADORES FINANCEIROS AVANÇADOS
   ============================================================ */
.indicadores-topbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  margin-bottom: 20px;
  border-radius: var(--radius);
}
.indicadores-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.ind-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 18px;
}
.ind-section-title {
  font-size: .9rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}
.ind-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}
.ind-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition: box-shadow .15s;
}
.ind-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.ind-card-label {
  font-size: .72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 6px;
}
.ind-card-val {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}
.ind-card-desc {
  font-size: .68rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ============================================================
   SÓCIOS & DISTRIBUIÇÃO DE LUCRO
   ============================================================ */
.socios-lista {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.socio-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}
.socio-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .82rem;
  flex-shrink: 0;
}
.socio-nome {
  font-weight: 600;
  font-size: .88rem;
  flex: 1;
}
.socio-pct {
  font-size: .82rem;
  color: var(--primary);
  font-weight: 700;
  min-width: 50px;
  text-align: right;
}
.socio-actions {
  display: flex;
  gap: 4px;
}
.socios-total-bar {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  margin: 8px 0 4px;
}
.socios-total-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 99px;
  transition: width .3s;
}
.distribuicao-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.distrib-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  text-align: center;
}
.distrib-nome {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.distrib-pct {
  font-size: .72rem;
  color: var(--text-muted);
}
.distrib-valor {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--success);
  margin: 4px 0 2px;
}

/* ============================================================
   LOGO UPLOAD
   ============================================================ */
.logo-upload-wrap {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.logo-preview {
  width: 200px;
  min-height: 100px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.logo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: .78rem;
}
.logo-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (max-width: 768px) {
  .ind-card-grid { grid-template-columns: 1fr 1fr; }
  .distribuicao-grid { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   FLUXO DE CAIXA — layout, KPIs, seções, indicadores, projeção
   ============================================================ */

/* ── Cabeçalho de controles ── */
.fc-header {
  margin-bottom: 18px;
}
.fc-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 18px;
}
.fc-control-group {
  display: flex;
  align-items: center;
  gap: 6px;
}
.fc-label {
  font-size: .82rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.fc-period-badge {
  font-size: .8rem;
  font-weight: 600;
  color: var(--primary);
  background: rgba(99,102,241,.08);
  border-radius: 20px;
  padding: 3px 12px;
  margin: 0 18px 8px;
}

/* ── KPI cards ── */
.fc-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.fc-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: box-shadow .15s;
}
.fc-kpi-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,.07); }
.fc-kpi-icon {
  font-size: 1.4rem;
  opacity: .9;
  margin-top: 2px;
  flex-shrink: 0;
}
.fc-kpi-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.fc-kpi-label {
  font-size: .72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.fc-kpi-val {
  font-size: 1.05rem;
  font-weight: 800;
  word-break: break-word;
}
.fc-kpi-sub {
  font-size: .7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Seções de Entradas / Saídas / Resultados ── */
.fc-section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.fc-section-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.fc-section-title {
  font-size: .88rem;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 7px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}
.fc-section-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.fc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .83rem;
  padding: 3px 0;
}
.fc-row-sub {
  padding-left: 14px;
  font-size: .78rem;
  color: var(--text-secondary);
  border-left: 2px solid var(--border);
  margin-left: 4px;
}
.fc-row-total {
  border-top: 1px solid var(--border);
  padding-top: 6px;
  margin-top: 4px;
  font-weight: 700;
}
.fc-row-alert {
  background: rgba(239,68,68,.06);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: .8rem;
  color: var(--danger);
}

/* ── Indicadores ── */
.fc-ind-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.fc-ind-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition: box-shadow .15s;
}
.fc-ind-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.07); }
.fc-ind-label {
  font-size: .7rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 5px;
}
.fc-ind-val {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 4px;
}
.fc-ind-desc {
  font-size: .65rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ── Projeção do ano ── */
.fc-proj-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 20px;
}
.fc-proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.fc-proj-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.fc-proj-label {
  font-size: .72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 5px;
}
.fc-proj-val {
  font-size: 1rem;
  font-weight: 800;
}
.fc-proj-val small {
  font-size: .7rem;
  font-weight: 400;
  color: var(--text-muted);
}

/* ── Gráfico ── */
.fc-chart-card {
  margin-bottom: 20px;
}

/* ── Tabela mensal ── */
.fc-table-card {
  margin-bottom: 20px;
}
.fc-mensal-table td,
.fc-mensal-table th {
  font-size: .8rem;
  padding: 8px 10px;
}
.fc-row-futuro td {
  opacity: .75;
  font-style: italic;
}
.fc-row-negativo {
  background: rgba(239,68,68,.04);
}
.fc-row-atual {
  background: rgba(99,102,241,.06);
  font-weight: 600;
}
.fc-badge-atual {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  border-radius: 20px;
  padding: 1px 7px;
  font-size: .65rem;
  font-weight: 700;
  vertical-align: middle;
  margin-left: 4px;
}

/* ── Tabela detalhada ── */
.fc-det-table td,
.fc-det-table th {
  font-size: .8rem;
  padding: 7px 10px;
}
.fc-tfoot td {
  border-top: 2px solid var(--border);
  background: var(--bg);
  font-size: .82rem;
  padding: 8px 10px;
}
.fc-badge-real {
  background: rgba(34,197,94,.12);
  color: #15803d;
  font-size: .7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
}
.fc-badge-proj {
  background: rgba(99,102,241,.1);
  color: var(--primary);
  font-size: .7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
}

/* ============================================================
   TAXA FINANCEIRA — campos no modal de lançamento
   ============================================================ */
.taxa-toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0 6px;
}
.taxa-toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .85rem;
  cursor: pointer;
  color: var(--text-secondary);
  user-select: none;
}
.taxa-toggle-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--warning);
  cursor: pointer;
  flex-shrink: 0;
}
.fc-liquido-preview {
  background: rgba(99,102,241,.07);
  border: 1px solid rgba(99,102,241,.2);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: .82rem;
  color: var(--text-secondary);
  margin-top: 4px;
}
.fc-liquido-preview strong {
  color: var(--primary);
  font-weight: 700;
}

/* ── Responsive Fluxo de Caixa ── */
@media (max-width: 768px) {
  .fc-controls { flex-direction: column; align-items: flex-start; gap: 8px; }
  .fc-kpi-grid { grid-template-columns: 1fr 1fr; }
  .fc-section-grid { grid-template-columns: 1fr; }
  .fc-ind-grid { grid-template-columns: 1fr 1fr; }
  .fc-proj-grid { grid-template-columns: 1fr 1fr; }
  .fc-det-table { font-size: .72rem; }
  .fc-mensal-table { font-size: .72rem; }
}
@media (max-width: 480px) {
  .fc-kpi-grid { grid-template-columns: 1fr; }
  .fc-ind-grid { grid-template-columns: 1fr; }
  .fc-proj-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   PESSOAS — Cadastro de Pessoas
   ============================================================ */
.pessoas-layout {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.pessoas-controls-card { }

/* Vazio */
.pessoas-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
}
.pessoas-empty p { margin-top: 10px; font-size: .88rem; }

/* Item de pessoa na listagem */
.pessoa-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  margin-bottom: 8px;
  transition: box-shadow .15s;
}
.pessoa-item:hover { box-shadow: 0 2px 10px rgba(0,0,0,.07); }
.pessoa-item:last-child { margin-bottom: 0; }
.pessoa-inativa { opacity: .55; }

.pessoa-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .92rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  text-transform: uppercase;
}

.pessoa-info {
  flex: 1;
  min-width: 0;
}
.pessoa-nome {
  font-weight: 700;
  font-size: .9rem;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.pessoa-inativo-badge {
  font-size: .62rem;
  font-weight: 700;
  background: #fef3c7;
  color: #92400e;
  padding: 1px 7px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.pessoa-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pessoa-tipo-badge {
  font-size: .68rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.pessoa-funcao, .pessoa-tel, .pessoa-pix {
  font-size: .75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.pessoa-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* Histórico de pagamentos por pessoa */
.pessoas-hist-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.phist-kpi {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}
.phist-kpi-label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.phist-kpi-val {
  font-size: .95rem;
  font-weight: 800;
  color: var(--text-primary);
}
.phist-table { font-size: .8rem; }

/* ── Responsivo Pessoas ── */
@media (max-width: 768px) {
  .pessoa-item { flex-wrap: wrap; gap: 10px; }
  .pessoa-actions { width: 100%; justify-content: flex-end; }
  .pessoas-hist-kpis { grid-template-columns: 1fr 1fr; }
  .pessoas-grupo-header { padding: 7px 10px; }
}

/* ── v8.5.12 — Grupos de pessoas ── */
.pessoas-grupo {
  margin-bottom: 18px;
}
.pessoas-grupo:last-child { margin-bottom: 0; }

.pessoas-grupo-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg-secondary, #f8fafc);
  border-left: 3px solid #6366f1;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.pessoas-grupo-icon { font-size: 1rem; }
.pessoas-grupo-label {
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
  flex: 1;
}
.pessoas-grupo-count {
  font-size: .7rem;
  font-weight: 700;
  background: var(--border);
  color: var(--text-muted);
  padding: 1px 8px;
  border-radius: 20px;
}
.pessoas-grupo-body { padding-left: 4px; }

/* Badge de possível duplicado */
.pessoa-dupe-alert {
  font-size: .62rem;
  font-weight: 700;
  background: #fef9c3;
  color: #854d0e;
  border: 1px solid #fde047;
  padding: 1px 8px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  cursor: help;
}

/* Fornecedor vinculado no lançamento */
.lanc-fornecedor-vinc {
  font-size: .72rem;
  color: var(--primary-light, #6366f1);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

/* Select de busca de pessoa no modal de lançamento */
.lanc-pessoa-wrap {
  position: relative;
}
.lanc-pessoa-autocomplete {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  z-index: 200;
  max-height: 200px;
  overflow-y: auto;
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
}
.lanc-pessoa-ac-item {
  padding: 7px 12px;
  font-size: .8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}
.lanc-pessoa-ac-item:last-child { border-bottom: none; }
.lanc-pessoa-ac-item:hover { background: var(--bg-secondary, #f8fafc); }
.lanc-pessoa-ac-nome { font-weight: 600; }
.lanc-pessoa-ac-tipo { font-size: .68rem; color: var(--text-muted); }

/* ============================================================
   CARTÕES — Cadastro de Cartões
   ============================================================ */
.cartoes-layout {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ── Responsivo Cartões ── */
@media (max-width: 768px) {
  .cartao-item { flex-wrap: wrap; gap: 10px; }
  .cartao-actions { width: 100%; justify-content: flex-end; }
}

/* ============================================================
   VÍNCULO DE PESSOA NO MODAL DE PAGAMENTO
   ============================================================ */
.pgto-pessoa-wrap {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 12px;
}
.pgto-pessoa-toggle {
  margin-bottom: 8px;
}
.pgto-pessoa-toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .83rem;
  cursor: pointer;
  color: var(--text-secondary);
  user-select: none;
}
.pgto-pessoa-toggle-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

/* Badge de pessoa vinculada no histórico do modal */
.pgto-hist-pessoa {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(99,102,241,.08);
  color: var(--primary);
  font-size: .68rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  margin-top: 3px;
}

/* ============================================================
   CARTÃO RESPONSÁVEL — campo no modal de lançamento
   ============================================================ */
.cartao-resp-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.cartao-resp-wrap .form-control {
  flex: 1;
  min-width: 120px;
}

/* Aviso informativo dentro do modal de lançamento (débito/crédito/reembolso) */
.lanc-info-aviso {
  font-size: .78rem;
  color: var(--text-muted);
  background: var(--bg-secondary, #f8fafc);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary-light, #6366f1);
  border-radius: 6px;
  padding: 6px 10px;
  margin: 0;
}

/* Badges de cartão na lista de cartões */
.cartao-debito-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .72rem; font-weight: 600;
  color: #fff; background: #3b82f6;
  border-radius: 10px; padding: 2px 8px;
}
.cartao-terceiro-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .72rem; font-weight: 600;
  color: #fff; background: #f59e0b;
  border-radius: 10px; padding: 2px 8px;
}
.cartao-reemb-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .72rem; font-weight: 600;
  color: #fff; background: #ef4444;
  border-radius: 10px; padding: 2px 8px;
}
/* v7.9.9 — Badge parcial (laranja) para reembolso parcialmente pago */
.cartao-reemb-badge.cartao-reemb-badge-parcial {
  background: #f97316;
}
.cartao-conta-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .72rem; color: var(--text-muted);
  background: var(--bg-secondary, #f1f5f9);
  border-radius: 8px; padding: 2px 7px;
}
.cartao-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: box-shadow .15s;
}
.cartao-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,.07); }
.cartao-item.cartao-inativo { opacity: .55; }
/* v7.9.9 — Destaque lateral para cartão com reembolso pendente */
.cartao-item.cartao-item-com-reemb {
  border-left: 3px solid #ef4444;
}
/* v7.9.9 — Botão de reembolso pendente com cor de destaque */
.btn-reemb-pendente {
  border-color: #fca5a5 !important;
  color: #ef4444 !important;
  font-weight: 600 !important;
}
.cartao-icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1rem; flex-shrink: 0;
}
.cartao-info { flex: 1; min-width: 0; }
.cartao-nome {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-weight: 600; font-size: .9rem; margin-bottom: 4px;
}
.cartao-meta {
  display: flex; flex-wrap: wrap; gap: 6px;
  font-size: .75rem; color: var(--text-muted); align-items: center;
}
.cartao-tipo-badge {
  border-radius: 8px; padding: 2px 8px; font-weight: 600; font-size: .72rem;
}
.cartao-banco, .cartao-bandeira { color: var(--text-muted); }
.cartao-actions {
  display: flex; gap: 4px; flex-shrink: 0; align-items: flex-start; flex-wrap: wrap;
}
/* v8.2.0 — Linha de ciclo de fatura no card do cartão */
.cartao-ciclo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: .72rem;
  color: var(--text-muted);
  margin-top: 4px;
  align-items: center;
}
.cartao-ciclo-row span { display: flex; align-items: center; gap: 4px; }
/* Badge próxima fatura */
.cartao-proxfatura-badge {
  font-size: .7rem;
  background: rgba(99,102,241,.08);
  color: #4338ca;
  border: 1px solid rgba(99,102,241,.18);
  border-radius: 6px;
  padding: 1px 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
/* Botão faturas no cartão */
.cartao-btn-fatura {
  color: #6366f1 !important;
  border-color: #6366f1 !important;
  font-size: .72rem;
}
.cartao-btn-fatura:hover { background: rgba(99,102,241,.06) !important; }

/* ── v8.1.0 — Grupos de reembolso no painel principal ── */
.reemb-grupo-card {
  margin-bottom: 16px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.reemb-grupo-header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px;
  background: linear-gradient(135deg, var(--bg-secondary, #f8fafc), var(--bg-card));
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  cursor: pointer;
  user-select: none;
  transition: background .15s;
}
.reemb-grupo-header:hover { background: linear-gradient(135deg, #f0f4ff, #f8fafc); }
.reemb-grupo-body { transition: none; }
.reemb-grupo-toggle-icon {
  color: var(--text-muted);
  font-size: .72rem;
  transition: transform .15s;
  flex-shrink: 0;
  margin-top: 2px;
}
.reemb-grupo-total-badge {
  font-size: .74rem;
  background: #fee2e2;
  color: #ef4444;
  border-radius: 20px;
  padding: 2px 10px;
  font-weight: 700;
  border: 1px solid #fca5a5;
}
/* Chip de cartão dentro de um grupo de titular */
.reemb-cartao-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .7rem;
  background: #e0e7ff;
  color: #3730a3;
  border-radius: 12px;
  padding: 1px 8px;
  border: 1px solid #c7d2fe;
  white-space: nowrap;
  transition: background .15s;
}
.reemb-cartao-chip:hover { background: #c7d2fe; }
.reemb-cartao-chip.reemb-cartao-chip-parcial {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fed7aa;
}

/* ── Danger outline button (outline com cor de perigo) ── */
.btn-danger-outline {
  border-color: #fca5a5 !important;
  color: var(--danger) !important;
}
.btn-danger-outline:hover {
  background: #fef2f2 !important;
  border-color: var(--danger) !important;
}

/* ============================================================
   BOTÃO RECEBER — ação rápida na tabela de lançamentos
   ============================================================ */
.btn-receber {
  background: linear-gradient(135deg, #16a34a, #22c55e);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: .75rem;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.btn-receber:hover { opacity: .85; transform: translateY(-1px); }

/* ============================================================
   CONTAS FINANCEIRAS — página e componentes
   ============================================================ */
.contas-layout {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.contas-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.contas-kpi-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}
.contas-kpi-label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.contas-kpi-val {
  font-size: 1.1rem;
  font-weight: 800;
}

.conta-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  margin-bottom: 8px;
  transition: box-shadow .15s;
}
.conta-item:hover { box-shadow: 0 2px 10px rgba(0,0,0,.07); }
.conta-item:last-child { margin-bottom: 0; }

.conta-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #fff;
  flex-shrink: 0;
}

.conta-info { flex: 1; min-width: 0; }
.conta-nome {
  font-weight: 700;
  font-size: .9rem;
  margin-bottom: 4px;
}
.conta-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.conta-tipo-badge {
  font-size: .68rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 20px;
}

.conta-saldo {
  font-size: .95rem;
  font-weight: 800;
  text-align: right;
  flex-shrink: 0;
}
.conta-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* Extrato de conta */
.conta-extrato-table th { font-size: .72rem; }
.conta-extrato-table td { font-size: .8rem; }

/* ── Responsivo Contas ── */
@media (max-width: 768px) {
  .conta-item { flex-wrap: wrap; gap: 10px; }
  .conta-actions { width: 100%; justify-content: flex-end; }
  .contas-kpis { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   MODAL RECEBER — liquidação de receita
   ============================================================ */
.modal-receber {
  width: min(560px, 95vw);
}

/* Card de resumo da venda no topo */
.receber-resumo-card {
  background: linear-gradient(135deg, rgba(22,163,74,.06), rgba(34,197,94,.04));
  border: 1px solid rgba(22,163,74,.2);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.receber-resumo-desc {
  font-weight: 700;
  font-size: .95rem;
  margin-bottom: 10px;
  color: var(--text-primary);
}
.receber-resumo-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.receber-resumo-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.receber-resumo-label {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
}
.receber-resumo-val {
  font-size: .95rem;
  font-weight: 800;
}
.receber-pago  { color: var(--primary); }   /* bruto recebido */
.receber-saldo { color: var(--warning); }   /* saldo a receber */

/* Preview de taxa no modal de receber */
.receber-taxa-preview {
  background: rgba(59,130,246,.07);
  border: 1px solid rgba(59,130,246,.2);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: .8rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.receber-taxa-preview strong { color: var(--primary); font-weight: 700; }

/* Histórico de recebimentos no modal */
.receber-hist-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: .82rem;
}
.receber-hist-title {
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 8px;
}

/* ── Responsivo modal receber ── */
@media (max-width: 768px) {
  .receber-resumo-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 480px) {
  .receber-resumo-grid { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   INDICADORES EXTRAS DO FLUXO DE CAIXA
   ============================================================ */
.fc-cash-indicators {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.fc-cash-ind-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition: box-shadow .15s;
}
.fc-cash-ind-card:hover { box-shadow: var(--shadow); }
.fc-cash-ind-label {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.fc-cash-ind-val {
  font-size: 1rem;
  font-weight: 800;
}
.fc-cash-ind-desc {
  font-size: .68rem;
  color: var(--text-muted);
  margin-top: 4px;
}

@media (max-width: 768px) {
  .fc-cash-indicators { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   MAQUININHAS / OPERADORAS FINANCEIRAS
   ============================================================ */
.maq-layout {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Item de maquininha */
.maq-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  margin-bottom: 8px;
  transition: box-shadow .15s;
}
.maq-item:hover { box-shadow: 0 2px 10px rgba(0,0,0,.07); }
.maq-item:last-child { margin-bottom: 0; }
.maq-inativa { opacity: .55; }

.maq-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f97316, #fb923c);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #fff;
  flex-shrink: 0;
}

.maq-info { flex: 1; min-width: 0; }
.maq-nome {
  font-weight: 700;
  font-size: .9rem;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.maq-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

/* Badges da maquininha */
.maq-empresa {
  font-size: .72rem;
  color: var(--text-muted);
}
.maq-antecip-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .65rem;
  font-weight: 700;
  background: rgba(245,158,11,.12);
  color: #b45309;
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: .03em;
}
.maq-inativa-badge {
  font-size: .62rem;
  font-weight: 700;
  background: #fef3c7;
  color: #92400e;
  padding: 1px 7px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.maq-conta-badge {
  font-size: .68rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.maq-taxa-count {
  font-size: .68rem;
  background: rgba(99,102,241,.1);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 600;
}

.maq-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* Painel de taxas */
.maq-taxa-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  margin-bottom: 7px;
}
.maq-taxa-item:last-child { margin-bottom: 0; }
.maq-taxa-inativa { opacity: .55; }
.maq-taxa-info { flex: 1; min-width: 0; }
.maq-taxa-nome {
  font-weight: 600;
  font-size: .85rem;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.maq-taxa-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.maq-taxa-tipo-badge {
  font-size: .65rem;
  font-weight: 700;
  background: rgba(59,130,246,.1);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 20px;
}
.maq-taxa-pct {
  font-size: .72rem;
  font-weight: 700;
  color: var(--danger);
}
.maq-taxa-prazo {
  font-size: .68rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.maq-taxa-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* Seção de antecipação no modal */
.maq-antecip-section {
  background: rgba(245,158,11,.04);
  border: 1px solid rgba(245,158,11,.2);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin: 12px 0;
}
.maq-antecip-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.maq-toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  color: var(--text-primary);
}
.maq-toggle-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--warning);
  cursor: pointer;
}
.maq-antecip-hint {
  font-size: .72rem;
  color: var(--text-muted);
}
#maq-antecip-fields {
  margin-top: 12px;
}

/* ── Responsivo Maquininhas ── */
@media (max-width: 768px) {
  .maq-item { flex-wrap: wrap; gap: 10px; }
  .maq-actions { width: 100%; justify-content: flex-end; }
  .maq-taxa-item { flex-wrap: wrap; }
  .maq-taxa-actions { width: 100%; justify-content: flex-end; }
}

/* ============================================================
   MODAL RECEBER — PAINEL DE MAQUININHA E CÁLCULO AUTOMÁTICO
   ============================================================ */

/* Linha de seleção de maquininha */
.receber-maq-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 12px;
  padding: 12px 14px;
  background: rgba(249,115,22,.04);
  border: 1px solid rgba(249,115,22,.15);
  border-radius: var(--radius-sm);
}
.receber-maq-row .form-group { flex: 1; min-width: 160px; margin-bottom: 0; }

/* Painel de cálculo automático */
.receber-calc-painel {
  background: linear-gradient(135deg, rgba(22,163,74,.06), rgba(34,197,94,.03));
  border: 1px solid rgba(22,163,74,.2);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 14px;
}
.receber-calc-titulo {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.receber-calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}
.receber-calc-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 6px 10px;
  background: rgba(255,255,255,.7);
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,.05);
}
.receber-calc-label {
  font-size: .63rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
}
.receber-calc-val {
  font-size: .9rem;
  font-weight: 800;
  color: var(--text-primary);
}
.receber-calc-antecip { color: #b45309 !important; }
.receber-calc-total   { color: var(--danger) !important; }
.receber-calc-liq     { color: var(--success) !important; font-size: 1rem !important; }

.receber-calc-prazo {
  margin-top: 8px;
  font-size: .75rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.receber-calc-prazo strong { color: var(--primary); }

/* Badge maquininha no histórico */
.maq-receb-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .65rem;
  font-weight: 700;
  background: rgba(249,115,22,.1);
  color: #c2410c;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}
.maq-antecip-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: .65rem;
  font-weight: 700;
  background: rgba(245,158,11,.12);
  color: #b45309;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}

/* ── Responsivo painel cálculo ── */
@media (max-width: 600px) {
  .receber-maq-row { flex-direction: column; }
  .receber-calc-grid { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   CONTA PADRÃO — badges de recebimento e pagamento
   ============================================================ */
.conta-padrao-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .63rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 20px;
  white-space: nowrap;
}
.conta-padrao-receb {
  background: rgba(22,163,74,.1);
  color: #15803d;
}
.conta-padrao-pgto {
  background: rgba(239,68,68,.1);
  color: #dc2626;
}

/* ============================================================
   MODAL TRANSFERÊNCIA — seleção de tipo (radio visual)
   ============================================================ */
.transf-tipo-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.transf-tipo-opt {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: .82rem;
  font-weight: 600;
  transition: all .15s;
  background: var(--bg);
  flex: 1;
  min-width: 100px;
}
.transf-tipo-opt:hover {
  border-color: var(--primary);
  background: rgba(59,130,246,.05);
}
.transf-tipo-opt input[type="radio"] {
  accent-color: var(--primary);
}
.transf-tipo-opt span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.transf-tipo-opt i {
  color: var(--primary);
  font-size: .9rem;
}

@media (max-width: 480px) {
  .transf-tipo-row { flex-direction: column; }
  .transf-tipo-opt { min-width: unset; }
}

/* ============================================================
   FOTO DE PERFIL — cartão na página de perfil
   ============================================================ */
.foto-perfil-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 18px;
}
.foto-perfil-card-title {
  font-weight: 700;
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.foto-perfil-row {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.foto-perfil-preview-wrap {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}
.foto-perfil-preview {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  font-size: 1.6rem;
  background: var(--primary);
  overflow: hidden;
}
.foto-perfil-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.foto-perfil-hint {
  font-size: .72rem;
  color: var(--text-muted);
  margin-top: 4px;
}

@media (max-width: 480px) {
  .foto-perfil-row { justify-content: center; text-align: center; }
  .foto-perfil-actions { justify-content: center; }
}

/* ============================================================
   EDITAR PAGAMENTO / RECEBIMENTO — modais sm
   ============================================================ */
.modal-editar-pgto,
.modal-editar-receb {
  width: min(480px, 95vw);
}

/* ============================================================
   EXTRATO CONTA — melhorias visuais
   ============================================================ */
.btn-pgto-del {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 3px 7px;
  font-size: .75rem;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.btn-pgto-del:hover {
  background: rgba(239,68,68,.08);
  border-color: var(--danger);
  color: var(--danger);
}

/* ============================================================
   MÓDULO DELIVERY — v1.0
   ============================================================ */

/* Layout da página */
.delivery-layout {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* KPIs */
.dlv-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.dlv-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: box-shadow .15s;
}
.dlv-kpi-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,.07); }
.dlv-kpi-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; flex-shrink: 0;
}
.dlv-kpi-body { flex: 1; min-width: 0; }
.dlv-kpi-label { font-size: .74rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; }
.dlv-kpi-val { font-size: 1.25rem; font-weight: 700; color: var(--text-primary); margin: 2px 0; }
.dlv-kpi-sub { font-size: .72rem; color: var(--text-muted); }

/* ── Marketing KPI Cards (v7.4) ── */
.mkt-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: box-shadow .15s;
}
.mkt-kpi-card:hover { box-shadow: 0 2px 12px rgba(233,30,99,.1); }
.mkt-kpi-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; flex-shrink: 0;
}
.mkt-kpi-body { flex: 1; min-width: 0; }
.mkt-kpi-label { font-size: .74rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; }
.mkt-kpi-val   { font-size: 1.2rem; font-weight: 700; color: var(--text-primary); margin: 2px 0; }
.mkt-kpi-sub   { font-size: .72rem; color: var(--text-muted); }

/* Badge no menu lateral */
.badge-delivery-pend {
  background: #f97316;
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 20px;
  margin-left: auto;
}

/* Badge de plataforma na tabela */
.dlv-plat-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .78rem;
  font-weight: 600;
  background: var(--bg-secondary, #f1f5f9);
  border-radius: 8px;
  padding: 3px 9px;
  color: var(--text-primary);
}

/* Toggle delivery no modal de lançamento */
.delivery-toggle-row {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 4px;
}
.delivery-toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .84rem;
  cursor: pointer;
  color: var(--text-secondary);
  user-select: none;
}
.delivery-toggle-label input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: #f97316;
  cursor: pointer;
}

/* Card de taxas do pedido */
.delivery-taxas-card {
  background: rgba(249, 115, 22, 0.06);
  border: 1px solid rgba(249, 115, 22, 0.2);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-top: 12px;
}
.delivery-taxas-title {
  font-size: .8rem;
  font-weight: 700;
  color: #f97316;
  margin-bottom: 2px;
}

/* Preview de líquido */
.delivery-preview {
  background: var(--bg-secondary, #f8fafc);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-top: 12px;
  font-size: .82rem;
}
.dlv-preview-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
  color: var(--text-secondary);
}
.dlv-preview-row.dlv-minus { color: var(--danger); }
.dlv-preview-row.dlv-total {
  border-top: 1px solid var(--border);
  margin-top: 4px;
  padding-top: 6px;
  font-weight: 700;
  color: var(--success);
  font-size: .88rem;
}
.dlv-preview-row.dlv-total strong { font-size: .95rem; }

/* Responsivo */
@media (max-width: 600px) {
  .dlv-kpis { grid-template-columns: 1fr 1fr; }
  .dlv-kpi-val { font-size: 1.05rem; }
}
@media (max-width: 380px) {
  .dlv-kpis { grid-template-columns: 1fr; }
}

/* ── Filtros bar ── */
.dlv-filter-bar { margin-bottom: 0; }
.dlv-filter-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  padding: 14px 16px;
}
.dlv-filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 130px;
}
.dlv-filter-label {
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .03em;
}
.dlv-filter-actions {
  display: flex;
  gap: 6px;
  align-items: flex-end;
  margin-left: auto;
}
.form-control-sm {
  padding: 6px 10px;
  font-size: .82rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-secondary, #f8fafc);
  color: var(--text-primary);
  font-family: inherit;
  transition: border-color .15s;
}
.form-control-sm:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(99,102,241,.12);
}
.btn-xs {
  padding: 4px 10px;
  font-size: .74rem;
  border-radius: 6px;
}

/* ── Indicadores grid ── */
.dlv-indicadores-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.dlv-ind-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  border-left: 4px solid #e2e8f0;
}
.dlv-ind-card.dlv-ind-success { border-left-color: #22c55e; }
.dlv-ind-card.dlv-ind-danger  { border-left-color: #ef4444; }
.dlv-ind-card.dlv-ind-warning { border-left-color: #f59e0b; }
.dlv-ind-card.dlv-ind-info    { border-left-color: #3b82f6; }
.dlv-ind-card.dlv-ind-purple  { border-left-color: #a855f7; }
.dlv-ind-label {
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .03em;
  margin-bottom: 4px;
}
.dlv-ind-val {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}
.dlv-ind-sub {
  font-size: .71rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Linha de gráficos ── */
.dlv-charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.dlv-chart-card { flex: 1; }
@media (max-width: 900px) {
  .dlv-charts-row { grid-template-columns: 1fr; }
}

/* ── Ranking plataformas ── */
.dlv-ranking-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}
.dlv-ranking-table th {
  background: var(--bg-secondary, #f8fafc);
  padding: 8px 12px;
  text-align: left;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}
.dlv-ranking-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.dlv-ranking-table tr:last-child td { border-bottom: none; }
.dlv-ranking-table tr:hover td { background: var(--bg-secondary, #f8fafc); }
.dlv-rank-pos {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700;
  color: #fff;
}
.dlv-rank-bar-wrap {
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  width: 80px;
  display: inline-block;
  vertical-align: middle;
}
.dlv-rank-bar {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #6366f1, #22c55e);
  transition: width .4s ease;
}

/* Tabela evolução */
.dlv-evo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .8rem;
}
.dlv-evo-table th {
  background: var(--bg-secondary, #f8fafc);
  padding: 7px 12px;
  font-size: .73rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  text-align: right;
}
.dlv-evo-table th:first-child { text-align: left; }
.dlv-evo-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  text-align: right;
}
.dlv-evo-table td:first-child { text-align: left; font-weight: 600; }
.dlv-evo-table tfoot td {
  font-weight: 700;
  background: var(--bg-secondary, #f8fafc);
}
.dlv-evo-table tr:hover td { background: rgba(99,102,241,.04); }
.dlv-evo-lider {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .72rem; font-weight: 600;
  padding: 2px 8px; border-radius: 20px;
  background: rgba(249,115,22,.1); color: #ea580c;
}

/* ── Upload de Logo de Plataforma ── */
.plat-logo-upload-wrap {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.plat-logo-preview {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  background: var(--bg-secondary, #f1f5f9);
  border: 2px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  flex-shrink: 0;
  overflow: hidden;
  transition: border-color .15s;
}
.plat-logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
}
.plat-logo-preview:hover { border-color: var(--primary); }
.plat-logo-upload-actions { flex: 1; }
.plat-logo-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .8rem;
}

/* Botão CSV */
.btn-csv {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: .78rem; font-weight: 600;
  cursor: pointer; color: var(--text-secondary);
  transition: all .15s;
}
.btn-csv:hover { background: var(--bg-secondary); }

/* Chips dos dias da semana no gráfico */
.dlv-dia-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: .74rem; font-weight: 700;
}
.dlv-dia-chip.best { background: rgba(34,197,94,.12); color: #16a34a; }
.dlv-dia-chip.worst { background: rgba(239,68,68,.12); color: #dc2626; }

/* Indicador de comparativo */
.dlv-vs-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: .7rem; font-weight: 600; padding: 1px 6px;
  border-radius: 99px;
}
.dlv-vs-badge.up   { background: rgba(34,197,94,.12); color: #16a34a; }
.dlv-vs-badge.down { background: rgba(239,68,68,.12); color: #dc2626; }
.dlv-vs-badge.eq   { background: rgba(100,116,139,.1); color: #64748b; }

/* ═══════════════════════════════════════════════════════════════
   DELIVERY v2.0 — NOVOS ESTILOS (modal pedido, repasses, tabela agrupada)
   ═══════════════════════════════════════════════════════════════ */

/* ── Tabela agrupada por dia ── */
.dlv-dia-header {
  background: var(--bg-secondary, #f8fafc);
  user-select: none;
}
.dlv-dia-header:hover td { background: rgba(99,102,241,.06); cursor: pointer; }
.dlv-dia-header td { border-top: 2px solid var(--border); padding: 6px 14px !important; }
.dlv-grupo-chevron { display: inline-block; transition: transform .2s; }
.dlv-pedido-row { transition: background .12s; }
.dlv-pedido-row:hover td { background: rgba(99,102,241,.04); cursor: pointer; }

/* ── Repasses — sumário e tabela ── */
.dlv-repasse-resumo {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-secondary, #f8fafc);
  border-radius: var(--radius);
  margin-bottom: 12px;
  border: 1px solid var(--border);
}
.dlv-repasse-total-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 130px;
  flex: 1;
}
.dlv-repasse-total-item span {
  font-size: .72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.dlv-repasse-total-item strong {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}
.dlv-repasse-highlight {
  border-left: 3px solid #6366f1;
  padding-left: 10px;
}
.dlv-repasse-highlight strong { color: #6366f1 !important; }
.dlv-repasse-highlight-warn {
  border-left: 3px solid var(--warning);
  padding-left: 10px;
}
/* v7.9.3 — Resultado real da loja (repasse − motoboy) */
.dlv-repasse-resultado-loja {
  border-left: 3px solid #7c3aed;
  padding-left: 10px;
  background: rgba(124,58,237,.04);
  border-radius: 0 6px 6px 0;
}
.dlv-repasse-resultado-loja strong { color: #7c3aed !important; }
.dlv-repasse-row.dlv-repasse-vencido { background: rgba(239,68,68,.04); }
.dlv-repasse-row.dlv-repasse-vencido:hover td { background: rgba(239,68,68,.08); }

/* ── Modal detalhado do pedido ── */
.dlv-modal-pedido {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.dlv-modal-header-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 18px 10px;
  background: var(--bg-secondary, #f8fafc);
  border-bottom: 1px solid var(--border);
}
.dlv-modal-plat {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 700;
}
.dlv-modal-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dlv-modal-data {
  font-size: .82rem;
  color: var(--text-secondary);
}
.dlv-modal-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.dlv-modal-info-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dlv-modal-info-item span {
  font-size: .7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .03em;
  font-weight: 600;
}
.dlv-modal-info-item strong {
  font-size: .84rem;
  color: var(--text-primary);
}
.dlv-modal-financeiro {
  padding: 14px 18px;
}
.dlv-modal-secao-titulo {
  font-size: .82rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dlv-modal-fin-secao {
  background: var(--bg-secondary, #f8fafc);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
}
.dlv-modal-fin-titulo {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.dlv-modal-fin-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
  font-size: .84rem;
  color: var(--text-secondary);
}
.dlv-modal-fin-row span { flex: 1; }
.dlv-modal-fin-row strong { font-size: .86rem; }
.dlv-modal-fin-minus { color: var(--danger) !important; }
.dlv-modal-fin-minus strong { color: var(--danger) !important; }
.dlv-modal-fin-total {
  border-top: 1px solid var(--border);
  margin-top: 5px;
  padding-top: 6px;
  font-weight: 700;
}
.dlv-modal-fin-liquido {
  background: rgba(34,197,94,.07);
  border-color: rgba(34,197,94,.3);
}
.dlv-modal-fin-liquido .dlv-modal-fin-row { font-weight: 600; }

/* Plat badge na tabela */
.dlv-plat-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-secondary, #f1f5f9);
  border-radius: 20px;
  padding: 2px 8px;
  font-size: .78rem;
  border: 1px solid var(--border);
}

@media (max-width: 768px) {
  .dlv-modal-info-grid { grid-template-columns: 1fr 1fr; }
  .dlv-repasse-resumo  { flex-direction: column; gap: 8px; }
}

/* ============================================================
   DELIVERY v6.9 — Chips info, motoboy badge, diária calendar
   ============================================================ */

/* Chips de informação rápida no modal de pedido (estilo iFood) */
.dlv-info-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 18px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.dlv-info-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-secondary, #f8fafc);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 12px;
  min-width: 110px;
}
.dlv-info-chip i { font-size: 1rem; flex-shrink: 0; }
.dlv-info-chip div { display: flex; flex-direction: column; gap: 0; }
.dlv-info-chip span { font-size: .65rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); font-weight: 600; }
.dlv-info-chip strong { font-size: .82rem; color: var(--text-primary); }

/* ── Blocos extras do modal delivery (v7.4 — iFood-faithful) ── */
.dlv-modal-bloco {
  margin: 0 18px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.dlv-modal-bloco-titulo {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 8px 14px;
  background: var(--bg-secondary, #f8fafc);
  border-bottom: 1px solid var(--border);
}
.dlv-modal-bloco-body {
  padding: 12px 14px;
}

/* Grid de métricas operacionais */
.dlv-modal-ops-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.dlv-ops-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: var(--bg-secondary, #f8fafc);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  text-align: center;
}
.dlv-ops-item i { font-size: 1.1rem; margin-bottom: 2px; }
.dlv-ops-item span { font-size: .65rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); font-weight: 600; }
.dlv-ops-item strong { font-size: .88rem; font-weight: 700; }

/* Badge motoboy pendente na listagem */
.badge-mb-pendente {
  background: #fef3c7;
  color: #b45309;
  border-radius: 8px;
  padding: 1px 5px;
  font-size: .6rem;
  font-weight: 700;
  border: 1px solid #fde68a;
}

/* ── Calendário de Diárias ── */
.diaria-cal-grid {
  user-select: none;
}
.diaria-cal-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 4px;
}
.diaria-cal-dow {
  text-align: center;
  font-size: .7rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 4px 0;
}
.diaria-cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.diaria-cal-day {
  position: relative;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: .82rem;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  transition: background .15s, border-color .15s;
  font-weight: 500;
}
.diaria-cal-day:hover:not(.diaria-pago):not(.diaria-empty) {
  background: rgba(99,102,241,.12);
  border-color: #6366f1;
}
.diaria-cal-day.diaria-sel {
  background: rgba(99,102,241,.18);
  border-color: #6366f1;
  color: #4338ca;
  font-weight: 700;
}
.diaria-cal-day.diaria-pago {
  background: #dcfce7;
  border-color: #86efac;
  color: #16a34a;
  cursor: default;
  font-weight: 700;
}
.diaria-cal-day.diaria-empty {
  border: none;
  background: transparent;
  cursor: default;
}
.diaria-pago-dot {
  position: absolute;
  top: 1px;
  right: 3px;
  font-size: .55rem;
  color: #16a34a;
}

/* ── Campo diária no modal de pessoa ── */
#pessoa-diaria-group input[type=number] {
  font-size: .9rem;
}

/* ── Status motoboy no modal de pedido ── */
.mb-status-pago { color: #16a34a; font-weight: 700; }
.mb-status-pendente { color: #b45309; font-weight: 700; }

@media (max-width: 480px) {
  .dlv-info-chips { gap: 5px; }
  .dlv-info-chip  { min-width: 90px; padding: 5px 8px; }
  .diaria-cal-day { font-size: .75rem; }
}

/* ============================================================
   MULTI-SELEÇÃO E AÇÕES EM LOTE (v7.1)
   ============================================================ */

/* Barra de ações em lote — aparece acima da tabela */
.batch-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: linear-gradient(90deg, #eff6ff 0%, #f0fdf4 100%);
  border-bottom: 2px solid var(--primary-light);
  flex-wrap: wrap;
}
.batch-count {
  font-size: .88rem;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
}
.batch-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ── Edição em Massa (v8.5.23) ── */
#modal-batch-editar .modal-header {
  border-radius: 8px 8px 0 0;
}
#modal-batch-editar .form-row {
  gap: 12px;
}
#modal-batch-editar .form-group {
  margin-bottom: 0;
}

/* ── Paginação: select por página (v8.5.23) ── */
#lanc-per-page-sel {
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  transition: border-color .2s;
}
#lanc-per-page-sel:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59,130,246,.15);
}

/* Linha selecionada na tabela */
.batch-row-selected td {
  background: rgba(59,130,246,.07) !important;
}

/* Checkbox da coluna de seleção */
.lanc-row-cb {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary);
}

/* ============================================================
   REEMBOLSOS — BATCH TOOLBAR (v7.2)
   ============================================================ */

#reemb-batch-toolbar {
  transition: opacity .2s;
}
#reemb-batch-toolbar label {
  cursor: pointer;
  user-select: none;
}
.reemb-row-cb {
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: var(--primary);
}
#reemb-sel-count {
  font-size: .78rem;
  color: var(--primary);
  font-weight: 600;
  white-space: nowrap;
}


/* ============================================================
   CALENDÁRIO DE DIÁRIAS NO MODAL DE PAGAMENTO (v7.0)
   ============================================================ */

.pgto-cal-container {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-card);
  margin-top: 8px;
}
.pgto-cal-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-secondary, #f8fafc);
  border-bottom: 1px solid var(--border);
  font-size: .82rem;
}
.pgto-cal-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  font-size: .84rem;
}
.pgto-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  padding: 8px;
}
.pgto-cal-dow {
  text-align: center;
  font-size: .68rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 2px 0;
}
.pgto-cal-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: .8rem;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-secondary, #f8fafc);
  transition: all .15s;
  font-weight: 500;
}
.pgto-cal-cell:hover:not(.pgto-cal-empty) {
  background: rgba(59,130,246,.14);
  border-color: var(--primary-light);
}
.pgto-cal-cell.pgto-cal-sel {
  background: var(--primary);
  border-color: var(--primary-dark);
  color: #fff;
  font-weight: 700;
}
.pgto-cal-cell.pgto-cal-empty {
  border: none;
  background: transparent;
  cursor: default;
}
.pgto-cal-resumo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-secondary, #f8fafc);
  border-top: 1px solid var(--border);
  font-size: .82rem;
  flex-wrap: wrap;
}
.pgto-cal-dias-sel {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px 12px;
  border-top: 1px solid var(--border);
}
.pgto-cal-dias-sel span {
  background: rgba(59,130,246,.12);
  color: var(--primary);
  font-size: .72rem;
  padding: 2px 7px;
  border-radius: 20px;
  font-weight: 600;
}
.pgto-cal-aviso {
  padding: 10px 14px;
  font-size: .82rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ============================================================
   REPASSE SEMANAL — badge de tipo
   ============================================================ */
.repasse-tipo-semanal {
  background: #ede9fe;
  color: #6d28d9;
  font-size: .7rem;
  padding: 2px 7px;
  border-radius: 20px;
  font-weight: 600;
  margin-left: 4px;
}

/* ============================================================
   RECIBO DE PAGAMENTO — estilos do pop-up de impressão
   ============================================================ */
.recibo-section { margin-bottom: 10px; }
.recibo-label   { font-size: .72rem; color: #94a3b8; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 2px; }
.recibo-value   { font-size: .92rem; font-weight: 600; color: #1e293b; }
.recibo-dias    { font-size: .8rem; color: #475569; line-height: 1.7; }

/* ============================================================
   HISTÓRICO PESSOA — dias de diária badge
   ============================================================ */
.phist-dias-wrap { margin-top: 4px; }
.phist-dias-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 20px;
  padding: 2px 9px;
  font-size: .75rem;
  color: #15803d;
  cursor: pointer;
  font-weight: 600;
}
.phist-dias-detalhes {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}
.phist-dias-detalhes span {
  background: #dcfce7;
  color: #16a34a;
  font-size: .72rem;
  padding: 2px 7px;
  border-radius: 10px;
}

@media (max-width: 640px) {
  .batch-toolbar { flex-direction: column; align-items: flex-start; }
  .batch-actions { gap: 4px; }
  .pgto-cal-cell { font-size: .72rem; }
}

/* ============================================================
   RELATÓRIO OFICIAL DE FATURAMENTO DIÁRIO — SHOPPING / LOCADORA
   v7.7
   ============================================================ */

/* Cabeçalho / header do card */
.rof-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.rof-header {
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
  border-bottom: 2px solid #1e40af;
  border-radius: var(--radius) var(--radius) 0 0;
}
.rof-icon-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #1e40af;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* Faixa de KPIs */
.rof-kpis-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 16px 8px;
}
.rof-kpi-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  flex: 1;
  min-width: 160px;
  transition: box-shadow .15s;
}
.rof-kpi-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,.07); }
.rof-kpi-card.rof-kpi-best  { border-left: 3px solid #16a34a; }
.rof-kpi-card.rof-kpi-worst { border-left: 3px solid #dc2626; }
.rof-kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.rof-kpi-label {
  font-size: .72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 600;
}
.rof-kpi-val {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
  margin: 2px 0;
}
.rof-kpi-sub {
  font-size: .68rem;
  color: var(--text-muted);
}

/* Tabela diária */
.rof-tabela {
  width: 100%;
  border-collapse: collapse;
  font-size: .83rem;
}
.rof-tabela thead th {
  background: var(--bg-secondary, #f8fafc);
  font-size: .76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--text-muted);
  padding: 8px 10px;
  border-bottom: 2px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1;
}
.rof-tabela tbody tr { border-bottom: 1px solid var(--border); }
.rof-tabela tbody tr.rof-row-dia {
  cursor: pointer;
  transition: background .12s;
}
.rof-tabela tbody tr.rof-row-dia:hover {
  background: rgba(30,64,175,.04) !important;
}
.rof-row-alt   { background: rgba(0,0,0,.018); }
.rof-row-best  { background: rgba(22,163,74,.07) !important; }
.rof-row-worst { background: rgba(220,38,38,.05) !important; }

/* Ícone de expandir */
.rof-expand-icon {
  font-size: .65rem;
  color: var(--text-muted);
  transition: transform .2s;
}
.rof-expand-icon.rof-icon-open {
  transform: rotate(90deg);
  color: #1e40af;
}

/* Linhas de detalhe */
.rof-detalhe-row {
  background: var(--bg-secondary, #f8fafc) !important;
  border-bottom: 1px solid var(--border);
}
.rof-detalhe-row td {
  padding: 5px 10px;
}
.rof-badge-canal {
  display: inline-flex;
  align-items: center;
  font-size: .65rem;
  background: #dbeafe;
  color: #1e40af;
  border-radius: 6px;
  padding: 1px 7px;
  font-weight: 600;
  margin-right: 4px;
}
.rof-badge-pgto {
  display: inline-flex;
  align-items: center;
  font-size: .65rem;
  background: #f0fdf4;
  color: #16a34a;
  border-radius: 6px;
  padding: 1px 7px;
  font-weight: 600;
}

/* Rodapé da tabela */
.rof-tfoot-row td {
  background: #eff6ff;
  border-top: 2px solid #1e40af;
  padding: 10px;
  font-size: .85rem;
}

/* Responsivo */
@media (max-width: 640px) {
  .rof-kpis-row { flex-direction: column; }
  .rof-kpi-card { min-width: unset; }
  .rof-tabela thead th,
  .rof-tabela tbody td { font-size: .72rem; padding: 6px 6px; }
}

/* ============================================================
   FATURAS DE CARTÃO DE CRÉDITO — v8.1.0
   ============================================================ */

/* Container de uma fatura individual */
.fatura-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  background: var(--bg-card);
  transition: box-shadow .15s;
}
.fatura-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,.07); }
.fatura-card:last-child { margin-bottom: 0; }

/* Fatura já paga — toque verde sutil */
.fatura-card-paga {
  border-left: 3px solid #22c55e;
  opacity: .9;
}
.fatura-card-paga .fatura-card-header { background: rgba(34,197,94,.04); }

/* Fatura vencida — toque vermelho */
.fatura-card-vencida {
  border-left: 3px solid #ef4444;
}
.fatura-card-vencida .fatura-card-header { background: rgba(239,68,68,.04); }

/* Cabeçalho clicável da fatura */
.fatura-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
  background: var(--bg-secondary, #f8fafc);
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.fatura-card-header:hover { background: rgba(99,102,241,.06); }

/* Ícone de seta expand/collapse */
.fatura-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: rgba(99,102,241,.1);
  color: #6366f1;
  font-size: .75rem;
  flex-shrink: 0;
  transition: background .12s;
}

/* Corpo da fatura (tabela de itens) */
.fatura-card-body {
  padding: 0;
}

/* Faixa de KPIs de faturas */
.fatura-kpi {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 16px;
  min-width: 130px;
  flex: 1;
}
.fatura-kpi-aberta {
  border-left: 3px solid #ef4444;
  background: rgba(239,68,68,.03);
}
.fatura-kpi-label {
  font-size: .7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 600;
}
.fatura-kpi-val {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
}

/* Dica de ciclo da fatura no modal do cartão */
.cartao-fatura-hint {
  font-size: .73rem;
  color: var(--text-muted);
  margin: 4px 0 10px;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  background: rgba(99,102,241,.05);
  border: 1px solid rgba(99,102,241,.12);
  border-radius: 6px;
  padding: 7px 10px;
  line-height: 1.5;
}
.cartao-fatura-hint i { color: #6366f1; margin-top: 1px; flex-shrink: 0; }

@media (max-width: 640px) {
  .fatura-card-header { flex-direction: column; align-items: flex-start; }
  .fatura-kpi { min-width: 100px; }
}

/* ============================================================
   MELHORIAS UI FATURAS — v8.2.0
   ============================================================ */

/* Info bancária na fatura */
.fatura-bank-info {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 5px;
  font-size: .72rem;
  color: var(--text-muted);
}
.fatura-bank-info span { display: flex; align-items: center; gap: 4px; }

/* Coluna de resumo financeiro */
.fatura-resumo-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  flex-shrink: 0;
  min-width: 140px;
}
.fatura-resumo-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  width: 100%;
  font-size: .8rem;
}
.fatura-resumo-label { color: var(--text-muted); font-size: .75rem; }
.fatura-resumo-val { font-weight: 600; }
.fatura-resumo-saldo {
  font-size: .85rem;
  font-weight: 800;
  padding-top: 4px;
  border-top: 1px solid var(--border);
  margin-top: 2px;
}

/* Tabela interna da fatura */
.fatura-table { font-size: .8rem; }
.fatura-table th { font-size: .72rem; }
.fatura-tr-parcial { border-left: 3px solid #f97316; background: #fffbf5; }
.fatura-tr-paga    { opacity: .7; background: #f0fdf4; }

/* Badge de parcela */
.fatura-parc-badge {
  font-size: .65rem;
  background: #e0e7ff;
  color: #3730a3;
  border-radius: 4px;
  padding: 0 5px;
  font-weight: 700;
}

/* Célula de ações na fatura */
.fatura-acoes-cell {
  white-space: nowrap;
  text-align: center;
  padding: 4px 6px !important;
}
.fatura-acoes-cell .btn { font-size: .68rem; padding: 2px 6px; }

/* Botão pagar na fatura */
.fatura-btn-pagar {
  color: #16a34a !important;
  border-color: #16a34a !important;
}
.fatura-btn-pagar:hover { background: #f0fdf4 !important; }

/* Rodapé da fatura (footer da tabela) */
.fatura-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: var(--bg-secondary, #f8fafc);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 8px;
}

/* ============================================================
   MÓDULO EVENTOS — v8.2.0
   Tabs, cards de performance, badges, etc.
   ============================================================ */

/* Barra de tabs interna dos eventos */
.evt-tabs-bar {
  display: flex;
  gap: 4px;
  background: var(--bg-secondary, #f8fafc);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px;
  flex-wrap: wrap;
}
.evt-tab {
  flex: 1;
  min-width: 120px;
  padding: 8px 14px;
  border: none;
  border-radius: calc(var(--radius) - 3px);
  background: transparent;
  color: var(--text-secondary);
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.evt-tab:hover { background: rgba(99,102,241,.07); color: #6366f1; }
.evt-tab.active {
  background: #6366f1;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(99,102,241,.3);
}

/* Cards de performance de evento */
.evt-perf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.evt-perf-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: box-shadow .12s;
}
.evt-perf-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,.07); }
.evt-perf-icon { font-size: 1.1rem; margin-bottom: 2px; }
.evt-perf-label {
  font-size: .7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 600;
}
.evt-perf-val {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
}
.evt-perf-norm { font-size: .68rem; color: var(--text-muted); }
.evt-perf-diff { font-size: .73rem; font-weight: 700; }

/* Badges de data do evento */
.evt-badge-hoje {
  font-size: .7rem;
  background: #dcfce7;
  color: #16a34a;
  border-radius: 20px;
  padding: 1px 8px;
  font-weight: 700;
}
.evt-badge-futuro {
  font-size: .7rem;
  background: #dbeafe;
  color: #1d4ed8;
  border-radius: 20px;
  padding: 1px 8px;
  font-weight: 700;
}

/* Badge de tipo de evento */
.evt-tipo-badge {
  font-size: .75rem;
  background: rgba(99,102,241,.1);
  color: #6366f1;
  border-radius: 20px;
  padding: 1px 8px;
}

/* Detalhe info do evento */
.evt-detalhe-info {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: rgba(99,102,241,.04);
  border-radius: 8px;
  border: 1px solid rgba(99,102,241,.1);
  font-size: .78rem;
  color: var(--text-secondary);
}
.evt-detalhe-info:empty { display: none; }

/* ============================================================
   RESPONSIVO — ajustes para telas menores
   ============================================================ */
@media (max-width: 600px) {
  .evt-tabs-bar { flex-direction: column; }
  .evt-tab { min-width: unset; }
  .evt-perf-grid { grid-template-columns: 1fr 1fr; }
  .fatura-resumo-col { min-width: unset; width: 100%; align-items: flex-start; }
  .fatura-bank-info { gap: 6px; }
}

/* ============================================================
   BANKING INVOICE UI — v8.2.0
   Redesign completo em estilo bancário profissional
   ============================================================ */

/* KPIs bancários */
.fatura-kpi-bank {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  min-width: 140px;
  flex: 1;
}
.fatura-kpi-bank-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: .95rem;
}
.fatura-kpi-bank-label {
  font-size: .68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 600;
  margin-bottom: 1px;
}
.fatura-kpi-bank-val {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}
.fatura-kpi-bank-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.fatura-kpi-badge {
  font-size: .62rem;
  padding: 1px 6px;
  border-radius: 20px;
  font-weight: 700;
}
.fatura-badge-aberta  { background: #fff7ed; color: #c2410c; }
.fatura-badge-parcial { background: #fff3e0; color: #b45309; }
.fatura-badge-paga    { background: #f0fdf4; color: #16a34a; }
.fatura-badge-vencida { background: #fee2e2; color: #991b1b; }

/* Cartão de fatura v2 */
.fatura-card-v2 {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
  margin-bottom: 14px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
  transition: box-shadow .15s;
}
.fatura-card-v2:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }

/* Header v2 */
.fatura-header-v2 {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
  transition: background .12s;
}
.fatura-header-v2:hover { background: rgba(99,102,241,.03); }

.fatura-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding-top: 2px;
}

.fatura-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
  flex-shrink: 0;
}
.fatura-icon-primary { background: rgba(99,102,241,.12); color: #6366f1; }
.fatura-icon-success { background: rgba(34,197,94,.12);  color: #16a34a; }
.fatura-icon-danger  { background: rgba(239,68,68,.12);  color: #ef4444; }

.fatura-header-center {
  flex: 1;
  min-width: 0;
}
.fatura-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 5px;
}
.fatura-venc-label {
  font-size: .72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: .04em;
}
.fatura-venc-date {
  font-size: .95rem;
  font-weight: 800;
  color: var(--text-primary);
}
.fatura-ciclo-info {
  background: #fff7ed;
  color: #c2410c;
  font-weight: 600;
}
.fatura-progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.fatura-progress-bar-wrap {
  flex: 1;
  min-width: 80px;
  height: 5px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.fatura-progress-bar {
  height: 100%;
  border-radius: 99px;
  transition: width .5s ease;
}
.fatura-progress-pct {
  font-size: .68rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.fatura-items-info {
  font-size: .7rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.fatura-acoes-rapidas {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.fatura-btn-full {
  width: 100%;
  justify-content: center;
}
.fatura-btn-export {
  color: var(--text-muted) !important;
  border-color: var(--border) !important;
}
.fatura-btn-export:hover { color: #6366f1 !important; border-color: #6366f1 !important; }

/* Botões de item na fatura */
.fatura-btn-pagar {
  color: #16a34a !important;
  border: 1px solid #16a34a !important;
  background: transparent !important;
  font-size: .68rem !important;
  padding: 2px 7px !important;
  border-radius: 5px !important;
}
.fatura-btn-pagar:hover { background: #f0fdf4 !important; }
.fatura-btn-reemb {
  color: #64748b !important;
  border: 1px solid var(--border) !important;
  background: transparent !important;
  font-size: .68rem !important;
  padding: 2px 7px !important;
  border-radius: 5px !important;
}
.fatura-btn-reemb:hover { background: var(--bg-secondary) !important; }
.fatura-btn-edit {
  color: #6366f1 !important;
  border: 1px solid #c7d2fe !important;
  background: transparent !important;
  font-size: .68rem !important;
  padding: 2px 6px !important;
  border-radius: 5px !important;
}
.fatura-btn-edit:hover { background: #eef2ff !important; }
.fatura-btn-del {
  color: #ef4444 !important;
  border: 1px solid #fecaca !important;
  background: transparent !important;
  font-size: .68rem !important;
  padding: 2px 6px !important;
  border-radius: 5px !important;
}
.fatura-btn-del:hover { background: #fee2e2 !important; }
.fatura-btn-label {
  font-size: .65rem;
  font-weight: 600;
}

/* Status do item */
.fatura-item-status {
  font-size: .6rem;
  padding: 0 5px;
  border-radius: 20px;
  font-weight: 700;
  vertical-align: middle;
}
.fatura-item-pago     { background: #f0fdf4; color: #16a34a; }
.fatura-item-parcial  { background: #fff7ed; color: #c2410c; }
/* v8.5.17 — item estornado */
.fatura-item-estornado { background: #f1f5f9; color: #64748b; border: 1px solid #cbd5e1; }
.fatura-tr-estornado   { opacity: .55; background: #f8fafc; text-decoration-line: none; }
.fatura-tr-estornado td { color: #94a3b8 !important; }
.fatura-item-estornado-info { font-size: .7rem; color: #94a3b8; padding: 2px 4px; }

/* v8.5.17 — botão Estornar Item */
.fatura-btn-estorno {
  color: #b45309 !important;
  border: 1px solid #fde68a !important;
  background: #fffbeb !important;
  font-size: .68rem !important;
  padding: 2px 7px !important;
  border-radius: 5px !important;
}
.fatura-btn-estorno:hover { background: #fef3c7 !important; }

/* ── v8.5.19 — Estorno em lote ─────────────────────────────────────────────── */

/* Célula do checkbox */
.fatura-td-check {
  width: 32px;
  min-width: 32px;
  padding: 0 4px !important;
  vertical-align: middle;
  text-align: center;
}
.fatura-td-check input[type="checkbox"] {
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: #6366f1;
  border-radius: 3px;
}

/* Barra de ações em lote — aparece quando há itens selecionados */
.fatura-lote-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #1e1e3f;
  border: 1px solid #6366f1;
  border-radius: 8px;
  padding: 8px 14px;
  margin: 0 0 8px;
  animation: fadeIn .15s ease;
}
.fatura-lote-count {
  font-size: .82rem;
  color: #a5b4fc;
  font-weight: 600;
}
.fatura-btn-estorno-lote {
  background: #ef4444 !important;
  color: #fff !important;
  border: none !important;
  font-size: .78rem !important;
  padding: 5px 12px !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  font-weight: 600 !important;
  transition: background .15s;
}
.fatura-btn-estorno-lote:hover { background: #dc2626 !important; }

/* Células da tabela de fatura */
.fatura-td-data  { font-size: .75rem; white-space: nowrap; color: var(--text-muted); }
.fatura-td-desc  { font-size: .78rem; max-width: 240px; }
.fatura-desc-text { font-weight: 500; }
.fatura-td-val   { font-size: .78rem; white-space: nowrap; }

/* Table wrapper */
.fatura-table-wrap {
  overflow-x: auto;
  border-top: 1px solid var(--border);
}

/* Footer melhorado */
.fatura-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: var(--bg-secondary, #f8fafc);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 8px;
  font-size: .75rem;
}
.fatura-footer-left  { display: flex; gap: 16px; align-items: center; color: var(--text-muted); }
.fatura-footer-right { display: flex; gap: 12px; align-items: center; }
.fatura-footer-saldo { font-weight: 700; color: #ef4444; }

/* ============================================================
   MODAL EXCLUIR IMPORTAÇÕES STONE (v8.5.27)
   Prefixo: mes- (modal-excluir-stone)
   ============================================================ */

.mes-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.mes-modal-box {
  background: #1e2535;
  border: 1px solid #334155;
  border-radius: 14px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,.65);
  color: #e2e8f0;
}

.mes-modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid #334155;
  background: #7f1d1d;
  border-radius: 14px 14px 0 0;
}

.mes-modal-header h3 {
  margin: 0;
  flex: 1;
  font-size: 1rem;
  font-weight: 700;
  color: #fecaca;
}

.mes-modal-close {
  background: transparent;
  border: none;
  color: #fca5a5;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
}
.mes-modal-close:hover { background: rgba(255,255,255,.12); }

.mes-modal-body {
  padding: 20px 22px 22px;
}

.mes-aviso-vermelho {
  background: #450a0a;
  border: 1px solid #7f1d1d;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: .82rem;
  color: #fca5a5;
  line-height: 1.6;
  margin-bottom: 18px;
}

.mes-field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
}

.mes-label {
  font-size: .78rem;
  color: #94a3b8;
  font-weight: 500;
}

.mes-label-danger {
  color: #f87171;
}

.mes-select,
.mes-input {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 7px;
  color: #e2e8f0;
  font-size: .88rem;
  padding: 8px 10px;
  width: 100%;
  box-sizing: border-box;
  transition: border-color .15s;
}
.mes-select:focus,
.mes-input:focus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 0 2px rgba(96,165,250,.15);
}
.mes-input::placeholder { color: #475569; }

.mes-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

/* Botões */
.mes-btn {
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: opacity .15s;
}
.mes-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}
.mes-btn-preview {
  background: #1e40af;
  color: #fff;
  width: 100%;
  justify-content: center;
  margin-top: 4px;
}
.mes-btn-preview:hover:not(:disabled) { background: #1d4ed8; }

.mes-btn-danger {
  background: #dc2626;
  color: #fff;
  flex: 1;
}
.mes-btn-danger:hover:not(:disabled) { background: #b91c1c; }

.mes-btn-voltar {
  background: #334155;
  color: #e2e8f0;
}
.mes-btn-voltar:hover { background: #475569; }

/* Preview box */
.mes-preview-box {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 16px;
}

.mes-preview-header {
  font-size: .78rem;
  font-weight: 700;
  color: #60a5fa;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.mes-preview-periodo {
  font-size: .84rem;
  color: #94a3b8;
  margin-bottom: 12px;
}
.mes-preview-periodo strong { color: #f1f5f9; }

.mes-preview-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0 20px;
  font-size: .86rem;
  line-height: 2;
}

.mes-preview-label { color: #94a3b8; }
.mes-preview-val   { font-weight: 700; text-align: right; color: #f1f5f9; }
.val-danger  { color: #f87171; }
.val-warning { color: #fbbf24; }
.val-zero    { color: #475569; }

.mes-preview-vazio {
  margin-top: 12px;
  padding: 10px 12px;
  background: #052e16;
  border: 1px solid #166534;
  border-radius: 7px;
  font-size: .82rem;
  color: #4ade80;
  text-align: center;
}

@media (max-width: 520px) {
  .mes-row-2 { grid-template-columns: 1fr; }
  .mes-modal-box { max-height: 95vh; }
}

/* ============================================================
   EVENT ANALYSIS ENHANCEMENTS — v8.2.0
   ============================================================ */

/* Veredicto box */
.evt-veredicto-box {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 20px;
}
.evt-veredicto-icon { font-size: 2rem; flex-shrink: 0; margin-top: 2px; }
.evt-veredicto-body { flex: 1; }
.evt-veredicto-msg {
  font-weight: 700;
  font-size: .93rem;
  margin-bottom: 5px;
}
.evt-veredicto-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: .72rem;
  color: var(--text-muted);
}
.evt-veredicto-sub span { display: flex; align-items: center; gap: 4px; }

/* Performance card variants */
.evt-perf-card-pos {
  border-left: 3px solid #22c55e !important;
  background: rgba(34,197,94,.02) !important;
}
.evt-perf-card-neg {
  border-left: 3px solid #f87171 !important;
  background: rgba(239,68,68,.02) !important;
}
.evt-perf-status {
  font-size: .68rem;
  font-weight: 700;
  padding: 0 5px;
  border-radius: 4px;
}
.evt-perf-ok  { background: rgba(34,197,94,.1);  color: #16a34a; }
.evt-perf-bad { background: rgba(239,68,68,.1);  color: #dc2626; }

/* Breakdown grid */
.evt-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.evt-breakdown-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}
.evt-breakdown-title {
  font-size: .82rem;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.evt-breakdown-item {
  margin-bottom: 10px;
}
.evt-breakdown-total {
  font-size: .8rem;
  font-weight: 700;
  text-align: right;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* Type mini badges */
.evt-tipo-mini {
  font-size: .67rem;
  padding: 0 6px;
  border-radius: 4px;
  font-weight: 600;
}
.evt-tipo-receita  { background: rgba(34,197,94,.1);  color: #16a34a; }
.evt-tipo-despesa  { background: rgba(239,68,68,.1);  color: #dc2626; }
.evt-tipo-invest   { background: rgba(124,58,237,.1); color: #7c3aed; }

/* ============================================================
   PRODUCTS IN EVENTS KPIs — v8.2.0
   ============================================================ */

.evt-prod-kpi {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}
.evt-prod-kpi-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  flex-shrink: 0;
}
.evt-prod-kpi-label {
  font-size: .68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: .03em;
}
.evt-prod-kpi-val {
  font-size: .95rem;
  font-weight: 800;
}

/* ============================================================
   CARD INTERFACE — cleanup v8.2.0
   Remove visual clutter, keep only decision-relevant info
   ============================================================ */

/* Rank position badge */
.rank-pos {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(99,102,241,.1);
  color: #6366f1;
  font-size: .72rem;
  font-weight: 700;
}

/* ============================================================
   RESPONSIVE ADDITIONS — v8.2.0
   ============================================================ */
@media (max-width: 768px) {
  .fatura-header-v2 { flex-wrap: wrap; }
  .fatura-resumo-col { order: 3; width: 100%; flex-direction: row; flex-wrap: wrap; gap: 8px; align-items: center; }
  .fatura-resumo-row { width: auto; }
  .fatura-acoes-rapidas { order: 4; width: 100%; }
  .fatura-btn-full { width: auto; }
  .fatura-kpi-bank { min-width: 120px; }
  .evt-breakdown-grid { grid-template-columns: 1fr; }
  .evt-veredicto-box { flex-direction: column; gap: 8px; }
  .evt-prod-kpi { padding: 10px 12px; }
}

@media (max-width: 480px) {
  .fatura-td-data, .fatura-td-val { font-size: .72rem; }
  .fatura-btn-label { display: none; }
  .fatura-header-left { gap: 4px; }
  .fatura-card-icon { width: 30px; height: 30px; font-size: .8rem; }
  .fatura-venc-date { font-size: .85rem; }
}

/* ============================================================
   MODAL DE LIQUIDAÇÃO AVANÇADA — v8.3.0
   Pagador | Fontes de Financiamento | Alocação de Responsabilidade
   ============================================================ */

/* Modal mais largo para acomodar as 3 seções */
.reemb-pgto-modal-wide {
  max-width: 600px !important;
  width: 95vw;
}

/* ── Blocos de seção ── */
.reemb-secao-bloco {
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: #fafbfc;
  position: relative;
}

/* Título da seção */
.reemb-secao-titulo {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .8rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 4px;
}
.reemb-secao-titulo span:first-of-type { flex: 1; }

/* Badges de seção */
.reemb-secao-badge {
  font-size: .65rem;
  padding: 2px 7px;
  border-radius: 20px;
  font-weight: 700;
  letter-spacing: .02em;
}
.reemb-badge-info  { background: #ede9fe; color: #6d28d9; }
.reemb-badge-blue  { background: #e0f2fe; color: #0369a1; }
.reemb-badge-green { background: #dcfce7; color: #166534; }

/* ── Seletor de modo de pagamento ── */
.reemb-modo-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .8rem;
  cursor: pointer;
  padding: 5px 12px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  flex: 1;
  justify-content: center;
  transition: border-color .15s, background .15s;
  user-select: none;
}
.reemb-modo-label:has(input:checked) {
  border-color: #6366f1;
  background: #eef2ff;
  color: #4338ca;
  font-weight: 600;
}
.reemb-modo-label input[type="radio"] { cursor: pointer; }

/* ── Totais do modo multi-fonte ── */
.reemb-multi-totais {
  display: flex;
  gap: 16px;
  font-size: .81rem;
  color: var(--text-muted);
  margin-top: 6px;
  flex-wrap: wrap;
}

/* ── Linha de fonte no modo múltiplo ── */
.reemb-multi-fonte-linha {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  padding: 6px 8px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

/* ── Preview de split ── */
.reemb-split-preview {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: .78rem;
}
.reemb-split-titulo {
  color: var(--text-muted);
  font-size: .72rem;
  margin-bottom: 6px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.reemb-split-linha {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
  border-bottom: 1px dashed #f1f5f9;
}
.reemb-split-linha:last-child { border-bottom: none; }
.reemb-split-linha strong { color: #0f172a; }

/* ── Lista de seleção (checkboxes de sócios) ── */
.reemb-split-lista {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.reemb-split-check-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .79rem;
  cursor: pointer;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #fff;
  transition: border-color .15s, background .15s;
  user-select: none;
}
.reemb-split-check-item:has(input:checked) {
  border-color: #059669;
  background: #ecfdf5;
  color: #065f46;
  font-weight: 600;
}

/* ── Linha de % customizada ── */
.reemb-custom-linha {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid #f1f5f9;
}
.reemb-custom-linha:last-child { border-bottom: none; }
.reemb-custom-nome {
  flex: 1;
  font-size: .8rem;
  color: #334155;
}

/* ── Responsivo mobile ── */
@media (max-width: 600px) {
  .reemb-pgto-modal-wide { max-width: 98vw !important; }
  .reemb-secao-bloco { padding: 10px; }
  .reemb-multi-fonte-linha { flex-direction: column; align-items: stretch; }
  .reemb-multi-fonte-linha > div,
  .reemb-multi-fonte-linha > input { width: 100% !important; }
  .reemb-split-lista { flex-direction: column; }
}
