:root{--bg:#f4f7f6;--surface:#fff;--line:#e4e9e7;--text:#17211e;--muted:#6d7c77;--green:#176b4a;--green-2:#21845f;--green-soft:#e8f4ee;--red:#b94343;--red-soft:#faecec;--shadow:0 8px 30px rgba(23,33,30,.08);--radius:14px}
*{box-sizing:border-box}html,body{height:100%;margin:0;font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;color:var(--text);background:var(--bg)}button,input,textarea,select{font:inherit}button{cursor:pointer}.hidden{display:none!important}
.login-shell{min-height:100%;display:grid;place-items:center;background:linear-gradient(135deg,#eef6f2,#f7f8f7)}.login-card{width:min(420px,92vw);background:#fff;padding:36px;border-radius:22px;box-shadow:var(--shadow);border:1px solid var(--line)}
.brand{display:flex;align-items:center;gap:12px}.brand-mark{width:42px;height:42px;border-radius:13px;background:var(--green);color:#fff;display:grid;place-items:center;font-weight:800;font-size:22px;box-shadow:0 7px 18px rgba(23,107,74,.22)}.brand-login{margin-bottom:28px}.brand-login h1{margin:0;font-size:27px}.brand-login p{margin:3px 0 0;color:var(--muted);font-size:14px}
label{display:flex;flex-direction:column;gap:7px;font-size:13px;font-weight:650;color:#43504c;margin-bottom:15px}input,textarea,select{border:1px solid #d9e0dd;background:#fff;border-radius:10px;padding:11px 12px;outline:none;color:var(--text)}input:focus,textarea:focus,select:focus{border-color:#74a990;box-shadow:0 0 0 3px rgba(33,132,95,.11)}
.btn{border:0;border-radius:10px;padding:10px 14px;font-weight:700;display:inline-flex;align-items:center;justify-content:center;gap:7px}.btn.primary{background:var(--green);color:#fff}.btn.success{background:var(--green-2);color:#fff}.btn.ghost{background:#eef2f0;color:#32443e}.btn.danger{background:var(--red);color:#fff}.btn.danger-soft{background:var(--red-soft);color:var(--red)}.btn.small{padding:8px 11px;font-size:13px}.btn.full{width:100%}.form-error{color:var(--red);font-size:13px;margin-top:12px;min-height:18px}
.app-shell{height:100%;display:flex}.sidebar{width:212px;background:#12251e;color:#e9f4ef;padding:19px 12px;display:flex;flex-direction:column;flex-shrink:0}.brand.compact{padding:0 9px 21px;font-weight:800;font-size:18px}.brand.compact .brand-mark{width:34px;height:34px;font-size:17px;background:#21845f}
.sidebar nav{display:flex;flex-direction:column;gap:4px}.nav-item{border:0;background:transparent;color:#a9bbb4;padding:11px 12px;border-radius:10px;display:flex;align-items:center;gap:11px;text-align:left;width:100%;font-weight:650}.nav-item:hover,.nav-item.active{background:#1c372d;color:#fff}.nav-icon{width:19px;text-align:center;font-size:18px}.sidebar-bottom{margin-top:auto;display:flex;flex-direction:column;gap:5px}.wa-mini{display:flex;align-items:center;gap:8px;color:#9fb1aa;font-size:12px;padding:10px 12px;border-top:1px solid #284036}.dot{width:8px;height:8px;border-radius:50%;background:#7a8783}.wa-mini.connected .dot{background:#39d58a;box-shadow:0 0 0 3px rgba(57,213,138,.13)}.profile-chip{border:0;background:#193229;color:#fff;border-radius:11px;padding:9px;display:flex;align-items:center;text-align:left;gap:9px}.profile-text{display:flex;min-width:0;flex-direction:column}.profile-text b{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.profile-text small{font-size:11px;color:#a4b5af}
.avatar{width:38px;height:38px;border-radius:50%;background:#dcebe4;color:var(--green);display:grid;place-items:center;font-weight:800;flex:0 0 auto}.avatar.small{width:31px;height:31px;font-size:12px}.avatar.xl{width:70px;height:70px;font-size:22px}
.content{flex:1;min-width:0;height:100%;overflow:hidden}.view{display:none;height:100%}.view.active{display:block}.chat-layout{display:flex;height:100%;background:#fff}.ticket-panel{width:360px;border-right:1px solid var(--line);display:flex;flex-direction:column;background:#fff;flex-shrink:0}.ticket-head{padding:21px 19px 12px;display:flex;justify-content:space-between;align-items:center}.ticket-head h2{margin:0;font-size:21px}.ticket-head p{margin:4px 0 0;color:var(--muted);font-size:12px}
.icon-btn{border:0;background:transparent;border-radius:9px;width:35px;height:35px;display:grid;place-items:center;color:#53625d;font-size:18px}.icon-btn:hover{background:#eef3f0}.search-wrap{margin:0 16px 12px;display:flex;align-items:center;background:#f2f5f4;border-radius:10px;padding:0 10px;color:#7d8a86}.search-wrap input{border:0;background:transparent;box-shadow:none;width:100%;padding:10px 8px}
.tabs{display:flex;padding:0 12px 9px;gap:3px;border-bottom:1px solid var(--line)}.tabs button{border:0;background:transparent;color:var(--muted);padding:8px 9px;border-radius:8px;font-size:12px;font-weight:700;white-space:nowrap}.tabs button.active{background:var(--green-soft);color:var(--green)}.badge{background:var(--red);color:#fff;border-radius:999px;padding:1px 6px;font-size:10px;margin-left:3px}
.ticket-list{overflow:auto;flex:1}.ticket-item{padding:14px 16px;border-bottom:1px solid #edf1ef;display:flex;gap:11px;cursor:pointer}.ticket-item:hover{background:#f7faf8}.ticket-item.active{background:#eef7f2}.ticket-body{min-width:0;flex:1}.ticket-top{display:flex;justify-content:space-between;gap:8px}.ticket-name{font-weight:750;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ticket-time{font-size:11px;color:var(--muted);white-space:nowrap}.ticket-preview{display:flex;justify-content:space-between;gap:8px;margin-top:4px;color:#71807b;font-size:12px}.ticket-preview span:first-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ticket-meta{font-size:10px;margin-top:6px;color:#87938f}.ticket-status{display:inline-block;padding:2px 7px;border-radius:999px;background:#eef2f0}.ticket-status.waiting{background:#fff2d9;color:#8a5a00}.ticket-status.progress{background:#e5f4ed;color:#176b4a}.ticket-status.closed{background:#eef0f2;color:#677078}
.conversation-panel{flex:1;min-width:400px;display:flex;position:relative;background:#eef2ef}.empty-state{margin:auto;text-align:center;color:var(--muted)}.empty-icon{width:80px;height:80px;border-radius:25px;background:#dfece6;color:var(--green);display:grid;place-items:center;font-weight:900;font-size:32px;margin:0 auto 16px}.empty-state h2{margin:0;color:#34443e}.empty-state p{font-size:14px}.conversation{display:flex;flex-direction:column;width:100%;height:100%}.conversation-head{height:70px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 17px}.contact-title{display:flex;align-items:center;gap:10px}.contact-title h3{margin:0;font-size:15px}.contact-title p{margin:3px 0 0;color:var(--muted);font-size:11px}.head-actions{display:flex;gap:6px;align-items:center}
.message-list{flex:1;overflow:auto;padding:24px 7%;background-color:#eef2ef;background-image:radial-gradient(#d5ded9 0.6px,transparent 0.6px);background-size:15px 15px}.message-row{display:flex;margin:4px 0}.message-row.out{justify-content:flex-end}.bubble{max-width:min(620px,78%);background:#fff;border-radius:9px;padding:8px 10px;box-shadow:0 1px 1px rgba(0,0,0,.05);font-size:13.5px;white-space:pre-wrap;word-break:break-word}.message-row.out .bubble{background:#dff3e8}.msg-media{display:block;max-width:340px;max-height:320px;border-radius:7px;margin-bottom:6px}.msg-file{display:flex;gap:8px;align-items:center;background:rgba(255,255,255,.55);border-radius:7px;padding:9px;margin-bottom:5px;color:inherit;text-decoration:none}.msg-meta{text-align:right;font-size:10px;color:#73817c;margin-top:4px;display:flex;justify-content:flex-end;gap:6px}.sender-label{color:#4e7767;font-weight:700}
.composer{background:#fff;border-top:1px solid var(--line);display:flex;align-items:flex-end;padding:10px 14px;gap:8px}.attach-btn{margin:0;width:40px;height:40px;display:grid;place-items:center;font-size:25px;color:#64736e;cursor:pointer}.compose-field{flex:1;background:#f2f5f4;border-radius:13px;padding:5px 10px}.compose-field textarea{border:0;box-shadow:none;background:transparent;width:100%;resize:none;max-height:120px;padding:7px 2px}.send-btn{width:42px;height:42px;border:0;border-radius:50%;background:var(--green);color:#fff;font-size:17px}.file-preview{padding:5px 3px;font-size:11px;color:#53635d}.file-preview button{border:0;background:transparent;color:var(--red)}
.contact-drawer{width:330px;border-left:1px solid var(--line);background:#fff;overflow:auto;flex-shrink:0}.drawer-head{height:70px;padding:0 15px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line)}.drawer-head h3{margin:0}.contact-card{text-align:center;padding:22px 16px;border-bottom:1px solid var(--line)}.contact-card .avatar{margin:0 auto 10px}.contact-name-input{text-align:center;border:0;font-size:16px;font-weight:800;width:100%;padding:6px}.contact-card p{color:var(--muted);font-size:12px;margin:4px}.drawer-section{padding:16px;border-bottom:1px solid var(--line)}.section-title{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}.section-title h4{margin:0;font-size:13px}.text-btn{border:0;background:transparent;color:var(--green);font-size:11px;font-weight:700}.tag-list{display:flex;flex-wrap:wrap;gap:6px}.tag{background:#edf3f0;color:#41554d;border-radius:999px;padding:5px 9px;font-size:11px;display:inline-flex;gap:5px;align-items:center}.tag button{border:0;background:transparent;padding:0;color:#788580}.note-form textarea{width:100%;resize:vertical;min-height:70px;font-size:12px}.note-form .btn{margin-top:7px}.notes-list{margin-top:10px;display:flex;flex-direction:column;gap:8px}.note{background:#f7f9f8;border:1px solid #e8ecea;border-radius:9px;padding:9px;font-size:12px}.note p{margin:0 0 7px;white-space:pre-wrap}.note small{color:var(--muted)}.history-list{display:flex;flex-direction:column;gap:6px}.history-item{border:1px solid var(--line);border-radius:8px;padding:8px;font-size:11px;display:grid;grid-template-columns:1fr auto;gap:4px}.history-item b{font-size:12px}
.page{height:100%;overflow:auto;padding:28px 32px}.page.narrow{max-width:860px;margin:auto}.page-head{display:flex;align-items:flex-end;justify-content:space-between;margin-bottom:22px;gap:20px}.page-head h1{margin:0;font-size:25px}.page-head p{margin:5px 0 0;color:var(--muted);font-size:13px}.date-filter{display:flex;gap:8px;align-items:flex-end}.date-filter label{margin:0}.date-filter input{padding:8px}.metric-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-bottom:18px}.metric-card{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:17px}.metric-card span{color:var(--muted);font-size:12px}.metric-card strong{display:block;font-size:26px;margin-top:8px}.metric-card small{color:#85908c}.card{background:#fff;border:1px solid var(--line);border-radius:var(--radius);margin-bottom:18px;box-shadow:0 3px 12px rgba(23,33,30,.03)}.card-head{padding:16px 18px;border-bottom:1px solid var(--line)}.card-head h3{margin:0;font-size:15px}.table-wrap{overflow:auto}table{border-collapse:collapse;width:100%;font-size:13px}th{text-align:left;color:#74817d;font-size:11px;text-transform:uppercase;letter-spacing:.03em;background:#fafbfb}th,td{padding:12px 16px;border-bottom:1px solid #edf0ef}tbody tr:last-child td{border-bottom:0}.status-pill{padding:4px 8px;border-radius:999px;font-size:11px;font-weight:700}.status-pill.on{background:#e5f4ed;color:#176b4a}.status-pill.off{background:#f1f2f2;color:#717a77}.table-actions{display:flex;gap:5px;justify-content:flex-end}
.daily-bars{padding:18px;display:flex;align-items:flex-end;gap:8px;min-height:190px;overflow-x:auto}.day-col{min-width:38px;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:3px;height:150px}.bar{width:17px;background:#70aa91;border-radius:4px 4px 0 0;min-height:2px}.day-col small{font-size:9px;color:var(--muted)}.wa-card{padding:24px}.wa-status-line{display:flex;align-items:center;gap:13px}.status-dot{width:13px;height:13px;border-radius:50%;background:#8d9894}.status-dot.connected{background:#20ad71;box-shadow:0 0 0 5px #e0f5eb}.status-dot.qr{background:#d89a26}.wa-status-line h3{margin:0}.wa-status-line p{margin:3px 0 0;color:var(--muted);font-size:13px}.qr-area{text-align:center;padding:25px}.qr-area img{width:280px;max-width:100%;border:1px solid var(--line);border-radius:15px}.qr-area h3{margin-bottom:4px}.qr-area p{color:var(--muted);font-size:13px}.wa-actions{display:flex;gap:8px;margin-top:20px}.warning-box{margin-top:22px;background:#fff7e7;color:#72501a;border:1px solid #f2ddb0;border-radius:10px;padding:12px;font-size:12px;line-height:1.5}
.modal-backdrop{position:fixed;inset:0;background:rgba(14,24,20,.45);display:grid;place-items:center;z-index:50;padding:20px}.modal{width:min(520px,96vw);max-height:88vh;overflow:auto;background:#fff;border-radius:16px;box-shadow:0 22px 70px rgba(0,0,0,.25)}.modal-head{display:flex;justify-content:space-between;align-items:center;padding:17px 20px;border-bottom:1px solid var(--line)}.modal-head h3{margin:0}.modal-body{padding:20px}.modal-foot{padding:13px 20px;border-top:1px solid var(--line);display:flex;justify-content:flex-end;gap:8px}.check-list{display:flex;flex-direction:column;gap:5px}.check-row{display:flex;align-items:center;justify-content:space-between;padding:10px;border:1px solid var(--line);border-radius:9px}.check-row label{margin:0;flex-direction:row;align-items:center}.check-row input{width:auto}
#toast-root{position:fixed;right:18px;top:18px;z-index:100;display:flex;flex-direction:column;gap:8px}.toast{background:#172b23;color:#fff;padding:11px 14px;border-radius:10px;box-shadow:var(--shadow);font-size:13px;max-width:360px}.toast.error{background:#9f3939}.empty-list{padding:35px 20px;text-align:center;color:var(--muted);font-size:13px}
@media(max-width:1100px){.sidebar{width:72px}.brand.compact span,.nav-item span:not(.nav-icon),.profile-text,.wa-mini span{display:none}.brand.compact{padding-left:7px}.ticket-panel{width:320px}.contact-drawer{position:absolute;right:0;top:0;bottom:0;z-index:10;box-shadow:-10px 0 30px rgba(0,0,0,.08)}.metric-grid{grid-template-columns:repeat(2,1fr)}}@media(max-width:760px){.sidebar{width:58px;padding-left:7px;padding-right:7px}.ticket-panel{width:100%}.conversation-panel{position:absolute;left:58px;right:0;top:0;bottom:0;min-width:0;z-index:3}.metric-grid{grid-template-columns:1fr}.page{padding:20px 14px}.page-head{align-items:flex-start;flex-direction:column}.date-filter{flex-wrap:wrap}.contact-drawer{width:min(330px,calc(100vw - 58px))}}


/* CasaChat: avatar clicável, emojis, figurinhas e formatação */
.clickable-avatar{border:0;cursor:pointer;padding:0;transition:transform .15s ease,box-shadow .15s ease}
.clickable-avatar:hover{transform:scale(1.04);box-shadow:0 0 0 3px rgba(23,107,74,.12)}

.composer{position:relative}
.composer-action{width:38px;height:38px;flex:0 0 auto;border:0;border-radius:50%;background:transparent;color:#63726d;font-size:23px;display:grid;place-items:center}
.composer-action:hover,.attach-btn:hover{background:#eef3f0;color:var(--green)}
.sticker-button{font-size:22px;transform:rotate(-5deg)}

.compose-field{padding:4px 9px 5px}
.format-toolbar{height:28px;display:flex;align-items:center;gap:2px;border-bottom:1px solid #e2e8e5;margin:0 0 2px;padding-bottom:3px}
.format-btn{height:25px;min-width:27px;border:0;border-radius:6px;background:transparent;color:#687771;padding:0 6px;font-size:12px;display:grid;place-items:center}
.format-btn:hover{background:#e2ebe7;color:var(--green)}
.format-btn.mono{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:10px}
.format-sep{height:15px;width:1px;background:#d7dfdc;margin:0 3px}

.composer-popover{position:absolute;left:12px;bottom:67px;width:360px;max-width:calc(100vw - 90px);max-height:360px;background:#fff;border:1px solid var(--line);border-radius:14px;box-shadow:0 14px 40px rgba(20,35,29,.18);z-index:30;overflow:hidden}
.picker-head{min-height:48px;padding:10px 13px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:10px}
.picker-head>div{display:flex;flex-direction:column}
.picker-head b{font-size:13px}
.picker-head span{display:block;color:var(--muted);font-size:10px;margin-top:2px}

.emoji-grid{padding:10px;display:grid;grid-template-columns:repeat(9,1fr);gap:2px;max-height:292px;overflow:auto}
.emoji-item{border:0;background:transparent;border-radius:7px;min-width:31px;height:34px;font-size:22px;display:grid;place-items:center}
.emoji-item:hover{background:#eef4f1;transform:scale(1.08)}

.sticker-picker{width:390px}
.sticker-grid{padding:10px;display:grid;grid-template-columns:repeat(4,1fr);gap:7px;max-height:300px;overflow:auto}
.sticker-item{border:0;background:#f7f9f8;border-radius:10px;aspect-ratio:1;display:grid;place-items:center;padding:5px;overflow:hidden}
.sticker-item:hover{background:#eaf2ee;box-shadow:inset 0 0 0 1px #cfe0d8}
.sticker-item img{max-width:100%;max-height:100%;object-fit:contain}
.sticker-empty{grid-column:1/-1;padding:35px 14px;text-align:center;color:var(--muted);font-size:12px;line-height:1.5}

.msg-sticker{display:block;width:auto;height:auto;max-width:190px;max-height:190px;object-fit:contain}
.message-row .bubble.sticker-bubble{background:transparent;box-shadow:none;padding:3px}
.message-row.out .bubble.sticker-bubble{background:transparent}
.wa-text strong{font-weight:800}.wa-text em{font-style:italic}.wa-text del{opacity:.78}
.wa-text code{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;background:rgba(0,0,0,.06);border-radius:4px;padding:1px 4px}
.wa-text .wa-quote{border-left:3px solid #80968c;padding-left:8px;margin:2px 0;color:#50635b}
.wa-text .wa-list-line{display:block;padding-left:2px}

@media(max-width:760px){
  .format-toolbar{overflow-x:auto}
  .composer-popover{left:4px;max-width:calc(100vw - 72px)}
  .emoji-grid{grid-template-columns:repeat(7,1fr)}
  .sticker-grid{grid-template-columns:repeat(3,1fr)}
  .composer-action{width:34px}
}


/* Fotos de perfil do WhatsApp */
.avatar{overflow:hidden}
.avatar.has-photo{background:#e5ece9;color:transparent}
.avatar.has-photo img{display:block;width:100%;height:100%;object-fit:cover;border-radius:inherit}
.clickable-avatar.has-photo{padding:0}
.ticket-item .avatar.has-photo{box-shadow:inset 0 0 0 1px rgba(23,107,74,.08)}
.contact-card .avatar.has-photo{box-shadow:0 0 0 4px #f2f7f4}


/* ==========================================================
   TARGET
   ========================================================== */
.btn.target-soft{
  background:#eef7f4;
  color:#176b4a;
  border-color:#cce7dd;
  font-weight:800
}
.btn.target-soft:hover{
  background:#e0f1eb;
  border-color:#afd9ca
}
.target-loading{
  display:flex;
  align-items:center;
  gap:12px;
  color:#64736e;
  padding:18px 2px
}
.target-spinner{
  width:20px;
  height:20px;
  border:2px solid #d8e4df;
  border-top-color:#176b4a;
  border-radius:50%;
  animation:target-spin .8s linear infinite
}
@keyframes target-spin{to{transform:rotate(360deg)}}
.target-driver-card{
  border:1px solid #dce8e3;
  background:#f8fbfa;
  border-radius:12px;
  padding:12px 14px;
  margin-bottom:14px
}
.target-driver-card strong{
  display:block;
  font-size:15px;
  color:#24332e;
  margin-bottom:4px
}
.target-driver-meta{
  font-size:12px;
  color:#6b7a75;
  line-height:1.55
}
.target-form-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px
}
.target-form-grid .full{grid-column:1/-1}
.target-form-grid label{
  display:flex;
  flex-direction:column;
  gap:6px;
  font-size:12px;
  font-weight:700;
  color:#52625c
}
.target-form-grid input,
.target-form-grid select,
.target-form-grid textarea{
  width:100%;
  border:1px solid #d6e0dc;
  border-radius:9px;
  padding:10px 11px;
  font:inherit;
  background:#fff;
  color:#20302a;
  outline:none
}
.target-form-grid textarea{
  min-height:88px;
  resize:vertical
}
.target-form-grid input:focus,
.target-form-grid select:focus,
.target-form-grid textarea:focus{
  border-color:#73b89e;
  box-shadow:0 0 0 3px rgba(23,107,74,.08)
}
.target-operator-note{
  margin:10px 0 0;
  padding:9px 11px;
  border-radius:9px;
  background:#f4f7f6;
  color:#66756f;
  font-size:11px;
  line-height:1.45
}
.target-result{
  border-radius:10px;
  padding:12px 13px;
  line-height:1.5;
  font-size:13px
}
.target-result.success{
  background:#eaf7f0;
  color:#176b4a;
  border:1px solid #c7e8d7
}
.target-result.warning{
  background:#fff7e6;
  color:#7a5815;
  border:1px solid #f2d698
}
.target-result.error{
  background:#fff0f0;
  color:#8b3333;
  border:1px solid #efc5c5
}
@media(max-width:700px){
  .target-form-grid{grid-template-columns:1fr}
  .target-form-grid .full{grid-column:auto}
}


/* Target — proteção visual durante operação financeira */
.modal-operation-locked{
  cursor:wait
}
.modal.modal-locked .modal-head,
.modal.modal-locked .modal-body,
.modal.modal-locked .modal-foot{
  user-select:none
}
.modal.modal-locked #modal-x,
.modal.modal-locked #modal-cancel{
  opacity:.45;
  cursor:not-allowed;
  pointer-events:none
}
.target-action-spinner{
  display:inline-block;
  width:15px;
  height:15px;
  border:2px solid rgba(255,255,255,.38);
  border-top-color:currentColor;
  border-radius:50%;
  animation:target-spin .75s linear infinite;
  vertical-align:-2px;
  margin-right:7px
}
.target-processing-row{
  display:flex;
  align-items:center;
  gap:12px
}
.target-processing-message{
  cursor:wait
}


/* Respostas e reações de mensagens */
.bubble-shell{position:relative;max-width:min(620px,78%)}
.bubble-shell>.bubble{max-width:100%}
.message-row.in .bubble-shell{margin-right:auto}
.message-row.out .bubble-shell{margin-left:auto}
.message-hover-actions{position:absolute;top:-4px;right:100%;margin-right:5px;display:flex;gap:3px;opacity:0;pointer-events:none;transition:opacity .12s ease;z-index:4}
.message-row.in .message-hover-actions{right:auto;left:100%;margin-right:0;margin-left:5px}
.bubble-shell:hover .message-hover-actions{opacity:1;pointer-events:auto}
.msg-action{width:28px;height:28px;border:1px solid #dfe6e3;background:#fff;border-radius:50%;display:grid;place-items:center;color:#53625d;box-shadow:0 2px 8px rgba(0,0,0,.09);font-size:14px;padding:0}
.msg-action:hover{background:#f2f6f4;color:var(--green)}
.quoted-preview{border-left:3px solid #45a47b;background:rgba(255,255,255,.58);border-radius:6px;padding:6px 8px;margin:0 0 6px;min-width:150px;max-width:100%;overflow:hidden}
.message-row.in .quoted-preview{background:#f1f5f3}
.quoted-author{font-size:11px;font-weight:800;color:var(--green);margin-bottom:2px}
.quoted-text{font-size:11.5px;color:#596761;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.message-reaction-list{display:flex;gap:3px;flex-wrap:wrap;margin-top:-3px;position:relative;z-index:3}
.message-row.out .message-reaction-list{justify-content:flex-end;padding-right:6px}
.message-row.in .message-reaction-list{justify-content:flex-start;padding-left:6px}
.reaction-pill{border:1px solid #dfe5e2;background:#fff;border-radius:999px;padding:2px 7px;display:inline-flex;align-items:center;gap:3px;box-shadow:0 1px 3px rgba(0,0,0,.07);font-size:13px;line-height:18px}
.reaction-pill.mine{border-color:#9fcdb8;background:#edf8f2}
.reaction-pill small{font-size:10px;color:#65736e}
.composer-reply-preview{display:flex;align-items:center;justify-content:space-between;gap:10px;background:#e9efec;border-left:3px solid var(--green-2);border-radius:7px;padding:7px 8px;margin:1px 0 4px}
.reply-preview-body{display:flex;flex-direction:column;min-width:0;gap:1px}
.reply-preview-body b{font-size:11px;color:var(--green)}
.reply-preview-body span{font-size:11px;color:#5e6c67;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.composer-reply-preview button{border:0;background:transparent;color:#65736e;font-size:20px;line-height:20px;padding:0 4px}
.message-context-menu{position:fixed;z-index:1000;min-width:165px;background:#fff;border:1px solid #dfe5e2;border-radius:10px;padding:5px;box-shadow:0 12px 30px rgba(0,0,0,.17)}
.message-context-menu button{width:100%;border:0;background:transparent;border-radius:7px;padding:9px 10px;text-align:left;display:flex;align-items:center;gap:9px;color:#25342f;font-size:13px}
.message-context-menu button:hover{background:#eef4f1}
.message-context-menu button span{font-weight:600}
.message-reaction-picker{position:fixed;z-index:1001;background:#fff;border:1px solid #dfe5e2;border-radius:999px;padding:5px;display:flex;align-items:center;gap:2px;box-shadow:0 12px 30px rgba(0,0,0,.17)}
.message-reaction-picker button{width:34px;height:34px;border:0;background:transparent;border-radius:50%;display:grid;place-items:center;font-size:19px;transition:transform .1s ease,background .1s ease;padding:0}
.message-reaction-picker button:hover{background:#eef4f1;transform:scale(1.13)}
.message-reaction-picker button.active{background:#daf1e5}
.message-reaction-picker .remove-reaction{font-size:17px;color:#68756f;border-left:1px solid #e5e9e7;border-radius:0;margin-left:2px}
@media(max-width:900px){
  .message-hover-actions{opacity:1;pointer-events:auto;position:static;margin:0 0 3px;justify-content:flex-end}
  .bubble-shell{max-width:86%}
}


/* ============================================================
   Correção: altura dos balões + hover tolerante + avisos do WhatsApp
   ============================================================ */

/* A .bubble tinha white-space:pre-wrap. Como o HTML das mensagens agora
   possui indentação interna, os espaços/quebras do template também estavam
   sendo renderizados, deixando os balões artificialmente muito altos.
   Preservamos quebras somente no conteúdo textual real. */
.bubble{
  white-space:normal;
}
.wa-text{
  white-space:pre-wrap;
  word-break:break-word;
}

/* O invólucro passa a ocupar somente o tamanho necessário da mensagem. */
.bubble-shell{
  width:fit-content;
}

/* Mantém a área de ações viva por alguns milissegundos ao sair do balão.
   Isso elimina o "buraco" entre a mensagem e os botões. */
.message-hover-actions{
  margin-right:0;
  padding-right:7px;
  opacity:0;
  visibility:hidden;
  pointer-events:auto;
  transition:
    opacity .14s ease,
    visibility 0s linear .28s;
}
.message-row.in .message-hover-actions{
  margin-left:0;
  padding-left:7px;
  padding-right:0;
}
.bubble-shell:hover .message-hover-actions,
.message-hover-actions:hover{
  opacity:1;
  visibility:visible;
  transition-delay:0s;
}

/* Avisos de sistema do WhatsApp/Meta, como mensagens temporárias. */
.message-row.system-message-row{
  justify-content:center;
  margin:9px 0;
}
.system-message{
  max-width:min(560px,78%);
  display:flex;
  align-items:center;
  gap:8px;
  background:#f7f9f8;
  border:1px solid #dde5e1;
  border-radius:999px;
  padding:5px 11px;
  color:#65736e;
  font-size:11px;
  line-height:1.3;
  box-shadow:0 1px 2px rgba(0,0,0,.03);
}
.system-message span{
  min-width:0;
}
.system-message small{
  flex:0 0 auto;
  color:#89948f;
  font-size:9px;
}

@media(max-width:900px){
  .message-hover-actions{
    visibility:visible;
    padding:0;
  }
}


/* ============================================================
   GRUPOS — conversas permanentes fora do fluxo de chamados
   ============================================================ */
.group-item .group-avatar{
  background:#e8eef8;
  color:#315b8c;
}
.group-pill{
  display:inline-block;
  padding:2px 7px;
  border-radius:999px;
  background:#e9eff8;
  color:#315b8c;
  font-weight:700;
}
.group-message-row .bubble{
  min-width:150px;
}
.group-message-row.in .sender-label{
  color:#315b8c;
}
.group-message-row.out .sender-label{
  color:#176b4a;
}
.group-msg-meta{
  align-items:center;
}
.group-history-empty{
  width:min(460px,80%);
  margin:40px auto;
  padding:14px 16px;
  border:1px dashed #cbd7d1;
  border-radius:12px;
  background:rgba(255,255,255,.68);
  color:#6d7c77;
  font-size:12px;
  line-height:1.5;
  text-align:center;
}


/* ============================================================
   Iniciar atendimento por contato sincronizado
   ============================================================ */

.ticket-head-actions{
  display:flex;
  align-items:center;
  gap:3px;
}

.new-ticket-btn{
  background:var(--green-soft);
  color:var(--green);
  font-size:23px;
  font-weight:500;
}

.new-ticket-btn:hover{
  background:#dcefe5;
  color:#0f5d3e;
}

.start-ticket-modal{
  display:flex;
  flex-direction:column;
  min-height:360px;
}

.start-ticket-help{
  margin:0 0 12px;
  color:var(--muted);
  font-size:12px;
  line-height:1.5;
}

.start-ticket-search{
  display:flex;
  align-items:center;
  gap:7px;
  background:#f2f5f4;
  border:1px solid #e2e8e5;
  border-radius:10px;
  padding:0 10px;
  color:#7d8a86;
  margin-bottom:10px;
}

.start-ticket-search:focus-within{
  border-color:#74a990;
  box-shadow:0 0 0 3px rgba(33,132,95,.10);
}

.start-ticket-search input{
  width:100%;
  border:0;
  background:transparent;
  box-shadow:none;
  padding:10px 2px;
}

.start-ticket-results{
  border:1px solid var(--line);
  border-radius:11px;
  overflow:auto;
  max-height:min(54vh,520px);
  background:#fff;
}

.start-contact-row{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 11px;
  border-bottom:1px solid #edf1ef;
}

.start-contact-row:last-child{
  border-bottom:0;
}

.start-contact-row:hover{
  background:#f8faf9;
}

.start-contact-row.disabled{
  opacity:.68;
}

.start-contact-avatar{
  width:38px;
  height:38px;
}

.start-contact-main{
  min-width:0;
  flex:1;
}

.start-contact-name{
  font-size:13px;
  font-weight:750;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
}

.start-contact-meta{
  display:flex;
  align-items:center;
  gap:5px;
  margin-top:3px;
  color:#7a8782;
  font-size:10.5px;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
}

.start-contact-action{
  flex:0 0 auto;
  border:0;
  border-radius:8px;
  padding:7px 9px;
  min-width:62px;
  font-size:11px;
  font-weight:750;
}

.start-contact-action.start{
  background:var(--green);
  color:#fff;
}

.start-contact-action.waiting{
  background:#fff0cf;
  color:#805400;
}

.start-contact-action.mine{
  background:var(--green-soft);
  color:var(--green);
}

.start-contact-action.busy{
  max-width:120px;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
  background:#eef1f0;
  color:#707b77;
  cursor:not-allowed;
}

.start-ticket-loading,
.start-ticket-empty{
  padding:28px 18px;
  text-align:center;
  color:var(--muted);
  font-size:12px;
}

.start-ticket-spinner{
  margin:0;
  width:14px;
  height:14px;
}



/* ============================================================
   Notificações / mensagens novas
   ============================================================ */
.tabs .unread-badge{
  margin-left:4px;
  min-width:17px;
  text-align:center;
}

.tabs button:not(.active) .unread-badge{
  box-shadow:0 0 0 2px #fff;
}

.tabs button.active .unread-badge{
  box-shadow:0 0 0 2px var(--green-soft);
}


/* ============================================================
   Anexos em lote
   ============================================================ */

.attachment-picker{
  width:330px;
  max-width:calc(100vw - 30px);
}

.attachment-options{
  display:flex;
  flex-direction:column;
  gap:4px;
  padding:6px;
}

.attachment-option{
  border:0;
  background:transparent;
  border-radius:11px;
  padding:10px;
  display:flex;
  align-items:center;
  gap:11px;
  text-align:left;
  color:var(--text);
}

.attachment-option:hover{
  background:#eef4f1;
}

.attachment-option-icon{
  width:38px;
  height:38px;
  border-radius:50%;
  display:grid;
  place-items:center;
  flex:0 0 auto;
  font-size:18px;
  font-weight:800;
}

.attachment-option.media .attachment-option-icon{
  background:#e7f2ff;
  color:#3477b8;
}

.attachment-option.document .attachment-option-icon{
  background:#efe9fb;
  color:#7153aa;
}

.attachment-option.audio .attachment-option-icon{
  background:#ffe9ef;
  color:#b64e70;
}

.attachment-option>span:last-child{
  display:flex;
  min-width:0;
  flex-direction:column;
  gap:2px;
}

.attachment-option b{
  font-size:13px;
}

.attachment-option small{
  color:var(--muted);
  font-size:10px;
  line-height:1.3;
}

.file-preview{
  padding:5px 3px 7px;
}

.file-batch-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:5px;
  color:#596862;
  font-size:10px;
  font-weight:700;
}

.file-batch-head button{
  border:0;
  background:transparent;
  color:var(--red);
  padding:2px 4px;
  font-size:10px;
}

.file-batch-list{
  display:flex;
  gap:5px;
  overflow-x:auto;
  padding:1px 1px 3px;
}

.file-preview-item{
  width:210px;
  min-width:210px;
  display:flex;
  align-items:center;
  gap:7px;
  border:1px solid #dce4e0;
  border-radius:9px;
  padding:6px;
  background:#fff;
}

.file-preview-icon{
  width:31px;
  height:31px;
  flex:0 0 auto;
  border-radius:8px;
  display:grid;
  place-items:center;
  background:#eef3f0;
  font-size:14px;
  font-weight:800;
}

.file-preview-icon.image,
.file-preview-icon.video{
  background:#e8f3ff;
  color:#3578b8;
}

.file-preview-icon.audio{
  background:#ffeaf0;
  color:#ad4c6b;
}

.file-preview-icon.document{
  background:#f0ebfb;
  color:#6d54a4;
}

.file-preview-info{
  min-width:0;
  flex:1;
  display:flex;
  flex-direction:column;
  gap:2px;
}

.file-preview-info b{
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
  font-size:10.5px;
  color:#3e4c47;
}

.file-preview-info small{
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
  color:#84908c;
  font-size:9px;
}

.remove-preview-file{
  width:23px;
  height:23px;
  border:0;
  border-radius:50%;
  background:#f5f7f6;
  color:#7d8985;
  display:grid;
  place-items:center;
  flex:0 0 auto;
  padding:0;
  font-size:15px;
}

.remove-preview-file:hover{
  background:#faecec;
  color:var(--red);
}


/* ============================================================
   Abas com rolagem horizontal
   ============================================================ */
.tabs{
  overflow-x:auto;
  overflow-y:hidden;
  flex-wrap:nowrap;
  scrollbar-width:thin;
  scrollbar-color:#c9d2ce transparent;
  scroll-behavior:smooth;
  overscroll-behavior-x:contain;
}

.tabs::-webkit-scrollbar{
  height:6px;
}

.tabs::-webkit-scrollbar-track{
  background:transparent;
}

.tabs::-webkit-scrollbar-thumb{
  background:#c9d2ce;
  border-radius:999px;
}

.tabs button{
  flex:0 0 auto;
}

/* ============================================================
   Foto interna do operador / agrupamento de mensagens
   ============================================================ */
.message-row.operator-message-row{
  align-items:flex-end;
  gap:6px;
}

.message-operator-avatar{
  width:29px;
  height:29px;
  flex:0 0 29px;
  border-radius:50%;
  overflow:hidden;
  display:grid;
  place-items:center;
  background:#dcebe4;
  color:var(--green);
  font-weight:800;
  font-size:10px;
  box-shadow:0 1px 3px rgba(0,0,0,.08);
  margin-bottom:1px;
}

.message-operator-avatar.has-photo img{
  width:100%;
  height:100%;
  display:block;
  object-fit:cover;
}

.message-operator-avatar.avatar-spacer{
  visibility:hidden;
}

.user-table-profile{
  display:flex;
  align-items:center;
  gap:8px;
}

.user-table-avatar img,
.profile-chip .avatar img{
  width:100%;
  height:100%;
  object-fit:cover;
  border-radius:50%;
}

/* ============================================================
   Preferências de perfil
   ============================================================ */
.profile-settings{
  display:flex;
  flex-direction:column;
  gap:17px;
}

.profile-settings-current{
  display:flex;
  align-items:center;
  gap:11px;
  padding:3px 0 10px;
  border-bottom:1px solid var(--line);
}

.profile-settings-current>div{
  display:flex;
  flex-direction:column;
  gap:2px;
}

.profile-settings-current b{
  font-size:14px;
}

.profile-settings-current span:not(.avatar){
  font-size:11px;
  color:var(--muted);
}

.profile-settings-avatar{
  width:54px;
  height:54px;
  font-size:17px;
}

.profile-settings-section{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.profile-settings-title{
  display:flex;
  flex-direction:column;
  gap:2px;
}

.profile-settings-title b{
  font-size:12px;
}

.profile-settings-title span{
  color:var(--muted);
  font-size:10px;
  line-height:1.4;
}

.profile-avatar-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:7px;
}

.profile-avatar-option{
  border:1px solid var(--line);
  background:#fff;
  border-radius:11px;
  min-height:81px;
  padding:7px 4px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:5px;
}

.profile-avatar-option:hover{
  background:#f7faf8;
}

.profile-avatar-option.selected{
  border-color:var(--green-2);
  box-shadow:0 0 0 2px var(--green-soft);
}

.profile-avatar-option small{
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:9px;
  color:#596863;
}

.profile-choice-avatar{
  width:43px;
  height:43px;
  border-radius:50%;
  overflow:hidden;
  display:grid;
  place-items:center;
  background:#dcebe4;
  color:var(--green);
  font-size:12px;
  font-weight:800;
}

.profile-choice-avatar img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.upload-choice{
  background:#eef2f0;
  color:#60706a;
  font-size:21px;
  font-weight:500;
}

.profile-theme-grid{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:6px;
}

.profile-theme-option{
  border:1px solid var(--line);
  background:#fff;
  border-radius:10px;
  padding:6px 4px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:5px;
}

.profile-theme-option.selected{
  border-color:var(--green-2);
  box-shadow:0 0 0 2px var(--green-soft);
}

.profile-theme-option small{
  font-size:8px;
  color:#5e6b66;
  white-space:nowrap;
}

.theme-preview{
  width:43px;
  height:31px;
  border-radius:7px;
  display:flex;
  overflow:hidden;
  box-shadow:inset 0 0 0 1px rgba(0,0,0,.06);
}

.theme-preview i:first-child{
  width:14px;
}

.theme-preview i:nth-child(2){
  flex:1;
}

.theme-preview i:last-child{
  width:8px;
}

.theme-green .theme-preview i:first-child{background:#12251e}
.theme-green .theme-preview i:nth-child(2){background:#eef2ef}
.theme-green .theme-preview i:last-child{background:#21845f}

.theme-blue .theme-preview i:first-child{background:#132b46}
.theme-blue .theme-preview i:nth-child(2){background:#eef4fa}
.theme-blue .theme-preview i:last-child{background:#3479b9}

.theme-purple .theme-preview i:first-child{background:#2c203d}
.theme-purple .theme-preview i:nth-child(2){background:#f3f0f7}
.theme-purple .theme-preview i:last-child{background:#7958a7}

.theme-rose .theme-preview i:first-child{background:#42252e}
.theme-rose .theme-preview i:nth-child(2){background:#f8f1f3}
.theme-rose .theme-preview i:last-child{background:#b65c78}

.theme-sand .theme-preview i:first-child{background:#332d23}
.theme-sand .theme-preview i:nth-child(2){background:#f5f1e8}
.theme-sand .theme-preview i:last-child{background:#9b7b45}

.wa-operator-note{
  margin-top:12px;
  color:var(--muted);
  font-size:11px;
  line-height:1.45;
}

/* ============================================================
   Temas por usuário
   Todos os temas são claros para manter boa legibilidade das telas atuais.
   ============================================================ */

body[data-theme="green"]{
  --theme-sidebar:#12251e;
  --theme-sidebar-active:#1c372d;
  --theme-chat:#eef2ef;
  --theme-bubble-out:#dff3e8;
  --theme-dot:#d5ded9;
}

body[data-theme="blue"]{
  --green:#2f6fa8;
  --green-2:#3d83bd;
  --green-soft:#e6f0f8;
  --bg:#f3f6f9;
  --theme-sidebar:#132b46;
  --theme-sidebar-active:#1d426a;
  --theme-chat:#edf3f7;
  --theme-bubble-out:#dcecf8;
  --theme-dot:#d2dde5;
}

body[data-theme="purple"]{
  --green:#715295;
  --green-2:#8663ad;
  --green-soft:#eee8f5;
  --bg:#f5f3f7;
  --theme-sidebar:#2c203d;
  --theme-sidebar-active:#44305d;
  --theme-chat:#f1eef4;
  --theme-bubble-out:#e9dff2;
  --theme-dot:#dcd5e3;
}

body[data-theme="rose"]{
  --green:#a84f6a;
  --green-2:#bd6480;
  --green-soft:#f7e7ec;
  --bg:#f8f4f5;
  --theme-sidebar:#42252e;
  --theme-sidebar-active:#613644;
  --theme-chat:#f6eff1;
  --theme-bubble-out:#f5dde5;
  --theme-dot:#e4d5da;
}

body[data-theme="sand"]{
  --green:#8a6b3d;
  --green-2:#a07d48;
  --green-soft:#f2eadc;
  --bg:#f7f4ed;
  --theme-sidebar:#332d23;
  --theme-sidebar-active:#4b4233;
  --theme-chat:#f3efe6;
  --theme-bubble-out:#eee2cb;
  --theme-dot:#ded6c8;
}

body[data-theme] .sidebar{
  background:var(--theme-sidebar,#12251e);
}

body[data-theme] .sidebar .nav-item:hover,
body[data-theme] .sidebar .nav-item.active{
  background:var(--theme-sidebar-active,#1c372d);
}

body[data-theme] .profile-chip{
  background:var(--theme-sidebar-active,#193229);
}

body[data-theme] .conversation-panel,
body[data-theme] .message-list{
  background-color:var(--theme-chat,#eef2ef);
}

body[data-theme] .message-list{
  background-image:
    radial-gradient(
      var(--theme-dot,#d5ded9) 0.6px,
      transparent 0.6px
    );
}

body[data-theme] .message-row.out .bubble:not(.sticker-bubble){
  background:var(--theme-bubble-out,#dff3e8);
}

body[data-theme] .brand-mark,
body[data-theme] .send-btn{
  background:var(--green);
}

@media(max-width:700px){
  .profile-avatar-grid{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }

  .profile-theme-grid{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
}


/* ============================================================
   Avatares nas mensagens — sempre à esquerda do balão
   ============================================================ */
.message-row.with-side-avatar{
  align-items:flex-end;
  gap:8px;
}

.message-row.with-side-avatar .bubble-shell{
  margin-left:0 !important;
  margin-right:0 !important;
}

.message-row.with-side-avatar.out{
  justify-content:flex-end;
}

.message-row.with-side-avatar.in{
  justify-content:flex-start;
}

.contact-message-avatar{
  background:#e5ece8;
  color:#5f736a;
}

.message-row.with-side-avatar.out .message-operator-avatar{
  background:#dcebe4;
  color:var(--green);
}

.message-row.with-side-avatar .message-operator-avatar{
  width:30px;
  height:30px;
  flex:0 0 30px;
  margin-bottom:2px;
}

/* ============================================================
   Animação Target — boneco tentando colocar dinheiro na carteira
   ============================================================ */
.target-loading.fancy{
  display:flex;
  align-items:center;
  gap:16px;
  color:#64736e;
  padding:18px 2px;
}

.target-loading-copy{
  display:flex;
  flex-direction:column;
  gap:5px;
  min-width:0;
}

.target-loading-copy b{
  color:#27332f;
  font-size:14px;
}

.target-loading-copy span{
  font-size:12px;
  line-height:1.45;
}

.target-money-scene{
  width:132px;
  height:86px;
  flex:0 0 132px;
  position:relative;
}

.target-wallet{
  position:absolute;
  right:2px;
  bottom:12px;
  width:52px;
  height:34px;
  border-radius:10px;
  background:#206e4f;
  box-shadow:inset 0 -4px 0 rgba(0,0,0,.12),0 7px 15px rgba(26,67,51,.12);
}

.target-wallet::before{
  content:'';
  position:absolute;
  left:8px;
  top:7px;
  right:8px;
  height:5px;
  border-radius:999px;
  background:rgba(255,255,255,.18);
}

.target-wallet-slot{
  position:absolute;
  left:8px;
  right:7px;
  top:13px;
  height:4px;
  border-radius:999px;
  background:rgba(10,28,20,.22);
}

.target-wallet-money{
  position:absolute;
  width:19px;
  height:11px;
  border-radius:3px;
  background:#85d19a;
  box-shadow:0 0 0 1px rgba(31,99,56,.15) inset;
}

.target-wallet-money.one{
  right:7px;
  top:-4px;
  transform:rotate(8deg);
}

.target-wallet-money.two{
  right:18px;
  top:-8px;
  transform:rotate(-3deg);
}

.target-stickman{
  position:absolute;
  left:8px;
  bottom:7px;
  width:54px;
  height:70px;
}

.target-stick-head{
  position:absolute;
  left:8px;
  top:0;
  width:14px;
  height:14px;
  border:2px solid #485750;
  border-radius:50%;
  background:#fff;
}

.target-stick-body{
  position:absolute;
  left:15px;
  top:14px;
  width:2px;
  height:23px;
  background:#485750;
}

.target-stick-arm{
  position:absolute;
  left:16px;
  top:18px;
  width:24px;
  height:2px;
  background:#485750;
  transform-origin:left center;
}

.target-stick-arm.arm-back{
  width:18px;
  transform:rotate(150deg);
}

.target-stick-arm.arm-front{
  animation:target-arm-reach 1.2s ease-in-out infinite;
}

.target-stick-leg{
  position:absolute;
  left:16px;
  top:36px;
  width:20px;
  height:2px;
  background:#485750;
  transform-origin:left center;
}

.target-stick-leg.leg-left{
  transform:rotate(58deg);
}

.target-stick-leg.leg-right{
  transform:rotate(108deg);
}

.target-stick-bill{
  position:absolute;
  left:33px;
  top:14px;
  width:15px;
  height:9px;
  border-radius:2px;
  background:#96d8a7;
  box-shadow:0 0 0 1px rgba(31,99,56,.12) inset;
  animation:target-bill-drop 1.2s ease-in-out infinite;
}

.target-processing-message .target-loading.fancy{
  padding:2px 0;
}

@keyframes target-arm-reach{
  0%,100%{transform:rotate(18deg)}
  45%,55%{transform:rotate(-14deg)}
}

@keyframes target-bill-drop{
  0%,100%{
    transform:translate(0,0) rotate(0deg);
    opacity:1;
  }
  48%{
    transform:translate(34px,8px) rotate(7deg);
    opacity:1;
  }
  55%{
    transform:translate(38px,10px) rotate(9deg);
    opacity:.25;
  }
  56%{
    transform:translate(0,0) rotate(0deg);
    opacity:0;
  }
  70%{
    transform:translate(0,0) rotate(0deg);
    opacity:1;
  }
}

@media (max-width:700px){
  .target-loading.fancy{
    flex-direction:column;
    align-items:flex-start;
  }

  .target-money-scene{
    width:118px;
    height:80px;
  }
}


/* ============================================================
   Resumo global do contato no cabeçalho
   ============================================================ */
.conversation-head{
  gap:12px;
}

.contact-title{
  min-width:190px;
  flex:1 1 auto;
}

.contact-summary{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  gap:5px;
  margin-left:auto;
}

.contact-summary-btn{
  height:32px;
  min-width:44px;
  padding:0 8px;
  border:1px solid #e1e7e4;
  border-radius:10px;
  background:#f8faf9;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:5px;
  color:#71807a;
  transition:
    background .12s ease,
    border-color .12s ease,
    color .12s ease,
    transform .12s ease;
}

.contact-summary-btn:hover{
  background:#eef5f2;
  border-color:#cbded5;
  color:var(--green);
  transform:translateY(-1px);
}

.contact-summary-btn.has-items{
  background:var(--green-soft);
  border-color:#cce2d8;
  color:var(--green);
}

.contact-summary-icon{
  font-size:14px;
  line-height:1;
}

.contact-summary-count{
  min-width:10px;
  font-size:11px;
  font-weight:850;
  text-align:center;
}

.drawer-section.drawer-highlight{
  animation:drawer-summary-highlight 1.1s ease;
}

@keyframes drawer-summary-highlight{
  0%,100%{
    box-shadow:none;
    background:transparent;
  }
  30%,65%{
    box-shadow:0 0 0 2px rgba(33,132,95,.16);
    background:rgba(33,132,95,.055);
  }
}

/* ============================================================
   Auditoria: busca, filtros e paginação
   ============================================================ */
.audit-filter-card{
  margin-bottom:12px;
}

.audit-filters{
  display:grid;
  grid-template-columns:minmax(240px,2fr) repeat(5,minmax(115px,1fr)) auto;
  gap:9px;
  align-items:end;
}

.audit-filters label{
  display:flex;
  flex-direction:column;
  gap:5px;
  color:#65736e;
  font-size:10px;
  font-weight:700;
}

.audit-filters input,
.audit-filters select{
  min-width:0;
}

.audit-search{
  height:38px;
  display:flex;
  align-items:center;
  gap:7px;
  padding:0 10px;
  background:#f3f6f4;
  border:1px solid #e0e6e3;
  border-radius:9px;
}

.audit-search:focus-within{
  border-color:#a9cbbb;
  box-shadow:0 0 0 3px rgba(33,132,95,.09);
}

.audit-search span{
  color:#7a8882;
}

.audit-search input{
  width:100%;
  border:0;
  padding:0;
  background:transparent;
  box-shadow:none;
}

.audit-filter-actions{
  display:flex;
  gap:5px;
  align-items:center;
}

.audit-pagination{
  min-height:54px;
  padding:10px 14px;
  border-top:1px solid var(--line);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  color:var(--muted);
  font-size:11px;
}

.audit-pagination-actions{
  display:flex;
  align-items:center;
  gap:9px;
}

.audit-pagination-actions button:disabled{
  opacity:.45;
  cursor:not-allowed;
}

.audit-user-login{
  display:block;
  margin-top:2px;
  color:#8a9691;
  font-size:9px;
  font-weight:400;
}

.audit-details-cell{
  max-width:420px;
  word-break:break-word;
}

@media(max-width:1250px){
  .audit-filters{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }

  .audit-search{
    grid-column:span 2;
  }
}

@media(max-width:900px){
  .contact-summary{
    gap:3px;
  }

  .contact-summary-btn{
    min-width:36px;
    padding:0 6px;
  }

  .audit-filters{
    grid-template-columns:1fr 1fr;
  }

  .audit-search{
    grid-column:1/-1;
  }

  .audit-pagination{
    align-items:flex-start;
    flex-direction:column;
  }
}


/* ============================================================
   Transcrição automática de áudio — Groq Whisper
   ============================================================ */
.audio-transcription{
  margin-top:7px;
  border-radius:9px;
  font-size:11px;
  line-height:1.45;
}

.audio-transcription.done{
  padding:8px 9px;
  background:rgba(255,255,255,.53);
  border:1px solid rgba(94,126,111,.15);
}

.message-row.in .audio-transcription.done{
  background:#f7f9f8;
}

.audio-transcription-title{
  display:flex;
  align-items:center;
  gap:5px;
  margin-bottom:4px;
  color:var(--green);
  font-size:10px;
}

.audio-transcription-text{
  color:#3f4d48;
  white-space:pre-wrap;
  word-break:break-word;
}

.audio-transcription.processing{
  display:flex;
  align-items:center;
  gap:7px;
  padding:6px 2px 2px;
  color:#72817b;
}

.audio-transcription-spinner{
  width:13px;
  height:13px;
  flex:0 0 13px;
  border:2px solid #d6e1dc;
  border-top-color:var(--green);
  border-radius:50%;
  animation:audio-transcription-spin .72s linear infinite;
}

@keyframes audio-transcription-spin{
  to{transform:rotate(360deg)}
}

.audio-transcription.error{
  padding:7px 8px;
  background:#fff5f5;
  border:1px solid #f1d5d5;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:9px;
  color:#8c4a4a;
}

.audio-transcription.error>div{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:2px;
}

.audio-transcription.error b{font-size:10px}
.audio-transcription.error span{font-size:9px}

.transcribe-audio-btn{
  flex:0 0 auto;
  border:1px solid #cbded5;
  background:#f5faf7;
  color:var(--green);
  border-radius:8px;
  padding:5px 7px;
  font-size:9px;
  font-weight:750;
}

.transcribe-audio-btn:hover{background:var(--green-soft)}
.transcribe-audio-btn:disabled{opacity:.55;cursor:not-allowed}
.audio-transcription.pending{padding-top:5px}


/* ============================================================
   Compartilhar contatos
   ============================================================ */
.attachment-option.contact .attachment-option-icon{
  background:#e7f5ee;
  color:#27835f;
}

.share-contact-modal{
  min-height:360px;
}

.share-contact-row{
  width:100%;
  border:0;
  border-bottom:1px solid var(--line);
  background:#fff;
  padding:9px 5px;
  display:flex;
  align-items:center;
  gap:9px;
  text-align:left;
}

.share-contact-row:hover{
  background:#f7faf8;
}

.share-contact-row.selected{
  background:var(--green-soft);
}

.share-contact-check{
  width:23px;
  height:23px;
  flex:0 0 23px;
  border:1px solid #cbd6d1;
  border-radius:50%;
  display:grid;
  place-items:center;
  color:#fff;
  font-size:11px;
  font-weight:900;
}

.share-contact-row.selected .share-contact-check{
  border-color:var(--green);
  background:var(--green);
}

.shared-contact-list{
  display:flex;
  flex-direction:column;
  gap:5px;
  min-width:220px;
}

.shared-contact-card{
  display:flex;
  align-items:center;
  gap:9px;
  padding:8px 9px;
  border:1px solid rgba(93,116,106,.16);
  border-radius:10px;
  background:rgba(255,255,255,.55);
}

.message-row.in .shared-contact-card{
  background:#f8faf9;
}

.shared-contact-avatar{
  width:34px;
  height:34px;
  flex:0 0 34px;
  border-radius:50%;
  display:grid;
  place-items:center;
  background:#dfece6;
  color:var(--green);
  font-size:10px;
  font-weight:850;
}

.shared-contact-info{
  min-width:0;
  flex:1;
  display:flex;
  flex-direction:column;
  gap:2px;
}

.shared-contact-info b{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:11px;
  color:#33413c;
}

.shared-contact-info small{
  color:#78857f;
  font-size:9px;
}

.shared-contact-symbol{
  color:var(--green);
  font-size:17px;
}

/* ============================================================
   Anexos/documentos claramente baixáveis
   ============================================================ */
.msg-file-card{
  min-width:235px;
  max-width:360px;
  display:flex;
  align-items:center;
  gap:9px;
  padding:8px;
  border:1px solid rgba(79,105,94,.16);
  border-radius:10px;
  background:rgba(255,255,255,.62);
  color:inherit;
  text-decoration:none;
  transition:
    background .12s ease,
    border-color .12s ease,
    transform .12s ease;
}

.message-row.in .msg-file-card{
  background:#f8faf9;
}

.msg-file-card:hover{
  background:#fff;
  border-color:#b9d3c7;
  transform:translateY(-1px);
}

.msg-file-type{
  width:39px;
  height:39px;
  flex:0 0 39px;
  border-radius:9px;
  display:grid;
  place-items:center;
  background:#eee9f8;
  color:#6f55a1;
  font-size:9px;
  font-weight:900;
}

.msg-file-info{
  min-width:0;
  flex:1;
  display:flex;
  flex-direction:column;
  gap:2px;
}

.msg-file-info b{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#34423d;
  font-size:10.5px;
}

.msg-file-info small{
  color:#7c8984;
  font-size:8.5px;
}

.msg-file-download{
  width:28px;
  height:28px;
  flex:0 0 28px;
  border-radius:50%;
  display:grid;
  place-items:center;
  background:#edf5f1;
  color:var(--green);
  font-size:15px;
  font-weight:800;
}

.transfer-help{
  color:#6d7c77;
  font-size:12px;
  line-height:1.45;
  margin-top:8px;
}


/* ============================================================
   Arrastar e soltar anexos
   ============================================================ */
.conversation{
  position:relative;
}

.attachment-drop-overlay{
  position:absolute;
  inset:70px 10px 76px;
  z-index:80;
  border:2px dashed rgba(33,132,95,.56);
  border-radius:16px;
  background:rgba(238,248,243,.94);
  backdrop-filter:blur(3px);
  display:grid;
  place-items:center;
  pointer-events:none;
  box-shadow:
    inset 0 0 0 4px rgba(255,255,255,.42),
    0 12px 38px rgba(25,67,50,.10);
}

.attachment-drop-card{
  max-width:390px;
  padding:26px 32px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:7px;
  text-align:center;
  color:#53655e;
}

.attachment-drop-card b{
  color:var(--green);
  font-size:16px;
}

.attachment-drop-card>span:not(.attachment-drop-icon){
  font-size:12px;
  line-height:1.45;
}

.attachment-drop-card small{
  color:#7d8c86;
  font-size:10px;
}

.attachment-drop-icon{
  width:54px;
  height:54px;
  border-radius:17px;
  display:grid;
  place-items:center;
  margin-bottom:4px;
  background:var(--green);
  color:#fff;
  font-size:29px;
  box-shadow:0 9px 22px rgba(33,132,95,.22);
}

.conversation.dragging-files .message-list{
  filter:saturate(.8);
}

/* ============================================================
   Imagem clicável
   ============================================================ */
.message-image-open{
  position:relative;
  display:block;
  max-width:340px;
  margin:0 0 6px;
  padding:0;
  border:0;
  border-radius:8px;
  overflow:hidden;
  background:transparent;
  cursor:zoom-in;
}

.message-image-open .msg-media{
  margin:0;
  transition:
    transform .16s ease,
    filter .16s ease;
}

.message-image-open:hover .msg-media{
  transform:scale(1.012);
  filter:brightness(.94);
}

.message-image-hint{
  position:absolute;
  right:7px;
  bottom:7px;
  padding:4px 7px;
  border-radius:7px;
  background:rgba(19,31,27,.68);
  color:#fff;
  font-size:9px;
  font-weight:750;
  opacity:0;
  transform:translateY(3px);
  transition:
    opacity .14s ease,
    transform .14s ease;
  pointer-events:none;
}

.message-image-open:hover .message-image-hint{
  opacity:1;
  transform:translateY(0);
}

/* ============================================================
   Visualizador de imagens
   ============================================================ */
body.image-viewer-open{
  overflow:hidden;
}

.image-viewer{
  position:fixed;
  inset:0;
  z-index:10000;
  display:grid;
  place-items:center;
  padding:18px;
  background:rgba(11,16,14,.86);
  backdrop-filter:blur(7px);
}

.image-viewer-panel{
  width:min(96vw,1500px);
  height:min(94vh,1000px);
  overflow:hidden;
  border:1px solid rgba(255,255,255,.13);
  border-radius:16px;
  background:#151b19;
  display:flex;
  flex-direction:column;
  box-shadow:0 28px 90px rgba(0,0,0,.45);
}

.image-viewer-toolbar{
  min-height:56px;
  padding:8px 10px 8px 15px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  background:#202825;
  border-bottom:1px solid rgba(255,255,255,.08);
}

.image-viewer-name{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#f1f5f3;
  font-size:12px;
  font-weight:700;
}

.image-viewer-actions{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  gap:5px;
}

.image-viewer-actions button,
.image-viewer-download{
  height:34px;
  min-width:34px;
  padding:0 9px;
  border:1px solid rgba(255,255,255,.11);
  border-radius:8px;
  background:#2a3430;
  color:#f4f7f6;
  text-decoration:none;
  display:grid;
  place-items:center;
  font-size:11px;
  font-weight:700;
}

.image-viewer-actions button:hover,
.image-viewer-download:hover{
  background:#34413c;
  border-color:rgba(255,255,255,.19);
}

.image-viewer-actions .image-viewer-close{
  margin-left:4px;
  font-size:21px;
  font-weight:400;
}

.image-viewer-separator{
  width:1px;
  height:22px;
  margin:0 3px;
  background:rgba(255,255,255,.10);
}

#image-viewer-zoom{
  width:48px;
  color:#c8d2ce;
  text-align:center;
  font-size:10px;
  font-variant-numeric:tabular-nums;
}

.image-viewer-stage{
  position:relative;
  flex:1;
  min-height:0;
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:center;
  background:
    linear-gradient(
      45deg,
      rgba(255,255,255,.025) 25%,
      transparent 25%,
      transparent 75%,
      rgba(255,255,255,.025) 75%
    ),
    linear-gradient(
      45deg,
      rgba(255,255,255,.025) 25%,
      transparent 25%,
      transparent 75%,
      rgba(255,255,255,.025) 75%
    ),
    #111614;
  background-size:24px 24px;
  background-position:0 0,12px 12px;
  touch-action:none;
}

#image-viewer-image{
  display:block;
  max-width:92%;
  max-height:92%;
  object-fit:contain;
  transform-origin:center center;
  user-select:none;
  cursor:grab;
  will-change:transform;
  transition:transform .09s ease-out;
}

#image-viewer-image.dragging{
  cursor:grabbing;
  transition:none;
}

.image-viewer-help{
  min-height:28px;
  display:grid;
  place-items:center;
  padding:4px 10px;
  background:#1d2522;
  border-top:1px solid rgba(255,255,255,.07);
  color:#8f9d97;
  font-size:9px;
}

@media(max-width:760px){
  .attachment-drop-overlay{
    inset:70px 7px 72px;
  }

  .image-viewer{
    padding:0;
  }

  .image-viewer-panel{
    width:100vw;
    height:100vh;
    border:0;
    border-radius:0;
  }

  .image-viewer-toolbar{
    align-items:flex-start;
    flex-direction:column;
    padding:8px;
  }

  .image-viewer-actions{
    width:100%;
    overflow-x:auto;
    justify-content:flex-start;
    padding-bottom:2px;
  }

  .image-viewer-name{
    width:100%;
  }

  .image-viewer-help{
    display:none;
  }
}


/* ============================================================
   Barra horizontal de anexos — não aumenta o composer
   ============================================================ */
.composer{
  min-width:0;
  overflow:visible;
}

.compose-field{
  min-width:0;
  max-width:100%;
  overflow:hidden;
}

.send-btn{
  flex:0 0 42px;
}

.composer-action,
.attach-btn{
  flex:0 0 auto;
}

.file-preview{
  min-width:0;
  max-width:100%;
  overflow:hidden;
}

.file-batch-head{
  min-width:0;
}

.file-batch-head>span{
  min-width:0;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
}

.file-batch-head-actions{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  gap:4px;
}

.file-batch-head .file-scroll-btn{
  width:24px;
  height:24px;
  flex:0 0 24px;
  padding:0;
  border:1px solid #d5dfda;
  border-radius:7px;
  background:#fff;
  color:#61716b;
  display:grid;
  place-items:center;
  font-size:18px;
  line-height:1;
}

.file-batch-head .file-scroll-btn:hover:not(:disabled){
  background:#f1f6f3;
  color:var(--green);
  border-color:#c2d4cb;
}

.file-batch-head .file-scroll-btn:disabled{
  opacity:.28;
  cursor:default;
}

.file-batch-head .clear-files-btn{
  margin-left:3px;
  white-space:nowrap;
}

.file-batch-list{
  width:100%;
  max-width:100%;
  min-width:0;
  overflow-x:scroll;
  overflow-y:hidden;
  flex-wrap:nowrap;
  scrollbar-width:thin;
  scrollbar-color:#bfcac5 #eef2f0;
  scroll-behavior:smooth;
  overscroll-behavior-x:contain;
  scrollbar-gutter:stable;
  padding:1px 1px 7px;
}

.file-batch-list::-webkit-scrollbar{
  height:8px;
}

.file-batch-list::-webkit-scrollbar-track{
  background:#eef2f0;
  border-radius:999px;
}

.file-batch-list::-webkit-scrollbar-thumb{
  background:#bfcac5;
  border-radius:999px;
  border:2px solid #eef2f0;
}

.file-batch-list::-webkit-scrollbar-thumb:hover{
  background:#9fada7;
}

.file-preview-item{
  flex:0 0 210px;
  width:210px;
  min-width:210px;
}

@media(max-width:760px){
  .file-batch-head{
    gap:5px;
  }

  .file-batch-head-actions{
    gap:2px;
  }

  .file-batch-head .clear-files-btn{
    font-size:9px;
  }

  .file-preview-item{
    flex-basis:190px;
    width:190px;
    min-width:190px;
  }
}


/* ============================================================
   Logo Casa Limpa + menu retrátil
   ============================================================ */
.brand-login{
  gap:16px;
}

.brand-login-logo{
  display:block;
  width:min(100%,420px);
  height:auto;
  object-fit:contain;
}

.brand-login-copy h1{
  margin:0;
}

.brand-login-copy p{
  margin:4px 0 0;
  color:var(--muted);
  font-size:14px;
}

.sidebar{
  transition:
    width .18s ease,
    padding .18s ease;
}

.sidebar-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  padding:0 8px 18px;
}

.sidebar-brand{
  flex:1;
  min-width:0;
  padding:0 !important;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:8px;
}

.brand-thumb{
  width:42px;
  height:42px;
  border-radius:12px;
  background:#fff;
  box-shadow:0 7px 18px rgba(23,107,74,.22);
  overflow:hidden;
  flex:0 0 42px;
  display:grid;
  place-items:center;
}

.brand-thumb img{
  width:38px;
  height:38px;
  object-fit:contain;
  display:block;
}

.brand-name{
  display:block;
  min-width:0;
  max-width:116px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  text-align:center;
  line-height:1.1;
  font-weight:800;
  font-size:17px;
  color:#fff;
}

.sidebar-toggle{
  width:34px;
  height:34px;
  flex:0 0 34px;
  border:0;
  border-radius:10px;
  background:#1c372d;
  color:#fff;
  display:grid;
  place-items:center;
  font-size:16px;
  font-weight:800;
}

.sidebar-toggle:hover{
  filter:brightness(1.05);
}

.sidebar.collapsed{
  width:72px;
  padding-left:8px;
  padding-right:8px;
}

.sidebar.collapsed .brand-name,
.sidebar.collapsed .nav-item span:not(.nav-icon),
.sidebar.collapsed .profile-text,
.sidebar.collapsed .wa-mini span{
  display:none !important;
}

.sidebar.collapsed .sidebar-top{
  flex-direction:column;
  align-items:center;
  padding-left:0;
  padding-right:0;
}

.sidebar.collapsed .sidebar-brand{
  justify-content:center;
  align-items:center;
}

.sidebar.collapsed .profile-chip,
.sidebar.collapsed .nav-item,
.sidebar.collapsed .wa-mini{
  justify-content:center;
}

.sidebar.collapsed .brand-thumb{
  margin:0 auto;
}

.sidebar.collapsed .sidebar-toggle{
  width:30px;
  height:30px;
  font-size:14px;
}

@media(max-width:1100px){
  .sidebar:not(.collapsed){
    width:212px;
    padding-left:12px;
    padding-right:12px;
  }

  .sidebar:not(.collapsed) .brand.compact span.brand-name,
  .sidebar:not(.collapsed) .nav-item span,
  .sidebar:not(.collapsed) .profile-text,
  .sidebar:not(.collapsed) .wa-mini span{
    display:initial;
  }

  .sidebar:not(.collapsed) .nav-item{
    gap:11px;
    justify-content:flex-start;
  }

  .sidebar:not(.collapsed) .wa-mini,
  .sidebar:not(.collapsed) .profile-chip{
    justify-content:flex-start;
  }

  .sidebar:not(.collapsed) .sidebar-top{
    flex-direction:row;
    align-items:flex-start;
  }
}

@media(max-width:760px){
  .brand-login-logo{
    width:min(100%,320px);
  }

  .sidebar:not(.collapsed){
    width:212px;
    padding-left:12px;
    padding-right:12px;
  }

  .sidebar.collapsed{
    width:58px;
    padding-left:7px;
    padding-right:7px;
  }

  .sidebar:not(.collapsed) + .content .conversation-panel{
    left:212px;
  }

  .sidebar.collapsed + .content .conversation-panel{
    left:58px;
  }
}


/* ============================================================
   Encaminhamento em massa
   ============================================================ */
.forward-selection-bar{
  min-height:54px;
  flex:0 0 auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:8px 14px;
  border-top:1px solid var(--line);
  background:#fff;
  box-shadow:0 -6px 18px rgba(28,55,45,.05);
}

.forward-selection-info{
  display:flex;
  align-items:center;
  gap:7px;
  color:#66756f;
  font-size:12px;
}

.forward-selection-info b{
  width:28px;
  height:28px;
  display:grid;
  place-items:center;
  border-radius:50%;
  background:var(--green);
  color:#fff;
  font-size:12px;
}

.forward-selection-actions{
  display:flex;
  gap:6px;
}

.message-forward-check{
  position:absolute;
  top:50%;
  left:-34px;
  width:24px;
  height:24px;
  transform:translateY(-50%);
  z-index:7;
  padding:0;
  border:2px solid #aab9b3;
  border-radius:50%;
  background:#fff;
  color:#fff;
  display:grid;
  place-items:center;
  font-size:12px;
  font-weight:900;
}

.message-row.out .message-forward-check{
  left:auto;
  right:-34px;
}

.message-forward-check:hover{
  border-color:var(--green);
}

.message-forward-check.selected{
  border-color:var(--green);
  background:var(--green);
}

.message-row.forward-selected .bubble{
  outline:2px solid rgba(33,132,95,.32);
  outline-offset:2px;
}

.message-row.forward-selected{
  background:rgba(33,132,95,.035);
}

.forwarded-message-label{
  margin-bottom:4px;
  color:#788780;
  font-size:9px;
  font-style:italic;
}

.forward-modal{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.forward-modal-summary{
  display:flex;
  align-items:center;
  gap:8px;
  padding:9px 10px;
  border:1px solid #dfe8e4;
  border-radius:10px;
  background:#f6faf8;
  color:#596a63;
  font-size:12px;
}

.forward-modal-summary b{
  width:26px;
  height:26px;
  display:grid;
  place-items:center;
  border-radius:50%;
  background:var(--green);
  color:#fff;
}

.forward-recent-label{
  color:#82908a;
  font-size:10px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.04em;
}

.forward-destination-results{
  max-height:52vh;
  overflow:auto;
  border:1px solid var(--line);
  border-radius:11px;
  background:#fff;
}

.forward-destination-row{
  width:100%;
  border:0;
  border-bottom:1px solid #edf1ef;
  background:#fff;
  padding:10px;
  display:flex;
  align-items:center;
  gap:10px;
  text-align:left;
}

.forward-destination-row:last-child{
  border-bottom:0;
}

.forward-destination-row:hover:not(:disabled){
  background:#f7faf8;
}

.forward-destination-row.selected{
  background:var(--green-soft);
}

.forward-destination-row.locked{
  opacity:.52;
  cursor:not-allowed;
}

.forward-destination-avatar{
  width:40px;
  height:40px;
  flex:0 0 40px;
}

.forward-destination-main{
  min-width:0;
  flex:1;
  display:flex;
  flex-direction:column;
  gap:3px;
}

.forward-destination-name{
  display:flex;
  align-items:center;
  gap:6px;
  min-width:0;
  color:#33423c;
  font-size:12px;
  font-weight:800;
}

.forward-destination-name{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.forward-kind-pill{
  flex:0 0 auto;
  padding:2px 6px;
  border-radius:999px;
  background:#e8eef8;
  color:#536d9d;
  font-size:8px;
  font-weight:800;
}

.forward-destination-meta{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#7d8a85;
  font-size:9.5px;
}

.forward-destination-side{
  min-width:74px;
  flex:0 0 auto;
  display:grid;
  grid-template-columns:1fr 24px;
  align-items:center;
  justify-items:end;
  gap:3px 7px;
}

.forward-destination-side small{
  grid-column:1;
  color:#8a9691;
  font-size:8.5px;
  white-space:nowrap;
}

.forward-destination-side em{
  grid-column:1;
  color:var(--green);
  font-size:8px;
  font-style:normal;
  font-weight:750;
  white-space:nowrap;
}

.forward-destination-check{
  grid-column:2;
  grid-row:1 / span 2;
  width:23px;
  height:23px;
  border:1px solid #cbd6d1;
  border-radius:50%;
  display:grid;
  place-items:center;
  color:#fff;
  font-size:11px;
  font-weight:900;
}

.forward-destination-row.selected .forward-destination-check{
  background:var(--green);
  border-color:var(--green);
}

@media(max-width:760px){
  .message-forward-check{
    left:-27px;
  }

  .message-row.out .message-forward-check{
    right:-27px;
  }

  .forward-selection-bar{
    padding:7px 9px;
  }

  .forward-destination-side{
    min-width:28px;
  }

  .forward-destination-side small,
  .forward-destination-side em{
    display:none;
  }
}


/* ============================================================
   Hotfix UX — seleção para encaminhamento
   ============================================================ */

/*
  A seleção ganha um "gutter" próprio à esquerda.
  Assim o círculo nunca fica sobre avatar/foto do contato.
*/
#message-list.forward-selection-active .message-row[data-message-row]{
  position:relative;
  padding-left:40px;
  min-height:38px;
  border-radius:10px;
  cursor:pointer;
  transition:
    background .12s ease,
    box-shadow .12s ease;
}

#message-list.forward-selection-active .message-row[data-message-row]:hover{
  background:rgba(33,132,95,.045);
}

/*
  Durante seleção, escondemos ações de hover para o clique inteiro
  ter um comportamento único: selecionar/desmarcar.
*/
#message-list.forward-selection-active .message-hover-actions{
  display:none !important;
}

.message-forward-check{
  position:absolute !important;
  left:8px !important;
  right:auto !important;
  top:50% !important;
  transform:translateY(-50%) !important;
  width:24px !important;
  height:24px !important;
  min-width:24px;
  flex:0 0 24px;
  z-index:8;
  padding:0 !important;
  border:2px solid #aebbb6 !important;
  border-radius:50% !important;
  background:#fff !important;
  color:#fff !important;
  display:grid !important;
  place-items:center;
  font-size:12px !important;
  line-height:1;
  font-weight:900;
  box-shadow:
    0 1px 3px rgba(25,50,41,.13),
    0 0 0 2px rgba(255,255,255,.68);
}

.message-forward-check:hover{
  border-color:var(--green) !important;
  box-shadow:
    0 1px 4px rgba(25,50,41,.16),
    0 0 0 3px rgba(33,132,95,.09);
}

.message-forward-check.selected{
  border-color:var(--green) !important;
  background:var(--green) !important;
  box-shadow:
    0 2px 6px rgba(25,50,41,.15),
    0 0 0 3px rgba(33,132,95,.10);
}

/* não coloca mais o checkbox do lado direito nas mensagens enviadas */
.message-row.out .message-forward-check{
  left:8px !important;
  right:auto !important;
}

#message-list.forward-selection-active .message-row.forward-selected{
  background:rgba(33,132,95,.075);
}

#message-list.forward-selection-active .message-row.forward-selected .bubble{
  outline:2px solid rgba(33,132,95,.35);
  outline-offset:2px;
}

@media(max-width:760px){
  #message-list.forward-selection-active .message-row[data-message-row]{
    padding-left:34px;
  }

  .message-forward-check,
  .message-row.out .message-forward-check{
    left:5px !important;
    width:22px !important;
    height:22px !important;
    min-width:22px;
  }
}


/* ============================================================
   Encaminhamento — modal preso à tela, scroll só na lista
   ============================================================ */

/*
  O modal genérico usa overflow:auto, então quando a lista de destinos cresce
  o rodapé "Cancelar / Encaminhar" pode sair da área visível.

  No modal de encaminhamento transformamos a estrutura em 3 faixas fixas:
  cabeçalho | conteúdo flexível | rodapé.
  Somente .forward-destination-results recebe rolagem.
*/
.modal:has(.forward-modal){
  width:min(620px,96vw);
  height:min(88dvh,780px);
  max-height:calc(100dvh - 24px);
  overflow:hidden;
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto;
}

.modal:has(.forward-modal) .modal-head,
.modal:has(.forward-modal) .modal-foot{
  position:relative;
  z-index:2;
  flex:0 0 auto;
  background:#fff;
}

.modal:has(.forward-modal) .modal-body{
  min-height:0;
  overflow:hidden;
  display:flex;
  padding:20px;
}

.modal:has(.forward-modal) .forward-modal{
  width:100%;
  min-height:0;
  flex:1 1 auto;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.modal:has(.forward-modal) .forward-modal-summary,
.modal:has(.forward-modal) .start-ticket-search,
.modal:has(.forward-modal) .forward-recent-label{
  flex:0 0 auto;
}

.modal:has(.forward-modal) .forward-destination-results{
  flex:1 1 auto;
  min-height:0;
  max-height:none;
  overflow-y:auto;
  overflow-x:hidden;
  overscroll-behavior:contain;
  scrollbar-gutter:stable;
}

/* O rodapé fica sempre visível, mesmo com centenas de destinos. */
.modal:has(.forward-modal) .modal-foot{
  box-shadow:0 -6px 18px rgba(25,50,41,.05);
}

/* Telas menores: usa praticamente toda a altura disponível. */
@media(max-height:720px){
  .modal:has(.forward-modal){
    height:calc(100dvh - 16px);
    max-height:calc(100dvh - 16px);
  }

  .modal:has(.forward-modal) .modal-body{
    padding:14px 16px;
  }

  .modal:has(.forward-modal) .modal-head{
    padding:13px 16px;
  }

  .modal:has(.forward-modal) .modal-foot{
    padding:10px 16px;
  }
}

@media(max-width:760px){
  .modal:has(.forward-modal){
    width:calc(100vw - 14px);
    height:calc(100dvh - 14px);
    max-height:calc(100dvh - 14px);
  }
}


/* ============================================================
   Contador individual de mensagens não visualizadas nos grupos
   ============================================================ */
.group-list-side{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  gap:7px;
}

.group-unread-badge{
  min-width:19px;
  height:19px;
  padding:0 5px;
  border-radius:999px;
  display:inline-grid;
  place-items:center;
  background:#e5484d;
  color:#fff;
  font-size:9px;
  line-height:1;
  font-weight:850;
  font-variant-numeric:tabular-nums;
  box-shadow:0 1px 3px rgba(143,28,32,.18);
}

.group-item.active .group-unread-badge{
  display:none;
}


/* ============================================================
   Paginação infinita — Encerrados
   ============================================================ */
.closed-scroll-footer{
  min-height:48px;
  padding:12px 16px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  color:#7c8984;
  font-size:10.5px;
  border-top:1px solid #edf1ef;
  background:#fafcfb;
}

.closed-scroll-footer.end{
  color:#8d9994;
  font-style:italic;
}

.closed-load-wheel{
  width:16px;
  height:16px;
  border:2px solid #d6e1dc;
  border-top-color:var(--green);
  border-radius:50%;
  animation:closed-wheel-spin .72s linear infinite;
}

@keyframes closed-wheel-spin{
  to{
    transform:rotate(360deg);
  }
}

/* ============================================================
   Loading engraçado dos grupos
   ============================================================ */
.group-funny-loader{
  width:100%;
  min-height:300px;
  padding:28px 18px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:12px;
  text-align:center;
  color:#687770;
}

.group-funny-loader.compact{
  min-height:280px;
}

.group-loader-scene{
  position:relative;
  width:150px;
  height:112px;
}

.group-loader-inbox{
  position:absolute;
  left:50%;
  bottom:4px;
  width:76px;
  height:58px;
  transform:translateX(-50%);
  border-radius:15px 15px 20px 20px;
  background:linear-gradient(180deg,var(--green-2),var(--green));
  box-shadow:0 12px 25px rgba(23,107,74,.18);
  animation:group-inbox-bob 1.25s ease-in-out infinite;
}

.group-loader-inbox::before{
  content:'';
  position:absolute;
  left:13px;
  right:13px;
  top:-10px;
  height:18px;
  border:4px solid rgba(255,255,255,.86);
  border-bottom:0;
  border-radius:16px 16px 0 0;
}

.group-loader-eye{
  position:absolute;
  top:22px;
  width:7px;
  height:9px;
  border-radius:50%;
  background:#fff;
}

.group-loader-eye.left{
  left:22px;
}

.group-loader-eye.right{
  right:22px;
}

.group-loader-mouth{
  position:absolute;
  left:50%;
  top:37px;
  width:20px;
  height:9px;
  transform:translateX(-50%);
  border-bottom:2px solid rgba(255,255,255,.92);
  border-radius:0 0 18px 18px;
}

.group-loader-bubble{
  position:absolute;
  min-width:34px;
  height:28px;
  padding:0 7px;
  border-radius:9px;
  display:grid;
  place-items:center;
  background:#fff;
  border:1px solid #dfe8e4;
  box-shadow:0 5px 14px rgba(31,56,47,.10);
  color:#4e6159;
  font-size:10px;
  font-weight:800;
  opacity:0;
}

.group-loader-bubble::after{
  content:'';
  position:absolute;
  bottom:-5px;
  left:8px;
  width:8px;
  height:8px;
  background:#fff;
  border-right:1px solid #dfe8e4;
  border-bottom:1px solid #dfe8e4;
  transform:rotate(45deg);
}

.group-loader-bubble.bubble-a{
  left:6px;
  top:12px;
  animation:group-message-toss 2.1s ease-in-out infinite;
}

.group-loader-bubble.bubble-b{
  right:3px;
  top:2px;
  animation:group-message-toss 2.1s .45s ease-in-out infinite;
}

.group-loader-bubble.bubble-c{
  left:24px;
  top:0;
  animation:group-message-toss 2.1s .9s ease-in-out infinite;
}

.group-loader-bubble.bubble-d{
  right:18px;
  top:27px;
  animation:group-message-toss 2.1s 1.35s ease-in-out infinite;
}

.group-loader-copy{
  display:flex;
  flex-direction:column;
  gap:4px;
  max-width:330px;
}

.group-loader-copy b{
  color:#34463f;
  font-size:13px;
}

.group-loader-copy span{
  color:#7c8a84;
  font-size:10.5px;
  line-height:1.45;
}

.group-loader-dots{
  display:flex;
  align-items:center;
  gap:5px;
  margin-top:2px;
}

.group-loader-dots i{
  width:6px;
  height:6px;
  border-radius:50%;
  background:var(--green);
  animation:group-dot-hop .9s ease-in-out infinite;
}

.group-loader-dots i:nth-child(2){
  animation-delay:.14s;
}

.group-loader-dots i:nth-child(3){
  animation-delay:.28s;
}

.group-conversation-loading{
  position:absolute;
  inset:0;
  z-index:45;
  display:grid;
  place-items:center;
  background:
    radial-gradient(circle at center,rgba(255,255,255,.96),rgba(241,246,243,.94));
  backdrop-filter:blur(2px);
}

.group-conversation-loading .group-funny-loader{
  min-height:0;
}

@keyframes group-inbox-bob{
  0%,100%{
    transform:translateX(-50%) rotate(-1deg) translateY(0);
  }

  50%{
    transform:translateX(-50%) rotate(1deg) translateY(-3px);
  }
}

@keyframes group-message-toss{
  0%{
    opacity:0;
    transform:translateY(-8px) rotate(-8deg) scale(.85);
  }

  18%{
    opacity:1;
  }

  58%{
    opacity:1;
    transform:translate(25px,46px) rotate(7deg) scale(1);
  }

  78%,100%{
    opacity:0;
    transform:translate(40px,72px) rotate(12deg) scale(.65);
  }
}

@keyframes group-dot-hop{
  0%,100%{
    transform:translateY(0);
    opacity:.45;
  }

  50%{
    transform:translateY(-5px);
    opacity:1;
  }
}

@media(prefers-reduced-motion:reduce){
  .group-loader-inbox,
  .group-loader-bubble,
  .group-loader-dots i,
  .closed-load-wheel{
    animation-duration:2.5s;
  }
}


/* ============================================================
   Contador individual de mensagens não visualizadas nos chamados
   ============================================================ */
.ticket-list-side{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  gap:7px;
}

.ticket-unread-badge{
  min-width:19px;
  height:19px;
  padding:0 5px;
  border-radius:999px;
  display:inline-grid;
  place-items:center;
  background:#e5484d;
  color:#fff;
  font-size:9px;
  line-height:1;
  font-weight:850;
  font-variant-numeric:tabular-nums;
  box-shadow:0 1px 3px rgba(143,28,32,.18);
}

/* Se o chamado está aberto, o endpoint já o marca como lido. */
.ticket-item.active .ticket-unread-badge{
  display:none;
}


/* ============================================================
   Página Configurações
   ============================================================ */
.settings-page{
  max-width:820px;
}

.system-setting-card{
  overflow:hidden;
}

.system-setting-head{
  display:flex;
  align-items:flex-start;
  gap:13px;
  padding-bottom:18px;
  border-bottom:1px solid var(--line);
}

.system-setting-icon{
  width:42px;
  height:42px;
  border-radius:12px;
  display:grid;
  place-items:center;
  background:var(--green-soft);
  color:var(--green);
  font-size:20px;
}

.system-setting-head h3{
  margin:1px 0 5px;
  color:#31423b;
  font-size:15px;
}

.system-setting-head p{
  margin:0;
  max-width:620px;
  color:var(--muted);
  font-size:11px;
  line-height:1.55;
}

.system-setting-form{
  display:flex;
  flex-direction:column;
  gap:18px;
  padding-top:18px;
}

.setting-switch-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  padding:13px 14px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fafcfb;
}

.setting-switch-row>span:first-child{
  display:flex;
  flex-direction:column;
  gap:4px;
}

.setting-switch-row b{
  color:#34463f;
  font-size:12px;
}

.setting-switch-row small{
  color:var(--muted);
  font-size:10px;
  line-height:1.4;
}

.switch-control{
  position:relative;
  width:42px;
  height:24px;
  flex:0 0 42px;
}

.switch-control input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}

.switch-slider{
  position:absolute;
  inset:0;
  border-radius:999px;
  background:#cbd5d1;
  cursor:pointer;
  transition:.18s ease;
}

.switch-slider::after{
  content:'';
  position:absolute;
  top:3px;
  left:3px;
  width:18px;
  height:18px;
  border-radius:50%;
  background:#fff;
  box-shadow:0 2px 5px rgba(32,52,44,.18);
  transition:.18s ease;
}

.switch-control input:checked + .switch-slider{
  background:var(--green);
}

.switch-control input:checked + .switch-slider::after{
  transform:translateX(18px);
}

.setting-field-row{
  padding:14px;
  border:1px solid var(--line);
  border-radius:12px;
  transition:.18s ease;
}

.setting-field-row.disabled{
  opacity:.48;
  background:#f5f7f6;
}

.setting-field-row>label{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.setting-field-row>label>span{
  color:#41514b;
  font-size:11px;
  font-weight:800;
}

.setting-field-row small{
  color:var(--muted);
  font-size:9.5px;
  line-height:1.45;
}

.setting-minute-input{
  width:min(260px,100%);
  display:flex;
  align-items:center;
  overflow:hidden;
  border:1px solid #cad5d0;
  border-radius:10px;
  background:#fff;
}

.setting-minute-input input{
  width:100%;
  min-width:0;
  border:0;
  padding:11px 12px;
  outline:0;
  color:#33453d;
  font-size:13px;
  font-weight:800;
  background:transparent;
}

.setting-minute-input span{
  align-self:stretch;
  padding:0 12px;
  display:flex;
  align-items:center;
  border-left:1px solid #e1e8e5;
  background:#f5f8f7;
  color:#687770;
  font-size:10px;
}

.system-setting-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:12px;
  padding-top:4px;
}

.setting-save-state{
  min-height:16px;
  margin-right:auto;
  color:var(--muted);
  font-size:10px;
}

.setting-save-state.success{
  color:var(--green);
}

.setting-save-state.error{
  color:#c43d43;
}

@media(max-width:700px){
  .setting-switch-row{
    align-items:flex-start;
  }

  .system-setting-actions{
    align-items:stretch;
    flex-direction:column;
  }

  .system-setting-actions .btn{
    width:100%;
  }
}


/* ============================================================
   Administração de acesso dos usuários
   ============================================================ */
.user-access-actions{
  align-items:center;
  flex-wrap:wrap;
}

.user-access-toggle{
  min-width:128px;
  white-space:nowrap;
}

.user-row-disabled td{
  background:#fcfdfd;
}

.user-row-disabled .user-table-profile,
.user-row-disabled td:nth-child(2),
.user-row-disabled td:nth-child(3){
  opacity:.62;
}

.user-self-access{
  padding:0 7px;
  color:#8a9691;
  font-size:10px;
  font-style:italic;
  white-space:nowrap;
}

.user-access-modal-hint{
  margin-top:4px;
  padding:10px 11px;
  border:1px solid var(--line);
  border-radius:10px;
  display:flex;
  align-items:center;
  gap:9px;
  background:#fafcfb;
}

.user-access-modal-hint small{
  color:var(--muted);
  font-size:9.5px;
  line-height:1.4;
}

/* Estacionamentos — grupo exclusivo */
.special-group-nav{position:relative}
.nav-unread-badge{margin-left:auto;min-width:20px;height:20px;padding:0 6px;border-radius:999px;display:inline-grid;place-items:center;background:#e5484d;color:#fff;font-size:9px;line-height:1;font-weight:850;font-variant-numeric:tabular-nums;box-shadow:0 1px 4px rgba(139,29,33,.22)}
.chat-layout.special-group-mode .ticket-panel{display:none}
.chat-layout.special-group-mode .conversation-panel{min-width:0}
.sidebar.collapsed #parking-nav{position:relative}
.sidebar.collapsed #parking-nav .nav-unread-badge{display:grid!important;position:absolute;top:4px;right:4px;min-width:17px;height:17px;padding:0 4px;font-size:8px}
@media(max-width:1100px){#parking-nav{position:relative}#parking-nav .nav-unread-badge{display:grid!important;position:absolute;top:4px;right:4px;min-width:17px;height:17px;padding:0 4px;font-size:8px}}

/* Target — menu independente */
.target-menu-page{max-width:1120px;margin:0 auto}
.target-menu-layout{display:grid;grid-template-columns:minmax(330px,.9fr) minmax(420px,1.1fr);gap:18px;align-items:start}
.target-menu-card{overflow:hidden}.target-menu-card-body,.target-menu-form{padding:18px}
.target-driver-search-wrap{display:flex;align-items:center;gap:7px;padding:0 10px;border:1px solid #d8e1dd;border-radius:11px;background:#f8faf9;color:#7a8983}
.target-driver-search-wrap input{width:100%;border:0;box-shadow:none;background:transparent;padding:11px 4px}
.target-menu-driver-results{max-height:520px;margin-top:10px;overflow:auto;border:1px solid var(--line);border-radius:11px;background:#fff}
.target-menu-driver-row{width:100%;border:0;border-bottom:1px solid #edf1ef;background:#fff;padding:11px;display:flex;align-items:center;gap:10px;text-align:left}
.target-menu-driver-row:last-child{border-bottom:0}.target-menu-driver-row:hover{background:#f5faf7}
.target-menu-driver-avatar,.target-menu-selected-avatar{width:38px;height:38px;flex:0 0 38px;border-radius:50%;display:grid;place-items:center;background:var(--green-soft);color:var(--green);font-weight:850;font-size:12px}
.target-menu-driver-main{min-width:0;flex:1;display:flex;flex-direction:column;gap:3px}.target-menu-driver-main b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#34463f;font-size:12px}.target-menu-driver-main small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#7c8984;font-size:9.5px}.target-menu-driver-arrow{color:#9aa6a1;font-size:22px}
.target-menu-placeholder,.target-menu-driver-loading{min-height:76px;padding:18px;display:flex;align-items:center;justify-content:center;gap:8px;text-align:center;color:#7a8983;font-size:11px}.target-menu-placeholder.error{color:#b94343}
.target-menu-selected-driver{margin-top:10px;padding:10px 11px;border:1px solid #cfe2d8;border-radius:11px;background:#f1f8f4;display:flex;align-items:center;gap:10px}.target-menu-selected-driver>div:nth-child(2){min-width:0;flex:1;display:flex;flex-direction:column;gap:3px}.target-menu-selected-driver strong{color:#30453d;font-size:12px}.target-menu-selected-driver small{color:#75857e;font-size:9.5px}
.target-menu-context{min-height:72px;margin-bottom:16px;border:1px solid var(--line);border-radius:11px;padding:12px;color:#74827d;font-size:11px;background:#fafcfb}.target-menu-context .target-loading{min-height:170px}.target-menu-context-ok{display:flex;flex-direction:column;gap:4px}.target-menu-context-ok b{color:#30443c;font-size:13px}.target-menu-context-ok span{color:#74827d;font-size:10px}
.target-menu-form-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.target-menu-form-grid label{margin:0}.target-menu-form-grid .full{grid-column:1/-1}.target-menu-form-grid textarea{min-height:100px;resize:vertical}.target-menu-actions{display:flex;justify-content:flex-end;margin-top:16px}.target-menu-actions .btn{min-width:150px}
.target-menu-result-area{margin-top:14px;border-radius:11px;font-size:11px;line-height:1.5}.target-menu-result-area.success,.target-menu-result-area.warning,.target-menu-result-area.error{padding:12px;border:1px solid}.target-menu-result-area.success{background:#eef8f2;border-color:#c8e5d4;color:#256344}.target-menu-result-area.warning{background:#fff8e9;border-color:#efdba8;color:#79581d}.target-menu-result-area.error{background:#fff0f0;border-color:#efc7c7;color:#a33c3c}.target-menu-result-area p{margin:4px 0 0}
@media(max-width:900px){.target-menu-layout{grid-template-columns:1fr}.target-menu-driver-results{max-height:320px}}
@media(max-width:620px){.target-menu-form-grid{grid-template-columns:1fr}.target-menu-form-grid .full{grid-column:auto}}

/* Durante depósito financeiro iniciado pelo menu Target, evita navegação acidental. */
body.financial-operation-running .sidebar{pointer-events:none}

/* ============================================================
   Softran — fallback de funcionários / modo de teste
   ============================================================ */
.erp-fallback-card{
  margin-top:18px;
}

.erp-fallback-status-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  padding-top:18px;
}

.erp-status-item{
  min-width:0;
  padding:12px 13px;
  border:1px solid var(--line);
  border-radius:11px;
  background:#fafcfb;
  display:flex;
  flex-direction:column;
  gap:4px;
}

.erp-status-item.wide{
  grid-column:1 / -1;
}

.erp-status-item span{
  color:#7d8a85;
  font-size:9px;
  font-weight:750;
  text-transform:uppercase;
  letter-spacing:.035em;
}

.erp-status-item b{
  overflow:hidden;
  text-overflow:ellipsis;
  color:#34463f;
  font-size:12px;
  line-height:1.35;
}

.status-success-text{
  color:#27825d!important;
}

.status-warning-text{
  color:#a16a17!important;
}

.status-danger-text{
  color:#c04449!important;
}

.erp-fallback-alert{
  margin-top:12px;
  padding:10px 12px;
  border:1px solid #dbe5e1;
  border-radius:10px;
  background:#f8faf9;
  color:#66766f;
  font-size:10px;
  line-height:1.5;
}

.erp-fallback-alert.warning{
  border-color:#ead8a8;
  background:#fff8e8;
  color:#79591f;
}

.erp-fallback-alert.error{
  border-color:#efcaca;
  background:#fff2f2;
  color:#a44044;
}

.erp-fallback-actions{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px;
  margin-top:14px;
}

.erp-fallback-help{
  display:block;
  margin-top:12px;
  color:#7c8984;
  font-size:9.5px;
  line-height:1.5;
}

.target-fallback-source{
  margin:9px 0 12px;
  padding:9px 10px;
  border:1px solid #ead8a8;
  border-radius:9px;
  background:#fff8e8;
  color:#76571f;
  display:flex;
  flex-direction:column;
  gap:2px;
  font-size:9.5px;
  line-height:1.4;
}

.target-fallback-source b{
  font-size:10px;
  color:#8b651e;
}

.target-menu-driver-results>.target-fallback-source{
  margin:8px;
}

@media(max-width:700px){
  .erp-fallback-status-grid{
    grid-template-columns:1fr;
  }

  .erp-status-item.wide{
    grid-column:auto;
  }

  .erp-fallback-actions{
    align-items:stretch;
    flex-direction:column;
  }

  .erp-fallback-actions .btn{
    width:100%;
  }
}
