:root {
  --bg: #0a0d12;
  --card: #141a22;
  --ink: #e7ebf2;
  --muted: #9aa3b2;
  --line: rgba(255, 255, 255, .10);
  --primary: #2ecc71;
  --primary-d: #25a25a;
  --danger: #f87171;
  --ok: #2ecc71;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
[x-cloak] { display: none !important; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  font-size: 15px;
  /* Contexto AxysPro: malha de planta baixa + brilho verde sutil (CSS puro, não pesa) */
  background-color: var(--bg);
  background-image:
    radial-gradient(70% 55% at 100% 0%, rgba(46, 204, 113, .06), transparent 60%),
    radial-gradient(55% 45% at 0% 100%, rgba(46, 204, 113, .045), transparent 55%),
    linear-gradient(rgba(255, 255, 255, .02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .02) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 44px 44px, 44px 44px;
  background-attachment: fixed;
}

h1, h2, h3 { margin: 0 0 .4em; }
.muted { color: var(--muted); }
.center { display: grid; place-items: center; min-height: 100vh; }
.r { text-align: right; }

/* ── Spinner ── */
.spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--primary);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Brand ── */
.brand { font-weight: 800; letter-spacing: -.5px; font-size: 1.8rem; }
.brand span { color: var(--primary); }
.brand.sm { font-size: 1.2rem; }

/* ── Botões ── */
.btn {
  border: 1px solid var(--line); background: rgba(255, 255, 255, .05); color: var(--ink);
  padding: 8px 14px; border-radius: 8px; cursor: pointer; font-size: .9rem;
  transition: background .15s, border-color .15s;
}
.btn:hover { background: rgba(255, 255, 255, .10); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #06140c; font-weight: 600; }
.btn.primary:hover { background: var(--primary-d); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.danger { color: var(--danger); border-color: rgba(248, 113, 113, .4); background: rgba(248, 113, 113, .08); }
.btn.danger:hover { background: rgba(248, 113, 113, .16); }
.btn.sm { padding: 4px 10px; font-size: .82rem; }
.btn.block { width: 100%; margin-top: 8px; }

/* ── Inputs ── */
.inp {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line);
  border-radius: 8px; font-size: .92rem; background: rgba(255, 255, 255, .05); color: var(--ink);
}
.inp::placeholder { color: #6b7488; }
.inp option { background: #161b22; color: var(--ink); }
.inp:focus { outline: 2px solid color-mix(in srgb, var(--primary) 30%, transparent); border-color: var(--primary); }
.w-qtd { max-width: 90px; }
.w-val { max-width: 130px; }
label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 10px; }
label .inp, label select, label textarea { margin-top: 4px; }

/* ── Auth ── */
.auth-wrap { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.auth-card {
  background: var(--card); padding: 32px; border-radius: var(--radius);
  box-shadow: var(--shadow); width: 100%; max-width: 380px;
}
.auth-card .inp { margin-bottom: 10px; }
.tabs { display: flex; gap: 6px; margin: 18px 0 14px; }
.tabs button {
  flex: 1; padding: 8px; border: none; background: rgba(255, 255, 255, .05); border-radius: 8px;
  cursor: pointer; color: var(--muted);
}
.tabs button.active { background: var(--primary); color: #06140c; }

/* ── Layout logado ── */
.topbar {
  display: flex; align-items: center; gap: 20px; padding: 12px 24px;
  background: var(--card); border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
  position: sticky; top: 0; z-index: 10;
}
.topbar nav { display: flex; gap: 6px; }
.topbar nav button {
  border: none; background: transparent; padding: 8px 14px; border-radius: 8px;
  cursor: pointer; color: var(--muted); font-size: .92rem;
}
.topbar nav button.active { background: rgba(46, 204, 113, .15); color: var(--primary); font-weight: 600; }
.user-box { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.content { max-width: 1000px; margin: 0 auto; padding: 28px 24px; }

.card { background: var(--card); padding: 22px; border-radius: var(--radius); box-shadow: var(--shadow); margin-top: 14px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row-end { display: flex; justify-content: flex-end; margin-top: 16px; }
.form-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 14px; }

/* ── Tabelas ── */
.grid { width: 100%; border-collapse: collapse; margin-top: 14px; background: var(--card); }
.grid th, .grid td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.grid th { font-size: .78rem; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.grid.items td { padding: 6px 8px; }
.grid .actions { display: flex; gap: 6px; justify-content: flex-end; }
.grid tfoot .total { font-weight: 700; font-size: 1.05rem; }
.add-row { display: flex; gap: 10px; margin-top: 12px; align-items: center; }
.empty { padding: 30px 0; text-align: center; }

/* ── Badges de status ── */
.badge { padding: 3px 9px; border-radius: 99px; font-size: .76rem; font-weight: 600; }
.badge.rascunho { background: #f3f4f6; color: #4b5563; }
.badge.enviado { background: #dbeafe; color: #1d4ed8; }
.badge.aprovado { background: #dcfce7; color: #15803d; }
.badge.recusado { background: #fee2e2; color: #b91c1c; }

/* ── Gate ── */
.gate { text-align: center; padding: 60px 20px; }
.gate h2 { color: var(--danger); }

/* ── Flash ── */
.flash {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  padding: 11px 20px; border-radius: 10px; color: #fff; z-index: 50; box-shadow: var(--shadow);
}
.flash.ok { background: var(--ok); }
.flash.err { background: var(--danger); }

@media (max-width: 720px) {
  .form-grid { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; }
  .content { padding: 16px; }
}

/* ══════════════════════════════════════════════════════════════════════════
   LOGIN — tema escuro com vídeo de fundo (cores da marca AXYSpro)
   ══════════════════════════════════════════════════════════════════════════ */
:root {
  --axys-green: #2ecc71;
  --axys-green-d: #25a25a;
}

.login-screen {
  position: fixed; inset: 0; display: grid; place-items: center;
  padding: 24px; overflow: hidden; background: #0a0d12;
}

/* Vídeo cobrindo a tela toda */
.login-bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 0; filter: saturate(1.05);
}

/* Camada escura por cima do vídeo (legibilidade + clima premium) */
.login-overlay {
  position: absolute; inset: 0; z-index: 1;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(46,204,113,.10), transparent 60%),
    linear-gradient(180deg, rgba(6,9,13,.72) 0%, rgba(6,9,13,.86) 100%);
}

/* Card de vidro */
.login-card {
  position: relative; z-index: 2; width: 100%; max-width: 400px;
  padding: 34px 32px 26px;
  background: rgba(16, 20, 27, .66);
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 20px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .06);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  animation: card-in .5s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

/* Logo (selo circular) */
.login-logo {
  display: block; width: 116px; height: 116px; margin: 0 auto 18px;
  border-radius: 50%; object-fit: cover;
  border: 2px solid rgba(46, 204, 113, .45);
  box-shadow: 0 0 0 6px rgba(46, 204, 113, .08), 0 10px 30px rgba(0, 0, 0, .5);
}

/* Selo "Axys Pro [ERP]" — deixa explícito que esta página é o ERP */
.erp-tag {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: -4px 0 16px;
}
.erp-tag span {
  color: #c8cdd6; font-size: .74rem; font-weight: 700;
  letter-spacing: 2.5px; text-transform: uppercase;
}
.erp-tag b {
  background: linear-gradient(180deg, var(--axys-green), var(--axys-green-d));
  color: #06140c; font-size: .7rem; font-weight: 800; letter-spacing: 1.5px;
  padding: 2px 9px; border-radius: 6px;
  box-shadow: 0 4px 12px rgba(46, 204, 113, .3);
}

.login-title {
  text-align: center; color: #fff; font-size: 1.25rem; font-weight: 700;
  margin: 4px 0 18px; letter-spacing: -.3px;
}

/* Abas no tema escuro */
.tabs.dark { margin: 0 0 18px; }
.tabs.dark button {
  background: rgba(255, 255, 255, .05); color: #c8cdd6;
  border: 1px solid rgba(255, 255, 255, .08);
}
.tabs.dark button.active {
  background: linear-gradient(180deg, var(--axys-green), var(--axys-green-d));
  color: #06140c; font-weight: 700; border-color: transparent;
}

/* Campos */
.login-card .field { margin-bottom: 14px; }
.login-card label {
  color: #aeb6c2; font-size: .8rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .4px; margin-bottom: 6px;
}
.login-card .inp {
  background: rgba(255, 255, 255, .06); color: #fff;
  border: 1px solid rgba(255, 255, 255, .12); padding: 12px 13px; margin: 0;
}
.login-card .inp::placeholder { color: #7c8595; }
.login-card .inp:focus {
  border-color: var(--axys-green);
  outline: 2px solid rgba(46, 204, 113, .25);
  background: rgba(255, 255, 255, .09);
}

/* Senha com botão de olho */
.pass-wrap { position: relative; }
.pass-wrap .inp { padding-right: 46px; }
.eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border: none; background: transparent;
  cursor: pointer; font-size: 1.05rem; border-radius: 8px; line-height: 1;
}
.eye:hover { background: rgba(255, 255, 255, .08); }

/* Botão principal (verde da marca) */
.btn-login {
  width: 100%; margin-top: 8px; padding: 13px; border: none; cursor: pointer;
  border-radius: 10px; font-size: 1rem; font-weight: 700; color: #06140c;
  background: linear-gradient(180deg, var(--axys-green), var(--axys-green-d));
  box-shadow: 0 8px 22px rgba(46, 204, 113, .28);
  transition: transform .12s, box-shadow .12s, filter .12s;
}
.btn-login:hover { filter: brightness(1.06); box-shadow: 0 10px 28px rgba(46, 204, 113, .38); }
.btn-login:active { transform: translateY(1px); }

.login-foot {
  text-align: center; color: #7c8595; font-size: .72rem;
  text-transform: uppercase; letter-spacing: 1.5px; margin: 18px 0 0;
}

@media (max-width: 480px) {
  .login-card { padding: 26px 20px 20px; }
  .login-logo { width: 96px; height: 96px; }
}

/* ══════════════════════════════════════════════════════════════════════════
   ÁREA LOGADA — topbar e HOME MODULAR (tema escuro)
   ══════════════════════════════════════════════════════════════════════════ */

/* Logo-texto no topbar: AXYSpro com "ERP" embaixo */
.brand small {
  display: block; font-size: .58rem; font-weight: 700; letter-spacing: 4px;
  color: var(--muted); margin-top: -3px;
}
.topbar { backdrop-filter: blur(8px); }

/* Selo PRO */
.pro-badge {
  background: rgba(46, 204, 113, .15); color: var(--axys-green);
  border: 1px solid rgba(46, 204, 113, .4);
  font-size: .64rem; font-weight: 800; letter-spacing: 1px;
  padding: 2px 8px; border-radius: 6px;
}

/* Home */
.home { max-width: 1140px; margin: 0 auto; }
.home-hi {
  font-size: 2rem; font-weight: 800; color: #fff;
  letter-spacing: -.6px; margin: 6px 0 4px;
}
.home-sub { color: var(--muted); margin: 0 0 24px; }
.home-group {
  color: var(--muted); font-size: .72rem; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase; margin: 28px 0 14px;
}

.mod-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px;
}
.mod-card {
  position: relative; overflow: hidden;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 20px 22px; transition: transform .18s, border-color .18s, box-shadow .18s;
  animation: mod-in .45s cubic-bezier(.2, .8, .2, 1) both;
}
/* Brilho verde que cruza o card no hover */
.mod-card.active::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(120% 80% at 50% -10%, rgba(46, 204, 113, .16), transparent 60%);
  transition: opacity .2s;
}
.mod-card.active { cursor: pointer; }
.mod-card.active:hover {
  transform: translateY(-4px); border-color: rgba(46, 204, 113, .55);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .5);
}
.mod-card.active:hover::after { opacity: 1; }
.mod-card.active:active { transform: translateY(-1px); }
.mod-card.soon { opacity: .5; }
.mod-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; }

/* Ícone em tile quadrado */
.mod-ico {
  display: grid; place-items: center; width: 48px; height: 48px;
  border-radius: 13px; font-size: 1.5rem; line-height: 1;
  background: rgba(255, 255, 255, .06); border: 1px solid var(--line);
  transition: transform .18s;
}
.mod-card.active .mod-ico {
  background: linear-gradient(135deg, rgba(46, 204, 113, .28), rgba(46, 204, 113, .07));
  border-color: rgba(46, 204, 113, .38);
}
.mod-card.active:hover .mod-ico { transform: scale(1.08) rotate(-3deg); }

/* Entrada em sequência (stagger) */
.mod-grid .mod-card:nth-child(2) { animation-delay: .07s; }
.mod-grid .mod-card:nth-child(3) { animation-delay: .14s; }
.mod-grid .mod-card:nth-child(4) { animation-delay: .21s; }
@keyframes mod-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
.mod-card h3 { color: #fff; font-size: 1.12rem; margin: 0 0 6px; }
.mod-card p { color: var(--muted); font-size: .9rem; line-height: 1.45; margin: 0; }
.mod-cta {
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line);
  color: var(--axys-green); font-weight: 700; font-size: .92rem;
}
.mod-badge {
  font-size: .64rem; font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
  padding: 3px 9px; border-radius: 99px;
}
.mod-badge.ok { background: rgba(46, 204, 113, .15); color: var(--axys-green); border: 1px solid rgba(46, 204, 113, .4); }
.mod-badge.soon { background: rgba(139, 124, 246, .14); color: #a99bf5; border: 1px solid rgba(139, 124, 246, .4); }
.mod-badge.future { background: rgba(255, 255, 255, .06); color: var(--muted); border: 1px solid var(--line); }

/* ══════════════════════════════════════════════════════════════════════════
   MÓDULO ORÇAMENTOS — layout com barra lateral
   ══════════════════════════════════════════════════════════════════════════ */
.erp-layout { display: grid; grid-template-columns: 268px 1fr; min-height: 100vh; }

.erp-side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: #0c1016; border-right: 1px solid var(--line);
  padding: 22px 16px; display: flex; flex-direction: column; gap: 14px;
}
.side-brand { text-align: center; font-weight: 800; font-size: 1.45rem; letter-spacing: -.5px; color: var(--ink); }
.side-brand span { color: var(--axys-green); }
.side-brand small { display: block; font-size: .55rem; font-weight: 700; letter-spacing: 4px; color: var(--muted); margin-top: -2px; }

.side-user { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 14px 4px; display: flex; flex-direction: column; gap: 10px; }
.side-user-row { display: flex; align-items: center; gap: 8px; }
.side-user-row b { color: #fff; font-size: .95rem; }
.side-ava { font-size: 1.05rem; }
.side-user .pro-badge { margin-left: auto; }
.side-quota-top { display: flex; justify-content: space-between; font-size: .76rem; color: var(--muted); margin-bottom: 6px; }
.side-bar { height: 6px; background: rgba(255, 255, 255, .08); border-radius: 99px; overflow: hidden; }
.side-bar-fill { height: 100%; background: linear-gradient(90deg, var(--axys-green), var(--axys-green-d)); border-radius: 99px; transition: width .3s; }

.side-back {
  background: rgba(255, 255, 255, .05); border: 1px solid var(--line); color: var(--ink);
  padding: 9px 12px; border-radius: 10px; cursor: pointer; font-size: .86rem; text-align: left;
}
.side-back:hover { background: rgba(255, 255, 255, .1); }

.side-group { color: var(--muted); font-size: .7rem; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; margin-top: 4px; }
.side-nav { display: flex; flex-direction: column; gap: 6px; }
.side-nav button {
  display: flex; align-items: center; gap: 11px; text-align: left;
  background: transparent; border: 1px solid transparent; color: #c8cdd6;
  padding: 11px 12px; border-radius: 10px; cursor: pointer; font-size: .92rem;
  transition: background .15s, border-color .15s, color .15s;
}
.side-nav button .si { font-size: 1.05rem; width: 20px; text-align: center; }
.side-nav button:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.side-nav button.active {
  background: linear-gradient(135deg, rgba(46, 204, 113, .18), rgba(46, 204, 113, .04));
  border-color: rgba(46, 204, 113, .35); color: #fff; font-weight: 600;
}
.side-foot { margin-top: auto; color: var(--muted); font-size: .76rem; padding-top: 14px; border-top: 1px solid var(--line); }

.erp-content { padding: 30px 36px; max-width: 1180px; }
.erp-content h2 { color: #fff; }

/* ── Novo Orçamento (visual do chat com IA) ────────────────────────────────── */
.ia-msg { display: flex; gap: 13px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; margin: 8px 0 16px; }
.ia-ava { font-size: 1.5rem; line-height: 1.2; }
.ia-text p { margin: 0 0 9px; color: #cdd3dd; line-height: 1.55; }
.ia-text p:last-child { margin-bottom: 0; }
.ia-text b { color: #fff; }

.upload-box {
  display: flex; align-items: center; gap: 14px; cursor: pointer;
  background: var(--card); border: 1px dashed var(--line); border-radius: 12px;
  padding: 14px 18px; margin-bottom: 16px; transition: border-color .15s;
}
.upload-box:hover { border-color: rgba(46, 204, 113, .45); }

.novo-fields { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; margin-bottom: 16px; }
.novo-chips { color: var(--muted); font-size: .86rem; margin-bottom: 12px; }
.novo-chips span { color: #c8cdd6; font-weight: 600; }
.novo-fields .form-grid { grid-template-columns: 1fr 1fr 1fr; }

.salvar-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin: 8px 0; padding: 10px 14px; border: 1px solid rgba(46, 204, 113, .35);
  border-radius: 12px; background: rgba(46, 204, 113, .08); }
.chat-input { display: flex; gap: 10px; align-items: flex-end; position: sticky; bottom: 0; background: var(--bg); padding: 12px 0 4px; }
.chat-input .inp { flex: 1; }
.chat-ta { resize: none; overflow-y: auto; min-height: 46px; max-height: 200px; line-height: 1.45;
  font-family: inherit; padding-top: 11px; padding-bottom: 11px; }
.chat-input .btn.primary { width: 48px; font-size: 1.1rem; }

/* ── Placeholder "em construção" ──────────────────────────────────────────── */
.build-note { text-align: center; padding: 44px 24px; }
.build-ico { font-size: 2.6rem; margin-bottom: 10px; }
.build-note h3 { color: #fff; margin-bottom: 6px; }

@media (max-width: 760px) {
  .erp-layout { grid-template-columns: 1fr; }
  .erp-side { position: static; height: auto; flex-direction: column; }
  .erp-content { padding: 20px 16px; }
  .novo-fields .form-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════════════════════
   WORKSPACE BENTO — trilho de ícones + grid de cards
   ══════════════════════════════════════════════════════════════════════════ */
.erp-shell { display: grid; grid-template-columns: 74px 1fr; min-height: 100vh; }

/* Trilho de ícones (recolhido por padrão, expansível) */
.rail {
  position: sticky; top: 0; height: 100vh; z-index: 20; width: 74px;
  background: #0c1016; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 0;
  transition: width .18s ease;
}
/* Ao aproximar o mouse, o trilho expande (sobreposto, sem empurrar o conteúdo) */
.rail:hover { width: 234px; align-items: stretch; padding: 14px 12px; box-shadow: 24px 0 50px rgba(0, 0, 0, .5); }

.rail-logo {
  width: 44px; height: 44px; border-radius: 13px; border: none; cursor: pointer; flex: none;
  display: flex; align-items: center; justify-content: center; gap: 0; padding: 0;
  color: #06140c; margin-bottom: 10px;
  background: linear-gradient(135deg, var(--axys-green), var(--axys-green-d));
  box-shadow: 0 6px 16px rgba(46, 204, 113, .3);
}
.rail-logo .ri { font-weight: 800; color: #06140c; }
.rail:hover .rail-logo { width: 100%; height: 46px; justify-content: flex-start; padding: 0 13px; }

.rail-nav { display: flex; flex-direction: column; gap: 6px; align-items: stretch; width: 100%; }
.rail-nav button, .rail-back {
  position: relative; height: 48px; display: flex; align-items: center; gap: 0;
  justify-content: center; padding: 0;
  border: 1px solid transparent; background: transparent; border-radius: 13px;
  cursor: pointer; color: #c8cdd6; transition: background .15s, color .15s, border-color .15s;
}
.rail .ri { font-size: 1.25rem; line-height: 1; width: 24px; text-align: center; flex: none; }
.rail-nav button:hover, .rail-back:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.rail-nav button.active {
  background: linear-gradient(135deg, rgba(46, 204, 113, .22), rgba(46, 204, 113, .05));
  border-color: rgba(46, 204, 113, .4); color: #fff;
}
.rail-nav button.active::before {
  content: ""; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 22px; border-radius: 99px; background: var(--axys-green);
}
.rail-back { margin-top: auto; }

/* Expandido: botões largos com rótulo ao lado */
.rail:hover .rail-nav button, .rail:hover .rail-back { justify-content: flex-start; padding: 0 13px; }
.rail:hover .rail-nav button.active::before { left: 0; }

/* Rótulos: ocultos no modo fino, deslizam pra dentro ao expandir */
.rail label {
  white-space: nowrap; font-size: .92rem; color: inherit; cursor: pointer;
  max-width: 0; margin-left: 0; overflow: hidden; opacity: 0;
  transition: opacity .15s ease, max-width .18s ease, margin-left .18s ease;
}
.rail:hover label { max-width: 160px; margin-left: 12px; opacity: 1; }
.rail:hover .rail-logo label { color: #06140c; font-weight: 700; font-size: .9rem; }

/* Área principal */
.erp-main { min-width: 0; }
.erp-top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 15px 30px; background: rgba(10, 13, 18, .82);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.erp-bread { display: flex; align-items: center; gap: 10px; }
.erp-bread .muted { font-size: .85rem; }
.erp-sep { color: var(--muted); }
.erp-title { color: #fff; font-size: 1.25rem; margin: 0; }
.erp-body { padding: 26px 30px; max-width: 1180px; }

/* Grid bento */
.bento { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; grid-auto-flow: dense; }
.bento-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px;
  cursor: pointer; transition: transform .16s, border-color .16s, box-shadow .16s;
  animation: mod-in .45s cubic-bezier(.2, .8, .2, 1) both;
}
.bento-card:hover { transform: translateY(-3px); border-color: rgba(46, 204, 113, .45); box-shadow: 0 16px 36px rgba(0, 0, 0, .45); }
.bento-card.span2 { grid-column: span 2; }
.bento-card h3 { color: #fff; font-size: 1.2rem; margin: 8px 0 6px; }
.bento-card h4 { color: #fff; font-size: 1rem; margin: 0 0 4px; }
.bento-card p { color: var(--muted); font-size: .9rem; line-height: 1.45; margin: 0; }

.bento-ico {
  width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center;
  font-size: 1.7rem; background: rgba(255, 255, 255, .06); border: 1px solid var(--line);
}
.bento-ico.sm { width: 44px; height: 44px; font-size: 1.4rem; margin-bottom: 10px; }

/* Herói */
.bento-card.hero {
  grid-column: span 2; display: flex; flex-direction: column;
  background: linear-gradient(135deg, rgba(46, 204, 113, .16), rgba(20, 26, 34, .55));
  border-color: rgba(46, 204, 113, .3);
}
.bento-card.hero .bento-ico {
  background: linear-gradient(135deg, var(--axys-green), var(--axys-green-d));
  border: none; box-shadow: 0 8px 20px rgba(46, 204, 113, .3);
}
.bento-cta { margin-top: auto; padding-top: 14px; color: var(--axys-green); font-weight: 700; font-size: .95rem; }
.bento-cta.sm { padding-top: 0; font-size: .84rem; }

/* KPI */
.bento-card.stat, .bento-card.mini { display: flex; flex-direction: column; justify-content: center; }
.bento-label { color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: 1px; }
.bento-kpi { color: #fff; font-size: 1.7rem; font-weight: 800; margin: 6px 0 2px; display: block; }
.bento-sub { color: var(--muted); font-size: .82rem; }

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

/* Funil de status */
.funnel { display: flex; flex-direction: column; gap: 9px; }
.funnel-row { display: grid; grid-template-columns: 92px 1fr 28px; align-items: center; gap: 10px; }
.funnel-bar { height: 8px; background: rgba(255, 255, 255, .07); border-radius: 99px; overflow: hidden; }
.funnel-fill { height: 100%; border-radius: 99px; background: var(--axys-green); transition: width .4s; min-width: 2px; }
.funnel-fill.rascunho { background: #6b7280; }
.funnel-fill.enviado  { background: #3b82f6; }
.funnel-fill.aprovado { background: #22c55e; }
.funnel-fill.recusado { background: #ef4444; }
.funnel-n { color: #fff; font-weight: 700; text-align: right; font-size: .9rem; }

/* Recentes */
.recent { list-style: none; margin: 0; padding: 0; }
.recent li { display: grid; grid-template-columns: 1.4fr 1fr auto auto; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.recent li:first-child { border-top: none; }
.recent-cli { color: #fff; font-weight: 600; }
.recent .muted { font-size: .85rem; }
.recent li b { color: #fff; text-align: right; }

/* ══════════════════════════════════════════════════════════════════════════
   PROSPECÇÃO — clientes pendentes
   ══════════════════════════════════════════════════════════════════════════ */
.prosp-add { padding: 0; overflow: hidden; }
.prosp-add-toggle {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 16px 20px;
  background: transparent; border: none; color: #fff; cursor: pointer; font-size: 1rem; text-align: left;
}
.prosp-add-toggle:hover { background: rgba(255, 255, 255, .03); }
.pat-ico { color: var(--axys-green); font-size: 1.3rem; font-weight: 800; width: 20px; }

.prosp-form { padding: 4px 20px 20px; border-top: 1px solid var(--line); }
.pf-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; margin-top: 14px; }
.pf-grid .pf-wide { grid-column: auto; }
.pf-label { display: block; color: var(--muted); font-size: .82rem; margin: 14px 0 8px; }

/* Stepper de número */
.stepper { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.stepper input { text-align: center; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper button {
  width: 38px; height: 38px; flex: none; border: 1px solid var(--line); border-radius: 9px;
  background: rgba(255, 255, 255, .05); color: #fff; font-size: 1.1rem; cursor: pointer;
}
.stepper button:hover { background: rgba(46, 204, 113, .15); border-color: rgba(46, 204, 113, .4); }

.pf-amb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.pf-amb-item { display: flex; align-items: center; gap: 6px; }
.pf-amb-item .inp { flex: 1; min-width: 0; }
.pf-amb-x {
  flex: none; width: 30px; height: 30px; border-radius: 8px; cursor: pointer;
  background: rgba(248, 113, 113, .10); border: 1px solid rgba(248, 113, 113, .35);
  color: var(--danger); font-size: .9rem; line-height: 1; display: grid; place-items: center;
}
.pf-amb-x:hover { background: var(--danger); color: #fff; }

/* Lista */
.prosp-count { color: #fff; margin: 26px 0 14px; }
.prosp-count b { color: var(--axys-green); }
.prosp-list { display: flex; flex-direction: column; gap: 12px; }
.prosp-item {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 20px;
  transition: border-color .15s, transform .15s;
}
.prosp-item:hover { border-color: rgba(46, 204, 113, .35); transform: translateX(2px); }
.prosp-info h4 { color: #fff; margin: 0 0 8px; font-size: 1.05rem; }
.prosp-meta { display: flex; flex-wrap: wrap; gap: 16px; color: var(--muted); font-size: .88rem; }
.prosp-meta span span { color: #c8cdd6; }
.prosp-date { display: block; color: #6b7488; font-size: .8rem; margin-top: 8px; }
.prosp-obs { color: #c8cdd6; font-size: .86rem; margin-top: 8px; font-style: italic; }
.prosp-actions { display: flex; gap: 8px; flex: none; }
.icon-btn {
  width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 11px;
  background: rgba(255, 255, 255, .04); cursor: pointer; font-size: 1.05rem;
  transition: background .15s, border-color .15s;
}
.icon-btn:hover { background: rgba(46, 204, 113, .15); border-color: rgba(46, 204, 113, .4); }
.icon-btn.danger:hover { background: rgba(248, 113, 113, .15); border-color: rgba(248, 113, 113, .45); }

@media (max-width: 620px) {
  .pf-grid { grid-template-columns: 1fr; }
  .prosp-item { flex-direction: column; align-items: stretch; }
  .prosp-actions { justify-content: flex-end; }
}

/* ══════════════════════════════════════════════════════════════════════════
   MEUS CUSTOS — accordion
   ══════════════════════════════════════════════════════════════════════════ */
.custos { max-width: 1100px; }
.acc { background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; overflow: hidden; }
.acc-head {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 16px 20px;
  background: transparent; border: none; color: #fff; cursor: pointer; font-size: 1rem; text-align: left;
}
.acc-head:hover { background: rgba(255, 255, 255, .03); }
.acc-arw { color: var(--axys-green); width: 16px; font-size: .9rem; }
.acc-count { color: var(--muted); font-size: .85rem; margin-left: 4px; }
.acc-body { padding: 4px 20px 20px; border-top: 1px solid var(--line); }
.acc-body.no-pad { padding: 0; }
.acc-body h4 { color: #fff; margin: 18px 0 10px; font-size: .95rem; }

/* Dados da empresa */
.emp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 14px 0; }
.emp-grid label, .acc-body label.full { display: block; color: var(--muted); font-size: .82rem; }
.emp-grid label .inp { margin-top: 5px; }
.acc-body label.full { margin-top: 14px; }
.acc-body label.full .inp { margin-top: 5px; }

/* Radios */
.radio { display: flex; align-items: flex-start; gap: 10px; color: #d3d8e0; font-size: .92rem; padding: 7px 0; cursor: pointer; }
.radio input[type=radio] { margin-top: 3px; accent-color: var(--axys-green); width: 16px; height: 16px; flex: none; }
.inp-mini { width: 58px; display: inline-block; padding: 2px 6px; margin: 0 2px; text-align: center; }
.obs-edit { width: 100%; min-height: 320px; resize: vertical; line-height: 1.55; font-size: .96rem;
  font-family: inherit; white-space: pre-wrap; }
.sobre-edit { width: 100%; min-height: 360px; resize: vertical; line-height: 1.6; font-size: 1.02rem;
  font-family: inherit; padding: 14px 16px; }

/* Linhas de custo */
.custo-row {
  display: grid; grid-template-columns: 1.6fr 1fr 110px auto auto; align-items: center; gap: 14px;
  padding: 12px 20px; border-bottom: 1px solid var(--line);
}
.cr-name b { color: #fff; display: block; }
.cr-name .muted { font-size: .8rem; }
.cr-unid { font-size: .9rem; }
/* campos editáveis inline: parecem texto, viram input no hover/foco */
.inp-inline {
  width: 100%; background: transparent; border: 1px solid transparent; color: var(--ink);
  border-radius: 7px; padding: 4px 7px; font: inherit; transition: border-color .12s, background .12s;
}
.inp-inline::placeholder { color: var(--muted); opacity: .6; }
.inp-inline:hover { border-color: var(--line); background: rgba(255, 255, 255, .03); }
.inp-inline:focus { border-color: rgba(46, 204, 113, .6); background: #0c1016; outline: none; }
.cr-name .cr-chave { color: #fff; font-weight: 700; }
.cr-name .cr-obs { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.cr-unid .inp-inline { color: var(--muted); }
.cr-disp { color: var(--axys-green); font-weight: 700; font-size: .95rem; text-align: right; }
.cr-edit { display: flex; align-items: center; gap: 6px; }
.cr-edit .w-val { width: 92px; max-width: 92px; }
.stp { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255, 255, 255, .05); color: #fff; cursor: pointer; font-size: 1.05rem; flex: none; }
.stp:hover { background: rgba(46, 204, 113, .15); border-color: rgba(46, 204, 113, .4); }

/* Adicionar item */
.add-item { display: flex; align-items: center; gap: 10px; padding: 14px 20px; flex-wrap: wrap; border-top: 1px solid var(--line); }
.add-label { color: var(--axys-green); font-weight: 600; font-size: .88rem; }
.add-item .inp { flex: 1; min-width: 110px; }
.add-item .w-val { flex: none; width: 100px; }
.add-ok { width: 44px; flex: none; }

/* Adicionar seção */
.add-grupo { display: flex; gap: 10px; margin: 8px 0 16px; }
.add-grupo .inp { max-width: 360px; }

/* Perfil de produtividade */
.perfil-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 8px; }
.perfil-resumo { margin-top: 18px; padding: 14px 16px; background: rgba(46, 204, 113, .08); border: 1px solid rgba(46, 204, 113, .25); border-radius: 10px; color: #d3d8e0; }
.perfil-resumo b { color: #fff; }

@media (max-width: 680px) {
  .emp-grid, .perfil-grid { grid-template-columns: 1fr; }
  .custo-row { grid-template-columns: 1fr auto; gap: 8px; }
  .cr-unid, .cr-disp { display: none; }
}

/* ══════════════════════════════════════════════════════════════════════════
   NOVO ORÇAMENTO — chat com a IA
   ══════════════════════════════════════════════════════════════════════════ */
.chat-stream {
  display: flex; flex-direction: column; gap: 14px;
  min-height: 240px; max-height: 58vh; overflow-y: auto;
  padding: 18px; margin: 4px 0 12px;
  background: rgba(0, 0, 0, .18); border: 1px solid var(--line); border-radius: 14px;
}
.chat-row { display: flex; }
.chat-row.user { justify-content: flex-end; }
.chat-row.assistant { justify-content: flex-start; }
.chat-bubble {
  max-width: 86%; padding: 13px 16px; border-radius: 14px; font-size: .93rem; line-height: 1.5;
  border: 1px solid var(--line);
}
.chat-row.user .chat-bubble { background: linear-gradient(135deg, rgba(46, 204, 113, .18), rgba(46, 204, 113, .06)); border-color: rgba(46, 204, 113, .3); color: #eaf6ee; }
.chat-row.assistant .chat-bubble { background: var(--card); color: #d6dbe3; }
.user-text { white-space: pre-wrap; }

/* Markdown da IA */
.md :first-child { margin-top: 0; }
.md :last-child { margin-bottom: 0; }
.md p { margin: 0 0 10px; color: #d6dbe3; }
.md h1, .md h2, .md h3, .md h4 { color: #fff; margin: 14px 0 8px; }
.md strong, .md b { color: #fff; }
.md ul, .md ol { margin: 0 0 10px; padding-left: 20px; }
.md code { background: rgba(255, 255, 255, .08); padding: 1px 5px; border-radius: 5px; font-size: .88em; }
.md table { border-collapse: collapse; width: 100%; margin: 10px 0; font-size: .86rem; }
.md th, .md td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; }
.md th { background: rgba(255, 255, 255, .06); color: #fff; font-weight: 700; }
.md tr:nth-child(even) td { background: rgba(255, 255, 255, .025); }

/* "Digitando" */
.chat-bubble.typing { display: flex; gap: 5px; align-items: center; }
.chat-bubble.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--axys-green); opacity: .5; animation: blink 1.2s infinite; }
.chat-bubble.typing span:nth-child(2) { animation-delay: .2s; }
.chat-bubble.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }

/* Streaming ao vivo: indicador de fase + cursor piscando */
.ia-phase { display: flex; align-items: center; gap: 9px; color: #9fb0c2; font-size: .9rem; font-style: italic; }
.typing-inline { display: inline-flex; gap: 4px; align-items: center; }
.typing-inline span { width: 6px; height: 6px; border-radius: 50%; background: var(--axys-green); animation: blink 1.2s infinite; }
.typing-inline span:nth-child(2) { animation-delay: .2s; }
.typing-inline span:nth-child(3) { animation-delay: .4s; }
.stream-caret { display: inline-block; width: 8px; height: 1.05em; margin-left: 2px; vertical-align: text-bottom;
  background: var(--axys-green); border-radius: 1px; animation: blink 1s steps(1) infinite; }

/* Anexos */
.anexos-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.anexo-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px;
  background: rgba(255, 255, 255, .06); border: 1px solid var(--line); border-radius: 9px;
  font-size: .82rem; color: #d6dbe3;
}
.anexo-chip img { width: 26px; height: 26px; object-fit: cover; border-radius: 5px; }
.anexo-chip.mini { font-size: .76rem; padding: 3px 8px; }
.anexo-chip.mini img { width: 22px; height: 22px; }
.anexo-chip button { border: none; background: transparent; color: var(--muted); cursor: pointer; font-size: 1.1rem; line-height: 1; }
.anexo-chip button:hover { color: var(--danger); }
.bubble-anexos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.bubble-anexos img { cursor: zoom-in; }

/* Anexos pendentes — preview grande (lê até as cotas pequenas; clica = tela cheia) */
.anexos-bar { gap: 14px; }
.anexo-thumb { position: relative; width: 100%; max-width: 100%; }
/* moldura: por padrão mostra a imagem INTEIRA cabendo na tela (sem rolar) */
.anexo-zoom {
  display: grid; place-items: center;
  max-height: 56vh; overflow: auto; border-radius: 11px;
  border: 1px solid var(--line); background: #0c1016; resize: vertical;
}
.anexo-zoom img {
  max-width: 100%; max-height: 54vh; width: auto; height: auto; object-fit: contain;
  display: block; cursor: zoom-in; transition: border-color .15s;
}
.anexo-zoom:hover { border-color: rgba(46, 204, 113, .5); }
/* clicou: amplia p/ ler cota miúda e navega arrastando a barra/scroll */
.anexo-zoom.zoomed { place-items: start; }
.anexo-zoom.zoomed img { width: 165%; max-width: none; max-height: none; cursor: zoom-out; }
.anexo-full {
  position: absolute; top: 8px; left: 8px; width: 30px; height: 30px; border-radius: 7px;
  background: rgba(0, 0, 0, .55); border: 1px solid var(--line); color: #fff; cursor: pointer;
  font-size: 1rem; line-height: 1; display: grid; place-items: center; z-index: 2;
}
.anexo-full:hover { background: rgba(0, 0, 0, .82); }
.anexo-pdf {
  width: 100%; height: 200px; display: grid; place-items: center; font-size: 3rem;
  background: var(--card); border: 1px solid var(--line); border-radius: 11px;
}
.anexo-name {
  display: block; font-size: .78rem; color: var(--muted); margin-top: 6px;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* dica de clique pra ampliar */
.anexo-thumb::after {
  content: "🔍 clique = zoom · ⛶ tela cheia"; position: absolute; bottom: 8px; right: 8px;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: .7rem; padding: 2px 8px;
  border-radius: 6px; pointer-events: none;
}
.anexo-thumb:has(.anexo-pdf)::after { content: none; }
.anexo-x {
  position: absolute; top: -7px; right: -7px; width: 22px; height: 22px; border-radius: 50%;
  background: #1a1f29; border: 1px solid var(--line); color: #fff; cursor: pointer;
  font-size: 1rem; line-height: 1; display: grid; place-items: center;
}
.anexo-x:hover { background: var(--danger); }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .9);
  display: grid; place-items: center; padding: 30px;
}
.lightbox img { max-width: 94vw; max-height: 90vh; border-radius: 10px; box-shadow: 0 24px 70px rgba(0, 0, 0, .6); }
.lightbox-x {
  position: fixed; top: 18px; right: 24px; width: 46px; height: 46px; border-radius: 50%;
  border: none; background: rgba(255, 255, 255, .12); color: #fff; font-size: 1.7rem; cursor: pointer;
}
.lightbox-x:hover { background: rgba(255, 255, 255, .22); }

/* Painel de markup (margem/lucro/valor final) na edição */
.markup-box { margin: 16px 0; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.markup-box h4 { margin: 0 0 10px; }
.markup-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.markup-grid label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: #aab4c0; }
.markup-resumo { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px;
  border-top: 1px dashed var(--border); font-size: 1.02rem; }
.markup-final b { color: var(--axys-green); font-size: 1.15rem; }
.markup-manual { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; font-size: .85rem; color: #aab4c0; }
.markup-manual .inp { max-width: 240px; }
@media (max-width: 720px) { .markup-grid { grid-template-columns: 1fr 1fr; } }

/* Modal "Ver orçamento" (dentro da página) */
.ver-overlay { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .72);
  display: grid; place-items: center; padding: 24px; }
.ver-modal { background: var(--bg); border: 1px solid var(--border); border-radius: 16px;
  width: min(860px, 96vw); max-height: 88vh; overflow-y: auto; padding: 22px 26px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .6); }
.ver-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 8px; }
.ver-head h3 { margin: 0 0 2px; }
.ver-valor { margin-left: auto; text-align: right; }
.ver-valor b { display: block; color: var(--axys-green); font-size: 1.3rem; }
.ver-head .lightbox-x { position: static; width: 38px; height: 38px; font-size: 1.4rem; flex: none; }
.ver-modal h4 { margin: 18px 0 8px; }
.ver-desc { line-height: 1.55; color: #d6dbe3; }
.ver-itens { width: 100%; }
.ver-resumo { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; margin-top: 12px;
  padding: 10px 0; border-top: 1px dashed var(--border); color: #aab4c0; }
.ver-memorial { margin-top: 16px; }
.ver-memorial summary { cursor: pointer; color: #aab4c0; }

/* Logo da empresa */
.logo-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 4px 0 16px; }
.logo-prev { position: relative; width: 120px; height: 90px; border-radius: 10px; border: 1px solid var(--border);
  background: #fff; display: grid; place-items: center; overflow: hidden; }
.logo-prev img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-add { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border: 1.5px dashed var(--border);
  border-radius: 10px; cursor: pointer; color: #9fb0c2; font-size: .9rem; }
.logo-add:hover { border-color: var(--axys-green); color: var(--axys-green); }

/* História guiada por blocos */
.historia-box { margin-top: 16px; }
.historia-box h4 { margin: 0 0 6px; }
.historia-bloco { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin: 12px 0; background: var(--card); }
.hb-head { display: flex; align-items: center; gap: 10px; }
.hb-num { width: 26px; height: 26px; flex: none; border-radius: 50%; background: var(--axys-green);
  color: #06250f; font-weight: 700; display: grid; place-items: center; font-size: .85rem; }
.hb-titulo { flex: 1; font-weight: 600; }
.hb-hint { color: #e0a52b; font-size: .85rem; margin: 8px 0; line-height: 1.45; }
.hb-texto { width: 100%; margin-top: 6px; resize: vertical; min-height: 220px; line-height: 1.65; font-size: 1.02rem; font-family: inherit; padding: 12px 14px; }
.hb-foto { margin-top: 10px; }
.hb-foto-prev { position: relative; width: 200px; height: 130px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.hb-foto-prev img { width: 100%; height: 100%; object-fit: cover; cursor: pointer; }
.hb-foto-add { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1.5px dashed var(--border);
  border-radius: 10px; cursor: pointer; color: #9fb0c2; font-size: .9rem; }
.hb-foto-add:hover { border-color: var(--axys-green); color: var(--axys-green); }

/* Galeria de trabalhos (Dados da Empresa) */
.galeria-box { margin-top: 16px; }
.galeria-box h4 { margin: 0 0 10px; }
.galeria-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.galeria-foto { position: relative; width: 130px; height: 100px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.galeria-foto img { width: 100%; height: 100%; object-fit: cover; cursor: pointer; }
.galeria-x { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%;
  border: none; background: rgba(0,0,0,.65); color: #fff; font-size: 1.1rem; cursor: pointer; line-height: 1; }
.galeria-add { width: 130px; height: 100px; border: 1.5px dashed var(--border); border-radius: 10px;
  display: grid; place-items: center; cursor: pointer; color: #9fb0c2; font-size: .85rem; text-align: center; }
.galeria-add:hover { border-color: var(--axys-green); color: var(--axys-green); }

/* Toggles da proposta */
.prop-toggles { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 18px; }
.prop-toggles .chk { display: flex; align-items: center; gap: 8px; color: #d3d8e0; cursor: pointer; font-size: .92rem; }
.prop-toggles input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--axys-green); }

/* Fotos na prévia */
.pp-galeria { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px 30px 0; }
.pp-galeria img { width: 100%; height: 150px; object-fit: cover; border-radius: 6px; }

/* Funil de Vendas: ações no card (status + ver) */
.funil-actions { display: flex; gap: 6px; align-items: center; width: 100%; }
.funil-actions .inp-sm { flex: 1; min-width: 0; font-size: .8rem; padding: 4px 6px; }
.funil-actions button { flex: none; }

/* Proposta Comercial (Parte 2) */
.proposta { padding: 4px 2px; }
.prop-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.prop-head h2 { margin: 0; }
.prop-fields { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.prop-fields label { display: flex; flex-direction: column; gap: 5px; font-size: .85rem; color: #aab4c0; }
.prop-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.prop-card { padding: 16px 18px; border: 1px solid var(--border); border-radius: 14px; background: var(--card); }
.prop-card span { display: block; color: #9fb0c2; font-size: .85rem; margin-bottom: 6px; }
.prop-card b { font-size: 1.5rem; }
.prop-card .plus { color: #e0a52b; }
.prop-card.final { border-color: rgba(46, 204, 113, .4); background: rgba(46, 204, 113, .08); }
.prop-card.final b { color: var(--axys-green); }
.prop-table { width: 100%; margin-top: 8px; table-layout: fixed; }
.prop-table td { vertical-align: top; }
.prop-table th:not(:first-child), .prop-table td:not(:first-child) { width: 130px; white-space: nowrap; }
.prop-desc { width: 100%; margin-top: 6px; resize: vertical; min-height: 150px; line-height: 1.5;
  font-family: inherit; font-size: .92rem; padding: 10px 12px; }
.prop-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 18px; }
.prop-actions .btn.primary { font-size: 1.02rem; padding: 12px 22px; }

/* Prévia estilo Word */
.prop-preview { margin-top: 24px; display: grid; place-items: center; }
.pp-paper { position: relative; background: #fdfbf7; color: #1a1f2a; width: min(820px, 100%); border-radius: 8px;
  padding: 0 0 28px; box-shadow: 0 18px 50px rgba(0, 0, 0, .45); overflow: hidden; }
.pp-marca { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  transform: rotate(-30deg); font-size: 2.8rem; font-weight: 800; color: #000; opacity: .055;
  pointer-events: none; text-align: center; z-index: 5; padding: 0 20px; }
.pp-logo { max-height: 56px; max-width: 220px; object-fit: contain; margin-bottom: 8px; display: block;
  background: #fff; padding: 4px 8px; border-radius: 6px; }
.pp-header { position: relative; z-index: 1; background: #1a1f2a; color: #fff; padding: 20px 30px; }
.pp-empresa { font-size: 1.4rem; font-weight: 700; }
.pp-contato { color: #e0a52b; font-size: .8rem; margin-top: 4px; }
.pp-titulo { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px;
  padding: 20px 30px; border-bottom: 2px solid #efe7d6; }
.pp-label { color: #b88a2a; font-size: .78rem; font-weight: 700; letter-spacing: .5px; }
.pp-titulo h3 { margin: 2px 0 0; color: #1a1f2a; }
.pp-meta { text-align: right; font-size: .82rem; color: #555; }
.pp-sec { background: #1a1f2a; color: #e0a52b; font-weight: 700; font-size: .82rem; letter-spacing: .5px;
  padding: 8px 30px; margin: 18px 30px 0; border-radius: 6px; }
.pp-row { display: flex; gap: 18px; padding: 14px 30px; border-bottom: 1px solid #efe7d6; }
.pp-amb { flex: 1; }
.pp-amb b { color: #1a1f2a; }
.pp-amb p { margin: 4px 0 0; font-size: .82rem; color: #666; line-height: 1.5; }
.pp-val { font-weight: 700; color: #1a1f2a; white-space: nowrap; }
.pp-totais { padding: 16px 30px 0; text-align: right; color: #444; font-size: .9rem; line-height: 1.7; }
.pp-final { font-size: 1.15rem; color: #1a1f2a; margin-top: 6px; }
.pp-final b { color: #1e9e5a; }
.pp-texto { padding: 10px 30px 0; color: #555; font-size: .85rem; line-height: 1.6; }
.pp-texto b { color: #1a1f2a; }
.pp-historia { white-space: pre-line; }
.pp-historia-foto { padding: 12px 30px 4px; text-align: center; }
.pp-historia-foto img { max-width: 100%; max-height: 260px; border-radius: 6px; object-fit: cover; }
@media (max-width: 760px) {
  .prop-fields, .prop-cards { grid-template-columns: 1fr 1fr; }
}

/* Memória da IA */
.memoria-box { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.memoria-box h4 { color: #fff; margin: 0 0 4px; }
.memoria-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.memoria-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: rgba(46, 204, 113, .07); border: 1px solid rgba(46, 204, 113, .22);
  border-radius: 10px; padding: 10px 14px; color: #d6dbe3; font-size: .9rem;
}
.icon-btn.sm-ico { width: 34px; height: 34px; font-size: .95rem; flex: none; }

/* Barra de envio */
.attach-btn {
  display: grid; place-items: center; width: 44px; height: 42px; flex: none;
  border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, .05);
  cursor: pointer; font-size: 1.15rem;
}
.attach-btn:hover { background: rgba(46, 204, 113, .15); border-color: rgba(46, 204, 113, .4); }
.chat-send { width: 48px; font-size: 1.1rem; }
.chat-input .inp:disabled, .chat-send:disabled { opacity: .55; cursor: not-allowed; }

/* ══════════════════════════════════════════════════════════════════════════
   MÓDULOS ERP — Pipeline (kanban), Caixa, Contas, Compras, Estoque
   ══════════════════════════════════════════════════════════════════════════ */
.mod-title { color: #fff; font-size: 1.7rem; font-weight: 800; letter-spacing: -.5px; margin: 0 0 4px; }

/* KPIs */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin: 16px 0 18px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.kpi span { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .5px; }
.kpi strong { color: #fff; font-size: 1.5rem; font-weight: 800; }
.kpi strong.pos { color: var(--axys-green); }
.kpi strong.neg { color: #f87171; }

/* Form compacto de adicionar */
.add-line { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.add-line .inp { flex: 1; min-width: 120px; }
.add-line .w-val, .add-line .w-qtd { flex: none; }
.inp-sm { padding: 5px 8px; font-size: .85rem; max-width: 140px; }

/* Linhas especiais */
.row-done td { opacity: .5; text-decoration: line-through; }
.row-warn td { background: rgba(248, 113, 113, .07); }
.btn.sm.ok { color: var(--axys-green); border-color: rgba(46, 204, 113, .4); background: rgba(46, 204, 113, .08); }
.btn.sm.ok:hover { background: rgba(46, 204, 113, .18); }

/* Kanban (Pipeline) */
.kanban { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 16px; align-items: start; }
.kanban-col { background: rgba(0, 0, 0, .18); border: 1px solid var(--line); border-radius: 14px; padding: 12px; min-height: 130px; }
.kanban-head { display: flex; align-items: center; justify-content: space-between; color: #fff; font-weight: 700; font-size: .92rem; }
.kanban-count { background: rgba(255, 255, 255, .08); border-radius: 99px; padding: 1px 9px; font-size: .76rem; color: var(--muted); }
.kanban-total { color: var(--axys-green); font-size: .82rem; font-weight: 700; margin: 4px 0 10px; }
.kanban-card { background: var(--card); border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; margin-bottom: 9px; display: flex; flex-direction: column; gap: 3px; transition: border-color .15s; }
.kanban-card:hover { border-color: rgba(46, 204, 113, .4); }
.kanban-card b { color: #fff; }
.kanban-card .muted { font-size: .82rem; }
.kanban-card strong { color: var(--axys-green); font-size: .95rem; }
.kanban-actions { display: flex; gap: 5px; margin-top: 7px; }
.kanban-actions button { flex: 1; border: 1px solid var(--line); background: rgba(255, 255, 255, .05); color: #c8cdd6; border-radius: 7px; cursor: pointer; padding: 4px 0; font-size: .85rem; }
.kanban-actions button:hover:not(:disabled) { background: rgba(46, 204, 113, .15); color: #fff; }
.kanban-actions button:disabled { opacity: .3; cursor: not-allowed; }
.kanban-actions button.danger:hover { background: rgba(248, 113, 113, .18); color: #fff; }
.kanban-empty { color: #4b5563; text-align: center; padding: 10px 0; }

/* Produção: datas do cronograma + obra atrasada */
.kanban-card.atrasada { border-color: rgba(248, 113, 113, .55); background: rgba(248, 113, 113, .06); }
.obra-datas { display: flex; flex-wrap: wrap; gap: 10px; font-size: .78rem; color: var(--muted); margin-top: 4px; }
.obra-datas .atraso { color: var(--danger); font-weight: 700; }
.obra-atraso-badge { display: inline-block; margin-top: 4px; font-size: .72rem; font-weight: 700; color: #fff; background: var(--danger); border-radius: 6px; padding: 1px 8px; width: fit-content; }
.kpi strong.neg { color: var(--danger); }

/* Aviso de conferência antes de enviar (orçamento/contrato) */
.aviso-conferir {
  margin: 14px 0; padding: 11px 14px; border-radius: 10px; font-size: .9rem; color: #f4d58d;
  background: rgba(224, 165, 43, .10); border: 1px solid rgba(224, 165, 43, .35);
}
.aviso-conferir b { color: #f0c45a; }

/* Funil: clientes agrupados na coluna (nome + qtd) + prévia grande embaixo */
.funil-cli {
  width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line);
  border-radius: 11px; padding: 9px 11px; margin-bottom: 8px; cursor: pointer;
  display: flex; flex-direction: column; gap: 5px; transition: border-color .15s, background .15s;
}
.funil-cli:hover { border-color: rgba(46, 204, 113, .4); }
.funil-cli.sel { border-color: var(--axys-green); background: rgba(46, 204, 113, .08); }
.funil-cli-nome { display: flex; align-items: center; gap: 6px; color: #fff; }
.funil-cli-nome b { color: #fff; }
.funil-cli-meta { display: flex; justify-content: space-between; align-items: center; }
.funil-cli-n { font-size: .74rem; color: var(--muted); background: rgba(255, 255, 255, .06); border-radius: 99px; padding: 1px 8px; }
.funil-cli-tot { color: var(--axys-green); font-weight: 700; font-size: .85rem; }

.funil-previa {
  margin-top: 18px; background: rgba(0, 0, 0, .18); border: 1px solid var(--line);
  border-radius: 14px; padding: 16px 18px;
}
.funil-previa-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.funil-previa-head b { color: #fff; font-size: 1.02rem; }
.funil-previa-head .btn { margin-left: auto; }
.funil-previa-item { background: var(--card); border: 1px solid var(--line); border-radius: 11px; padding: 12px 14px; margin-bottom: 10px; }
.funil-previa-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.funil-previa-top b { color: #fff; font-size: .98rem; }
.funil-previa-actions { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.funil-previa-actions .inp-sm { max-width: 220px; }

@media (max-width: 900px) { .kanban { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .kanban { grid-template-columns: 1fr; } }

/* ══════════════════════════════════════════════════════════════════════════
   ORÇAMENTOS — pastas por cliente, filtros e contadores
   ══════════════════════════════════════════════════════════════════════════ */
.orc-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 16px 0 14px; }
.orc-toolbar .inp { flex: 1; min-width: 160px; }
.orc-toolbar select.inp { flex: none; max-width: 200px; }
.orc-aprovado {
  margin-left: auto; background: var(--card); border: 1px solid rgba(46, 204, 113, .3);
  border-radius: 14px; padding: 10px 18px; display: flex; flex-direction: column; gap: 2px; min-width: 150px;
}
.orc-aprovado span { color: var(--muted); font-size: .78rem; }
.orc-aprovado strong { color: var(--axys-green); font-size: 1.4rem; font-weight: 800; }

.orc-counters { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 18px; }
.orc-counter { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; text-align: center; }
.orc-counter b { display: block; color: #fff; font-size: 1.5rem; font-weight: 800; }
.orc-counter span { color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .4px; }
.orc-counter.c-rascunho b { color: #9aa3b2; }
.orc-counter.c-enviado b { color: #60a5fa; }
.orc-counter.c-aprovado b { color: var(--axys-green); }
.orc-counter.c-recusado b { color: #f87171; }

.orc-folders { display: flex; flex-direction: column; gap: 10px; }
.folder-head { gap: 8px; }
.folder-ico { font-size: 1.05rem; }
.folder-head b { color: #fff; }
.folder-meta { color: var(--muted); font-size: .88rem; font-weight: 400; }
.folder-apr { margin-left: auto; color: var(--axys-green); font-size: .82rem; font-weight: 600; }

.orc-item { background: rgba(0, 0, 0, .16); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; }
.orc-item-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.orc-item-info { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.orc-item-info b { color: #fff; }
.orc-item-info .muted { font-size: .82rem; }
.orc-item-top strong { color: var(--axys-green); font-size: 1.05rem; }
.orc-desc { margin: 10px 0; }
.orc-desc summary { color: var(--muted); cursor: pointer; font-size: .85rem; }
.orc-desc div { margin-top: 8px; color: #c8cdd6; font-size: .88rem; white-space: pre-wrap; background: rgba(255, 255, 255, .03); padding: 10px 12px; border-radius: 8px; }
.orc-item-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.orc-item-actions .inp-sm { max-width: 150px; }

@media (max-width: 720px) {
  .orc-counters { grid-template-columns: repeat(3, 1fr); }
  .orc-aprovado { margin-left: 0; width: 100%; }
}

@media (max-width: 900px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .bento-card.span2, .bento-card.hero { grid-column: span 2; }
}
@media (max-width: 560px) {
  .bento { grid-template-columns: 1fr; }
  .bento-card.span2, .bento-card.hero { grid-column: span 1; }
  .erp-top { padding: 14px 16px; }
  .erp-body { padding: 18px 16px; }
  .recent li { grid-template-columns: 1fr auto; }
  .recent-amb { display: none; }
}
