:root{--bg:#F5F3EE;--card:#FFFFFF;--line:#E6E1D6;--line2:#EEEAE1;--text:#1A1A1A;--muted:#6B665C;--soft:#F8F6F1;--gold:#C9A24A;--gold-soft:#E9D7A6;--gold-text:#4A3A12;--dark:#111111;--red:#9B1C1C;--red-soft:#FDE8E8;--green:#1E5B33;--green-soft:#DDF0E3;--orange:#9A3412}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font-family:Inter,system-ui,sans-serif;font-size:14px}a{color:#7a5c17}a:hover{color:var(--gold-text)}h1,h2,h3{font-family:Manrope,sans-serif;margin:0}h1{font-size:28px;font-weight:800}h2{font-size:18px;font-weight:700}h3{font-size:15px;font-weight:700}button,input,select,textarea{font:inherit;color:inherit}.app{display:flex;flex-wrap:wrap;min-height:100vh}.side{flex:1 1 220px;background:var(--dark);padding:24px 14px;display:flex;flex-direction:column;gap:2px}.brand{padding:0 12px 20px;display:flex;flex-direction:column;gap:2px}.brand b{font-family:Manrope,sans-serif;font-weight:800;font-size:22px;letter-spacing:.04em;color:#e2be66}.brand span{font-size:12px;color:#a39d90}.nav{display:flex;justify-content:space-between;align-items:center;padding:10px 12px;border-radius:8px;color:#d9d4c7;text-decoration:none}.nav:hover{background:#1c1a16;color:#fff}.nav.active{background:#241f14;color:#e2be66;font-weight:600}.nav small{font-size:11px;color:#8e887b}.sep{height:1px;background:#2a2722;margin:12px 8px}.me{margin-top:auto;padding:12px;border-radius:10px;background:#1c1a16;display:flex;flex-direction:column;gap:2px}.me b{color:#fff;font-size:13px}.me span{color:#a39d90;font-size:12px}.me button{margin-top:8px;background:none;border:0;color:#e2be66;text-align:left;padding:0;cursor:pointer;font-size:12px}.main{flex:999 1 560px;min-width:0;padding:32px;display:flex;flex-direction:column;gap:20px}.head{display:flex;flex-wrap:wrap;gap:16px;align-items:center;justify-content:space-between}.head .sub{color:var(--muted);margin-top:4px}.row{display:flex;flex-wrap:wrap;gap:10px;align-items:center}.grid-kpi{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:14px}.grid2{display:grid;grid-template-columns:repeat(auto-fit,minmax(360px,1fr));gap:16px;align-items:start}.card{background:var(--card);border:1px solid var(--line);border-radius:14px;padding:20px}.card.warn{border-color:#e8c9b8;background:#fff8f3}.kpi{display:flex;flex-direction:column;gap:6px}.kpi span{color:var(--muted);font-size:13px}.kpi b{font-family:Manrope,sans-serif;font-size:28px;font-weight:800}.kpi small{color:var(--muted);font-size:12px}.stack{display:flex;flex-direction:column;gap:12px}.muted{color:var(--muted)}.small{font-size:12px}.red{color:var(--red)}.green{color:var(--green)}.orange{color:var(--orange)}.btn{height:44px;padding:0 16px;border:1px solid #DCD6C8;border-radius:10px;background:#fff;cursor:pointer;white-space:nowrap}.btn:hover{border-color:#bfb6a2}.btn.gold{background:var(--gold);border-color:var(--gold);color:#1a1a1a;font-weight:600}.btn.dark{background:var(--text);border-color:var(--text);color:#fff}.btn.green{background:var(--green);border-color:var(--green);color:#fff;font-weight:600}.btn.red{background:var(--red);border-color:var(--red);color:#fff;font-weight:600}.btn.sm{height:36px;padding:0 12px;border-radius:8px;font-size:13px}.btn:disabled{opacity:.5;cursor:default}.linkbtn{background:none;border:0;color:#7a5c17;cursor:pointer;padding:0;font-weight:600}.badge{display:inline-block;padding:3px 9px;border-radius:999px;font-size:12px;font-weight:600;white-space:nowrap}.chip{height:36px;padding:0 14px;border:1px solid #DCD6C8;border-radius:999px;background:#fff;cursor:pointer;font-size:13px}.chip.on{background:var(--text);color:#fff;border-color:var(--text)}input.inp,select.inp,textarea.inp{height:44px;padding:0 12px;border:1px solid #DCD6C8;border-radius:10px;background:#fff;width:100%}textarea.inp{height:auto;min-height:80px;padding:10px 12px;resize:vertical}.field{display:flex;flex-direction:column;gap:6px;font-size:13px;font-weight:600;color:#3f3b33}.form{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:12px}.form .full{grid-column:1/-1}.check{display:flex;gap:8px;align-items:center;font-weight:500}.err{background:var(--red-soft);color:var(--red);padding:10px 12px;border-radius:10px}.note{background:var(--soft);padding:12px;border-radius:10px}.item{display:flex;gap:12px;align-items:flex-start;padding:12px;border-radius:10px;background:var(--soft)}table{width:100%;border-collapse:collapse}th,td{text-align:left;padding:11px 10px;border-bottom:1px solid var(--line2);white-space:nowrap}th{font-size:12px;color:var(--muted);font-weight:600}tr.click{cursor:pointer}tr.click:hover td{background:#fbfaf6}.scroll{overflow-x:auto}.empty{padding:24px;text-align:center;color:var(--muted)}.bar-bg{height:8px;background:var(--line2);border-radius:999px}.bar-bg div{height:8px;background:var(--gold);border-radius:999px}.overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:#11111173;display:flex;justify-content:flex-end;z-index:50}.modal{background:var(--bg);width:min(640px,100%);height:100%;overflow-y:auto;padding:28px;display:flex;flex-direction:column;gap:16px;box-shadow:-8px 0 30px #00000026}.modal-head{display:flex;justify-content:space-between;align-items:center;gap:12px}.x{width:40px;height:40px;border-radius:10px;border:1px solid #DCD6C8;background:#fff;cursor:pointer;font-size:20px}.board{overflow-x:auto;display:flex;flex-direction:column;gap:12px;padding-bottom:4px}.kanban{display:grid;grid-template-columns:repeat(var(--n,5),minmax(150px,1fr));gap:8px;align-items:stretch;min-width:calc(var(--n,5) * 150px)}.col{background:#efece5;border-radius:14px;padding:8px;display:flex;flex-direction:column;gap:10px;min-height:340px}.funnel{display:grid;grid-template-columns:repeat(var(--n,5),minmax(150px,1fr));gap:8px;min-width:calc(var(--n,5) * 150px)}.step{position:relative;display:flex;gap:8px;align-items:center;background:#1a1a1a;color:#fff;padding:10px 20px 10px 10px;border-radius:12px;clip-path:polygon(0 0,calc(100% - 14px) 0,100% 50%,calc(100% - 14px) 100%,0 100%)}.step div{display:flex;flex-direction:column;min-width:0}.step b{font-size:12.5px;line-height:1.2}.step div span{font-size:12px;color:#cfcac0}.step-n{width:22px;height:22px;border-radius:50%;background:#c9a24a;color:#1a1a1a;display:grid;place-items:center;font-weight:700;font-size:13px;flex:none}.step.lost{background:#6b665c;clip-path:none}.col-h{display:flex;justify-content:space-between;align-items:center;padding:2px 4px}.lead{background:#fff;border:1px solid var(--line);border-radius:12px;padding:10px;display:flex;flex-direction:column;gap:6px;cursor:pointer}.lead:hover{border-color:#cfc6b2}.lead{min-width:0;overflow-wrap:break-word;hyphens:auto;-webkit-hyphens:auto}.lead-actions{display:flex;flex-direction:column;gap:6px}.lead-actions .btn{width:100%;height:34px;padding:0 8px;font-size:12.5px;justify-content:center;white-space:normal;line-height:1.1;hyphens:auto;-webkit-hyphens:auto}.lead-actions a.btn{display:flex!important;align-items:center}.step b{font-size:12px;hyphens:auto;-webkit-hyphens:auto}.cal{min-width:1040px}.cal-row{display:flex;border-top:1px solid #ECE7DC}.cal-car{width:200px;flex:none;padding:0 16px;display:flex;flex-direction:column;justify-content:center;gap:2px;border-right:1px solid var(--line)}.cal-days{flex:1;display:grid;text-align:center;font-size:12px;color:var(--muted)}.cal-days div{padding:9px 0;display:flex;flex-direction:column}.cal-days div b{font-size:15px;color:var(--text);font-weight:500}.cal-days .today{background:#fbf3dc;color:var(--gold-text)}.cal-days .wk{color:var(--orange)}.track{flex:1;display:grid;height:64px;align-items:center;position:relative}.track .cell{grid-row:1;height:64px;border-left:1px solid #ECE7DC;cursor:pointer}.track .cell:hover{background:#faf6ea}.track .cell.today{background:#fbf3dc}.bk{grid-row:1;height:44px;margin:0 3px;border-radius:8px;padding:5px 10px;display:flex;flex-direction:column;justify-content:center;overflow:hidden;font-size:12px;line-height:1.3;white-space:nowrap;cursor:pointer;z-index:1;border:0;text-align:left}.bk b{font-size:13px;font-weight:600;overflow:hidden;text-overflow:ellipsis}.bk.active{background:#1a1a1a;color:#fff}.bk.confirmed{background:var(--gold-soft);color:#3a2d0e}.bk.ready{background:#fff1d6;border:1.5px solid #C9A24A;color:#5a3d00}.bk.pending{background:#fff;border:1.5px dashed #9C7A26;color:#5a4512}.bk.service{background:repeating-linear-gradient(45deg,#d4d4d4 0,#d4d4d4 6px,#ededed 6px,#ededed 12px);color:#333}.bk.done{background:#e8e5de;color:#555}.legend{display:flex;flex-wrap:wrap;gap:16px;font-size:13px;color:#3f3b33}.legend i{display:inline-block;width:18px;height:12px;border-radius:4px;margin-right:6px;vertical-align:-1px}.login{min-height:100vh;display:grid;place-items:center;background:var(--dark);padding:20px}.login .card{width:min(400px,100%);display:flex;flex-direction:column;gap:14px}@media(max-width:700px){.main,.modal{padding:18px}}.lead{gap:3px;padding:10px 11px;cursor:grab;transition:box-shadow .12s,border-color .12s}.lead:active{cursor:grabbing}.lead.dragging{opacity:.45}.lead-top{display:flex;justify-content:space-between;gap:6px;align-items:baseline}.lead-top b{font-size:14px;font-weight:600;line-height:1.25;hyphens:manual;-webkit-hyphens:manual;overflow-wrap:break-word}.lead-top span{font-size:11px;color:#8e887b;white-space:nowrap}.lead-phone{font-size:13px;color:#3f3b33;hyphens:manual;-webkit-hyphens:manual}.lead-car{font-size:13px;color:#7a5c17;font-weight:500}.lead-sub{font-size:12px;color:#6b665c}.lead-foot{display:flex;justify-content:space-between;gap:6px;align-items:center;margin-top:3px;font-size:11.5px;color:#8e887b;hyphens:manual;-webkit-hyphens:manual;white-space:nowrap;overflow:hidden}.lead-need{color:#c2410c;font-weight:500;font-size:12px;hyphens:manual;-webkit-hyphens:manual}.lead-need:after{content:"";display:inline-block;width:6px;height:6px;border-radius:50%;background:#ea8a2a;margin-left:5px;vertical-align:1px}.col.drop,.card.drop{outline:2px dashed #C9A24A;outline-offset:-2px;background:#f6efd9}.wa-layout{display:grid;grid-template-columns:320px 1fr;gap:16px;align-items:start}.wa-layout.lead{grid-template-columns:300px 1fr}.wa-list{padding:6px;max-height:calc(100vh - 160px);overflow:auto;display:flex;flex-direction:column;gap:2px}.wa-item{all:unset;box-sizing:border-box;display:flex;flex-direction:column;gap:3px;padding:10px 12px;border-radius:10px;cursor:pointer;width:100%}.wa-item:hover{background:var(--soft)}.wa-item.active{background:#fbf3dc}.wa-item-top{display:flex;justify-content:space-between;align-items:center;gap:8px}.wa-item-top b,.wa-item-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.wa-count{display:inline-flex;min-width:20px;height:20px;padding:0 6px;border-radius:999px;background:#1e5b33;color:#fff;font-size:12px;font-weight:700;align-items:center;justify-content:center;margin-left:6px;flex:none}.wa-pane{padding:14px;min-width:0}.wa{display:flex;flex-direction:column;gap:10px;min-width:0}.wa-top{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;align-items:flex-start}.wa-warn{background:#fff4ec;color:#9a3412;border-radius:10px;padding:8px 12px;font-size:13px}.wa-msgs{display:flex;flex-direction:column;gap:8px;max-height:calc(100vh - 330px);min-height:240px;overflow:auto;padding:10px;background:var(--soft);border-radius:12px}.wa-msg{max-width:78%;padding:8px 10px;border-radius:12px;background:#fff;border:1px solid var(--line2);align-self:flex-start;min-width:0}.wa-msg.me{align-self:flex-end;background:#e7f5ea;border-color:#cfe8d6}.wa-msg.failed{background:var(--red-soft);border-color:#f5c2c2}.wa-text{white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word}.wa-meta{display:flex;gap:8px;justify-content:flex-end;font-size:11px;color:var(--muted);margin-top:4px;flex-wrap:wrap}.wa-read{color:#1d6fb8}.wa-error{color:var(--red);font-size:12px;margin-top:4px;font-weight:600}.wa-note{font-size:12px;color:var(--muted);font-style:italic}.wa-img{display:block;max-width:100%;max-height:320px;border-radius:8px}.wa-audio{width:260px;max-width:100%}.wa-reply{display:flex;gap:8px;align-items:flex-end}.wa-reply textarea{flex:1;resize:vertical;min-height:44px}@media(max-width:900px){.wa-layout,.wa-layout.lead{grid-template-columns:1fr}.wa-msg{max-width:92%}}.chats{display:grid;grid-template-columns:320px minmax(0,1fr) 300px;gap:14px;height:calc(100vh - 48px);min-height:520px}.chats>.card{padding:12px;min-height:0;display:flex;flex-direction:column}.chats-list{gap:10px}.chats-tools{display:flex;flex-direction:column;gap:8px}.chats-filter{display:flex;gap:6px;flex-wrap:wrap}.chats-items{overflow:auto;display:flex;flex-direction:column;gap:2px;min-height:0;flex:1}.wa-item.unread b{font-weight:800}.chats-thread .thread{height:100%}.thread .wa-msgs{flex:1;max-height:none;min-height:0}.thread-head{display:flex;gap:10px;align-items:center}.thread-title{flex:1;min-width:0}.thread-title b{overflow-wrap:anywhere}.chats-back,.chats-deal-btn,.chats-deal-close{display:none}.wa-reply-btns{display:flex;flex-direction:column;gap:6px}.chats-deal{overflow:auto}.deal .field{display:flex;flex-direction:column;gap:6px}.tpl-item{all:unset;box-sizing:border-box;display:flex;flex-direction:column;gap:4px;padding:10px 12px;border:1px solid var(--line);border-radius:10px;cursor:pointer;white-space:pre-wrap;overflow-wrap:anywhere}.tpl-item:hover{background:var(--soft)}@media(max-width:1200px){.chats{grid-template-columns:280px minmax(0,1fr) 260px}}@media(max-width:900px){.chats{grid-template-columns:1fr;height:calc(100vh - 90px)}.chats .chats-thread,.chats .chats-deal,.chats.has-sel .chats-list{display:none}.chats.has-sel .chats-thread{display:flex}.chats.has-sel.show-deal .chats-thread{display:none}.chats.has-sel.show-deal .chats-deal{display:flex}.chats-back,.chats-deal-btn,.chats-deal-close{display:inline-flex}.wa-reply{flex-direction:column;align-items:stretch}.wa-reply-btns{flex-direction:row}.wa-reply-btns .btn{flex:1}}.money-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:10px}.money-grid div{display:flex;flex-direction:column;gap:2px;padding:10px 12px;background:var(--soft);border-radius:10px}.money-grid span{font-size:12px;color:var(--muted)}.money-grid b{font-family:Manrope,sans-serif;font-size:17px}.kaspi-box{border:1px solid #F3C1C1;background:#fff5f5;border-radius:12px;padding:10px 12px;display:flex;flex-direction:column;gap:8px}.kaspi-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.kaspi-row>span{min-width:120px}.kaspi-btn{border-color:#e4002b!important;color:#c4001f!important;font-weight:600}.pay-list{display:flex;flex-direction:column;border-top:1px solid var(--line2)}.pay-row{display:grid;grid-template-columns:110px 1fr auto auto;gap:10px;align-items:center;padding:8px 0;border-bottom:1px solid var(--line2);font-size:13px}@media(max-width:600px){.pay-row{grid-template-columns:1fr auto}}
