/* ============================================
   SETOR FINANCEIRO - Controle de Liquidações
   63º Batalhão de Infantaria
   Design System: Militar / Institucional
   ============================================ */

/* ---------- CSS Variables ---------- */
:root {
  --bg-primary: #eef2e6;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f7faf5;

  --olive: #3d5016;
  --olive-light: #6b7c3a;
  --olive-dark: #2a3810;

  --accent-amber: #c9a227;
  --accent-amber-light: #e8bc3a;
  --accent-green: #15803d;
  --accent-red: #dc2626;
  --accent-blue: #2563eb;

  --text-primary: #1a1a1a;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;

  --border-default: rgba(0, 0, 0, 0.08);
  --border-accent: rgba(201, 162, 39, 0.4);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.08);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
}

/* ── BARRA DE ABAS NO LIMITE DO CABEÇALHO E DO MÓDULO ── */
.module-tabs-bar {
  background: rgba(20, 28, 12, 0.85) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  border-bottom: 2.5px solid #c9a227 !important;
  padding: 0 32px !important;
  display: flex !important;
  align-items: flex-end !important;
  gap: 8px !important;
}

.module-tabs-bar .tab-btn {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-bottom: none;
  padding: 10px 22px;
  color: rgba(255, 255, 255, 0.75);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  transition: all 0.2s ease;
  position: relative;
  top: 1px;
}

.module-tabs-bar .tab-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

/* ABA SELECIONADA ATIVA COM BACKGROUND TRANSPARENTE MOSTRANDO A IMAGEM AÉREA DE FUNDO DO MÓDULO */
.module-tabs-bar .tab-btn.active {
  background: transparent !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  border: 2px solid #c9a227 !important;
  border-bottom: 2.5px solid transparent !important;
  box-shadow: 0 -4px 16px rgba(201, 162, 39, 0.35);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: #f5f2e8;
  background-image: linear-gradient(rgba(245, 242, 232, 0.88), rgba(245, 242, 232, 0.88)), url('../assets/imagemaerea63biverdeoliva.webp');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(74, 124, 89, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(74, 124, 89, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--olive-dark); border-radius: 3px; }

/* ---------- Golden Accent Inputs & Placeholders ---------- */
input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
  transition: color var(--transition-fast), opacity var(--transition-fast);
}

input:focus::placeholder,
textarea:focus::placeholder {
  color: var(--accent-amber);
  opacity: 0.95;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent-amber) !important;
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.18) !important;
}

/* ---------- Container ---------- */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 100%;
  margin: 0;
  padding: 1.5rem 2rem;
}

/* ---------- Header EXECUTIVO EM VERDE OLIVA MILITAR COM EFEITO DE VIDRO ---------- */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: rgba(20, 28, 12, 0.90);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-bottom: 2.5px solid #c9a227;
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
  color: #ffffff;
  position: relative;
  overflow: hidden;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-logo {
  width: auto;
  height: 72px;
  object-fit: contain;
  border-right: 1px solid rgba(255, 255, 255, 0.2);
  padding-right: 20px;
}

.header-info h1 {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: #ffffff;
  background: none;
  -webkit-text-fill-color: initial;
}

.header-subtitle {
  font-size: 0.78rem;
  color: #c2d1b2;
  font-weight: 600;
  margin-top: 2px;
  letter-spacing: 0.3px;
}

/* ---------- UGE Tabs ---------- */
.uge-tabs {
  display: flex;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  width: fit-content;
}

.uge-tab {
  padding: 10px 28px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-base);
  position: relative;
}

.uge-tab:hover {
  color: var(--text-primary);
  background: rgba(0,0,0,0.03);
}

.uge-tab.active {
  background: var(--olive);
  color: #fff;
  box-shadow: 0 2px 8px rgba(42,56,16,0.25);
}

.uge-tab .tab-count {
  font-size: 11px;
  font-weight: 700;
  background: rgba(255,255,255,0.25);
  padding: 1px 6px;
  border-radius: 8px;
  margin-left: 6px;
}

.uge-tab.active .tab-count {
  background: rgba(255,255,255,0.3);
}

/* ── SELEÇÃO DE UGE ACIMA DO BOTÃO DE INCLUIR LIQUIDAÇÃO ── */
.uge-selector-container {
  margin-bottom: 1.25rem;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.uge-selector-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--olive-dark);
  display: flex;
  align-items: center;
  gap: 6px;
}

.uge-tabs-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.uge-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  background: var(--olive);
  color: #ffffff;
  border: 1.5px solid var(--olive-light);
  border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(42, 56, 16, 0.2);
}

.uge-tab-btn:hover:not(.active) {
  background: var(--olive-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(42, 56, 16, 0.3);
}

/* UGE SELECIONADA FICA DOURADA (GOLD) */
.uge-tab-btn.active {
  background: linear-gradient(135deg, #c9a227, #e8bc3a) !important;
  color: #141c0c !important;
  border: 2px solid #f5d77f !important;
  font-weight: 800 !important;
  box-shadow: 0 4px 16px rgba(201, 162, 39, 0.45) !important;
  transform: translateY(-1px);
}

.uge-tab-btn .tab-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 800;
  transition: all 0.25s ease;
}

.uge-tab-btn.active .tab-count {
  background: rgba(20, 28, 12, 0.85) !important;
  color: #e8bc3a !important;
}

/* ---------- Action Bar ---------- */
.action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-incluir {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--olive);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: 0 2px 8px rgba(42,56,16,0.2);
}

.btn-incluir:hover {
  background: var(--olive-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(42,56,16,0.3);
}

.btn-incluir .icon { font-size: 18px; }

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 8px 16px;
  min-width: 280px;
}

.search-box input {
  border: none;
  outline: none;
  background: transparent;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--text-primary);
  width: 100%;
}

.search-box .search-icon {
  color: var(--text-muted);
  font-size: 16px;
}

/* ---------- Form Panel ---------- */
.form-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  max-height: 0;
  opacity: 0;
  transition: max-height 0.5s cubic-bezier(0.4,0,0.2,1),
              opacity 0.3s ease,
              margin 0.3s ease;
  margin-bottom: 0;
}

.form-panel.open {
  max-height: 3000px;
  opacity: 1;
  margin-bottom: 1.5rem;
}

.form-panel-header {
  background: linear-gradient(135deg, var(--olive-dark) 0%, var(--olive) 100%);
  color: #fff;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-panel-header h2 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.btn-close-form {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.btn-close-form:hover {
  background: rgba(255,255,255,0.25);
}

/* ---------- SIAFI Paste Section ---------- */
.siafi-paste-section {
  padding: 20px 24px;
  background: rgba(245,242,232,0.5);
  border-bottom: 1px solid var(--border-default);
}

.siafi-paste-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--olive);
  margin-bottom: 12px;
}

.siafi-paste-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* --- Paste Card --- */
.siafi-paste-card {
  position: relative;
  border: 2px solid rgba(61,80,22,0.18);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  cursor: pointer;
  transition: all 0.35s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
  min-height: 110px;
}

.siafi-paste-card:hover {
  border-color: var(--olive);
  box-shadow: 0 4px 16px rgba(61,80,22,0.10);
}

/* Card idle state content */
.siafi-paste-card .paste-idle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 16px;
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.siafi-paste-card .paste-idle .paste-icon {
  font-size: 30px;
  margin-bottom: 8px;
  line-height: 1;
}

.siafi-paste-card .paste-idle .paste-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.siafi-paste-card .paste-idle .paste-hint {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.4;
  max-width: 220px;
}

/* Card textarea (hidden by default) */
.siafi-paste-card .paste-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  outline: none;
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  line-height: 1.5;
  padding: 14px 16px;
  resize: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  box-sizing: border-box;
}

.siafi-paste-card .paste-input::placeholder {
  color: var(--text-muted);
  font-style: italic;
  font-size: 11px;
}

/* --- ACTIVE state (hover/focus) --- */
.siafi-paste-card.active {
  border-color: var(--olive);
  border-style: dashed;
  animation: siafi-pulse 2s ease-in-out infinite;
}

.siafi-paste-card.active .paste-idle {
  opacity: 0;
  transform: scale(0.92);
  pointer-events: none;
}

.siafi-paste-card.active .paste-input {
  opacity: 1;
  pointer-events: auto;
}

/* Hover hint overlay (before becoming fully active) */
.siafi-paste-card:not(.active):not(.filled):hover .paste-idle {
  opacity: 0.5;
}

.siafi-paste-card:not(.active):not(.filled):hover::after {
  content: 'Clique e cole (Ctrl+V)';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--olive);
  letter-spacing: 0.5px;
  pointer-events: none;
  opacity: 0.8;
}

@keyframes siafi-pulse {
  0%, 100% { border-color: var(--olive); box-shadow: 0 0 0 0 rgba(61,80,22,0.15); }
  50% { border-color: rgba(61,80,22,0.6); box-shadow: 0 0 0 6px rgba(61,80,22,0.05); }
}

/* --- FILLED state --- */
.siafi-paste-card.filled {
  border-color: var(--accent-green);
  border-style: solid;
  background: rgba(21,128,61,0.03);
  animation: none;
  cursor: default;
}

.siafi-paste-card.filled .paste-idle {
  opacity: 0;
  transform: scale(0.92);
  pointer-events: none;
}

.siafi-paste-card.filled .paste-input {
  opacity: 1;
  pointer-events: auto;
  color: var(--text-muted);
  font-size: 10px;
}

/* Filled badge overlay */
.siafi-paste-card .paste-filled-badge {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: linear-gradient(135deg, rgba(21,128,61,0.08) 0%, rgba(21,128,61,0.02) 100%);
  border-bottom: 1px solid rgba(21,128,61,0.12);
  z-index: 2;
}

.siafi-paste-card.filled .paste-filled-badge {
  display: flex;
}

.paste-filled-badge .badge-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-green);
  color: #fff;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  animation: badge-pop 0.4s cubic-bezier(.4,0,.2,1);
}

@keyframes badge-pop {
  0% { transform: scale(0); }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.paste-filled-badge .badge-text {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-green);
  white-space: nowrap;
}

/* Clear button */
.siafi-paste-card .paste-clear-btn {
  position: absolute;
  top: 6px; right: 6px;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: none;
  background: var(--accent-red);
  color: #fff;
  font-size: 11px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 3;
  transition: transform 0.15s ease, opacity 0.15s ease;
  opacity: 0.8;
}

.siafi-paste-card .paste-clear-btn:hover {
  transform: scale(1.15);
  opacity: 1;
}

.siafi-paste-card.filled .paste-clear-btn {
  display: flex;
}

/* Highlight flash for auto-filled form fields */
@keyframes field-flash {
  0% { background-color: rgba(21,128,61,0.15); }
  100% { background-color: transparent; }
}

.field-flash {
  animation: field-flash 1.2s ease-out;
}

/* Golden autofill indicator for auto-filled fields */
.field-autofilled {
  border-color: var(--accent-amber) !important;
  box-shadow: 0 0 0 2px rgba(201, 162, 39, 0.20) !important;
  background: linear-gradient(135deg, rgba(201,162,39,0.06) 0%, transparent 100%) !important;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.field-autofilled::after {
  content: '✦';
  color: var(--accent-amber);
}

/* N/A indicator for non-applicable fields (optante pelo simples) */
.field-na {
  border-color: rgba(107,114,128,0.3) !important;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 4px,
    rgba(107,114,128,0.04) 4px,
    rgba(107,114,128,0.04) 8px
  ) !important;
  opacity: 0.5 !important;
  pointer-events: none;
}

/* has-content state on paste cards */
.siafi-paste-card.has-content:not(.filled) {
  border-color: var(--accent-amber);
  box-shadow: 0 0 0 2px rgba(201,162,39,0.15);
}

/* Autofill trigger button */
.btn-autofill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  background: linear-gradient(135deg, #c9a227 0%, #e8bc3a 50%, #b8891f 100%);
  color: #1a1200;
  border: none;
  border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(201,162,39,0.30), inset 0 1px 0 rgba(255,255,255,0.25);
  transition: all 0.25s cubic-bezier(.4,0,.2,1);
  position: relative;
  overflow: hidden;
}

.btn-autofill::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,0.15) 50%, transparent 100%);
  transform: translateX(-100%);
  transition: transform 0.4s ease;
}

.btn-autofill:hover::before {
  transform: translateX(100%);
}

.btn-autofill:hover {
  background: linear-gradient(135deg, #d4aa2e 0%, #f0c73d 50%, #c49225 100%);
  box-shadow: 0 4px 20px rgba(201,162,39,0.45), inset 0 1px 0 rgba(255,255,255,0.30);
  transform: translateY(-1px);
}

.btn-autofill:active {
  transform: translateY(0);
  box-shadow: 0 1px 6px rgba(201,162,39,0.25);
}

.btn-autofill-icon {
  font-size: 16px;
  line-height: 1;
  filter: drop-shadow(0 0 4px rgba(255,220,0,0.6));
  animation: lightning-pulse 2s ease-in-out infinite;
}

@keyframes lightning-pulse {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(255,220,0,0.6)); }
  50% { filter: drop-shadow(0 0 10px rgba(255,220,0,1)); }
}

/* Clear form button */
.btn-limpar-registro {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 16px;
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid rgba(0,0,0,0.12);
  border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-limpar-registro:hover {
  background: rgba(220, 38, 38, 0.06);
  border-color: var(--accent-red);
  color: var(--accent-red);
  transform: translateY(-1px);
}

/* ---------- Form Fields ---------- */
.form-body {
  padding: 24px;
}

.form-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--olive);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

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

.form-group.span-2 { grid-column: span 2; }
.form-group.span-3 { grid-column: span 3; }
.form-group.span-4 { grid-column: span 4; }

.form-group label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.form-group label .required {
  color: var(--accent-red);
  margin-left: 2px;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 10px 12px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--text-primary);
  background: var(--bg-card);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--olive-light);
  box-shadow: 0 0 0 3px rgba(61,80,22,0.1);
}

.form-group input:read-only {
  background: rgba(245,242,232,0.6);
  color: var(--text-muted);
}

.form-group input.computed {
  background: rgba(21,128,61,0.06);
  border-color: rgba(21,128,61,0.2);
  font-weight: 600;
  color: var(--accent-green);
}

.form-group select {
  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 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.form-group textarea {
  resize: vertical;
  min-height: 60px;
}

/* ---------- Deductions Section ---------- */
.deductions-container {
  margin-bottom: 24px;
}

.deduction-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 10px;
  padding: 12px;
  background: rgba(245,242,232,0.4);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
}

.btn-add-deduction,
.btn-remove-deduction {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-add-deduction {
  background: rgba(61,80,22,0.06);
  color: var(--olive);
}

.btn-add-deduction:hover {
  background: rgba(61,80,22,0.12);
}

.btn-remove-deduction {
  background: rgba(220,38,38,0.06);
  color: var(--accent-red);
  border-color: rgba(220,38,38,0.15);
}

.btn-remove-deduction:hover {
  background: rgba(220,38,38,0.12);
}

/* ---------- Form Actions ---------- */
.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--border-default);
}

.btn-submit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: var(--olive);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: 0 2px 8px rgba(42,56,16,0.2);
}

.btn-submit:hover {
  background: var(--olive-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(42,56,16,0.3);
}

.btn-cancel {
  padding: 12px 24px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-cancel:hover {
  background: rgba(0,0,0,0.03);
}

/* ---------- Data Table ---------- */
.table-section {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.table-header {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-default);
}

.table-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-header .record-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-primary);
  padding: 3px 10px;
  border-radius: 10px;
}

.table-wrapper {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(245,242,232,0.5);
  border-bottom: 1px solid var(--border-default);
  white-space: nowrap;
  position: sticky;
  top: 0;
}

.data-table tbody tr {
  transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
  background: var(--bg-card-hover);
}

.data-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  white-space: nowrap;
  vertical-align: middle;
}

.data-table .tipo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.tipo-badge.np {
  background: rgba(37,99,235,0.1);
  color: var(--accent-blue);
}

.tipo-badge.ob {
  background: rgba(21,128,61,0.1);
  color: var(--accent-green);
}

.tipo-badge.gps {
  background: rgba(201,162,39,0.15);
  color: #9a7b0a;
}

.tipo-badge.darf {
  background: rgba(220,38,38,0.1);
  color: var(--accent-red);
}

.optante-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 11px;
}

.optante-badge.sim {
  background: rgba(21,128,61,0.1);
  color: var(--accent-green);
}

.optante-badge.nao {
  background: rgba(220,38,38,0.1);
  color: var(--accent-red);
}

.optante-badge.na {
  background: rgba(0,0,0,0.05);
  color: var(--text-muted);
}

.valor-cell {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.valor-cell.positive { color: var(--accent-green); }
.valor-cell.negative { color: var(--accent-red); }

/* Row Actions */
.row-actions {
  display: flex;
  gap: 4px;
}

.row-actions button {
  background: none;
  border: 1px solid transparent;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 14px;
  transition: all var(--transition-fast);
}

.row-actions button:hover {
  background: rgba(0,0,0,0.04);
  border-color: var(--border-default);
}

/* Empty State */
.empty-state {
  padding: 60px 24px;
  text-align: center;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.6;
}

.empty-state .empty-text {
  font-size: 14px;
  font-weight: 500;
}

.empty-state .empty-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ---------- Toast Notifications ---------- */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 280px;
}

.toast.success { background: var(--accent-green); }
.toast.error { background: var(--accent-red); }
.toast.warning { background: #d97706; }
.toast.info { background: var(--accent-blue); }

@keyframes toastIn {
  from { transform: translateX(100px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast.removing {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastOut {
  to { transform: translateX(100px); opacity: 0; }
}

/* ---------- Duplicate Warning Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 24px 48px rgba(0,0,0,0.2);
}

/* ---------- Detail Popup Modal Extensions (DESIGN.md Aligned) ---------- */
.detail-modal-large {
  max-width: 840px;
  width: 92%;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 16px;
  border-top: 5px solid #3d5016; /* Verde Oliva Institucional */
  background: #ffffff;
  padding: 30px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.25);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1.5px solid #e5e0d8;
  padding-bottom: 16px;
  margin-bottom: 22px;
}

.modal-title-group h3 {
  font-size: 18px;
  font-weight: 800;
  color: #2a3810; /* Verde Oliva Escuro */
  line-height: 1.3;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-title-group p {
  font-size: 12px;
  color: #6b7280;
  margin-top: 6px;
  margin-bottom: 0;
}

.modal-close {
  background: rgba(0,0,0,0.04);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 18px;
  color: #4b5563;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  line-height: 1;
}

.modal-close:hover {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.detail-card {
  background: #f8faf6;
  border: 1px solid #e5e0d8;
  border-radius: 10px;
  padding: 12px 14px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.detail-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(61, 80, 22, 0.08);
  border-color: #6b7c3a;
}

.detail-label {
  font-size: 10px;
  font-weight: 700;
  color: #4b5563;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 5px;
}

.detail-value {
  font-size: 13px;
  font-weight: 700;
  color: #1a1a1a;
  word-break: break-word;
  font-variant-numeric: tabular-nums;
}

.detail-value.highlight-ob {
  color: #2563eb;
  font-size: 15px;
  font-weight: 800;
}

.detail-value.highlight-green {
  color: #15803d;
  font-size: 15px;
  font-weight: 800;
}

.detail-value.highlight-red {
  color: #dc2626;
}

.detail-full-desc {
  background: #f8faf6;
  border: 1px solid #e5e0d8;
  border-left: 4px solid #3d5016;
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.6;
  color: #1a1a1a;
}

.modal-content h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent-red);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-content p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.modal-actions button {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.modal-btn-cancel {
  background: transparent;
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
}

.modal-btn-confirm {
  background: var(--accent-red);
  border: none;
  color: #fff;
}

.modal-btn-confirm:hover {
  opacity: 0.9;
}

/* ---------- Stats Bar ---------- */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
}

.stat-card .stat-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.stat-card .stat-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.stat-card .stat-value.money {
  font-size: 18px;
  color: var(--olive);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .form-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
  .siafi-paste-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .app-container { padding: 1rem; }
  .form-grid { grid-template-columns: 1fr; }
  .form-group.span-2,
  .form-group.span-3,
  .form-group.span-4 { grid-column: span 1; }
  .stats-bar { grid-template-columns: 1fr; }
  .action-bar { flex-direction: column; align-items: stretch; }
  .search-box { min-width: unset; }
  .deduction-row { grid-template-columns: 1fr; }
  .uge-tabs { width: 100%; }
  .uge-tab { flex: 1; text-align: center; padding: 10px 12px; }
}

/* ---------- Selection & Floating Tooltip ---------- */
.selectable-val {
  cursor: cell !important;
  user-select: none;
  position: relative;
  transition: background-color 0.15s, outline 0.15s;
}

.selectable-val:hover {
  background-color: rgba(61, 80, 22, 0.08) !important;
}

.selectable-val.selected-cell {
  background-color: rgba(201, 162, 39, 0.18) !important;
  outline: 2px solid var(--accent-amber) !important;
  outline-offset: -2px;
}

.selection-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(42, 56, 16, 0.95);
  color: #ffffff;
  padding: 10px 14px;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  border: 1px solid var(--accent-amber-light);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transform: translate(15px, 15px); /* Offset from cursor */
  opacity: 0;
  transition: opacity 0.15s ease;
}

.selection-tooltip.show {
  opacity: 1;
}

/* ---------- Column Header Filter ---------- */
.filterable-header {
  position: relative;
}

.filterable-header .header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.filter-icon-btn {
  font-size: 8px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 2px 4px;
  border-radius: 3px;
  transition: all var(--transition-fast);
}

.filter-icon-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  color: var(--olive);
}

.filter-icon-btn.active-filter {
  color: var(--accent-amber) !important;
  font-weight: 900;
}

/* Floating Column Filter Popup */
.column-filter-popup {
  position: absolute;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 10px;
  z-index: 10001;
  width: 210px;
  display: none;
  flex-direction: column;
  gap: 8px;
}

.column-filter-popup.show {
  display: flex;
}

.filter-popup-search input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  outline: none;
}

.filter-popup-search input:focus {
  border-color: var(--olive-light);
}

.filter-popup-options-container {
  max-height: 150px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 2px;
  border-bottom: 1px solid var(--border-default);
}

.filter-option-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  cursor: pointer;
  user-select: none;
}

.filter-option-row input {
  cursor: pointer;
}

.filter-popup-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.filter-popup-actions button {
  flex: 1;
  padding: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-filter-clear {
  background: transparent;
  color: var(--text-secondary);
}

.btn-filter-clear:hover {
  background: rgba(0, 0, 0, 0.04);
}

.btn-filter-apply {
  background: var(--olive);
  color: #fff;
  border: none !important;
}

.btn-filter-apply:hover {
  background: var(--olive-dark);
}

/* ---------- Inline Inputs & Selects in Table ---------- */
.table-inline-input {
  width: 100%;
  padding: 4px 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  background: transparent;
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.table-inline-input:hover {
  border-color: var(--border-default);
  background: rgba(0, 0, 0, 0.02);
}

.table-inline-input:focus {
  border-color: var(--olive);
  background: var(--bg-card);
  outline: none;
  box-shadow: 0 0 0 2px rgba(95,111,82,0.1);
}

.table-inline-select {
  padding: 4px 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  appearance: none;
}

.table-inline-select:hover {
  border-color: var(--border-default);
  background: rgba(0, 0, 0, 0.02);
}

.table-inline-select:focus {
  border-color: var(--olive);
  outline: none;
  background: var(--bg-card);
}

/* Explicit widths for inline fields */
.inline-tipo { width: 70px; }
.inline-numero { width: 85px; font-weight: 700; }
.inline-data-emissao { width: 125px; }
.inline-optante { width: 75px; }
.inline-money { width: 105px; text-align: right; font-family: monospace; }
.inline-cod-natureza { width: 85px; }
.inline-doc-relacionado { width: 110px; }
.inline-cnpj { width: 140px; }
.inline-data-ob { width: 125px; }
.inline-e-cac { width: 90px; }
.inline-observacao { width: 180px; }

/* Inline deductions modal trigger button */
.btn-inline-deducoes {
  display: inline-block;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--border-default);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-inline-deducoes:hover {
  background: rgba(0, 0, 0, 0.08);
  border-color: var(--text-muted);
}

/* GERCOMP/GEROP Badge */
.gercomp-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  background: rgba(0,0,0,0.05);
  text-align: center;
  white-space: nowrap;
}

.gercomp-badge.active {
  color: var(--accent-green);
  background: rgba(21,128,61,0.1);
}

/* Active inline editing row style */
tr.row-editing {
  background: rgba(95,111,82,0.05) !important;
}

tr.row-editing .table-inline-input,
tr.row-editing .table-inline-select {
  border-color: var(--border-default) !important;
  background: var(--bg-card) !important;
}

/* ---------- Column Resizers ---------- */
.data-table thead th {
  position: relative;
}
.col-resizer {
  position: absolute;
  top: 0;
  right: 0;
  width: 6px;
  height: 100%;
  cursor: col-resize;
  user-select: none;
  z-index: 10;
}
.col-resizer:hover, .col-resizer.resizing {
  background: rgba(201, 162, 39, 0.4);
}

/* ---------- Deduction Sub-rows ---------- */
.data-table tbody td.has-sub-rows {
  padding: 0 !important;
  vertical-align: stretch;
}
.deduction-sub-row {
  height: 28px;
  display: flex;
  align-items: center;
  padding: 4px 14px;
  box-sizing: border-box;
  width: 100%;
  cursor: cell !important;
  user-select: none;
  position: relative;
  transition: background-color 0.15s, outline 0.15s;
}
.deduction-sub-row:hover {
  background-color: rgba(61, 80, 22, 0.08) !important;
}
.deduction-sub-row.selected-cell {
  background-color: rgba(201, 162, 39, 0.18) !important;
  outline: 2px solid var(--accent-amber) !important;
  outline-offset: -2px;
}
.deduction-sub-row.center {
  justify-content: center;
}
.deduction-sub-row.right {
  justify-content: center;
}
.deduction-sub-row:not(:last-child) {
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

/* Force all headers and cells to be centered */
.data-table thead th {
  text-align: center !important;
}
.data-table tbody td {
  text-align: center !important;
}
.header-content {
  justify-content: center !important;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Expanding Sync Button */
.btn-sync-bottom {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  height: 40px;
  width: 40px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
  color: var(--olive-dark);
  border: none;
  box-shadow: 0 4px 12px rgba(201, 162, 39, 0.2);
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  white-space: nowrap;
  padding: 0;
  font-size: 13px;
  font-family: inherit;
}
.btn-sync-bottom span.btn-text {
  max-width: 0;
  opacity: 0;
  transition: max-width 0.3s ease, opacity 0.3s ease, margin-left 0.3s ease;
  margin-left: 0;
  display: inline-block;
  vertical-align: middle;
}
.btn-sync-bottom:hover {
  width: 190px;
  border-radius: 20px;
  padding: 0 16px;
  gap: 8px;
}
.btn-sync-bottom:hover span.btn-text {
  max-width: 150px;
  opacity: 1;
  margin-left: 4px;
}
.btn-sync-bottom #btnSincronizarIcon {
  display: inline-block;
  font-size: 16px;
  line-height: 1;
}

/* ---------- Pagination Controls ---------- */
.pagination-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-default);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--text-primary);
  flex-wrap: wrap;
  gap: 12px;
}

.pagination-info {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.pagination-info strong {
  color: var(--text-primary);
  font-weight: 700;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.pagination-page-size {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.page-size-select {
  padding: 6px 28px 6px 12px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background-color: var(--bg-card);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23c9a227' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 10px 6px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: all var(--transition-fast);
}

.page-size-select:hover {
  border-color: var(--accent-amber);
  background-color: var(--bg-card-hover);
}

.page-size-select:focus {
  outline: none;
  border-color: var(--accent-amber);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.2);
}

.pagination-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.page-btn:hover:not(:disabled):not(.active) {
  background: var(--olive);
  color: #ffffff;
  border-color: var(--accent-amber);
}

.page-btn.active {
  background: var(--olive-dark) !important;
  color: #ffffff !important;
  border: 2px solid var(--accent-amber) !important;
  font-weight: 700 !important;
  box-shadow: 0 0 0 2px rgba(201, 162, 39, 0.3), 0 2px 8px rgba(0, 0, 0, 0.15);
  position: relative;
  z-index: 1;
}

.page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  background: rgba(0, 0, 0, 0.02);
  border-color: var(--border-default);
}

.page-numbers {
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 32px;
  font-size: 12px;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .pagination-container {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 12px 16px;
  }
  .pagination-controls {
    justify-content: space-between;
    width: 100%;
  }
  .pagination-nav {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* ============================================
   CONCILIAÇÃO TRIBUTÁRIA (e-CAC vs Conta 218810132)
   ============================================ */

.btn-conciliacao {
  background: linear-gradient(135deg, #3d5016 0%, #2a3810 100%);
  color: #ffffff;
  border: 1px solid rgba(201, 162, 39, 0.4);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(61, 80, 22, 0.25);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-conciliacao:hover {
  background: linear-gradient(135deg, #4f681d 0%, #354714 100%);
  border-color: var(--accent-amber);
  box-shadow: 0 4px 14px rgba(61, 80, 22, 0.35);
  transform: translateY(-1px);
}

.btn-conciliacao.active {
  background: linear-gradient(135deg, #c9a227 0%, #9e7d17 100%);
  color: #ffffff;
  border-color: #e8bc3a;
  box-shadow: 0 0 12px rgba(201, 162, 39, 0.5);
}

/* Conciliação Panel Base */
.conciliacao-panel {
  background: #ffffff;
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: 0;
  margin-bottom: 24px;
  box-shadow: 0 10px 30px rgba(61, 80, 22, 0.08);
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease, margin-bottom 0.35s ease;
}

.conciliacao-panel.open {
  max-height: 2000px;
  opacity: 1;
  padding: 24px;
  margin-bottom: 24px;
}

.conciliacao-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  padding-bottom: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 16px;
}

.conciliacao-title-group h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--olive);
  display: flex;
  align-items: center;
  gap: 10px;
}

.conciliacao-title-group p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.conciliacao-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.conciliacao-controls label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.conciliacao-controls select {
  padding: 8px 14px;
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--olive);
  background: var(--bg-card-hover);
  cursor: pointer;
}

.btn-close-conciliacao {
  background: rgba(0, 0, 0, 0.05);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 16px;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-close-conciliacao:hover {
  background: var(--accent-red);
  color: #ffffff;
}

/* KPIs Grid */
.conciliacao-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: #ffffff;
  transition: transform 0.2s, box-shadow 0.2s;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-card.kpi-conciliado {
  border-left: 5px solid var(--accent-green);
  background: linear-gradient(135deg, rgba(21, 128, 61, 0.03) 0%, rgba(255, 255, 255, 1) 100%);
}

.kpi-card.kpi-pendente {
  border-left: 5px solid var(--accent-amber);
  background: linear-gradient(135deg, rgba(201, 162, 39, 0.04) 0%, rgba(255, 255, 255, 1) 100%);
}

.kpi-card.kpi-divergente {
  border-left: 5px solid var(--accent-red);
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.04) 0%, rgba(255, 255, 255, 1) 100%);
}

.kpi-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.kpi-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 4px 0 2px 0;
  font-feature-settings: "tnum";
}

.kpi-sub {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Conciliation Table Wrapper */
.conciliacao-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
}

.conciliacao-table {
  width: 100%;
  font-size: 13px;
}

.conciliacao-table th {
  background: var(--olive);
  color: #ffffff;
  font-weight: 700;
  padding: 12px 14px;
  text-align: left;
}

.conciliacao-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-default);
}

.badge-conciliado {
  background: rgba(21, 128, 61, 0.12);
  color: #15803d;
  border: 1px solid rgba(21, 128, 61, 0.3);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-ecac-pendente {
  background: rgba(201, 162, 39, 0.15);
  color: #9e7d17;
  border: 1px solid rgba(201, 162, 39, 0.4);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-divergente {
  background: rgba(220, 38, 38, 0.12);
  color: #dc2626;
  border: 1px solid rgba(220, 38, 38, 0.3);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-quitado {
  background: rgba(107, 114, 128, 0.12);
  color: #4b5563;
  border: 1px solid rgba(107, 114, 128, 0.3);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Audit Modal Specifics */
.audit-summary-box {
  background: rgba(61, 80, 22, 0.04);
  border-left: 4px solid var(--olive);
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  font-size: 13px;
  line-height: 1.6;
}

.audit-warning-box {
  background: rgba(220, 38, 38, 0.05);
  border-left: 4px solid var(--accent-red);
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  font-size: 13px;
  color: #991b1b;
  line-height: 1.6;
}

/* ---------- Column Headers Active Filter Style (Ajuste 4) ---------- */
th.filterable-header.has-filter {
  background: linear-gradient(135deg, var(--olive-dark), #26380c) !important;
  color: var(--accent-amber-light) !important;
  border-bottom: 3px solid var(--accent-amber) !important;
  box-shadow: inset 0 -2px 8px rgba(201, 162, 39, 0.3) !important;
}

th.filterable-header.has-filter .header-content span:first-child {
  color: #ffffff !important;
  font-weight: 800 !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

th.filterable-header.has-filter .filter-icon-btn {
  background: var(--accent-amber) !important;
  color: var(--olive-dark) !important;
  font-weight: 900 !important;
  border-radius: 4px !important;
  padding: 2px 6px !important;
  box-shadow: 0 0 8px rgba(201, 162, 39, 0.7) !important;
  transform: scale(1.1);
}

/* Row highlight for divergent NP in escrituracao mode (Ajuste 2) */
tr.row-divergente-highlight {
  background: rgba(220, 38, 38, 0.12) !important;
  border-left: 5px solid var(--accent-red) !important;
  font-weight: 600 !important;
}

tr.row-divergente-highlight:hover {
  background: rgba(220, 38, 38, 0.2) !important;
}

.btn-escriturar-filter {
  background: rgba(61, 80, 22, 0.1);
  color: var(--olive-dark);
  border: 1px solid var(--olive-light);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-escriturar-filter:hover {
  background: var(--olive);
  color: #ffffff;
  border-color: var(--olive);
  box-shadow: 0 2px 6px rgba(61, 80, 22, 0.3);
}

.btn-clear-filters {
  background: rgba(220, 38, 38, 0.1);
  color: var(--accent-red);
  border: 1px solid rgba(220, 38, 38, 0.3);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-clear-filters:hover {
  background: var(--accent-red);
  color: #ffffff;
  border-color: var(--accent-red);
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

/* ---------- Table Inline Editing Inputs & Selects ---------- */
tr.row-editing {
  background: rgba(201, 162, 39, 0.08) !important;
  outline: 2px solid var(--accent-amber) !important;
}

.table-inline-input,
.table-inline-select {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  background: #ffffff;
  border: 1px solid var(--accent-amber);
  border-radius: var(--radius-sm);
  padding: 3px 6px;
  outline: none;
  box-shadow: 0 0 0 2px rgba(201, 162, 39, 0.15);
  transition: all 0.2s ease;
  max-width: 100%;
}

.table-inline-input:focus,
.table-inline-select:focus {
  border-color: var(--olive);
  box-shadow: 0 0 0 3px rgba(61, 80, 22, 0.2);
}

.inline-cnpj {
  width: 125px;
}

.inline-data-ob {
  width: 120px;
}

.inline-gercomp {
  width: 130px;
}

.inline-e-cac {
  width: 95px;
}




