@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500;600&family=Manrope:wght@400;500;600;700;800&family=Noto+Sans+SC:wght@400;500;700&display=swap');

:root {
  /* ALTAHAUS Brand Palette */
  --primary-navy: #002d62;          /* Corporate Navy Blue */
  --primary-navy-dark: #071c38;     /* Deep slate navy */
  --primary-navy-light: #0f3e7a;
  --accent-blue: #0066cc;           /* Tech royal blue */
  --accent-blue-hover: #0052a3;
  --accent-blue-soft: #edf5fd;
  --profit-green: #00a859;          /* ALTAHAUS Emerald Green */
  --profit-green-dark: #007a41;
  --profit-green-soft: #eafaf1;
  --amber: #f59e0b;                 /* Amber Gold for China RMB */
  --amber-soft: #fffbeb;
  --amber-dark: #b45309;
  --red: #ef4444;                   /* Margin deficit / loss */
  --red-soft: #fef2f2;
  --red-dark: #b91c1c;

  /* Surfaces & Typography */
  --ink: #0f172a;                   /* Slate 900 text */
  --ink-secondary: #334155;         /* Slate 700 */
  --muted: #64748b;                 /* Slate 500 */
  --line: #e2e8f0;                  /* Slate 200 border */
  --line-strong: #cbd5e1;           /* Slate 300 border */
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --surface-hover: #f1f5f9;
  
  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 14px -1px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 16px 36px -4px rgba(15, 23, 42, 0.12), 0 6px 16px -2px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--surface-alt);
  color: var(--ink);
  font-family: 'Manrope', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, select {
  font: inherit;
}

button {
  cursor: pointer;
}

/* Modals must remain hidden when marked hidden */
[hidden], .hidden, .modal-overlay[hidden] {
  display: none !important;
}

.app-shell {
  max-width: 1460px;
  margin: auto;
  min-height: 100vh;
  padding: 0 4vw 48px 4vw;
}

/* ==========================================================================
   TOPBAR & HEADER BRANDING
   ========================================================================== */
.topbar {
  min-height: 84px;
  padding: 14px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-alt);
  position: sticky;
  top: 0;
  z-index: 40;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  color: var(--ink);
}

.header-logo-img {
  height: 52px;
  width: auto;
  max-width: 260px;
  object-fit: contain;
  display: block;
  transition: opacity 0.2s ease;
}

.brand:hover .header-logo-img {
  opacity: 0.92;
}

.brand-titles {
  display: flex;
  flex-direction: column;
  border-left: 2px solid var(--line);
  padding-left: 14px;
}

.brand-app-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--primary-navy);
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.brand-app-subtitle {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* Language Switcher */
.lang-switch-container {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 3px;
  box-shadow: var(--shadow-sm);
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  border-radius: 7px;
  transition: all 0.15s ease;
}

.lang-btn:hover {
  color: var(--primary-navy);
  background: var(--surface-hover);
}

.lang-btn.active {
  background: var(--primary-navy);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 45, 98, 0.25);
}

.lang-flag {
  font-size: 14px;
}

.header-pills {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--profit-green-soft);
  color: var(--profit-green-dark);
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid rgba(0, 168, 89, 0.2);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--profit-green);
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* ==========================================================================
   INTRO SECTION
   ========================================================================== */
.intro {
  padding: 28px 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--accent-blue);
}

.intro h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.8px;
  color: var(--primary-navy);
}

.intro h1 em {
  font-style: normal;
  color: var(--profit-green-dark);
}

.intro-copy {
  margin: 10px 0 0;
  max-width: 820px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-secondary);
}

.intro-stamp {
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-sm);
  text-align: right;
  flex-shrink: 0;
}

.intro-stamp span {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: var(--primary-navy);
  letter-spacing: 0.5px;
}

.intro-stamp small {
  display: block;
  font-size: 11px;
  font-family: 'DM Mono', monospace;
  color: var(--muted);
  line-height: 1.3;
  margin-top: 2px;
}

/* ==========================================================================
   PRODUCT IDENTIFICATION BAR
   ========================================================================== */
.product-id-bar {
  margin-bottom: 24px;
}

.product-id-inner {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  background: var(--surface);
  padding: 16px 20px;
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.product-id-field label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 6px;
}

.product-id-field input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--surface-alt);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  outline: none;
  transition: all 0.15s ease;
}

.product-id-field input:focus {
  border-color: var(--accent-blue);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.15);
}

/* ==========================================================================
   WORKSPACE GRID (INPUTS + RESULTS)
   ========================================================================== */
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(380px, 0.95fr);
  gap: 28px;
  align-items: start;
}

/* ==========================================================================
   INPUTS COLUMN & SECTIONS
   ========================================================================== */
.inputs-column {
  background: var(--surface);
  padding: 28px;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}

.section-heading.spaced {
  margin-top: 28px;
}

.section-number {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--primary-navy);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  font-family: 'DM Mono', monospace;
  flex-shrink: 0;
}

.section-heading h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--primary-navy);
  letter-spacing: -0.2px;
}

.section-heading p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
}

/* Mode toggle */
.toggle {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.toggle input {
  display: none;
}

.toggle-track {
  width: 42px;
  height: 24px;
  border-radius: 14px;
  background: var(--line-strong);
  position: relative;
  transition: background 0.2s ease;
}

.toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

.toggle input:checked + .toggle-track {
  background: var(--profit-green);
}

.toggle input:checked + .toggle-track::after {
  transform: translateX(18px);
}

.toggle b {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--profit-green-dark);
}

/* Sub-panels */
.sub-panel {
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 18px;
}

.import-panel {
  background: linear-gradient(180deg, #fffcf4 0%, #fffbf0 100%);
  border: 1px solid #fde68a;
}

.panel-header-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(217, 119, 6, 0.25);
}

.panel-tag {
  font-size: 12px;
  font-weight: 800;
  color: var(--amber-dark);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.panel-hint {
  font-size: 11px;
  color: var(--muted);
}

.import-summary-bar {
  margin-top: 14px;
  padding: 10px 14px;
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid #fde68a;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.import-summary-bar strong {
  font-size: 15px;
  font-weight: 800;
  color: var(--primary-navy);
  font-family: 'DM Mono', monospace;
}

.auto-sync-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--profit-green-dark);
}

/* Form grids & fields - Alinhamento Perfeito & Padronização Visual */
.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.import-panel .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid.spaced-grid {
  margin-top: 16px;
}

.single-row-grid {
  grid-template-columns: 1.4fr 1fr;
}

@media (max-width: 860px) {
  .form-grid,
  .import-panel .form-grid,
  .single-row-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

.field {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  position: relative;
  width: 100%;
}

.field > span {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-secondary);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  min-height: 38px; /* Altura padronizada: alinha perfeitamente labels de 1 e 2 linhas na mesma linha horizontal */
  line-height: 1.28;
}

.field > span > span:first-child {
  display: inline-block;
  line-height: 1.28;
}

.field > span small {
  font-size: 11px;
  font-family: 'DM Mono', monospace;
  color: var(--muted);
  font-weight: 700;
  padding: 1px 6px;
  background: var(--surface-subtle);
  border-radius: 4px;
  border: 1px solid var(--line);
  margin-left: 6px;
  align-self: flex-start;
  white-space: nowrap;
  flex-shrink: 0;
}

.field input, .field select {
  height: 44px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  outline: none;
  box-sizing: border-box;
  transition: all 0.15s ease;
  width: 100%;
}

.field input:focus, .field select:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.15);
}

.field-note {
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
  min-height: 32px; /* Altura padronizada: garante que todas as notas terminem na mesma linha horizontal */
  line-height: 1.35;
  display: flex;
  align-items: flex-start;
}

.input-readonly {
  background: var(--surface-alt) !important;
  color: var(--muted) !important;
  cursor: default;
}

.input-readonly.highlight {
  color: var(--amber-dark) !important;
  font-weight: 800 !important;
  font-family: 'DM Mono', monospace;
}

.input-with-button {
  display: flex;
  gap: 8px;
  height: 44px;
}

.input-with-button input {
  flex: 1;
  height: 44px;
  box-sizing: border-box;
}

.btn-input-action {
  height: 44px;
  padding: 0 14px;
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
  border: 1px solid rgba(0, 102, 204, 0.25);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.btn-input-action:hover {
  background: var(--accent-blue);
  color: #ffffff;
}

.btn-input-action {
  padding: 0 12px;
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
  border: 1px solid rgba(0, 102, 204, 0.25);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.btn-input-action:hover {
  background: var(--accent-blue);
  color: #ffffff;
}

.btn-input-clear {
  width: 38px;
  background: var(--surface-alt);
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
}

.btn-input-clear:hover {
  background: var(--red-soft);
  color: var(--red);
  border-color: var(--red);
}

/* Cost summary box */
.cost-summary-box {
  margin: 16px 0;
  padding: 12px 16px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
}

.cost-summary-item span {
  color: var(--muted);
  display: block;
  font-size: 11px;
}

.cost-summary-item strong {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  font-family: 'DM Mono', monospace;
}

.cost-summary-item.total strong {
  color: var(--primary-navy);
  font-size: 15px;
}

.cost-plus, .cost-equals {
  color: var(--muted);
  font-weight: 800;
}

.fiscal-entry-pill {
  margin-left: auto;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-blue);
  background: var(--accent-blue-soft);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(0, 102, 204, 0.2);
}

/* Presets bar */
.preset-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.preset-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-secondary);
}

.preset-buttons {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

.preset-btn {
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-secondary);
  font-size: 12px;
  font-weight: 700;
  transition: all 0.15s ease;
}

.preset-btn:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.preset-btn.active {
  background: var(--primary-navy);
  color: #ffffff;
  border-color: var(--primary-navy);
  box-shadow: 0 2px 6px rgba(0, 45, 98, 0.2);
}

/* Validation Alert */
.validation-alert {
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--red-soft);
  color: var(--red-dark);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
}

/* Add product wrapper */
.add-product-wrapper {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.action-btn-row {
  display: flex;
  gap: 12px;
}

.btn-primary {
  padding: 12px 24px;
  border-radius: 10px;
  border: none;
  background: var(--primary-navy);
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
  box-shadow: 0 4px 12px rgba(0, 45, 98, 0.25);
}

.btn-primary:hover {
  background: var(--primary-navy-light);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 45, 98, 0.3);
}

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

.btn-secondary {
  padding: 12px 20px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-secondary);
  font-size: 13px;
  font-weight: 700;
  transition: all 0.15s ease;
}

.btn-secondary:hover {
  background: var(--surface-hover);
  color: var(--ink);
}

.add-btn {
  flex: 1;
}

.add-hint {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
}

/* ==========================================================================
   RESULTS COLUMN (CARDS, MEMORY, ICMS, DRE)
   ========================================================================== */
.results-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Dual Pricing Cards */
.dual-pricing-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.result-card {
  padding: 22px;
  border-radius: 16px;
  color: #ffffff;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

/* Card 1: Suggested Price (Navy / Emerald Green) */
.suggested-card {
  background: linear-gradient(150deg, #071c38 0%, #002d62 100%);
  border: 1px solid rgba(0, 168, 89, 0.4);
}

.suggested-card .main-result strong {
  color: #4ade80; /* Vibrant emerald */
}

/* Card 2: Manual Practiced Price (Deep Tech Slate / Royal Blue) */
.manual-card {
  background: linear-gradient(150deg, #0f172a 0%, #1e293b 100%);
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.manual-card .main-result strong {
  color: #38bdf8; /* Tech sky blue */
}

.result-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.label-caps {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
}

.health-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.health-badge i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  background: currentColor;
}

.health-badge.healthy {
  background: rgba(0, 168, 89, 0.25);
  color: #4ade80;
}

.health-badge.warning {
  background: rgba(245, 158, 11, 0.25);
  color: #fbbf24;
}

.health-badge.danger {
  background: rgba(239, 68, 68, 0.25);
  color: #f87171;
}

.main-result {
  margin-bottom: 18px;
}

.main-result span {
  display: block;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.main-result strong {
  display: block;
  font-size: 38px;
  font-weight: 800;
  line-height: 1.1;
  font-family: 'DM Mono', monospace;
  margin: 4px 0;
  letter-spacing: -1px;
}

.main-result span:last-child {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.metrics span {
  display: block;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.65);
}

.metrics strong {
  display: block;
  font-size: 15px;
  font-weight: 800;
  font-family: 'DM Mono', monospace;
  color: #ffffff;
  margin-top: 2px;
}

/* Markup Structure Panel (Memory of Calculation) */
.markup-structure-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.markup-structure-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.markup-structure-header .label-caps {
  color: var(--primary-navy);
}

.badge-divisor {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
  padding: 3px 8px;
  border-radius: 6px;
}

.structure-table {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.struct-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--ink-secondary);
}

.struct-row strong {
  font-family: 'DM Mono', monospace;
  font-weight: 700;
  color: var(--ink);
}

.struct-row.struct-total {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 2px solid var(--line-strong);
  font-weight: 800;
}

.struct-row.struct-total span {
  font-size: 13px;
  color: var(--primary-navy);
}

.struct-row.struct-total strong {
  font-size: 16px;
  color: var(--profit-green-dark);
}

.struct-footer-note {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
}

/* ICMS Panel Box */
.icms-panel-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.icms-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.icms-panel-header .label-caps {
  color: var(--primary-navy);
}

.badge-profile {
  font-size: 11px;
  font-weight: 700;
  background: var(--surface-alt);
  color: var(--ink-secondary);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.icms-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.icms-metric-box {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.icms-metric-box span {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

.icms-metric-box strong {
  display: block;
  font-size: 14px;
  font-weight: 800;
  font-family: 'DM Mono', monospace;
  color: var(--ink);
  margin-top: 2px;
}

.icms-metric-box.highlight {
  background: var(--profit-green-soft);
  border-color: rgba(0, 168, 89, 0.25);
}

.icms-metric-box.highlight strong {
  color: var(--profit-green-dark);
}

/* DRE Panel (Demonstrativo Financeiro) */
.dre-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

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

.dre-heading .label-caps {
  color: var(--muted);
}

.dre-heading h2 {
  margin: 2px 0 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--primary-navy);
}

.dre-tag {
  font-size: 11px;
  font-weight: 700;
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
  padding: 4px 10px;
  border-radius: 6px;
  font-family: 'DM Mono', monospace;
}

.dre-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dre-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--ink-secondary);
}

.dre-line strong {
  font-family: 'DM Mono', monospace;
  font-weight: 700;
  color: var(--ink);
}

.dre-line.total {
  font-weight: 800;
  font-size: 13px;
  color: var(--primary-navy);
}

.dre-line.sub-note-line {
  font-size: 11px;
  color: var(--muted);
  padding-left: 12px;
}

.dre-line.subtotal {
  font-weight: 700;
  color: var(--primary-navy);
}

.dre-line.profit {
  font-size: 14px;
  font-weight: 800;
  color: var(--profit-green-dark);
  padding-top: 4px;
}

.dre-line.profit strong {
  color: var(--profit-green-dark);
  font-size: 16px;
}

.line-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

.line-dot.tax { background: #d97706; }
.line-dot.cost { background: #dc2626; }
.line-dot.storage { background: #64748b; }
.line-dot.fee { background: #2563eb; }

.dre-divider {
  height: 1px;
  background: var(--line);
  margin: 6px 0;
}

.protection-callout {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  font-size: 11px;
  line-height: 1.45;
  color: var(--ink-secondary);
}

/* ==========================================================================
   PRODUCTS CATALOG & TABLE SECTION
   ========================================================================== */
.products-catalog-section {
  margin-top: 40px;
  background: var(--surface);
  border-radius: 16px;
  border: 1px solid var(--line);
  padding: 28px;
  box-shadow: var(--shadow-md);
}

.catalog-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.catalog-header .label-caps {
  color: var(--muted);
}

.catalog-header h2 {
  margin: 2px 0 0;
  font-size: 20px;
  font-weight: 800;
  color: var(--primary-navy);
}

.catalog-header p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.catalog-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.count-badge {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  background: var(--surface-alt);
  color: var(--primary-navy);
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.btn-export {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 8px;
  background: var(--primary-navy);
  color: #ffffff;
  border: none;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.15s ease;
}

.btn-export:hover {
  background: var(--primary-navy-light);
}

.btn-import {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 8px;
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
  border: 1px solid rgba(0, 102, 204, 0.25);
  font-size: 13px;
  font-weight: 700;
  transition: all 0.15s ease;
}

.btn-import:hover {
  background: var(--accent-blue);
  color: #ffffff;
}

.btn-clear {
  padding: 9px 14px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--line-strong);
  font-size: 12px;
  font-weight: 700;
}

.btn-clear:hover {
  background: var(--red-soft);
  color: var(--red);
  border-color: var(--red);
}

/* Tabs for filtering */
.table-filter-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
  flex-wrap: wrap;
}

.tab-filter-btn {
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  transition: all 0.15s ease;
}

.tab-filter-btn:hover {
  background: var(--surface-hover);
  color: var(--ink);
}

.tab-filter-btn.active {
  background: var(--surface-alt);
  color: var(--primary-navy);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}

/* Table */
.table-responsive {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.products-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
  white-space: nowrap;
}

.products-table th {
  background: var(--surface-alt);
  color: var(--muted);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

/* Colunas Sticky para SKU e Descrição não sumirem no scroll */
.products-table th.col-sticky-1,
.products-table td.col-sticky-1 {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--surface);
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.04);
}

.products-table th.col-sticky-2,
.products-table td.col-sticky-2 {
  position: sticky;
  left: 105px;
  z-index: 2;
  background: var(--surface);
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.04);
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.products-table th.col-sticky-1,
.products-table th.col-sticky-2 {
  z-index: 4;
  background: var(--surface-alt);
}

.products-table tbody tr:hover td.col-sticky-1,
.products-table tbody tr:hover td.col-sticky-2 {
  background: var(--surface-hover);
}

.products-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}

.products-table tbody tr:hover {
  background: var(--surface-hover);
}

.products-table td.num {
  font-family: 'DM Mono', monospace;
  font-weight: 600;
}

.products-table td.bold-num {
  font-family: 'DM Mono', monospace;
  font-weight: 800;
  color: var(--primary-navy);
}

.products-table td.profit-num {
  font-family: 'DM Mono', monospace;
  font-weight: 800;
  color: var(--profit-green-dark);
}

.products-table .empty-row td {
  text-align: center;
  padding: 40px 14px;
  color: var(--muted);
  white-space: normal;
}

.th-actions, .td-actions {
  text-align: right;
}

.btn-table-action {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font-size: 11px;
  font-weight: 700;
  margin-left: 4px;
}

.btn-table-action.edit:hover {
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
  border-color: var(--accent-blue);
}

.btn-table-action.delete:hover {
  background: var(--red-soft);
  color: var(--red);
  border-color: var(--red);
}

/* ==========================================================================
   MODALS (EXPORT & IMPORT)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow-y: auto;
}

.modal-card {
  background: var(--surface);
  border-radius: 16px;
  max-width: 860px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
  overflow: hidden;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.modal-header h3 {
  margin: 2px 0 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--primary-navy);
}

.modal-header p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 16px;
  color: var(--muted);
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.modal-close-btn:hover {
  background: var(--surface-hover);
  color: var(--ink);
}

.modal-presets {
  padding: 12px 24px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 8px;
}

.btn-sm {
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-secondary);
}

.btn-sm.active {
  background: var(--primary-navy);
  color: #ffffff;
  border-color: var(--primary-navy);
}

.modal-columns-grid {
  padding: 20px 24px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.col-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.col-group-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--primary-navy);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.col-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-secondary);
  cursor: pointer;
}

.col-check input {
  accent-color: var(--primary-navy);
}

.modal-footer {
  padding: 16px 24px;
  background: var(--surface-alt);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.modal-format-choice {
  display: flex;
  gap: 16px;
  font-size: 13px;
}

.modal-format-choice label {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.modal-action-buttons {
  display: flex;
  gap: 10px;
}

/* ==========================================================================
   IMPORT SPREADSHEET MODAL STYLES
   ========================================================================== */
.file-drop-area {
  border: 2px dashed var(--line-strong);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  background: var(--surface-alt);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.file-drop-area:hover, .file-drop-area.dragover {
  border-color: var(--accent-blue);
  background: var(--accent-blue-soft);
}

.file-drop-area input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.drop-icon {
  font-size: 32px;
  display: block;
  margin-bottom: 6px;
}

.drop-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  display: block;
}

.drop-hint {
  font-size: 11px;
  color: var(--muted);
  display: block;
  margin-top: 2px;
}

.selected-file-name {
  margin-top: 10px;
  display: inline-block;
  padding: 4px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-navy);
  font-family: 'DM Mono', monospace;
}

.import-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 18px 0;
}

.import-preview-box {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-alt);
}

.import-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-navy);
}

.import-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  white-space: nowrap;
}

.import-preview-table th, .import-preview-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
footer {
  margin-top: 48px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
  gap: 12px;
}

footer b {
  color: var(--ink-secondary);
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 1120px) {
  .workspace {
    grid-template-columns: 1fr;
  }
  .results-column {
    margin-top: 12px;
  }
}

@media (max-width: 768px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    height: auto;
    padding: 16px 0;
  }
  .product-id-inner {
    grid-template-columns: 1fr;
  }
  .intro {
    flex-direction: column;
  }
  .intro-stamp {
    text-align: left;
  }
  .metrics {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   AUTOMAÇÃO DE PRECIFICAÇÃO SIMULTÂNEA DAS 3 TABELAS
   ========================================================================== */
.auto-triple-config {
  margin-top: 14px;
  background: linear-gradient(180deg, #f0f7ff 0%, #f8fafc 100%);
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 14px 16px;
  transition: all 0.2s ease;
}

.auto-triple-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.auto-triple-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge-auto-tag {
  background: #0284c7;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-block;
}

.auto-desc-sub {
  margin: 2px 0 0;
  font-size: 11px;
  color: #64748b;
}

.btn-toggle-config {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-toggle-config:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.auto-triple-body {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed #cbd5e1;
}

.auto-tables-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.auto-table-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.auto-table-card.card-spsp {
  border-left: 4px solid #002d62;
}

.auto-table-card.card-inter {
  border-left: 4px solid #0284c7;
}

.auto-table-card.card-custom {
  border-left: 4px solid #d97706;
}

.auto-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.auto-card-badge {
  font-size: 12px;
  font-weight: 800;
  color: var(--ink);
}

.auto-card-head small {
  font-size: 10px;
  color: var(--muted);
}

.auto-card-fields {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.auto-card-fields label {
  display: flex;
  flex-direction: column;
}

.auto-card-fields label span {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 3px;
  white-space: nowrap;
}

.auto-card-fields input {
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 700;
  font-family: 'DM Mono', monospace;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-align: right;
  background: var(--surface);
}

.auto-config-hint {
  display: block;
  margin-top: 10px;
  font-size: 11px;
  color: #0369a1;
  line-height: 1.4;
}

/* ==========================================================================
   BLOCO DEDICADO: SIMULAÇÃO & FORMAÇÃO DO PREÇO MANUAL (PRATICADO)
   ========================================================================== */
.manual-pricing-box {
  margin-top: 14px;
  background: #f8fafc;
  border: 1.5px solid rgba(0, 102, 204, 0.28);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 2px 8px rgba(0, 51, 102, 0.04);
}

.manual-pricing-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px dashed rgba(0, 102, 204, 0.2);
}

.manual-pricing-title {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.manual-tag {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent-blue);
  letter-spacing: 0.5px;
}

.manual-subtitle {
  font-size: 12px;
  color: var(--ink-secondary);
  font-weight: 500;
}

.manual-pricing-actions {
  display: flex;
  gap: 8px;
}

.btn-manual-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-copy-sug {
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
  border: 1px solid rgba(0, 102, 204, 0.35);
}

.btn-copy-sug:hover {
  background: var(--accent-blue);
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-clear-manual {
  background: #ffffff;
  color: var(--muted);
  border: 1px solid var(--line);
}

.btn-clear-manual:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: rgba(220, 38, 38, 0.3);
}

.manual-pricing-inputs-grid {
  display: grid;
  grid-template-columns: 1fr 40px 1fr;
  align-items: start;
  gap: 14px;
}

.manual-input-col .field-label-row {
  min-height: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.manual-input-col .field-note {
  min-height: 20px;
}

.manual-sync-arrow {
  margin-top: 36px;
}

@media (max-width: 680px) {
  .manual-pricing-inputs-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .manual-sync-arrow {
    display: none;
  }
}

.manual-input-col {
  display: flex;
  flex-direction: column;
}

.manual-sync-arrow {
  font-size: 20px;
  color: var(--accent-blue);
  font-weight: 800;
  text-align: center;
  padding-top: 10px;
  user-select: none;
}

.field-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.field-label-row strong {
  font-size: 13px;
  color: var(--navy-dark);
  font-weight: 700;
}

.unit-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  background: rgba(0, 102, 204, 0.1);
  color: var(--accent-blue);
  border-radius: 5px;
}

.input-lg {
  height: 44px;
  font-size: 16px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 9px;
  border: 1.5px solid rgba(0, 102, 204, 0.3);
  background: #ffffff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input-lg:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.15);
  outline: none;
}

.manual-live-pill {
  margin-top: 12px;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 12px;
  font-weight: 600;
  color: var(--navy-dark);
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.4;
}

/* ==========================================================================
   RESUMO COMPARATIVO DAS 3 TABELAS (PRÉVIA LIVE: SUGERIDO E PRATICADO)
   ========================================================================== */
.triple-live-preview {
  margin-top: 18px;
  background: #f8fafc;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
}

.triple-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.preview-tag {
  font-size: 12px;
  font-weight: 800;
  color: var(--primary-navy);
  letter-spacing: 0.4px;
  display: block;
}

.preview-subtitle {
  font-size: 12px;
  color: var(--ink-secondary);
  font-weight: 500;
}

.preview-rule-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--muted);
}

.triple-cards-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.triple-card {
  background: #ffffff;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.triple-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.triple-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.triple-card-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--navy-dark);
}

.triple-card-rule {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  background: var(--surface-subtle);
  border-radius: 5px;
  color: var(--muted);
  border: 1px solid var(--line);
}

.triple-tier-block {
  padding: 10px 12px;
  border-radius: 9px;
  display: flex;
  flex-direction: column;
}

.tier-suggested {
  background: rgba(0, 168, 89, 0.05);
  border: 1px solid rgba(0, 168, 89, 0.22);
}

.tier-manual {
  background: rgba(0, 102, 204, 0.05);
  border: 1px solid rgba(0, 102, 204, 0.22);
}

.tier-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.tier-tag {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.tag-sug {
  color: #047857;
}

.tag-man {
  color: #0369a1;
}

.triple-card-price {
  font-size: 19px;
  font-weight: 800;
  font-family: 'DM Mono', monospace;
  color: var(--profit-green-dark);
  letter-spacing: -0.4px;
  line-height: 1.2;
}

.triple-card-meta {
  font-size: 11px;
  font-family: 'DM Mono', monospace;
  color: var(--muted);
  margin-top: 3px;
  font-weight: 600;
}

.triple-manual-price {
  font-size: 19px;
  font-weight: 800;
  font-family: 'DM Mono', monospace;
  color: var(--accent-blue);
  letter-spacing: -0.4px;
  line-height: 1.2;
}

.triple-manual-meta {
  font-size: 11px;
  font-family: 'DM Mono', monospace;
  color: var(--ink-secondary);
  margin-top: 3px;
  font-weight: 600;
}

/* Botão Lançamento Triplo */
.btn-triple-add {
  padding: 12px 22px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.btn-triple-add:hover {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.38);
}

.btn-triple-add:active {
  transform: translateY(0);
}

/* ==========================================================================
   BARRA DE GESTÃO DE MÚLTIPLAS TABELAS / PROJETOS
   ========================================================================== */
.list-manager-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 18px;
  margin-bottom: 16px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}

.active-list-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.active-list-badge {
  background: #f1f5f9;
  color: var(--primary-navy);
  font-size: 10px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
  border: 1px solid #cbd5e1;
}

.active-list-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--navy-dark);
}

.btn-list-mini {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  opacity: 0.6;
  padding: 2px 4px;
  border-radius: 4px;
  transition: opacity 0.15s, background 0.15s;
}

.btn-list-mini:hover {
  opacity: 1;
  background: #f1f5f9;
}

.list-manager-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-list-action {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-list-action:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.btn-new-list-highlight {
  background: #002d62;
  color: #ffffff;
  border-color: #002d62;
}

.btn-new-list-highlight:hover {
  background: #0d4182;
  border-color: #0d4182;
  color: #ffffff;
}

.btn-upload-label {
  margin-bottom: 0;
  cursor: pointer;
}

/* Modal de Listas Salvas */
.saved-lists-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.saved-list-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.saved-list-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.saved-list-card.active-card {
  border: 2px solid #0284c7;
  background: #f0f9ff;
}

.saved-list-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.saved-list-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.saved-list-name {
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
}

.saved-list-active-tag {
  background: #0284c7;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
}

.saved-list-counts {
  display: flex;
  gap: 8px;
  font-size: 11px;
  color: #64748b;
  flex-wrap: wrap;
}

.saved-list-counts span {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'DM Mono', monospace;
}

.saved-list-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-saved-action {
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-saved-action:hover {
  background: #f1f5f9;
}

.btn-saved-action.btn-open {
  background: var(--primary-navy);
  color: #ffffff;
  border-color: var(--primary-navy);
}

.btn-saved-action.btn-open:hover {
  background: var(--primary-navy-light);
}

.btn-saved-action.btn-del {
  color: var(--red);
}

.btn-saved-action.btn-del:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}
