/*
 * ConciliaBank Pro — Design System Refatorado
 * Versão: 4.0 | Estética: "Expert Modern Financial"
 *
 * FILOSOFIA DE DESIGN:
 * ─────────────────────────────────────────────────────
 * Hierarquia clara, dados em primeiro lugar.
 * Laranja reservado APENAS para CTAs primários.
 * Tons de azul-ardósia no menu, cinzas suaves nos painéis.
 * Tipografia DM Sans + DM Mono para valores financeiros.
 * Espaçamento generoso — nunca espremido.
 * ─────────────────────────────────────────────────────
 *
 * IMPORTAR NO <head> do WordPress (ou via wp_enqueue_style):
 * <link rel="preconnect" href="https://fonts.googleapis.com">
 * <link href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&family=DM+Mono:wght@400;500&display=swap" rel="stylesheet">
 */

/* ============================================================
   1. RESET & VARIÁVEIS GLOBAIS
   ============================================================ */
#conciliabank-app *,
#conciliabank-app *::before,
#conciliabank-app *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* ── Paleta Principal: Azul-Ardósia (menu/chrome) ── */
  --navy-950: #0b1120;
  --navy-900: #111827;
  --navy-800: #1a2540;
  --navy-700: #1e2d4f;
  --navy-600: #253562;
  --navy-500: #3b4d78;
  --navy-400: #5a6e9a;
  --navy-200: #a8b6d4;
  --navy-100: #d4daea;
  --navy-50:  #eef1f8;

  /* ── Laranja: APENAS para CTAs ── */
  --cta-500: #f47920;
  --cta-600: #d9650f;
  --cta-100: #fef0e4;

  /* ── Cinzas Neutros (painéis, tabelas) ── */
  --slate-50:  #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  /* ── Semântica de Status ── */
  --status-open-bg:     #fff1f2;
  --status-open-text:   #be123c;
  --status-open-border: #fecdd3;
  --status-open-dot:    #f43f5e;

  --status-partial-bg:     #fffbeb;
  --status-partial-text:   #92400e;
  --status-partial-border: #fde68a;
  --status-partial-dot:    #f59e0b;

  --status-done-bg:     #f0fdf4;
  --status-done-text:   #166534;
  --status-done-border: #bbf7d0;
  --status-done-dot:    #22c55e;

  --debit-color:  #be123c;
  --credit-color: #15803d;

  /* ── Superfícies ── */
  --surface: #ffffff;
  --bg:      #f1f4f9;

  /* ── Tipografia ── */
  --font-ui:   'DM Sans', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'DM Mono', 'Fira Code', monospace;

  /* Escala tipográfica */
  --text-xs:   11px;
  --text-sm:   12px;
  --text-base: 13px;
  --text-md:   14px;
  --text-lg:   15px;
  --text-xl:   16px;

  /* ── Alturas das barras fixas ── */
  --topbar-h:    54px;
  --topbar2-h:   42px;
  --cbar-h:      50px;
  --total-fixed: calc(var(--topbar-h) + var(--topbar2-h) + var(--cbar-h));
  --footer-h:    40px;

  /* ── Raios ── */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* ── Sombras ── */
  --shadow-xs: 0 1px 2px rgba(0,0,0,.06);
  --shadow-sm: 0 1px 4px rgba(0,0,0,.08), 0 0 0 1px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.10), 0 1px 3px rgba(0,0,0,.06);
  --shadow-lg: 0 8px 28px rgba(0,0,0,.14), 0 2px 8px rgba(0,0,0,.08);

  --transition:    0.14s ease;
  --transition-md: 0.22s ease;
}

/* ============================================================
   2. BASE
   ============================================================ */
#conciliabank-app {
  font-family: var(--font-ui);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.5;
  color: var(--slate-800);
  background: var(--bg);
  width: 100%;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   3. TOPBAR — LINHA 1 (logo + nav + stats)
   ============================================================ */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  background: var(--navy-900);
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 0 rgba(255,255,255,.05), 0 4px 16px rgba(0,0,0,.35);
  transition: transform var(--transition-md);
}
.topbar.minimized { transform: translateY(calc(-1 * (var(--topbar-h) + var(--topbar2-h)))); }

.topbar-row {
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 6px;
  height: var(--topbar-h);
  flex-shrink: 0;
}
.topbar-row + .topbar-row {
  border-top: 1px solid rgba(255,255,255,.06);
  height: var(--topbar2-h);
  background: rgba(0,0,0,.12);
}

/* Logo */
.topbar-logo {
  font-family: var(--font-ui);
  font-size: var(--text-xl);
  font-weight: 700;
  color: #fff;
  letter-spacing: -.4px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-right: 8px;
}
.topbar-logo span { color: var(--cta-500); }

.logo-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--navy-500), var(--navy-600));
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  box-shadow: 0 2px 8px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.1);
}

.topbar-divider {
  width: 1px; height: 20px;
  background: rgba(255,255,255,.1);
  flex-shrink: 0;
  margin: 0 6px;
}

/* ── Botões de nav: ghost sutil ── */
.topbar-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 13px;
  height: 32px;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: .25px;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.75);
  transition: var(--transition);
  white-space: nowrap;
}
.topbar-nav-btn:hover {
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.18);
  color: #fff;
}

/* CTA laranja: APENAS upload/ação principal */
.topbar-nav-btn.nav-highlight {
  background: var(--cta-500);
  border-color: transparent;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(244,121,32,.4);
}
.topbar-nav-btn.nav-highlight:hover {
  background: var(--cta-600);
  box-shadow: 0 2px 8px rgba(244,121,32,.5);
}

.topbar-spacer { flex: 1; }

/* Stats */
.topbar-stats { display: flex; gap: 14px; align-items: center; }

.stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
  color: rgba(255,255,255,.5);
}
.stat-pill strong { color: rgba(255,255,255,.9); font-weight: 600; }
.stat-dot { width: 7px; height: 7px; border-radius: 50%; }
.sd-open    { background: var(--status-open-dot); }
.sd-partial { background: var(--status-partial-dot); }
.sd-done    { background: var(--status-done-dot); }

/* Toggle minimizar */
.topbar-toggle {
  position: fixed;
  top: 0; right: 14px;
  z-index: 201;
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.6);
  border: 1px solid rgba(255,255,255,.1);
  border-top: none;
  border-radius: 0 0 6px 6px;
  padding: 4px 12px;
  font-size: var(--text-xs);
  font-family: var(--font-ui);
  cursor: pointer;
  transition: var(--transition);
}
.topbar-toggle:hover { background: rgba(255,255,255,.14); color: #fff; }

.topbar-hint {
  font-size: var(--text-xs);
  color: rgba(255,255,255,.25);
  font-style: italic;
  flex-shrink: 0;
}

/* ============================================================
   4. BOTÕES GERAIS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  height: 32px;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  white-space: nowrap;
  letter-spacing: .2px;
}
.btn:disabled { opacity: .35; cursor: not-allowed; }

.btn-ghost {
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.8);
  border: 1px solid rgba(255,255,255,.12);
}
.btn-ghost:hover:not(:disabled) { background: rgba(255,255,255,.14); color: #fff; }

.btn-primary {
  background: var(--navy-500);
  color: #fff;
  border: 1px solid var(--navy-400);
}
.btn-primary:hover:not(:disabled) { background: var(--navy-400); }

.btn-orange {
  background: var(--cta-500);
  color: #fff;
  box-shadow: 0 1px 4px rgba(244,121,32,.3);
}
.btn-orange:hover:not(:disabled) { background: var(--cta-600); }

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

.btn-warn { background: #d97706; color: #fff; }
.btn-warn:hover:not(:disabled) { background: #b45309; }

.btn-sm { height: 28px; padding: 0 10px; font-size: var(--text-xs); border-radius: var(--radius-xs); }

/* ── CONCILIAR SELECIONADOS: CTA principal ── */
.btn-conciliar {
  height: 34px;
  padding: 0 18px;
  font-size: var(--text-sm);
  font-weight: 700;
  border-radius: var(--radius-sm);
  background: var(--cta-500);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 1px 4px rgba(244,121,32,.4);
  display: flex; align-items: center; gap: 6px;
  letter-spacing: .3px;
  text-transform: uppercase;
  font-family: var(--font-ui);
}
.btn-conciliar:hover:not(:disabled) {
  background: var(--cta-600);
  box-shadow: 0 3px 10px rgba(244,121,32,.5);
  transform: translateY(-1px);
}
.btn-conciliar:disabled { opacity: .35; cursor: not-allowed; transform: none; }

/* Botão DESFAZER */
.btn-desfazer {
  height: 34px;
  padding: 0 12px;
  font-size: var(--text-sm);
  font-weight: 500;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.65);
  border: 1px solid rgba(255,255,255,.1);
  cursor: pointer;
  transition: var(--transition);
  display: flex; align-items: center; gap: 6px;
}
.btn-desfazer:hover:not(:disabled) { background: rgba(255,255,255,.12); color: rgba(255,255,255,.9); }
.btn-desfazer:disabled { opacity: .35; cursor: not-allowed; }

/* ============================================================
   5. BARRA CONCILIAR
   ============================================================ */
.conciliar-bar {
  position: fixed;
  top: calc(var(--topbar-h) + var(--topbar2-h));
  left: 0; right: 0;
  z-index: 190;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--navy-800);
  border-bottom: 1px solid rgba(255,255,255,.07);
  padding: 0 20px;
  height: var(--cbar-h);
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
  transition: top var(--transition-md);
}
.topbar.minimized ~ .conciliar-bar { top: 0; }

.conciliar-bar-divider {
  width: 1px; height: 20px;
  background: rgba(255,255,255,.1);
  flex-shrink: 0;
  margin: 0 4px;
}

.sel-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-sm);
  color: rgba(255,255,255,.6);
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px;
  padding: 5px 13px;
  white-space: nowrap;
}
.sel-chip strong { color: var(--cta-500); font-weight: 600; }

.search-inline { display: none; align-items: center; gap: 6px; }
.search-inline.visible { display: flex; }
.search-inline input {
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08);
  color: #fff;
  padding: 0 11px;
  font-size: var(--text-sm);
  font-family: var(--font-ui);
  width: 190px;
  transition: var(--transition);
  -webkit-appearance: none;
}
.search-inline input::placeholder { color: rgba(255,255,255,.3); }
.search-inline input:focus {
  outline: none;
  border-color: var(--cta-500);
  background: rgba(255,255,255,.11);
}
.search-count { font-size: var(--text-xs); color: rgba(255,255,255,.4); white-space: nowrap; }

/* Busca Rápida: ghost, não laranja */
.btn-busca-rapida {
  height: 32px;
  padding: 0 14px;
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.75);
  border: 1px solid rgba(255,255,255,.12);
  cursor: pointer;
  transition: var(--transition);
  display: flex; align-items: center; gap: 6px;
  text-transform: uppercase;
  letter-spacing: .3px;
  font-family: var(--font-ui);
}
.btn-busca-rapida:hover:not(:disabled) { background: rgba(255,255,255,.12); color: #fff; }
.btn-busca-rapida:disabled { opacity: .35; cursor: not-allowed; }

/* ============================================================
   6. LAYOUT PRINCIPAL
   ============================================================ */
.main-layout {
  display: flex;
  gap: 14px;
  width: calc(100vw - 24px) !important;
  max-width: calc(100vw - 24px) !important;
  box-sizing: border-box;
  height: calc(100vh - var(--total-fixed) - var(--footer-h) - 10px);
  margin-top: calc(var(--total-fixed) + 8px);
  position: relative !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  margin-bottom: 0;
  transition: margin-top var(--transition-md), height var(--transition-md);
}
.topbar.minimized ~ .conciliar-bar ~ .main-layout {
  margin-top: calc(var(--cbar-h) + 8px);
  height: calc(100vh - var(--cbar-h) - var(--footer-h) - 10px);
}

/* Painéis */
.panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  height: 100%;
  overflow: hidden;
}

.panel-body {
  flex: 1;
  overflow-y: auto !important;
  overflow-x: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.panel-header {
  background: var(--navy-800);
  padding: 0 16px;
  border-bottom: 1px solid rgba(0,0,0,.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  height: 44px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.panel-title {
  font-family: var(--font-ui);
  font-size: var(--text-base);
  font-weight: 600;
  color: rgba(255,255,255,.95);
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
  letter-spacing: -.1px;
}

.panel-actions { display: flex; align-items: center; gap: 6px; }

.panel-badge {
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.75);
  border: 1px solid rgba(255,255,255,.1);
}

/* Rodapé fixo */
.action-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 20px;
  background: var(--navy-900);
  border-top: 1px solid rgba(255,255,255,.06);
  height: var(--footer-h);
  box-sizing: border-box;
  width: calc(100vw - 24px) !important;
  position: relative !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
}

/* ============================================================
   7. FILTRO RÁPIDO — alinhamento milimétrico
   ============================================================ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

/* Normaliza altura do input — sem aparência nativa */
.filter-input {
  flex: 1;
  height: 32px;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-sm);
  padding: 0 11px;
  font-size: var(--text-base);
  font-family: var(--font-ui);
  color: var(--slate-800);
  background: var(--surface);
  transition: var(--transition);
  line-height: 32px;
  -webkit-appearance: none;
  appearance: none;
}
.filter-input::placeholder { color: var(--slate-400); }
.filter-input:focus {
  outline: none;
  border-color: var(--navy-400);
  box-shadow: 0 0 0 3px rgba(59,77,120,.12);
}

.filter-status { font-size: var(--text-xs); color: var(--slate-500); white-space: nowrap; padding: 0 4px; }

.btn-filter-clear {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 10px;
  font-size: var(--text-xs);
  font-family: var(--font-ui);
  font-weight: 500;
  background: var(--slate-100);
  color: var(--slate-600);
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-filter-clear:hover { background: var(--slate-200); color: var(--slate-800); }

/* ============================================================
   8. DROP ZONE
   ============================================================ */
.dropzone {
  border: 2px dashed var(--slate-300);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--surface);
  flex-shrink: 0;
}
.dropzone:hover,
.dropzone.drag-over {
  border-color: var(--navy-400);
  background: var(--navy-50);
}
.dropzone-icon    { font-size: 28px; margin-bottom: 8px; line-height: 1; }
.dropzone-text    { font-size: var(--text-md); font-weight: 600; color: var(--slate-700); }
.dropzone-sub     { font-size: var(--text-sm); color: var(--slate-400); margin-top: 4px; }
.dropzone-btn-row { margin-top: 12px; display: flex; justify-content: center; gap: 8px; }

/* ============================================================
   9. TABS DE BANCO
   ============================================================ */
.tab-bar {
  display: flex;
  align-items: stretch;
  background: var(--slate-50);
  border-bottom: 1px solid var(--slate-200);
  padding: 0 10px;
  flex-shrink: 0;
  overflow-x: auto;
  gap: 2px;
  min-height: 38px;
}
.tab-bar::-webkit-scrollbar { height: 0; }

.tab-item { display: flex; align-items: stretch; position: relative; }

.tab-btn {
  padding: 0 12px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--slate-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: var(--transition);
  background: none;
  border-top: none; border-left: none; border-right: none;
  font-family: var(--font-ui);
  letter-spacing: -.1px;
}
.tab-btn.active { color: var(--navy-700); border-bottom-color: var(--cta-500); font-weight: 600; }
.tab-btn:hover:not(.active) { color: var(--slate-700); }

.tab-close {
  display: flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: none; border: none;
  cursor: pointer;
  color: var(--slate-400);
  font-size: 11px;
  margin: auto 2px auto -2px;
  transition: var(--transition);
  flex-shrink: 0;
}
.tab-close:hover { background: #fee2e2; color: #dc2626; }

/* ============================================================
   10. TABELAS — hierarquia, respiro, alinhamento
   ============================================================ */
.table-wrapper {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--slate-200);
  overflow: auto;
  box-shadow: var(--shadow-xs);
  position: relative;
}

table { width: 100%; border-collapse: collapse; min-width: 580px; }

/* Cabeçalho: leve, não compete com os dados */
thead th {
  background: var(--slate-50);
  padding: 9px 10px;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--slate-500);
  border-bottom: 1px solid var(--slate-200);
  position: sticky; top: 0; z-index: 10;
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--slate-100);
  transition: background var(--transition);
  cursor: pointer;
}
tbody tr:hover     { background: var(--slate-50); }
tbody tr:last-child { border-bottom: none; }

/* Células: tamanho e peso corretos */
tbody td {
  padding: 7px 10px;
  font-size: var(--text-base);
  font-weight: 400;
  color: var(--slate-700);
  vertical-align: middle;
}

/* Alinhamentos por tipo */
.td-check { width: 36px; text-align: center; padding: 0 8px; }
.td-num {
  text-align: right;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
  color: var(--slate-800);
  font-weight: 500;
}
.td-mono { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--slate-500); }

.val-debit  { color: var(--debit-color) !important; font-weight: 600 !important; }
.val-credit { color: var(--credit-color) !important; font-weight: 600 !important; }

/* ============================================================
   11. STATUS DE LINHA
   ============================================================ */
tr.status-open    td { background: rgba(255,241,242,.5); }
tr.status-open:hover td { background: rgba(255,241,242,.85); }
tr.status-partial td { background: rgba(255,251,235,.55); }
tr.status-partial:hover td { background: rgba(255,251,235,.9); }
tr.status-done    td { background: rgba(240,253,244,.5); }
tr.status-done:hover td { background: rgba(240,253,244,.85); }
tr.selected-row td {
  background: rgba(59,77,120,.07) !important;
  outline: 2px solid rgba(59,77,120,.3);
  outline-offset: -1px;
}
tr.keyboard-active td {
  background: rgba(59,77,120,.1) !important;
  outline: 2px solid var(--navy-500);
  outline-offset: -1px;
}
tr.search-highlight td {
  background: rgba(251,191,36,.18) !important;
  outline: 1px solid #f59e0b;
  outline-offset: -1px;
}
tr.hidden-by-filter { display: none; }

/* ============================================================
   12. BADGES DE STATUS — clara hierarquia visual
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: .2px;
  border: 1px solid transparent;
  white-space: nowrap;
  line-height: 1;
}
.badge-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

.badge-open    { background: var(--status-open-bg);    color: var(--status-open-text);    border-color: var(--status-open-border); }
.badge-partial { background: var(--status-partial-bg); color: var(--status-partial-text); border-color: var(--status-partial-border); }
.badge-done    { background: var(--status-done-bg);    color: var(--status-done-text);    border-color: var(--status-done-border); }

/* ============================================================
   13. BOTÃO MATCH RÁPIDO
   ============================================================ */
.btn-quick-match {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px;
  border-radius: var(--radius-xs);
  background: var(--cta-100);
  color: var(--cta-600);
  border: 1px solid rgba(244,121,32,.25);
  font-size: 10px;
  cursor: pointer;
  transition: var(--transition);
}
.btn-quick-match:hover  { background: #fde5cc; transform: scale(1.08); }
.btn-quick-match:active { transform: scale(0.94); }

/* ============================================================
   14. BARRA DE SELEÇÃO INTERNA
   ============================================================ */
.sel-bar {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  background: var(--navy-800);
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.9);
  font-size: var(--text-sm);
  font-weight: 500;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,.07);
}
.sel-bar.visible  { display: flex; }
.sel-bar strong   { font-weight: 700; color: var(--cta-500); }
.sel-bar-sum      { margin-left: auto; font-family: var(--font-mono); font-size: var(--text-sm); }

/* ============================================================
   15. INFO BAR / EMPTY STATE
   ============================================================ */
.info-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--navy-50);
  border: 1px solid var(--navy-100);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--navy-600);
  font-weight: 500;
  flex-shrink: 0;
}

.empty-state   { text-align: center; padding: 36px 20px; color: var(--slate-400); }
.empty-icon    { font-size: 34px; margin-bottom: 10px; }
.empty-text    { font-size: var(--text-md); font-weight: 600; color: var(--slate-500); }

/* ============================================================
   16. TOTALIZADOR FLUTUANTE
   ============================================================ */
.floating-total {
  position: fixed;
  bottom: calc(var(--footer-h) + 12px);
  right: 18px;
  z-index: 150;
  background: var(--surface);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-md);
  min-width: 250px;
  display: none;
}
.floating-total.visible { display: block; animation: cbp-slideUp 0.22s ease; }

@keyframes cbp-slideUp {
  from { transform: translateY(10px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.floating-total-title {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--slate-500);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 10px;
}
.floating-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: var(--text-sm);
}
.floating-total-label { color: var(--slate-600); font-weight: 500; }
.floating-total-value { font-weight: 700; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.floating-total-value.parcelas { color: var(--navy-600); }
.floating-total-value.extrato  { color: #15803d; }
.floating-total-value.diff     { color: #dc2626; font-size: var(--text-md); }
.floating-total-value.diff.zero { color: #16a34a; }
.floating-total-divider { height: 1px; background: var(--slate-200); margin: 8px 0; }

/* ============================================================
   17. MODAIS
   ============================================================ */
.modal-backdrop {
  display: none;
  position: fixed; inset: 0;
  z-index: 500;
  background: rgba(10,18,40,.6);
  backdrop-filter: blur(2px);
  align-items: center; justify-content: center;
}
.modal-backdrop.open { display: flex; animation: cbp-fadeIn .18s ease; }

@keyframes cbp-fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 28px;
  width: 500px;
  max-width: 95vw;
  box-shadow: var(--shadow-lg);
  animation: cbp-modalIn .2s ease;
  border: 1px solid var(--slate-200);
}
.modal-sm { width: 400px; }

@keyframes cbp-modalIn {
  from { transform: scale(.97) translateY(8px); opacity: 0; }
  to   { transform: scale(1)   translateY(0);   opacity: 1; }
}

.modal-title {
  font-family: var(--font-ui);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--slate-900);
  margin-bottom: 4px;
  letter-spacing: -.2px;
}

.modal-body { font-size: var(--text-base); color: var(--slate-600); line-height: 1.65; }

.modal-value-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 16px 0;
}

.modal-val-card {
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}
.modal-val-label {
  font-size: var(--text-xs); color: var(--slate-500); font-weight: 600;
  text-transform: uppercase; letter-spacing: .6px; margin-bottom: 4px;
}
.modal-val-num {
  font-size: 20px; font-weight: 700; color: var(--slate-900);
  font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -.5px;
}
.modal-val-diff .modal-val-num { color: var(--cta-500); }
.modal-val-diff .modal-val-num.zero { color: #16a34a; }

.modal-actions {
  display: flex; gap: 8px; margin-top: 20px; justify-content: flex-end; align-items: center;
}

.modal-adj-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0 0; }
.modal-adj-field { display: flex; flex-direction: column; gap: 4px; }
.modal-adj-field label {
  font-size: var(--text-xs); font-weight: 600; color: var(--slate-500);
  text-transform: uppercase; letter-spacing: .6px;
}
.modal-adj-field input {
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  font-size: var(--text-md);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--slate-800);
  transition: var(--transition);
  -webkit-appearance: none;
}
.modal-adj-field input:focus {
  outline: none;
  border-color: var(--navy-400);
  box-shadow: 0 0 0 3px rgba(59,77,120,.12);
}

.modal-adj-hint {
  font-size: var(--text-sm); font-weight: 500;
  margin-top: 8px; padding: 8px 12px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; gap: 6px;
}
.hint-ok   { background: var(--status-done-bg); color: var(--status-done-text); border: 1px solid var(--status-done-border); }
.hint-diff { background: var(--status-partial-bg); color: var(--status-partial-text); border: 1px solid var(--status-partial-border); }

.modal-warn-box {
  background: #fff1f2; border: 1px solid #fecdd3;
  border-radius: var(--radius-md);
  padding: 12px 14px; margin-top: 12px;
  font-size: var(--text-sm); color: #9f1239; line-height: 1.7;
}

/* ============================================================
   18. TOASTS
   ============================================================ */
.toast-container { position: fixed; bottom: 50px; right: 18px; z-index: 999; display: flex; flex-direction: column; gap: 7px; }
.toast {
  background: var(--slate-900); color: rgba(255,255,255,.92);
  padding: 11px 16px; border-radius: var(--radius-md);
  font-size: var(--text-sm); font-family: var(--font-ui); font-weight: 500;
  box-shadow: var(--shadow-md);
  display: flex; align-items: center; gap: 8px;
  animation: cbp-slideIn .2s ease;
  min-width: 260px;
  border: 1px solid rgba(255,255,255,.06);
}
.toast-success { border-left: 3px solid var(--status-done-dot); }
.toast-error   { border-left: 3px solid var(--status-open-dot); }
.toast-warn    { border-left: 3px solid var(--status-partial-dot); }
.toast-info    { border-left: 3px solid var(--navy-200); }

@keyframes cbp-slideIn {
  from { transform: translateX(12px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ============================================================
   19. SCROLLBAR
   ============================================================ */
#conciliabank-app ::-webkit-scrollbar         { width: 5px; height: 5px; }
#conciliabank-app ::-webkit-scrollbar-track   { background: transparent; }
#conciliabank-app ::-webkit-scrollbar-thumb   { background: var(--slate-300); border-radius: 4px; }
#conciliabank-app ::-webkit-scrollbar-thumb:hover { background: var(--slate-400); }

/* ============================================================
   20. UTILITÁRIOS
   ============================================================ */
input[type="checkbox"] {
  width: 14px; height: 14px;
  cursor: pointer; accent-color: var(--navy-500); border-radius: 3px;
}
.fw6        { font-weight: 600; }
.text-muted { color: var(--slate-500); }
.sr-only    { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
