/* ==========================================================================
   FVP FISCAL CLASSIFIER - PREMIUM GLASSMORPHISM & AURORA UI (2026)
   ========================================================================== */

/* Variables / Design System Tokens */
:root {
  /* Color Bases */
  --bg-dark: #06100e;             /* Petróleo escuro FVP (alinhado a #021514) */
  --glass-bg: rgba(18, 22, 28, 0.45); /* Frosted Glass Base */
  --glass-bg-hover: rgba(255, 255, 255, 0.035);
  --glass-border: rgba(255, 255, 255, 0.08); /* Thin glass shine border */
  --glass-border-glow: rgba(30, 138, 126, 0.25);

  /* Brand Accents — paleta oficial FVP (fvp-kv/Paleta_cores.png) */
  --color-teal-rgb: 30, 138, 126; /* fonte única do verde-água da marca */
  --color-teal: #1e8a7e;          /* Verde-água FVP (oficial) */
  --color-teal-dim: #14685f;
  --color-teal-glow: rgba(var(--color-teal-rgb), 0.35);
  --color-orange-rgb: 220, 131, 45;
  --color-orange: #dc832d;        /* Laranja FVP (oficial) */
  --color-orange-glow: rgba(var(--color-orange-rgb), 0.35);

  /* Statuses */
  --color-success: #1e8a7e;
  --color-warning: #ffb829;
  --color-danger: #ff5c5c;
  
  /* Typography */
  --color-text-bright: #ffffff;
  --color-text-main: #c4ccd6;
  --color-text-muted: #7e8c9a;   /* clareado p/ atingir contraste AA em textos pequenos */

  --font-brand: 'Outfit', sans-serif;
  --font-data: 'Inter', sans-serif;

  /* Escala tipográfica — fonte única de tamanhos (cada papel na sua escala) */
  --fs-display: 24px;  /* h1 de página / números HUD */
  --fs-h2: 18px;       /* títulos de card / login */
  --fs-h3: 14px;       /* títulos de seção */
  --fs-body: 12px;     /* corpo, inputs, navegação */
  --fs-data: 11px;     /* dados da tabela / botões */
  --fs-label: 10px;    /* rótulos, meta, caixa-alta */
  --fs-micro: 9px;     /* piso mínimo: badges e captions */
  
  --blur-amount: 24px;
  --transition-smooth: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   GLOBAL STYLES & BACKGROUND AURORAS
   ========================================================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--bg-dark);
  color: var(--color-text-main);
  font-family: var(--font-data);
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  overflow: hidden;
  position: relative;
}

/* Glowing Aurora Spheres in Background (Matches the glowing blobs of the reference images) */
.aurora-glow-1 {
  position: absolute;
  top: -20%;
  left: -20%;
  width: 60%;
  height: 60%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--color-teal-glow) 0%, transparent 70%);
  filter: blur(140px);
  z-index: -10;
  pointer-events: none;
}

.aurora-glow-2 {
  position: absolute;
  bottom: -20%;
  right: -20%;
  width: 60%;
  height: 60%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--color-orange-glow) 0%, transparent 70%);
  filter: blur(140px);
  z-index: -10;
  pointer-events: none;
}

/* Scrollbars customization */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.01);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-teal);
}

/* ==========================================================================
   GLASSMORPHIC VIEWPORT WRAPPER
   ========================================================================== */

.dashboard-viewport {
  width: 100%;
  max-width: none;
  height: 100vh;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--blur-amount)) saturate(120%);
  -webkit-backdrop-filter: blur(var(--blur-amount)) saturate(120%);
  border: none;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   SIDEBAR GLASS PANEL
   ========================================================================== */

.sidebar-panel {
  width: 260px;
  border-right: 1px solid var(--glass-border);
  padding: 30px 24px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  background: rgba(10, 12, 16, 0.2);
}

/* Brand styling */
.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
}
.logo-holder {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 6px 12px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fvp-logo {
  height: 28px;
  object-fit: contain;
}
.brand-meta h2 {
  font-family: var(--font-brand);
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text-bright);
}
.brand-meta span {
  font-family: var(--font-brand);
  font-size: var(--fs-micro);
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--color-teal);
}

/* Sidebar Navigation */
.sidebar-nav {
  flex: 1;
}
.sidebar-nav ul {
  list-style: none;
}
.nav-item {
  margin-bottom: 8px;
}
.nav-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  color: var(--color-text-main);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  transition: var(--transition-smooth);
}
.nav-item a i {
  width: 16px;
  height: 16px;
  color: var(--color-text-muted);
  transition: var(--transition-smooth);
}
.nav-item a:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--color-text-bright);
}
.nav-item a:hover i {
  color: var(--color-text-bright);
}

/* Active Nav State - matching the glass highlight in 'Labs.' app */
.nav-item.active a {
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-text-bright);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.nav-item.active a i {
  color: var(--color-teal);
}

/* Sidebar Status LEDs */
.sys-leds-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  margin-bottom: 24px;
}
.led-indicator-group {
  display: flex;
  align-items: center;
  gap: 10px;
}
.led-bulb {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  transition: var(--transition-smooth);
}
.led-teal.active {
  background: var(--color-teal);
  box-shadow: 0 0 12px var(--color-teal), 0 0 4px var(--color-teal);
}
.led-red.active {
  background: var(--color-danger);
  box-shadow: 0 0 12px var(--color-danger), 0 0 4px var(--color-danger);
  animation: ledPulse 1s infinite alternate;
}
.led-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--color-text-main);
}

/* User Widget */
.user-profile-widget {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.avatar-holder {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
}
.avatar-holder i {
  width: 16px;
  height: 16px;
  color: var(--color-text-main);
}
.user-info h3 {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-bright);
}
.user-info p {
  font-size: var(--fs-label);
  color: var(--color-text-muted);
}

/* ==========================================================================
   MAIN DASHBOARD WRAPPER
   ========================================================================== */

.main-content-panel {
  flex: 1;
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0; /* Prevents layout break */
  overflow-y: auto; /* conteúdo rola dentro do painel; sidebar fica fixa */
}

/* Header layout */
.main-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 30px;
}
.page-title-bevel h1 {
  font-family: var(--font-brand);
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text-bright);
  margin-bottom: 6px;
}
.page-title-bevel p {
  font-size: 12px;
  color: var(--color-text-muted);
  max-width: 460px;
  line-height: 1.5;
}

/* ==========================================================================
   GLASSMORPHIC SCANNERS (DRAG & DROP)
   ========================================================================== */

.scanner-drop-box {
  flex: 1;
  max-width: 480px;
  background: rgba(255, 255, 255, 0.015);
  border: 1.5px dashed rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 16px 20px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
}
.scanner-drop-box:hover {
  background: rgba(var(--color-teal-rgb), 0.02);
  border-color: var(--color-teal);
}
.scanner-drop-box.dragover {
  background: rgba(var(--color-teal-rgb), 0.05);
  border-color: var(--color-teal);
  box-shadow: 0 0 15px rgba(var(--color-teal-rgb), 0.15) inset;
}

.laser-scanner-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--color-teal);
  box-shadow: 0 0 10px var(--color-teal);
  opacity: 0;
  z-index: 5;
}
.scanner-drop-box.dragover .laser-scanner-line,
.scanner-drop-box.scanning .laser-scanner-line {
  opacity: 1;
  animation: laserScanHoriz 2s infinite ease-in-out;
}
@keyframes laserScanHoriz {
  0% { left: 0%; }
  50% { left: 100%; }
  100% { left: 0%; }
}

.scanner-wrapper {
  display: flex;
  align-items: center;
  gap: 16px;
  pointer-events: none;
}
.scanner-icon {
  width: 24px;
  height: 24px;
  color: var(--color-teal);
  background: rgba(var(--color-teal-rgb), 0.08);
  padding: 10px;
  box-sizing: content-box;
  border-radius: 12px;
  border: 1px solid rgba(var(--color-teal-rgb), 0.15);
  transition: var(--transition-smooth);
}
.scanner-drop-box:hover .scanner-icon {
  transform: scale(1.05);
  box-shadow: 0 0 12px var(--color-teal-glow);
}
.scanner-text-content h3 {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-bright);
  margin-bottom: 2px;
}
.scanner-text-content p {
  font-size: 10px;
  color: var(--color-text-muted);
}
.hidden-input {
  display: none;
}

/* ==========================================================================
   HUD METRICS WIDGETS
   ========================================================================== */

.hud-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.hud-card {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition-smooth);
}
.hud-card:hover {
  transform: translateY(-2px);
  background: var(--glass-bg-hover);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}
.hud-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hud-icon-wrap i {
  width: 18px;
  height: 18px;
}

.bg-teal {
  background: rgba(var(--color-teal-rgb), 0.08);
  border: 1px solid rgba(var(--color-teal-rgb), 0.15);
  color: var(--color-teal);
}
.bg-orange {
  background: rgba(var(--color-orange-rgb), 0.08);
  border: 1px solid rgba(var(--color-orange-rgb), 0.15);
  color: var(--color-orange);
}
.bg-white {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--color-text-bright);
}

/* Specific warning border on card */
.hud-card.border-orange:hover {
  border-color: rgba(var(--color-orange-rgb), 0.3);
}

.hud-data {
  display: flex;
  flex-direction: column;
}
.hud-num {
  font-family: var(--font-brand);
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text-bright);
  line-height: 1.1;
}
.hud-num.font-small {
  font-size: 18px;
}
.hud-title {
  font-size: 10px;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ==========================================================================
   DRAWER / CUSTOMIZER PANEL (GLASS DRAWER)
   ========================================================================== */

.column-customizer-drawer {
  background: rgba(20, 25, 30, 0.7);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  transition: var(--transition-smooth);
}
.hidden-drawer {
  display: none !important;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 10px;
  margin-bottom: 16px;
}
.drawer-header h3 {
  font-family: var(--font-brand);
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-bright);
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
}
.btn-close-drawer {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}
.btn-close-drawer:hover {
  color: var(--color-text-bright);
}
.btn-close-drawer i {
  width: 16px;
  height: 16px;
}

.drawer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.toggle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--glass-border);
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.toggle-card:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.1);
}
.toggle-card span {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-main);
}

/* Glass toggle design */
.toggle-switch {
  width: 32px;
  height: 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  position: relative;
  transition: var(--transition-smooth);
  flex-shrink: 0;
}
.toggle-switch:before {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-text-muted);
  left: 3px;
  top: 3px;
  transition: var(--transition-smooth);
}
.toggle-card input {
  display: none;
}
.toggle-card input:checked + .toggle-switch {
  background: rgba(var(--color-teal-rgb), 0.15);
}
.toggle-card input:checked + .toggle-switch:before {
  transform: translateX(16px);
  background: var(--color-teal);
  box-shadow: 0 0 8px var(--color-teal);
}

/* ==========================================================================
   LEDGER DATA GRID SHEET
   ========================================================================== */

.ledger-container {
  flex: 1;
  background: rgba(18, 22, 28, 0.25);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

/* Table Toolbar row */
.ledger-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.search-box-wrapper {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  flex: 1;
  max-width: 380px;
  transition: var(--transition-smooth);
}
.search-box-wrapper:hover {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.1);
}
.search-box-wrapper:focus-within {
  border-color: var(--color-teal);
  box-shadow: 0 0 10px var(--color-teal-glow);
  background: rgba(255, 255, 255, 0.02);
}
.search-icon {
  width: 14px;
  height: 14px;
  color: var(--color-text-muted);
  margin-right: 10px;
}
.search-box-wrapper input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--color-text-bright);
  font-family: var(--font-data);
  font-size: 11px;
  width: 100%;
  padding: 10px 0;
}
.search-box-wrapper input::placeholder {
  color: var(--color-text-muted);
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Tabs list */
.tab-filters {
  display: flex;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--glass-border);
  padding: 3px;
  border-radius: 10px;
}
.tab-btn {
  background: transparent;
  border: none;
  outline: none;
  padding: 6px 14px;
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-muted);
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.tab-btn.active {
  background: rgba(255, 255, 255, 0.04);
  color: var(--color-text-bright);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255,255,255,0.03);
}
.tab-btn:hover:not(.active) {
  color: var(--color-text-main);
}

/* Scroll wrapper */
.table-scroll-container {
  flex: 1;
  overflow: auto;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.005);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.02);
}

/* Modern Data Table */
.ledger-grid-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px; /* Key style for floating capsule rows matching reference image! */
  font-size: 11px;
  text-align: left;
  padding: 0 10px;
}

.ledger-grid-table th {
  position: sticky;
  top: 0;
  background: var(--bg-dark);
  color: var(--color-text-bright);
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: var(--fs-label);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  z-index: 10;
  white-space: nowrap;
}

/* Floating Row Capsule Structure */
.ledger-grid-table td {
  padding: 12px 16px;
  vertical-align: middle;
  color: var(--color-text-main);
  white-space: nowrap;
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  background: rgba(255, 255, 255, 0.015);
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  transition: var(--transition-smooth);
}

/* Left-most cell border rounding */
.ledger-grid-table td:first-child {
  border-left: 1px solid rgba(255, 255, 255, 0.03);
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;
}

/* Right-most cell border rounding */
.ledger-grid-table td:last-child {
  border-right: 1px solid rgba(255, 255, 255, 0.03);
  border-top-right-radius: 12px;
  border-bottom-right-radius: 12px;
}

/* Hover highlights row capsule */
.ledger-grid-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.035);
  border-top-color: rgba(255, 255, 255, 0.08);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}
.ledger-grid-table tbody tr:hover td:first-child {
  border-left-color: rgba(255, 255, 255, 0.08);
}
.ledger-grid-table tbody tr:hover td:last-child {
  border-right-color: rgba(255, 255, 255, 0.08);
}

/* Row states matching warnings */
.ledger-grid-table tbody tr.row-status-warning td {
  border-top-color: rgba(var(--color-orange-rgb), 0.15);
  border-bottom-color: rgba(var(--color-orange-rgb), 0.15);
}
.ledger-grid-table tbody tr.row-status-warning td:first-child { border-left-color: rgba(var(--color-orange-rgb), 0.15); }
.ledger-grid-table tbody tr.row-status-warning td:last-child { border-right-color: rgba(var(--color-orange-rgb), 0.15); }

.ledger-grid-table tbody tr.row-status-alert td {
  border-top-color: rgba(255, 92, 92, 0.15);
  border-bottom-color: rgba(255, 92, 92, 0.15);
}
.ledger-grid-table tbody tr.row-status-alert td:first-child { border-left-color: rgba(255, 92, 92, 0.15); }
.ledger-grid-table tbody tr.row-status-alert td:last-child { border-right-color: rgba(255, 92, 92, 0.15); }

/* In-table UI elements */
.meta-num {
  font-family: var(--font-brand);
  color: var(--color-teal);
  font-weight: 700;
}
.meta-ch {
  font-size: var(--fs-micro);
  color: var(--color-text-muted);
  display: block;
}
.partner-title {
  font-weight: 700;
  color: var(--color-text-bright);
}
.partner-cnpj {
  font-size: var(--fs-label);
  color: var(--color-text-muted);
  display: block;
}
.item-title {
  font-weight: 600;
  color: var(--color-text-bright);
}
.item-desc {
  font-size: var(--fs-label);
  color: var(--color-text-muted);
  display: block;
}
.badge-code {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 700;
  color: var(--color-teal);
}
.value-highlight {
  font-family: var(--font-brand);
  color: var(--color-text-bright);
  font-size: 11px;
}
.bold-row-total {
  font-weight: 700;
  color: var(--color-text-bright);
}

/* Glass select fields in table rows */
.cfop-select-bevel {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 4px 8px;
  display: flex;
  align-items: center;
}
.cfop-dropdown {
  background: transparent;
  border: none;
  outline: none;
  color: var(--color-text-bright); /* neutro p/ filtros/config; laranja só p/ CFOP (.rule-select) */
  font-family: var(--font-data);
  font-size: 10px;
  font-weight: 700;
  width: 100%;
  cursor: pointer;
  color-scheme: dark;              /* lista nativa aberta = popup escuro (não branco do SO) */
  accent-color: var(--color-teal); /* realce do item = verde-água da marca (não azul do SO) */
}
/* Selects que representam CFOP (regras De/Para) mantêm o laranja-código */
.cfop-dropdown.rule-select {
  color: var(--color-orange);
}
.cfop-dropdown option {
  background-color: var(--bg-dark);
  color: var(--color-text-main);
  font-size: 11px;
}
.cfop-dropdown option:checked {
  color: var(--color-teal);
}

/* Status Labels */
.warning-highlight {
  background: rgba(var(--color-orange-rgb), 0.08);
  border: 1px solid rgba(var(--color-orange-rgb), 0.15);
  color: var(--color-orange);
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 700;
  font-size: var(--fs-micro);
}
.danger-highlight {
  background: rgba(255, 92, 92, 0.08);
  border: 1px solid rgba(255, 92, 92, 0.15);
  color: var(--color-danger);
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 700;
  font-size: var(--fs-micro);
}
.col-hidden {
  display: none !important;
}

/* Empty State */
.empty-state-row td {
  height: 250px;
  text-align: center;
  vertical-align: middle;
  background: transparent !important;
  border: none !important;
}
.empty-state-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.empty-icon {
  width: 38px;
  height: 38px;
  color: var(--color-text-muted);
}
.empty-state-layout h3 {
  font-family: var(--font-brand);
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-bright);
}
.empty-state-layout p {
  font-size: 11px;
  color: var(--color-text-muted);
  max-width: 280px;
  line-height: 1.5;
  margin-bottom: 6px;
}

/* Minimalist Sample Loader Button */
.btn-sample-trigger {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--color-text-main);
  font-family: var(--font-brand);
  font-size: 10px;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.btn-sample-trigger:hover {
  background: var(--color-teal);
  color: #fff;
  border-color: var(--color-teal);
  box-shadow: 0 0 15px var(--color-teal-glow);
}

/* ==========================================================================
   BUTTONS & ACTIONS (FOOTER ROW & BUTTONS)
   ========================================================================== */

.table-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.status-connection-indicator {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.active-dot {
  width: 6px;
  height: 6px;
  background: var(--color-teal);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--color-teal);
}

/* Footer button group (CSV / TXT / Salvar) */
.footer-actions-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Database connection status pill */
.db-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  color: var(--color-text-muted);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.db-status-pill.is-connected {
  color: var(--color-teal, #1e8a7e);
  border-color: rgba(var(--color-teal-rgb), 0.25);
}
.db-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-text-muted);
}
.db-status-dot.connected {
  background: var(--color-teal, #1e8a7e);
  box-shadow: 0 0 8px var(--color-teal, #1e8a7e);
}

/* "Já gravada" badge */
.saved-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 8px;
  padding: 1px 6px;
  border-radius: 5px;
  font-size: var(--fs-micro);
  font-weight: 700;
  color: var(--color-teal, #1e8a7e);
  background: rgba(var(--color-teal-rgb), 0.08);
  border: 1px solid rgba(var(--color-teal-rgb), 0.2);
  vertical-align: middle;
}
.saved-badge i {
  width: 9px;
  height: 9px;
}

/* Status na consulta de escriturações salvas */
.saved-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: var(--fs-label);
  font-weight: 700;
}
.saved-status.ok {
  color: var(--color-teal, #1e8a7e);
  background: rgba(var(--color-teal-rgb), 0.08);
  border: 1px solid rgba(var(--color-teal-rgb), 0.2);
}
.saved-status.pend {
  color: var(--color-orange, #dc832d);
  background: rgba(var(--color-orange-rgb), 0.08);
  border: 1px solid rgba(var(--color-orange-rgb), 0.2);
}

/* ==========================================================================
   LOGIN / CADASTRO (Auth)
   ========================================================================== */
.auth-tabs {
  display: flex;
  gap: 8px;
  margin: 4px 0 16px;
  background: rgba(0, 0, 0, 0.2);
  padding: 4px;
  border-radius: 12px;
}
.auth-tab {
  flex: 1;
  padding: 9px 12px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--color-text-muted);
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.auth-tab.active {
  background: rgba(var(--color-teal-rgb), 0.12);
  color: var(--color-teal);
  box-shadow: inset 0 0 0 1px rgba(var(--color-teal-rgb), 0.25);
}
.auth-message {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 14px;
  border: 1px solid transparent;
}
.auth-message.error {
  color: #ff8a8a;
  background: rgba(255, 92, 92, 0.10);
  border-color: rgba(255, 92, 92, 0.3);
}
.auth-message.warn {
  color: var(--color-orange, #dc832d);
  background: rgba(var(--color-orange-rgb), 0.10);
  border-color: rgba(var(--color-orange-rgb), 0.3);
}
.auth-message.success {
  color: var(--color-teal);
  background: rgba(var(--color-teal-rgb), 0.10);
  border-color: rgba(var(--color-teal-rgb), 0.3);
}
.auth-hint {
  font-size: 10px;
  line-height: 1.5;
  color: var(--color-text-muted);
  margin: -2px 0 14px;
}
.auth-link {
  display: block;
  width: 100%;
  margin-top: 12px;
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: var(--transition-smooth);
}
.auth-link:hover {
  color: var(--color-teal);
}
.btn-primary-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.4);
}

/* Client registry form */
.client-add-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
  flex-wrap: wrap;
}
.client-add-row .param-input-bevel {
  flex: 1;
  min-width: 180px;
}
.client-add-row .btn-primary-action {
  white-space: nowrap;
}

/* Importação em lote de clientes */
.bulk-import-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.bulk-preview {
  margin-top: 14px;
  padding: 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.bulk-summary {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.bulk-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.bulk-tag.ok { color: var(--color-teal); border-color: rgba(var(--color-teal-rgb), 0.3); }
.bulk-tag.warn { color: var(--color-orange, #dc832d); border-color: rgba(var(--color-orange-rgb), 0.3); }
.bulk-tag.muted { color: var(--color-text-muted); }
.bulk-invalid {
  font-size: 10px;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: 12px;
}
.bulk-actions {
  display: flex;
  gap: 10px;
}

/* Unregistered client highlight in the Cliente column */
.client-unregistered {
  color: var(--color-orange, #dc832d) !important;
  font-style: italic;
  font-weight: 600;
}

/* ==========================================================================
   ALERTAS DE IDENTIFICAÇÃO (campos não identificados)
   ========================================================================== */
.field-missing {
  color: var(--color-orange, #dc832d);
  font-style: italic;
  font-weight: 600;
  font-size: 10px;
}
.row-alert-icon {
  width: 12px;
  height: 12px;
  color: var(--color-orange, #dc832d);
  margin-right: 5px;
  vertical-align: -1px;
}
/* Realce sutil da linha com pendência: faixa lateral laranja */
.ledger-grid-table tbody tr.row-alert td {
  border-top-color: rgba(var(--color-orange-rgb), 0.18);
  border-bottom-color: rgba(var(--color-orange-rgb), 0.18);
}
.ledger-grid-table tbody tr.row-alert td:first-child {
  border-left: 3px solid var(--color-orange, #dc832d);
}
.classificacao-text {
  display: block;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==========================================================================
   CFOP AUTOCOMPLETE
   ========================================================================== */
.cfop-autocomplete {
  position: relative;
  min-width: 120px;
}
.cfop-autocomplete .cfop-select-bevel {
  justify-content: space-between;
  gap: 6px;
}
.cfop-ac-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--color-orange, #dc832d);
  font-family: var(--font-data, 'Inter', sans-serif);
  font-size: 11px;
  font-weight: 700;
  width: 100%;
  min-width: 52px;
  cursor: text;
}
.cfop-ac-caret {
  width: 13px;
  height: 13px;
  color: var(--color-text-muted);
  flex-shrink: 0;
  pointer-events: none;
}

/* Floating list (position: fixed -> escapa do overflow da tabela) */
.cfop-ac-list {
  position: fixed;
  z-index: 9999;
  max-height: 240px;
  overflow-y: auto;
  background: rgba(18, 22, 30, 0.97);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(var(--color-teal-rgb), 0.18);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.03);
  padding: 6px;
}
.cfop-ac-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.12s ease;
}
.cfop-ac-item:hover,
.cfop-ac-item.is-active {
  background: rgba(var(--color-teal-rgb), 0.12);
}
.cfop-ac-item.is-current {
  background: rgba(var(--color-orange-rgb), 0.10);
}
.cfop-ac-code {
  font-family: var(--font-data, 'Inter', sans-serif);
  font-weight: 700;
  font-size: 11px;
  color: var(--color-orange, #dc832d);
  flex-shrink: 0;
  min-width: 38px;
}
.cfop-ac-desc {
  font-size: 10px;
  color: var(--color-text-main);
  line-height: 1.3;
  white-space: normal;
}
.cfop-ac-empty {
  padding: 12px 10px;
  font-size: 10px;
  color: var(--color-text-muted);
  text-align: center;
}

/* ==========================================================================
   CUSTOM SELECT (substitui o <select> nativo p/ realce na marca, igual ao AC)
   ========================================================================== */
.cfop-dropdown.cs-native {
  /* select nativo escondido, mas mantido como fonte do valor e dos eventos */
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}
.cfop-select-bevel.cs-enhanced {
  cursor: pointer;
  justify-content: space-between;
  gap: 6px;
}
.cs-label {
  flex: 1;
  min-width: 0;
  font-family: var(--font-data);
  font-size: var(--fs-label);
  font-weight: 700;
  color: var(--color-text-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cs-label.cs-cfop { color: var(--color-orange); } /* selects de código CFOP */
.cs-caret {
  width: 13px;
  height: 13px;
  color: var(--color-text-muted);
  flex-shrink: 0;
  pointer-events: none;
  transition: transform 0.2s ease;
}
.cfop-select-bevel.cs-open { border-color: var(--color-teal); }
.cfop-select-bevel.cs-open .cs-caret { transform: rotate(180deg); }
.cfop-select-bevel.cs-enhanced:focus-visible {
  outline: none;
  border-color: var(--color-teal);
  box-shadow: 0 0 10px var(--color-teal-glow);
}

/* Clean Flat Buttons */
.btn-action {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--glass-border);
  color: var(--color-text-main);
  padding: 8px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-family: var(--font-brand);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-smooth);
}
.btn-action i {
  width: 14px;
  height: 14px;
}
.btn-action:hover {
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--color-text-bright);
}

/* Solid Glass Primary Action Button (Matches the follow/save button in 'Labs.') */
.btn-primary-action {
  background: var(--color-teal);
  border: 1px solid var(--color-teal);
  color: #030a08;
  padding: 10px 24px;
  border-radius: 12px;
  cursor: pointer;
  font-family: var(--font-brand);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 15px var(--color-teal-glow);
}
.btn-primary-action i {
  width: 14px;
  height: 14px;
}
.btn-primary-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(var(--color-teal-rgb), 0.5);
  filter: brightness(1.05);
}
.btn-primary-action:active {
  transform: translateY(0);
}

/* ==========================================================================
   GLASSMORPHIC TOAST NOTIFICATION CARD
   ========================================================================== */

.toast-card-glass {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(18, 22, 28, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  z-index: 100;
  transform: translateY(150%);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.toast-card-glass.active {
  transform: translateY(0);
}
.toast-accent-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-teal);
  box-shadow: 0 0 8px var(--color-teal);
}
.toast-body-text h4 {
  font-family: var(--font-brand);
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-bright);
}
.toast-body-text p {
  font-size: 10px;
  color: var(--color-text-muted);
}

/* Utility classes to handle toast LEDs */
.toast-accent-dot.led-teal { background: var(--color-teal); box-shadow: 0 0 8px var(--color-teal); }
.toast-accent-dot.led-green { background: var(--color-teal); box-shadow: 0 0 8px var(--color-teal); }
.toast-accent-dot.led-orange { background: var(--color-orange); box-shadow: 0 0 8px var(--color-orange); }
.toast-accent-dot.led-red { background: var(--color-danger); box-shadow: 0 0 8px var(--color-danger); }

/* ==========================================================================
   GLASSMORPHIC LOGIN OVERLAY
   ========================================================================== */

.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(8, 11, 14, 0.65);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 1;
  visibility: visible;
}

.login-overlay.hidden-login {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.login-card-glass {
  width: 380px;
  background: rgba(20, 25, 30, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 40px 32px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255,255,255,0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.login-logo-wrapper {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 8px 16px;
  border-radius: 12px;
  margin-bottom: 20px;
}

.login-logo {
  height: 32px;
  object-fit: contain;
}

.login-card-glass h2 {
  font-family: var(--font-brand);
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text-bright);
  margin-bottom: 4px;
}

.login-subtitle {
  font-size: 10px;
  color: var(--color-text-muted);
  margin-bottom: 24px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.login-card-glass form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.input-glass-group {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  transition: var(--transition-smooth);
  width: 100%;
}

.input-glass-group:hover {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.025);
}

.input-glass-group:focus-within {
  border-color: var(--color-teal);
  box-shadow: 0 0 10px var(--color-teal-glow);
  background: rgba(255, 255, 255, 0.025);
}

.input-icon {
  width: 14px;
  height: 14px;
  color: var(--color-text-muted);
  margin-right: 12px;
}

.input-glass-group input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--color-text-bright);
  font-family: var(--font-data);
  font-size: 12px;
  width: 100%;
  padding: 12px 0;
}

.input-glass-group input::placeholder {
  color: var(--color-text-muted);
}

.btn-login-action {
  background: var(--color-teal);
  border: 1px solid var(--color-teal);
  color: #030a08;
  border-radius: 12px;
  padding: 12px;
  font-family: var(--font-brand);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 15px var(--color-teal-glow);
  width: 100%;
  margin-top: 8px;
}

.btn-login-action:hover {
  box-shadow: 0 6px 20px rgba(var(--color-teal-rgb), 0.5);
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.btn-login-action:active {
  transform: translateY(0);
}

.login-footer {
  font-size: var(--fs-micro);
  color: var(--color-text-muted);
  margin-top: 28px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ==========================================================================
   VIEWPORT SECTIONS & TAB VIEWS
   ========================================================================== */

.content-view {
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex: 1;
}

.hidden-view {
  display: none !important;
}

.param-card {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--glass-border);
  padding: 16px 20px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.param-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.param-input-bevel {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 6px 12px;
}

.param-input-bevel input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--color-text-bright);
  font-family: var(--font-brand);
  font-size: 14px;
  font-weight: 700;
  width: 100%;
  text-align: center;
}

/* Custom Scroll Rules for CFOP tab */
.rules-table td {
  padding: 8px 16px;
}
.rules-table select {
  font-size: 10px;
}

/* Active tab style inside sub-tab buttons */
.subtab-btn {
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ==========================================================================
   TÍTULOS DE SEÇÃO (Configurações) — substitui estilos inline duplicados
   ========================================================================== */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.section-title {
  font-family: var(--font-brand);
  font-size: var(--fs-h3);
  font-weight: 700;
  color: var(--color-text-bright);
  margin-bottom: 4px;
}
.section-sub {
  font-size: var(--fs-data);
  color: var(--color-text-muted);
  line-height: 1.5;
}
.section-intro {
  font-size: var(--fs-data);
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
}
.subsection-title {
  font-family: var(--font-brand);
  font-size: var(--fs-body);
  font-weight: 700;
  color: var(--color-text-bright);
  margin-bottom: 12px;
}

