/* ============================================================
   app.css :: Design System Archveer App
   Tokens: #E27526 (laranja), navys escuros, Playfair Display + Montserrat
   Layout: sidebar 240px + conteudo. Mobile-first (~400px).
   Elemento de assinatura: grade de blueprint no cabecalho da sidebar.
   ============================================================ */

/* ---------- TOKENS ---------- */
:root {
  /* Laranja Archveer (correcao do token antigo #C44613) */
  --orange:        #E27526;
  --orange-hover:  #F28A35;
  --orange-glow:   rgba(226,117,38,0.28);
  --orange-light:  rgba(226,117,38,0.10);
  --orange-border: rgba(226,117,38,0.35);

  /* Navys escuros */
  --navy-950:  #0C1525;
  --navy-900:  #121E38;
  --navy-800:  #162247;
  --navy-700:  #1A2B5A;
  --navy-600:  #213470;
  --navy-100:  rgba(22,34,71,0.08);
  --navy-border: rgba(22,34,71,0.18);

  /* Superficies */
  --bg-page:    #F1F3F8;
  --bg-surface: #FFFFFF;
  --bg-zebra:   #F7F8FB;
  --bg-header:  var(--navy-950);

  /* Texto */
  --ink:   #0A1020;
  --body:  #374151;
  --muted: #6B7280;
  --on-dark:      #FFFFFF;
  --on-dark-soft: rgba(255,255,255,0.70);

  /* Bordas e sombras */
  --border:   #E2E6EF;
  --sh-card:  0 1px 4px rgba(22,34,71,0.07), 0 3px 10px rgba(22,34,71,0.05);
  --sh-raised:0 4px 20px rgba(22,34,71,0.14);

  /* Tipografia */
  --font-title: 'Playfair Display', Georgia, serif;
  --font-ui:    'Montserrat', 'Helvetica Neue', Arial, sans-serif;

  /* Radius */
  --r-sm:   4px;
  --r-md:   8px;
  --r-lg:   12px;
  --r-pill: 200px;

  /* Espacamento */
  --sp1: 4px;  --sp2: 8px;  --sp3: 12px; --sp4: 16px; --sp5: 20px;
  --sp6: 24px; --sp8: 32px; --sp10:40px; --sp12:48px;

  /* Sidebar */
  --sidebar-w: 240px;

  /* Transicao */
  --tr: all 0.2s ease;
}

/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-ui);
  background: var(--bg-page);
  color: var(--body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- LAYOUT SHELL ---------- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ---------- SIDEBAR ---------- */
.app-sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  height: 100dvh;
  background: var(--bg-header);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 200;
  transition: transform 0.25s ease;
  overflow: hidden;
}

/* Blueprint grid no topo da sidebar */
.sidebar-brand {
  padding: var(--sp5) var(--sp5) var(--sp4);
  background:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px),
    var(--navy-950);
  background-size: 28px 28px, 28px 28px, auto;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}
.sidebar-logo {
  height: 26px;
  width: auto;
  filter: brightness(0) invert(1);
  display: block;
  margin-bottom: var(--sp3);
}
.sidebar-appname {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--on-dark-soft);
}

/* Navegacao */
#app-nav {
  flex: 1;
  min-height: 0;
  padding: var(--sp3) 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(226,117,38,0.55) transparent;
}
#app-nav::-webkit-scrollbar { width: 6px; }
#app-nav::-webkit-scrollbar-track { background: transparent; }
#app-nav::-webkit-scrollbar-thumb { background: rgba(226,117,38,0.55); border-radius: 6px; }
#app-nav::-webkit-scrollbar-thumb:hover { background: var(--orange); }
#app-nav > * { flex-shrink: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--sp3);
  padding: 10px var(--sp5);
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.55);
  text-align: left;
  width: 100%;
  transition: var(--tr);
  border-left: 3px solid transparent;
  white-space: nowrap;
  letter-spacing: 0.03em;
}
.nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.90);
}
.nav-item.active {
  background: rgba(226,117,38,0.12);
  border-left-color: var(--orange);
  color: #fff;
}
.nav-icon {
  font-size: 16px;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}
.nav-label { flex: 1; }

/* Menu por setores: cabeçalho do setor abre e fecha o grupo; os itens do grupo são só texto */
.nav-setor {
  display: flex;
  align-items: center;
  gap: var(--sp3);
  padding: 10px var(--sp5);
  background: transparent;
  border: none;
  border-left: 3px solid transparent;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,0.70);
  text-align: left;
  width: 100%;
  letter-spacing: 0.03em;
  transition: var(--tr);
}
.nav-setor:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-setor.contem { color: #fff; border-left-color: rgba(226,117,38,0.45); }
.nav-setor:hover .nav-icon-img { transform: scale(1.12); }
.nav-seta {
  width: 7px; height: 7px; flex-shrink: 0; margin-right: 2px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(-45deg); transition: transform .18s ease; opacity: .7;
}
.nav-setor.aberto .nav-seta { transform: rotate(45deg); }
.nav-grupo { display: flex; flex-direction: column; gap: 1px; padding: 2px 0 8px; }
.nav-grupo[hidden] { display: none; }
.nav-subtitulo {
  padding: 8px var(--sp5) 3px calc(var(--sp5) + 40px);
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: rgba(255,255,255,0.38);
}
.nav-item.nav-sub {
  padding: 7px var(--sp4) 7px calc(var(--sp5) + 40px);
  font-weight: 500;
  white-space: normal;
  line-height: 1.3;
  letter-spacing: 0.01em;
}
.nav-item.nav-sub2 { padding-left: calc(var(--sp5) + 50px); }
@media (prefers-reduced-motion: reduce) { .nav-seta { transition: none; } }

/* Rodape da sidebar */
.sidebar-footer {
  padding: var(--sp4) var(--sp5);
  border-top: 1px solid rgba(255,255,255,0.07);
  font-size: 10px;
  color: rgba(255,255,255,0.25);
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

/* ---------- TOPBAR (mobile) ---------- */
.app-topbar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 190;
  height: 52px;
  background: var(--navy-950);
  align-items: center;
  gap: var(--sp3);
  padding: 0 var(--sp4);
  box-shadow: 0 2px 12px rgba(12,21,37,0.50);
}
.topbar-logo {
  height: 22px;
  width: auto;
  filter: brightness(0) invert(1);
}
.topbar-title {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.80);
  flex: 1;
}
.topbar-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.80);
  font-size: 20px;
  cursor: pointer;
  padding: var(--sp2);
  line-height: 1;
}

/* Overlay para fechar sidebar em mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 199;
}
.sidebar-overlay.visible { display: block; }

/* ---------- AREA DE CONTEUDO ---------- */
.app-content-wrap {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

#app-content {
  flex: 1;
  padding: var(--sp8) var(--sp8);
  max-width: 1200px;
  width: 100%;
}

/* ---------- TIPOGRAFIA MODULOS ---------- */
.module-title {
  font-family: var(--font-title);
  font-size: 28px;
  font-weight: 700;
  color: var(--navy-800);
  line-height: 1.2;
  margin-bottom: var(--sp2);
}
.module-subtitle {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: var(--sp8);
  line-height: 1.5;
}
.section-title {
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: 700;
  color: var(--navy-800);
  margin-bottom: var(--sp4);
}

/* ---------- CARDS ---------- */
.sc {
  background: var(--bg-surface);
  border-radius: var(--r-md);
  box-shadow: var(--sh-card);
  border: 1px solid var(--border);
  margin-bottom: var(--sp6);
  overflow: hidden;
}
.sc-head {
  background: var(--navy-800);
  padding: var(--sp3) var(--sp5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp4);
}
.sc-head h2 {
  color: var(--on-dark);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.13em;
}
.sc-body { padding: var(--sp5); }

/* ---------- TABS INTERNAS (dentro de modulo) ---------- */
.tab-bar {
  display: flex;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
  margin-bottom: var(--sp6);
  border-radius: var(--r-md) var(--r-md) 0 0;
  box-shadow: var(--sh-card);
}
.tab-bar::-webkit-scrollbar { display: none; }
.tab-btn {
  padding: var(--sp4) var(--sp5);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  white-space: nowrap;
  transition: var(--tr);
}
.tab-btn:hover { color: var(--navy-800); background: var(--navy-100); }
.tab-btn.active { color: var(--orange); border-bottom-color: var(--orange); }

.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ---------- STEP NAV (compras) ---------- */
.step-nav {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 0;
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  margin-bottom: var(--sp6);
  border-radius: var(--r-md) var(--r-md) 0 0;
  box-shadow: var(--sh-card);
}
.step-nav::-webkit-scrollbar { display: none; }
.step-tab {
  display: flex;
  align-items: center;
  gap: var(--sp2);
  padding: var(--sp4) var(--sp5);
  border-bottom: 3px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--tr);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: var(--font-ui);
}
.step-tab:hover { color: var(--navy-800); background: var(--navy-100); }
.step-tab.active { color: var(--orange); border-bottom-color: var(--orange); }
.step-tab.done { color: var(--navy-700); }
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
  background: var(--muted);
  color: #fff;
}
.step-tab.active .step-num { background: var(--orange); }
.step-tab.done .step-num { background: var(--navy-700); }

.step-panel { display: none; }
.step-panel.active { display: block; }

/* ---------- TABELAS ---------- */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.dt { width: 100%; border-collapse: collapse; font-size: 13px; }
table.dt th {
  background: var(--navy-800);
  color: rgba(255,255,255,0.75);
  text-align: left;
  padding: var(--sp3) var(--sp4);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  white-space: nowrap;
}
table.dt th.r { text-align: right; }
table.dt td {
  padding: var(--sp3) var(--sp4);
  border-bottom: 1px solid #EEF0F5;
  vertical-align: middle;
}
table.dt tr:last-child td { border-bottom: none; }
table.dt tbody tr:hover td { background: var(--bg-zebra); }
.td-r { text-align: right; }
.td-c { text-align: center; }
.td-calc { font-weight: 600; color: var(--navy-700); text-align: right; white-space: nowrap; }
.td-hi { font-weight: 700; color: var(--orange); text-align: right; white-space: nowrap; }
.row-cat td {
  background: #EEF0F8;
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--navy-700);
  padding: var(--sp2) var(--sp4);
}
.row-total td {
  background: var(--navy-100);
  font-weight: 700;
  border-top: 2px solid var(--navy-border);
}

/* ---------- INPUTS ---------- */
input[type=text],
input[type=number],
input[type=email],
input[type=tel],
input[type=url],
input[type=date],
input[type=time],
input[type=search],
input[type=password],
select,
textarea {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  background: var(--bg-surface);
  border: 1px solid #D1D5E8;
  border-radius: var(--r-sm);
  padding: 8px 10px;
  width: 100%;
  transition: border-color 0.15s;
  outline: none;
  line-height: 1.4;
}
input[type=number] { text-align: right; }
input[type=text]:focus,
input[type=number]:focus,
input[type=email]:focus,
input[type=tel]:focus,
select:focus,
textarea:focus {
  border-color: var(--navy-700);
  box-shadow: 0 0 0 3px rgba(22,34,71,0.09);
}
textarea { resize: vertical; min-height: 80px; }

/* Input group (prefixo R$, %) */
.ig {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-surface);
  border: 1px solid #D1D5E8;
  border-radius: var(--r-sm);
  padding: 0 10px;
  transition: border-color 0.15s;
}
.ig:focus-within {
  border-color: var(--navy-700);
  box-shadow: 0 0 0 3px rgba(22,34,71,0.09);
}
.ig span { color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.ig input { border: none; padding: 8px 0; box-shadow: none !important; flex: 1; min-width: 0; }
.ig input:focus { border: none; box-shadow: none !important; }

/* Checkbox toggle */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: var(--sp3);
  cursor: pointer;
}
.toggle-wrap input[type=checkbox] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--orange);
}
.toggle-label { font-size: 13px; font-weight: 600; color: var(--body); }

/* ---------- BOTOES ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp2);
  cursor: pointer;
  border: none;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  line-height: 1;
  padding: 11px 24px;
  border-radius: var(--r-pill);
  transition: var(--tr);
  white-space: nowrap;
  -webkit-font-smoothing: antialiased;
}
.btn-p {
  background: var(--orange);
  color: #fff;
  box-shadow: 0 3px 10px var(--orange-glow);
  min-width: 200px;
}
.btn-p:hover {
  background: var(--orange-hover);
  transform: translateY(-1px);
  box-shadow: 0 5px 16px var(--orange-glow);
}
.btn-s {
  background: var(--navy-800);
  color: #fff;
  box-shadow: 0 2px 6px rgba(22,34,71,0.22);
}
.btn-s:hover { background: var(--navy-950); transform: translateY(-1px); }
.btn-g {
  background: transparent;
  color: var(--navy-700);
  border: 1px solid var(--navy-border);
  border-radius: var(--r-sm);
  font-size: 11px;
  padding: 7px 16px;
}
.btn-g:hover { background: var(--navy-100); }
.btn-del {
  background: transparent;
  color: #DC2626;
  border: none;
  padding: 5px 7px;
  border-radius: var(--r-sm);
  font-size: 11px;
  cursor: pointer;
  font-family: var(--font-ui);
  transition: var(--tr);
}
.btn-del:hover { background: #FEF2F2; }
.btn-add-cat {
  background: transparent;
  color: var(--orange);
  border: 1px solid var(--orange);
  width: 22px;
  height: 22px;
  line-height: 1;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-ui);
  transition: var(--tr);
  padding: 0;
}
.btn-add-cat:hover { background: var(--orange); color: #fff; }
.btn-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp2);
  color: var(--navy-700);
  background: none;
  border: 1.5px dashed var(--navy-border);
  border-radius: var(--r-sm);
  padding: 8px 16px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-ui);
  transition: var(--tr);
  width: 100%;
  margin-top: var(--sp2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.btn-add:hover { background: var(--navy-100); border-color: var(--navy-700); }

/* ---------- STEP ACTIONS ---------- */
.step-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp6) 0;
  gap: var(--sp4);
  flex-wrap: wrap;
}

/* ---------- SUMMARY ROW ---------- */
.sum-row {
  display: flex;
  gap: var(--sp4);
  flex-wrap: wrap;
  padding: var(--sp4) var(--sp5);
  background: var(--bg-zebra);
  border-top: 1px solid var(--border);
}
.sum-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 130px;
}
.sum-lbl {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--muted);
}
.sum-val { font-size: 18px; font-weight: 700; color: var(--navy-700); }
.sum-val.hi { color: var(--orange); }

/* ---------- FORM GRID ---------- */
.fg {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--sp4);
}
.fg-2 { grid-template-columns: 1fr 1fr; }
.fg-3 { grid-template-columns: repeat(3, 1fr); }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--muted);
}

/* ---------- NOTICE ---------- */
.notice {
  display: flex;
  gap: var(--sp3);
  background: rgba(226,117,38,0.06);
  border: 1px solid rgba(226,117,38,0.25);
  border-radius: var(--r-sm);
  padding: var(--sp4);
  font-size: 12px;
  color: var(--body);
  line-height: 1.5;
  margin-bottom: var(--sp4);
}
.notice strong { color: var(--orange); }

.notice-info {
  background: rgba(22,34,71,0.05);
  border-color: rgba(22,34,71,0.18);
}

/* Calibrar aviso */
.calib-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--orange);
  background: var(--orange-light);
  border: 1px solid var(--orange-border);
  border-radius: var(--r-pill);
  padding: 2px 8px;
  margin-left: var(--sp2);
}

/* ---------- STAT CARDS ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--sp4);
  margin-bottom: var(--sp6);
}
.stat-card {
  background: var(--bg-surface);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  box-shadow: var(--sh-card);
  padding: var(--sp5);
}
.stat-lbl {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--muted);
  margin-bottom: var(--sp2);
}
.stat-val {
  font-family: var(--font-title);
  font-size: 22px;
  font-weight: 700;
  color: var(--navy-800);
  line-height: 1.1;
}
.stat-val.hi { color: var(--orange); }

/* ---------- MODELOS DE PRECO ---------- */
.models-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--sp5);
  margin-bottom: var(--sp6);
}
.mod-card {
  background: var(--bg-surface);
  border-radius: var(--r-md);
  border: 2px solid transparent;
  box-shadow: var(--sh-card);
  padding: var(--sp6);
  cursor: pointer;
  transition: var(--tr);
  position: relative;
}
.mod-card:hover { border-color: var(--navy-border); box-shadow: var(--sh-raised); }
.mod-card.sel {
  border-color: var(--orange);
  box-shadow: 0 0 0 4px var(--orange-light), var(--sh-raised);
}
.mod-num {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--muted);
  margin-bottom: var(--sp2);
}
.mod-name { font-size: 14px; font-weight: 700; color: var(--navy-800); margin-bottom: var(--sp3); line-height: 1.3; }
.mod-val { font-size: 26px; font-weight: 700; color: var(--orange); line-height: 1; margin-bottom: var(--sp2); }
.mod-val small { font-size: 14px; font-weight: 600; }
.mod-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin-top: var(--sp3);
  border-top: 1px solid var(--border);
  padding-top: var(--sp3);
}
.mod-pay { font-size: 12px; color: var(--body); font-weight: 600; margin-top: var(--sp2); }
.chk-mark {
  position: absolute;
  top: var(--sp4);
  right: var(--sp4);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}
.mod-card.sel .chk-mark { display: flex; }

/* ---------- PROPOSTA ---------- */
.proposta-wrap { display: none; }
.proposta-wrap.vis { display: block; }
.proposta {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp12);
  max-width: 760px;
  margin: 0 auto;
}
.prop-hdr {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--sp8);
  padding-bottom: var(--sp6);
  border-bottom: 3px solid var(--navy-800);
}
.prop-logo { height: 32px; width: auto; }
.prop-title-blk { text-align: right; }
.prop-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy-800);
  text-transform: uppercase;
  letter-spacing: 0.09em;
}
.prop-date { font-size: 12px; color: var(--muted); margin-top: 3px; }
.prop-sec-lbl {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--muted);
  margin-bottom: var(--sp2);
  margin-top: var(--sp6);
}
.prop-sec-lbl:first-of-type { margin-top: 0; }
.proposta p { font-size: 14px; color: var(--body); line-height: 1.65; margin-bottom: var(--sp2); }
.prop-valor {
  font-family: var(--font-title);
  font-size: 30px;
  font-weight: 700;
  color: var(--orange);
  display: block;
  margin: var(--sp3) 0;
}
.clausulas {
  background: var(--bg-zebra);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: var(--sp5);
  margin-top: var(--sp6);
}
.clausulas p {
  font-size: 13px;
  margin-bottom: var(--sp2);
  padding-left: var(--sp5);
  position: relative;
}
.clausulas p::before { content: 'o'; position: absolute; left: 0; color: var(--navy-700); font-weight: 700; }
.assina {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp8);
  margin-top: var(--sp10);
  padding-top: var(--sp6);
  border-top: 1px solid var(--border);
}
.assina-blk { display: flex; flex-direction: column; gap: var(--sp2); }
.assina-line { border-bottom: 1px solid var(--muted); height: 38px; margin-bottom: 3px; }
.assina-lbl { font-size: 12px; color: var(--muted); font-weight: 600; }

/* ---------- CARGO REF ROW ---------- */
.ref-row {
  display: flex;
  align-items: center;
  gap: var(--sp4);
  padding: var(--sp4) var(--sp5);
  background: var(--navy-100);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.ref-row label {
  font-size: 11px;
  font-weight: 700;
  color: var(--navy-700);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.ref-hora { font-size: 20px; font-weight: 700; color: var(--orange); margin-left: auto; }

/* ---------- CONST PANEL ---------- */
.const-panel {
  background: var(--bg-zebra);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp5);
  margin-bottom: var(--sp6);
  display: none;
}
.const-panel.open { display: block; }
.const-panel h3 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--navy-700);
  margin-bottom: var(--sp4);
}
.const-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: var(--sp4);
}
.const-item { display: flex; flex-direction: column; gap: 3px; }
.const-lbl {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--muted);
}

/* ---------- INICIO (home) ---------- */
.home-hero {
  background: linear-gradient(135deg, var(--navy-950) 0%, var(--navy-800) 100%);
  border-radius: var(--r-lg);
  padding: var(--sp12) var(--sp8);
  margin-bottom: var(--sp8);
  position: relative;
  overflow: hidden;
}
.home-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 32px 32px;
}
.home-hero-inner { position: relative; z-index: 1; }
.home-hero-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--orange);
  background: rgba(226,117,38,0.15);
  border: 1px solid var(--orange-border);
  border-radius: var(--r-pill);
  padding: 4px 12px;
  margin-bottom: var(--sp4);
}
.home-hero-title {
  font-family: var(--font-title);
  font-size: 36px;
  font-weight: 700;
  color: #fff;
  line-height: 1.15;
  margin-bottom: var(--sp4);
}
.home-hero-desc {
  font-size: 15px;
  color: rgba(255,255,255,0.70);
  max-width: 520px;
  line-height: 1.6;
}

.home-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp5);
  margin-bottom: var(--sp8);
}
.home-card {
  background: var(--bg-surface);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  box-shadow: var(--sh-card);
  padding: var(--sp6);
  cursor: pointer;
  transition: var(--tr);
  text-decoration: none;
  display: block;
}
.home-card:hover { box-shadow: var(--sh-raised); transform: translateY(-2px); border-color: var(--orange-border); }
.home-card-icon { font-size: 28px; margin-bottom: var(--sp3); }
.home-card-title {
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: 700;
  color: var(--navy-800);
  margin-bottom: var(--sp2);
  line-height: 1.2;
}
.home-card-desc { font-size: 13px; color: var(--muted); line-height: 1.5; }
.home-card-badge {
  display: inline-block;
  margin-top: var(--sp3);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  border-radius: var(--r-pill);
}
.badge-active { background: rgba(16,185,129,0.10); color: #059669; border: 1px solid rgba(5,150,105,0.25); }
.badge-soon { background: var(--navy-100); color: var(--muted); border: 1px solid var(--navy-border); }

/* ---------- PLACEHOLDER MODULO ---------- */
.placeholder-module {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  text-align: center;
  padding: var(--sp12);
}
.placeholder-icon { font-size: 52px; margin-bottom: var(--sp5); opacity: 0.4; }
.placeholder-title {
  font-family: var(--font-title);
  font-size: 22px;
  font-weight: 700;
  color: var(--navy-800);
  margin-bottom: var(--sp3);
}
.placeholder-desc { font-size: 14px; color: var(--muted); max-width: 380px; line-height: 1.6; }

/* ---------- CONFIGURACOES HT ---------- */
.ht-result {
  background: linear-gradient(135deg, var(--navy-950), var(--navy-800));
  border-radius: var(--r-md);
  padding: var(--sp6);
  margin-top: var(--sp4);
}
.ht-result-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: rgba(255,255,255,0.55);
  margin-bottom: var(--sp2);
}
.ht-result-value {
  font-family: var(--font-title);
  font-size: 36px;
  font-weight: 700;
  color: var(--orange);
  line-height: 1;
}
.ht-result-sub { font-size: 12px; color: rgba(255,255,255,0.50); margin-top: var(--sp2); }

/* ---------- SAVE BADGE ---------- */
.save-badge {
  display: none;
  position: fixed;
  bottom: var(--sp6);
  right: var(--sp6);
  align-items: center;
  gap: var(--sp2);
  background: var(--navy-800);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--r-pill);
  padding: 6px 16px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.05em;
  z-index: 300;
  box-shadow: var(--sh-raised);
}
.save-badge.show { display: flex; }

/* ---------- PRINT ---------- */
@media print {
  .app-sidebar,
  .app-topbar,
  .sidebar-overlay,
  .step-nav,
  .step-actions,
  .const-panel,
  .save-badge,
  .btn,
  .notice { display: none !important; }
  .proposta-wrap { display: block !important; }
  body { background: #fff; }
  #app-content { padding: 0; max-width: 100%; margin: 0; }
  .proposta { box-shadow: none; border: none; padding: 0; }
  @page { margin: 2cm; }
}

/* ---------- RESPONSIVE ---------- */

/* Tablet */
@media (max-width: 1024px) {
  #app-content { padding: var(--sp6); }
}

/* Mobile */
@media (max-width: 768px) {
  .app-topbar { display: flex; }
  .app-sidebar {
    transform: translateX(-100%);
    top: 0;
  }
  .app-sidebar.open { transform: translateX(0); }
  .app-content-wrap {
    margin-left: 0;
    padding-top: 52px;
  }
  #app-content { padding: var(--sp4); }
  .module-title { font-size: 22px; }
  .home-hero { padding: var(--sp8) var(--sp5); }
  .home-hero-title { font-size: 26px; }
  .models-grid { grid-template-columns: 1fr; }
  .fg { grid-template-columns: 1fr 1fr; }
  .assina { grid-template-columns: 1fr; }
  .proposta { padding: var(--sp8) var(--sp5); }
}

@media (max-width: 480px) {
  .fg { grid-template-columns: 1fr; }
  .const-grid { grid-template-columns: 1fr 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .home-cards { grid-template-columns: 1fr; }
  .step-tab { padding: var(--sp3); }
}

/* ---------- UTILS ---------- */
.mt2 { margin-top: var(--sp2); }
.mt4 { margin-top: var(--sp4); }
.mt6 { margin-top: var(--sp6); }
.mt8 { margin-top: var(--sp8); }
.mb4 { margin-bottom: var(--sp4); }
.mb6 { margin-bottom: var(--sp6); }
.fw7 { font-weight: 700; }
.fz12 { font-size: 12px; }
.fz11 { font-size: 11px; }
.clr-orange { color: var(--orange); }
.clr-navy { color: var(--navy-700); }
.clr-muted { color: var(--muted); }
.text-right { text-align: right; }

/* Foco acessivel */
:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* dica abaixo de campo de formulário */
.field .hint { display: block; margin-top: 4px; font-size: 12px; line-height: 1.4; color: var(--muted); }

/* botões dentro do cabeçalho navy dos cards (Todos / Limpar / Calcular rota) */
.sc-head .btn, .sc-head .btn-g { color: #fff; border-color: rgba(255,255,255,.55); background: transparent; }
.sc-head .btn:hover, .sc-head .btn-g:hover { background: rgba(255,255,255,.12); color: #fff; }

/* ícones 3D da navegação e dos cards do Início */
.nav-icon { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; }
.nav-icon-img { width: 28px; height: 28px; object-fit: contain; filter: drop-shadow(0 2px 3px rgba(0,0,0,.45)); transition: transform .18s ease; }
.nav-item:hover .nav-icon-img, .nav-item.active .nav-icon-img { transform: scale(1.12); }
.home-card-icon img { width: 64px; height: 64px; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(12,21,37,.25)); transition: transform .25s ease; }
.home-card:hover .home-card-icon img { transform: translateY(-3px) scale(1.06); }
@media (prefers-reduced-motion: reduce) { .nav-icon-img, .home-card-icon img { transition: none; } }

/* botão principal usado pelo Histórico (alias do .btn-p) */
.btn-primary { background: linear-gradient(135deg, #E27526, #C4561A); color: #fff; border: 1px solid transparent; box-shadow: 0 6px 16px rgba(226,117,38,.28); }
.btn-primary:hover { filter: brightness(1.06); transform: translateY(-1px); color: #fff; }

/* barra de passos: no celular, indica que rola para o lado */
@media (max-width: 768px) {
  .step-nav { mask-image: linear-gradient(to right, #000 calc(100% - 48px), rgba(0,0,0,.15)); -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 48px), rgba(0,0,0,.15)); }
}

/* seletor de período do Dashboard: compacto, na mesma linha do rótulo */
#dash-periodo { max-width: 320px; }


/* -------- ícones de traço (icons.js) -------- */
.av-ic { width: 1.15em; height: 1.15em; vertical-align: -0.2em; flex-shrink: 0; }
.btn .av-ic { margin-right: 2px; }
.hn-card-icon { color: var(--orange); }
.hn-card-icon .av-ic { width: 26px; height: 26px; }
.hn-card.selected .hn-card-icon, .hn-card:hover .hn-card-icon { color: #C4561A; }
.av-empty-icon { color: var(--navy-700, #26335E); }
.av-empty-icon .av-ic { width: 44px; height: 44px; stroke-width: 1.6; }
.luna-voice-btn .av-ic { width: 20px; height: 20px; }
.luna-fab .av-ic { width: 24px; height: 24px; }
.pr-modal-icon { color: var(--orange); display: flex; justify-content: center; }
.pr-modal-icon .av-ic { width: 56px; height: 56px; stroke-width: 1.6; }
/* medalha das conquistas: círculo navy com ícone laranja (cinza quando bloqueada) */
.ach-card-icon, .ach-overlay-icon, .ach-trophy-icon {
  width: 56px; height: 56px; border-radius: 50%; display: flex !important; align-items: center; justify-content: center;
  background: radial-gradient(circle at 30% 25%, #26335E, #0C1525 75%); color: #F08A3C;
  box-shadow: 0 6px 14px rgba(12,21,37,.22), inset 0 0 0 2px rgba(226,117,38,.45); font-size: 0 !important;
}
.ach-card-icon .av-ic { width: 26px; height: 26px; }
.ach-overlay-icon, .ach-trophy-icon { width: 96px; height: 96px; margin-left: auto; margin-right: auto; }
.ach-overlay-icon .av-ic, .ach-trophy-icon .av-ic { width: 46px; height: 46px; }
.ach-card.locked .ach-card-icon { background: #E6E9F2; color: #9AA3B5; box-shadow: inset 0 0 0 2px #D5DAE6; filter: none; }


/* -------- textos que não cabem: tabelas de custos, equipe, presets e conquistas -------- */
table.dt td.c-item input { min-width: 220px; width: 100%; }
table.dt td.c-cat input { width: 190px; }
#cfgBodyPresets input[type=text] { min-width: 200px; }
.ach-card-nome { overflow-wrap: anywhere; hyphens: auto; }
@media (max-width: 768px) {
  /* no celular a categoria já aparece no cabeçalho do grupo: cada linha vira grade item | valor | excluir */
  table.dt-custos, table.dt-custos tbody, table.dt-custos tfoot { display: block; width: 100%; }
  table.dt-custos thead { display: none; }
  /* linha do item: nome em cima (largura toda) e valor embaixo, excluir ao lado */
  table.dt-custos tr { display: grid; grid-template-columns: minmax(0, 1fr) 32px; grid-template-areas: "item del" "valor del"; align-items: center; gap: 6px 8px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
  table.dt-custos td.c-item { grid-area: item; }
  table.dt-custos td.c-valor { grid-area: valor; }
  table.dt-custos td.c-del { grid-area: del; }
  table.dt-custos tr.row-total { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: none; }
  table.dt-custos tr.row-cat { grid-template-columns: minmax(0, 1fr) 32px; }
  table.dt-custos td { display: block; border: 0; padding: 0; min-width: 0; }
  table.dt-custos td.c-cat { display: none; }
  table.dt-custos td.c-item input { min-width: 0; width: 100%; }
  table.dt-custos td.c-total { white-space: nowrap; }
  table.dt-custos .ig { min-width: 0; }
  table.dt-custos .ig input { min-width: 0; width: 100%; }
  .ach-card-nome { font-size: 11px; }
}

/* -------- ícones 3D de interface (Higgsfield) -------- */
.av-ic3d { object-fit: contain; filter: drop-shadow(0 1px 1.5px rgba(12,21,37,.28)); }
.btn .av-ic3d { width: 1.45em; height: 1.45em; vertical-align: -0.38em; }
.hn-card-icon .av-ic3d { width: 44px; height: 44px; }
.av-empty-icon .av-ic3d { width: 72px; height: 72px; opacity: 1; }
.av-empty-icon:has(.av-ic3d) { opacity: 1; }
.luna-voice-btn .av-ic3d { width: 24px; height: 24px; }
.pr-modal-icon .av-ic3d { width: 88px; height: 88px; }
/* medalhas das conquistas com ícone 3D: fundo claro para o navy do ícone aparecer */
.ach-card-icon:has(.av-ic3d), .ach-overlay-icon:has(.av-ic3d), .ach-trophy-icon:has(.av-ic3d) {
  background: radial-gradient(circle at 30% 25%, #FFFFFF, #F3EDE6 80%);
  box-shadow: 0 6px 14px rgba(12,21,37,.14), inset 0 0 0 2px rgba(226,117,38,.55);
}
.ach-card-icon .av-ic3d { width: 40px; height: 40px; }
.ach-overlay-icon .av-ic3d, .ach-trophy-icon .av-ic3d { width: 70px; height: 70px; }
.ach-card.locked .ach-card-icon:has(.av-ic3d) { background: #EEF0F5; box-shadow: inset 0 0 0 2px #D5DAE6; }
.ach-card.locked .ach-card-icon .av-ic3d { filter: grayscale(1); opacity: .45; }

/* no computador, aba que não cabe desce para a linha de baixo, em vez de sumir pela lateral */
@media (min-width: 769px) {
  .tab-bar { flex-wrap: wrap; overflow-x: visible; }
}

/* barras de abas que rolam de lado: esmaece a borda direita no celular para indicar que há mais abas */
@media (max-width: 768px) {
  .tab-bar, .av-tab-bar { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 44px), rgba(0,0,0,.12)); mask-image: linear-gradient(to right, #000 calc(100% - 44px), rgba(0,0,0,.12)); }
}


/* -------- Hora Técnica (módulo) e resumo nas Compras -------- */
.ht-resumo { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--orange); border-radius: var(--r-md); padding: 12px 16px; margin: 0 0 var(--sp5); box-shadow: var(--sh-card); }
.ht-resumo:empty { display: none; }
.ht-resumo > div { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline; }
.ht-resumo-lbl { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); width: 100%; }
.ht-resumo-val { font-size: 14px; color: var(--navy-800); }
.ht-resumo-val strong { color: var(--orange); }
.ht-resumo .btn { min-width: 0; }
.ht-expl { font-size: 13px; line-height: 1.6; color: var(--body); margin: 0 0 14px; max-width: 760px; }
.ht-final { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px; padding: 16px 18px; border-radius: var(--r-md); background: linear-gradient(135deg, #0C1525, #162247); }
.ht-final-lbl { color: rgba(255,255,255,.75); font-size: 13px; font-weight: 600; }
.ht-final-val { color: #F3A56B; font-family: Montserrat, sans-serif; font-weight: 700; font-size: 28px; }
.field[hidden] { display: none; }

/* -------- edição direta no card do modelo (saving, % sobre orçados) -------- */
.mod-edit { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); font-size: 12px; font-weight: 600; color: var(--navy-800); cursor: default; }
.mod-edit .ig { max-width: 110px; }
.mod-edit input { text-align: right; font-weight: 700; }

/* -------- valores em fonte limpa (pedido da Thaline: destacar melhor o valor) -------- */
.mod-val, .prop-valor { font-family: Montserrat, sans-serif; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
#htPasso3 .fg select { min-width: 0; width: 100%; }
#htPasso3 .fg { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
