:root{--green: #128c7e;--green-dark: #075e54;--bg: #f0f2f5;--panel: #ffffff;--border: #e4e6eb;--in: #ffffff;--out: #d9fdd3;--muted: #667781}*{box-sizing:border-box}body{margin:0;font-family:-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;background:var(--bg);color:#111b21}button{cursor:pointer;font-family:inherit}.muted{color:var(--muted)}.small{font-size:12px}.login-wrap{min-height:100vh;display:grid;place-items:center;background:var(--green-dark)}.login-card{background:var(--panel);padding:32px;border-radius:12px;width:320px;display:flex;flex-direction:column;gap:12px;box-shadow:0 8px 30px #0003}.login-logo{display:flex;justify-content:center;margin-bottom:4px}.login-card p{margin:0 0 8px;text-align:center}.login-card input,.composer input{padding:11px 12px;border:1px solid var(--border);border-radius:8px;font-size:14px;outline:none}.login-card input:focus{border-color:var(--green)}.login-card button{padding:11px;background:var(--green);color:#fff;border:none;border-radius:8px;font-weight:600}.login-card button:disabled{opacity:.6}.error{color:#c0392b;font-size:13px}.app{height:100vh;display:flex;flex-direction:column}.topbar{background:var(--green-dark);color:#fff;padding:10px 16px;display:flex;align-items:center;gap:8px}.brand{display:inline-flex;align-items:center;line-height:0}.brand svg{display:block;filter:drop-shadow(0 1px 2px rgba(0,0,0,.3))}.topbar .who{margin-left:auto;opacity:.85}.topbar .link{margin-left:12px}.link{background:none;border:none;color:inherit;text-decoration:underline;opacity:.9}.link.danger{color:#ffb4ab}.nav{display:flex;gap:4px;margin-left:20px}.nav .tab{background:#ffffff1f;color:#fff;border:none;padding:6px 14px;border-radius:16px;font-size:13px;opacity:.8}.nav .tab.active{background:#fff;color:var(--green-dark);opacity:1;font-weight:600}.layout{flex:1;display:flex;min-height:0}.assign{display:flex;align-items:center;gap:6px}.assign select,.team select{padding:5px 8px;border:1px solid var(--border);border-radius:6px;font-size:13px;font-family:inherit;background:#fff}.team{flex:1;overflow-y:auto;background:var(--bg)}.team-inner{max-width:720px;margin:0 auto;padding:28px 20px}.team-inner h2{margin:0 0 4px}.team-table{width:100%;border-collapse:collapse;margin:18px 0 28px;background:var(--panel);border-radius:10px;overflow:hidden;box-shadow:0 1px 3px #00000014}.team-table th,.team-table td{text-align:left;padding:11px 14px;border-bottom:1px solid var(--border);font-size:14px}.team-table th{background:#fafafa;font-size:12px;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}.team-table tr:last-child td{border-bottom:none}.team-table .badge{margin-left:6px}.team-add{background:var(--panel);border-radius:10px;padding:20px;box-shadow:0 1px 3px #00000014;display:flex;flex-direction:column;gap:12px}.team-add h3{margin:0;font-size:15px}.team-add .row{display:flex;gap:12px}.team-add .row>*{flex:1}.team-add input,.team-add select,.team-add textarea{padding:10px 12px;border:1px solid var(--border);border-radius:8px;font-size:14px;font-family:inherit;outline:none;resize:vertical}.team-add input:focus,.team-add textarea:focus{border-color:var(--green)}.qr-list{display:flex;flex-direction:column;gap:8px;margin:16px 0 24px}.qr-item{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;background:var(--panel);border:1px solid var(--border);border-radius:10px;padding:12px 14px}.qr-item-main{min-width:0}.qr-item-main strong{display:block;margin-bottom:2px}.qr-body{font-size:13px;color:var(--muted);white-space:pre-wrap;word-break:break-word}.replies-popover{position:absolute;left:12px;right:12px;bottom:70px;max-height:50%;overflow-y:auto;background:var(--panel);border:1px solid var(--border);border-radius:10px;box-shadow:0 8px 24px #0000002e;padding:6px;z-index:40}.reply-item{display:flex;flex-direction:column;gap:2px;width:100%;text-align:left;background:none;border:none;border-radius:8px;padding:8px 10px;cursor:pointer}.reply-item:hover{background:#f0f2f5}.reply-item strong{font-size:13px}.reply-preview{font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.team-add button{align-self:flex-start;padding:10px 22px;background:var(--green);color:#fff;border:none;border-radius:8px;font-weight:600}.team-add button:disabled{opacity:.5}.sidebar{width:340px;border-right:1px solid var(--border);background:var(--panel);display:flex;flex-direction:column;min-height:0}.filter-bar{flex:0 0 auto;padding:8px 10px;border-bottom:1px solid var(--border);background:#fafafa;display:flex;flex-direction:column;gap:6px}.filter-bar select,.filter-bar .search-input{width:100%;padding:7px 8px;border:1px solid var(--border);border-radius:6px;font-family:inherit;font-size:13px;background:#fff;outline:none}.filter-bar .search-input:focus,.filter-bar select:focus{border-color:var(--green)}.convo-list{flex:1;overflow-y:auto;min-height:0}.convo{width:100%;text-align:left;border:none;border-bottom:1px solid var(--border);background:var(--panel);padding:12px 14px;display:flex;flex-direction:column;gap:3px}.convo:hover{background:#f5f6f6}.convo.active{background:#e9fdf4}.convo-top{display:flex;justify-content:space-between}.convo-top .name{font-weight:600}.convo-top .time{font-size:11px;color:var(--muted)}.convo .preview{font-size:13px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;max-width:290px}.convo-meta{display:flex;gap:6px;margin-top:2px}.badge{font-size:10px;background:#e7f3ff;color:#1d6fb8;padding:1px 6px;border-radius:10px}.badge.warn{background:#fff3cd;color:#8a6d3b}.badge.tag{background:#e8f5e9;color:#2e7d32}.badge.status{background:#ede7f6;color:#5e35b1}.contact-panel{background:#fffdf5;border-bottom:1px solid var(--border);padding:14px 16px;display:flex;flex-direction:column;gap:10px}.contact-panel label{display:flex;flex-direction:column;gap:4px;font-size:12px;color:var(--muted)}.contact-panel input,.contact-panel textarea,.contact-panel select{padding:8px 10px;border:1px solid var(--border);border-radius:6px;font-size:14px;font-family:inherit;color:#111b21;outline:none;resize:vertical;background:#fff}.contact-panel input:focus,.contact-panel textarea:focus,.contact-panel select:focus{border-color:var(--green)}.contact-panel button{align-self:flex-start;padding:8px 18px;background:var(--green);color:#fff;border:none;border-radius:8px;font-weight:600}.contact-panel button:disabled{opacity:.5}.tag-row{display:flex;gap:4px;margin-top:4px;flex-wrap:wrap}.head-meta{display:flex;align-items:center;gap:6px;margin-top:5px;flex-wrap:wrap}.status-select{font-size:11px;padding:2px 8px;border:1px solid #d1c4e9;border-radius:11px;background:#ede7f6;color:#5e35b1;font-family:inherit;font-weight:600;cursor:pointer;outline:none}.status-select:hover{border-color:#b39ddb}.status-select:focus{border-color:#7e57c2}.thread{flex:1;display:flex;flex-direction:column;min-width:0;background:#efeae2;position:relative}.thread-head{background:var(--panel);padding:10px 16px;border-bottom:1px solid var(--border);display:flex;justify-content:space-between;align-items:center}.thread-head-right{display:flex;align-items:center;gap:12px}.messages{flex:1;overflow-y:auto;padding:18px 8%;display:flex;flex-direction:column;gap:6px}.msg{display:flex}.msg.inbound{justify-content:flex-start}.msg.outbound{justify-content:flex-end}.bubble{max-width:70%;padding:7px 10px 5px;border-radius:8px;background:var(--in);box-shadow:0 1px .5px #0000001f;font-size:14px;white-space:pre-wrap;word-break:break-word}.msg.outbound .bubble{background:var(--out)}.msg-meta{font-size:10px;color:var(--muted);margin-top:2px;text-align:right}.msg-img{max-width:260px;max-height:320px;border-radius:6px;display:block;cursor:pointer}.msg-text{margin-top:4px}.msg-file{color:#1d6fb8;text-decoration:none;font-size:14px}.composer{display:flex;gap:8px;padding:12px;background:var(--panel);border-top:1px solid var(--border);align-items:center}.composer input[type=text],.composer>input:not([type]){flex:1}.composer>input{flex:1}.attach-btn{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:8px;cursor:pointer;font-size:18px;background:#f0f2f5;flex:0 0 auto}.attach-btn:hover{background:#e4e6eb}.catalog-overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:#00000059;display:flex;align-items:flex-end;justify-content:flex-start;z-index:50}.catalog{background:var(--panel);width:560px;max-width:92%;height:78%;margin:0 0 76px 12px;border-radius:12px;box-shadow:0 8px 30px #00000040;display:flex;flex-direction:column;overflow:hidden;position:relative}.catalog-head{display:flex;align-items:center;justify-content:space-between;padding:12px 14px;border-bottom:1px solid var(--border)}.catalog-head .link{color:var(--green-dark)}.catalog-controls{display:flex;gap:8px;padding:10px 14px;border-bottom:1px solid var(--border)}.catalog-controls select{flex:1;min-width:0;padding:8px;border:1px solid var(--border);border-radius:6px;font-family:inherit}.catalog-search{display:flex;gap:6px;flex:1}.catalog-search input{flex:1;min-width:0;padding:8px;border:1px solid var(--border);border-radius:6px;font-family:inherit}.catalog-search button{padding:0 14px;background:var(--green);color:#fff;border:none;border-radius:6px}.catalog-grid{flex:1;overflow-y:auto;padding:12px;display:grid;grid-template-columns:repeat(3,1fr);gap:10px;align-content:start}.product{border:1px solid var(--border);border-radius:8px;background:#fff;padding:6px;cursor:pointer;text-align:center;display:flex;flex-direction:column;gap:4px}.product:hover{border-color:var(--green);box-shadow:0 2px 8px #0000001a}.product:disabled{opacity:.5;cursor:default}.product img{width:100%;aspect-ratio:1;object-fit:cover;border-radius:6px}.product .noimg{width:100%;aspect-ratio:1;display:grid;place-items:center;background:#f0f2f5;border-radius:6px;color:var(--muted)}.product .pname{font-size:11px;line-height:1.3;max-height:28px;overflow:hidden}.catalog-sending{position:absolute;top:0;right:0;bottom:0;left:0;background:#ffffffb3;display:grid;place-items:center;font-weight:600;color:var(--green-dark)}.composer button{padding:0 20px;background:var(--green);color:#fff;border:none;border-radius:8px;font-weight:600}.composer button:disabled{opacity:.5}.empty{padding:24px;color:var(--muted);text-align:center}.empty.big{margin:auto;font-size:15px}
