:root{--navy:#0b1033;--blue:#151c4c;--panel:#202858;--line:#b1c8ff2a;--ink:#f2f7ff;--muted:#adbbdc;--mint:#36e6c3;--danger:#ffbeac;--yellow:#f6d997}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;font-family:Inter,ui-sans-serif,system-ui,-apple-system,Segoe UI,Arial,sans-serif;background:radial-gradient(ellipse at 80% 3%,#34338a66,transparent 45%),var(--navy);color:var(--ink)}body{font-size:14px}a{color:#6decd2}button,input,select,textarea{font:inherit}button{cursor:pointer}button:disabled{opacity:.42;cursor:not-allowed}.hidden{display:none!important}*:focus-visible{outline:2px solid var(--mint);outline-offset:3px}h1,h2,h3,p{margin-top:0}h1{font-size:clamp(26px,3.2vw,43px);line-height:1.15;letter-spacing:-1.2px;margin:8px 0 14px}h2{font-size:22px;letter-spacing:-.5px;margin:0 0 9px}h3{font-size:16px;margin:0 0 13px}.small{font-size:12px;color:#9faed1;line-height:1.65}p{color:var(--muted);line-height:1.65}
.head{height:72px;background:#090d2bde;border-bottom:1px solid var(--line);position:sticky;top:0;z-index:40;backdrop-filter:blur(12px)}.head-inner{width:min(1280px,calc(100% - 40px));margin:auto;display:flex;align-items:center;gap:21px;height:100%}.logo{width:138px;display:block}.beta{font-size:9px;font-weight:900;letter-spacing:1.3px;color:#6ce7ce;border:1px solid #41e7bd48;padding:7px 10px;border-radius:8px}.head-right{display:flex;gap:13px;align-items:center;margin-left:auto}.identity{font-size:11px;color:#bbc8e5;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.link{font-size:12px;font-weight:800;text-decoration:none;color:#9bded2;white-space:nowrap}
.container{max-width:1280px;margin:auto;padding:22px 20px 40px;min-height:calc(100vh - 132px)}.alert{padding:12px 16px;border-radius:11px;margin:0 0 19px;font-size:12px;line-height:1.65;background:#2d3577;border:1px solid #b7bffb38;color:#dce8fb}.alert.success{background:#1bdba81a;border-color:#25e0b75c;color:#9bffe5}.alert.error{background:#ca58421c;border-color:#f485806d;color:#ffd9d1}.alert.info{background:#3440785e}.gate{width:min(540px,100%);margin:clamp(24px,6vw,68px) auto;padding:clamp(25px,4vw,45px);border:1px solid #b5c5ff40;background:linear-gradient(140deg,#242b6c,#191e52);border-radius:23px;box-shadow:0 22px 60px #0004}.gate-icon{height:65px;display:flex;align-items:center;margin-bottom:15px}.gate-icon img{max-height:65px;max-width:80px}.eyebrow{font-size:10px;letter-spacing:1.35px;color:#65ebcf;font-weight:900}.info-list{display:grid;grid-template-columns:1fr;gap:8px;margin:20px 0}.info-list>div{border-radius:9px;background:#ffffff0b;border:1px solid var(--line);padding:11px 13px;font-size:12px}.info-list strong{color:#76ffe1;margin-right:10px}.auth-tabs{display:flex;gap:6px;background:#121846;border-radius:12px;padding:5px;margin:23px 0}.auth-tabs button{border:0;background:transparent;color:#a8b8dd;flex:1;border-radius:9px;padding:11px;font-weight:800;font-size:12px}.auth-tabs button.selected{color:#052e39;background:#58eaca}.form-stack{display:grid;gap:14px}
label{font-size:11px;font-weight:750;color:#b7c7e7;display:flex;flex-direction:column;gap:7px;min-width:0}input,select,textarea{background:#0e1640;border:1px solid #a9beed54;color:#f9fbff;border-radius:10px;padding:11px 12px;min-height:43px;width:100%;outline:0}input:focus,select:focus,textarea:focus{border-color:#37e8c1}input::placeholder{color:#7688b1}textarea{resize:vertical}select option{color:#202945;background:white}
.btn{border:1px solid transparent;border-radius:10px;display:inline-flex;align-items:center;justify-content:center;font-weight:850;font-size:12px;line-height:1.35;min-height:40px;padding:10px 16px;text-decoration:none;transition:transform .15s}.btn:not(:disabled):hover{transform:translateY(-1px)}.btn.primary{background:linear-gradient(120deg,#45eec9,#17caa6);color:#053640}.btn.subtle{background:#ffffff11;color:#dce7ff;border-color:#d6e1ff30}.app-header{display:flex;gap:22px;align-items:center;justify-content:space-between;margin:9px 0 20px}.app-header p{margin:0}.org-switch{display:flex;align-items:end;gap:10px;flex-wrap:wrap}.org-switch label{min-width:200px}.surface{background:linear-gradient(160deg,#1b2356,#161d49);border:1px solid var(--line);border-radius:15px;padding:clamp(17px,2vw,25px);margin:0 0 16px}.surface h2,.surface h3{margin-bottom:10px}.surface p{margin:0 0 14px}.section-head{display:flex;justify-content:space-between;align-items:center;gap:15px;margin:17px 0}.section-head p{margin:0}.section-head h2{margin-bottom:6px}.summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:11px;margin-bottom:18px}.summary .stat{border:1px solid var(--line);border-radius:13px;background:#202753;padding:16px}.stat small{display:block;color:#aebedf;font-size:10px;margin-bottom:9px}.stat strong{display:block;font-size:21px;letter-spacing:-.5px}.stat span{display:block;color:#80e9d4;font-size:10px;margin-top:8px}
.tabs{display:flex;gap:7px;flex-wrap:wrap;border-bottom:1px solid var(--line);padding:0 0 11px;margin:0 0 20px}.tabs button{border:1px solid #a6b4ff2d;background:#ffffff0b;border-radius:10px;color:#bdccec;font-size:11px;font-weight:800;padding:11px 15px}.tabs button.active{background:#31ddb929;color:#7df6d7;border-color:#5af1d27a}.tab-content{animation:appear .2s ease}@keyframes appear{from{opacity:.75;transform:translateY(3px)}to{opacity:1;transform:none}}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.form-grid.compact{grid-template-columns:2fr 1fr 1fr 1fr auto;gap:10px}.form-grid .full{grid-column:1/-1}.actions{display:flex;flex-wrap:wrap;gap:9px;align-items:center}.actions.align-bottom{align-items:end;align-self:end}.badge{font-size:10px;font-weight:900;border-radius:99px;color:#92ffe4;background:#27e0b41a;border:1px solid #43e8c157;padding:8px 11px;white-space:nowrap}.units-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:11px;margin-bottom:16px}.unit-card{background:linear-gradient(145deg,#1d2558,#1a2954);border:1px solid #bdccff37;border-radius:13px;padding:18px;display:flex;align-items:flex-start;gap:12px;min-width:0}.unit-icon{width:38px;height:38px;border-radius:10px;background:#27d6b727;display:grid;place-items:center;flex:0 0 38px;color:#74ffdc;font-weight:900}.unit-card strong{font-size:13px;display:block;line-height:1.4}.unit-card small{font-size:11px;color:#99add2;display:block;line-height:1.6;margin-top:5px;overflow-wrap:anywhere}
.table-scroll{overflow-x:auto}table{width:100%;border-collapse:collapse;min-width:550px}th{font-size:10px;letter-spacing:.6px;text-transform:uppercase;color:#8ea1ce;text-align:left;padding:12px 9px;border-bottom:1px solid var(--line)}td{font-size:12px;color:#dfebf9;padding:12px 9px;border-bottom:1px solid #ffffff18;vertical-align:middle}td .btn{padding:7px 10px;min-height:32px;font-size:10px}td .actions{gap:5px}.table-scroll .muted{color:#9cb1d7;font-size:11px}
.checkbox-row{display:flex;gap:16px;align-items:center;flex-wrap:wrap}.checkbox-row label{flex-direction:row;align-items:center;gap:7px}.checkbox-row input{width:17px;height:17px;min-height:17px}.draft-items{border:1px solid var(--line);border-radius:11px;margin:15px 0;overflow:hidden}.draft-items .draft-row{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:12px;border-bottom:1px solid var(--line)}.draft-items .draft-row:last-child{border:0}.draft-row strong{font-size:12px}.draft-row small{display:block;color:#9cb2d6;margin-top:5px;font-size:10px}.draft-row button{border:0;background:#ffffff11;border-radius:7px;padding:7px 10px;color:#fff}.total-strip{border-top:1px solid var(--line);margin-top:18px;padding:17px 0;display:flex;align-items:center;gap:12px;flex-wrap:wrap}.total-strip span{color:#b9c9e5}.total-strip strong{font-size:23px;color:#6dffda;margin-left:auto}.total-strip small{color:#99b1d5;width:100%;text-align:right}.footer{margin:30px auto 0;text-align:center;color:#8496ba;font-size:10px;line-height:1.7}.footer a{text-decoration:none}.toast{position:fixed;bottom:20px;right:20px;background:#19d7b2;color:#06373d;border-radius:10px;padding:14px 18px;box-shadow:0 12px 35px #0005;font-size:12px;max-width:360px;font-weight:900;z-index:100;display:none}.toast.show{display:block}
#printArea{display:none}
@media(max-width:1050px){.units-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.form-grid.compact{grid-template-columns:repeat(3,minmax(0,1fr))}.form-grid.compact .actions{grid-column:1/-1}}
@media(max-width:780px){.app-header{flex-direction:column;align-items:stretch}.org-switch{align-items:end}.org-switch label{flex:1}.summary{grid-template-columns:repeat(2,minmax(0,1fr))}.head-inner{width:calc(100% - 26px)}.beta{display:none}.link{font-size:10px}.units-grid{grid-template-columns:1fr}.form-grid{grid-template-columns:1fr}.form-grid.compact{grid-template-columns:repeat(2,minmax(0,1fr))}.form-grid.compact .actions{grid-column:1/-1}}
@media(max-width:460px){.container{padding:13px 12px 24px}.logo{width:110px}.head-right .identity{max-width:100px}.head-right{gap:7px}.head-right .btn{min-height:31px;padding:7px}.app-header h1{font-size:29px}.summary{gap:7px}.summary .stat{padding:12px}.stat strong{font-size:19px}.tabs{gap:5px}.tabs button{flex:1;padding:9px 8px;font-size:10px}.section-head{align-items:flex-start}.unit-card{padding:14px}.form-grid.compact{grid-template-columns:repeat(2,minmax(0,1fr))}.gate{padding:21px}}
@media print{@page{size:A4;margin:15mm 14mm}body{background:white!important;color:#253452!important}.head,.container,.footer,.toast{display:none!important}#printArea{display:block!important;font-family:Arial,sans-serif;color:#28384c}#printArea .pdf-head{border-bottom:4px solid #1fc5a3;padding-bottom:16px;display:flex;justify-content:space-between;align-items:center}#printArea h1{font-size:20px;margin:0}#printArea p{font-size:11px;color:#60718a;margin:6px 0}#printArea .pdf-label{font-size:10px;font-weight:900;color:#108770}#printArea .pdf-meta{margin:22px 0;display:flex;justify-content:space-between;gap:20px}#printArea .pdf-meta strong{font-size:13px}#printArea table{min-width:0;width:100%;border-collapse:collapse;margin:21px 0}#printArea th{background:#eef4f6;color:#536175;padding:11px;font-size:9px}#printArea td{font-size:10px;padding:12px 10px;color:#26394e;border-color:#dbe3ed}#printArea .pdf-totals{margin-left:auto;max-width:260px}#printArea .pdf-totals p{display:flex;justify-content:space-between}#printArea .pdf-totals .sum{border-top:1px solid #dbe4eb;padding-top:12px;color:#0b705e;font-size:18px;font-weight:900}#printArea .pdf-notes{padding:14px 0;border-top:1px solid #e1e8ef;margin-top:23px;font-size:11px;color:#50657c;white-space:pre-wrap}#printArea .pdf-foot{margin-top:25px;border-top:1px solid #d6e3e9;padding-top:12px;font-size:9px;color:#718098}#printArea .pdf-hash{font-family:monospace;font-size:8px;overflow-wrap:anywhere;color:#7a8999}}

/* Recuperação de conta */
.auth-links{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:12px 0 7px}
.auth-link{border:0;background:transparent;color:#83f9dc;font-size:12px;font-weight:800;padding:7px 0;text-align:left}
.auth-link:hover{text-decoration:underline}
#resetPasswordForm{margin-top:22px;padding:17px;border:1px solid #55e7c65c;border-radius:12px;background:#12ab9020}
#resetPasswordForm .small{margin-bottom:5px}
@media(max-width:460px){.auth-links{gap:8px}.auth-link{font-size:11px}}

/* Clientes recorrentes — busca exata e repetição segura */
.crm-grid{display:grid;grid-template-columns:minmax(0,1.06fr) minmax(0,.94fr);gap:14px;align-items:stretch}
.crm-grid>.surface{margin-bottom:14px;min-width:0}
.crm-grid h3{margin-bottom:7px}
.customer-search-row{display:flex;align-items:end;flex-wrap:wrap;gap:9px}
.customer-search-row label{flex:1 1 240px;min-width:0}
.customer-search-row .btn{flex:0 0 auto}
.customer-results{margin-top:13px;display:grid;gap:8px}
.customer-row{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px 13px;border:1px solid #a7c4f63a;background:#ffffff07;border-radius:11px;min-width:0}
.customer-row>div{flex:1;min-width:0}
.customer-row strong,.selected-customer strong{display:block;font-size:12px;color:#e5f5ff}
.customer-row small,.selected-customer small{display:block;font-size:10px;color:#abbbd9;line-height:1.6;margin-top:4px;overflow-wrap:anywhere}
.selected-customer{display:flex;align-items:center;flex-wrap:wrap;gap:8px 14px;padding:12px 13px;margin-top:13px;border:1px solid #60f5cf72;background:#22dab91b;border-radius:11px}
.selected-customer strong{flex:1 1 180px}
.selected-customer small{flex-basis:100%;order:3;margin-top:0}
.selected-customer .btn{min-height:32px;font-size:10px}
#quoteCustomer[readonly]{border-color:#59ecce66;background:#27e7b513;color:#abffe8}
.history-list{display:grid;gap:8px}
.history-card{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:13px 14px;border-radius:12px;border:1px solid #afc5fa30;background:#fff6}
.history-meta{min-width:0;flex:1}
.history-meta strong{display:block;font-size:12px;color:#eff7ff}
.history-meta span{display:block;color:#b2c3e2;font-size:11px;margin-top:5px}
.history-meta small{display:block;font-size:10px;color:#8fa9d2;margin-top:5px}
.history-value{font-size:15px;font-weight:850;color:#86ffe4;white-space:nowrap}
#repeatPriceNotice{margin-top:4px;background:#18d4a51c;border-color:#48f0c05c}
#repeatPriceNotice ul{margin:10px 0;padding-left:20px}
#repeatPriceNotice li{font-size:12px;margin:4px 0}
.template-explore{display:flex;align-items:end;gap:13px;justify-content:space-between;flex-wrap:wrap}
.template-explore>div:first-child{flex:1 1 330px}
.template-explore-actions{display:flex;gap:9px;align-items:end;flex-wrap:wrap;flex:1 1 370px}
.template-explore-actions label{flex:1 1 200px}
.template-explore-actions .btn{min-height:43px}
@media(max-width:900px){.crm-grid{grid-template-columns:1fr}.crm-grid>.surface{margin-bottom:0}.crm-grid{margin-bottom:15px}}
@media(max-width:600px){.customer-search-row .btn{width:100%}.history-card{flex-wrap:wrap;align-items:start;padding:11px}.history-value{font-size:14px}.history-card .btn{flex:1 1 100%;}.customer-row{flex-wrap:wrap}.customer-row .btn{width:100%}.template-explore-actions .btn{width:100%}}

.guided-entry{display:flex;justify-content:space-between;align-items:center;gap:18px;flex-wrap:wrap;
 background:linear-gradient(105deg,#24d4ae20,#2b46892b);border-color:#58e8c46b}
.guided-entry>div{flex:1 1 370px}
.guided-entry h2{font-size:20px;margin:8px 0 5px}
.guided-entry p{margin:0 0 4px;font-size:12px;max-width:740px}
.guided-entry .btn{min-height:45px}
@media(max-width:600px){.guided-entry .btn{width:100%}}
