:root{--bg:#f4f7fb;--panel:#fff;--line:#e7ecf2;--text:#172033;--muted:#7a8699;--blue:#246bfd;--blue2:#1658e8;--green:#19a974;--wa:#25d366;--danger:#d92d20;--chat:#edf2f7;--bubble-in:#fff;--bubble-out:#dff7e9;--shadow:0 10px 30px rgba(30,55,90,.08);--radius:18px}*{box-sizing:border-box}html,body{height:100%}body{margin:0;font-family:Inter,"Segoe UI",system-ui,-apple-system,sans-serif;color:var(--text);background:var(--bg);font-size:14px}.app-shell{height:100vh;display:grid;grid-template-columns:360px minmax(520px,1fr) 320px;grid-template-rows:72px 1fr;grid-template-areas:"top top top" "side chat context";overflow:hidden}.topbar{grid-area:top;display:flex;align-items:center;justify-content:space-between;padding:0 22px;background:rgba(255,255,255,.96);border-bottom:1px solid var(--line);backdrop-filter:blur(16px);z-index:5}.topbar-brand{display:flex;align-items:center;gap:12px}.brand-mark{width:38px;height:38px;border-radius:12px;background:linear-gradient(135deg,#1b62f2,#1744ae);color:#fff;display:grid;place-items:center;font-weight:900;font-size:18px;box-shadow:0 8px 20px rgba(36,107,253,.22)}.brand-title{font-size:17px;font-weight:800;letter-spacing:-.2px}.brand-subtitle{margin-top:2px;color:var(--muted);font-size:11.5px;display:flex;align-items:center;gap:6px}.status-dot{width:7px;height:7px;border-radius:50%;background:var(--wa);box-shadow:0 0 0 3px rgba(37,211,102,.12);display:inline-block}.topbar-actions,.user-menu{display:flex;align-items:center;gap:10px}.icon-btn{width:38px;height:38px;border:1px solid var(--line);background:#fff;border-radius:11px;cursor:pointer;color:#536076;font-size:18px}.user-menu{padding-left:10px}.user-avatar{width:36px;height:36px;border-radius:50%;display:grid;place-items:center;background:#edf3ff;color:#2458c8;font-weight:800}.user-copy{display:flex;flex-direction:column;min-width:150px}.user-copy strong{font-size:12.5px}.user-copy span{font-size:11px;color:var(--muted);margin-top:2px}.logout{color:#667085;text-decoration:none;font-size:12px;margin-left:4px}.sidebar{grid-area:side;background:#fff;border-right:1px solid var(--line);display:flex;flex-direction:column;min-width:0;overflow:hidden}.sidebar-head{padding:22px 18px 12px;display:flex;justify-content:space-between;align-items:center}.sidebar-head h1{margin:0;font-size:22px;letter-spacing:-.5px}.sidebar-head p{margin:3px 0 0;color:var(--muted);font-size:12px}.new-chat{width:38px;height:38px;border-radius:12px;border:0;background:#edf3ff;color:var(--blue);font-size:23px;cursor:pointer}.search-wrap{margin:4px 16px 12px;height:42px;border:1px solid var(--line);background:#f8fafc;border-radius:12px;display:flex;align-items:center;gap:8px;padding:0 12px}.search-wrap span{font-size:18px;color:#8591a5}.search-wrap input{border:0;outline:0;background:transparent;width:100%;font:inherit;color:var(--text)}.filters{display:flex;gap:7px;padding:0 16px 14px;overflow-x:auto}.filters button{border:1px solid transparent;background:#f5f7fa;color:#697586;padding:8px 11px;border-radius:10px;white-space:nowrap;font-weight:600;font-size:11.5px;cursor:pointer}.filters button.active{background:#eaf1ff;color:#205ed7;border-color:#d8e4ff}.list-caption{height:34px;display:flex;align-items:center;justify-content:space-between;padding:0 18px;color:#9aa4b3;text-transform:uppercase;font-size:10.5px;font-weight:800;letter-spacing:.8px;border-top:1px solid #f2f4f7}.list-caption span:last-child{background:#f1f4f8;color:#758195;padding:2px 7px;border-radius:999px}.conversation-list{overflow:auto;flex:1;padding:4px 8px 14px}.conv{width:100%;border:0;background:transparent;text-align:left;display:grid;grid-template-columns:48px minmax(0,1fr) auto;gap:11px;padding:11px 10px;border-radius:14px;cursor:pointer;transition:.18s ease;margin:2px 0}.conv:hover{background:#f6f8fb}.conv.selected{background:linear-gradient(90deg,#eef4ff,#f7f9fd);box-shadow:inset 3px 0 0 var(--blue)}.conv .avatar{width:46px;height:46px;border-radius:15px;display:grid;place-items:center;background:linear-gradient(135deg,#edf4ff,#e8f9f2);color:#2459b9;font-weight:800;font-size:16px;position:relative}.conv .avatar:after{content:"";position:absolute;width:9px;height:9px;border-radius:50%;background:var(--wa);right:-1px;bottom:2px;border:2px solid #fff}.conv-body{min-width:0}.conv-line{display:flex;align-items:center;justify-content:space-between;gap:6px}.conv strong{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.conv small{display:block;color:#7e899b;margin-top:5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:11.5px;max-width:220px}.conv time{font-size:10.5px;color:#a2abb8;white-space:nowrap}.conv .status-mini{font-size:9px;text-transform:uppercase;font-weight:800;color:#687386;margin-top:4px}.chat{grid-area:chat;min-width:0;position:relative;background:linear-gradient(180deg,#eef3f8 0%,#edf2f6 100%);overflow:hidden}.chat:before{content:"";position:absolute;inset:0;opacity:.23;pointer-events:none;background-image:radial-gradient(circle at 1px 1px,#b9c7d7 1px,transparent 0);background-size:24px 24px}.empty-state{height:100%;position:relative;z-index:1;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:40px;color:#697586}.empty-icon{width:76px;height:76px;border-radius:24px;background:#fff;box-shadow:var(--shadow);display:grid;place-items:center;color:var(--blue);font-size:32px;margin-bottom:20px}.empty-state h2{margin:0;color:#2a3548;font-size:21px}.empty-state p{max-width:390px;margin:8px auto 18px;line-height:1.55;font-size:13px}.empty-badges{display:flex;gap:7px;flex-wrap:wrap;justify-content:center}.empty-badges span{background:#fff;border:1px solid var(--line);border-radius:999px;padding:6px 10px;font-size:10.5px;color:#718096}.chat-panel{height:100%;position:relative;z-index:1;display:grid;grid-template-rows:72px 1fr auto auto auto}.chat-head{background:rgba(255,255,255,.96);border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 18px;backdrop-filter:blur(14px)}.chat-contact{display:flex;align-items:center;gap:12px;min-width:0}.chat-avatar{width:43px;height:43px;border-radius:14px;background:linear-gradient(135deg,#eaf1ff,#e6f8f0);color:#2459b9;display:grid;place-items:center;font-weight:800}.chat-head h2{margin:0;font-size:15px;max-width:360px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.presence{margin-top:4px;color:#8792a3;font-size:11px;display:flex;align-items:center;gap:7px}.actions{display:flex;gap:7px}.actions button,.quick-actions button{height:34px;border-radius:10px;padding:0 12px;font-size:11px;font-weight:700;cursor:pointer}.secondary-action{border:1px solid #dce4ef;background:#fff;color:#3d4a5e}.secondary-action:hover{border-color:#b8c7dd;background:#f8fbff}.danger-ghost{border:1px solid #f2d6d3;background:#fff;color:#b42318}.messages{overflow:auto;padding:24px 5.5% 20px;display:flex;flex-direction:column;gap:9px;scroll-behavior:smooth}.msg{max-width:72%;padding:10px 12px 7px;border-radius:15px;box-shadow:0 2px 8px rgba(36,55,80,.08);line-height:1.42;position:relative;font-size:13px}.msg.in{align-self:flex-start;background:var(--bubble-in);border-top-left-radius:5px}.msg.out{align-self:flex-end;background:var(--bubble-out);border-top-right-radius:5px}.msg.note{align-self:center;background:#fff7da;border:1px solid #f5e5a6;max-width:82%;color:#645626}.msg footer{display:flex;justify-content:flex-end;align-items:center;gap:5px;color:#7d8797;font-size:9.5px;margin-top:5px}.msg.out footer{color:#658271}.reply{border:0;background:transparent;color:#7f8a9a;cursor:pointer;font-size:13px;padding:0 2px}.media-img,.media-video{display:block;max-width:min(360px,60vw);max-height:310px;border-radius:10px}.msg audio{width:min(330px,55vw);height:38px}.file{display:flex;align-items:center;gap:9px;padding:12px;background:rgba(255,255,255,.72);border:1px solid rgba(0,0,0,.05);border-radius:10px;color:#344054;text-decoration:none;font-weight:600}.replying{padding:9px 18px;background:#fbfcfe;border-top:1px solid var(--line);color:#667085;font-size:11.5px;cursor:pointer}.composer-shell{display:grid;grid-template-columns:auto 1fr auto auto;gap:9px;align-items:end;padding:11px 14px 14px;background:rgba(255,255,255,.98);border-top:1px solid var(--line)}.composer-input{background:#f6f8fb;border:1px solid #e6ebf1;border-radius:14px;padding:8px 12px 5px}.composer-input textarea{width:100%;resize:none;max-height:120px;min-height:24px;border:0;background:transparent;outline:0;font:inherit;line-height:1.4}.composer-hint{display:block;text-align:right;color:#a0a9b6;font-size:9px;margin-top:2px}.round-btn,.send-btn{width:42px;height:42px;border-radius:13px;border:1px solid var(--line);background:#fff;cursor:pointer;font-size:18px}.send-btn{border:0;background:linear-gradient(135deg,var(--blue),var(--blue2));color:#fff;box-shadow:0 8px 18px rgba(36,107,253,.22)}.recordbar{padding:9px 14px;background:#fff;border-top:1px solid var(--line);display:flex;align-items:center;justify-content:space-between}.recording{display:flex;align-items:center;gap:8px;color:#d92d20;font-size:11px}.record-pulse{width:9px;height:9px;border-radius:50%;background:#d92d20;animation:pulse 1.2s infinite}.recordbar button{border:0;background:transparent;padding:8px 10px;border-radius:9px;cursor:pointer}.recordbar .primary-mini{background:#eaf1ff;color:#205ed7;font-weight:700}@keyframes pulse{50%{opacity:.35}}.context{grid-area:context;background:#fff;border-left:1px solid var(--line);overflow:auto;padding:0}.context-empty{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:34px;color:#9099a7}.context-empty-icon{width:48px;height:48px;border-radius:15px;background:#f3f6fa;display:grid;place-items:center;margin-bottom:12px;font-size:22px;color:#748096}.context-empty strong{color:#505b6d;margin-bottom:5px}.context-empty span{font-size:11px;line-height:1.5}.context-title{height:56px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 18px;font-weight:800;font-size:12px}.context-title button{border:0;background:transparent;color:#8993a2}.profile-card{text-align:center;padding:24px 18px 20px;border-bottom:1px solid #f0f2f5}.profile-avatar{width:70px;height:70px;border-radius:22px;margin:auto;background:linear-gradient(135deg,#eaf1ff,#e5f8f0);color:#2259be;display:grid;place-items:center;font-size:24px;font-weight:800}.profile-card h3{margin:12px 0 4px;font-size:15px}.profile-phone{color:#7e899a;font-size:11px}.status-badge{display:inline-block;margin-top:10px;border-radius:999px;padding:5px 9px;background:#eef7f2;color:#16865f;font-size:9.5px;font-weight:800;text-transform:uppercase}.context-section{padding:16px 18px;border-bottom:1px solid #f0f2f5}.context-section h4{margin:0 0 12px;color:#9aa3b0;text-transform:uppercase;font-size:9.5px;letter-spacing:.8px}.info-row{display:flex;justify-content:space-between;gap:14px;padding:7px 0}.info-row span{color:#8b95a5;font-size:11px}.info-row strong{font-size:11px;text-align:right;word-break:break-word}.quick-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:16px 18px}.quick-actions button{border:1px solid var(--line);background:#fff;color:#465166}.quick-actions button:last-child{background:#eef4ff;color:#1d5ed4;border-color:#dbe6ff}.login-body{min-height:100vh;display:grid;place-items:center;background:radial-gradient(circle at top,#eef4ff 0,#f6f8fb 45%,#eef1f5 100%)}.login-card{width:min(430px,92vw);background:#fff;padding:34px;border:1px solid #e7ecf2;border-radius:24px;box-shadow:0 24px 70px rgba(28,48,78,.12)}.login-card .brand{font-size:18px;font-weight:800}.login-card h1{font-size:28px;margin:18px 0 4px}.login-card p{color:#778294}.login-card label{display:block;margin:17px 0;color:#505b6d;font-size:12px;font-weight:700}.login-card input{display:block;width:100%;margin-top:7px;padding:13px 14px;border:1px solid #dce3eb;border-radius:12px;outline:0}.login-card input:focus{border-color:#97b4ff;box-shadow:0 0 0 3px #edf3ff}.login-card button{width:100%;padding:13px;border:0;border-radius:12px;background:linear-gradient(135deg,var(--blue),var(--blue2));color:#fff;font-weight:800;box-shadow:0 10px 22px rgba(36,107,253,.2)}.alert{padding:11px;border-radius:10px;background:#fff1f0;color:#b42318}@media(max-width:1180px){.app-shell{grid-template-columns:330px 1fr;grid-template-areas:"top top" "side chat"}.context{display:none}}@media(max-width:760px){.app-shell{grid-template-columns:1fr;grid-template-rows:64px 1fr;grid-template-areas:"top" "chat"}.sidebar{display:none}.topbar{padding:0 12px}.user-copy{display:none}.messages{padding-left:14px;padding-right:14px}.msg{max-width:88%}.chat-head{padding:0 10px}.secondary-action{display:none}}

/* ===== Fase 2 - Central de Voz ===== */
.phone-top{font-size:16px}.call-action{background:#ecfdf3!important;color:#067647!important;border-color:#abefc6!important}.quick-actions-voice{grid-template-columns:1fr 1fr 1fr}.modal-open{overflow:hidden}.voice-modal[hidden]{display:none}.voice-modal{position:fixed;inset:0;z-index:1000;display:grid;place-items:center;padding:24px}.voice-backdrop{position:absolute;inset:0;background:rgba(15,23,42,.48);backdrop-filter:blur(7px)}.voice-card{position:relative;width:min(720px,96vw);max-height:min(760px,92vh);overflow:hidden;background:#fff;border:1px solid #e7ecf2;border-radius:24px;box-shadow:0 30px 90px rgba(15,23,42,.28);display:flex;flex-direction:column}.voice-card>header{display:flex;align-items:flex-start;justify-content:space-between;padding:24px 26px 18px;border-bottom:1px solid var(--line);background:linear-gradient(180deg,#fff,#fbfcff)}.voice-card header h2{margin:4px 0 2px;font-size:23px;letter-spacing:-.5px}.voice-card header p{margin:0;color:var(--muted);font-size:12px}.eyebrow{display:inline-block;font-size:9px;font-weight:900;letter-spacing:1px;text-transform:uppercase;color:#175cd3;background:#eff4ff;padding:4px 7px;border-radius:999px}.voice-close{width:36px;height:36px;border:1px solid var(--line);border-radius:11px;background:#fff;color:#667085;font-size:24px;line-height:1;cursor:pointer}.voice-status{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 26px;border-bottom:1px solid #f0f2f5;background:#fbfcfe}.voice-status>div{display:grid;grid-template-columns:10px auto;column-gap:9px;align-items:center}.voice-status strong{font-size:12.5px}.voice-status small{grid-column:2;color:#8a94a4;font-size:10.5px;margin-top:2px}.voice-dot{width:9px;height:9px;border-radius:50%;background:#98a2b3;box-shadow:0 0 0 4px rgba(152,162,179,.12)}.voice-dot.online{background:#17b26a;box-shadow:0 0 0 4px rgba(23,178,106,.12)}.voice-dot.warning{background:#f79009;box-shadow:0 0 0 4px rgba(247,144,9,.12)}.voice-dialer{padding:22px 26px;display:grid;grid-template-columns:1fr auto;gap:10px;align-items:end}.voice-dialer label{display:flex;flex-direction:column;gap:7px;color:#667085;font-size:10.5px;font-weight:800;text-transform:uppercase;letter-spacing:.5px}.voice-dialer input{height:47px;border:1px solid #dce4ef;border-radius:13px;padding:0 14px;font:inherit;font-size:16px;outline:0;background:#f9fafb}.voice-dialer input:focus{border-color:#8fb0ff;box-shadow:0 0 0 3px #edf3ff;background:#fff}.voice-dial-btn{height:47px;border:0;border-radius:13px;padding:0 18px;background:linear-gradient(135deg,#079455,#17b26a);color:#fff;font-weight:800;cursor:pointer;box-shadow:0 10px 22px rgba(23,178,106,.2)}.voice-dial-btn:disabled{opacity:.6;cursor:wait}.voice-history-head{display:flex;align-items:center;justify-content:space-between;padding:4px 26px 10px}.voice-history-head strong{font-size:12px}.voice-history{overflow:auto;padding:0 18px 22px;min-height:180px}.voice-row{display:grid;grid-template-columns:42px 1fr auto;gap:11px;align-items:center;padding:11px 10px;border-radius:13px;border:1px solid transparent}.voice-row:hover{background:#f8fafc;border-color:#eef1f4}.voice-direction{width:38px;height:38px;border-radius:12px;display:grid;place-items:center;background:#eef7f2;color:#067647;font-size:18px;font-weight:800}.voice-direction.inbound{background:#eff4ff;color:#175cd3}.voice-row-main{display:flex;flex-direction:column;min-width:0}.voice-row-main strong{font-size:12.5px}.voice-row-main span{color:#8b95a5;font-size:10.5px;margin-top:3px}.voice-duration{font-variant-numeric:tabular-nums;color:#667085;font-size:11px}.voice-empty{margin:20px 8px;padding:25px;border:1px dashed #d8dee8;border-radius:14px;text-align:center;color:#8c96a5;font-size:11px}.voice-empty.error{color:#b42318;background:#fff8f7}.voice-toast{position:fixed;right:24px;bottom:24px;z-index:1200;background:#101828;color:#fff;padding:12px 16px;border-radius:12px;box-shadow:0 15px 40px rgba(16,24,40,.28);font-size:12px;transform:translateY(20px);opacity:0;pointer-events:none;transition:.2s}.voice-toast.show{transform:none;opacity:1}@media(max-width:760px){.voice-modal{padding:8px}.voice-card{border-radius:18px;max-height:95vh}.voice-dialer{grid-template-columns:1fr}.quick-actions-voice{grid-template-columns:1fr 1fr}.quick-actions-voice button:first-child{grid-column:1/-1}}

/* ===== 1.3.0 WhatsApp Advanced ===== */
.window-badge{display:inline-flex;align-items:center;gap:6px;padding:7px 10px;border-radius:999px;background:#f2f4f7;color:#667085;font-size:10px;font-weight:800;white-space:nowrap}.window-badge.open{background:#ecfdf3;color:#067647;border:1px solid #abefc6}.window-badge.closed{background:#fff6ed;color:#b54708;border:1px solid #fedf89}.status-read{color:#1570ef}.msg-wrap{display:flex;flex-direction:column;position:relative;max-width:76%}.msg-wrap.in-wrap{align-self:flex-start}.msg-wrap.out-wrap{align-self:flex-end}.msg-wrap .msg{max-width:100%}.msg-actions{display:flex;gap:3px;opacity:0;transition:.15s;margin-top:3px}.msg-wrap:hover .msg-actions{opacity:1}.out-wrap .msg-actions{justify-content:flex-end}.msg-actions button{border:1px solid #e8edf3;background:#fff;border-radius:999px;padding:3px 7px;font-size:11px;cursor:pointer;box-shadow:0 2px 8px rgba(16,24,40,.06)}.reaction-pill{position:absolute;bottom:-11px;left:10px;border:1px solid #e1e7ef;background:#fff;border-radius:999px;padding:2px 7px;font-size:11px;box-shadow:0 3px 10px rgba(16,24,40,.07)}.msg.out .reaction-pill{left:auto;right:10px}.quote-block{border-left:3px solid #84adff;background:rgba(255,255,255,.52);padding:7px 9px;margin:-2px 0 8px;border-radius:7px;font-size:10.5px;color:#5e6b7c}.quote-block span{display:block;color:#175cd3;font-weight:800;font-size:9.5px;margin-bottom:2px}.replying{display:grid;grid-template-columns:auto 1fr auto;gap:10px;align-items:center}.replying strong{font-size:10px;color:#175cd3}.replying span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.replying b{font-size:16px}.wa-modal[hidden]{display:none}.wa-modal{position:fixed;inset:0;z-index:1100;display:grid;place-items:center;padding:24px}.wa-backdrop{position:absolute;inset:0;background:rgba(15,23,42,.48);backdrop-filter:blur(7px)}.wa-card{position:relative;width:min(760px,96vw);max-height:min(780px,92vh);overflow:hidden;background:#fff;border:1px solid #e7ecf2;border-radius:24px;box-shadow:0 30px 90px rgba(15,23,42,.28);display:flex;flex-direction:column}.wa-card>header{display:flex;align-items:flex-start;justify-content:space-between;padding:24px 26px 18px;border-bottom:1px solid var(--line);background:linear-gradient(180deg,#fff,#fbfcff)}.wa-card header h2{margin:4px 0 2px;font-size:23px}.wa-card header p{margin:0;color:var(--muted);font-size:12px}.wa-search{padding:14px 20px;border-bottom:1px solid #f0f2f5}.wa-search input{width:100%;height:42px;border:1px solid #dce4ef;border-radius:12px;padding:0 13px;font:inherit;outline:0;background:#f9fafb}.template-list{padding:10px 16px 18px;overflow:auto}.template-row{width:100%;display:grid;grid-template-columns:1fr auto;gap:4px 15px;text-align:left;border:1px solid #edf0f4;background:#fff;border-radius:14px;padding:14px 15px;margin:7px 0;cursor:pointer}.template-row:hover{background:#f8fbff;border-color:#d9e5ff}.template-row>div{display:flex;flex-direction:column;gap:3px}.template-row strong{font-size:12.5px}.template-row span{font-size:9.5px;color:#8b95a5}.template-row p{grid-column:1/2;margin:5px 0 0;color:#667085;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.template-row b{grid-row:1/3;grid-column:2;align-self:center;color:#175cd3;font-size:10.5px}.monitor-card{width:min(700px,96vw)}.monitor-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;padding:22px}.monitor-stat,.monitor-last{border:1px solid #e7ecf2;border-radius:16px;padding:16px;background:#fbfcfe}.monitor-stat span,.monitor-last span{display:block;color:#8a94a4;font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.4px}.monitor-stat strong{display:block;font-size:26px;margin-top:7px;color:#344054}.monitor-stat.ok{background:#f3fdf7;border-color:#d1fadf}.monitor-stat.warn{background:#fffaf0;border-color:#fedf89}.monitor-stat.bad{background:#fff5f4;border-color:#fecdca}.monitor-last{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between}.monitor-last strong{font-size:12px}.monitor-foot{padding:0 22px 22px;color:#98a2b3;font-size:10px}.topbar-actions .icon-btn:first-child{position:relative}.topbar-actions .icon-btn:first-child:after{content:'';position:absolute;width:6px;height:6px;border-radius:50%;background:#17b26a;right:7px;top:7px;box-shadow:0 0 0 2px #fff}@media(max-width:760px){.window-badge{display:none}.wa-modal{padding:8px}.wa-card{border-radius:18px;max-height:95vh}.monitor-grid{grid-template-columns:1fr 1fr}.msg-wrap{max-width:90%}}

/* 1.4.0 - realtime/unread */
.status-dot.live{background:#22c55e;box-shadow:0 0 0 4px rgba(34,197,94,.12)}
.status-dot.offline{background:#f59e0b;box-shadow:0 0 0 4px rgba(245,158,11,.12)}
.icon-btn.active{background:rgba(37,99,235,.12);color:#2563eb;border-color:rgba(37,99,235,.2)}
.filter-count{margin-left:auto;min-width:20px;height:20px;padding:0 6px;border-radius:999px;background:#e8eefc;color:#3157a7;font-size:11px;display:inline-flex;align-items:center;justify-content:center}
.conv.has-unread{background:linear-gradient(90deg,rgba(37,99,235,.07),rgba(37,99,235,.015));}
.conv.has-unread strong{font-weight:750;color:#172554}
.avatar{position:relative}.unread-dot{position:absolute;width:9px;height:9px;border-radius:50%;background:#2563eb;right:0;bottom:1px;border:2px solid #fff}
.conv-meta{display:flex;align-items:center;gap:7px;margin-top:6px;min-width:0}.wait-mini{font-size:10px;color:#94a3b8;white-space:nowrap}.unread-count{margin-left:auto;min-width:21px;height:21px;padding:0 6px;border-radius:999px;background:#2563eb;color:#fff;font-size:10px;line-height:21px;text-align:center}

/* 1.5.0 - Gestão Operacional */
.presence-select{height:32px;border:1px solid #dce3eb;background:#fff;border-radius:9px;padding:0 8px;font-size:10px;color:#475467;outline:0}.alert-count{background:#fff1f0!important;color:#b42318!important}.conv.sla-breached{box-shadow:inset 3px 0 0 #f04438}.sla-mini{background:#fff1f0;color:#b42318;border:1px solid #fecdca;border-radius:999px;padding:2px 6px;font-size:8px;font-weight:900;letter-spacing:.3px}.operations-card{width:min(1080px,96vw);max-height:92vh}.operations-body{padding:20px;overflow:auto;background:#f8fafc}.ops-summary{display:grid;grid-template-columns:repeat(6,1fr);gap:10px}.ops-summary>div{background:#fff;border:1px solid #e7ecf2;border-radius:15px;padding:15px}.ops-summary span{display:block;color:#8a94a4;font-size:9px;text-transform:uppercase;font-weight:800;letter-spacing:.35px}.ops-summary strong{display:block;margin-top:7px;font-size:21px;color:#344054}.ops-summary .bad{background:#fff5f4;border-color:#fecdca}.ops-summary .bad strong{color:#b42318}.ops-columns{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-top:14px}.ops-columns section,.ops-longest{background:#fff;border:1px solid #e7ecf2;border-radius:16px;padding:15px}.ops-columns h3,.ops-longest h3{font-size:12px;margin:0 0 10px}.agent-row,.queue-row{display:grid;grid-template-columns:auto 1fr auto;gap:10px;align-items:center;padding:10px 7px;border-top:1px solid #f0f2f5}.queue-row{grid-template-columns:1fr auto}.agent-row:first-child,.queue-row:first-child{border-top:0}.agent-row div,.queue-row div{display:flex;flex-direction:column;gap:2px}.agent-row strong,.queue-row strong{font-size:11.5px}.agent-row small,.queue-row small{font-size:9.5px;color:#98a2b3}.agent-row>b,.queue-row>b{font-size:12px;color:#667085}.agent-presence{width:9px;height:9px;border-radius:50%;background:#98a2b3;box-shadow:0 0 0 4px rgba(152,162,179,.10)}.agent-presence.online{background:#17b26a;box-shadow:0 0 0 4px rgba(23,178,106,.10)}.agent-presence.offline{background:#cbd5e1}.ops-longest{margin-top:14px}.ops-section-head{display:flex;align-items:center;justify-content:space-between}.ops-section-head span{font-size:9.5px;color:#98a2b3}.ops-longest button{width:100%;display:flex;align-items:center;justify-content:space-between;text-align:left;border:0;border-top:1px solid #f0f2f5;background:#fff;padding:10px 5px;cursor:pointer}.ops-longest button:hover{background:#f8fbff}.ops-longest button div{display:flex;flex-direction:column;gap:2px}.ops-longest button strong{font-size:11.5px}.ops-longest button small{font-size:9.5px;color:#98a2b3}.ops-longest button>b{font-size:10.5px;color:#667085}.ops-longest button>b.late{color:#b42318;background:#fff1f0;padding:4px 7px;border-radius:999px}.transfer-card{width:min(560px,96vw)}.transfer-list{padding:12px 16px 18px;overflow:auto}.transfer-row{width:100%;display:grid;grid-template-columns:auto 1fr;gap:11px;align-items:center;border:1px solid #edf0f4;background:#fff;border-radius:13px;padding:12px;margin:7px 0;text-align:left;cursor:pointer}.transfer-row:hover{background:#f8fbff;border-color:#d9e5ff}.transfer-row>div{display:flex;flex-direction:column;gap:3px}.transfer-row strong{font-size:11.5px}.transfer-row small{font-size:9.5px;color:#98a2b3}.transfer-row.queue{grid-template-columns:1fr;background:#f8fafc}.quick-actions-voice{grid-template-columns:repeat(2,1fr)}@media(max-width:980px){.ops-summary{grid-template-columns:repeat(3,1fr)}.ops-columns{grid-template-columns:1fr}}@media(max-width:620px){.ops-summary{grid-template-columns:repeat(2,1fr)}.presence-select{display:none}}

/* ===== 1.6.0 - Produtividade ===== */
.tag-mini{display:inline-flex;align-items:center;max-width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:2px 7px;border-radius:999px;background:#eef4ff;color:#325b9a;font-size:10px;font-weight:700}
.context-section-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.mini-link{border:0;background:transparent;color:#2563eb;font-size:12px;font-weight:700;cursor:pointer;padding:2px 0}.tag-cloud{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px}.tag-chip{display:inline-flex;align-items:center;padding:5px 9px;border-radius:999px;background:#eef4ff;color:#244b83;font-size:11px;font-weight:700}.muted{font-size:12px;color:#8a94a6}
.productivity-card{max-width:840px}.productivity-toolbar{display:flex;gap:10px;padding:18px 24px 12px}.productivity-toolbar input{flex:1;border:1px solid #dde3ec;border-radius:12px;padding:11px 13px;background:#fff;outline:none}.quick-replies-list{padding:0 24px 22px;max-height:460px;overflow:auto}.quick-reply-row{width:100%;text-align:left;border:1px solid #e3e8ef;background:#fff;border-radius:14px;padding:13px 15px;margin:0 0 9px;cursor:pointer;transition:.16s}.quick-reply-row:hover{border-color:#b9c8df;box-shadow:0 5px 14px rgba(31,50,76,.07);transform:translateY(-1px)}.quick-reply-row>div{display:flex;align-items:center;justify-content:space-between;gap:10px}.quick-reply-row strong{font-size:13px;color:#152238}.quick-reply-row span{font-size:11px;color:#768399}.quick-reply-row p{margin:7px 0 0;color:#526176;line-height:1.45;font-size:12px;white-space:pre-wrap}.quick-reply-form{border-top:1px solid #e8edf3;padding:18px 24px 22px;background:#fafbfd}.quick-reply-form label{display:flex;flex-direction:column;gap:6px;font-size:11px;font-weight:700;color:#506078}.quick-reply-form input,.quick-reply-form textarea{border:1px solid #dce3ec;border-radius:10px;padding:10px 11px;font:inherit;background:#fff}.quick-reply-form textarea{resize:vertical}.form-grid{display:grid;grid-template-columns:1.4fr .8fr .8fr;gap:10px;margin-bottom:10px}.form-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:12px}.form-actions button{border:1px solid #d9e0ea;border-radius:10px;padding:9px 14px;background:#fff;cursor:pointer}.form-actions .send-btn{border:0;background:#0f766e;color:#fff}.tags-card{max-width:520px}.tags-list{padding:20px 24px 26px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.tag-option{display:flex;align-items:center;gap:9px;padding:11px 12px;border:1px solid #e1e6ee;border-radius:12px;background:#fff;cursor:pointer;font-size:12px;font-weight:700;color:#34445d}.tag-option:hover{border-color:#bbc8da}.tag-option input{width:16px;height:16px}.filters button[data-filter="PINNED"] span:before{content:'★ ';color:#d39b17}
@media(max-width:980px){.form-grid{grid-template-columns:1fr}.tags-list{grid-template-columns:1fr}}

/* 1.7.0 - Automacao e Distribuicao Inteligente */
.automation-card{width:min(980px,94vw);max-height:88vh;overflow:auto}.automation-summary{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;padding:18px 22px 6px}.automation-summary>div{background:#f7f9fc;border:1px solid #e7ebf2;border-radius:14px;padding:14px}.automation-summary span{display:block;font-size:12px;color:#6b7280}.automation-summary strong{display:block;font-size:24px;margin-top:4px}.automation-summary .bad strong{color:#b42318}.automation-toolbar{display:flex;justify-content:space-between;align-items:center;padding:14px 22px;border-bottom:1px solid #edf0f5}.automation-rules{padding:14px 22px;display:grid;gap:10px}.automation-rule{display:grid;grid-template-columns:42px 1fr auto auto;gap:12px;align-items:center;border:1px solid #e5e9f0;border-radius:14px;padding:12px 14px;background:#fff}.automation-rule.inactive{opacity:.72}.automation-rule-order{width:34px;height:34px;border-radius:10px;display:grid;place-items:center;background:#eef4ff;color:#275efe;font-weight:700}.automation-rule-main>div{display:flex;gap:10px;align-items:baseline;flex-wrap:wrap}.automation-rule-main span,.automation-rule-main small{color:#667085;font-size:12px}.automation-rule-main small{display:block;margin-top:4px}.automation-form{margin:12px 22px 22px;padding:18px;border:1px solid #dfe5ee;border-radius:16px;background:#fbfcfe}.automation-form>label{display:grid;gap:6px;margin:12px 0;font-size:12px;font-weight:600;color:#344054}.automation-form input,.automation-form select,.automation-form textarea{width:100%;border:1px solid #d0d5dd;border-radius:10px;padding:10px;background:#fff;font:inherit}.automation-warning{font-size:12px;color:#805b10;background:#fff8e7;border:1px solid #f2dfaa;border-radius:10px;padding:10px;margin:12px 0}.check-label{display:flex!important;align-items:center;gap:8px;margin-top:24px!important}.check-label input{width:auto}.switch{position:relative;width:42px;height:24px}.switch input{display:none}.switch span{position:absolute;inset:0;background:#d0d5dd;border-radius:20px;cursor:pointer;transition:.2s}.switch span:after{content:"";position:absolute;width:18px;height:18px;left:3px;top:3px;background:white;border-radius:50%;box-shadow:0 1px 3px #0003;transition:.2s}.switch input:checked+span{background:#12b76a}.switch input:checked+span:after{transform:translateX(18px)}@media(max-width:800px){.automation-summary{grid-template-columns:1fr 1fr}.automation-rule{grid-template-columns:36px 1fr auto}.automation-rule>.mini-link{grid-column:2}.automation-card .form-grid{grid-template-columns:1fr}}

/* 1.8.0 - IA do Atendimento 360 */
.ai-top{position:relative}
.ai-top::after{content:'';position:absolute;right:7px;bottom:7px;width:6px;height:6px;border-radius:50%;background:#7c3aed;box-shadow:0 0 0 2px #fff}
.active-ai{border-color:#c4b5fd!important;background:#f5f3ff!important;color:#6d28d9!important}
.ai-card{max-width:900px}
.ai-status-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;padding:18px 22px 8px}
.ai-stat{border:1px solid #e6eaf0;border-radius:14px;padding:14px;background:#fff;display:flex;flex-direction:column;gap:4px}
.ai-stat span{font-size:12px;color:#667085;text-transform:uppercase;letter-spacing:.04em}.ai-stat strong{font-size:21px;color:#101828}.ai-stat small{color:#667085}.ai-stat.ok{border-color:#bbf7d0;background:#f0fdf4}.ai-stat.bad{border-color:#fecaca;background:#fff7f7}
.ai-settings{margin:14px 22px;border:1px solid #e6eaf0;border-radius:16px;overflow:hidden;background:#fff}.switch-row{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:14px 16px;border-bottom:1px solid #eef1f5}.switch-row:last-of-type{border-bottom:0}.switch-row span{display:flex;flex-direction:column;gap:3px}.switch-row small{color:#667085}.switch-row input{width:20px;height:20px;accent-color:#7c3aed}.ai-settings .form-actions{padding:14px 16px;background:#fafbfc}
.ai-history-head{display:flex;align-items:center;justify-content:space-between;padding:10px 22px;color:#344054}.ai-history-head span{font-size:12px;color:#667085}.ai-executions{padding:0 22px 22px;display:flex;flex-direction:column;gap:8px;max-height:320px;overflow:auto}.ai-exec{display:grid;grid-template-columns:1fr auto;gap:4px 14px;border:1px solid #e6eaf0;border-radius:12px;padding:11px 13px;background:#fff}.ai-exec>div{display:flex;flex-direction:column;gap:2px}.ai-exec>div:nth-child(2){text-align:right}.ai-exec small{color:#667085}.ai-exec p{grid-column:1/-1;margin:4px 0 0;color:#b42318;font-size:12px}.ai-exec.ok{border-left:3px solid #22c55e}.ai-exec.bad{border-left:3px solid #ef4444}
@media(max-width:900px){.ai-status-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
