/* ============================================================
   CALCULADORA DO TAPECEIRO — DESIGN TOKENS & COMPONENTS
============================================================ */

:root {
  /* Surfaces */
  --bg: #F5F2EB;
  --bg-2: #EFEBE2;
  --surface: #FFFFFF;
  --surface-2: #F2EFE7;
  --surface-3: #E8E3D8;
  --border: #E2DDD2;
  --border-strong: #C8C2B5;
  --border-soft: #EDE9DE;

  /* Text */
  --text: #1A1816;
  --text-2: #4A453F;
  --text-muted: #7A746B;
  --text-faint: #A8A299;

  /* Brand */
  --accent: #2B5C3F;
  --accent-2: #3E7B58;
  --accent-soft: #E5EFE9;
  --accent-tint: #F0F6F2;

  /* Status */
  --positive: #2B5C3F;
  --positive-soft: #E5EFE9;
  --warning: #8A5A1A;
  --warning-soft: #F5EBD8;
  --danger: #8C2B2B;
  --danger-soft: #F5E3E3;

  /* Sizing */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(26,24,22,0.04);
  --shadow: 0 1px 3px rgba(26,24,22,0.05), 0 8px 24px rgba(26,24,22,0.04);
  --shadow-lg: 0 4px 12px rgba(26,24,22,0.06), 0 24px 48px rgba(26,24,22,0.06);
}

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

html, body { background: var(--bg); }

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
}

input, button, select, textarea { font-family: inherit; }
button { cursor: pointer; }

.mono { font-family: 'DM Mono', ui-monospace, monospace; font-feature-settings: "tnum"; }
.tnum { font-variant-numeric: tabular-nums; }

/* ============================================================
   HEADER
============================================================ */
.app-header {
  background: var(--accent);
  color: #F2EFE7;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.12);
  display: grid;
  place-items: center;
  font-family: 'DM Mono', monospace;
  font-weight: 500;
  font-size: 16px;
  letter-spacing: -0.02em;
}
.brand-text { line-height: 1.15; }
.brand-title {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.brand-sub {
  font-size: 11px;
  opacity: 0.62;
  margin-top: 2px;
  letter-spacing: 0.02em;
}

.header-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.10);
  padding: 6px 14px 7px;
  border-radius: 10px;
  min-width: 140px;
}
.header-stat-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.62;
}
.header-stat-val {
  font-family: 'DM Mono', monospace;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-top: 1px;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   NAV
============================================================ */
.nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0 8px;
  position: sticky;
  top: 64px;
  z-index: 90;
}
.nav::-webkit-scrollbar { display: none; }
.nav-btn {
  padding: 14px 18px;
  border: none;
  background: none;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
  letter-spacing: -0.005em;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}
.nav-btn .glyph {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text-faint);
  border: 1px solid var(--border);
  width: 18px;
  height: 18px;
  border-radius: 5px;
  display: grid;
  place-items: center;
  transition: all 0.15s;
}
.nav-btn:hover:not(.active) { color: var(--text); }
.nav-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.nav-btn.active .glyph {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.nav-btn .pill {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 1px 6px;
  border-radius: 20px;
  font-weight: 500;
}

/* ============================================================
   LAYOUT
============================================================ */
.content {
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px 20px 64px;
}

.panel { display: none; }
.panel.active { display: block; animation: fadeIn .25s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   CARDS
============================================================ */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 14px;
  overflow: hidden;
}
.card-header {
  padding: 14px 18px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border-soft);
}
.card-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.card-title-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.card-subtitle {
  font-size: 12px;
  color: var(--text-faint);
}
.card-body { padding: 16px 18px; }

/* ============================================================
   INPUTS
============================================================ */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
  color: var(--text-muted);
}
.field-note {
  font-size: 11px;
  color: var(--text-faint);
}
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.15s, background 0.15s;
  overflow: hidden;
}
.input-wrap:focus-within {
  border-color: var(--accent);
  background: var(--surface);
}
.input-prefix, .input-suffix {
  padding: 8px 10px;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--text-faint);
  background: var(--surface-3);
  flex-shrink: 0;
  pointer-events: none;
  user-select: none;
}
.input-prefix { border-right: 1px solid var(--border); }
.input-suffix { border-left: 1px solid var(--border); }
.input-wrap input {
  flex: 1;
  min-width: 0;
  border: none;
  background: none;
  padding: 8px 10px;
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.input-wrap input:focus { outline: none; }
.input-wrap input:disabled { color: var(--accent); -webkit-text-fill-color: var(--accent); opacity: 1; }

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

/* ============================================================
   FORMULA / INFO BOX
============================================================ */
.info-box {
  background: var(--warning-soft);
  border: 1px solid #E8D5B0;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 12.5px;
  color: var(--warning);
  margin-top: 12px;
  line-height: 1.55;
}
.info-box strong { font-weight: 600; }

/* ============================================================
   TABLES
============================================================ */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  min-width: 540px;
}
th {
  text-align: left;
  padding: 9px 14px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: var(--surface-2);
}
th.r { text-align: right; }
th.c { text-align: center; }
td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text);
  vertical-align: middle;
}
td.r { text-align: right; }
td.c { text-align: center; }
td.mono {
  font-family: 'DM Mono', monospace;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(43,92,63,0.02); }

/* Inline cell input — looks invisible until hovered */
.td-input {
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 5px 8px;
  font-family: 'DM Mono', monospace;
  font-size: 12.5px;
  background: transparent;
  color: var(--text);
  width: 92px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  transition: border-color 0.15s, background 0.15s;
}
.td-input:hover { border-color: var(--border); background: var(--surface-2); }
.td-input:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.td-input.wide { width: 100%; min-width: 160px; text-align: left; }
.td-input.tight { width: 64px; }

/* ============================================================
   BADGES
============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: 'DM Mono', monospace;
  font-size: 11.5px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.005em;
}
.badge.good    { background: var(--positive-soft); color: var(--positive); }
.badge.warn    { background: var(--warning-soft);  color: var(--warning); }
.badge.bad     { background: var(--danger-soft);   color: var(--danger); }
.badge.neutral { background: var(--surface-2);     color: var(--text-muted); }
.badge.ghost   { background: transparent;          color: var(--text-muted); border: 1px dashed var(--border); }
.badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ============================================================
   BUTTONS
============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  transition: all 0.15s;
}
.btn:hover { border-color: var(--text-muted); }
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.subtle {
  background: transparent;
  border-color: var(--border);
  color: var(--text-muted);
}
.btn.subtle:hover { color: var(--text); border-color: var(--border-strong); }
.btn.danger {
  background: var(--danger-soft);
  border-color: transparent;
  color: var(--danger);
}
.btn.danger:hover { background: var(--danger); color: white; }
.btn.small { padding: 5px 10px; font-size: 12px; }

.btn-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  background: transparent;
  font-size: 13px;
  color: var(--text-muted);
  transition: all 0.15s;
}
.btn-add:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-tint); }
.btn-add.block { display: flex; width: 100%; justify-content: center; }

.btn-remove {
  border: none;
  background: none;
  color: var(--text-faint);
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1;
  transition: all 0.15s;
}
.btn-remove:hover { color: var(--danger); background: var(--danger-soft); }

.btn-icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 14px;
  transition: all 0.15s;
}
.btn-icon:hover { color: var(--text); border-color: var(--text-muted); }

/* ============================================================
   PAINEL (Dashboard)
============================================================ */
.painel-hero {
  background: linear-gradient(180deg, #2B5C3F 0%, #244E36 100%);
  color: white;
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
.painel-hero.neg {
  background: linear-gradient(180deg, #8C2B2B 0%, #6F2222 100%);
}
.painel-hero.empty {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.painel-hero-eyebrow {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 8px;
}
.painel-hero-num {
  font-family: 'DM Mono', monospace;
  font-size: 52px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.painel-hero-num small {
  font-size: 22px;
  opacity: 0.7;
}
.painel-hero-meta {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-end;
}
.painel-hero-meta-item {
  display: flex;
  flex-direction: column;
}
.painel-hero-meta-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 4px;
}
.painel-hero-meta-val {
  font-family: 'DM Mono', monospace;
  font-size: 15px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.painel-hero-actions {
  position: absolute;
  top: 24px;
  right: 24px;
  display: flex;
  gap: 8px;
}
.painel-hero-pill {
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.18);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  color: white;
  text-decoration: none;
  letter-spacing: 0.02em;
}
.painel-hero-pill:hover { background: rgba(255,255,255,0.2); }

.painel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
@media (max-width: 720px) { .painel-grid { grid-template-columns: 1fr; } }

.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.kpi-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.kpi-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.kpi-big {
  font-family: 'DM Mono', monospace;
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.kpi-big.accent { color: var(--accent); }
.kpi-sub {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.kpi-bullets {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.kpi-bullet {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-2);
  gap: 10px;
}
.kpi-bullet-val {
  font-family: 'DM Mono', monospace;
  font-size: 12.5px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* Progress bar inside KPIs */
.kpi-progress {
  margin-top: 8px;
  height: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  overflow: hidden;
}
.kpi-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* Ranking list */
.ranking {
  display: flex;
  flex-direction: column;
}
.ranking-row {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-soft);
}
.ranking-row:last-child { border-bottom: none; }
.ranking-rank {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text-faint);
  text-align: right;
}
.ranking-name {
  font-size: 13.5px;
  color: var(--text);
  letter-spacing: -0.005em;
}
.ranking-meta {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.ranking-bar {
  grid-column: 2 / 3;
  height: 4px;
  background: var(--surface-2);
  border-radius: 999px;
  margin-top: 4px;
  overflow: hidden;
}
.ranking-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
}

/* Alerts */
.alerts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--text-muted);
  border-radius: 10px;
}
.alert.warn   { border-left-color: var(--warning); background: var(--warning-soft); border-color: #E8D5B0; }
.alert.bad    { border-left-color: var(--danger);  background: var(--danger-soft); border-color: #E8C5C5; }
.alert.good   { border-left-color: var(--accent);  background: var(--accent-tint); border-color: #C9DCD0; }
.alert-icon {
  font-family: 'DM Mono', monospace;
  font-weight: 600;
  font-size: 12px;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.alert.warn .alert-icon { background: var(--warning); color: white; }
.alert.bad  .alert-icon { background: var(--danger);  color: white; }
.alert.good .alert-icon { background: var(--accent);  color: white; }
.alert-body { flex: 1; min-width: 0; }
.alert-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.005em;
}
.alert-desc {
  font-size: 12.5px;
  color: var(--text-2);
  margin-top: 2px;
}
.alert-cta {
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11.5px;
  color: var(--text);
  align-self: center;
  flex-shrink: 0;
}
.alert-cta:hover { background: var(--surface); }

/* ============================================================
   SERVIÇOS — CARDS
============================================================ */
.svc-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.svc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.svc-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-soft);
}
.svc-name-input {
  flex: 1;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 14.5px;
  font-weight: 500;
  background: transparent;
  color: var(--text);
  letter-spacing: -0.005em;
}
.svc-name-input:hover { border-color: var(--border); background: var(--surface); }
.svc-name-input:focus { outline: none; border-color: var(--accent); background: var(--surface); }

.svc-body {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 0;
}
@media (max-width: 720px) {
  .svc-body { grid-template-columns: 1fr; }
}

.svc-inputs {
  padding: 14px 16px;
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
@media (max-width: 720px) {
  .svc-inputs { border-right: none; border-bottom: 1px solid var(--border-soft); }
}
.svc-input-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}
.svc-summary {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface);
}

/* Cadeia (chain) — sempre visível, compacta */
.chain {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 0;
  padding: 12px 16px;
  background: var(--surface-2);
  border-top: 1px solid var(--border-soft);
}
.chain-node {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
  padding: 0 8px;
  border-right: 1px dashed var(--border);
  position: relative;
}
.chain-node:first-child { padding-left: 0; }
.chain-node:last-child { border-right: none; }
.chain-node-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  font-weight: 500;
  white-space: nowrap;
}
.chain-node-val {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.chain-node.final .chain-node-val { color: var(--accent); font-weight: 600; }
.chain-node.muted .chain-node-val { color: var(--text-muted); }

/* Régua de preço */
.price-ruler {
  position: relative;
  height: 56px;
  margin-top: 4px;
  padding-top: 4px;
}
.ruler-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 28px;
  height: 5px;
  background: linear-gradient(90deg,
    var(--danger-soft) 0%,
    var(--warning-soft) 35%,
    var(--positive-soft) 60%,
    var(--positive-soft) 100%);
  border-radius: 999px;
  border: 1px solid var(--border-soft);
}
.ruler-marker {
  position: absolute;
  top: 21px;
  width: 2px;
  height: 19px;
  background: var(--text-muted);
  transform: translateX(-50%);
}
.ruler-marker.min  { background: var(--warning); }
.ruler-marker.cost { background: var(--text-faint); }
.ruler-dot {
  position: absolute;
  top: 23px;
  width: 14px;
  height: 14px;
  background: var(--text);
  border: 2px solid white;
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  z-index: 2;
}
.ruler-dot.good { background: var(--accent); }
.ruler-dot.warn { background: var(--warning); }
.ruler-dot.bad  { background: var(--danger); }
.ruler-label {
  position: absolute;
  top: 0;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  white-space: nowrap;
  transform: translateX(-50%);
}
.ruler-label.you {
  color: var(--text);
  font-weight: 600;
  font-family: 'DM Mono', monospace;
  text-transform: none;
  letter-spacing: 0;
  font-size: 11px;
  top: 45px;
}
.ruler-label.you.good { color: var(--accent); }
.ruler-label.you.bad { color: var(--danger); }
.ruler-label.you.warn { color: var(--warning); }

/* Metrics row inside service summary */
.svc-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  overflow: hidden;
}
.svc-stat {
  padding: 10px 12px;
  border-right: 1px solid var(--border-soft);
  text-align: left;
}
.svc-stat:last-child { border-right: none; }
.svc-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  font-weight: 500;
  margin-bottom: 3px;
}
.svc-stat-val {
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.svc-stat-val.accent { color: var(--accent); }
.svc-stat-val.warn   { color: var(--warning); }
.svc-stat-val.bad    { color: var(--danger); }

/* ============================================================
   FIXOS TABLE — share weight bar
============================================================ */
.weight-bar {
  position: relative;
  height: 4px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 4px;
}
.weight-bar-fill {
  height: 100%;
  background: var(--accent-2);
  opacity: 0.65;
  border-radius: 999px;
}

/* ============================================================
   SIMULADOR
============================================================ */
.sim-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 16px;
}
@media (min-width: 720px) {
  .sim-hero { grid-template-columns: 1.4fr 1fr; }
}

.sim-hero-main {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}
.sim-hero-main.cenario {
  border: 2px dashed var(--accent);
  background: var(--accent-tint);
}
.sim-hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
}
.sim-hero-num {
  font-family: 'DM Mono', monospace;
  font-size: 44px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.sim-hero-num.pos { color: var(--accent); }
.sim-hero-num.neg { color: var(--danger); }
.sim-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 4px;
}
.sim-hero-meta-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-muted);
}
.sim-hero-meta-item .v {
  font-family: 'DM Mono', monospace;
  color: var(--text);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.sim-delta {
  position: absolute;
  top: 18px;
  right: 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: 10px;
  min-width: 130px;
}
.sim-delta-label {
  font-size: 10px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.sim-delta-val {
  font-family: 'DM Mono', monospace;
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.sim-delta-val.pos { color: var(--accent); }
.sim-delta-val.neg { color: var(--danger); }

/* Cenário toolbar */
.cenario-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 14px;
  border-radius: 10px;
  background: var(--accent);
  color: white;
}
.cenario-bar-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.cenario-bar-info .tag {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: 'DM Mono', monospace;
}
.cenario-bar-actions { display: flex; gap: 8px; }
.cenario-bar-actions .btn {
  border-color: rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.10);
  color: white;
}
.cenario-bar-actions .btn:hover {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.4);
}
.cenario-bar-actions .btn.solid {
  background: white;
  color: var(--accent);
  border-color: white;
}
.cenario-bar-actions .btn.solid:hover {
  background: var(--surface-2);
}

/* Preset chips */
.preset-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.preset-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--text-2);
  transition: all 0.15s;
}
.preset-chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-tint); }
.preset-chip .glyph {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text-faint);
}

/* Qty stepper */
.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 7px;
  overflow: hidden;
  background: var(--surface);
}
.qty-stepper button {
  width: 26px;
  height: 26px;
  border: none;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 13px;
  display: grid;
  place-items: center;
  transition: all 0.15s;
}
.qty-stepper button:hover { background: var(--accent-tint); color: var(--accent); }
.qty-stepper input {
  width: 44px;
  height: 26px;
  border: none;
  background: transparent;
  text-align: center;
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.qty-stepper input:focus { outline: none; background: var(--accent-tint); }

/* Sim diff cell (shows base → cenario) */
.sim-diff {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}
.sim-diff .arrow { color: var(--text-faint); }
.sim-diff .new { color: var(--accent); font-weight: 500; }
.sim-diff .new.bad { color: var(--danger); }

/* Composition chart */
.chart {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 14px;
}
.chart-row {
  display: grid;
  grid-template-columns: 110px 1fr 100px;
  align-items: center;
  gap: 12px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--border-soft);
}
.chart-row:last-child { border-bottom: none; }
.chart-row.total {
  background: var(--surface-2);
  font-weight: 600;
}
.chart-label {
  font-size: 12.5px;
  color: var(--text-2);
}
.chart-track {
  position: relative;
  height: 8px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
}
.chart-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
  min-width: 2px;
}
.chart-val {
  font-family: 'DM Mono', monospace;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.chart-val.muted { color: var(--text-muted); }
.chart-val.pos { color: var(--accent); }
.chart-val.neg { color: var(--danger); }

/* Tempo block */
.tempo {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 14px;
  padding: 16px 18px;
}
.tempo-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}
.tempo-pct {
  font-family: 'DM Mono', monospace;
  font-size: 24px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.tempo-pct.warn { color: var(--warning); }
.tempo-pct.bad { color: var(--danger); }
.tempo-pct.good { color: var(--accent); }
.tempo-bar-wrap {
  position: relative;
  height: 14px;
  background: var(--surface-2);
  border-radius: 999px;
  border: 1px solid var(--border);
  overflow: visible;
  margin-bottom: 12px;
}
.tempo-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.35s ease;
  max-width: 100%;
}
.tempo-bar-extra {
  position: absolute;
  top: -1px;
  height: calc(100% + 2px);
  left: 100%;
  background: var(--danger);
  border-radius: 0 999px 999px 0;
  transition: width 0.35s ease;
  min-width: 3px;
}
.tempo-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.tempo-stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.tempo-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  font-weight: 500;
}
.tempo-stat-val {
  font-family: 'DM Mono', monospace;
  font-size: 16px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.tempo-stat-val.warn { color: var(--warning); }
.tempo-stat-val.bad  { color: var(--danger); }
.tempo-stat-val.good { color: var(--accent); }

/* Empty state */
.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.empty-title { font-size: 14px; font-weight: 500; margin-bottom: 4px; color: var(--text); }
.empty-desc { font-size: 13px; color: var(--text-muted); }

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26,24,22,0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  padding: 24px;
  box-shadow: var(--shadow-lg);
}
.modal-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}
.modal-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 18px;
}
.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* Toggle (cenário) */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.toggle {
  display: inline-block;
  width: 36px;
  height: 20px;
  background: var(--border-strong);
  border-radius: 999px;
  position: relative;
  transition: background 0.15s;
}
.toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  transition: transform 0.15s;
}
.toggle.on { background: var(--accent); }
.toggle.on::after { transform: translateX(16px); }

/* Scroll hint */
.scroll-hint {
  font-size: 11px;
  color: var(--text-faint);
  text-align: center;
  padding: 6px 0;
  display: none;
}
@media (max-width: 600px) { .scroll-hint { display: block; } }

/* Hide cols on mobile */
@media (max-width: 680px) {
  .hide-mobile { display: none; }
}

/* Small responsive header tweaks */
@media (max-width: 600px) {
  .brand-sub { display: none; }
  .painel-hero { padding: 20px 18px; }
  .painel-hero-num { font-size: 40px; }
  .painel-hero-num small { font-size: 18px; }
  .sim-hero-main { padding: 18px; }
  .sim-hero-num { font-size: 36px; }
  .nav-btn { padding: 12px 14px; font-size: 12.5px; }
  .header-stat { min-width: auto; }
}

/* Selection */
::selection { background: var(--accent-soft); color: var(--accent); }
