*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #2E8B57;
  --primary-hover: #236b44;
  --accent: #FFD700;
  --danger: #e53e3e;
  --success: #38a169;
  --bg: #f7fafc;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --text: #2d3748;
  --text-muted: #718096;
  --radius: 8px;
}

body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); line-height: 1.5; }

.navbar { background: var(--primary); color: white; padding: 0 1.5rem; display: flex; align-items: center; justify-content: space-between; height: 52px; }
.nav-left { display: flex; align-items: center; gap: 2rem; }
.nav-brand { color: white; font-family: 'Montserrat', sans-serif; font-weight: 800; font-size: 1.1rem; text-decoration: none; display: flex; align-items: center; gap: 0.5rem; }
.nav-logo { height: 32px; width: auto; }
.nav-powered { font-family: 'Inter', sans-serif; font-weight: 400; font-size: 0.7rem; color: var(--accent); letter-spacing: 0.03em; }
.nav-main { display: flex; align-items: center; gap: 0.25rem; }
.nav-main a { color: rgba(255,255,255,0.78); text-decoration: none; padding: 0.4rem 0.75rem; border-radius: 6px; font-size: 0.875rem; font-weight: 500; transition: background 0.15s, color 0.15s; }
.nav-main a:hover { background: rgba(255,255,255,0.12); color: #fff; }
.nav-right { display: flex; align-items: center; }
/* tenant dropdown */
.nav-tenant-menu { position: relative; cursor: pointer; padding: 0.4rem 0.75rem; border-radius: 6px; transition: background 0.15s; user-select: none; }
.nav-tenant-menu:hover { background: rgba(255,255,255,0.12); }
.nav-tenant-name { color: rgba(255,255,255,0.92); font-size: 0.875rem; font-weight: 500; }
.nav-tenant-arrow { color: rgba(255,255,255,0.5); font-size: 0.75rem; margin-left: 0.25rem; }
.nav-dropdown { display: none; position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,0.15); min-width: 220px; z-index: 100; overflow: hidden; }
.nav-tenant-menu.is-open .nav-dropdown { display: block; }
.nav-dropdown-header { padding: 0.5rem 1rem; border-bottom: 1px solid #e2e8f0; }
.nav-dropdown-user { color: #4a5568; font-size: 0.75rem; word-break: break-all; }
.nav-dropdown-item { display: block; width: 100%; padding: 0.5rem 1rem; color: #2d3748; font-size: 0.7rem; text-decoration: none; border: none; background: none; text-align: left; cursor: pointer; font: inherit; }
.nav-dropdown-item:hover { background: #f7fafc; }
.nav-dropdown-logout { color: #e53e3e; }
.nav-dropdown-logout:hover { background: #fff5f5; }

.container { max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem; }
.page-header { margin-bottom: 1.5rem; }
.page-header h2 { font-size: 1.5rem; color: var(--text); }
.page-header p { color: var(--text-muted); margin-top: 0.25rem; }

.card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.5rem; }
.card h3 { font-size: 1.1rem; margin-bottom: 1rem; }
.card h4 { font-size: 0.95rem; margin: 1.25rem 0 0.75rem; }

.login-box { max-width: 380px; margin: 4rem auto; background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; }
.login-logo { width: 100%; max-width: 260px; display: block; margin: 0 auto 1rem; }
.login-brand { font-family: 'Montserrat', sans-serif; font-weight: 800; font-size: 1.6rem; color: var(--primary); margin-bottom: 0; }
.login-powered { font-size: 0.75rem; color: var(--accent); font-weight: 600; letter-spacing: 0.04em; margin-bottom: 0.25rem; }
.subtitle { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 1.5rem; }

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 0.375rem; }
.form-group input[type="text"], .form-group input[type="email"], .form-group input[type="password"], .form-group input[type="file"], .form-group select { width: 100%; padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.9rem; }
.form-group input[type="checkbox"] { margin-right: 0.5rem; cursor: pointer; }
.form-group label:has(input[type="checkbox"]) { display: flex; align-items: center; margin-bottom: 0.375rem; font-weight: 400; }
.form-group small { display: block; color: var(--text-muted); font-size: 0.8rem; margin-top: 0.25rem; }
.form-row { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.form-row input { flex: 1; min-width: 120px; padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.9rem; }

.btn { display: inline-block; padding: 0.5rem 1.25rem; border-radius: var(--radius); font-size: 0.9rem; font-weight: 500; cursor: pointer; border: none; text-decoration: none; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-secondary:hover { background: #cbd5e0; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #c53030; }
.btn-sm { padding: 0.25rem 0.75rem; font-size: 0.8rem; }
.btn-full { width: 100%; text-align: center; }
.btn-link { background: none; border: none; color: rgba(255,255,255,0.9); cursor: pointer; font-size: 0.9rem; padding: 0; }
.btn-link:hover { color: white; }
.btn-clear { background: none; border: none; color: #74c69d; cursor: pointer; font-size: 0.85rem; padding: 0; font-weight: 600; }
.btn-clear:hover { color: #95d5b2; text-decoration: underline; }

.alert { padding: 0.75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: 0.9rem; }
.alert-error { background: #fff5f5; border: 1px solid #fed7d7; color: #c53030; }
.alert-success { background: #f0fff4; border: 1px solid #c6f6d5; color: #276749; }
.alert-warning { background: #fffbeb; border: 1px solid rgba(245,158,11,0.3); border-left: 4px solid #d97706; color: #92400e; }

.progress-bar-wrap { background: var(--border); border-radius: 999px; height: 10px; overflow: hidden; margin: 1rem 0; }
.progress-bar { background: linear-gradient(90deg, #a8dbc0, #6db88e); height: 100%; border-radius: 999px; transition: width 0.4s ease; }
.progress-bar-indeterminate { width: 40%; animation: indeterminate 1.5s infinite ease-in-out; }
@keyframes indeterminate { 0% { transform: translateX(-200%); } 100% { transform: translateX(350%); } }
.progress-message { color: rgba(255,255,255,0.9); font-size: 0.875rem; }
.progress-count { color: rgba(255,255,255,0.6); font-size: 0.8rem; margin-top: 0.25rem; }

.actions-bar { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.6rem; }
.filter-label { display: flex; align-items: center; gap: 0.4rem; font-size: 0.875rem; cursor: pointer; user-select: none; margin-right: auto; }
.filter-label input[type="checkbox"] { accent-color: var(--green); width: 16px; height: 16px; cursor: pointer; }
.below-table-bar { display: flex; align-items: center; padding: 0.5rem 0.25rem; margin-top: 0.4rem; }
.table-wrap { overflow-x: auto; overflow-y: auto; max-height: 70vh; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.875rem; }
.data-table th { background: var(--primary); color: #fff; border-bottom: 2px solid var(--primary-hover); padding: 0.625rem 0.75rem; text-align: left; font-weight: 600; white-space: nowrap; position: sticky; top: 0; z-index: 2; }
.data-table td { border-bottom: 1px solid var(--border); padding: 0.625rem 0.75rem; }
.data-table td.nowrap { white-space: nowrap; }
.data-table td.currency { text-align: right; white-space: nowrap; }
.data-table tr:hover td { background: #f7fafc; }
.obs-cell { min-width: 500px; font-size: 0.8rem; color: var(--text-muted); white-space: normal; word-break: break-word; }
.ncm-sugeridos-list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
}
.ncm-sugerido-item {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef6f1;
  border: 1px solid #d4e8dc;
  color: #365243;
  font-size: 0.78rem;
  line-height: 1.2;
  white-space: normal;
}

.badge { display: inline-block; padding: 0.2rem 0.5rem; border-radius: 999px; font-size: 0.8rem; font-weight: 600; }
.badge-divergente { background: #fff5f5; color: #c53030; border: 1px solid #fed7d7; }
.badge-erro { background: var(--border); color: var(--text-muted); }
.badge-correto      { background: #1a6b3a; color: #ffffff; border: 1px solid #145c30; }
.badge-coerente     { background: #fefce8; color: #854d0e; border: 1px solid #fde68a; }
.badge-inconsistente { background: #fbbf24; color: #78350f; border: 1px solid #f59e0b; }
.badge-insuficiente { background: #fafafa; color: #718096; border: 1px solid #e2e8f0; }

.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.empty-state p { margin-bottom: 1rem; }
.text-muted { color: var(--text-muted); }

.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: inline; }
.htmx-request .htmx-indicator + span { display: none; }

/* ── Homepage Hero ─────────────────────────────── */
body:has(.hero-page) {
  background: linear-gradient(160deg, #e8f8ef 0%, #f4fbf7 35%, #f7fafc 65%, #ffffff 100%);
}

.hero-page {
  --content-width: 860px;
  min-height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 26px 24px 48px;
}
.hero-page > * { width: 100%; max-width: var(--content-width); }
.hero-page > .modal-overlay { max-width: none; }

.hero-eyebrow {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: -2px;
  text-align: center;
}

.hero-headline {
  font-family: 'Montserrat', sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  color: #1a202c;
  text-align: center;
  line-height: 1.2;
  margin-top: 0;
  margin-bottom: 28px;
}

.hero-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
  max-width: 440px;
  margin-bottom: 36px;
  line-height: 1.6;
}

.upload-card {
  background: linear-gradient(180deg, #2e8b57 0%, #257349 100%);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 10px 24px rgba(46,139,87,0.22), 0 2px 8px rgba(0,0,0,0.08);
  width: 100%;
  max-width: 480px;
  margin: 0 auto 36px;
}
.upload-card-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}
.upload-card-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffd166;
  line-height: 1.25;
}
.upload-card-sub {
  font-size: 0.86rem;
  color: rgba(255,255,255,0.84);
  line-height: 1.55;
}

.drop-zone {
  border: 2px dashed rgba(255,255,255,0.3);
  border-radius: 12px;
  padding: 28px 20px;
  text-align: center;
  background: linear-gradient(135deg, rgba(255,255,255,0.12), rgba(255,255,255,0.08));
  cursor: pointer;
  margin-bottom: 18px;
  transition: background 0.2s, border-color 0.2s;
}
.drop-zone:hover { background: linear-gradient(135deg, rgba(255,255,255,0.18), rgba(255,255,255,0.12)); border-color: rgba(255,255,255,0.42); }
.drop-zone-icon { font-size: 2rem; margin-bottom: 8px; }
.drop-zone-title { font-size: 0.9rem; font-weight: 600; color: #ffffff; margin-bottom: 4px; }
.drop-zone-sub { font-size: 0.75rem; color: rgba(255,255,255,0.76); }
.drop-zone-btn {
  display: inline-block;
  margin-top: 12px;
  background: rgba(255,255,255,0.14);
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 7px 18px;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,0.24);
  cursor: pointer;
}
.drop-zone-btn:hover { background: rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.34); }
.drop-zone-filename {
  font-size: 0.75rem;
  color: #ffffff;
  margin-top: 8px;
  font-weight: 500;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  background: #f8fbfa;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 18px;
}
.toggle-row-label { font-size: 0.8rem; font-weight: 600; color: var(--text); }
.toggle-row-label small { display: block; font-size: 0.7rem; color: #a0aec0; font-weight: 400; margin-top: 2px; }

.toggle-switch {
  width: 44px;
  height: 26px;
  background: #cbd5e0;
  border-radius: 999px;
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.25s;
}
.toggle-switch.on { background: var(--primary); }
.toggle-knob {
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  position: absolute;
  top: 3px;
  left: 3px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
  transition: transform 0.25s;
  pointer-events: none;
}
.toggle-switch.on .toggle-knob { transform: translateX(18px); }

.submit-btn-hero {
  width: 100%;
  background: var(--primary);
  color: white;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 14px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 12px rgba(46,139,87,0.3);
  transition: background 0.2s;
}
.submit-btn-hero:hover { background: var(--primary-hover); }

.feature-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  width: 100%;
  max-width: 480px;
}
.feature-card {
  background: linear-gradient(180deg, #2e8b57 0%, #257349 100%);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 10px 24px rgba(46,139,87,0.22), 0 2px 8px rgba(0,0,0,0.08);
}
.feature-card-icon { font-size: 1.5rem; margin-bottom: 6px; }
.feature-card-title { font-size: 0.75rem; font-weight: 600; color: #ffd166; margin-bottom: 3px; }
.feature-card-desc { font-size: 0.65rem; color: rgba(255,255,255,0.82); line-height: 1.4; }

/* Module grid */
.module-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: 1fr;
  gap: 16px;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}
.module-grid-compact {
  max-width: 420px;
}
.module-card {
  background: linear-gradient(180deg, #2e8b57 0%, #257349 100%);
  border-radius: 12px;
  padding: 18px;
  text-align: left;
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 10px 24px rgba(46,139,87,0.22), 0 2px 8px rgba(0,0,0,0.08);
  transition: box-shadow 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
  min-height: 206px;
  height: 100%;
}
.module-card-compact {
  min-height: 150px;
  padding: 16px;
}
.module-card-action {
  cursor: pointer;
}
.module-card-action:focus-visible {
  outline: 3px solid rgba(255,255,255,0.32);
  outline-offset: 3px;
}
.module-card-open {
  border-color: rgba(255,255,255,0.35);
  box-shadow: 0 14px 28px rgba(46,139,87,0.28), 0 4px 10px rgba(0,0,0,0.1);
}
.module-card form { margin-top: auto; padding-top: 12px; }
.module-card:hover {
  box-shadow: 0 14px 28px rgba(46,139,87,0.28), 0 4px 10px rgba(0,0,0,0.1);
  border-color: rgba(255,255,255,0.35);
}
.module-icon { font-size: 22px; margin-bottom: 6px; filter: saturate(0.9) brightness(1.05); }
.module-title { font-weight: 700; font-size: 14px; color: #ffd166; margin-bottom: 4px; }
.module-desc { font-size: 11px; color: rgba(255,255,255,0.84); line-height: 1.5; }
.module-card .btn-module {
  margin-top: auto;
}
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(14, 30, 22, 0.48);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 50;
}
.modal-overlay.is-open {
  display: flex;
}
.modal-card {
  width: 100%;
  max-width: 460px;
  background: linear-gradient(180deg, #2e8b57 0%, #257349 100%);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.2);
  padding: 22px;
}
/* Small modal variant (upload, etc.) */
.modal-card-sm { max-width: 480px; }

/* Dropzone (drag & drop upload area inside modals) */
.dropzone {
  border: 2px dashed rgba(255,255,255,0.25);
  border-radius: 12px;
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  margin-bottom: 12px;
}
.dropzone:hover {
  border-color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.04);
}
.dropzone-active {
  border-color: #ffd166 !important;
  background: rgba(255,209,102,0.06) !important;
}
.dropzone-icon { font-size: 2rem; margin-bottom: 8px; }
.dropzone-title {
  color: #ffd166;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 4px;
}
.dropzone-sub {
  color: rgba(255,255,255,0.68);
  font-size: 0.78rem;
  line-height: 1.4;
}
.file-count-label {
  color: rgba(255,255,255,0.84);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 12px;
  text-align: center;
}

/* Danger modal variant (company deletion) */
.modal-card-danger {
  background: linear-gradient(180deg, #6b2525 0%, #4a1c1c 100%);
  border: 1px solid rgba(252, 129, 129, 0.2);
}
.modal-card-danger .form-input::placeholder { color: rgba(255,255,255,0.35); }

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.modal-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffd166;
}
.modal-sub {
  margin-top: 4px;
  font-size: 0.84rem;
  color: rgba(255,255,255,0.84);
  line-height: 1.5;
}
.modal-card .form-label {
  color: rgba(255,255,255,0.92);
}
.modal-card .form-input {
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.12);
  color: #ffffff;
}
.modal-card input[type="file"].form-input {
  padding: 8px;
}
.modal-card input[type="file"].form-input::file-selector-button {
  margin-right: 12px;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,0.24);
  border-radius: 8px;
  background: rgba(255,255,255,0.14);
  color: #ffffff;
  font: inherit;
  cursor: pointer;
}
.modal-card input[type="file"].form-input::file-selector-button:hover {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.34);
}
.modal-card .form-input::placeholder {
  color: rgba(255,255,255,0.66);
}
.modal-card .form-input:focus {
  border-color: rgba(255,255,255,0.34);
  background: rgba(255,255,255,0.18);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.1);
}
.modal-close {
  background: transparent;
  border: 0;
  color: rgba(255,255,255,0.82);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.modal-close:hover {
  color: #fff;
}
.modal-note {
  margin: 14px 0 16px;
  font-size: 0.82rem;
  color: #fff3d6;
  background: rgba(245, 158, 11, 0.16);
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(245, 158, 11, 0.3);
  line-height: 1.5;
}
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.modal-actions .btn-link {
  color: rgba(255,255,255,0.82);
}
.modal-actions .btn-link:hover {
  color: #fff;
}
.modal-submit {
  max-width: 190px;
}
.btn-module {
  display: inline-block;
  padding: 8px 16px;
  background: rgba(255,255,255,0.14);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.24);
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  box-shadow: none;
  transition: background 0.2s, border-color 0.2s;
}
.btn-module:hover { background: rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.34); }
.module-select {
  width: 100%;
  padding: 6px 8px;
  margin-top: 10px;
  margin-bottom: 0;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-size: 13px;
}
.module-select option {
  color: #1a202c;
}
.base-status-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  font-size: 14px;
}
.base-count { color: var(--text); }
.base-empty { color: var(--text-muted); }
.text-success { color: #276749; }
.text-warning { color: #7b5a00; }

/* Stage slide transition */
#stage, #stage-pre { width: 100%; max-width: 860px; }
.stage-content {
  animation: stageSlideIn 0.32s ease;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.stage-content-back {
  animation: stageSlideBackIn 0.32s ease;
}
.stage-shell {
  width: 100%;
  max-width: 860px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 20px;
}
.stage-side-nav {
  width: 120px;
  display: flex;
  justify-content: flex-end;
  padding-top: 10px;
  flex-shrink: 0;
}
.stage-side-spacer {
  width: 120px;
  flex-shrink: 0;
}
@keyframes stageSlideIn {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes stageSlideBackIn {
  from { opacity: 0; transform: translateX(-40px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Add-bar (above module grid) */
.upload-success-card { text-align: center; }
.upload-success-icon { font-size: 2.5rem; color: var(--primary); margin-bottom: 12px; }
.upload-success-msg { font-size: 1rem; color: var(--text); margin-bottom: 24px; }

.base-ready-bar {
  border-top: 1px solid rgba(255,255,255,0.16);
  margin-top: 18px;
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  overflow: hidden;
}
.base-ready-bar--animate {
  animation: slideDown 0.38s ease forwards;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-12px); max-height: 0; padding-top: 0; margin-top: 0; }
  to   { opacity: 1; transform: translateY(0);     max-height: 200px; padding-top: 16px; margin-top: 18px; }
}
#base-ready-wrapper.htmx-swapping .base-ready-bar {
  animation: slideUp 0.34s ease forwards;
}
@keyframes slideUp {
  from { opacity: 1; transform: translateY(0);      max-height: 200px; padding-top: 16px; margin-top: 18px; }
  to   { opacity: 0; transform: translateY(-12px);  max-height: 0;     padding-top: 0;    margin-top: 0; }
}
.base-ready-info {
  font-size: 13px;
  color: rgba(255,255,255,0.88);
  text-align: center;
}
.btn-back {
  background: none;
  border: none;
  padding: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  cursor: pointer;
}
.btn-back:hover { text-decoration: underline; }
.btn-ready {
  display: inline-block;
  padding: 11px 20px;
  background: #f0fff4;
  color: var(--primary);
  border: 1.5px solid #c6e8d4;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
  transition: background 0.2s, border-color 0.2s;
}
.upload-card .btn-ready { display: block; width: 100%; }
.upload-card #module-progress-container {
  width: 100%;
  text-align: center;
}
.btn-ready:hover { background: #e0f7ea; border-color: var(--primary); }
.table-note { font-size: 12px; color: var(--text-muted); padding: 8px 0; }
.module-card .btn-link {
  color: var(--primary);
  font-size: 0.84rem;
  font-weight: 700;
}
.module-card .btn-link:hover {
  color: var(--primary-hover);
}
.form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
}
.form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-size: 0.9rem;
  box-sizing: border-box;
}
.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(46,139,87,0.12);
}
.progress-card {
  width: 100%;
  max-width: 480px;
  background: linear-gradient(180deg, #2e8b57 0%, #257349 100%);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 10px 24px rgba(46,139,87,0.22), 0 2px 8px rgba(0,0,0,0.08);
  text-align: center;
}
.progress-icon {
  font-size: 2rem;
  margin-bottom: 10px;
}
.progress-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffd166;
  margin-bottom: 14px;
}
.progress-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2e8b57, #49a26d);
  transition: width 0.25s ease;
}
.progress-sub {
  margin-top: 12px;
  font-size: 0.84rem;
  color: rgba(255,255,255,0.84);
  line-height: 1.5;
}

/* ── Consultas Rápidas ─────────────────────────── */
.section-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.section-title {
  font-family: 'Montserrat', sans-serif; font-size: 11px; font-weight: 700;
  color: var(--text); text-transform: uppercase; letter-spacing: 0.1em; white-space: nowrap;
}
.section-line { flex: 1; height: 1px; background: #c6e8d4; }

.consultas-grid {
  display: grid; grid-template-columns: 1fr 1.25fr; gap: 12px;
  width: 100%; margin-bottom: 2px;
}
.consulta-card {
  background: linear-gradient(180deg, #2e8b57 0%, #257349 100%);
  border: 1px solid rgba(255,255,255,0.12); border-radius: 14px;
  padding: 20px; box-shadow: 0 10px 24px rgba(46,139,87,0.22), 0 2px 8px rgba(0,0,0,0.08);
  min-width: 0;
}
.consulta-card-title {
  font-size: 11px; font-weight: 700; color: #ffd166;
  text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 12px;
}
.consulta-input-row { display: flex; gap: 8px; margin-bottom: 12px; }
.consulta-input-row input,
.consulta-input-row select {
  flex: 1; min-width: 0; padding: 8px 12px; border: 1px solid rgba(255,255,255,0.24);
  border-radius: 8px; font-size: 0.875rem; color: #ffffff;
  background: rgba(255,255,255,0.16); font-family: 'Inter', sans-serif;
}
.consulta-input-row input::placeholder { color: rgba(255,255,255,0.68); }
.consulta-input-row select option { color: #1a202c; }
.consulta-input-row input:focus,
.consulta-input-row select:focus {
  outline: none;
  border-color: rgba(255,255,255,0.38);
  background: rgba(255,255,255,0.22);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.1);
}
.consulta-input-ncm { max-width: 130px; flex: none !important; }
.btn-go {
  background: var(--primary); color: white; border: none;
  border-radius: 8px; padding: 8px 14px; font-size: 0.875rem;
  font-weight: 600; cursor: pointer; white-space: nowrap; flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(46,139,87,0.25); font-family: 'Inter', sans-serif;
}
.btn-go:hover { background: var(--primary-hover); }
.consulta-result-area { min-height: 20px; }
.consulta-result-panel { display: flex; flex-direction: column; gap: 10px; }
.consulta-result-panel .text-muted { color: rgba(255,255,255,0.65); }
.consulta-result-clear {
  align-self: flex-start;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,0.52);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  font-family: 'Inter', sans-serif;
}
.consulta-result-clear:hover { color: rgba(255,255,255,0.85); }
.consulta-loading {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 6px 0 10px;
  color: rgba(255,255,255,0.82);
  font-size: 12px;
}
.consulta-loading.htmx-request,
.htmx-request .consulta-loading {
  display: inline-flex;
}
.spinner-inline {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid #c6e8d4;
  border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* NCM tree */
.ncm-tree { display: flex; flex-direction: column; }
.ncm-tree-row {
  display: flex; align-items: flex-start;
  padding: 7px 0; border-bottom: 1px solid #f0f7f3;
}
.ncm-tree-row:last-child { border-bottom: none; }
.ncm-vbar {
  width: 2px; border-radius: 2px; align-self: stretch;
  margin-right: 10px; margin-top: 3px; flex-shrink: 0;
}
.ncm-badge {
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 5px;
  white-space: nowrap; flex-shrink: 0; min-width: 64px; text-align: center; margin-right: 10px;
}
.ncm-level-label {
  font-size: 9px; color: rgba(255,255,255,0.58); text-transform: uppercase;
  letter-spacing: 0.06em; margin-bottom: 2px; font-weight: 600;
}
.ncm-level-desc { font-size: 12px; color: rgba(255,255,255,0.88); line-height: 1.4; }
.lv0 .ncm-vbar  { background: #c6e8d4; }
.lv0 .ncm-badge { background: #e6f4ed; color: #1a6b3a; border: 1px solid #c6e8d4; }
.lv1 .ncm-vbar  { background: #a7f3d0; }
.lv1 .ncm-badge { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.lv2 .ncm-vbar  { background: #fde68a; }
.lv2 .ncm-badge { background: #fefce8; color: #854d0e; border: 1px solid #fde68a; }
.lv3 .ncm-vbar  { background: var(--primary); }
.lv3 .ncm-badge { background: var(--primary); color: white; border: 1px solid var(--primary-hover); font-size: 12px; }
.lv3 .ncm-level-desc { font-weight: 600; color: #ffffff; }

/* Benefício result */
.beneficio-result {
  background: #f4fbf7;
  border-radius: 0 0 10px 10px; padding: 14px;
}
.beneficio-result-expanded { margin-top: 0; }
.beneficio-results-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.beneficio-results-summary {
  font-size: 12px;
  color: rgba(255,255,255,0.82);
  padding: 0 2px;
}
.beneficio-item {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 10px;
  overflow: hidden;
}
.beneficio-item-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
}
.beneficio-item-summary::-webkit-details-marker { display: none; }
.beneficio-item-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.beneficio-item-desc {
  font-size: 13px;
  color: #ffffff;
  font-weight: 600;
  line-height: 1.4;
}
.beneficio-item-desc-muted {
  font-size: 11px;
  color: rgba(255,255,255,0.72);
  font-weight: 500;
}
.beneficio-item-toggle {
  font-size: 11px;
  color: rgba(255,255,255,0.60);
  white-space: nowrap;
}
.beneficio-item[open] .beneficio-item-summary {
  border-bottom: 1px solid #d7ecdf;
  background: #f4fbf7;
}
.beneficio-item[open] .beneficio-item-desc { color: #1a202c; }
.beneficio-item[open] .beneficio-item-desc-muted { color: var(--text-muted); }
.beneficio-item[open] .beneficio-item-toggle { color: var(--text-muted); }
.beneficio-item[open] .badge-ncm-tag { background: #d4edda; color: #1a6b3a; }
.beneficio-empty {
  background: #f8fbf9; border: 1px dashed #c6e8d4; border-radius: 10px;
  padding: 16px; text-align: center; color: var(--text-muted); font-size: 13px;
}
.beneficio-result-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px; gap: 8px; flex-wrap: wrap;
}
.badge-tipo {
  font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 5px;
  text-transform: uppercase; letter-spacing: 0.06em; background: #1a6b3a; color: white;
}
.badge-ncm-tag {
  font-size: 11px; color: var(--primary); font-weight: 600;
  background: #e6f4ed; padding: 2px 8px; border-radius: 5px;
}
.beneficio-descricao { font-size: 13px; font-weight: 600; color: #1a202c; margin-bottom: 12px; line-height: 1.4; }
.beneficio-meta-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 10px; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid #c6f6d5;
}
.meta-lbl {
  font-size: 9px; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-muted); margin-bottom: 3px; font-weight: 600;
}
.meta-val { font-size: 12px; color: var(--text); font-weight: 500; }
.obs-lbl {
  font-size: 9px; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-muted); margin-bottom: 5px; font-weight: 600;
}
.obs-box {
  font-size: 12px; color: var(--text); line-height: 1.7;
  background: white; border: 1px solid #c6e8d4; border-radius: 7px; padding: 10px 12px;
}

/* Análises completas bar */
.analises-bar {
  background: linear-gradient(180deg, #4aa46f 0%, #3a8d5c 100%);
  border: 1px solid rgba(255,255,255,0.14); border-radius: 14px;
  padding: 18px 22px; box-shadow: 0 8px 20px rgba(46,139,87,0.18), 0 2px 6px rgba(0,0,0,0.06);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  width: 100%;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.analises-bar-button {
  appearance: none;
  justify-content: flex-start;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.analises-bar-button:focus-visible {
  outline: 3px solid rgba(255,255,255,0.28);
  outline-offset: 3px;
}
.analises-bar:hover { box-shadow: 0 12px 24px rgba(46,139,87,0.22); border-color: rgba(255,255,255,0.3); }
.analises-bar-left { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.analises-bar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; min-width: 210px; justify-content: flex-end; }
.analises-bar-icon { font-size: 1.8rem; }
.analises-bar-title { font-weight: 700; font-size: 15px; color: #ffd166; }
.analises-bar-sub { font-size: 12px; color: rgba(255,255,255,0.84); margin-top: 2px; }

@media (max-width: 780px) {
  .stage-shell {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
  .stage-side-nav {
    width: 100%;
    justify-content: flex-start;
    max-width: 480px;
    padding-top: 0;
  }
  .stage-side-spacer {
    display: none;
  }
}

/* ── Empresa card (workspace, light theme) ───────────────────────── */
.empresa-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 100%;
  max-width: 860px;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.empresa-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
  border-radius: 10px;
}
.empresa-card-header:hover { background: rgba(46,139,87,0.04); }
.empresa-card-summary { display: flex; align-items: center; gap: 16px; }
.empresa-card-name { font-weight: 600; font-size: 0.95rem; color: var(--text); }
.empresa-card-cnpj { font-family: monospace; font-size: 0.82rem; color: var(--text-muted); }
.empresa-card-chevron {
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: transform 0.2s;
}
.empresa-card.is-open .empresa-card-chevron { transform: rotate(180deg); }
.empresa-card-body {
  display: none;
  padding: 0 20px 16px;
}
.empresa-card.is-open .empresa-card-body { display: block; }
.empresa-card.is-open .empresa-card-header {
  border-bottom: 1px solid var(--border);
  border-radius: 10px 10px 0 0;
}
.empresa-detail { padding-top: 12px; }
.empresa-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 24px;
}
@media (max-width: 600px) { .empresa-detail-grid { grid-template-columns: 1fr; } }
.empresa-detail-field { display: flex; flex-direction: column; gap: 2px; }
.empresa-detail-label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.empresa-detail-value { font-size: 0.85rem; color: var(--text); }
.empresa-detail-section { margin-top: 12px; display: flex; flex-direction: column; gap: 4px; }
.empresa-detail-section-title { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.empresa-detail-cnaes { display: flex; flex-wrap: wrap; gap: 6px; }
.empresa-detail-cnae-tag {
  font-size: 0.78rem; color: var(--text);
  background: var(--bg-subtle, #f7fafc);
  border: 1px solid var(--border);
  border-radius: 6px; padding: 3px 8px;
}
/* CNAE list (light theme, mirrors _empresa_form.html) */
.ecard-cnae-list { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; max-height: 240px; overflow-y: auto; }
.ecard-cnae-item {
  display: flex; align-items: baseline; gap: 8px;
  background: #f7fafc; border: 1px solid #edf2f7;
  border-radius: 6px; padding: 6px 10px; font-size: 0.82rem;
}
.ecard-cnae-item-principal { background: #eef7f1; border-color: #c6f0d4; }
.ecard-cnae-code { font-family: monospace; font-weight: 600; color: var(--primary); white-space: nowrap; font-size: 0.8rem; }
.ecard-cnae-desc { color: var(--text); }
/* Briefing section */
.empresa-briefing-box {
  background: #f0faf4; border: 1px solid #c6f0d4;
  border-radius: 8px; padding: 12px 14px;
}
.empresa-briefing-hint {
  font-size: 0.7rem; font-weight: 600; color: #b7791f;
  background: #fefcbf; border-radius: 4px; padding: 2px 8px;
}
.empresa-briefing-empty-text {
  font-size: 0.82rem; color: var(--text-muted); line-height: 1.5; margin-bottom: 10px;
}
.empresa-briefing-add-btn {
  background: var(--primary); color: white; border: none;
  border-radius: 8px; padding: 7px 16px; font-size: 0.82rem;
  font-weight: 600; cursor: pointer; font-family: 'Inter', sans-serif;
}
.empresa-briefing-add-btn:hover { background: var(--primary-hover); }
.empresa-briefing-filled { position: relative; }
.empresa-briefing-text {
  font-size: 0.85rem; color: var(--text); line-height: 1.5;
  background: #f7fafc; border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px;
}
.empresa-briefing-edit-btn {
  background: none; border: none; color: var(--primary);
  font-size: 0.78rem; font-weight: 600; cursor: pointer;
  margin-top: 6px; padding: 0;
}
.empresa-briefing-edit-btn:hover { text-decoration: underline; }
.empresa-briefing-textarea {
  width: 100%; min-height: 80px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 0.85rem; font-family: 'Inter', sans-serif;
  color: var(--text); resize: vertical; line-height: 1.5;
}
.empresa-briefing-textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(46,139,87,0.1);
}
.empresa-briefing-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 6px;
}
.empresa-briefing-counter { font-size: 0.72rem; color: var(--text-muted); }
.empresa-briefing-actions { display: flex; gap: 8px; align-items: center; }
.empresa-briefing-save-btn {
  background: var(--primary); color: white; border: none;
  border-radius: 6px; padding: 5px 14px; font-size: 0.82rem;
  font-weight: 600; cursor: pointer; font-family: 'Inter', sans-serif;
}
.empresa-briefing-save-btn:hover { background: var(--primary-hover); }
/* "com contexto" label on analysis bars */
.analises-bar-ctx {
  font-size: 0.68rem; font-weight: 600; color: #68d391;
  background: rgba(104,211,145,0.12); border-radius: 4px;
  padding: 1px 6px; margin-left: 6px;
}
/* Nudge in confirmation modals */
.modal-nudge {
  font-size: 0.8rem; color: #b7791f; background: #fffff0;
  border: 1px solid #fefcbf; border-radius: 8px;
  padding: 8px 12px; margin-top: 0; margin-bottom: 16px;
}
.modal-nudge-link { color: #975a16; text-decoration: underline; font-weight: 600; cursor: pointer; background: none; border: none; font-size: inherit; padding: 0; }
.modal-nudge-link:hover { color: #744210; }
.modal-nudge-ok {
  background: #f0fdf4; border: 1px solid #bbf7d0;
  color: #166534; display: flex; align-items: center;
}
.modal-nudge-ok .analises-bar-ctx {
  background: #2E8B57; color: #fff; border: none;
  font-size: 0.75rem; font-weight: 600; padding: 2px 8px; border-radius: 4px;
  flex-shrink: 0;
}
.modal-nudge-ok .modal-nudge-link {
  flex: 1; text-align: center;
  color: #15803d; text-decoration: underline; font-size: 0.78rem;
  background: none; padding: 0;
}
.modal-nudge-ok .modal-nudge-link:hover { color: #166534; }

/* ecard sections (light theme collapsible) */
.ecard-section { border-bottom: 1px solid #edf2f7; }
.ecard-section:last-of-type { border-bottom: none; }
.ecard-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  cursor: pointer;
  color: #5a9e78;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.01em;
  user-select: none;
}
.ecard-section-header:hover { color: var(--primary); }
.ecard-toggle {
  color: #a0aec0;
  font-size: 0.7rem;
  transition: transform 0.18s;
  margin-left: auto;
  flex-shrink: 0;
}
.ecard-section.is-open .ecard-toggle { transform: rotate(180deg); }
.ecard-section-body { display: none; padding: 2px 0 10px; }
.ecard-section.is-open .ecard-section-body { display: block; }

/* ── Danger zone section (company deletion) ── */
.ecard-section-danger {
  background: #5c2020;
  border-bottom: none;
  border-radius: var(--radius);
  margin-top: 12px;
  overflow: hidden;
}
.ecard-section-danger .ecard-section-header {
  color: rgba(255, 255, 255, 0.88);
  padding: 10px 14px;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.01em;
  transition: background 0.15s;
}
.ecard-section-danger .ecard-section-header:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}
.ecard-section-danger .ecard-toggle { color: rgba(255, 255, 255, 0.44); }
.ecard-section-danger .ecard-section-body { padding: 2px 14px 14px; }
.ecard-section-danger .ecard-section-body p {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.84rem;
  line-height: 1.5;
  margin-bottom: 14px;
}
.ecard-section-danger .btn-danger {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.84rem;
  padding: 8px 18px;
  border-radius: var(--radius);
  border: 1px solid rgba(229, 62, 62, 0.4);
  background: var(--danger);
  color: #ffffff;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
}
.ecard-section-danger .btn-danger:hover {
  background: #c53030;
  box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.18);
}
.ecard-section-danger .btn-danger:active { background: #9b2c2c; box-shadow: none; }

/* ecard labels and values */
.ecard-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.ecard-value {
  background: #f7fafc;
  border: 1px solid #edf2f7;
  border-radius: 6px;
  padding: 7px 10px;
  color: var(--text);
  font-size: 0.85rem;
  min-height: 34px;
  display: flex;
  align-items: center;
}
.ecard-value-mono { font-family: monospace; letter-spacing: 0.03em; }
.ecard-sublabel { font-size: 0.72rem; color: var(--text-muted); margin-bottom: 4px; }
.ecard-input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--text);
  background: #fff;
  transition: border-color 0.15s;
}
.ecard-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(46,139,87,0.12); }
.ecard-badge {
  background: #e6f7ed;
  color: var(--primary);
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 7px;
}

/* ecard CNAE items (light theme) */
.ecard-cnae-list { display: flex; flex-direction: column; gap: 4px; max-height: 200px; overflow-y: auto; }
.ecard-cnae {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 5px;
  background: #f7fafc;
  font-size: 0.8rem;
}
.ecard-cnae-primary { background: #e6f7ed; }
.ecard-cnae-code { font-family: monospace; font-weight: 600; color: var(--primary); font-size: 0.78rem; white-space: nowrap; }
.ecard-cnae-desc { color: var(--text); font-size: 0.78rem; }

/* ecard action buttons */
.ecard-edit-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.ecard-edit-btn:hover { color: var(--primary); border-color: var(--primary); }
.ecard-btn-cancel {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 16px;
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
}
.ecard-btn-cancel:hover { background: #f7fafc; }
.ecard-btn-save {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 20px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.ecard-btn-save:hover { background: var(--primary-hover); }

/* ── Empresa form: read-only display field ────────────────────────── */
.field-readonly {
  background: rgba(255,255,255,0.06);
  border-radius: 6px;
  padding: 8px 12px;
  color: rgba(255,255,255,0.72);
  font-size: 0.9rem;
  min-height: 38px;
  display: flex;
  align-items: center;
}

/* ── Collapsible form sections (inside modal) ─────────────────────── */
.form-section { border-bottom: 1px solid rgba(255,255,255,0.10); }
.form-section:last-of-type { border-bottom: none; }

.form-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 0;
  cursor: pointer;
  color: #5ebd8a;
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  user-select: none;
  gap: 8px;
}
.form-section-header:hover { color: #7dd3a4; }

.section-toggle {
  color: rgba(255,255,255,0.45);
  font-size: 0.7rem;
  transition: transform 0.18s ease;
  flex-shrink: 0;
}
.form-section.is-open .section-toggle { transform: rotate(180deg); }

.form-section-body { display: none; padding: 4px 0 12px; }
.form-section.is-open .form-section-body { display: block; }

.form-section-badge {
  background: rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.72);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 1px 7px;
  margin-left: auto;
}

/* ── CNAE list inside empresa form ────────────────────────────────── */
.cnae-list { display: flex; flex-direction: column; gap: 5px; margin-top: 6px; max-height: 240px; overflow-y: auto; }
.cnae-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 5px 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 6px;
  font-size: 0.82rem;
}
.cnae-code {
  font-family: 'Courier New', monospace;
  color: rgba(255,255,255,0.55);
  white-space: nowrap;
  font-size: 0.78rem;
}
.cnae-desc { color: rgba(255,255,255,0.82); line-height: 1.4; }

/* ── Home onboarding bar (shown only when no companies) ───────────── */
a.analises-bar-onboarding {
  background: linear-gradient(180deg, #3d7a5a 0%, #2e6647 100%);
  border: 1.5px dashed rgba(255,255,255,0.22);
  text-decoration: none;
  color: inherit;
  margin-bottom: 12px;
}
a.analises-bar-onboarding:hover {
  box-shadow: 0 12px 24px rgba(46,139,87,0.18);
  border-color: rgba(255,255,255,0.35);
}
a.analises-bar-onboarding .analises-bar-title {
  color: rgba(255, 220, 100, 0.85);
}

/* ── Empresa page: modal wider than default ───────────────────────── */
.modal-card-wide { max-width: 560px; }

/* ── Email verification banner ────────────────────────────────────── */
.email-verify-banner {
  background: #fefce8;
  border-bottom: 1px solid #fde68a;
  color: #78350f;
  padding: 10px 1.5rem;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}
.email-verify-banner a {
  color: #92400e;
  font-weight: 600;
  text-decoration: underline;
}
.email-verify-banner a:hover { color: #78350f; }

/* ── Premium tributacao bar ──────────────────────────────────── */
.analises-bar-premium {
  background: linear-gradient(135deg, #1a3a2a 0%, #2e8b57 50%, #1a3a2a 100%);
  border: 1px solid rgba(255,215,0,0.25);
  box-shadow: 0 8px 24px rgba(46,139,87,0.22), 0 0 0 1px rgba(255,215,0,0.08), inset 0 1px 0 rgba(255,255,255,0.06);
  padding: 22px 24px;
  position: relative;
  overflow: hidden;
}
.analises-bar-premium::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at 30% 50%, rgba(255,215,0,0.06) 0%, transparent 60%);
  pointer-events: none;
}
.analises-bar-premium:hover {
  border-color: rgba(255,215,0,0.4);
  box-shadow: 0 12px 32px rgba(46,139,87,0.28), 0 0 0 1px rgba(255,215,0,0.15), inset 0 1px 0 rgba(255,255,255,0.08);
}
.analises-bar-title-premium { color: #ffd166; font-size: 16px; }
.analises-bar-badge-premium {
  background: linear-gradient(135deg, #ffd166, #f0b830);
  color: #1a3a2a;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  flex-shrink: 0;
}
.analises-bar-badge-ver {
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.25);
  transition: background 0.15s;
  flex-shrink: 0;
}
.analises-bar-badge-ver:hover { background: rgba(255,255,255,0.25); }
.analises-bar-disabled { pointer-events: none; opacity: 0.5; filter: grayscale(30%); }
.analises-bar-ia-badge {
  position: absolute;
  bottom: 8px;
  right: 16px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: rgba(255,209,102,0.62);
  pointer-events: none;
  z-index: 1;
}
@media (max-width: 480px) {
  .analises-bar-ia-badge { display: none; }
}

/* ── Card processing states ────────────────────────────────── */
.card-spinner {
  width: 24px; height: 24px;
  border: 3px solid rgba(255,255,255,0.25);
  border-top-color: #ffd166;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }
.card-mini-progress {
  position: absolute; bottom: 0; left: 0; right: 0; height: 3px;
  background: rgba(0,0,0,0.2); border-radius: 0 0 14px 14px; overflow: hidden;
}
.card-mini-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ffd166, #f0b830);
  border-radius: 0 0 14px 14px;
  transition: width 0.5s ease-out;
}
.card-mini-progress-indeterminate {
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, #ffd166, #f0b830);
  border-radius: 0 0 14px 14px;
  animation: indeterminate 1.5s infinite ease-in-out;
}
.card-glow-pulse {
  animation: glow-pulse 2s ease-in-out;
}
@keyframes glow-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255,209,102,0.5); }
  50%  { box-shadow: 0 0 20px 4px rgba(255,209,102,0.3); }
  100% { box-shadow: 0 8px 24px rgba(46,139,87,0.22), 0 0 0 1px rgba(255,215,0,0.08); }
}
.analises-bar-badge-processing {
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.6);
  font-size: 0.68rem; font-weight: 600;
  padding: 3px 10px; border-radius: 999px;
  pointer-events: none;
  flex-shrink: 0;
}
.analises-bar-badge-pending {
  background: rgba(245,158,11,0.18);
  color: #fff3d6;
  border: 1px solid rgba(245,158,11,0.25);
  font-size: 0.68rem; font-weight: 600;
  padding: 3px 10px; border-radius: 999px;
  cursor: default; flex-shrink: 0;
}
.analises-bar-sub-error { color: #fca5a5; }

/* ── Toast ── */
#toast-container {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  z-index: 9999; display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  background: #1a3a2a; color: #fff; padding: 12px 24px;
  border-radius: 10px; font-size: 0.85rem; font-weight: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  animation: toast-slide-in 0.3s ease;
  pointer-events: auto;
  text-align: center;
}
.toast-fade-out { opacity: 0; transition: opacity 0.6s ease; }
@keyframes toast-slide-in { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ── Tributacao resultado page ────────────────────────────────── */
.trib-resultado-page { max-width: 860px; margin: 0 auto; padding: 2rem 1.5rem; }
.trib-page-title { font-size: 1.4rem; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.trib-page-sub { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 20px; }

.trib-diag-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.trib-empresa-label {
  font-size: 0.82rem; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 8px;
}
.trib-diag-resumo { font-size: 0.92rem; line-height: 1.6; color: var(--text); font-family: 'Inter', sans-serif; }

.trib-alert-banner {
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.84rem;
  margin-top: 12px;
}
.trib-alert-amber {
  background: rgba(245,158,11,0.10);
  border: 1px solid rgba(245,158,11,0.25);
  color: #92400e;
}
.trib-alertas-section {
  margin-top: 16px;
  padding: 14px 16px;
  background: #fffbeb;
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: 8px;
}
.trib-alertas-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #b45309;
  margin-bottom: 8px;
}
.trib-alert-item {
  font-size: 0.82rem;
  color: #78350f;
  padding: 5px 0 5px 18px;
  position: relative;
  line-height: 1.45;
}
.trib-alert-item::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: #d97706;
}
.trib-cnae-alertas {
  margin-top: 10px;
  padding: 10px 12px;
  background: #fefce8;
  border-radius: 6px;
  border-left: 3px solid #eab308;
}
.trib-cnae-alerta-item {
  font-size: 0.78rem;
  color: #713f12;
  padding: 3px 0;
  line-height: 1.4;
}

.trib-regime-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
@media (max-width: 640px) { .trib-regime-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .trib-regime-cards { grid-template-columns: 1fr; } }
.benef-regime-cards { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 640px) { .benef-regime-cards { grid-template-columns: repeat(2, 1fr); } }
.trib-regime-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 10px;
  padding: 14px 16px;
}
.trib-pill-ok {
  background: linear-gradient(135deg, #f0fff4 0%, #e6ffed 100%);
  border: 1px solid #9ae6b4;
}
.trib-pill-vedado {
  background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%);
  border: 1px solid #feb2b2;
}
.trib-pill-conf {
  background: #f7fafc;
  border: 1px solid #edf2f7;
}
.trib-pill-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}
.trib-pill-ok .trib-pill-icon { color: #38a169; }
.trib-pill-vedado .trib-pill-icon { color: #e53e3e; }
.trib-pill-parcial {
  background: linear-gradient(135deg, #fffbeb, #fef9e7);
  border: 1px solid rgba(245,158,11,0.35);
}
.trib-pill-parcial .trib-pill-icon { color: #d97706; }
.trib-pill-parcial .trib-pill-status { color: #92400e; }
.trib-pill-status {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.trib-pill-ok .trib-pill-status { color: #276749; }
.trib-pill-vedado .trib-pill-status { color: #9b2c2c; }
.trib-pill-status.trib-conf-alta { color: #27ae60; }
.trib-pill-status.trib-conf-media { color: #f39c12; }
.trib-pill-status.trib-conf-baixa { color: #e74c3c; }
.trib-regime-label { font-size: 0.72rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.trib-status-permitido {
  background: rgba(56,161,105,0.12); color: #276749;
  border: 1px solid rgba(56,161,105,0.25); border-radius: 6px;
  padding: 2px 8px; font-size: 0.78rem; font-weight: 600;
}
.trib-status-vedado {
  background: rgba(229,62,62,0.08); color: #9b2c2c;
  border: 1px solid rgba(229,62,62,0.2); border-radius: 6px;
  padding: 2px 8px; font-size: 0.78rem; font-weight: 600;
}

/* CNAE accordion */
.trib-cnaes-header {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.trib-cnae-section {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 8px;
  overflow: hidden;
}
.trib-cnae-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
  gap: 12px;
}
.trib-cnae-header:hover { background: rgba(46,139,87,0.03); }
.trib-cnae-code { font-family: monospace; font-weight: 700; color: var(--primary); font-size: 0.85rem; margin-right: 8px; }
.trib-cnae-desc { font-size: 0.84rem; color: var(--text); }
.trib-cnae-toggle { color: var(--text-muted); font-size: 0.75rem; transition: transform 0.2s; }
.trib-cnae-section.is-open .trib-cnae-toggle { transform: rotate(180deg); }
.trib-cnae-body { display: none; padding: 0 16px 16px; }
.trib-cnae-section.is-open .trib-cnae-body { display: block; }

.trib-conf { font-size: 0.72rem; color: var(--text-muted); }
.trib-conf-high { color: #276749; }
.trib-conf-med { color: #92400e; }
.trib-badge-revisar {
  background: rgba(245,158,11,0.12);
  color: #92400e;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.68rem;
  font-weight: 700;
}

/* Tax pills inside CNAE card */
.trib-modalidade { margin-top: 12px; }
.trib-modalidade-header {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.trib-pills { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.trib-pill {
  background: #f7fafc;
  border: 1px solid #edf2f7;
  border-radius: 8px;
  padding: 8px 10px;
  text-align: center;
}
.trib-pill-label { font-size: 0.68rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.trib-pill-value { font-size: 1.1rem; font-weight: 700; color: #ffa726; margin: 2px 0; }
.trib-pill-detail { font-size: 0.68rem; color: var(--text-muted); }
.trib-pill-legal { font-size: 0.65rem; color: #a0aec0; margin-top: 4px; line-height: 1.3; }

.trib-obs { font-size: 0.82rem; color: var(--text-muted); margin-top: 10px; font-style: italic; }

/* Justificativa de confiança baixa */
.benef-confianca-justificativa {
  display: flex; gap: 12px; align-items: flex-start;
  margin-top: 20px;
  padding: 14px 18px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 4px solid #f59e0b;
  border-radius: 8px;
}
.benef-confianca-justificativa-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 1px; }
.benef-confianca-justificativa-title {
  font-weight: 600; font-size: 0.84rem; color: #92400e; margin-bottom: 4px;
}
.benef-confianca-justificativa-text {
  margin: 0; font-size: 0.82rem; line-height: 1.55; color: #78350f;
}

.trib-disclaimer {
  margin-top: 32px;
  padding: 14px 18px;
  background: #f7fafc;
  border: 1px solid #edf2f7;
  border-radius: 8px;
  font-size: 0.75rem;
  color: #a0aec0;
  line-height: 1.5;
}

@media (max-width: 640px) {
  .trib-pills { grid-template-columns: repeat(2, 1fr); }
}

/* ── Benefícios Fiscais ────────────────────────────────────────── */
.analises-bar-beneficios {
  background: linear-gradient(135deg, #1a3a2a 0%, #2e8b57 50%, #1a3a2a 100%);
  border: 1px solid rgba(255,215,0,0.25);
  box-shadow: 0 8px 24px rgba(46,139,87,0.22), 0 0 0 1px rgba(255,215,0,0.08), inset 0 1px 0 rgba(255,255,255,0.06);
  padding: 22px 24px;
  position: relative;
  overflow: hidden;
  color: #fff;
}
.analises-bar-beneficios::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(ellipse at 30% 20%, rgba(255,215,0,0.06) 0%, transparent 60%);
  pointer-events: none;
}
.analises-bar-beneficios:hover {
  border-color: rgba(255,215,0,0.4);
  box-shadow: 0 12px 32px rgba(46,139,87,0.28), 0 0 0 1px rgba(255,215,0,0.15), inset 0 1px 0 rgba(255,255,255,0.08);
}
.analises-bar-beneficios .analises-bar-title { color: #ffd166; font-size: 16px; }
.analises-bar-beneficios .analises-bar-sub { color: rgba(255,255,255,0.8); }
.benef-esfera {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.benef-esfera-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px;
  background: #f7fafc;
  cursor: pointer;
  font-size: 0.9rem;
}
.benef-esfera-header:hover { background: #edf2f7; }
.benef-esfera-title { font-weight: 600; color: var(--text); }
.benef-esfera-header-right {
  display: flex; align-items: center; gap: 10px;
}
.benef-esfera-count { font-size: 0.78rem; color: var(--text-muted); }
.benef-esfera-toggle::after { content: "▾"; color: var(--text-muted); font-size: 0.8rem; }
.benef-esfera:not([open]) .benef-esfera-toggle::after { content: "▸"; }
.benef-esfera-body { padding: 12px 16px; }

/* CNAE group within esfera */
.benef-cnae-group { margin-bottom: 8px; border: 1px solid #edf2f7; border-radius: 8px; overflow: hidden; }
.benef-cnae-group:last-child { margin-bottom: 0; }
.benef-cnae-group-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px;
  background: #fafcfe;
  cursor: pointer;
  font-size: 0.84rem;
}
.benef-cnae-group-header:hover { background: #f0f4f8; }
.benef-cnae-group-title { font-weight: 600; color: var(--text); }
.benef-cnae-group-right { display: flex; align-items: center; gap: 8px; }
.benef-cnae-group-count { font-size: 0.75rem; color: var(--text-muted); }
.benef-cnae-group-toggle::after { content: "▾"; color: var(--text-muted); font-size: 0.75rem; }
.benef-cnae-group:not([open]) .benef-cnae-group-toggle::after { content: "▸"; }
.benef-cnae-group-body { padding: 8px 14px 12px; }
.benef-card {
  padding: 12px;
  border: 1px solid #edf2f7;
  border-radius: 8px;
  margin-bottom: 8px;
}
.benef-card-header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.benef-badge {
  font-size: 0.7rem; font-weight: 600; padding: 2px 8px;
  border-radius: 4px; text-transform: uppercase;
}
.benef-badge-reducao { background: #ebf5fb; color: #2980b9; }
.benef-badge-isencao { background: #eafaf1; color: #27ae60; }
.benef-badge-credito_presumido { background: #fef9e7; color: #f39c12; }
.benef-badge-suspensao { background: #fdebd0; color: #e67e22; }
.benef-badge-diferimento { background: #f4ecf7; color: #8e44ad; }
.benef-badge-regime_especial { background: #ebf5fb; color: #2c3e50; }
.benef-badge-incentivo_local { background: #eafaf1; color: #1e8449; }
.benef-badge-outro { background: #f2f3f4; color: #5d6d7e; }
.benef-tributo { font-size: 0.78rem; font-weight: 600; color: var(--text); }
.benef-cnae-tag { font-size: 0.7rem; color: var(--text-muted); background: #f7fafc; border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; }
.benef-conf { font-size: 0.7rem; font-weight: 600; padding: 2px 6px; border-radius: 4px; }
.benef-conf-alta { background: #eafaf1; color: #27ae60; }
.benef-conf-media { background: #fef9e7; color: #f39c12; }
.benef-conf-baixa { background: #fdedec; color: #e74c3c; }
.benef-card-desc { font-size: 0.85rem; color: var(--text); line-height: 1.5; }
.benef-card-legal { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; font-style: italic; }
.benef-card-legal-link {
  color: #2563eb;
  text-decoration: none;
  font-style: italic;
  transition: color 0.15s;
}
.benef-card-legal-link:hover { color: #1d4ed8; text-decoration: underline; }
.benef-card-vigencia { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.benef-empty { font-size: 0.85rem; color: var(--text-muted); padding: 8px 0; }
.benef-cnae-detail { padding: 8px 0; border-bottom: 1px solid #edf2f7; font-size: 0.85rem; }
.benef-cnae-detail:last-child { border-bottom: none; }
.benef-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.benef-meta-sep {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--text-muted);
  opacity: 0.4;
  flex-shrink: 0;
}
.benef-meta-item { white-space: nowrap; }
.benef-obs { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }

/* ── Parecer Executivo ── */
.benef-parecer {
  background: linear-gradient(135deg, #fefefe 0%, #f8fafb 100%);
  border: 1px solid var(--border);
  border-left: 4px solid #2e8b57;
  border-radius: 10px;
  margin: 20px 0;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(46,139,87,0.06);
}
.benef-parecer-header {
  display: block;
  padding: 16px 20px;
  cursor: pointer;
  user-select: none;
}
.benef-parecer-header:hover { background: rgba(46,139,87,0.04); }
.benef-parecer-summary-row {
  display: flex; align-items: center; justify-content: space-between;
}
.benef-parecer-title { font-weight: 700; font-size: 1rem; color: var(--text); }
.benef-parecer-toggle::after { content: "▾"; color: var(--text-muted); font-size: 0.85rem; }
.benef-parecer:not([open]) .benef-parecer-toggle::after { content: "▸"; }
.benef-parecer-resumo {
  margin: 10px 0 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-muted);
}
.benef-parecer-body {
  padding: 0 20px 24px;
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--text);
}
.benef-parecer-body p { margin: 8px 0; }

/* Seções */
.parecer-section { margin-bottom: 24px; }
.parecer-section:last-of-type { margin-bottom: 12px; }
.parecer-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1a3a2a;
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid #e8f5e9;
  display: flex;
  align-items: center;
  gap: 8px;
}
.parecer-section-icon { font-size: 1.1rem; }
.parecer-section-content { padding-left: 4px; }

/* Destaques */
.parecer-destaque {
  background: #f0faf4;
  border: 1px solid #c8e6c9;
  border-radius: 8px;
  padding: 14px 16px;
  margin: 10px 0;
}
.parecer-destaque-titulo {
  font-weight: 700;
  font-size: 0.9rem;
  color: #1a3a2a;
  margin-bottom: 4px;
}
.parecer-destaque-impacto {
  font-size: 0.85rem;
  color: #2e7d32;
  font-weight: 600;
  margin-bottom: 4px;
}
.parecer-destaque-legal {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Orientação prática — passos */
.parecer-passo {
  background: #f7f9fc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px 16px;
  margin: 10px 0;
}
.parecer-passo-titulo {
  font-weight: 700;
  font-size: 0.9rem;
  color: #2c5282;
  margin-bottom: 8px;
}
.parecer-passo-lista {
  margin: 0 0 8px 20px;
  padding: 0;
  font-size: 0.85rem;
  color: var(--text);
}
.parecer-passo-lista li { margin-bottom: 4px; }
.parecer-passo-docs {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding-top: 6px;
  border-top: 1px solid #edf2f7;
}
.parecer-passo-prazo {
  font-size: 0.8rem;
  color: #6b46c1;
  font-weight: 600;
  margin-top: 4px;
}

/* Alertas */
.parecer-alerta {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-left: 3px solid #f59e0b;
  border-radius: 8px;
  padding: 12px 16px;
  margin: 10px 0;
}
.parecer-alerta-titulo {
  font-weight: 700;
  font-size: 0.88rem;
  color: #92400e;
  margin-bottom: 4px;
}
.parecer-alerta p { font-size: 0.84rem; color: #78350f; margin: 4px 0 0; }

/* Utilitários do parecer */
.parecer-lista {
  margin: 6px 0 6px 20px;
  padding: 0;
  font-size: 0.85rem;
}
.parecer-lista li { margin-bottom: 3px; }
.parecer-lei {
  background: #eef2ff;
  color: #3730a3;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.82rem;
  font-family: inherit;
}

/* Disclaimer */
.benef-parecer-disclaimer {
  margin-top: 20px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #fef9e7, #fef3cd);
  border: 1px solid #f0d78c;
  border-radius: 8px;
  font-size: 0.78rem;
  color: #856404;
  text-align: center;
  font-weight: 500;
}

/* ── Chat com Dados ─────────────────────────────────────────────── */

.chat-page {
  max-width: 1060px;
  margin: 0 auto;
  padding: 24px 24px;
}

.chat-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.chat-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 2px;
}

.chat-subtitle {
  font-size: 13px;
  color: #718096;
  margin: 0;
}

/* LGPD inline notice */
.chat-notice-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted, #718096);
  margin-bottom: 12px;
  line-height: 1.4;
  flex-wrap: wrap;
}
.chat-notice-icon { flex-shrink: 0; opacity: 0.7; }
.chat-notice-toggle {
  background: none; border: none;
  color: var(--primary, #2e8b57); font-size: 12px;
  cursor: pointer; padding: 0;
  text-decoration: underline; text-underline-offset: 2px;
}
.chat-notice-toggle:hover { opacity: 0.8; }
.chat-notice-detail {
  display: none; width: 100%;
  font-size: 11px; color: var(--text-muted, #718096);
  padding-left: 20px; margin-top: 2px; line-height: 1.5;
}
.chat-notice-inline.expanded .chat-notice-detail { display: block; }

.chat-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-messages {
  min-height: 300px;
  max-height: calc(100vh - 260px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 0;
}

.chat-empty {
  text-align: center;
  padding: 56px 24px 40px;
  color: var(--text-muted, #718096);
}
.chat-empty-icon { margin-bottom: 16px; opacity: 0.6; }
.chat-empty-title {
  font-size: 16px; font-weight: 600;
  color: var(--text); margin: 0 0 4px;
}
.chat-empty-sub {
  font-size: 13px; color: var(--text-muted, #718096);
  margin: 0 0 24px; line-height: 1.5;
}
.chat-suggestions {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 8px; max-width: 560px; margin: 0 auto;
}
.chat-suggestion {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 999px; padding: 8px 16px;
  font-size: 13px; color: var(--text);
  cursor: pointer; transition: border-color 0.15s, background 0.15s;
  line-height: 1.4;
}
.chat-suggestion:hover {
  border-color: var(--primary, #2e8b57);
  background: rgba(46,139,87,0.04);
  color: var(--primary, #2e8b57);
}

.chat-msg { display: flex; flex-direction: column; }
.chat-msg-user { align-items: flex-end; }
.chat-msg-assistant { align-items: flex-start; }

.chat-bubble {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
}

.chat-bubble-user {
  background: var(--primary, #2e8b57);
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 1px 3px rgba(46,139,87,0.2);
}

.chat-bubble-assistant {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e2e8f0);
  color: var(--text);
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  max-width: 92%;
}

.chat-text {
  line-height: 1.6;
}
.chat-text p { margin: 6px 0; }
.chat-text p:first-child { margin-top: 0; }
.chat-text p:last-child { margin-bottom: 0; }
.chat-text strong { font-weight: 600; }
.chat-text ul, .chat-text ol { margin: 6px 0; padding-left: 20px; }
.chat-text li { margin: 2px 0; }
.chat-text table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 0.82rem;
  overflow-x: auto;
  display: block;
}
.chat-text th, .chat-text td {
  padding: 6px 10px;
  border: 1px solid #e2e8f0;
  text-align: left;
  white-space: nowrap;
}
.chat-text th {
  background: #f7fafc;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}
.chat-text tr:nth-child(even) { background: #fafcfe; }
.chat-text code {
  background: #f1f5f9;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.85em;
}

.chat-chart-container {
  margin-top: 8px;
  padding: 4px 4px 8px;
}
.chat-chart-wrap {
  position: relative;
  height: 300px;
  margin-top: 8px;
  padding: 16px;
  width: 100%;
  background: #fafcfe;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  transition: height 0.3s ease;
  box-sizing: border-box;
}
.chat-chart-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.chat-chart-title {
  font-size: 0.8rem; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.03em;
}
.chat-chart-expand {
  background: none; border: 1px solid #e2e8f0; border-radius: 6px;
  padding: 2px 8px; cursor: pointer; font-size: 0.85rem; color: var(--text-muted);
  transition: background 0.15s;
}
.chat-chart-expand:hover { background: #edf2f7; }
@media (max-width: 768px) {
  .chat-page { max-width: 100%; padding: 16px 12px; }
  .chat-bubble { max-width: 92%; }
  .chat-bubble-assistant { max-width: 98%; }
  .chat-suggestions { flex-direction: column; align-items: center; }
}

/* Chat modal (charts & tables) */
.chat-modal-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  justify-content: center; align-items: center;
  padding: 24px;
}
.chat-modal-overlay.active { display: flex; }
.chat-modal {
  background: #fff; border-radius: 14px;
  width: 90vw; max-width: 900px; height: 75vh;
  display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  overflow: hidden;
}
.chat-modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
}
.chat-modal-title {
  font-weight: 700; font-size: 1rem; color: var(--text);
}
.chat-modal-close {
  background: none; border: none; font-size: 1.5rem;
  cursor: pointer; color: var(--text-muted); padding: 0 4px;
  line-height: 1;
}
.chat-modal-close:hover { color: var(--text); }
.chat-modal-body {
  flex: 1; padding: 20px; overflow: auto;
  position: relative;
}
.chat-modal-body canvas { width: 100% !important; height: 100% !important; }
.chat-modal-table {
  width: 100%; border-collapse: collapse; font-size: 0.9rem;
}
.chat-modal-table th, .chat-modal-table td {
  padding: 10px 14px; border: 1px solid #e2e8f0; text-align: left; white-space: nowrap;
}
.chat-modal-table th {
  background: #f7fafc; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; font-size: 0.8rem; letter-spacing: 0.02em;
}
.chat-modal-table tr:nth-child(even) { background: #fafcfe; }

/* Table expand button */
.chat-table-expand {
  display: block;
  margin-left: auto; margin-bottom: 4px;
  background: none; border: 1px solid #e2e8f0; border-radius: 6px;
  padding: 2px 8px; cursor: pointer; font-size: 0.8rem; color: var(--text-muted);
}
.chat-table-expand:hover { background: #edf2f7; }

@media (max-width: 640px) {
  .chat-modal { width: 98vw; height: 85vh; }
  .chat-modal-body { padding: 12px; }
}

.chat-input-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-input-row {
  display: flex;
  gap: 8px;
}

.chat-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  font-size: 14px;
  background: var(--card-bg, #fff);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.chat-input:focus {
  outline: none;
  border-color: var(--primary, #2e8b57);
  box-shadow: 0 0 0 2px rgba(46,139,87,0.15);
}

.chat-send-btn {
  padding: 12px 24px;
  background: var(--primary, #2e8b57);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.chat-send-btn:hover {
  background: var(--primary-hover, #256b45);
}

.chat-send-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.chat-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #718096;
  padding: 4px 0;
}

/* ── PGDAS-D report ──────────────────────────────────────────────── */
.hero-page.pgdas-report {
  --content-width: 100%;
  max-width: none;
  padding-left: 3px;
  padding-right: 3px;
}
.hero-page.pgdas-report > * { max-width: none; width: 100%; }
.pgdas-tab-content {
  background: white;
  border: 1px solid #c0c8d0;
  border-radius: 0 8px 8px 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.pgdas-table-wrap { overflow-x: auto; padding: 16px; }
.pgdas-actions { display: flex; gap: 8px; justify-content: center; margin-bottom: 16px; }
.pgdas-actions button, .pgdas-actions a {
  padding: 8px 18px; font-size: 12px; font-weight: 600; border-radius: 6px;
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
}
.pgdas-btn-export { background: var(--primary); color: white; border: none; }
.pgdas-btn-export:hover { background: var(--primary-hover); }
.pgdas-btn-print { background: white; color: #333; border: 1px solid #ccc; }
.pgdas-btn-print:hover { background: #f5f5f5; }
.pgdas-tab {
  padding: 10px 28px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: #e0e0e0;
  color: #556;
  border: none;
  border-radius: 8px 8px 0 0;
  transition: all 0.2s;
  user-select: none;
}
.pgdas-tab:hover { background: #c8d0da; }
.pgdas-tab.active {
  background: white;
  color: var(--primary);
  box-shadow: 0 -2px 6px rgba(0,0,0,0.06);
}
.pgdas-sheet { display: none; }
.pgdas-sheet.active { display: block; }

.pgdas-table { border-collapse: collapse; width: max-content; border: 1px solid #c0c8d0; }
.pgdas-table thead { position: sticky; top: 0; z-index: 5; }
.pgdas-table th {
  background: var(--primary);
  color: #fff;
  padding: 11px 10px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border: 1px solid var(--primary-hover);
}
.pgdas-table td {
  padding: 8px 10px;
  border: 1px solid #dde2e8;
  text-align: right;
  white-space: nowrap;
}
.pgdas-table td.desc {
  text-align: left;
  white-space: normal;
  min-width: 260px;
  max-width: 400px;
  font-size: 12px;
  line-height: 1.4;
}
.pgdas-table td.center { text-align: center; font-size: 12px; }
.pgdas-table td, .pgdas-table td.center {
  font-size: 12px;
  font-family: 'Consolas', 'SF Mono', 'Courier New', monospace;
  font-variant-numeric: tabular-nums;
}
.pgdas-table td.num {
  font-variant-numeric: tabular-nums;
  font-family: 'Consolas', 'SF Mono', 'Courier New', monospace;
  font-size: 12px;
}
.pgdas-table td.num.zero { color: #c0c0c0; }
.pgdas-table tbody tr { transition: background 0.1s; }
.pgdas-table tbody tr:hover { background: #e8f5e9; }
.pgdas-subtotal { background: #e8f5e9 !important; font-weight: 700; }
.pgdas-subtotal td {
  border-top: 2px solid var(--primary);
  border-bottom: 2px solid var(--primary);
  padding-top: 10px;
  padding-bottom: 10px;
}

@media print {
  .pgdas-tab, .pgdas-actions, .btn-back, .navbar { display: none !important; }
  .pgdas-sheet { display: block !important; page-break-after: always; }
  .pgdas-table { min-width: unset; font-size: 9px; }
  .pgdas-table th { background: #333 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .hero-page.pgdas-report { padding: 0; }
}

/* ── Scope radios ──────────────────────────────────────────────── */
.scope-radios {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  font-size: 14px;
}
.scope-radio {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: rgba(255,255,255,0.85);
}
.scope-radio input[type="radio"] {
  accent-color: var(--accent);
}
.scope-count {
  color: rgba(255,255,255,0.5);
  font-size: 12px;
}
.scope-period-selects select {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 12px;
}

/* ── Confronto SPED x SEFAZ ─────────────────────────────────────────────── */
.confronto-summary {
  display: flex;
  gap: 12px;
  margin: 16px 0;
  flex-wrap: wrap;
}
.confronto-card {
  flex: 1;
  min-width: 100px;
  padding: 16px;
  border-radius: 10px;
  text-align: center;
  text-decoration: none;
  color: inherit;
  border: 2px solid transparent;
  transition: border-color 0.15s;
}
.confronto-card:hover { opacity: 0.85; }
.confronto-card-active { border-color: var(--primary) !important; }
.confronto-card-number { font-size: 28px; font-weight: 700; }
.confronto-card-label { font-size: 13px; margin-top: 4px; opacity: 0.8; }
.confronto-card-all { background: rgba(100,116,139,0.12); }
.confronto-card-ok { background: rgba(16,185,129,0.12); color: #065f46; }
.confronto-card-divergente { background: rgba(245,158,11,0.12); color: #92400e; }
.confronto-card-so-sped { background: rgba(59,130,246,0.12); color: #1e40af; }
.confronto-card-so-sefaz { background: rgba(236,72,153,0.12); color: #9d174d; }

.confronto-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.confronto-badge-ok { background: rgba(16,185,129,0.15); color: #065f46; }
.confronto-badge-divergente { background: rgba(245,158,11,0.15); color: #92400e; }
.confronto-badge-so-sped { background: rgba(59,130,246,0.15); color: #1e40af; }

/* ── SPED Editor ─────────────────────────────────────────────────────────── */

/* Header card */
.editor-header-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px 18px;
  margin-bottom: 20px;
}
.editor-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.editor-header-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px;
}
.editor-header-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.editor-badge-file {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Consolas', 'SF Mono', monospace;
  background: rgba(46,139,87,0.1);
  color: var(--primary);
  border: 1px solid rgba(46,139,87,0.2);
}
.editor-header-periodo {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}
.editor-btn-export {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  transition: background 0.15s;
}
.editor-btn-export:hover { background: var(--primary-hover); }

/* Tabs */
.editor-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 0;
}
.editor-tab {
  padding: 10px 22px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  border-radius: 6px 6px 0 0;
}
.editor-tab:hover {
  color: var(--text);
  background: rgba(46,139,87,0.04);
}
.editor-tab-active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: rgba(46,139,87,0.06);
}

/* Sub-pills */
.editor-pills {
  display: flex;
  gap: 6px;
  padding: 14px 0 10px;
  flex-wrap: wrap;
}
.editor-pill {
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.15s;
}
.editor-pill:hover { border-color: var(--primary); color: var(--text); }
.editor-pill-active { background: var(--primary); color: #fff; border-color: var(--primary); }
.editor-pill-active:hover { color: #fff; filter: brightness(0.85); }
.editor-pill-count { opacity: 0.6; font-size: 11px; margin-left: 2px; }

/* Table */
.editor-table td, .editor-table th {
  font-size: 11px;
  padding: 6px 8px;
  line-height: 1.4;
}
.editor-table td {
  font-family: 'Consolas', 'SF Mono', monospace;
  font-variant-numeric: tabular-nums;
}

/* Action buttons */
.editor-btn-edit {
  padding: 4px 10px; border-radius: 5px; border: none; cursor: pointer;
  font-size: 11px; font-weight: 600;
  background: var(--primary); color: #fff;
  transition: opacity 0.15s;
}
.editor-btn-edit:hover { opacity: 0.85; }
.editor-btn-delete {
  padding: 4px 10px; border-radius: 5px; border: none; cursor: pointer;
  font-size: 11px; font-weight: 600;
  background: rgba(220,38,38,0.08); color: #dc2626;
  border: 1px solid rgba(220,38,38,0.15);
  transition: all 0.15s;
}
.editor-btn-delete:hover { background: rgba(220,38,38,0.15); border-color: rgba(220,38,38,0.3); }

/* Highlight & state badges */
.editor-row-highlight { background: rgba(245,158,11,0.08) !important; }
.editor-dirty-state { font-size: 13px; color: var(--warning, #f59e0b); }

.editor-badge-editado {
  display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px;
  background: rgba(245,158,11,0.1); color: #b45309;
}
.editor-badge-novo {
  display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px;
  background: rgba(16,185,129,0.1); color: #047857;
}

/* Empty state */
.editor-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
  font-size: 13px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  margin-top: 8px;
}
.editor-actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border, rgba(255,255,255,0.08));
}
.editor-btn-add {
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid var(--primary, #6366f1);
  background: transparent;
  color: var(--primary, #6366f1);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.editor-btn-add:hover { background: rgba(99,102,241,0.1); }

/* Add button alignment */
.editor-reg-table .btn-module {
  font-size: 12px;
  padding: 6px 14px;
}
.confronto-badge-so-sefaz { background: rgba(236,72,153,0.15); color: #9d174d; }

.confronto-table td, .confronto-table th {
  font-size: 10px;
  padding: 3px 6px;
  line-height: 1.3;
}
.confronto-table .mono { font-family: Consolas, monospace; font-size: 10px; }
.confronto-edit-link {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: var(--primary, #6366f1);
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}
.confronto-edit-link:hover { opacity: 0.85; }

/* ── Benefícios v2: Regime Tabs ────────────────────────────────────────── */
.benef-regime-tabs { display: flex; gap: 4px; margin: 16px 0; border-bottom: 2px solid var(--border); }
.benef-tab { padding: 8px 18px; font-size: 0.82rem; font-weight: 600; font-family: 'Montserrat', sans-serif;
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.15s; }
.benef-tab:hover { color: var(--primary); }
.benef-tab.is-active { color: var(--primary); border-bottom-color: var(--primary); }
.benef-tab-count { font-size: 0.72rem; background: var(--primary-50, #ecfdf3); color: var(--primary);
  padding: 1px 6px; border-radius: 8px; margin-left: 4px; }
.benef-tab.is-active .benef-tab-count { background: var(--primary); color: white; }
.benef-tab-content { display: none; }
.benef-tab-content.is-active { display: block; }

/* ── Benefícios v2: Suggested CNAEs ────────────────────────────────────── */
.benef-sugerido-section { margin-top: 20px; }
.benef-sugerido-header { font-family: 'Montserrat', sans-serif; font-size: 0.85rem; font-weight: 700;
  color: var(--accent-deep, #C48800); margin-bottom: 12px; }
.benef-sugerido-card { background: var(--card-bg); border: 1px solid var(--border);
  border-left: 3px solid var(--accent, #FFD700); border-radius: var(--radius, 8px);
  padding: 12px 16px; margin-bottom: 10px; }
.benef-sugerido-badge { font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
  background: #FFF3C4; color: #92400e; padding: 2px 8px; border-radius: 4px; }
.benef-sugerido-just { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }

/* ── Benefícios v2: Chat inline ────────────────────────────────────────── */
.benef-chat-container { max-height: 450px; overflow-y: auto; padding: 12px; border-top: 1px solid rgba(255,255,255,0.15); margin-top: 16px; }
.benef-chat-messages { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; max-height: 300px; overflow-y: auto; }
.benef-chat-msg { max-width: 85%; padding: 8px 12px; border-radius: 10px; font-size: 0.85rem; line-height: 1.5; }
.benef-chat-msg-user { align-self: flex-end; background: var(--primary); color: white; border-bottom-right-radius: 2px; }
.benef-chat-msg-assistant { align-self: flex-start; background: var(--gray-100, #f1f5f9); color: var(--text);
  border-bottom-left-radius: 2px; }
.benef-chat-input-row { display: flex; gap: 6px; }
.benef-chat-input { flex: 1; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 0.85rem; }
.benef-chat-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(46,139,87,0.12); }
.benef-chat-send { padding: 8px 16px; background: var(--primary); color: white; border: none; border-radius: 6px;
  font-weight: 600; cursor: pointer; font-size: 0.82rem; }
.benef-chat-actions { margin-top: 10px; text-align: center; }
.benef-chat-finish { font-size: 0.82rem; color: #fff; font-weight: 600; background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3); padding: 6px 16px; border-radius: 8px; cursor: pointer; }
.benef-chat-finish:hover { background: rgba(255,255,255,0.25); }
.benef-chat-result { padding: 16px; }
.benef-chat-result-title { font-weight: 700; font-size: 0.95rem; margin-bottom: 10px; color: #ffd166; }
.benef-chat-result-text { font-size: 0.85rem; line-height: 1.6; color: var(--text); background: rgba(255,255,255,0.92);
  padding: 12px; border-radius: 8px; margin-bottom: 14px; }
.benef-chat-result-actions { text-align: center; }

/* ── Parecer Version Tabs ────────────────────────────────────────── */
.parecer-version-tabs {
  display: flex; gap: 2px; margin: 16px 0 0;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  border-bottom: 2px solid var(--border);
  scrollbar-width: thin;
}
.parecer-vtab {
  padding: 6px 14px; font-size: 0.78rem; font-weight: 600;
  font-family: 'Montserrat', sans-serif;
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  white-space: nowrap; transition: all 0.15s;
}
.parecer-vtab:hover { color: var(--primary); }
.parecer-vtab.is-active { color: var(--primary); border-bottom-color: var(--primary); }
.parecer-vcontent { display: none; }
.parecer-vcontent.is-active { display: block; }

/* ── Parecer Changelog ────────────────────────────────────────── */
.parecer-changelog {
  background: rgba(46, 139, 87, 0.06);
  border-left: 3px solid var(--primary);
  border-radius: 0 6px 6px 0;
  padding: 16px 20px;
  margin: 16px 0 20px;
}
.parecer-changelog-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700; font-size: 0.85rem;
  color: var(--text); margin-bottom: 10px;
}
.parecer-changelog-bullets { list-style: none; padding: 0; margin: 0 0 12px; }
.parecer-changelog-bullets li {
  font-size: 0.82rem; color: var(--text);
  padding: 4px 0 4px 20px; position: relative;
}
.parecer-changelog-bullets li::before {
  content: ''; position: absolute;
  left: 0; top: 10px;
  width: 8px; height: 8px; border-radius: 50%;
}
.changelog-added::before { background: #27ae60; }
.changelog-removed::before { background: #e74c3c; }
.changelog-adjusted::before { background: #f39c12; }
.parecer-changelog-resumo {
  font-size: 0.82rem; color: var(--text-muted);
  line-height: 1.6; margin: 0;
}
.parecer-changelog-meta {
  font-size: 0.72rem; color: var(--text-muted);
  opacity: 0.7; margin-top: 8px; display: block;
}

/* ── Chat Context Badges ────────────────────────────────────────── */
.chat-context-badges {
  font-size: 0.75rem; color: var(--text-muted);
  margin-top: 2px;
}

/* ── Chat Refine Card + Footer ────────────────────────────────── */
.chat-refine-card {
  background: rgba(46, 139, 87, 0.06);
  border: 1px solid rgba(46, 139, 87, 0.2);
  border-radius: 10px;
  padding: 14px 18px;
  margin: 8px 0;
  text-align: center;
}
.chat-refine-card p {
  font-size: 0.85rem; color: var(--text);
  margin: 0 0 10px;
}
.chat-refine-btn {
  padding: 8px 20px; font-size: 0.82rem; font-weight: 600;
  background: transparent; color: var(--primary);
  border: 1px solid var(--primary); border-radius: 6px;
  cursor: pointer; transition: all 0.15s;
}
.chat-refine-btn:hover { background: var(--primary); color: white; }
.chat-refine-loading { font-size: 0.78rem; color: var(--text-muted); margin-left: 8px; }
.chat-refine-footer {
  text-align: center; padding: 6px 0; border-top: 1px solid var(--border);
  margin-top: 4px;
}
.chat-refine-link {
  font-size: 0.78rem; color: var(--primary); font-weight: 600;
  background: none; border: none; cursor: pointer;
  text-decoration: none;
}
.chat-refine-link:hover { text-decoration: underline; }
.chat-refine-link:disabled, .chat-refine-btn:disabled { opacity: 0.5; cursor: wait; }
.chat-refine-result {
  font-size: 0.85rem; color: var(--text);
  background: rgba(46, 139, 87, 0.08);
  border-radius: 8px; padding: 12px 16px;
}
.chat-refine-result a { color: var(--primary); font-weight: 600; }
.chat-refine-error {
  font-size: 0.85rem; color: #e74c3c;
  background: rgba(231, 76, 60, 0.08);
  border-radius: 8px; padding: 12px 16px;
}

/* ── Benefits discuss link ────────────────────────────────────── */
.benef-discuss-link {
  color: var(--primary); font-weight: 600; font-size: 0.88rem;
  text-decoration: none;
}
.benef-discuss-link:hover { text-decoration: underline; }

/* ── Centro de Relatórios Tabs ───���────────────────────────────────── */
.relatorios-tabs {
  display: flex; gap: 4px; margin: 20px 0 0;
  border-bottom: 2px solid var(--border);
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.relatorios-tab {
  padding: 14px 24px; font-size: 0.88rem; font-weight: 600; min-height: 44px;
  font-family: 'Montserrat', sans-serif;
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.15s;
  white-space: nowrap; flex-shrink: 0;
}
.relatorios-tab:hover { color: var(--primary); }
.relatorios-tab.is-active { color: var(--primary); border-bottom-color: var(--primary); }
.relatorios-content { display: none; padding-top: 16px; }
.relatorios-content.is-active { display: block; }
.relatorios-empty {
  text-align: center; padding: 40px 20px;
  color: var(--text-muted); font-size: 0.9rem;
}
.relatorios-empty .btn-module {
  background: var(--primary); color: #fff; border: none;
  width: auto; padding: 10px 24px; font-size: 0.85rem;
  border-radius: 8px; text-decoration: none;
}
.relatorios-empty .btn-module:hover { background: #257a4a; }

/* ── Welcome screen (first-time onboarding) ────────────────────── */
.welcome-cta-card {
  background: linear-gradient(180deg, #2e8b57 0%, #257349 100%);
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(46,139,87,0.22), 0 2px 8px rgba(0,0,0,0.08);
  padding: 18px;
  text-align: center;
  margin-bottom: 12px;
  animation: stageSlideIn 0.32s ease;
}
.welcome-cta-title {
  color: #ffd166;
  font-weight: 700;
  font-size: 1.1rem;
  font-family: 'Montserrat', sans-serif;
  margin-bottom: 4px;
}
.welcome-cta-sub {
  color: rgba(255,255,255,0.84);
  font-size: 0.8rem;
  margin-bottom: 12px;
}
.welcome-cta-btn {
  display: inline-block;
  background: white;
  color: var(--primary);
  padding: 9px 28px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.85rem;
  border: none;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
}
.welcome-cta-btn:hover {
  background: #f0f0f0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.welcome-cta-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(46,139,87,0.18), 0 2px 8px rgba(0,0,0,0.1);
}

.welcome-showcase-grid {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  animation: stageSlideIn 0.32s ease 0.08s both;
}
.welcome-showcase-card {
  flex: 1;
  background: linear-gradient(135deg, #1a3a2a 0%, #2e8b57 50%, #1a3a2a 100%);
  border: 1px solid rgba(255,215,0,0.25);
  box-shadow: 0 8px 24px rgba(46,139,87,0.22), 0 0 0 1px rgba(255,215,0,0.08), inset 0 1px 0 rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 16px;
  position: relative;
  overflow: hidden;
}
.welcome-showcase-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at 30% 50%, rgba(255,215,0,0.06) 0%, transparent 60%);
  pointer-events: none;
}
.welcome-showcase-emoji { font-size: 1.3rem; margin-bottom: 6px; }
.welcome-showcase-title {
  color: #ffd166;
  font-weight: 700;
  font-size: 0.82rem;
  margin-bottom: 6px;
  position: relative;
}
.welcome-showcase-desc {
  color: rgba(255,255,255,0.84);
  font-size: 0.72rem;
  line-height: 1.45;
  position: relative;
}

.welcome-consultas-grid {
  display: flex;
  gap: 12px;
  width: 100%;
}
.welcome-consulta-card {
  flex: 1;
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.2s;
}
.welcome-consulta-card:hover {
  background: var(--bg);
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(46,139,87,0.08);
}
.welcome-consulta-card:active { border-color: var(--primary-hover); }
.welcome-consulta-card:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(46,139,87,0.12);
}
.welcome-consulta-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.welcome-consulta-emoji { font-size: 0.95rem; }
.welcome-consulta-title { font-weight: 600; font-size: 0.78rem; color: var(--text); }
.welcome-consulta-sub { font-size: 0.72rem; color: var(--text-muted); }
.welcome-consulta-arrow { color: var(--primary); font-size: 0.85rem; font-weight: 600; }

@media (max-width: 640px) {
  .welcome-showcase-grid { flex-direction: column; }
  .welcome-consultas-grid { flex-direction: column; }
}
/* badge IA já é hidden em <480px pela regra global .analises-bar-ia-badge */

/* ── NF-e badges ──────────────────────────────────────────────── */
.badge-entrada { background: #dbeafe; color: #1e40af; border: 1px solid rgba(30,64,175,0.2); }
.badge-saida { background: #dcfce7; color: #166534; border: 1px solid rgba(22,101,52,0.2); }
.badge-autorizada { background: #1a6b3a; color: white; }
.badge-cancelada { background: var(--danger); color: white; }
.badge-cce { background: rgba(245,158,11,0.16); color: #92400e; border: 1px solid rgba(245,158,11,0.35); }
.badge-revenda { background: #ede9fe; color: #6b21a8; border: 1px solid rgba(107,33,168,0.2); }
.badge-revenda-st { background: #fce7f3; color: #9d174d; border: 1px solid rgba(157,23,77,0.2); }
.badge-industrializacao { background: #dbeafe; color: #1e40af; border: 1px solid rgba(30,64,175,0.2); }
.badge-consumo { background: #e2e8f0; color: #475569; }
.badge-ativo { background: rgba(245,158,11,0.16); color: #92400e; border: 1px solid rgba(245,158,11,0.35); }
.badge-outra { background: #f1f5f9; color: #64748b; }
[class*="badge-"] {
  font-size: 0.7rem; font-weight: 600; padding: 2px 8px;
  border-radius: 12px; display: inline-block; white-space: nowrap;
}

/* ── NF-e consulta page ───────────────────────────────────────── */
.hero-page.nfe-consulta-page { --content-width: 1080px; }

#nfe-module-result:not(:empty) {
  background: linear-gradient(180deg, #2e8b57 0%, #257349 100%);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 16px;
  position: relative;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
#nfe-module-result:not(:empty) .alert-error {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.2);
  color: #fecaca;
}
#nfe-module-result:not(:empty) .btn-result-primary {
  background: #fff;
  color: var(--primary);
  border: none;
  padding: 8px 20px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background 0.15s;
}
#nfe-module-result:not(:empty) .btn-result-primary:hover {
  background: rgba(255,255,255,0.88);
}
#nfe-module-result:not(:empty) .btn-module {
  background: rgba(255,255,255,0.22);
  border: 1px solid rgba(255,255,255,0.34);
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background 0.15s;
}
#nfe-module-result:not(:empty) .btn-module:hover {
  background: rgba(255,255,255,0.32);
}
#nfe-module-result:not(:empty) .btn-dismiss {
  background: none;
  border: none;
  color: rgba(255,255,255,0.82);
  font-size: 0.82rem;
  padding: 6px 12px;
  cursor: pointer;
  transition: color 0.15s;
}
#nfe-module-result:not(:empty) .btn-dismiss:hover {
  color: #fff;
}

.nfe-toolbar {
  display: flex; gap: 8px; padding: 10px 0 14px;
  border-bottom: 1px solid var(--border); margin-bottom: 16px; flex-wrap: wrap;
  align-items: center;
}
.btn-tool {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 0.8rem; padding: 7px 14px; font-weight: 500; color: var(--text);
  cursor: pointer; transition: all 180ms ease-out; font-family: 'Inter', sans-serif;
}
.btn-tool svg {
  width: 16px; height: 16px; stroke: var(--primary); stroke-width: 1.75;
  fill: none; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0;
}
.btn-tool:hover { border-color: var(--primary); background: rgba(46,139,87,0.06); color: var(--primary); }
.btn-tool:active { background: rgba(46,139,87,0.12); transform: scale(0.98); }
.btn-tool:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn-tool-group { display: flex; gap: 0; }
.btn-tool-group .btn-tool:first-child { border-radius: 8px 0 0 8px; border-right: none; }
.btn-tool-group .btn-tool:last-child { border-radius: 0 8px 8px 0; }
.btn-tool-alt { font-size: 0.7rem; padding: 6px 10px; min-width: 0; }
.nfe-toolbar-note { font-size: 0.72rem; color: var(--text-muted); margin-left: auto; max-width: 280px; line-height: 1.4; }

.nfe-filters {
  display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; align-items: center;
}
.nfe-filters select, .nfe-filters input {
  padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 0.78rem; font-family: 'Inter', sans-serif; color: var(--text);
}
.nfe-filters input[type="text"] { flex: 1; min-width: 180px; }

.nfe-expand-row { background: #f0fdf4; }
.nfe-expand-body { padding: 8px 12px 14px 40px; }
.nfe-expand-label {
  font-size: 0.72rem; color: var(--text-muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em; margin: 8px 0 6px;
}
.nfe-impostos {
  display: flex; gap: 16px; margin-top: 10px; flex-wrap: wrap;
  font-size: 0.72rem; color: var(--text-muted);
}
.nfe-impostos strong { color: var(--text); }

.nfe-row-cancelada { opacity: 0.7; }
.nfe-row-cancelada .nfe-valor { text-decoration: line-through; }

.nfe-pagination {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 12px; font-size: 0.78rem; color: var(--text-muted);
}
.nfe-pagination-btns { display: flex; gap: 4px; }
.nfe-pagination-btn {
  padding: 4px 10px; border: 1px solid var(--border); border-radius: 4px;
  cursor: pointer; background: white; font-size: 0.78rem; text-decoration: none; color: var(--text);
}
.nfe-pagination-btn.active { background: var(--primary); color: white; font-weight: 600; border-color: var(--primary); }

@media (max-width: 780px) {
  .nfe-filters { flex-direction: column; }
  .nfe-filters select, .nfe-filters input { width: 100%; }
  .nfe-filters-general,
  .nfe-filters-tab { flex-direction: row; flex-wrap: wrap; }
  .nfe-itens-table .col-emitente { display: none; }
}
@media (max-width: 640px) {
  .nfe-filters-general,
  .nfe-filters-tab { flex-direction: column; }
  .nfe-itens-table .col-cfop,
  .nfe-itens-table .col-aliquota,
  .nfe-itens-table .col-vlrunit,
  .nfe-itens-table .col-vlricms { display: none; }
}
@media (max-width: 480px) {
  .nfe-itens-table .col-ncm { display: none; }
  .nfe-itens-table .col-descricao {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* Resizable columns for tables */
.nfe-itens-table,
.nfe-notas-table { table-layout: auto; width: max-content; min-width: 100%; }
.nfe-itens-table th,
.nfe-notas-table th { white-space: nowrap; }
/* sticky + position context for col-resize handles already on .data-table th */

/* Aliquota ICMS badges */
.badge-aliq-0 { background: #f1f5f9; color: #64748b; }
.badge-aliq-4 { background: #dbeafe; color: #1e40af; border: 1px solid rgba(30,64,175,0.2); }
.badge-aliq-12 { background: #ede9fe; color: #6b21a8; border: 1px solid rgba(107,33,168,0.2); }
.badge-aliq-18 { background: #dcfce7; color: #166534; border: 1px solid rgba(22,101,52,0.2); }
.badge-aliq-alta { background: rgba(245,158,11,0.16); color: #92400e; border: 1px solid rgba(245,158,11,0.35); }
.nfe-itens-table th .col-resize,
.nfe-notas-table th .col-resize {
  position: absolute; right: 0; top: 25%; bottom: 25%; width: 3px;
  cursor: col-resize; background: rgba(255,255,255,0.5); border-radius: 2px;
}
.nfe-itens-table th .col-resize:hover,
.nfe-itens-table th .col-resize.active,
.nfe-notas-table th .col-resize:hover,
.nfe-notas-table th .col-resize.active { background: #fff; opacity: 0.9; }

/* Tab bar */
.nfe-tab-bar {
  display: flex;
  gap: 0;
  margin-bottom: 0;
  border-bottom: 2px solid var(--border, #e0e0e0);
  margin-top: 16px;
}
.nfe-tab {
  padding: 10px 24px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s, border-color 0.2s;
}
.nfe-tab:hover { color: var(--primary); }
.nfe-tab.active {
  color: var(--primary);
  font-weight: 600;
  border-bottom-color: var(--primary);
}

/* Filter sub-containers */
.nfe-filters-general,
.nfe-filters-tab {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  width: 100%;
}
