:root{
  --bg:#F2F2F7;--ink:#1D1D1F;--soft:#3A3A3C;--muted:#6E6E73;--line:rgba(0,0,0,.08);--fill:rgba(118,118,128,.12);
  --orange:#EF6A01;--orange-strong:#C94F00;--orange-ink:#A34000;--orange-tint:#FFF1E5;--orange-wash:#FFF8F2;
  --navy:#00205B;--green:#17703C;--green-tint:#E6F4EA;--red:#B3261E;--red-tint:#FDECEA;--amber-tint:#FFF6DC;--amber-ink:#8A5A00;
  --card-shadow:0 1px 2px rgba(0,0,0,.04),0 0 0 .5px rgba(0,0,0,.05);
  --font:-apple-system,BlinkMacSystemFont,'SF Pro Text',Inter,system-ui,sans-serif;
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;min-height:100vh;background:var(--bg);color:var(--ink);font-family:var(--font);-webkit-font-smoothing:antialiased;font-size:15px;line-height:1.4}
body::before,body::after{content:"";position:fixed;z-index:-1;border-radius:50%;pointer-events:none}
body::before{top:-280px;right:-160px;width:780px;height:780px;background:radial-gradient(circle at center,rgba(239,106,1,.24),rgba(239,106,1,0) 68%)}
body::after{bottom:-320px;left:80px;width:860px;height:860px;background:radial-gradient(circle at center,rgba(0,72,190,.13),rgba(0,72,190,0) 68%)}
a{color:#B44700}
a:hover{color:#8A3600}
button,input,select,textarea{font:inherit;color:inherit}
input::placeholder,textarea::placeholder{color:#8A8A8E}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:2px solid var(--orange);outline-offset:2px}
[hidden]{display:none!important}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

.glass{position:relative;isolation:isolate;background:rgba(255,255,255,.56);-webkit-backdrop-filter:blur(28px) saturate(190%);backdrop-filter:blur(28px) saturate(190%);border:1px solid rgba(255,255,255,.78);box-shadow:inset 0 1px 0 rgba(255,255,255,.95),inset 0 -1px 0 rgba(255,255,255,.35),0 0 0 .5px rgba(0,0,0,.06),0 24px 60px -18px rgba(0,32,91,.22)}
.glass::before{content:"";z-index:-1;position:absolute;inset:0;border-radius:inherit;pointer-events:none;background:linear-gradient(135deg,rgba(255,255,255,.7),rgba(255,255,255,0) 38%,rgba(255,255,255,0) 64%,rgba(255,255,255,.32))}
.press{transition:transform .18s cubic-bezier(.3,.7,.4,1.4)}
.press:active{transform:scale(.97)}

/* Estrutura */
.app{display:flex;gap:20px;padding:20px;max-width:1480px;margin:0 auto;align-items:flex-start}
.menu{position:sticky;top:20px;flex:0 0 248px;border-radius:30px;padding:22px 14px 14px;display:flex;flex-direction:column;gap:4px}
.menu .logo{width:128px;height:auto;display:block;margin:0 12px 22px}
.menu-item{display:flex;align-items:center;gap:12px;min-height:44px;padding:0 12px;border-radius:14px;color:var(--ink);font-size:15px;font-weight:500;text-decoration:none}
.menu-item:hover{color:var(--ink);background:rgba(255,255,255,.5)}
.menu-item[aria-current="page"]{background:rgba(239,106,1,.13);color:var(--orange-ink);font-weight:600}
.menu .grupo{font-size:12px;font-weight:600;color:var(--muted);padding:18px 12px 6px}
.menu .sep{height:1px;background:rgba(0,0,0,.07);margin:14px 8px}
.menu .usuario{display:flex;align-items:center;gap:10px;margin-top:18px;padding:10px;border-radius:18px;background:rgba(255,255,255,.6)}
.menu .usuario .quem{display:flex;flex-direction:column;min-width:0;flex:1}
.menu .usuario strong{font-size:14px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.menu .usuario small{font-size:12px;color:var(--muted)}
.avatar{width:36px;height:36px;border-radius:50%;background:var(--navy);color:#fff;display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:700;flex:none}
.sair{width:36px;height:36px;border-radius:50%;border:0;background:transparent;color:var(--muted);display:flex;align-items:center;justify-content:center;cursor:pointer;flex:none}
.sair:hover{background:rgba(0,0,0,.05);color:var(--ink)}
.conteudo{flex:1;min-width:0;display:flex;flex-direction:column;gap:20px;padding:8px 4px 40px}
.cabecalho{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:16px;padding:4px 4px 0}
.cabecalho h1{margin:0;font-size:36px;line-height:1.1;font-weight:700;letter-spacing:-.025em}
.cabecalho p{margin:6px 0 0;font-size:16px;color:var(--muted)}
.migalha{font-size:13px;color:var(--muted);font-weight:500;margin-bottom:6px}
.migalha a{color:var(--muted);text-decoration:none}
.topo-mobile{display:none}
.tabbar{display:none}
.colunas{display:flex;flex-wrap:wrap;gap:20px;align-items:flex-start}
.colunas>.principal{flex:999 1 520px;min-width:0;display:flex;flex-direction:column;gap:18px}
.colunas>.lado{flex:1 1 340px;min-width:0}

@media (max-width:900px){
  .app{display:block;padding:0 16px calc(110px + env(safe-area-inset-bottom))}
  .menu{display:none}
  .conteudo{padding:0}
  .topo-mobile{display:flex;align-items:center;justify-content:space-between;padding:calc(14px + env(safe-area-inset-top)) 0 4px}
  .topo-mobile img{width:76px;height:auto;display:block}
  .cabecalho h1{font-size:32px}
  .tabbar{display:flex;position:fixed;left:16px;right:16px;bottom:calc(16px + env(safe-area-inset-bottom));height:64px;border-radius:999px;padding:4px;gap:2px;z-index:50}
  .tabbar a{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;border-radius:999px;color:var(--ink);text-decoration:none;font-size:11px;font-weight:600}
  .tabbar a[aria-current="page"]{background:rgba(118,118,128,.14);color:var(--orange-ink);font-weight:700}
  .resumo{position:static!important}
}

/* Blocos */
.card{background:#fff;border-radius:26px;padding:22px;box-shadow:var(--card-shadow)}
.card-tabela{background:#fff;border-radius:26px;box-shadow:var(--card-shadow);overflow:hidden}
.secao-topo{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:8px 12px;margin-bottom:16px}
.secao-titulo{display:flex;align-items:center;gap:10px}
.secao-titulo h2{margin:0;font-size:20px;font-weight:700;letter-spacing:-.01em}
.num{width:28px;height:28px;border-radius:50%;background:var(--orange-tint);color:var(--orange-ink);display:inline-flex;align-items:center;justify-content:center;font-size:14px;font-weight:700;flex:none}
.dica{font-size:13px;color:var(--muted)}
.erro{color:var(--red);font-size:14px;background:var(--red-tint);border-radius:12px;padding:10px 12px}
.aviso{font-size:14px;background:var(--orange-tint);color:var(--orange-ink);border-radius:14px;padding:12px 14px}
.carregando{color:var(--muted);padding:32px;text-align:center}
.vazio{padding:40px 20px;text-align:center;color:var(--muted);display:flex;flex-direction:column;align-items:center;gap:10px}
.vazio strong{color:var(--ink);font-size:17px}

/* Botões */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:44px;padding:0 18px;border-radius:999px;border:0;font-size:15px;font-weight:600;cursor:pointer;text-decoration:none;white-space:nowrap;transition:transform .18s cubic-bezier(.3,.7,.4,1.4)}
.btn:active{transform:scale(.97)}
.btn-primario{background:var(--orange-strong);color:#fff;box-shadow:inset 0 1px 0 rgba(255,255,255,.35)}
.btn-primario:hover{background:#B44700;color:#fff}
.btn-sec{background:rgba(255,255,255,.85);color:var(--ink);border:.5px solid rgba(0,0,0,.08);box-shadow:inset 0 1px 0 #fff}
.btn-sec:hover{color:var(--ink);background:#fff}
.btn-perigo{background:var(--red-tint);color:var(--red)}
.btn-grande{height:54px;font-size:17px}
.btn-icone{width:44px;height:44px;padding:0;border-radius:50%}
.btn[disabled]{opacity:.5;cursor:not-allowed}
.link{color:#B44700;font-weight:500;text-decoration:none;background:none;border:0;padding:0;cursor:pointer;font-size:15px}
.link:hover{color:#8A3600}
.seta{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:50%;border:0;background:transparent;color:var(--muted);cursor:pointer;text-decoration:none}
.seta:hover{background:var(--bg);color:var(--ink)}

/* Formulários */
.campo{display:flex;flex-direction:column;gap:6px;min-width:0}
.campo>label,.rotulo{font-size:13px;font-weight:600;color:var(--soft)}
.input{height:48px;border-radius:14px;border:0;background:var(--fill);padding:0 14px;font-size:16px;color:var(--ink);width:100%;min-width:0}
.input:focus{outline:2px solid var(--orange);outline-offset:0;background:#fff}
select.input{appearance:none;background-image:linear-gradient(45deg,transparent 50%,#6E6E73 50%),linear-gradient(135deg,#6E6E73 50%,transparent 50%);background-position:calc(100% - 20px) 21px,calc(100% - 15px) 21px;background-size:5px 5px;background-repeat:no-repeat;padding-right:36px}
textarea.input{height:auto;min-height:88px;padding:12px 14px;resize:vertical;line-height:1.4}
.input-prefixo{display:flex;align-items:center;gap:8px;height:48px;border-radius:14px;background:var(--fill);padding:0 14px}
.input-prefixo>span{color:var(--muted);font-size:16px}
.input-prefixo input{flex:1;min-width:0;height:100%;border:0;background:transparent;font-size:16px;color:var(--ink)}
.input-prefixo input:focus{outline:none}
.input-prefixo:focus-within{outline:2px solid var(--orange);background:#fff}
.grade-2{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px}
.grade-3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.chips{display:flex;flex-wrap:wrap;gap:8px}
.chip{height:40px;padding:0 16px;border-radius:999px;border:1.5px solid rgba(0,0,0,.1);background:#fff;color:var(--ink);font-size:14px;font-weight:600;cursor:pointer}
.chip[aria-pressed="true"],.chip[aria-checked="true"]{border-color:var(--orange);background:var(--orange-tint);color:var(--orange-ink)}
.chip.novo{border-style:dashed;border-color:rgba(0,0,0,.2);background:transparent;color:var(--orange-ink)}
.chip.novo[aria-pressed="true"]{border-color:var(--orange);background:var(--orange-tint)}
.seg{display:flex;gap:2px;padding:3px;border-radius:999px;background:var(--fill)}
.seg button{flex:1;height:38px;padding:0 14px;border:0;border-radius:999px;background:transparent;color:var(--ink);font-size:14px;font-weight:600;cursor:pointer;white-space:nowrap}
.seg button[aria-checked="true"],.seg button[aria-selected="true"]{background:#fff;box-shadow:0 3px 8px rgba(0,0,0,.1)}
.seg.vidro{background:transparent;padding:4px}
.seg.vidro button{height:40px;padding:0 18px;font-size:15px}
.contador{font-size:12px;font-weight:600;color:#48484D;background:rgba(118,118,128,.14);border-radius:999px;padding:2px 8px;margin-left:6px}
.switch{position:relative;width:52px;height:32px;border-radius:999px;border:0;padding:0;background:#D1D1D6;cursor:pointer;flex:none;transition:background .2s}
.switch::after{content:"";position:absolute;top:2px;left:2px;width:28px;height:28px;border-radius:50%;background:#fff;box-shadow:0 2px 6px rgba(0,0,0,.2);transition:left .22s cubic-bezier(.3,.7,.4,1.3)}
.switch[aria-checked="true"]{background:#30A14E}
.switch[aria-checked="true"]::after{left:22px}

/* Opções selecionáveis */
.opcoes{display:flex;flex-direction:column;gap:8px}
.opcao{display:flex;flex-wrap:wrap;align-items:center;gap:12px 14px;width:100%;text-align:left;padding:12px 16px;border-radius:18px;border:1.5px solid rgba(0,0,0,.07);background:#fff;color:inherit;cursor:pointer}
.opcao[aria-pressed="true"],.opcao[aria-checked="true"]{border-color:var(--orange);background:var(--orange-wash)}
.opcao .texto{display:flex;flex-direction:column;gap:2px;flex:1 1 200px;min-width:0}
.opcao .texto strong{font-size:16px;font-weight:600}
.opcao .texto span{font-size:13px;color:var(--muted)}
.opcao .valor{font-size:15px;font-weight:600;font-variant-numeric:tabular-nums;white-space:nowrap}
.radio{width:22px;height:22px;border-radius:50%;border:2px solid #AEAEB2;display:flex;align-items:center;justify-content:center;flex:none}
[aria-checked="true"]>.radio,[aria-pressed="true"]>.radio{border-color:var(--orange)}
[aria-checked="true"]>.radio::after,[aria-pressed="true"]>.radio::after{content:"";width:10px;height:10px;border-radius:50%;background:var(--orange)}
.check{width:24px;height:24px;border-radius:7px;border:2px solid #AEAEB2;display:flex;align-items:center;justify-content:center;flex:none;color:#fff}
[aria-checked="true"]>.check{background:var(--orange);border-color:var(--orange)}
.pill{display:inline-flex;align-items:center;height:28px;padding:0 12px;border-radius:999px;font-size:13px;font-weight:600;white-space:nowrap;font-variant-numeric:tabular-nums}
.pill.compativel{background:var(--green-tint);color:var(--green)}
.pill.sobrecarga{background:var(--orange-tint);color:var(--orange-ink)}
.pill.folgado{background:#EDEDF2;color:#48484D}
.tag{font-size:13px;color:var(--soft);background:var(--bg);border-radius:999px;padding:4px 10px;white-space:nowrap}

/* Tabelas e listas */
.tabela-wrap{overflow-x:auto}
.tbl{width:100%;border-collapse:collapse}
.tbl th{font-size:12px;font-weight:600;color:var(--muted);text-align:left;padding:12px 16px;white-space:nowrap;border-bottom:.5px solid rgba(0,0,0,.1)}
.tbl td{font-size:14px;padding:12px 16px;border-bottom:.5px solid rgba(0,0,0,.07);white-space:nowrap;font-variant-numeric:tabular-nums}
.tbl tbody tr:last-child td{border-bottom:0}
.tbl tbody tr:hover td{background:#FAFAFC}
.tbl .nome{display:flex;align-items:center;gap:12px}
.tbl .nome>span:last-child{display:flex;flex-direction:column;gap:2px}
.tbl .nome small{font-size:13px;color:var(--muted)}
.icone-item{width:40px;height:40px;border-radius:11px;display:flex;align-items:center;justify-content:center;flex:none}
.icone-item.kit{background:var(--orange-tint);color:var(--orange-strong)}
.icone-item.placa{background:#EEF3FB;color:#1E3E80}
.icone-item.inversor{background:var(--bg);color:var(--navy)}
.icone-item.padrao{background:var(--amber-tint);color:var(--amber-ink)}
.lista{background:#fff;border-radius:26px;overflow:hidden;box-shadow:var(--card-shadow)}
.lista-item{display:flex;align-items:center;gap:12px;width:100%;min-height:68px;padding:10px 16px;border:0;border-bottom:.5px solid var(--line);background:#fff;color:inherit;text-decoration:none;text-align:left;cursor:pointer}
.lista-item:last-child{border-bottom:0}
.lista-item:hover{color:inherit;background:#FAFAFC}
.lista-item .texto{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}
.lista-item .texto strong{font-size:16px;font-weight:600}
.lista-item .texto span{font-size:13px;color:var(--muted)}
.lista-item .valor{font-size:14px;font-weight:600;font-variant-numeric:tabular-nums;white-space:nowrap}
.busca{display:flex;align-items:center;gap:10px;background:var(--bg);border-radius:12px;padding:0 12px;height:40px;flex:0 1 340px;min-width:200px}
.busca input{flex:1;min-width:0;height:100%;border:0;background:transparent;font-size:15px}
.busca input:focus{outline:none}
.busca:focus-within{outline:2px solid var(--orange)}

/* Resumo lateral */
.resumo{position:sticky;top:20px;border-radius:32px;padding:24px;display:flex;flex-direction:column;gap:18px}
.bloco{display:flex;flex-direction:column;border-radius:18px;background:rgba(255,255,255,.62);padding:4px 14px;font-variant-numeric:tabular-nums}
.bloco .linha{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:11px 0;font-size:14px;border-bottom:.5px solid rgba(0,0,0,.1)}
.bloco .linha:last-child{border-bottom:0}
.bloco .linha>span:first-child{color:var(--soft)}
.bloco .linha>span:last-child{font-weight:600;text-align:right}
.verde{color:var(--green)!important}

/* Folha (dialog) */
.sheet-fundo{position:fixed;inset:0;background:rgba(20,20,30,.24);display:flex;align-items:flex-start;justify-content:center;padding:10vh 16px 16px;z-index:100;overflow-y:auto}
.sheet{width:100%;max-width:560px;border-radius:34px;padding:22px 24px 24px;background:rgba(255,255,255,.86)!important;display:flex;flex-direction:column;gap:18px}
.sheet-topo{display:flex;align-items:center;justify-content:space-between;gap:12px}
.sheet-topo h2{margin:0;font-size:17px;font-weight:600;text-align:center}
@media (max-width:640px){
  .sheet-fundo{align-items:flex-end;padding:0 8px 8px}
  .sheet{max-height:92vh;overflow-y:auto;padding:18px 18px 24px}
  .grade-3{grid-template-columns:1fr}
}
.toast{position:fixed;left:50%;bottom:28px;transform:translateX(-50%);max-width:calc(100% - 32px);background:rgba(29,29,31,.92);color:#fff;padding:12px 18px;border-radius:999px;font-size:14px;font-weight:600;z-index:200;box-shadow:0 10px 30px rgba(0,0,0,.25)}
.toast.erro-toast{background:var(--red)}
@media (max-width:900px){.toast{bottom:calc(96px + env(safe-area-inset-bottom))}}
