/* ==========================================================================
   Calculadora de Orçamento & Margem — Equipe Xispeh
   Design System: Preto profundo (#121111, #0a0a0a), Laranja Xispeh (#ff8d07),
   Contraste estrito, tipografia Space Grotesk + JetBrains Mono, scrollbar custom.
   ========================================================================== */

:root {
  /* Tokens de Cor */
  --c-black: #121111;
  --c-black-deep: #0a0a0a;
  --c-black-mid: #171616;
  --c-black-surface: #1e1d1d;
  --c-black-card: #151414;

  --c-orange: #ff8d07;
  --c-orange-bright: #ffa53b;
  --c-orange-dark: #d47200;
  --c-orange-glow: rgba(255, 141, 7, 0.28);
  --c-orange-dim: rgba(255, 141, 7, 0.12);

  --c-green: #22c55e;
  --c-green-dim: rgba(34, 197, 94, 0.15);

  --c-white: #f5f5f5;
  --c-white-dim: rgba(245, 245, 245, 0.72);
  --c-white-low: rgba(245, 245, 245, 0.45);
  --c-white-faint: rgba(245, 245, 245, 0.08);

  --c-line: rgba(245, 245, 245, 0.09);
  --c-line-strong: rgba(255, 141, 7, 0.28);
  --c-line-glow: rgba(255, 141, 7, 0.45);

  --glow-orange: 0 0 25px rgba(255, 141, 7, 0.35), 0 0 50px rgba(255, 141, 7, 0.15);
  --glow-orange-sm: 0 0 12px rgba(255, 141, 7, 0.4);
  --glow-orange-card: 0 8px 32px rgba(255, 141, 7, 0.12);

  /* Dimensões e Raios */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 18px;
  --r-2xl: 24px;
  --r-pill: 9999px;

  /* Fontes */
  --font-main: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Scrollbar customizado da biblioteca xsite */
  --scroll-track: var(--c-black-deep);
  --scroll-thumb: var(--c-orange);
  --scroll-width: 8px;
  --scroll-radius: 8px;
}

/* Scrollbar Firefox & Webkit */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
}
::-webkit-scrollbar {
  width: var(--scroll-width);
  height: var(--scroll-width);
}
::-webkit-scrollbar-track {
  background: var(--scroll-track);
}
::-webkit-scrollbar-thumb {
  background-color: var(--scroll-thumb);
  border-radius: var(--scroll-radius);
  border: 2px solid var(--scroll-track);
}
::-webkit-scrollbar-thumb:hover {
  background-color: var(--c-orange-bright);
}

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

body {
  background-color: var(--c-black);
  color: var(--c-white);
  font-family: var(--font-main);
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  background-image: 
    radial-gradient(circle at 85% -10%, rgba(255, 141, 7, 0.12), transparent 45%),
    radial-gradient(circle at -15% 105%, rgba(255, 141, 7, 0.08), transparent 45%);
  background-attachment: fixed;
}

/* Container Principal */
.app-layout {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 16px 60px;
}

/* Top Bar & Navegação Fixa */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(18, 17, 17, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--c-line);
  margin: 0 -16px 28px -16px;
  padding: 14px 20px 10px;
}

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

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

.brand-badge {
  background: linear-gradient(135deg, var(--c-orange), var(--c-orange-dark));
  color: var(--c-black);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 4px 8px;
  border-radius: var(--r-sm);
}

h1, h2, h3 {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

.brand-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--c-white);
  text-wrap: balance;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(245, 245, 245, 0.04);
  border: 1px solid var(--c-line);
  padding: 4px 10px;
  border-radius: var(--r-pill);
}

.live-dot {
  width: 7px;
  height: 7px;
  background-color: var(--c-green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--c-green);
  animation: pulse-dot 2s infinite ease-in-out;
}

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

.status-text {
  font-size: 11px;
  font-weight: 500;
  color: var(--c-white-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Abas de Navegação */
.nav-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
}

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

.nav-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--c-black-card);
  border: 1px solid var(--c-line);
  color: var(--c-white-dim);
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 600;
  min-height: 42px;
  padding: 10px 18px;
  border-radius: var(--r-pill);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-tab:hover {
  background: var(--c-black-surface);
  color: var(--c-white);
  border-color: rgba(255, 141, 7, 0.3);
}

.nav-tab.active {
  background: var(--c-orange);
  color: var(--c-black);
  border-color: var(--c-orange);
  box-shadow: var(--glow-orange-sm);
  font-weight: 700;
}

.tab-icon {
  width: 14px;
  height: 14px;
}

/* Seções de Cálculo */
.calc-section {
  background: linear-gradient(180deg, var(--c-black-card), var(--c-black-deep));
  border: 1px solid var(--c-line);
  border-radius: var(--r-2xl);
  padding: 28px 24px;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.calc-section::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle at 100% 0%, rgba(255, 141, 7, 0.12), transparent 70%);
  pointer-events: none;
}

.section-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.section-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  background: var(--c-orange-dim);
  color: var(--c-orange);
  border: 1px solid rgba(255, 141, 7, 0.3);
  padding: 2px 8px;
  border-radius: var(--r-xs);
  letter-spacing: 0.08em;
}

.section-subtag {
  font-size: 11px;
  font-weight: 600;
  color: var(--c-white-low);
  letter-spacing: 0.06em;
}

.calc-head {
  margin-bottom: 24px;
}

.calc-head h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  color: var(--c-white);
  text-wrap: balance;
}

.calc-head p {
  font-size: 14px;
  color: var(--c-white-dim);
  line-height: 1.5;
  text-wrap: balance;
}

/* Pílulas de Preço */
.price-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.pill {
  background: var(--c-black-deep);
  border: 1px solid var(--c-line);
  color: var(--c-white-dim);
  font-family: var(--font-main);
  border-radius: var(--r-pill);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.pill:hover {
  border-color: rgba(255, 141, 7, 0.4);
  color: var(--c-white);
  transform: translateY(-1px);
}

.pill.active {
  background: var(--c-orange);
  color: var(--c-black);
  border-color: var(--c-orange);
  box-shadow: var(--glow-orange);
  font-weight: 700;
}

.edit-pill {
  border-color: var(--c-line-strong);
  background: rgba(255, 141, 7, 0.06);
  color: var(--c-orange-bright);
}

.edit-pill.active {
  background: var(--c-orange);
  color: var(--c-black);
}

/* Input de Valor Customizado */
.custom-input-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--c-line-strong);
  border-radius: var(--r-lg);
  padding: 18px;
  margin-bottom: 22px;
  animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.custom-input-box label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-orange);
  margin-bottom: 8px;
  text-align: center;
}

.input-money-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-black-deep);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  padding: 8px 16px;
  transition: all 0.2s ease;
}

.input-money-wrapper:focus-within {
  border-color: var(--c-orange);
  box-shadow: var(--glow-orange-sm);
}

.currency-prefix {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--c-orange);
  margin-right: 8px;
}

.percent-suffix, .suffix-pct, .suffix-mult {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--c-orange);
  margin-left: 6px;
}

.input-money {
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  color: var(--c-white);
  text-align: center;
  width: 100%;
}

.input-percent {
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  color: var(--c-white);
  text-align: center;
  width: 100%;
}

.quick-inc-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
}

.quick-chip {
  background: var(--c-black-surface);
  border: 1px solid var(--c-line);
  color: var(--c-white-dim);
  font-size: 13px;
  font-weight: 600;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: var(--r-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.quick-chip:hover {
  background: var(--c-orange-dim);
  border-color: var(--c-orange);
  color: var(--c-orange-bright);
}

.quick-chip.clear {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.2);
}

.quick-chip.clear:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
}

/* Configuração de Taxa do Cartão */
.rate-config-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(245, 245, 245, 0.03);
  border: 1px solid var(--c-line);
  padding: 10px 16px;
  border-radius: var(--r-md);
  margin-bottom: 22px;
}

.rate-config-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--c-white-dim);
}

.rate-config-label strong {
  color: var(--c-orange);
  font-family: var(--font-mono);
}

.rate-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rate-pill {
  background: var(--c-black-deep);
  border: 1px solid var(--c-line);
  color: var(--c-white-low);
  font-size: 12px;
  font-weight: 600;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: var(--r-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.rate-pill:hover {
  color: var(--c-white);
  border-color: rgba(255, 141, 7, 0.3);
}

.rate-pill.active {
  background: var(--c-orange-dim);
  border-color: var(--c-orange);
  color: var(--c-orange-bright);
}

/* Resultados do Projeto */
.results-container {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.result-row.main-total {
  border: 1px solid var(--c-orange);
  border-radius: var(--r-lg);
  text-align: center;
  box-shadow: var(--glow-orange);
  background: linear-gradient(135deg, rgba(255, 141, 7, 0.18), rgba(255, 141, 7, 0.05));
  padding: 22px;
  position: relative;
}

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

.result-row .label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-orange);
  font-size: 11px;
  font-weight: 700;
}

.result-row .value {
  color: var(--c-white);
  font-size: 34px;
  font-weight: 800;
  font-family: var(--font-mono);
  display: block;
  letter-spacing: -0.02em;
}

.subtext-note {
  font-size: 11px;
  color: var(--c-white-low);
  margin-top: 4px;
  display: block;
}

.copy-mini-btn {
  background: rgba(255, 141, 7, 0.12);
  border: 1px solid rgba(255, 141, 7, 0.3);
  color: var(--c-orange-bright);
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--r-xs);
  min-height: 40px;
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.copy-mini-btn:hover {
  background: var(--c-orange);
  color: var(--c-black);
}

.result-grid-condensed {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 540px) {
  .result-grid-condensed {
    grid-template-columns: 1fr;
  }
}

.result-box {
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  background: rgba(245, 245, 245, 0.03);
  padding: 16px;
  position: relative;
  transition: border-color 0.2s;
}

.result-box.highlight-pix {
  border-color: rgba(34, 197, 94, 0.3);
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.08), rgba(34, 197, 94, 0.02));
}

.result-box .label {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--c-white-low);
  font-size: 10px;
  font-weight: 600;
  display: block;
}

.result-box .value.larger {
  font-size: 26px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--c-white);
  display: block;
  margin: 6px 0;
}

.badge-mini-green {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  background: var(--c-green-dim);
  color: var(--c-green);
  border: 1px solid rgba(34, 197, 94, 0.3);
  padding: 2px 6px;
  border-radius: var(--r-xs);
  text-transform: uppercase;
}

.badge-mini-dim {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  background: rgba(245, 245, 245, 0.06);
  color: var(--c-white-dim);
  padding: 2px 6px;
  border-radius: var(--r-xs);
}

/* Simulação de Cartão */
.installments-wrapper {
  border-radius: var(--r-md);
  border: 1px solid var(--c-line);
  background: rgba(18, 17, 17, 0.5);
  padding: 16px;
}

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

.label-heading {
  text-transform: uppercase;
  color: var(--c-orange);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.installments-tag {
  font-size: 10px;
  color: var(--c-white-low);
}

.installments-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

@media (max-width: 640px) {
  .installments-row {
    grid-template-columns: repeat(3, 1fr);
  }
}

.installment-item {
  text-align: center;
  border-radius: var(--r-sm);
  border: 1px solid var(--c-line);
  background: rgba(245, 245, 245, 0.02);
  padding: 10px 4px;
  transition: all 0.15s;
}

.installment-item:hover {
  background: rgba(255, 141, 7, 0.08);
  border-color: rgba(255, 141, 7, 0.3);
}

.installment-item .count {
  color: var(--c-orange);
  font-size: 12px;
  font-weight: 700;
  display: block;
  margin-bottom: 2px;
}

.installment-item .val {
  color: var(--c-white);
  font-size: 16px;
  font-weight: 800;
  font-family: var(--font-mono);
}

/* Ações de Proposta */
.proposal-action-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.action-btn-main {
  width: 100%;
  background: var(--c-orange);
  color: var(--c-black);
  border: none;
  font-family: var(--font-main);
  font-size: 15px;
  font-weight: 700;
  padding: 14px 20px;
  border-radius: var(--r-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: var(--glow-orange);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.action-btn-main:hover {
  background: var(--c-orange-bright);
  transform: translateY(-2px);
  box-shadow: 0 0 35px rgba(255, 141, 7, 0.6);
}

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

.action-btn-secondary {
  width: 100%;
  background: var(--c-black-surface);
  border: 1px solid var(--c-line-strong);
  color: var(--c-orange-bright);
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 600;
  padding: 12px 18px;
  border-radius: var(--r-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

.action-btn-secondary:hover {
  background: var(--c-orange-dim);
  border-color: var(--c-orange);
  color: var(--c-white);
}

.preview-toggle-btn {
  background: transparent;
  border: none;
  color: var(--c-white-low);
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  transition: color 0.15s;
}

.preview-toggle-btn:hover {
  color: var(--c-white-dim);
}

.preview-content {
  background: var(--c-black-deep);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  padding: 14px;
  margin-top: 8px;
}

.preview-content pre {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--c-white-dim);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
}

.chevron {
  transition: transform 0.2s ease;
}

.chevron.open {
  transform: rotate(180deg);
}

/* ==========================================================================
   SEÇÃO 2: CALCULADORA DE MARGEM & DELEGAÇÃO
   ========================================================================== */

.mode-switch-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 22px;
}

@media (max-width: 540px) {
  .mode-switch-container {
    grid-template-columns: 1fr;
  }
}

.mode-tab {
  background: var(--c-black-deep);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  padding: 14px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.mode-tab:hover {
  border-color: rgba(255, 141, 7, 0.3);
  background: var(--c-black-surface);
}

.mode-tab.active {
  background: rgba(255, 141, 7, 0.08);
  border-color: var(--c-orange);
  box-shadow: inset 0 0 0 1px var(--c-orange);
}

.mode-title {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--c-white);
  margin-bottom: 3px;
}

.mode-tab.active .mode-title {
  color: var(--c-orange-bright);
}

.mode-desc {
  display: block;
  font-size: 11px;
  color: var(--c-white-low);
  line-height: 1.35;
}

.inputs-two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

@media (max-width: 640px) {
  .inputs-two-cols {
    grid-template-columns: 1fr;
  }
}

.input-card {
  background: var(--c-black-deep);
  border: 1px solid var(--c-line);
  border-radius: var(--r-lg);
  padding: 18px;
}

.input-card label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--c-white-dim);
  margin-bottom: 10px;
}

.label-step {
  width: 18px;
  height: 18px;
  background: var(--c-orange);
  color: var(--c-black);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
}

.label-with-type {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.label-with-type label {
  margin-bottom: 0;
}

.sub-type-toggle {
  display: flex;
  background: var(--c-black-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--r-sm);
  padding: 2px;
}

.sub-toggle-btn {
  background: transparent;
  border: none;
  color: var(--c-white-low);
  font-size: 11px;
  font-weight: 600;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.sub-toggle-btn.active {
  background: var(--c-orange);
  color: var(--c-black);
  font-weight: 700;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.preset-chip {
  background: rgba(245, 245, 245, 0.04);
  border: 1px solid var(--c-line);
  color: var(--c-white-dim);
  font-size: 13px;
  font-weight: 600;
  min-height: 40px;
  min-width: 44px;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.preset-chip:hover {
  background: var(--c-orange-dim);
  border-color: rgba(255, 141, 7, 0.4);
  color: var(--c-orange-bright);
}

.preset-chip.active {
  background: var(--c-orange);
  color: var(--c-black);
  border-color: var(--c-orange);
  font-weight: 700;
}

/* Controle de Arredondamento Inteligente */
.rounding-control-card {
  background: rgba(255, 141, 7, 0.04);
  border: 1px solid var(--c-line-strong);
  border-radius: var(--r-md);
  padding: 14px 18px;
  margin-bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rounding-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--c-white);
  text-wrap: balance;
}

.rounding-info p {
  font-size: 12px;
  color: var(--c-white-dim);
  margin-top: 2px;
  text-wrap: balance;
}

.rounding-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.round-chip {
  background: var(--c-black-deep);
  border: 1px solid var(--c-line);
  color: var(--c-white-low);
  font-size: 12px;
  font-weight: 600;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.round-chip:hover {
  color: var(--c-white);
  border-color: rgba(255, 141, 7, 0.4);
}

.round-chip.active {
  background: var(--c-orange);
  color: var(--c-black);
  border-color: var(--c-orange);
  box-shadow: var(--glow-orange-sm);
  font-weight: 700;
}

/* Fita de Proporção (Split Bar) */
.split-bar-wrapper {
  background: var(--c-black-deep);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  padding: 16px;
  margin-bottom: 22px;
}

.split-bar-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--c-white-dim);
  margin-bottom: 8px;
}

.split-bar {
  height: 12px;
  background: rgba(245, 245, 245, 0.05);
  border-radius: var(--r-pill);
  overflow: hidden;
  display: flex;
}

.bar-segment {
  height: 100%;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.bar-team {
  background: #64748b;
}

.bar-agency {
  background: linear-gradient(90deg, var(--c-orange), var(--c-orange-bright));
  box-shadow: 0 0 10px rgba(255, 141, 7, 0.4);
}

.split-bar-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  font-size: 11px;
  color: var(--c-white-dim);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot-team {
  background: #64748b;
}

.dot-agency {
  background: var(--c-orange);
}

/* Grade de Métricas */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

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

.metric-card {
  background: var(--c-black-deep);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  padding: 16px;
  text-align: center;
}

.metric-card.highlight-glow {
  border-color: var(--c-orange);
  background: linear-gradient(135deg, rgba(255, 141, 7, 0.12), rgba(255, 141, 7, 0.02));
  box-shadow: var(--glow-orange-card);
}

.metric-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-white-low);
  margin-bottom: 6px;
}

.metric-val {
  display: block;
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 800;
  color: var(--c-white);
  margin-bottom: 4px;
}

.metric-sub {
  display: block;
  font-size: 11px;
  color: var(--c-white-dim);
}

.text-white { color: #ffffff !important; }
.text-orange { color: var(--c-orange-bright) !important; }
.text-green { color: var(--c-green) !important; }

/* ==========================================================================
   SEÇÃO 3: CÁLCULOS RÁPIDOS DE PORCENTAGEM (REFERÊNCIA 4DEVS REINVENTADA)
   ========================================================================== */

.percentage-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

@media (max-width: 768px) {
  .percentage-cards-grid {
    grid-template-columns: 1fr;
  }
}

.pct-card {
  background: var(--c-black-deep);
  border: 1px solid var(--c-line);
  border-radius: var(--r-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.pct-card:hover {
  border-color: rgba(255, 141, 7, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.pct-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.pct-card-num {
  width: 24px;
  height: 24px;
  background: var(--c-orange-dim);
  border: 1px solid rgba(255, 141, 7, 0.3);
  color: var(--c-orange);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pct-card-head h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--c-white);
  margin-bottom: 2px;
  text-wrap: balance;
}

.pct-card-head p {
  font-size: 11px;
  color: var(--c-white-low);
  line-height: 1.35;
  text-wrap: balance;
}

.sentence-builder {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--c-white-dim);
  margin-bottom: 12px;
}

.inline-input-group {
  display: inline-flex;
  align-items: center;
  background: var(--c-black-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--r-sm);
  padding: 4px 8px;
  transition: border-color 0.15s;
}

.inline-input-group:focus-within {
  border-color: var(--c-orange);
  box-shadow: var(--glow-orange-sm);
}

.inline-input-group.prefix-brl::before {
  content: "R$";
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--c-orange);
  margin-right: 4px;
}

.inline-input-group.suffix-pct::after {
  content: "%";
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--c-orange);
  margin-left: 2px;
}

.inline-input-group.suffix-mult::after {
  content: "x";
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--c-orange);
  margin-left: 2px;
}

.input-inline {
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--c-white);
  width: 78px;
  text-align: right;
}

.input-inline.small-num {
  width: 44px;
  text-align: center;
}

.quick-chips-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 14px;
}

.chip-mini {
  background: rgba(245, 245, 245, 0.03);
  border: 1px solid var(--c-line);
  color: var(--c-white-low);
  font-size: 12px;
  font-weight: 600;
  min-height: 40px;
  min-width: 44px;
  padding: 8px 12px;
  border-radius: var(--r-xs);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.chip-mini:hover {
  color: var(--c-white);
  border-color: rgba(255, 141, 7, 0.3);
}

.chip-mini.active {
  background: var(--c-orange-dim);
  border-color: var(--c-orange);
  color: var(--c-orange-bright);
}

.pct-result-box {
  background: rgba(255, 141, 7, 0.04);
  border: 1px solid rgba(255, 141, 7, 0.2);
  border-radius: var(--r-md);
  padding: 12px 14px;
}

.pct-result-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 12px;
}

.pct-result-line:not(:last-child) {
  border-bottom: 1px solid rgba(245, 245, 245, 0.05);
}

.pct-res-label {
  color: var(--c-white-dim);
}

.pct-res-val {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--c-white);
}

.pct-res-val.highlight {
  color: var(--c-orange-bright);
  font-size: 15px;
}

/* Rodapé */
.app-footer {
  margin-top: 40px;
  border-top: 1px solid var(--c-line);
  padding-top: 24px;
  text-align: center;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: var(--c-white-low);
  letter-spacing: 0.08em;
  font-weight: 500;
}

/* Ícones Auxiliares */
.icon-xs {
  width: 13px;
  height: 13px;
}

.icon-sm {
  width: 16px;
  height: 16px;
}

/* Toast de Notificação */
.toast-popup {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--c-black-card);
  border: 1px solid var(--c-orange);
  box-shadow: var(--glow-orange);
  color: var(--c-white);
  padding: 12px 18px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 9999;
  transform: translateY(100px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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