:root{
    --ui:#2B5C8A; --ui-dark:#1D4064; --ui-light:#E7EEF5;
    --bg:#F6F6F4; --card:#FFFFFF; --text:#1C1C1A; --muted:#6B6B64; --border:#E3E1DA;
    --danger:#B23A32; --danger-bg:#FCEBEB; --ok:#3B6D11; --ok-bg:#EAF3DE; --warn:#854F0B; --warn-bg:#FAEEDA;
    --wa:#1E9E4F; --loja:#2B5C8A;
  }
  *{box-sizing:border-box;}
  body{margin:0; font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif; background:var(--bg); color:var(--text);}
  button, input, select, textarea{font-family:inherit;}

  /* ---------- base ---------- */
  .wrap{max-width:720px; margin:0 auto; padding:16px 16px 40px;}
  .topbar{background:var(--ui); color:#fff; padding:14px 16px;}
  .topbar-in{max-width:720px; margin:0 auto; display:flex; align-items:center; justify-content:space-between; gap:10px;}
  .brand{font-weight:700; font-size:15px;}
  .brand small{display:block; font-weight:400; font-size:11.5px; opacity:0.8;}
  .nav{display:flex; gap:4px; flex-wrap:wrap; justify-content:flex-end;}
  .nav button{background:transparent; border:none; color:#fff; opacity:0.75; font-size:13px; padding:7px 9px; border-radius:8px; cursor:pointer;}
  .nav button.on{opacity:1; background:rgba(255,255,255,0.16); font-weight:600;}
  h1{font-size:19px; margin:4px 0 4px;}
  h2{font-size:15px; margin:0 0 10px;}
  .sub{font-size:13px; color:var(--muted); margin:0 0 16px; line-height:1.5;}
  .card{background:var(--card); border:1px solid var(--border); border-radius:14px; padding:16px; margin-bottom:14px;}
  .row{display:flex; gap:10px; align-items:center;}
  .between{display:flex; justify-content:space-between; align-items:center; gap:10px;}
  .grow{flex:1; min-width:0;}
  .l{display:block; font-size:12.5px; font-weight:600; margin:0 0 6px;}
  .opt{font-weight:400; color:var(--muted);}
  .field{margin-bottom:14px;}
  .in{width:100%; padding:10px 12px; border:1px solid var(--border); border-radius:9px; font-size:14px; background:#fff; color:var(--text);}
  .in:focus{outline:2px solid var(--ui-light); border-color:var(--ui);}
  .help{font-size:11.5px; color:var(--muted); margin:6px 0 0; line-height:1.45;}
  .err{font-size:12.5px; color:var(--danger); margin:8px 0 0;}
  .btn{display:inline-block; text-align:center; text-decoration:none; border:none; border-radius:10px; padding:11px 16px; font-size:14px; font-weight:600; cursor:pointer; background:var(--ui); color:#fff;}
  .btn.block{display:block; width:100%;}
  .btn.ghost{background:#fff; color:var(--ui-dark); border:1.5px solid var(--border);}
  .btn.wa{background:var(--wa);}
  .btn.danger{background:#fff; color:var(--danger); border:1.5px solid #F09595;}
  .btn.small{padding:7px 11px; font-size:12.5px;}
  .btn:disabled{opacity:0.5; cursor:not-allowed;}
  .linkbtn{background:none; border:none; color:var(--ui); font-size:13px; cursor:pointer; padding:0; text-decoration:underline;}
  .actions{display:flex; gap:10px; margin-top:6px; flex-wrap:wrap;}
  .actions .btn{flex:1;}
  .seg{display:flex; gap:8px;}
  .seg button{flex:1; padding:10px 6px; border-radius:10px; border:1.5px solid var(--border); background:#fff; font-size:13px; font-weight:600; color:var(--muted); cursor:pointer;}
  .seg button.on{border-color:var(--ui); color:var(--ui); background:var(--ui-light);}
  .chips{display:flex; flex-wrap:wrap; gap:8px;}
  .chip{padding:8px 12px; border-radius:20px; border:1px solid var(--border); background:#fff; font-size:12.5px; color:var(--muted); cursor:pointer;}
  .chip.on{background:var(--ui); border-color:var(--ui); color:#fff;}
  .pill{display:inline-block; font-size:11px; font-weight:600; padding:3px 8px; border-radius:20px; background:var(--ui-light); color:var(--ui-dark);}
  .pill.ok{background:var(--ok-bg); color:var(--ok);}
  .pill.warn{background:var(--warn-bg); color:var(--warn);}
  .pill.danger{background:var(--danger-bg); color:var(--danger);}
  .notice{font-size:12.5px; line-height:1.5; border-radius:10px; padding:10px 12px; margin-bottom:14px;}
  .notice.ok{background:var(--ok-bg); color:var(--ok);}
  .notice.warn{background:var(--warn-bg); color:var(--warn);}
  .notice.info{background:var(--ui-light); color:var(--ui-dark);}
  .notice.danger{background:var(--danger-bg); color:var(--danger);}
  .logo{width:44px; height:44px; border-radius:11px; display:flex; align-items:center; justify-content:center; color:#fff; font-weight:700; font-size:14px; flex-shrink:0; overflow:hidden;}
  .logo img{width:100%; height:100%; object-fit:cover;}
  .loja-item{display:flex; gap:12px; align-items:center; padding:12px; border:1px solid var(--border); border-radius:12px; background:#fff; margin-bottom:10px; cursor:pointer;}
  .t-name{font-weight:600; font-size:14px; margin:0;}
  .t-meta{font-size:12px; color:var(--muted); margin:2px 0 0;}
  .url{font-size:12.5px; color:var(--ui-dark); word-break:break-all;}
  .urllink{background:none; border:none; padding:0; color:var(--ui-dark); font-size:12.5px; text-decoration:underline; cursor:pointer; word-break:break-all; text-align:left;}
  .steps{display:flex; gap:6px; margin-bottom:16px;}
  .steps div{flex:1; height:4px; border-radius:4px; background:var(--border);}
  .steps div.on{background:var(--ui);}
  .step-label{font-size:11.5px; color:var(--muted); text-transform:uppercase; letter-spacing:0.04em; margin:0 0 4px;}
  .upload{display:flex; align-items:center; gap:12px; flex-wrap:wrap;}
  .thumb{width:56px; height:56px; border-radius:12px; background:#EEE; display:flex; align-items:center; justify-content:center; color:#999; font-size:11px; overflow:hidden; flex-shrink:0;}
  .thumb img{width:100%; height:100%; object-fit:cover;}
  .colorrow{display:flex; align-items:center; gap:10px;}
  .colorrow input[type=color], input.cor{width:44px; height:38px; border:1px solid var(--border); border-radius:8px; padding:0; background:#fff;}
  .prod{display:flex; gap:10px; align-items:center; padding:9px 0; border-bottom:1px solid var(--border);}
  .prod:last-child{border-bottom:none;}
  .prod-thumb{width:40px; height:40px; border-radius:8px; background:#EEE; flex-shrink:0; overflow:hidden; display:flex; align-items:center; justify-content:center; font-size:11px; color:#999; font-weight:700;}
  .prod-thumb img{width:100%; height:100%; object-fit:cover;}
  .switch{display:flex; align-items:center; gap:6px; font-size:11.5px; color:var(--muted); cursor:pointer; background:none; border:none; padding:0;}
  .track{width:32px; height:18px; border-radius:10px; background:#D8D6CE; position:relative; display:inline-block;}
  .track.on{background:var(--ok);}
  .knob{position:absolute; top:2px; left:2px; width:14px; height:14px; border-radius:50%; background:#fff; transition:left 0.15s;}
  .track.on .knob{left:16px;}
  .qrbox{display:flex; flex-direction:column; align-items:center; gap:10px; padding:8px 0;}
  #qr{background:#fff; padding:10px; border-radius:12px; border:1px solid var(--border); min-height:60px; min-width:60px;}
  .big-check{width:54px; height:54px; border-radius:50%; background:var(--ok-bg); color:var(--ok); display:flex; align-items:center; justify-content:center; font-size:26px; margin:0 auto 10px;}
  .pedido{border:1px solid var(--border); border-radius:12px; padding:12px; background:#fff; margin-bottom:10px;}
  .pedido.novo{border-color:var(--wa); box-shadow:0 0 0 2px #CDEBD6;}
  .pedido-itens{font-size:13px; margin:8px 0; line-height:1.6;}
  .kv{font-size:12.5px; color:var(--muted); margin:2px 0; line-height:1.5;}
  .kv b{color:var(--text); font-weight:600;}
  .stats{display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:14px;}
  .stat{background:#fff; border:1px solid var(--border); border-radius:12px; padding:12px;}
  .stat-n{font-size:18px; font-weight:700;}
  .stat-l{font-size:11.5px; color:var(--muted); margin-top:2px;}
  .tabs{display:flex; border-bottom:1px solid var(--border); margin-bottom:14px;}
  .tabs button{flex:1; background:none; border:none; padding:11px 0; font-size:13.5px; font-weight:600; color:var(--muted); border-bottom:2px solid transparent; cursor:pointer;}
  .tabs button.on{color:var(--text); border-bottom-color:var(--loja);}
  .lj-head{background:var(--loja); color:#fff; padding:16px;}
  .impersona{background:var(--warn-bg); color:var(--warn); font-size:12.5px; padding:9px 16px; text-align:center;}
  .impersona button{background:none; border:none; color:var(--warn); text-decoration:underline; font-weight:600; cursor:pointer; font-size:12.5px;}
  .hist{display:flex; justify-content:space-between; align-items:center; font-size:12.5px; padding:9px 0; border-bottom:1px solid var(--border); gap:8px;}
  .hist:last-child{border-bottom:none;}
  .progress{height:6px; border-radius:6px; background:var(--border); overflow:hidden; margin:10px 0 6px;}
  .progress div{height:100%; background:var(--ui); width:0; transition:width 0.4s;}
  pre.code{white-space:pre-wrap; font-size:12px; background:#F4F3EF; border-radius:8px; padding:10px; margin:8px 0 0;}
  details summary{cursor:pointer; font-size:13px; font-weight:600;}
  .toast{position:fixed; left:50%; bottom:96px; transform:translateX(-50%); background:#1C1C1A; color:#fff; padding:10px 16px; border-radius:10px; font-size:13px; z-index:99; display:none; max-width:90%;}
  .demo{font-size:12px; color:var(--muted); background:#fff; border:1px dashed var(--border); border-radius:10px; padding:10px 12px; line-height:1.6;}
  .sr{position:absolute; left:-9999px;}
  .pw{position:relative;}
  .pw button{position:absolute; right:8px; top:50%; transform:translateY(-50%); background:none; border:none; color:var(--muted); font-size:12px; cursor:pointer;}

  /* ---------- site institucional ---------- */
  .hero{background:#1C1C1A; color:#fff; padding:40px 20px;}
  .hero h1{font-size:24px;}
  .hero p{opacity:0.8; font-size:14px; line-height:1.6; max-width:520px;}

  a{color:var(--ui-dark);}
  .loja-item{text-decoration:none; color:inherit;}
  .busca{position:relative; margin-bottom:10px;}
  .busca input{width:100%; padding:11px 36px 11px 38px; border:1px solid var(--border); border-radius:11px; font-size:15px; background:#fff;}
  .busca:before{content:""; position:absolute; left:13px; top:50%; width:13px; height:13px; margin-top:-8px; border:2px solid #9A978E; border-radius:50%;}
  .busca:after{content:""; position:absolute; left:26px; top:50%; width:7px; height:2px; margin-top:5px; background:#9A978E; transform:rotate(45deg);}
  .busca button{position:absolute; right:6px; top:50%; transform:translateY(-50%); border:none; background:none; font-size:18px; color:var(--muted); cursor:pointer; padding:6px;}
  .chips.rolar{flex-wrap:nowrap; overflow-x:auto; -webkit-overflow-scrolling:touch; padding-bottom:4px; scrollbar-width:none;}
  .chips.rolar::-webkit-scrollbar{display:none;}
  .chips.rolar .chip{flex-shrink:0; white-space:nowrap;}
  .preco-edit{border:1px dashed var(--border); background:#fff; border-radius:8px; padding:5px 8px; font-size:13px; font-weight:700; cursor:pointer; color:var(--text); white-space:nowrap;}
  .preco-in{width:92px; padding:6px 8px; border:1.5px solid var(--ui); border-radius:8px; font-size:14px; font-weight:700;}
  .modal-fundo{position:fixed; inset:0; background:rgba(0,0,0,0.45); z-index:80; display:flex; align-items:flex-end; justify-content:center;}
  .modal{background:var(--bg); width:100%; max-width:720px; max-height:94vh; overflow-y:auto; border-radius:18px 18px 0 0; padding:18px 16px 28px;}
  @media(min-width:760px){ .modal-fundo{align-items:center;} .modal{border-radius:18px;} }
  .var-linha{display:grid; grid-template-columns:1fr 96px 40px; gap:8px; align-items:center; padding:7px 0; border-bottom:1px solid var(--border); font-size:13px;}
  .vazio{text-align:center; color:var(--muted); font-size:13.5px; padding:26px 10px; line-height:1.6;}
  .carregando{text-align:center; color:var(--muted); padding:60px 0; font-size:14px;}
  table.t{width:100%; border-collapse:collapse; font-size:13px;}
  table.t td{padding:8px 4px; border-bottom:1px solid var(--border); vertical-align:top;}
  input[type=search]::-webkit-search-cancel-button{display:none;}
