/* Identidade da loja: verde-oliva, creme e dourado; títulos Cormorant Garamond, texto DM Sans.
   Celular: barra superior + menu inferior com botão central "Novo".
   Computador (>= 960px): menu lateral fixo. */
:root{
  --bg:#F6F2E9; --surface:#FDFBF7; --surface-2:#F3EEE3; --ink:#203F3C; --muted:#5F6C66; --line:#E2DED4;
  --accent:#1A4442; --accent-2:#2A5D59; --accent-ink:#FDFBF7; --soft:#E6ECE4; --gold:#C4A25C; --gold-ink:#7D6127;
  --ok:#2F7A4F; --ok-soft:#E1EFE4; --warn:#A8701A; --warn-soft:#F7ECD6; --bad:#A9433A; --bad-soft:#F6E2DF;
  --info:#38609F; --info-soft:#E3E9F3; --violet:#6A4D9F; --violet-soft:#ECE6F4;
  --shadow:0 1px 2px rgba(32,63,60,.06),0 10px 28px rgba(32,63,60,.07);
  --f-display:"Cormorant Garamond",Georgia,"Times New Roman",serif;
  --f-body:"DM Sans","Segoe UI",Arial,sans-serif;
  --r:16px; --nav-h:64px;
  color-scheme:light;
}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){
  --bg:#0F1817; --surface:#162220; --surface-2:#1C2B29; --ink:#EEE8DA; --muted:#A3B2AA; --line:#2B3B38;
  --accent:#A9CBBE; --accent-2:#C2DCD2; --accent-ink:#0F1817; --soft:#20332F; --gold:#D6B676; --gold-ink:#D6B676;
  --ok:#6CC795; --ok-soft:#173025; --warn:#E3B062; --warn-soft:#352A16; --bad:#E3857B; --bad-soft:#3A201D;
  --info:#93AEE6; --info-soft:#1C2740; --violet:#BCA6EA; --violet-soft:#272040;
  --shadow:0 1px 2px rgba(0,0,0,.3),0 10px 28px rgba(0,0,0,.25); color-scheme:dark}}
:root[data-theme="dark"]{
  --bg:#0F1817; --surface:#162220; --surface-2:#1C2B29; --ink:#EEE8DA; --muted:#A3B2AA; --line:#2B3B38;
  --accent:#A9CBBE; --accent-2:#C2DCD2; --accent-ink:#0F1817; --soft:#20332F; --gold:#D6B676; --gold-ink:#D6B676;
  --ok:#6CC795; --ok-soft:#173025; --warn:#E3B062; --warn-soft:#352A16; --bad:#E3857B; --bad-soft:#3A201D;
  --info:#93AEE6; --info-soft:#1C2740; --violet:#BCA6EA; --violet-soft:#272040;
  --shadow:0 1px 2px rgba(0,0,0,.3),0 10px 28px rgba(0,0,0,.25); color-scheme:dark}

*{box-sizing:border-box}
[hidden]{display:none!important}
html,body{margin:0}
body{background:var(--bg);color:var(--ink);font-family:var(--f-body);font-size:15px;line-height:1.45;-webkit-font-smoothing:antialiased}
h1,h2,h3{font-family:var(--f-display);margin:0;letter-spacing:-.01em;text-wrap:balance}
h1{font-size:1.95rem;font-weight:600;line-height:1.08} h2{font-size:1.4rem;font-weight:600;line-height:1.15} h3{font-size:1.15rem;font-weight:600}
h1 em,h2 em,h3 em{font-weight:500;font-style:italic}
a{color:var(--accent)}
p{margin:0}
.muted{color:var(--muted)} .small{font-size:.84rem} .num{font-variant-numeric:tabular-nums}
.label{font-size:.72rem;text-transform:uppercase;letter-spacing:.08em;color:var(--muted);font-weight:600}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}

/* ---------- casca do app ---------- */
.shell{min-height:100vh;display:flex}
.side{display:none}
.main{flex:1;min-width:0;display:flex;flex-direction:column}
.topbar{position:sticky;top:0;z-index:20;background:color-mix(in srgb,var(--bg) 88%,transparent);
  backdrop-filter:saturate(1.4) blur(12px);-webkit-backdrop-filter:saturate(1.4) blur(12px);
  padding:calc(10px + env(safe-area-inset-top,0px)) max(16px,env(safe-area-inset-right,0px)) 10px max(16px,env(safe-area-inset-left,0px));
  display:flex;align-items:center;gap:10px;min-height:56px}
.topbar h1{font-size:1.55rem;flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.topbar .back{display:none}
.topbar.has-back .back{display:inline-flex}
.content{width:100%;max-width:1080px;margin:0 auto;
  padding:4px max(16px,env(safe-area-inset-right,0px)) calc(var(--nav-h) + 32px + env(safe-area-inset-bottom,0px)) max(16px,env(safe-area-inset-left,0px));
  display:flex;flex-direction:column;gap:16px}

.tabbar{position:fixed;left:0;right:0;bottom:0;z-index:30;background:var(--surface);border-top:1px solid var(--line);
  padding:6px max(8px,env(safe-area-inset-right,0px)) calc(6px + env(safe-area-inset-bottom,0px)) max(8px,env(safe-area-inset-left,0px));
  display:grid;grid-template-columns:repeat(5,1fr);align-items:end}
.tab{appearance:none;background:none;border:0;color:var(--muted);font:inherit;font-size:.7rem;font-weight:600;
  display:flex;flex-direction:column;align-items:center;gap:3px;padding:6px 0;cursor:pointer;text-decoration:none;border-radius:10px;position:relative}
.tab svg{width:24px;height:24px}
.tab.on{color:var(--accent)}
.tab .ic{display:flex;align-items:center;justify-content:center;width:52px;height:30px;border-radius:15px;transition:background .15s}
.tab.on .ic{background:var(--soft)}
.tab .badge{position:absolute;top:2px;left:calc(50% + 6px)}
.tab.fab{color:var(--accent-ink)}
.tab.fab .fab-in{width:52px;height:52px;border-radius:18px;background:var(--accent);display:flex;align-items:center;justify-content:center;
  margin-top:-22px;box-shadow:0 6px 18px color-mix(in srgb,var(--accent) 40%,transparent)}
.tab.fab span.t{color:var(--muted)}
.tab.fab.on span.t{color:var(--accent)}

@media (min-width:960px){
  .tabbar{display:none}
  .side{display:flex;flex-direction:column;gap:4px;width:240px;flex:none;position:sticky;top:0;height:100vh;
    background:var(--surface);border-right:1px solid var(--line);padding:20px 14px}
  .side .brand{display:flex;align-items:center;gap:10px;padding:4px 8px 18px}
  .side .brand b{font-family:var(--f-display);font-size:1.05rem;line-height:1.2}
  .side a{display:flex;align-items:center;gap:12px;padding:10px 12px;border-radius:10px;color:var(--ink);text-decoration:none;font-weight:500}
  .side a svg{width:20px;height:20px;color:var(--muted)}
  .side a:hover{background:var(--surface-2)}
  .side a.on{background:var(--soft);color:var(--accent)} .side a.on svg{color:var(--accent)}
  .side .novo{background:var(--accent);color:var(--accent-ink);justify-content:center;margin:0 0 14px;font-weight:600}
  .side .novo svg{color:var(--accent-ink)}
  .side .novo:hover{background:var(--accent-2)}
  .side .sp{flex:1}
  .content{padding-bottom:40px}
  .topbar{padding-top:18px}
}

/* ---------- componentes ---------- */
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:16px;display:flex;flex-direction:column;gap:12px;min-width:0}
.card.flat{border:0;box-shadow:var(--shadow)}
.row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.between{justify-content:space-between}
.grow{flex:1;min-width:0}
.grid2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.grid3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
@media (max-width:640px){.grid3{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:380px){.grid2,.grid3{grid-template-columns:minmax(0,1fr)}}
.stack{display:flex;flex-direction:column;gap:12px}
.cols{display:grid;grid-template-columns:minmax(0,1fr);gap:16px}
@media (min-width:960px){.cols{grid-template-columns:minmax(0,1.5fr) minmax(0,1fr)}}

.btn{appearance:none;border:1px solid var(--line);background:var(--surface);color:var(--ink);font:inherit;font-weight:600;font-size:.92rem;
  padding:10px 14px;border-radius:10px;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:8px;text-decoration:none;white-space:nowrap}
.btn svg{width:18px;height:18px}
.btn:hover{background:var(--surface-2)}
.btn.primary{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
.btn.primary:hover{background:var(--accent-2)}
.btn.ghost{background:transparent;border-color:transparent}
.btn.danger{color:var(--bad)}
.btn.wa{background:#1FA855;border-color:#1FA855;color:#fff}
.btn.block{width:100%}
.btn.icon{padding:9px;border-radius:12px}
.btn:disabled{opacity:.55;cursor:default}
.actions{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.actions .btn{flex-direction:column;gap:4px;font-size:.76rem;padding:10px 4px;white-space:normal;text-align:center}
.actions .btn svg{width:22px;height:22px}

.field{display:flex;flex-direction:column;gap:5px;min-width:0}
.field>label,.field>.lbl{font-size:.82rem;color:var(--muted);font-weight:500}
input[type=text],input[type=email],input[type=tel],input[type=password],input[type=number],input[type=search],select,textarea{
  width:100%;min-width:0;font:inherit;font-size:16px;color:var(--ink);background:var(--surface-2);border:1px solid var(--line);
  border-radius:10px;padding:10px 12px;font-variant-numeric:tabular-nums}
textarea{min-height:84px;resize:vertical;line-height:1.45}
input:focus,select:focus,textarea:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 20%,transparent)}
.inp{position:relative;display:flex;align-items:center}
.inp .pre,.inp .suf{position:absolute;font-size:.85rem;color:var(--muted);pointer-events:none}
.inp .pre{left:12px}.inp .suf{right:12px}
.inp.has-pre input{padding-left:36px}.inp.has-suf input{padding-right:46px}
.check{display:inline-flex;align-items:center;gap:8px;cursor:pointer;user-select:none;font-weight:500}
.check input{width:20px;height:20px;accent-color:var(--accent);margin:0}
.switch{display:inline-flex;align-items:center;gap:10px;cursor:pointer}
.switch input{appearance:none;width:42px;height:24px;border-radius:12px;background:var(--line);position:relative;cursor:pointer;margin:0;transition:background .15s}
.switch input::after{content:"";position:absolute;top:3px;left:3px;width:18px;height:18px;border-radius:50%;background:#fff;transition:transform .15s}
.switch input:checked{background:var(--accent)}
.switch input:checked::after{transform:translateX(18px)}

.pill{display:inline-flex;align-items:center;gap:6px;font-size:.74rem;font-weight:600;padding:3px 9px;border-radius:999px;white-space:nowrap;
  background:var(--soft);color:var(--accent)}
.pill::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor}
.s-novo{background:var(--info-soft);color:var(--info)}
.s-enviado{background:var(--violet-soft);color:var(--violet)}
.s-negociando{background:var(--warn-soft);color:var(--warn)}
.s-aprovado{background:var(--soft);color:var(--accent)}
.s-fechado{background:var(--ok-soft);color:var(--ok)}
.s-perdido{background:var(--bad-soft);color:var(--bad)}
.tag{font-size:.7rem;font-weight:600;padding:2px 7px;border-radius:6px;background:var(--surface-2);color:var(--muted);border:1px solid var(--line)}
.tag.site{color:var(--info);border-color:color-mix(in srgb,var(--info) 35%,var(--line))}
.badge{min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:var(--bad);color:#fff;font-size:.68rem;font-weight:700;display:inline-flex;align-items:center;justify-content:center}

.chips{display:flex;gap:8px;overflow-x:auto;padding-bottom:2px;scrollbar-width:none;-webkit-overflow-scrolling:touch}
.chips::-webkit-scrollbar{display:none}
.chip{appearance:none;border:1px solid var(--line);background:var(--surface);color:var(--ink);font:inherit;font-size:.85rem;font-weight:500;
  padding:7px 12px;border-radius:999px;cursor:pointer;white-space:nowrap;display:inline-flex;gap:6px;align-items:center}
.chip .n{color:var(--muted);font-variant-numeric:tabular-nums}
.chip[aria-pressed="true"]{background:var(--ink);border-color:var(--ink);color:var(--bg)}
.chip[aria-pressed="true"] .n{color:inherit;opacity:.7}
.chips.wrap{flex-wrap:wrap;overflow:visible}

.seg{display:flex;background:var(--surface-2);border:1px solid var(--line);border-radius:10px;padding:3px;gap:2px;overflow-x:auto}
.seg button{flex:1;appearance:none;border:0;background:none;font:inherit;font-size:.82rem;font-weight:600;color:var(--muted);padding:7px 10px;border-radius:8px;cursor:pointer;white-space:nowrap}
.seg button.on{background:var(--surface);color:var(--ink);box-shadow:0 1px 2px rgba(0,0,0,.08)}

/* lista */
.list{display:flex;flex-direction:column;background:var(--surface);border:1px solid var(--line);border-radius:var(--r);overflow:hidden}
.li{display:flex;gap:12px;align-items:center;padding:14px 16px;border-bottom:1px solid var(--line);text-decoration:none;color:inherit;cursor:pointer;min-width:0}
.li:last-child{border-bottom:0}
.li:hover{background:var(--surface-2)}
.li .av{width:40px;height:40px;border-radius:12px;background:var(--soft);color:var(--accent);display:flex;align-items:center;justify-content:center;
  font-family:var(--f-display);font-weight:700;flex:none}
.li .body{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}
.li .t1{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.li .t2{font-size:.82rem;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.li .end{display:flex;flex-direction:column;align-items:flex-end;gap:5px;flex:none}
.li .val{font-weight:700;font-variant-numeric:tabular-nums}

/* KPIs */
.kpis{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
@media (min-width:720px){.kpis{grid-template-columns:repeat(4,minmax(0,1fr))}}
.kpi{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:14px;display:flex;flex-direction:column;gap:4px;min-width:0}
.kpi .v{font-family:var(--f-display);font-weight:700;font-size:1.35rem;font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.kpi .d{font-size:.78rem;color:var(--muted)}
.kpi.hero{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
.kpi.hero .label,.kpi.hero .d{color:color-mix(in srgb,var(--accent-ink) 78%,transparent)}
.chart-box{position:relative;height:220px}
.bars{display:flex;flex-direction:column;gap:10px}
.bar-row{display:grid;grid-template-columns:minmax(0,7rem) minmax(0,1fr) auto;gap:10px;align-items:center;font-size:.86rem}
.bar-row .track{height:8px;border-radius:4px;background:var(--surface-2);overflow:hidden}
.bar-row .fill{height:100%;border-radius:4px;background:var(--accent)}
.bar-row .nm{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* calculadora */
.amb{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:16px;display:flex;flex-direction:column;gap:14px}
.width-box{background:var(--soft);border-radius:12px;padding:14px;display:flex;flex-direction:column;gap:10px}
.width-box .big input{font-family:var(--f-display);font-weight:700;font-size:1.5rem;padding:10px 46px 10px 14px;background:var(--surface);border-color:var(--accent)}
.steps{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:9px}
.step{display:grid;grid-template-columns:24px minmax(0,1fr) auto;gap:2px 10px;align-items:baseline}
.step .n{width:22px;height:22px;border-radius:50%;background:var(--soft);color:var(--accent);font-size:.72rem;font-weight:700;display:flex;align-items:center;justify-content:center;align-self:start}
.step .t{font-weight:600;font-size:.92rem}
.step .f{grid-column:2;color:var(--muted);font-size:.8rem;font-variant-numeric:tabular-nums}
.step .v{font-variant-numeric:tabular-nums;white-space:nowrap;font-weight:500}
.step.off{opacity:.4}
.ln{display:flex;justify-content:space-between;gap:12px;font-variant-numeric:tabular-nums}
.ln.sub{color:var(--muted);font-size:.9rem}
.ln.tot{font-weight:700;font-size:1.1rem;color:var(--accent)}
.sep{border:0;border-top:1px dashed var(--line);margin:2px 0}
.totbar{position:sticky;bottom:calc(var(--nav-h) + env(safe-area-inset-bottom,0px) + 8px);z-index:10;background:var(--ink);color:var(--bg);
  border-radius:16px;padding:12px 14px 12px 18px;display:flex;align-items:center;gap:12px;box-shadow:var(--shadow)}
.totbar .v{font-family:var(--f-display);font-weight:700;font-size:1.35rem;font-variant-numeric:tabular-nums}
.totbar .btn.primary{background:var(--accent-2);border-color:var(--accent-2)}
@media (min-width:960px){.totbar{bottom:16px}}

/* timeline */
.tl{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}
.tl li{display:grid;grid-template-columns:14px minmax(0,1fr);gap:10px;padding-bottom:14px;position:relative}
.tl li::before{content:"";width:10px;height:10px;border-radius:50%;background:var(--accent);margin-top:5px;z-index:1}
.tl li::after{content:"";position:absolute;left:4px;top:15px;bottom:0;width:2px;background:var(--line)}
.tl li:last-child::after{display:none}
.tl .w{font-size:.78rem;color:var(--muted)}

/* folha (modal) */
.sheet-bg{position:fixed;inset:0;background:rgba(10,18,20,.45);z-index:50;display:flex;align-items:flex-end;justify-content:center;animation:fade .15s}
.sheet{background:var(--surface);width:100%;max-width:560px;border-radius:20px 20px 0 0;max-height:90vh;overflow:auto;
  padding:18px max(18px,env(safe-area-inset-right,0px)) calc(18px + env(safe-area-inset-bottom,0px)) max(18px,env(safe-area-inset-left,0px));
  display:flex;flex-direction:column;gap:14px;animation:up .2s ease-out}
.sheet .grab{width:40px;height:4px;border-radius:2px;background:var(--line);align-self:center;margin-top:-6px}
@media (min-width:640px){.sheet-bg{align-items:center}.sheet{border-radius:20px}}
@keyframes up{from{transform:translateY(24px);opacity:.6}to{transform:none;opacity:1}}
@keyframes fade{from{opacity:0}to{opacity:1}}

.toast{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(var(--nav-h) + 20px + env(safe-area-inset-bottom,0px));z-index:60;
  background:var(--ink);color:var(--bg);padding:11px 16px;border-radius:12px;font-weight:500;font-size:.9rem;box-shadow:var(--shadow);max-width:calc(100% - 32px);animation:up .2s}
.toast.err{background:var(--bad);color:#fff}
@media (min-width:960px){.toast{bottom:24px}}

.empty{text-align:center;padding:36px 16px;color:var(--muted);display:flex;flex-direction:column;align-items:center;gap:10px}
.empty svg{width:40px;height:40px;opacity:.5}
.skeleton{height:64px;border-radius:var(--r);background:linear-gradient(90deg,var(--surface) 0,var(--surface-2) 50%,var(--surface) 100%);background-size:200% 100%;animation:sk 1.2s infinite}
@keyframes sk{to{background-position:-200% 0}}
.menu-list .li .av{background:var(--surface-2);color:var(--ink)}
.menu-list .li .av svg{width:20px;height:20px}
.hide-m{display:none}
@media (min-width:960px){.hide-m{display:initial}.hide-d{display:none!important}}
.notice{background:var(--warn-soft);color:var(--ink);border-radius:12px;padding:12px 14px;font-size:.88rem;display:flex;gap:10px;align-items:flex-start}
.notice b{color:var(--warn)}
code.box{display:block;background:var(--surface-2);border:1px solid var(--line);border-radius:10px;padding:10px 12px;font-size:.8rem;overflow-x:auto;white-space:pre}

/* números sempre na fonte de texto, com algarismos alinhados */
.kpi .v,.totbar .v,.li .val{font-family:var(--f-body);font-weight:700;letter-spacing:-.01em}
.kpi .v{font-size:1.3rem}
.side .brand b{font-size:1.3rem}
.eyebrow{font-size:.7rem;letter-spacing:.15em;text-transform:uppercase;font-weight:600;color:var(--muted)}
.gold{color:var(--gold-ink)}
.notice>svg{width:22px;height:22px;flex:none;color:var(--warn)}
