/* XSIZE CRM v0.4 communications, filters, task board */
.deal-comm-badges{display:flex;gap:5px;align-items:center;margin:7px 0 2px;flex-wrap:wrap}.comm-badge{font-size:9px;font-weight:800;border-radius:999px;padding:4px 7px;background:#eef2ff;color:#4f46e5}.comm-badge.uis{background:#ecfeff;color:#0e7490}.comm-replied{font-size:9px;font-weight:900;border-radius:999px;padding:4px 7px;background:#fee2e2;color:#b91c1c;animation:replyPulse 1.7s ease-in-out infinite}@keyframes replyPulse{0%,100%{box-shadow:0 0 0 0 rgba(239,68,68,.15)}50%{box-shadow:0 0 0 4px rgba(239,68,68,.10)}}.comm-unread{background:#ef4444;color:#fff;min-width:18px;height:18px;padding:0 5px;border-radius:999px;display:inline-grid;place-items:center;font-size:9px;font-weight:900}.deal-card.has-unread{box-shadow:0 0 0 2px rgba(239,68,68,.18),0 5px 15px rgba(15,23,42,.07)}

.pipeline-filter-btn.active{background:#ede9fe;color:#6d28d9;border-color:#c4b5fd}.filter-drawer{position:fixed;z-index:95;top:64px;left:90px;width:760px;max-width:calc(100vw - 120px);height:calc(100vh - 88px);background:#fff;border:1px solid var(--line);border-radius:16px;box-shadow:0 18px 50px rgba(15,23,42,.18);display:grid;grid-template-columns:210px 1fr;overflow:hidden}.filter-drawer.hidden{display:none}.filter-presets{background:#fbfcfe;border-right:1px solid var(--line);padding:16px 12px;overflow:auto}.filter-presets h4,.filter-fields h4{margin:0 0 10px;font-size:11px;text-transform:uppercase;letter-spacing:.07em;color:#64748b}.filter-preset{display:block;width:100%;border:0;background:transparent;text-align:left;padding:10px;border-radius:9px;color:#334155;cursor:pointer;font-size:12px}.filter-preset:hover,.filter-preset.active{background:#ede9fe;color:#5b21b6}.filter-preset.warn{color:#b45309}.filter-preset.danger{color:#b91c1c}.filter-fields{padding:17px 18px;overflow:auto}.filter-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px}.filter-head strong{font-size:15px}.filter-close{border:0;background:#f1f5f9;border-radius:8px;width:30px;height:30px;cursor:pointer}.filter-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.filter-box{border:1px solid var(--line);border-radius:12px;padding:12px;background:#fff}.filter-box.full{grid-column:1/-1}.filter-list{display:flex;gap:7px;flex-wrap:wrap;max-height:160px;overflow:auto}.filter-check{display:flex;align-items:center;gap:6px;border:1px solid #e2e8f0;border-radius:999px;padding:6px 9px;font-size:10px;cursor:pointer}.filter-check input{margin:0;width:14px}.filter-check:has(input:checked){border-color:#8b5cf6;background:#f5f3ff;color:#5b21b6}.filter-search-tags{margin:0 0 9px!important}.filter-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:14px}.filter-active-count{font-size:9px;background:#ef4444;color:white;border-radius:999px;padding:2px 6px;margin-left:4px}

.deal-communications{border-bottom:1px solid var(--line);background:#f8fafc}.deal-communications-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 13px;border-bottom:1px solid #e8edf4;background:#fff}.deal-communications-head strong{font-size:12px}.deal-channel-select{max-width:190px;margin:0!important;height:34px}.deal-comms-items{height:285px;overflow:auto;padding:12px;display:flex;flex-direction:column;gap:9px}.deal-comms-empty{text-align:center;color:#94a3b8;font-size:11px;padding:30px 10px}.deal-msg{max-width:86%;display:flex;flex-direction:column}.deal-msg.user{align-self:flex-start}.deal-msg.admin,.deal-msg.assistant{align-self:flex-end}.deal-msg-bubble{padding:9px 11px;border-radius:13px;font-size:11px;line-height:1.4;white-space:pre-wrap;word-break:break-word;background:#fff;border:1px solid #e2e8f0}.deal-msg.admin .deal-msg-bubble{background:#6d5dfc;color:#fff;border-color:#6d5dfc}.deal-msg.assistant .deal-msg-bubble{background:#dbeafe;color:#1e3a8a;border-color:#bfdbfe}.deal-msg-meta{font-size:8.5px;color:#94a3b8;margin-top:3px}.deal-msg.admin .deal-msg-meta,.deal-msg.assistant .deal-msg-meta{text-align:right}.msg-status{font-weight:700}.msg-status.read{color:#16a34a}.msg-status.delivered{color:#0284c7}.msg-status.sent{color:#64748b}.uis-call-card{border:1px solid #bae6fd;background:#f0f9ff;border-radius:12px;padding:10px 11px}.uis-call-top{display:flex;justify-content:space-between;gap:8px}.uis-call-title{font-weight:800;font-size:11px;color:#0c4a6e}.uis-call-meta{font-size:9px;color:#64748b;margin-top:4px}.uis-call-actions{display:flex;gap:6px;margin-top:8px;align-items:center;flex-wrap:wrap}.uis-call-actions a{font-size:10px;text-decoration:none;border:1px solid #7dd3fc;background:#fff;color:#0369a1;border-radius:7px;padding:5px 8px}.deal-comms-compose{display:grid;grid-template-columns:1fr auto;gap:8px;padding:10px 12px;background:#fff;border-top:1px solid #e8edf4}.deal-comms-compose textarea{margin:0;min-height:44px;resize:vertical}.deal-comms-compose .btn{align-self:end}.deal-comms-status{font-size:9px;color:#94a3b8;padding:0 12px 8px;background:#fff}

.task-board-v04{margin-top:12px}.task-board-toolbar{display:flex;gap:8px;align-items:center;flex-wrap:wrap;padding:10px 0 14px}.task-board-toolbar select{width:auto;min-width:180px;margin:0}.task-toggle{display:flex;align-items:center;gap:6px;font-size:11px}.task-toggle input{width:15px;margin:0}.task-overdue-chip{background:#fee2e2;color:#b91c1c;border-radius:999px;padding:6px 9px;font-size:10px;font-weight:800}.task-columns{display:grid;grid-template-columns:repeat(4,minmax(230px,1fr));gap:14px;align-items:start}.task-column{min-width:0}.task-column.month{grid-column:4}.task-column-head{text-align:center;border-bottom:2px solid #d8dee8;padding:8px 5px;margin-bottom:8px}.task-column-head b{display:block;font-size:11px;letter-spacing:.05em}.task-column-head span{font-size:11px;color:#64748b}.task-card-v04{border:1px solid #d9dee7;border-radius:8px;background:#fff;padding:9px;margin-bottom:7px;box-shadow:0 1px 2px rgba(15,23,42,.02)}.task-card-v04.overdue{border-left:3px solid #ef4444}.task-card-v04.done{opacity:.55}.task-card-v04 .task-person{font-size:10px;color:#475569}.task-card-v04 .task-deal{border:0;background:transparent;color:#0369a1;font-size:11px;padding:2px 0;cursor:pointer;text-align:left;font-weight:700}.task-card-v04 .task-desc{font-size:11px;font-weight:700;margin:3px 0}.task-card-v04 .task-info{font-size:9px;color:#64748b;display:flex;justify-content:space-between;gap:6px}.task-card-v04 .task-check{display:flex;align-items:center;gap:5px;margin-top:6px;font-size:9px;color:#64748b}.task-card-v04 .task-check input{width:14px;margin:0}.task-empty-col{color:#94a3b8;text-align:center;font-size:10px;padding:18px}.task-overdue-section{background:#fff7f7;border:1px solid #fecaca;border-radius:12px;padding:10px;margin-bottom:13px}.task-overdue-section h4{margin:0 0 7px;color:#b91c1c}.task-overdue-list{display:grid;grid-template-columns:repeat(3,1fr);gap:7px}

.live-indicator{position:fixed;right:18px;bottom:18px;z-index:85;background:#0f172a;color:#fff;border-radius:999px;padding:7px 10px;font-size:9px;box-shadow:0 6px 22px rgba(15,23,42,.2);opacity:.82}.live-indicator.online::before{content:'●';color:#22c55e;margin-right:5px}.live-indicator.warn::before{content:'●';color:#f59e0b;margin-right:5px}.top-actions .icon-btn.live-enabled{background:#dcfce7;color:#166534}

@media(max-width:1200px){.filter-drawer{left:72px;width:700px}.task-columns{grid-template-columns:repeat(2,minmax(250px,1fr))}.task-column.month{grid-column:auto}.task-overdue-list{grid-template-columns:1fr 1fr}}@media(max-width:850px){.filter-drawer{left:10px;right:10px;width:auto;max-width:none;grid-template-columns:1fr;height:82vh}.filter-presets{border-right:0;border-bottom:1px solid var(--line);max-height:180px}.filter-grid{grid-template-columns:1fr}.filter-box.full{grid-column:auto}.task-columns{grid-template-columns:1fr}.task-overdue-list{grid-template-columns:1fr}.deal-comms-items{height:240px}}

/* PART 11 — amo-like deal filters */
.filter-drawer.amo-like{left:185px;top:54px;width:min(1220px,calc(100vw - 210px));height:calc(100vh - 74px);max-width:none;display:grid;grid-template-columns:220px minmax(360px,1fr) 330px;grid-template-rows:1fr 64px;border-radius:0 0 12px 12px;overflow:hidden;background:#fff}
.filter-drawer.amo-like.hidden{display:none}
.filter-drawer.amo-like .filter-presets{grid-row:1/3;padding:12px 10px;background:#fff;border-right:1px solid #e5e7eb}
.filter-drawer.amo-like .filter-presets h4{font-size:11px;color:#64748b;padding:3px 10px 8px}
.filter-drawer.amo-like .filter-preset{font-size:13px;border-radius:4px;padding:11px 10px;border-bottom:1px solid #eef2f7}
.filter-drawer.amo-like .filter-preset:hover,.filter-drawer.amo-like .filter-preset.active{background:#eef6ff;color:#0284c7}
.filter-drawer.amo-like .filter-fields{padding:14px 18px 74px;overflow:auto;border-right:1px solid #e5e7eb}
.filter-drawer.amo-like .filter-head{position:sticky;top:-14px;background:#fff;z-index:3;padding:4px 0 10px;margin:0}.filter-drawer.amo-like .filter-head strong,.filter-tags-title,.amo-section-title{font-size:11px;font-weight:800;color:#64748b;letter-spacing:.02em}
.filter-tags-pane{padding:14px 18px 74px;overflow:auto;background:#fff}.filter-tags-title{margin:4px 0 12px}.filter-tag-search,.amo-filter-input{box-sizing:border-box;width:100%;min-height:36px;border:1px solid #d6dce5;border-radius:4px;background:#fff;padding:7px 9px;font-size:12px;color:#334155;outline:none}.filter-tag-search:focus,.amo-filter-input:focus{border-color:#3b82f6;box-shadow:0 0 0 1px #3b82f6}
.filter-tag-cloud{display:flex;flex-direction:column;gap:3px;margin-top:8px}.amo-tag-row,.amo-check-row{display:flex;align-items:center;gap:7px;min-height:30px;font-size:12px;color:#475569;cursor:pointer}.amo-tag-row small,.amo-check-row small{margin-left:auto;color:#94a3b8;font-size:11px}.amo-tag-row input,.amo-check-row input{width:15px;height:15px;margin:0;accent-color:#3b82f6}.amo-tag-row:hover,.amo-check-row:hover{background:#f8fafc}.amo-tag-row{padding:1px 4px;border-radius:4px}
.amo-filter-stack{display:flex;flex-direction:column;gap:9px}.amo-filter-row{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:7px}.amo-filter-group{border:1px solid #d6dce5;border-radius:4px;background:#fff}.amo-filter-group summary{list-style:none;cursor:pointer;padding:8px 9px;font-size:12px;color:#475569;display:flex;justify-content:space-between;align-items:center}.amo-filter-group summary::-webkit-details-marker{display:none}.amo-filter-group summary:after{content:'⌄';color:#94a3b8}.amo-filter-group[open] summary:after{content:'⌃'}.amo-filter-group summary b{margin-left:auto;margin-right:8px;background:#dbeafe;color:#2563eb;border-radius:999px;padding:1px 6px;font-size:10px}.amo-check-list{border-top:1px solid #eef2f7;max-height:210px;overflow:auto;padding:5px 8px}.amo-check-row{padding:4px 2px}.amo-check-row.all{border-bottom:1px solid #eef2f7;margin-bottom:4px;padding-bottom:7px}.amo-check-row.boxed{border:1px solid #d6dce5;border-radius:4px;padding:7px 9px}.amo-section-title{margin-top:9px;padding-top:12px;border-top:1px solid #e5e7eb}
.filter-actions.amo-actions{grid-column:2/4;grid-row:2;position:static;margin:0;padding:12px 18px;border-top:1px solid #e5e7eb;background:#fff;justify-content:flex-start;align-items:center;z-index:4}.filter-actions.amo-actions .btn.primary{min-width:110px}.filter-close{margin-left:auto}
.deal-filter-chips{display:flex;align-items:center;gap:5px;flex-wrap:wrap;max-width:520px;margin-left:6px}.deal-filter-chips.hidden{display:none}.deal-filter-chip{border:1px solid #bfdbfe;background:#eff6ff;color:#2563eb;border-radius:4px;padding:4px 7px;font-size:10px;cursor:pointer;white-space:nowrap}.deal-filter-chip b{font-size:13px;margin-left:3px}.deal-filter-chip:hover{background:#dbeafe}.pipeline-filter-btn.active{background:#eff6ff;color:#2563eb;border-color:#93c5fd}
@media(max-width:1150px){.filter-drawer.amo-like{left:70px;width:calc(100vw - 90px);grid-template-columns:190px minmax(330px,1fr) 270px}}
@media(max-width:850px){.filter-drawer.amo-like{left:8px;right:8px;width:auto;height:88vh;grid-template-columns:1fr;grid-template-rows:auto 1fr auto auto}.filter-drawer.amo-like .filter-presets{grid-row:auto;max-height:150px;border-right:0;border-bottom:1px solid #e5e7eb}.filter-drawer.amo-like .filter-fields{border-right:0}.filter-tags-pane{max-height:230px;border-top:1px solid #e5e7eb}.filter-actions.amo-actions{grid-column:1;grid-row:auto}.deal-filter-chips{display:none}}

/* PART 13 — robust amoCRM-like funnel filters */
.filter-drawer.amo-v2{position:fixed!important;z-index:5000!important;left:220px!important;right:0!important;top:58px!important;bottom:0!important;width:auto!important;height:auto!important;max-width:none!important;border-radius:0!important;border:1px solid #e5e7eb!important;background:#fff!important;box-shadow:0 10px 35px rgba(15,23,42,.13)!important;display:grid!important;grid-template-columns:235px minmax(390px,1fr) 330px!important;grid-template-rows:1fr 64px!important;overflow:hidden!important}
.filter-drawer.amo-v2.hidden{display:none!important}.amo-v2-presets{grid-row:1/3;padding:14px 12px;border-right:1px solid #e5e7eb;overflow:auto;background:#fff}.amo-v2-presets h4,.amo-v2-main .amo-v2-title b,.amo-v2-tags>b,.amo-v2-stack h5{font-size:11px;font-weight:800;color:#64748b;letter-spacing:.03em;margin:0 0 10px}.amo-v2-preset{display:block;width:100%;padding:11px 10px;border:0;border-bottom:1px solid #eef2f7;background:#fff;text-align:left;font-size:13px;color:#334155;cursor:pointer;border-radius:4px}.amo-v2-preset:hover,.amo-v2-preset.active{background:#edf7ff;color:#0284c7}.amo-v2-main{padding:15px 20px 78px;overflow:auto;border-right:1px solid #e5e7eb;background:#fff}.amo-v2-title{display:flex;align-items:center;justify-content:space-between;position:sticky;top:-15px;background:#fff;z-index:2;padding:5px 0 12px}.amo-v2-title button{width:32px;height:32px;border:0;border-radius:6px;background:#f1f5f9;font-size:20px;cursor:pointer}.amo-v2-stack{display:flex;flex-direction:column;gap:10px;max-width:560px}.amo-v2-input,.amo-v2-range input,.amo-v2-stack select,.amo-v2-tags input{width:100%;box-sizing:border-box;border:1px solid #cbd5e1;border-radius:4px;padding:9px 10px;background:#fff;color:#334155;font-size:13px}.amo-v2-range{display:grid;grid-template-columns:1fr 18px 1fr;align-items:center;gap:5px}.amo-v2-range span{text-align:center;color:#94a3b8}.amo-v2-stack details{border-bottom:1px solid #eef2f7;padding:0 0 7px}.amo-v2-stack summary{display:flex;justify-content:space-between;align-items:center;cursor:pointer;padding:9px 7px;color:#475569;font-size:13px;list-style:none;border:1px solid #dbe3ee;border-radius:4px;background:#fff}.amo-v2-stack summary::-webkit-details-marker{display:none}.amo-v2-stack summary:after{content:'⌄';color:#94a3b8}.amo-v2-stack details[open] summary:after{content:'⌃'}.amo-v2-stack summary em{font-style:normal;color:#0284c7;font-size:11px;margin-left:auto;margin-right:8px}.amo-v2-list{padding:6px 4px;max-height:220px;overflow:auto}.amo-v2-check,.amo-v2-tag{display:flex;align-items:center;gap:8px;padding:7px 5px;font-size:12px;color:#475569;cursor:pointer}.amo-v2-check input,.amo-v2-tag input{width:15px;height:15px;margin:0}.amo-v2-check small,.amo-v2-tag small{margin-left:auto;color:#94a3b8}.amo-v2-check.boxed{border:1px solid #dbe3ee;border-radius:4px;padding:9px}.amo-v2-stack h5{margin-top:9px;padding-top:10px;border-top:1px solid #e5e7eb}.amo-v2-tags{padding:16px 18px 76px;overflow:auto;background:#fff}.amo-v2-tags>input{margin-bottom:10px}.amo-v2-tags #p13Tags{max-height:calc(100vh - 175px);overflow:auto}.amo-v2-tag{border-bottom:1px solid #f1f5f9}.amo-v2-empty{padding:10px;color:#94a3b8;font-size:12px}.amo-v2-actions{grid-column:2/4;grid-row:2;display:flex;align-items:center;gap:10px;padding:10px 20px;border-top:1px solid #e5e7eb;background:#fff}.pipeline-filter-btn{white-space:nowrap}.pipeline-filter-btn.active{background:#eff6ff!important;color:#2563eb!important;border-color:#93c5fd!important}.deal-filter-chips{display:flex;align-items:center;gap:5px;flex-wrap:wrap;max-width:560px;margin-left:4px}.deal-filter-chips.hidden{display:none}.deal-filter-chip{border:1px solid #bfdbfe;background:#eff6ff;color:#2563eb;border-radius:4px;padding:5px 7px;font-size:10px;cursor:pointer}.filter-active-count{display:inline-block;background:#ef4444;color:#fff;border-radius:20px;padding:1px 6px;font-size:9px;margin-left:4px}
@media(max-width:1100px){.filter-drawer.amo-v2{left:70px!important;grid-template-columns:190px minmax(330px,1fr) 270px!important}}@media(max-width:800px){.filter-drawer.amo-v2{left:6px!important;top:56px!important;grid-template-columns:1fr!important;grid-template-rows:auto 1fr auto auto!important}.amo-v2-presets{grid-row:auto;max-height:145px;border-right:0;border-bottom:1px solid #e5e7eb}.amo-v2-main{border-right:0}.amo-v2-tags{max-height:220px;padding-bottom:12px;border-top:1px solid #e5e7eb}.amo-v2-actions{grid-column:1;grid-row:auto}.deal-filter-chips{display:none}}

/* PART 14: pipeline Filters button lives in the top bar next to global search. */
.topbar .pipeline-filter-btn{height:40px;padding:0 13px;display:inline-flex;align-items:center;justify-content:center;white-space:nowrap;border:1px solid #dfe3eb;background:#f8fafc;color:#335aa8;border-radius:11px}
.topbar .pipeline-filter-btn:hover{background:#eef2ff;color:#4f46e5}
.topbar .pipeline-filter-btn.active{background:#ede9fe;color:#6d28d9;border-color:#c4b5fd}
.toolbar .deal-filter-chips{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
@media(max-width:1100px){.topbar .pipeline-filter-btn{padding:0 10px}.topbar .search-box{width:300px}}
