/* Grupofy — design system "Midnight": preto profundo, superfícies azul-marinho, um único azul de ação.
   Mobile-first no comportamento; o layout desktop entra a partir de 921px. */
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300..700&family=Geist+Mono:wght@400;500&display=swap');

:root{
  /* superfícies */
  --bg:#05070D;
  --s1:#0A1020;            /* cartão */
  --s2:#0E1629;            /* cartão elevado / campo */
  --s3:#142039;            /* hover */
  --line:rgba(148,172,224,.10);
  --line-2:rgba(148,172,224,.18);
  --line-3:rgba(148,172,224,.28);
  /* texto */
  --text:#EDF2FB; --muted:#97A4BF; --dim:#7886A4;
  /* ação */
  --acc:#3D7BFF; --acc-hi:#5C92FF; --acc-lo:#2A62E6; --acc-ink:#FFFFFF;
  --acc-soft:rgba(61,123,255,.14); --acc-line:rgba(61,123,255,.45);
  --stroke-gold:var(--acc-line);
  --acc-grad:linear-gradient(180deg,#2F6DF4 0%,#2A62E6 100%);
  /* estados */
  --ok:#34D399; --ok-soft:rgba(52,211,153,.12);
  --warn:#FBBF24; --warn-soft:rgba(251,191,36,.12);
  --err:#F87171; --err-soft:rgba(248,113,113,.12);
  /* forma */
  --r:18px; --r-sm:12px; --r-xs:9px;
  --sh-1:0 1px 0 rgba(255,255,255,.035) inset, 0 1px 2px rgba(0,0,0,.4), 0 14px 32px -18px rgba(0,0,0,.85);
  --sh-2:0 1px 0 rgba(255,255,255,.05) inset, 0 24px 60px -24px rgba(0,0,0,.9);
  --blur:blur(20px) saturate(160%);
  --font:"Geist",-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",sans-serif;
  --mono:"Geist Mono",ui-monospace,"SF Mono",Menlo,monospace;
  --font-display:var(--font); --font-body:var(--font);
  --ease:cubic-bezier(.16,1,.3,1);
  --safe-b:env(safe-area-inset-bottom,0px); --safe-t:env(safe-area-inset-top,0px);
}

/* ---------- base ---------- */
*{box-sizing:border-box;margin:0;padding:0}
html{color-scheme:dark;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent;overscroll-behavior-y:none}
body{background:var(--bg);color:var(--text);font:400 14.5px/1.55 var(--font);min-height:100vh;min-height:100dvh;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;overflow-x:hidden}
h1,h2,h3,.display{font-family:var(--font);font-weight:600;letter-spacing:-.022em;line-height:1.15;text-wrap:balance}
a{color:var(--acc-hi);text-decoration:none;text-underline-offset:3px}
a:hover{text-decoration:underline}
button{font:inherit;cursor:pointer;border:0;background:none;color:inherit}
[hidden]{display:none!important}
::selection{background:rgba(61,123,255,.35);color:#fff}
input,textarea{caret-color:var(--acc-hi)}
:focus{outline:none}
:focus-visible{outline:2px solid var(--acc-hi);outline-offset:2px;border-radius:8px}
*{scrollbar-width:thin;scrollbar-color:var(--line-3) transparent}
::-webkit-scrollbar{width:10px;height:10px}
::-webkit-scrollbar-thumb{background:var(--line-2);border-radius:99px;border:3px solid var(--bg)}
::-webkit-scrollbar-thumb:hover{background:var(--line-3)}
::-webkit-scrollbar-track{background:transparent}
.n,td,.feed .t,.count,.badge,.big{font-variant-numeric:tabular-nums}

/* atmosfera: uma luz azul fria no topo + grão fino. Estática. */
body::before{content:"";position:fixed;inset:0;z-index:0;pointer-events:none;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.035'/%3E%3C/svg%3E"),
    radial-gradient(ellipse 60% 42% at 50% -8%,rgba(46,98,230,.22),transparent 70%),
    radial-gradient(ellipse 40% 30% at 100% 0%,rgba(30,64,160,.14),transparent 70%),
    var(--bg)}

/* ---------- superfícies ---------- */
.glass{background:var(--s1);border:1px solid var(--line);border-radius:var(--r);box-shadow:var(--sh-1);position:relative}
.glass.gold{border-color:var(--line-2);background:linear-gradient(180deg,#0D1528 0%,var(--s1) 60%)}
.glass.gold::after{content:"";position:absolute;left:24px;right:24px;top:-1px;height:1px;background:linear-gradient(90deg,transparent,var(--acc-line),transparent);pointer-events:none}
.blur{backdrop-filter:var(--blur);-webkit-backdrop-filter:var(--blur);background:rgba(10,16,32,.78)}
.card{padding:22px 24px;margin-bottom:16px}
.card h2{font-size:17px;margin-bottom:3px}
.card h3{font-size:14px;margin-bottom:10px;color:var(--text);font-weight:600}
.hint{font-size:13px;color:var(--muted);line-height:1.55}
.hint b{color:var(--text);font-weight:500}
.muted{color:var(--muted)}.small{font-size:12.5px}

/* ---------- shell ---------- */
.shell{position:relative;z-index:2;display:grid;grid-template-columns:248px 1fr;min-height:100vh}
.sidebar{position:sticky;top:0;height:100vh;padding:20px 14px 16px;display:flex;flex-direction:column;border-right:1px solid var(--line);background:rgba(6,9,18,.72);backdrop-filter:var(--blur);-webkit-backdrop-filter:var(--blur)}
.brand{display:flex;align-items:center;gap:11px;padding:4px 10px 24px}
.brand .omega{width:36px;height:36px;display:grid;place-items:center;border-radius:10px;background:var(--acc-grad);color:#fff;font:700 19px/1 var(--font);letter-spacing:-.04em;box-shadow:0 1px 0 rgba(255,255,255,.25) inset,0 4px 10px -4px rgba(0,0,0,.6)}
.brand b{display:block;font-size:16px;font-weight:600;letter-spacing:-.02em}
.brand small{display:block;font-size:11.5px;color:var(--dim);margin-top:1px}
.nav{position:relative;display:flex;flex-direction:column;gap:2px}
.nav a{position:relative;z-index:1;display:flex;align-items:center;gap:11px;padding:9px 11px;border-radius:10px;color:var(--muted);font-weight:500;font-size:14px;cursor:pointer;transition:color .2s,background .2s;user-select:none;text-decoration:none}
.nav a svg{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round;flex:none}
.nav a.on{color:var(--text)}
.nav a.on svg{color:var(--acc-hi)}
.nav a:hover:not(.on){color:var(--text);background:rgba(148,172,224,.05)}
.nav-indicator{position:absolute;left:0;right:0;top:0;height:38px;border-radius:10px;background:var(--s2);border:1px solid var(--line-2);box-shadow:0 1px 0 rgba(255,255,255,.04) inset;transition:transform .4s var(--ease),height .3s var(--ease),width .3s var(--ease)}
.badge{margin-left:auto;font-size:11px;font-weight:600;min-width:20px;height:20px;padding:0 6px;border-radius:99px;background:#DC3D3D;color:#fff;display:grid;place-items:center}
.badge:empty{display:none}
.side-foot{margin-top:auto;display:flex;flex-direction:column;gap:6px;padding:14px 4px 0;border-top:1px solid var(--line)}
.side-foot .pill{justify-content:flex-start;border:0;background:transparent;padding:6px 8px}
.sair{font-size:13px;color:var(--dim);padding:8px;border-radius:8px;text-align:left;transition:color .2s,background .2s}
.sair:hover{color:var(--err);background:var(--err-soft)}

main{padding:36px 44px 72px;max-width:1220px;width:100%}
.topbar{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;margin-bottom:28px}
.topbar h1{font-size:28px;letter-spacing:-.03em}
.topbar p{color:var(--muted);font-size:14px;margin-top:4px}
.topbar .actions{display:flex;gap:10px;align-items:center}
.mobile-status{display:none}

/* ---------- pills de status ---------- */
.pill{display:inline-flex;align-items:center;gap:8px;padding:5px 11px;border-radius:99px;font-size:12.5px;font-weight:500;color:var(--muted);background:var(--s2);border:1px solid var(--line);white-space:nowrap}
.pill .dot{width:7px;height:7px;border-radius:50%;background:var(--dim);position:relative;flex:none}
.pill.ok{color:var(--text)}
.pill.ok .dot{background:var(--ok);box-shadow:0 0 0 3px var(--ok-soft)}
.pill.bad .dot{background:var(--err);box-shadow:0 0 0 3px var(--err-soft)}
.pill.warn .dot{background:var(--warn);box-shadow:0 0 0 3px var(--warn-soft)}

/* ---------- botões ---------- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:40px;padding:9px 16px;border-radius:11px;font-weight:550;font-size:14px;letter-spacing:-.005em;background:var(--acc-grad);color:#fff;box-shadow:0 1px 0 rgba(255,255,255,.22) inset,0 0 0 1px rgba(30,70,180,.55),0 6px 14px -8px rgba(0,0,0,.7);transition:transform .15s var(--ease),filter .2s,box-shadow .2s;white-space:nowrap;text-decoration:none}
.btn:hover{filter:brightness(1.08);text-decoration:none}
.btn:active{transform:scale(.97)}
.btn:disabled{opacity:.45;pointer-events:none}
.btn.ghost{background:var(--s2);color:var(--text);box-shadow:0 1px 0 rgba(255,255,255,.04) inset,0 0 0 1px var(--line-2)}
.btn.ghost:hover{background:var(--s3);filter:none}
.btn.danger{background:transparent;color:var(--err);box-shadow:0 0 0 1px rgba(248,113,113,.32)}
.btn.danger:hover{background:var(--err-soft);filter:none}
.btn.sm{min-height:32px;padding:6px 12px;font-size:13px;border-radius:9px}
.btn svg{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;flex:none}

/* ---------- campos ---------- */
label{display:block;font-size:12.5px;color:var(--muted);margin:14px 0 6px;font-weight:500}
input,select,textarea{font:inherit;font-size:14.5px;color:var(--text);width:100%;padding:10px 12px;min-height:42px;border-radius:11px;background:var(--bg);border:1px solid var(--line-2);transition:border-color .2s,box-shadow .2s,background .2s;outline:none}
input:hover,select:hover,textarea:hover{border-color:var(--line-3)}
input:focus,select:focus,textarea:focus{border-color:var(--acc);box-shadow:0 0 0 3px rgba(61,123,255,.22);background:#070B16}
input::placeholder,textarea::placeholder{color:var(--dim)}
select{appearance:none;cursor:pointer;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2393A0BB' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 12px center;padding-right:36px}
select option{background:#0A1020;color:var(--text)}
select[multiple]{background-image:none;padding:6px}
select[multiple] option{padding:7px 9px;border-radius:7px}
select[multiple] option:checked{background:linear-gradient(0deg,var(--acc-soft),var(--acc-soft));color:var(--text)}
textarea{min-height:170px;resize:vertical;line-height:1.55;font-family:var(--mono);font-size:13.5px}
.search{position:relative}
.search svg{position:absolute;left:14px;top:50%;transform:translateY(-50%);width:18px;height:18px;stroke:var(--muted);fill:none;stroke-width:2;stroke-linecap:round}
.search input{padding-left:42px;font-size:15.5px;min-height:50px;border-radius:13px}

.switch{position:relative;width:42px;height:24px;border-radius:99px;background:var(--s3);box-shadow:0 0 0 1px var(--line-2) inset;cursor:pointer;transition:background .25s;flex:none;display:inline-block;vertical-align:middle}
.switch::after{content:"";position:absolute;top:3px;left:3px;width:18px;height:18px;border-radius:50%;background:#C9D3E8;box-shadow:0 2px 4px rgba(0,0,0,.5);transition:transform .3s var(--ease),background .25s}
.switch.on{background:var(--acc);box-shadow:none}
.switch.on::after{transform:translateX(18px);background:#fff}

.seg{position:relative;display:inline-flex;padding:3px;border-radius:11px;background:var(--bg);border:1px solid var(--line-2);gap:2px}
.seg button{position:relative;z-index:1;padding:6px 13px;border-radius:8px;font-size:13px;font-weight:500;color:var(--muted);transition:color .25s}
.seg button.on{color:var(--text)}
.seg .seg-ind{position:absolute;top:3px;bottom:3px;left:3px;border-radius:8px;background:var(--s3);box-shadow:0 0 0 1px var(--line-2),0 1px 0 rgba(255,255,255,.05) inset;transition:transform .35s var(--ease),width .35s var(--ease)}

/* ---------- dashboard ---------- */
.grid{display:grid;gap:16px}
.grid>*,main,.feed .p{min-width:0}
.g2{grid-template-columns:1fr 1fr}.g3{grid-template-columns:repeat(3,1fr)}.g4{grid-template-columns:repeat(4,1fr)}

/* faixa de indicadores: um bloco, quatro células divididas por linha fina */
#stats.kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:0;padding:0;overflow:hidden;margin-bottom:16px}
.kpi{padding:20px 22px 18px;position:relative;min-width:0}
.kpi+.kpi{border-left:1px solid var(--line)}
.kpi .l{display:flex;align-items:center;gap:8px;font-size:12.5px;color:var(--muted);font-weight:500}
.kpi .l svg{width:15px;height:15px;stroke:var(--dim);fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:none}
.kpi .n{font-size:30px;font-weight:600;letter-spacing:-.035em;line-height:1;margin-top:12px;color:var(--text)}
.kpi .n.sm{font-size:19px;letter-spacing:-.02em;margin-top:18px;line-height:1.2}
.kpi .sub{font-size:12px;color:var(--dim);margin-top:6px}
.kpi .sub b{color:var(--muted);font-weight:500}

.meter{height:8px;border-radius:99px;background:var(--s3);overflow:hidden;margin:18px 0 10px}
.meter i{display:block;height:100%;width:100%;border-radius:inherit;background:linear-gradient(90deg,#2F6DF4,#5C92FF);transform-origin:left;transform:scaleX(0);transition:transform 1s var(--ease)}
.cap-row{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-top:14px}
.cap-row .big{font-size:30px;font-weight:600;letter-spacing:-.035em;line-height:1}

.setup{display:flex;flex-direction:column;margin-top:8px}
.setup-row{display:flex;align-items:center;gap:14px;padding:13px 0;border-top:1px solid var(--line)}
.setup-row:first-child{border-top:0}
.setup-row .ck{width:26px;height:26px;border-radius:50%;display:grid;place-items:center;flex:none;box-shadow:0 0 0 1.5px var(--line-3) inset;color:transparent}
.setup-row .ck svg{width:14px;height:14px;stroke:currentColor;fill:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}
.setup-row.done .ck{background:var(--ok);box-shadow:none;color:#04150D}
.setup-row .tx{flex:1;min-width:0}
.setup-row .tx b{display:block;font-weight:550;font-size:14px}
.setup-row .tx span{font-size:12.5px;color:var(--muted)}
.setup-row.done .tx b{color:var(--muted)}
.setup-head{display:flex;align-items:baseline;justify-content:space-between;gap:12px}
.setup-prog{font-size:12.5px;color:var(--muted);font-weight:500;white-space:nowrap}

.feed{display:flex;flex-direction:column}
.feed .row{display:flex;align-items:center;gap:12px;padding:11px 2px;font-size:13.5px;border-top:1px solid var(--line)}
.feed .row:first-child{border-top:0}
.feed .t{color:var(--dim);font-size:12.5px;width:46px;flex:none;font-family:var(--mono)}
.feed .p{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}


/* ---------- estrutura de cartões e formulários ---------- */
.card-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px 16px;flex-wrap:wrap;margin-bottom:6px}
.card-head>div:first-child{flex:1 1 260px;min-width:0}
.card-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.card-head input[type=search]{max-width:260px;min-height:38px}
.table-wrap{overflow-x:auto;margin-top:12px}
.toolbar{margin:16px 0 8px;display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:8px}
.grid.tight{gap:0 12px}
.link-btn{font-size:13px;font-weight:500;color:var(--acc-hi);padding:6px 2px;border-radius:6px}
.link-btn:hover{text-decoration:underline}
.link-btn.danger{color:var(--err);margin-top:14px}
.btn.icon{width:42px;min-width:42px;padding:0}
section[id^=aba-]:not([hidden]){animation:tabIn .32s var(--ease)}
@keyframes tabIn{from{opacity:0;transform:translateY(4px)}}

.filters{display:grid;grid-template-columns:auto 150px 170px 1fr;gap:12px 14px;align-items:end;margin-top:16px}
.filters label{margin-top:0}
.f-go{display:flex;justify-content:flex-end}

.steps-form{list-style:none;counter-reset:sf;display:grid;grid-template-columns:1.3fr 1fr .9fr;gap:14px;margin:16px 0 4px}
.steps-form li{counter-increment:sf;min-width:0}
.sf-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px;min-height:28px}
.sf-head label{margin:0;display:flex;align-items:center;gap:8px;color:var(--text);font-size:13.5px}
.sf-head label::before{content:counter(sf);width:20px;height:20px;border-radius:50%;display:grid;place-items:center;font-size:11.5px;font-weight:600;background:var(--acc-soft);color:var(--acc-hi);flex:none}
.sf-head label span{color:var(--dim);font-weight:400}
.sf-row{display:flex;gap:8px}
.sf-row select{flex:1;min-width:0}
.sf-range{display:flex;align-items:center;gap:8px}
.sf-range input{width:70px;text-align:center;flex:none}
.sf-range span{color:var(--muted);font-size:13px}
.sf-foot{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;margin-top:18px;padding-top:16px;border-top:1px solid var(--line)}
.toggle-row{display:flex;align-items:center;gap:12px;margin:0;font-size:14px;color:var(--text);cursor:pointer;font-weight:400}

.qr-box{margin-top:20px;grid-template-columns:1fr auto}
.pair h3{font-size:15px;margin-bottom:10px}
.howto{margin:0 0 6px 18px;color:var(--muted);font-size:13.5px;display:grid;gap:6px}
.howto b{color:var(--text);font-weight:500}
.howto li::marker{color:var(--acc-hi);font-weight:600}
.pairing-code{margin-top:12px}
.pair-actions{display:flex;gap:10px;margin-top:14px;flex-wrap:wrap}
.save-bar{display:flex;justify-content:flex-end;margin-top:4px}


/* ---------- abertura, acessibilidade, peças novas ---------- */
#splash{position:fixed;inset:0;z-index:200;display:grid;place-items:center;background:var(--bg)}
#splash span{width:56px;height:56px;border-radius:16px;display:grid;place-items:center;background:var(--acc-grad);color:#fff;font:700 28px/1 var(--font);letter-spacing:-.05em;animation:breathe 1.4s var(--ease) infinite alternate}
@keyframes breathe{from{opacity:.55;transform:scale(.96)}}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.prod .earn{font-size:14.5px;font-weight:600;color:var(--ok);margin-top:6px;letter-spacing:-.01em}
.prod .earn span{font-weight:400;color:var(--muted);font-size:12.5px}
.prod .check{transform:none;background:transparent;box-shadow:0 0 0 1.5px var(--line-3) inset;color:transparent;transition:background .2s,box-shadow .2s,color .2s}
.prod.sel .check{background:var(--acc);box-shadow:none;color:#fff}
.shop-link{font-size:12.5px;color:var(--acc-hi);display:inline-flex;align-items:center;min-height:32px}
.erro-msg{font-size:12.5px;color:var(--err);margin-top:4px;line-height:1.4}
.toast.warn::before{background:var(--warn);box-shadow:0 0 0 3px var(--warn-soft)}
.chip svg.ic{width:14px;height:14px;stroke:currentColor;fill:none;stroke-width:2.2;stroke-linecap:round;flex:none}
button.chip{font:inherit;font-size:13px}
button.pill{font:inherit;font-size:12.5px;cursor:pointer}
.setup-prog{display:flex;align-items:center;gap:4px}
.setup-prog i{width:18px;height:4px;border-radius:99px;background:var(--s3)}
.setup-prog i.on{background:var(--ok)}
.setup-prog b{font-weight:500;margin-left:6px}
.setup-row.next .tx b{color:var(--text)}
.setup-row.next .ck{box-shadow:0 0 0 1.5px var(--acc) inset}
.pulse{animation:pulseRing 1.3s var(--ease)}
@keyframes pulseRing{0%{box-shadow:0 0 0 0 rgba(61,123,255,.55),var(--sh-1)}100%{box-shadow:0 0 0 14px rgba(61,123,255,0),var(--sh-1)}}
.sair-card{display:none}
.switch::before{content:"";position:absolute;inset:-10px -8px}

/* ---------- tabelas ---------- */
table{width:100%;border-collapse:separate;border-spacing:0;font-size:14px}
th{font-size:12px;color:var(--dim);text-align:left;padding:8px 12px;font-weight:500;border-bottom:1px solid var(--line)}
td{padding:13px 12px;border-bottom:1px solid var(--line);vertical-align:middle}
tbody tr{transition:background .15s}
tbody tr:hover td{background:rgba(148,172,224,.035)}
tbody tr:last-child td{border-bottom:0}
td small.muted{font-family:var(--mono);font-size:11.5px;color:var(--dim)}
.tag{display:inline-flex;align-items:center;gap:6px;font-size:12px;font-weight:550;padding:3px 9px;border-radius:7px;white-space:nowrap;background:var(--s3);color:var(--muted)}
.tag::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor;opacity:.9}
.tag.wa{background:transparent;padding:0;color:var(--text);font-weight:500}
.tag.wa::before{display:none}
.tag.enviado{background:var(--ok-soft);color:var(--ok)}
.tag.pendente{background:var(--acc-soft);color:var(--acc-hi)}
.tag.falhou,.tag.cancelado{background:var(--err-soft);color:var(--err)}
.tag.clone{background:rgba(167,139,250,.14);color:#C4B5FD}
.actions-cell{white-space:nowrap;display:flex;gap:6px;justify-content:flex-end;align-items:center}

/* ---------- garimpo ---------- */
.prods{display:grid;grid-template-columns:repeat(auto-fill,minmax(310px,1fr));gap:12px}
.prod{display:flex;gap:14px;padding:12px;cursor:pointer;border-radius:16px;transition:border-color .2s,background .2s,box-shadow .2s;content-visibility:auto;contain-intrinsic-size:110px}
.prod:hover{border-color:var(--line-3);background:#0C1325}
.prod.sel{border-color:var(--acc);background:#0C1428;box-shadow:0 0 0 1px var(--acc),var(--sh-1)}
.prod img{width:84px;height:84px;object-fit:cover;border-radius:11px;background:var(--s3);flex:none}
.prod .nm{font-size:13.5px;font-weight:500;line-height:1.38;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;padding-right:22px}
.prod .mt{font-size:12.5px;color:var(--muted);margin-top:6px}
.prod .cm{color:var(--ok);font-weight:600}
.prod .check{position:absolute;top:10px;right:10px;width:22px;height:22px;border-radius:50%;background:var(--acc);color:#fff;display:grid;place-items:center;transform:scale(0);transition:transform .3s var(--ease)}
.prod.sel .check{transform:scale(1)}
.prod .check svg{width:13px;height:13px;stroke:currentColor;fill:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}
.selbar{position:sticky;bottom:16px;z-index:5;display:flex;align-items:center;gap:12px;padding:12px 14px;margin-top:18px;flex-wrap:wrap;border-radius:16px;box-shadow:var(--sh-2);animation:rise .4s var(--ease)}
@keyframes rise{from{transform:translateY(12px);opacity:0}}
.selbar .count{font-size:20px;font-weight:600;letter-spacing:-.03em}
.chips{display:flex;flex-wrap:wrap;gap:8px}
.chip{display:inline-flex;align-items:center;gap:7px;padding:7px 13px;border-radius:99px;background:var(--s2);border:1px solid var(--line);font-size:13px;font-weight:500;color:var(--muted);cursor:pointer;transition:all .2s;user-select:none}
.chip:hover{border-color:var(--line-3);color:var(--text)}
.chip.on,.chip.active{background:var(--text);color:#060A14;border-color:var(--text)}
.chip .badge-cat{font-size:11px;font-weight:600;padding:1px 7px;border-radius:99px;background:rgba(148,172,224,.12);color:inherit}
.chip.on .badge-cat,.chip.active .badge-cat{background:rgba(6,10,20,.12)}

/* ---------- WhatsApp: QR / código ---------- */
.qr-box{display:grid;grid-template-columns:auto 1fr;gap:28px;align-items:start}
.qr{width:208px;height:208px;border-radius:16px;background:#fff;padding:12px;display:grid;place-items:center;box-shadow:0 0 0 1px var(--line-2),0 20px 50px -24px rgba(0,0,0,.9)}
.qr img{width:100%;height:100%;image-rendering:pixelated;border-radius:4px}
.qr .empty{color:#5B6478;font-size:12.5px;text-align:center;padding:10px}
.qr-timer{height:3px;border-radius:2px;background:var(--s3);overflow:hidden;margin-top:12px}
.qr-timer i{display:block;height:100%;background:var(--acc);width:100%;transform-origin:left;transition:transform 1s linear}
.pairing-code{font-family:var(--mono);font-size:32px;font-weight:500;letter-spacing:.18em;text-align:center;padding:16px 10px;border-radius:14px;background:var(--bg);border:1px dashed var(--acc-line);color:var(--text);user-select:all;-webkit-user-select:all}

/* ---------- prévia WhatsApp (mimetiza o app, de propósito) ---------- */
.phone{border-radius:22px;padding:14px;background:#0b141a;border:1px solid var(--line);min-height:200px}
.phone .top{display:flex;align-items:center;gap:10px;padding:0 4px 12px;font-size:13px;color:#cfd8dc}
.phone .top .av{width:30px;height:30px;border-radius:50%;background:var(--acc-grad)}
.bubble{max-width:88%;background:#1f2c34;border-radius:12px;border-top-left-radius:3px;padding:8px;font-size:13.5px;line-height:1.45;color:#e9edef;white-space:pre-wrap;word-break:break-word;position:relative;box-shadow:0 1px 1px rgba(0,0,0,.3)}
.bubble .img{height:120px;border-radius:8px;background:linear-gradient(135deg,#2a3942,#1f2c34);display:grid;place-items:center;color:#8696a0;font-size:12px;margin-bottom:6px}
.bubble .time{display:block;text-align:right;font-size:10.5px;color:#8696a0;margin-top:4px}
.bubble a{color:#53bdeb}

/* ---------- toasts / modal / vazios ---------- */
#toasts{position:fixed;top:18px;right:18px;z-index:100;display:flex;flex-direction:column;gap:8px;max-width:380px}
.toast{padding:12px 16px 12px 38px;font-size:13.5px;display:flex;gap:12px;align-items:flex-start;border-radius:13px;background:rgba(14,22,41,.94);border:1px solid var(--line-2);box-shadow:var(--sh-2);animation:toastIn .45s var(--ease)}
.toast::before{content:"";position:absolute;left:15px;top:17px;width:8px;height:8px;border-radius:50%;background:var(--acc);box-shadow:0 0 0 3px var(--acc-soft)}
.toast.ok::before{background:var(--ok);box-shadow:0 0 0 3px var(--ok-soft)}
.toast.err::before{background:var(--err);box-shadow:0 0 0 3px var(--err-soft)}
.toast.out{animation:toastOut .25s ease-in forwards}
@keyframes toastIn{from{transform:translateY(-8px) scale(.98);opacity:0}}
@keyframes toastOut{to{transform:translateY(-6px);opacity:0}}
.overlay{position:fixed;inset:0;z-index:90;background:rgba(2,4,10,.66);backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);display:grid;place-items:center;animation:fade .2s}
.modal{width:min(440px,92vw);padding:24px;border-radius:20px;background:var(--s1);border:1px solid var(--line-2);box-shadow:var(--sh-2);animation:pop .35s var(--ease)}
.modal h3{font-size:18px;color:var(--text);margin-bottom:6px}
.modal p{color:var(--muted);font-size:14px;margin-bottom:20px}
.modal .row{display:flex;gap:10px;justify-content:flex-end}
@keyframes fade{from{opacity:0}}@keyframes pop{from{transform:translateY(8px) scale(.98);opacity:0}}
.skel{border-radius:12px;background:linear-gradient(90deg,var(--s1) 25%,var(--s2) 50%,var(--s1) 75%);background-size:200% 100%;animation:shimmer 1.4s infinite}
@keyframes shimmer{to{background-position:-200% 0}}
.empty{text-align:center;padding:36px 20px;color:var(--muted);font-size:13.5px}
.empty .glyph{width:40px;height:40px;margin:0 auto 12px;border-radius:12px;display:grid;place-items:center;background:var(--s2);border:1px solid var(--line-2);color:var(--dim);font-weight:700;font-size:17px}

.reveal{animation:reveal .5s var(--ease) both;animation-delay:calc(var(--i,0)*40ms)}
@keyframes reveal{from{opacity:0;transform:translateY(6px)}}

/* ---------- login ---------- */
#login{position:relative;z-index:2;min-height:100vh;min-height:100dvh;display:grid;place-items:center;padding:24px}
#login .box{width:min(380px,100%);padding:40px 32px 32px;text-align:center;border-radius:24px}
#login .omega{width:56px;height:56px;margin:0 auto 18px;display:grid;place-items:center;border-radius:16px;background:var(--acc-grad);color:#fff;font:700 28px/1 var(--font);letter-spacing:-.05em;box-shadow:0 1px 0 rgba(255,255,255,.25) inset,0 12px 26px -12px rgba(0,0,0,.8)}
#login h1{font-size:24px;letter-spacing:-.03em;margin-bottom:6px}
#login p{color:var(--muted);font-size:14px;margin-bottom:26px}
#login input{text-align:center;margin-bottom:10px;min-height:48px;font-size:16px}
#login .btn{width:100%;min-height:48px;font-size:15px}
#login .msg{min-height:20px;margin-top:12px;font-size:13px;color:var(--err)}

.install-banner{display:none}

/* =====================================================================
   CELULAR (≤920px): barra de app no topo, abas embaixo, tudo no polegar
   ===================================================================== */
@media (max-width:920px){
  body{font-size:15px}
  .shell{grid-template-columns:1fr}
  .sidebar{position:fixed;top:auto;height:auto;left:10px;right:10px;bottom:calc(10px + var(--safe-b));padding:6px;border:1px solid var(--line-2);border-radius:22px;flex-direction:row;align-items:center;z-index:50;background:rgba(10,15,30,.84);box-shadow:0 18px 40px -10px rgba(0,0,0,.95)}
  .brand,.side-foot{display:none}
  .nav{flex-direction:row;width:100%;justify-content:space-between;gap:0}
  .nav a{flex:1;flex-direction:column;justify-content:center;gap:3px;padding:8px 2px 6px;min-height:54px;font-size:11px;font-weight:500;border-radius:16px}
  .nav a svg{width:22px;height:22px;stroke-width:1.7}
  .nav a:hover:not(.on){background:transparent}
  .nav a .badge{position:absolute;top:4px;right:calc(50% - 22px);margin:0;min-width:17px;height:17px;font-size:10px;padding:0 5px;box-shadow:0 0 0 2px #0A0F1E}
  .nav-indicator{top:0;bottom:0;height:auto;border-radius:16px;background:var(--acc-soft);border-color:transparent;box-shadow:none}

  main{padding:0 16px calc(108px + var(--safe-b))}
  .mobile-status{display:flex;align-items:center;gap:8px;position:sticky;top:0;z-index:20;margin:0 -16px 4px;padding:calc(10px + var(--safe-t)) 16px 12px;background:linear-gradient(180deg,rgba(5,7,13,.97) 65%,rgba(5,7,13,0))}
  .mobile-status .mb{display:flex;align-items:center;gap:9px;margin-right:auto;font-weight:600;font-size:16px;letter-spacing:-.02em}
  .mobile-status .mb i{font-style:normal;width:30px;height:30px;border-radius:9px;display:grid;place-items:center;background:var(--acc-grad);color:#fff;font-weight:700;font-size:16px;letter-spacing:-.04em;box-shadow:0 1px 0 rgba(255,255,255,.25) inset}
  .mobile-status #st-shopee-m{display:none}
  .mobile-status .pill{height:32px;padding:0 12px;font-size:12.5px}
  .setup-row{gap:12px}
  .setup-row .btn{min-height:34px;padding:6px 12px;font-size:13px}
  .mobile-status .sair-m{width:32px;height:32px;border-radius:50%;display:grid;place-items:center;background:var(--s2);border:1px solid var(--line);color:var(--muted)}
  .mobile-status .sair-m svg{width:15px;height:15px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}

  .topbar{flex-direction:column;align-items:stretch;gap:12px;margin:6px 0 18px}
  .topbar h1{font-size:30px;letter-spacing:-.035em}
  .topbar p{font-size:14px}
  .topbar .actions:empty{display:none}
  .topbar .actions .btn{flex:1}

  .card{padding:18px 16px;margin-bottom:12px}
  .glass{border-radius:16px}
  .g2,.g3,.g4{grid-template-columns:1fr}
  .grid{gap:12px}

  #stats.kpis{grid-template-columns:1fr 1fr;margin-bottom:12px}
  .kpi{padding:16px 16px 14px}
  .kpi+.kpi{border-left:0}
  .kpi:nth-child(2n){border-left:1px solid var(--line)}
  .kpi:nth-child(n+3){border-top:1px solid var(--line)}
  .kpi .n{font-size:27px;margin-top:10px}
  .kpi .n.sm{font-size:16px;margin-top:14px}

  input,select,textarea{font-size:16px;min-height:48px;padding:12px 14px}
  textarea{font-size:14px;min-height:150px}
  .btn{min-height:46px;padding:11px 18px;font-size:15px}
  .btn.sm{min-height:40px;padding:8px 14px;font-size:14px}
  .chip{min-height:38px;padding:8px 14px}
  .seg{display:flex;width:100%}
  .seg button{flex:1;min-height:40px;padding:8px 4px}
  .switch{width:50px;height:30px}
  .switch::after{width:24px;height:24px}
  .switch.on::after{transform:translateX(20px)}

  .prods{grid-template-columns:1fr}
  .prod img{width:76px;height:76px}
  .selbar{position:fixed;left:10px;right:10px;bottom:calc(84px + var(--safe-b));margin:0;z-index:60;flex-direction:column;align-items:stretch;padding:14px;border-radius:20px}
  .selbar select,.selbar input{max-width:none!important;width:100%}
  .selbar .btn{width:100%}

  table,thead,tbody,tr,th,td{display:block}
  thead{display:none}
  tbody tr{padding:14px 2px;border-bottom:1px solid var(--line);display:grid;grid-template-columns:1fr auto;gap:6px 12px;align-items:center}
  tbody tr:last-child{border-bottom:0}
  tbody tr:hover td{background:transparent}
  td{padding:0;border:0;min-width:0;word-break:break-word}
  td:first-child{grid-column:1/-1;font-weight:500}
  td[colspan]{grid-column:1/-1}
  .actions-cell{justify-content:flex-start}
  td::before{content:attr(data-l);display:block;font-size:11.5px;color:var(--dim);margin-bottom:2px}
  td:not([data-l])::before{display:none}

  .overlay{place-items:end center}
  .modal{width:100%!important;max-width:none!important;border-radius:24px 24px 0 0;padding:10px 18px calc(20px + var(--safe-b));animation:sheet .4s var(--ease)}
  .modal::before{content:"";display:block;width:38px;height:4px;border-radius:99px;background:var(--line-3);margin:0 auto 16px}
  .modal .row{flex-direction:column-reverse}
  .modal .row .btn{width:100%}
  #toasts{left:12px;right:12px;top:calc(10px + var(--safe-t));max-width:none}

  .qr-box{grid-template-columns:1fr;justify-items:center;gap:20px}
  .qr-box>div:last-child{width:100%}
  .qr{width:min(220px,60vw);height:min(220px,60vw)}
  .pairing-code{font-size:28px}


  /* estrutura no celular */
  .card-head{flex-direction:column;align-items:stretch}
  .card-head>div:first-child{flex:none}
  .card-actions{width:100%}
  .card-actions .btn{flex:1}
  .card-actions .pill{flex:none}
  .card-head input[type=search]{max-width:none}
  .filters{grid-template-columns:1fr 1fr;gap:12px}
  .f-sort,.f-go{grid-column:1/-1}
  .f-go .btn{width:100%}
  .chips.scroller{flex-wrap:nowrap;overflow-x:auto;margin-left:-16px;margin-right:-16px;padding:2px 16px 4px;scroll-snap-type:x proximity;scrollbar-width:none;-webkit-mask-image:linear-gradient(90deg,transparent,#000 16px,#000 calc(100% - 24px),transparent)}
  .chips.scroller::-webkit-scrollbar{display:none}
  .chips.scroller .chip{flex:none;scroll-snap-align:start}
  .steps-form{grid-template-columns:1fr;gap:16px}
  .sf-range input{flex:1 1 0;width:0;min-width:0}
  .sf-head label span{display:none}
  .link-btn{white-space:nowrap}
  .sf-foot{flex-direction:column;align-items:stretch}
  .sf-foot .btn{width:100%}
  .toolbar .card-actions{width:auto}
  .qr-box{grid-template-columns:1fr}
  .qr-box .qr-col{display:none}
  .qr-box.qr-on .qr-col{display:block;justify-self:center;order:-1}
  .pair-actions{flex-direction:column}
  .pair-actions .btn{width:100%}
  .save-bar{position:sticky;bottom:calc(84px + var(--safe-b));z-index:30;margin:4px -4px 0;padding:10px;border-radius:18px;background:rgba(10,15,30,.86);backdrop-filter:var(--blur);-webkit-backdrop-filter:var(--blur);border:1px solid var(--line-2)}
  .save-bar .btn{width:100%}
  /* avisos aparecem embaixo, perto do polegar, acima da barra de abas */
  #toasts{top:auto;bottom:calc(84px + var(--safe-b));flex-direction:column-reverse}
  @keyframes toastIn{from{transform:translateY(10px) scale(.98);opacity:0}}

  /* alvos de toque de 44px (Apple HIG / NN/g) */
  .btn.sm,.seg button,.chip,.setup-row .btn,.card-actions .btn{min-height:44px}
  .link-btn,.shop-link{min-height:44px;display:inline-flex;align-items:center}
  .mobile-status .sair-m{display:none}
  .mobile-status .pill{height:36px;position:relative}
  .mobile-status .pill::after{content:"";position:absolute;inset:-4px -2px}
  .setup-head{flex-direction:column;align-items:flex-start;gap:8px}
  .sair-card{display:block}
  body[data-aba=config] #toasts,body.tem-sel #toasts{bottom:calc(84px + 78px + var(--safe-b))}
  body.tem-sel[data-aba=garimpo] #toasts{bottom:calc(84px + 250px + var(--safe-b))}
  .install-banner{display:flex;align-items:center;gap:12px;padding:12px 12px 12px 14px;margin-bottom:14px;border-radius:16px;background:linear-gradient(180deg,#0F1A36,#0B1328);border:1px solid var(--line-2)}
  .install-banner[hidden]{display:none}
  .install-banner b{font-size:14px;font-weight:600;display:block}
  .install-banner span{font-size:12.5px;color:var(--muted);display:block}
  .install-banner .btn{margin-left:auto;min-height:38px;padding:8px 14px;font-size:14px}
}
@media (min-width:921px) and (max-width:1180px){
  main{padding:30px 28px 60px}
  #stats.kpis{grid-template-columns:repeat(2,1fr)}
  .kpi:nth-child(3){border-left:0}
  .kpi:nth-child(n+3){border-top:1px solid var(--line)}
}
@keyframes sheet{from{transform:translateY(40%);opacity:.4}}
@media (display-mode:standalone){body{-webkit-user-select:none;user-select:none}input,textarea,.pairing-code{-webkit-user-select:text;user-select:text}.install-banner{display:none!important}}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important}}
