/* ==========================================================================
   PrecificaFácil PRO - Corporate Financial ERP Design System
   Mobile-First, Ultra-Responsive, High-Density Financial Architecture
   ========================================================================== */

:root {
  /* Enterprise Slate Palette */
  --bg-app: #f4f6f8;
  --bg-surface: #ffffff;
  --bg-subtle: #f8fafc;
  --bg-muted: #edf2f7;
  
  --border-subtle: #f1f5f9;
  --border-default: #e2e8f0;
  --border-strong: #cbd5e1;
  --border-focus: #0f172a;

  /* Typography */
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;

  /* Executive Brand Colors */
  --navy-900: #0f172a;
  --navy-800: #1e293b;
  --navy-700: #334155;

  --emerald-600: #059669;
  --emerald-700: #047857;
  --emerald-50: #ecfdf5;
  --emerald-border: #a7f3d0;

  --amber-600: #d97706;
  --amber-700: #b45309;
  --amber-50: #fffbeb;
  --amber-border: #fde68a;

  --rose-600: #e11d48;
  --rose-700: #be123c;
  --rose-50: #fff1f2;
  --rose-border: #fecdd3;

  --blue-600: #2563eb;
  --blue-50: #eff6ff;
  --blue-border: #bfdbfe;

  /* Spacing & Sizing */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-pill: 9999px;

  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
  --shadow-card: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);

  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 14px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-app);
  color: var(--text-primary);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* Hide native number spinners */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield;
}

/* Container */
.app-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 20px 40px 20px;
}

@media (max-width: 980px) {
  .app-container {
    padding: 10px 12px 100px 12px; /* Bottom padding for sticky mobile dock */
  }
}

/* ==========================================================================
   Header Bar
   ========================================================================== */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding: 12px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  flex-wrap: wrap;
  gap: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon-wrap {
  width: 36px;
  height: 36px;
  background: var(--navy-900);
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-info h1 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.2;
}

.badge-version {
  background: var(--bg-muted);
  color: var(--text-secondary);
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid var(--border-strong);
}

.brand-info .subtitle {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 500;
}

.header-status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--emerald-50);
  border: 1px solid var(--emerald-border);
  color: var(--emerald-700);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

.status-dot {
  width: 6px;
  height: 6px;
  background: var(--emerald-600);
  border-radius: 50%;
}

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

@media (max-width: 600px) {
  .app-header {
    padding: 10px 12px;
  }
  .header-status-pill {
    display: none; /* Keep clean on small mobile */
  }
  .brand-info h1 {
    font-size: 1rem;
  }
  .brand-info .subtitle {
    display: none;
  }
}

/* ==========================================================================
   Navigation Tabs Bar (Touch-Optimized Scrollable Pills)
   ========================================================================== */
.nav-tabs-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 4px 6px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  gap: 4px;
}

.nav-tabs-wrapper::-webkit-scrollbar {
  display: none;
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 3px;
  flex: 1;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  min-height: 38px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: var(--radius-xs);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.12s ease;
  user-select: none;
  touch-action: manipulation;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: var(--bg-subtle);
}

.tab-btn.active {
  background: var(--navy-900);
  color: #ffffff;
}

.tab-btn .tab-badge {
  background: rgba(0, 0, 0, 0.12);
  color: inherit;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
}

.tab-btn.active .tab-badge {
  background: var(--emerald-600);
  color: #ffffff;
}

.tab-link-external {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 11px;
  min-height: 36px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-xs);
  font-size: 0.78rem;
  font-weight: 700;
  transition: all 0.12s;
  white-space: nowrap;
  touch-action: manipulation;
}

.tab-link-external:hover {
  background: var(--bg-muted);
  color: var(--text-primary);
}

/* Tab Content */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ==========================================================================
   Layout Grid
   ========================================================================== */
.grid-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 16px;
  align-items: start;
}

@media (max-width: 980px) {
  .grid-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* ==========================================================================
   Cards & Surfaces
   ========================================================================== */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
}

@media (max-width: 600px) {
  .card {
    padding: 14px 12px;
  }
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-default);
  flex-wrap: wrap;
  gap: 8px;
}

.card-header h2 {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

.status-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.status-badge.viable {
  background: var(--emerald-50);
  color: var(--emerald-700);
  border: 1px solid var(--emerald-border);
}

.status-badge.tight {
  background: var(--amber-50);
  color: var(--amber-700);
  border: 1px solid var(--amber-border);
}

.status-badge.danger {
  background: var(--rose-50);
  color: var(--rose-700);
  border: 1px solid var(--rose-border);
}

/* ==========================================================================
   Forms & Controls
   ========================================================================== */
.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.help-text {
  display: block;
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.3;
}

input[type="text"],
input[type="number"],
select {
  width: 100%;
  padding: 9px 11px;
  min-height: 40px;
  font-family: inherit;
  font-size: 0.88rem; /* Prevents auto-zoom on iOS */
  font-weight: 500;
  color: var(--text-primary);
  background: #ffffff;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xs);
  outline: none;
  transition: border-color 0.12s;
}

@media (max-width: 768px) {
  input[type="text"],
  input[type="number"],
  select {
    font-size: 16px !important; /* Strict 16px to prevent iOS Safari zoom */
    min-height: 42px;
  }
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
  border-color: var(--border-focus);
}

/* Addon Wrappers */
.input-addon {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xs);
  background: #ffffff;
  overflow: hidden;
  min-height: 40px;
  transition: border-color 0.12s;
}

@media (max-width: 768px) {
  .input-addon {
    min-height: 42px;
  }
}

.input-addon:focus-within {
  border-color: var(--border-focus);
}

.input-addon span {
  padding: 8px 10px;
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 700;
  border-right: 1px solid var(--border-default);
  user-select: none;
}

.input-addon input {
  border: none !important;
  box-shadow: none !important;
  padding: 8px 10px;
  flex: 1;
  width: 100%;
  font-weight: 600;
}

.input-addon span.suffix {
  border-right: none;
  border-left: 1px solid var(--border-default);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

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

@media (max-width: 680px) {
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }
}

/* Fieldset Section Groups */
.fieldset {
  background: var(--bg-subtle);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xs);
  padding: 12px 14px 8px 14px;
  margin-bottom: 12px;
}

@media (max-width: 600px) {
  .fieldset {
    padding: 10px 10px 6px 10px;
  }
}

.fieldset legend {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 8px;
  display: block;
}

/* Quick Margin Preset Chips */
.chips-row {
  display: flex;
  gap: 5px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.chip-btn {
  background: #ffffff;
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 5px 10px;
  min-height: 32px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all 0.1s;
  touch-action: manipulation;
}

.chip-btn:hover {
  background: var(--bg-muted);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

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

/* Segmented Activity Toggle */
.segmented-control {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  background: var(--bg-muted);
  padding: 3px;
  border-radius: var(--radius-xs);
  margin-bottom: 14px;
}

@media (max-width: 480px) {
  .segmented-control {
    grid-template-columns: 1fr; /* Stack vertically on very small mobile */
    gap: 3px;
  }
}

.segment-item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  min-height: 36px;
  border-radius: var(--radius-xs);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  background: transparent;
  transition: all 0.12s;
  user-select: none;
  border: 1px solid transparent;
  touch-action: manipulation;
}

.segment-item input {
  display: none;
}

.segment-item:hover {
  color: var(--text-primary);
}

.segment-item.active {
  background: #ffffff;
  color: var(--navy-900);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
  border-color: var(--border-default);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  min-height: 38px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: var(--radius-xs);
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: all 0.12s;
  user-select: none;
  white-space: nowrap;
  touch-action: manipulation;
}

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

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

.btn-emerald {
  background: var(--emerald-600);
  color: #ffffff;
}

.btn-emerald:hover {
  background: var(--emerald-700);
}

.btn-secondary {
  background: #ffffff;
  border-color: var(--border-default);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--bg-subtle);
  border-color: var(--border-strong);
}

.btn-outline {
  background: transparent;
  border-color: var(--border-default);
  color: var(--text-muted);
}

.btn-outline:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: #ffffff;
}

.btn-sm {
  padding: 5px 10px;
  min-height: 32px;
  font-size: 0.74rem;
}

.action-buttons-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--border-default);
}

@media (max-width: 600px) {
  .action-buttons-row {
    justify-content: stretch;
  }
  .action-buttons-row .btn {
    width: 100%;
  }
}

/* ==========================================================================
   Executive Price Result Box (Accounting Style)
   ========================================================================== */
.price-result-card {
  background: var(--navy-900);
  color: #ffffff;
  border-radius: var(--radius-sm);
  padding: 18px 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--navy-800);
}

.price-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.price-result-tag {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #94a3b8;
}

.price-result-badge {
  background: rgba(255, 255, 255, 0.1);
  color: #f1f5f9;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
}

.price-result-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.price-result-value {
  font-size: 2.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: #ffffff;
  margin-bottom: 6px;
}

@media (max-width: 600px) {
  .price-result-value {
    font-size: 2rem;
  }
}

.price-result-sub {
  font-size: 0.74rem;
  color: #94a3b8;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.price-result-sub strong {
  color: #e2e8f0;
}

/* Health Meter */
.health-meter-wrap {
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-xs);
  padding: 8px 10px;
  margin-top: 10px;
}

.health-meter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.health-meter-title {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
}

.health-meter-status {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: var(--radius-xs);
}

.health-meter-track {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  overflow: hidden;
}

.health-meter-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease;
  min-width: 3%;
}

/* Comparative Audit Box */
.audit-box {
  background: var(--amber-50);
  border: 1px solid var(--amber-border);
  border-left: 3px solid var(--amber-600);
  border-radius: var(--radius-xs);
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 0.76rem;
  color: #78350f;
  line-height: 1.4;
}

.audit-box-title {
  font-weight: 800;
  margin-bottom: 2px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Demonstrativo Unitário de Formação de Preço */
.breakdown-table-wrap {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xs);
  overflow: hidden;
  margin-bottom: 12px;
  background: #ffffff;
}

.breakdown-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.breakdown-table tr {
  border-bottom: 1px solid var(--border-default);
}

.breakdown-table tr:last-child {
  border-bottom: none;
}

.breakdown-table td {
  padding: 7px 10px;
}

.breakdown-table .row-total {
  background: var(--bg-subtle);
  font-weight: 800;
}

.breakdown-table .row-highlight {
  background: var(--emerald-50);
  font-weight: 800;
  color: var(--emerald-700);
}

/* Quick Metrics 2x2 */
.metrics-grid-2x2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.metric-card-sm {
  background: var(--bg-subtle);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xs);
  padding: 10px 12px;
}

.metric-card-sm .label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.metric-card-sm .value {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
}

.metric-card-sm.accent {
  background: var(--emerald-50);
  border-color: var(--emerald-border);
}

.metric-card-sm.accent .value {
  color: var(--emerald-700);
}

/* Chart Container */
.chart-container-card {
  background: #ffffff;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xs);
  padding: 12px 14px;
  margin-bottom: 12px;
}

.chart-container-card h3 {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.chart-wrapper {
  position: relative;
  height: 175px;
  width: 100%;
}

/* Tables (DRE & Catalog) */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xs);
  background: #ffffff;
}

.dre-table,
.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  text-align: left;
  white-space: nowrap;
}

.dre-table th, .dre-table td,
.history-table th, .history-table td {
  padding: 8px 11px;
  border-bottom: 1px solid var(--border-default);
}

.dre-table th,
.history-table th {
  background: var(--bg-subtle);
  font-weight: 800;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-size: 0.66rem;
  letter-spacing: 0.03em;
}

.dre-table tbody tr:nth-child(even),
.history-table tbody tr:nth-child(even) {
  background: #fbfcfd;
}

.dre-table tbody tr:hover,
.history-table tbody tr:hover {
  background: #f1f5f9;
}

.dre-row-header {
  background: var(--bg-subtle) !important;
  font-weight: 700;
}

.dre-sub-row td {
  padding-left: 20px;
  color: var(--text-muted);
}

.dre-row-total {
  background: #e2e8f0 !important;
  font-weight: 800;
}

.dre-row-highlight {
  background: var(--emerald-50) !important;
}

.dre-row-grand-total {
  background: #cbd5e1 !important;
  font-weight: 800;
  font-size: 0.84rem;
}

.text-right { text-align: right !important; }
.font-bold { font-weight: 800 !important; }
.text-success { color: var(--emerald-700) !important; }
.text-danger { color: var(--rose-600) !important; }
.text-warning { color: var(--amber-700) !important; }
.text-primary { color: var(--text-primary) !important; }
.text-muted { color: var(--text-muted) !important; }

/* Scenarios Grid */
.scenarios-grid-4 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (max-width: 860px) {
  .scenarios-grid-4 {
    grid-template-columns: 1fr;
  }
}

.scenario-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xs);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
}

.scenario-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.scenario-tag {
  font-size: 0.64rem;
  font-weight: 800;
  text-transform: uppercase;
  background: #ffffff;
  border: 1px solid var(--border-default);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
}

.scenario-card h3 {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.scenario-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.35;
  flex-grow: 1;
}

.scenario-result-box {
  background: #ffffff;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xs);
  padding: 10px 12px;
  margin-top: 8px;
  font-size: 0.78rem;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.scenario-verdict {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid var(--border-default);
  font-weight: 700;
  font-size: 0.72rem;
}

/* Catalog Toolbar */
.catalog-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 8px;
  flex-wrap: wrap;
}

.catalog-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 200px;
}

@media (max-width: 600px) {
  .catalog-search-wrap {
    flex-direction: column;
    align-items: stretch;
  }
  .catalog-search-wrap select {
    max-width: 100% !important;
  }
}

.empty-state {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Footer */
.app-footer {
  margin-top: 28px;
  padding-top: 14px;
  border-top: 1px solid var(--border-default);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 8px;
}

/* ==========================================================================
   Floating Sticky Bottom Bar for Mobile Devices
   ========================================================================== */
.mobile-calc-dock {
  display: none;
}

@media (max-width: 980px) {
  .mobile-calc-dock {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding: 10px 16px env(safe-area-inset-bottom, 10px) 16px;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.2);
    color: #ffffff;
  }

  .dock-info {
    display: flex;
    flex-direction: column;
  }

  .dock-label {
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--emerald-border);
  }

  .dock-price {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: #ffffff;
  }

  .dock-sub {
    font-size: 0.68rem;
    color: #94a3b8;
  }

  .dock-actions {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .dock-actions .btn {
    min-height: 38px;
    padding: 8px 16px;
    font-size: 0.82rem;
    border-radius: var(--radius-xs);
  }
}

/* ==========================================================================
   Hero Quick Action Buttons (Copy & WhatsApp)
   ========================================================================== */
.price-hero-actions {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  flex-wrap: wrap;
}

.btn-hero-action {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.12s;
  touch-action: manipulation;
}

.btn-hero-action:hover {
  background: rgba(255, 255, 255, 0.2);
}

.btn-hero-action.whatsapp {
  background: rgba(5, 150, 105, 0.35);
  border-color: rgba(5, 150, 105, 0.6);
  color: #a7f3d0;
}

.btn-hero-action.whatsapp:hover {
  background: rgba(5, 150, 105, 0.55);
}

/* ==========================================================================
   Omnichannel Pricing Matrix
   ========================================================================== */
.omnichannel-section {
  margin-top: 14px;
}

.omnichannel-table-wrap {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xs);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: #ffffff;
}

.omnichannel-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.76rem;
  white-space: nowrap;
}

.omnichannel-table th, .omnichannel-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-default);
}

.omnichannel-table th {
  background: var(--bg-subtle);
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.03em;
}

.omnichannel-table tbody tr:hover {
  background: #f8fafc;
}

.channel-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  font-size: 0.7rem;
}

.channel-pix { background: #ecfdf5; color: #047857; }
.channel-card { background: #eff6ff; color: #1d4ed8; }
.channel-ml { background: #fefce8; color: #854d0e; }
.channel-shopee { background: #fff7ed; color: #c2410c; }
.channel-ifood { background: #fef2f2; color: #b91c1c; }

/* ==========================================================================
   Break-Even Metrics Card (Ponto de Equilíbrio)
   ========================================================================== */
.breakeven-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-default);
  border-left: 3px solid var(--navy-900);
  border-radius: var(--radius-xs);
  padding: 12px 14px;
  margin-top: 14px;
}

.breakeven-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.breakeven-header h4 {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.breakeven-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 600px) {
  .breakeven-grid {
    grid-template-columns: 1fr;
  }
}

.breakeven-item {
  display: flex;
  flex-direction: column;
}

.breakeven-item .label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.breakeven-item .value {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--navy-900);
}

/* ==========================================================================
   Target Pricing Switch (Preço Alvo / Engenharia Reversa)
   ========================================================================== */
.pricing-direction-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: var(--bg-muted);
  padding: 3px;
  border-radius: var(--radius-xs);
  margin-bottom: 12px;
}

.pricing-direction-btn {
  padding: 7px 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 700;
  border-radius: var(--radius-xs);
  cursor: pointer;
  text-align: center;
  transition: all 0.12s;
  user-select: none;
  touch-action: manipulation;
}

.pricing-direction-btn.active {
  background: #ffffff;
  color: var(--navy-900);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
  border-color: var(--border-default);
}

/* ==========================================================================
   Toast Notification Component
   ========================================================================== */
.toast-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  background: var(--navy-900);
  color: #ffffff;
  border-left: 4px solid var(--emerald-600);
  padding: 10px 16px;
  border-radius: var(--radius-xs);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  transform: translateY(-20px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-notification.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 600px) {
  .toast-notification {
    top: auto;
    bottom: 80px;
    right: 12px;
    left: 12px;
    justify-content: center;
  }
}

/* Print Rules */
@media print {
  body { background: #ffffff !important; font-size: 10pt; }
  .app-header, .nav-tabs-wrapper, .action-buttons-row, .app-footer, .btn, .tab-link-external, .mobile-calc-dock, .price-hero-actions, .toast-notification { display: none !important; }
  .tab-content { display: block !important; page-break-after: always; }
  .card { box-shadow: none !important; border: 1px solid #ccc !important; margin-bottom: 16px !important; }
  .grid-layout { display: block !important; }
  .app-container { padding: 0 !important; max-width: 100% !important; }
}
