/* ===== Base ===== */
*{ box-sizing:border-box; }
:root{
  --bg:#111b21;
  --panel:#ffffff;
  --panel2:#f7f7f7;
  --line: rgba(0,0,0,.08);
  --muted: rgba(0,0,0,.65);
  /* Default to DigiSac-like blue from the first paint (avoid green flash) */
  --brand: var(--digisacBlue);
  --brand2: var(--digisacBlue2);
  --digisacBlue:#1f6fbf;
  --digisacBlue2:#1a5ea3;
  --bubbleIn:#ffffff;
  --bubbleOut:#d9fdd3;
  --shadow: 0 10px 40px rgba(0,0,0,.10);
}
body{
  margin:0;
  font-family: system-ui,-apple-system,"Segoe UI",Roboto,Ubuntu,Cantarell,"Noto Sans","Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif;
  color:#111;
  /* neutro e claro (base similar WhatsApp) */
  background:#dfe8f5;
}
a{ color:inherit; }
.hidden{ display:none !important; }
.muted{ opacity:.75; }
hr{ border:0; border-top:1px solid var(--line); margin:12px 0; }

/* ===== Login page ===== */
.page-center{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px;
}
.card{
  width:min(420px, 100%);
  background:#fff;
  border:1px solid var(--line);
  border-radius:18px;
  padding:18px;
  box-shadow: var(--shadow);
}
.brand{ font-weight:900; font-size:18px; margin-bottom:4px; }
.form{ display:flex; flex-direction:column; gap:8px; margin-top:14px; }
label{ font-size:13px; opacity:.8; }
input, textarea, select{
  font:inherit;
  border:1px solid rgba(0,0,0,.14);
  border-radius:12px;
  padding:10px 12px;
  outline:none;
  background:#fff;
  width:100%;
}
textarea{ resize:none; }
.primary{
  border:0;
  background:var(--brand);
  color:#fff;
  padding:10px 14px;
  border-radius:12px;
  cursor:pointer;
  font-weight:800;
  box-shadow: 0 6px 16px rgba(0,0,0,.10);
  transition: transform .08s ease, filter .12s ease, box-shadow .12s ease;
}
.primary.small{ padding:8px 10px; font-weight:800; }
.primary:hover{ filter: brightness(0.98); box-shadow: 0 10px 24px rgba(0,0,0,.12); }
.primary:active{ transform: translateY(1px); }
.primary:focus-visible{ outline: 3px solid rgba(31,111,191,.22); outline-offset: 2px; }
.primary:disabled{ opacity:.55; cursor:not-allowed; }
.error{ color:#b00020; margin-top:8px; font-size:13px; }
.hint{ margin-top:12px; font-size:12px; opacity:.75; }

.chip{
  border:1px solid rgba(0,0,0,.12);
  background:#fff;
  padding:8px 10px;
  border-radius:999px;
  cursor:pointer;
  font-weight:600;
  box-shadow: 0 4px 12px rgba(0,0,0,.06);
  transition: background .12s ease, border-color .12s ease, transform .08s ease, box-shadow .12s ease;
}
.chip:hover{ background: rgba(0,0,0,.03); border-color: rgba(0,0,0,.18); box-shadow: 0 8px 18px rgba(0,0,0,.08); }
.chip:active{ transform: translateY(1px); }
.chip:focus-visible{ outline: 3px solid rgba(0,0,0,.10); outline-offset: 2px; }
.chip:disabled{ opacity:.55; cursor:not-allowed; }

/* ===== App shell ===== */
.app{ height:100vh; display:flex; flex-direction:column; }
.topbar{
  height:60px;
  background:#fff;
  border-bottom:1px solid var(--line);
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 14px;
}
.top-left{ display:flex; gap:10px; align-items:center; }
.logo{
  width:40px; height:40px;
  display:grid; place-items:center;
  border-radius:12px;
  background: rgba(31,111,191,.12);
  color:#111;
}
.title{ font-weight:900; }
.subtitle{ font-size:12px; opacity:.7; }
.top-right{ display:flex; gap:8px; align-items:center; }

.layout{
  flex:1;
  display:grid;
  grid-template-columns: 360px 1fr;
  min-height:0;
}

/* ===== Sidebar ===== */
.sidebar{
  background:#fff;
  border-right:1px solid var(--line);
  display:flex;
  flex-direction:column;
  min-height:0;
}
.tabs{
  display:flex;
  gap:6px;
  padding:10px;
}
.tab{
  flex:1;
  border:1px solid rgba(0,0,0,.10);
  background:#fff;
  padding:8px 10px;
  border-radius:12px;
  cursor:pointer;
  /* texto mais fino, estilo DigiSac */
	font-weight:500;
	color: var(--digisacBlue2);
  font-size:13px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
}
.tab:hover{ background: rgba(0,0,0,.02); }
.tab:active{ transform: translateY(1px); }
.tab.active{
  border-color: rgba(31,111,191,.35);
  background: rgba(31,111,191,.10);
  font-weight:600;
}
.tab-badge{
  min-width:18px;
  height:18px;
  padding:0 6px;
  border-radius:999px;
  background: var(--brand);
  color:#fff;
  font-size:11px;
  display:grid;
  place-items:center;
}

.search{ padding:0 10px 10px; }
.filters{ padding:0 12px 10px; }
.filters select{ width:100%; border:1px solid var(--line); border-radius:14px; padding:10px 12px; background:#fff; }

.search input{ width:100%; border-radius:999px; background: #f0f2f5; border-color: rgba(0,0,0,.08); }
.list{
  overflow:auto;
  padding:6px 6px 10px;
}
.item{
  display:flex;
  gap:10px;
  padding:10px;
  border-radius:14px;
  background:#fff;
  margin:6px 4px;
  cursor:pointer;
  border:1px solid rgba(0,0,0,.06);
}
.item:hover{ background:#f7f7f7; }
.item.active{ border-color: rgba(0,168,132,.35); background: rgba(0,168,132,.06); }
.item .avatar{
  width:42px; height:42px;
  border-radius:999px;
  display:grid; place-items:center;
  background:#eef2f5;
  flex:0 0 auto;
}
.item-mid{ flex:1; min-width:0; }
.item-top{ display:flex; justify-content:space-between; gap:8px; }
.item-name{ font-weight:900; font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.item-time{ font-size:11px; opacity:.65; flex:0 0 auto; }
.item-sub{ font-size:12px; opacity:.72; margin-top:4px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.item-sub.is-media{ color: #425a67; }
.sub-icon{ display:inline-block; margin-right:6px; opacity:.9; }
.item-bottom{ display:flex; gap:8px; align-items:center; margin-top:6px; }
.badge{
  display:inline-block;
  padding:2px 8px;
  border-radius:999px;
  background:rgba(0,0,0,.06);
  font-size:11px;
  opacity:.85;
}
.unread{
  margin-left:auto;
  min-width:18px;
  height:18px;
  padding:0 6px;
  border-radius:999px;
  background: #25d366;
  color:#0b141a;
  font-size:11px;
  font-weight:900;
  display:grid;
  place-items:center;
}

/* ===== Chat ===== */
.chat{
  display:flex;
  flex-direction:column;
  min-height:0;
  background:#e5ddd5;
  position:relative;
}
.chat-header{
  background:#fff;
  border-bottom:1px solid var(--line);
  padding:10px 12px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  z-index:2;
}
.chat-headbtn{
  border:0;
  background:transparent;
  display:flex;
  gap:10px;
  align-items:center;
  padding:6px 8px;
  border-radius:14px;
  cursor:pointer;
  text-align:left;
}
.chat-headbtn:disabled{ cursor:default; opacity:.85; }
.chat-headbtn:not(:disabled):hover{ background:#f0f2f5; }

.avatar{ width:38px; height:38px; border-radius:999px; display:grid; place-items:center; background:#eef2f5; }
.avatar.big{ width:78px; height:78px; font-size:28px; }
.chat-headtext{ display:flex; flex-direction:column; gap:2px; }
.chat-title{ font-weight:950; }
.chat-meta{ font-size:12px; opacity:.7; }
.chat-actions{ display:flex; gap:8px; }

.messages{
  position:relative;
  flex:1;
  overflow:auto;
  padding:14px;
  display:flex;
  flex-direction:column;
  gap:10px;
  z-index:2;
}
.bubble{
  max-width:min(660px, 92%);
  padding:9px 12px;
  border-radius:10px;
  background: var(--bubbleIn);
  align-self:flex-start;
  box-shadow: 0 1px 0 rgba(0,0,0,.08);
}
.bubble.me{
  align-self:flex-end;
  background: var(--bubbleOut);
}
.bubble .meta{
  font-size:11px;
  opacity:.6;
  margin-top:6px;
  display:flex;
  gap:10px;
  justify-content:flex-end;
}
.bubble .file{
  display:flex;
  gap:8px;
  align-items:center;
  margin-top:8px;
  padding-top:8px;
  border-top:1px solid rgba(0,0,0,.06);
}
.file a{ text-decoration:none; font-weight:900; color: var(--brand2); }
.file small{ opacity:.7; }

.composer{
  display:flex;
  gap:10px;
  align-items:flex-end;
  padding:10px;
  border-top:1px solid var(--line);
  background:#f0f2f5;
  z-index:2;
}
.icon-btn{
  border:0;
  background:transparent;
  cursor:pointer;
  font-size:18px;
  padding:10px;
  border-radius:999px;
}
.icon-btn:hover{ background: rgba(0,0,0,.06); }
.icon-btn.small{ padding:8px; font-size:16px; }
.icon-btn.recording{
  background: rgba(176,0,32,.12);
  color:#b00020;
}
.input-wrap{ flex:1; display:flex; flex-direction:column; gap:8px; position:relative; }

/* Recording mode: keep a single bar (WhatsApp-like) */
.composer.is-recording #msgInput,
.composer.is-recording #attachmentsBar,
.composer.is-recording #btnAttach,
.composer.is-recording #btnEmoji { display:none !important; }

.composer.is-recording #recordingPill { margin:0; }
#msgInput{
  width:100%;
  resize:none;
  padding:10px 12px;
  border:1px solid rgba(0,0,0,.10);
  border-radius:18px;
  outline:none;
  font-size:14px;
  background:#fff;
}
.send-btn{
  border:0;
  background:var(--brand);
  color:#fff;
  width:44px;
  height:44px;
  padding:0;
  border-radius:999px;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow: 0 6px 18px rgba(0,0,0,.12);
}
.send-btn svg{ width:20px; height:20px; display:block; }
.send-btn.mode-mic{ background: var(--digisacBlue); }
.send-btn.mode-stop{ background: var(--digisacBlue); }
.send-btn:hover{ background: var(--brand2); }
.send-btn.mode-mic:hover,
.send-btn.mode-stop:hover{ background: var(--digisacBlue2); }
.send-btn:disabled{ opacity:.55; cursor:not-allowed; }

.attachments-bar{ display:flex; flex-wrap:wrap; gap:8px; }
.attachment-chip{
  display:flex;
  align-items:center;
  gap:8px;
  border:1px solid rgba(0,0,0,.10);
  background:#fff;
  padding:8px 10px;
  border-radius:999px;
  max-width:100%;
}
.attachment-name{ font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:220px; }
.attachment-meta{ font-size:12px; opacity:.7; }
.attachment-bad{ border-color: rgba(255,0,0,.25); background: rgba(255,0,0,.06); }
.attachment-bad .attachment-meta{ color:#b00020; opacity:1; font-weight:800; }
.attachment-remove{
  border:0; background:transparent; cursor:pointer;
  font-size:14px; padding:2px 6px; border-radius:999px;
}
.attachment-remove:hover{ background: rgba(0,0,0,.06); }

/* ===== Drawer ===== */
.drawer-backdrop{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.35);
  display:flex;
  justify-content:flex-end;
  z-index:9998;
}
.drawer{
  width:min(420px, 100vw);
  height:100%;
  background:#fff;
  border-left:1px solid rgba(0,0,0,.12);
  padding:14px;
  overflow:auto;
}
.drawer-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.drawer-title{ font-weight:950; }
.drawer-profile{
  margin-top:10px;
  padding:14px;
  border:1px solid var(--line);
  border-radius:18px;
  background:#fff;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
}
.drawer-name{ font-weight:950; font-size:16px; }
.drawer-wa{ opacity:.7; font-size:13px; }
.drawer-tags{ display:flex; flex-wrap:wrap; gap:8px; margin-top:4px; justify-content:center; }
.drawer-section{
  margin-top:12px;
  padding:12px;
  border:1px solid var(--line);
  border-radius:18px;
  background:#fff;
}
.sec-title{ font-weight:950; margin-bottom:8px; }
.sec-actions{ display:flex; gap:8px; flex-wrap:wrap; }
.note{ width:100%; min-height:110px; }

/* ===== Toast ===== */
.toast{
  position:fixed;
  right:16px;
  bottom:16px;
  width:min(420px, calc(100vw - 32px));
  border:1px solid rgba(0,0,0,.12);
  background:#fff;
  border-radius:18px;
  padding:12px 14px;
  box-shadow: var(--shadow);
  z-index:9999;
}
.toast-title{ font-weight:950; margin-bottom:4px; }
.toast-body{ font-size:13px; opacity:.92; line-height:1.35; }

/* ===== Modal ===== */
.modal-backdrop{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.35);
  display:grid;
  place-items:center;
  z-index:9998;
}
.modal{
  width:min(720px, calc(100vw - 24px));
  background:#fff;
  border-radius:18px;
  padding:14px;
  border:1px solid rgba(0,0,0,.14);
  box-shadow: 0 10px 40px rgba(0,0,0,.18);
  max-height: calc(100vh - 24px);
  overflow:auto;
}
.modal.wide{ width:min(1060px, calc(100vw - 24px)); }
.modal-title{ font-weight:950; font-size:16px; margin-bottom:10px; }
.modal-row{ margin:10px 0; display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.radio, .check{ display:flex; align-items:center; gap:8px; }
.modal-actions{ display:flex; justify-content:flex-end; gap:8px; margin-top:10px; }

.grid2{ display:grid; grid-template-columns: 1fr 1fr; gap:12px; }
.grid3{ display:grid; grid-template-columns: 1.25fr .9fr .9fr; gap:12px; }

/* ===== Root (Plataforma) layout ===== */
.root-layout{
  display:grid;
  grid-template-columns: 1.15fr 1fr;
  gap:12px;
}
.root-col{ min-width: 0; }
.dashlist{ display:flex; flex-direction:column; gap:10px; }
.dashitem{
  border:1px solid rgba(0,0,0,.08);
  border-radius:16px;
  padding:10px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  background:#fff;
}
.dashitem .meta{ display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.dashitem .meta .pill{ font-size:12px; padding:4px 10px; border-radius:999px; background:#f3f5f8; border:1px solid rgba(0,0,0,.06); }
.dashitem .actions{ display:flex; gap:8px; align-items:center; }
.panel{
  border:1px solid var(--line);
  border-radius:18px;
  padding:12px;
  background:#fff;
}
.panel-title{ font-weight:950; margin-bottom:10px; }
.panel-subtitle{ font-weight:900; opacity:.85; margin:10px 0 6px; }
.panel-body{ margin-bottom:10px; }
.panel-row{ display:flex; gap:10px; align-items:center; margin:8px 0; flex-wrap:wrap; }
.smalllabel{ font-size:12px; opacity:.75; }
.checks{ display:flex; gap:8px; flex-wrap:wrap; }
.checks label{ font-size:12px; display:flex; gap:6px; align-items:center; }
.triage-options{ display:flex; flex-direction:column; gap:8px; }
.triage-opt{
  display:grid;
  grid-template-columns: 60px 1fr 1fr;
  gap:8px;
  align-items:center;
}
.triage-opt input{ border-radius:12px; }
.triage-opt select{ border-radius:12px; }

.transfer-history{
  display:flex;
  flex-direction:column;
  gap:8px;
  font-size:13px;
}
.transfer-card{
  border:1px solid rgba(0,0,0,.08);
  border-radius:14px;
  padding:10px;
  background:#fff;
}

/* ===== Responsive ===== */
@media (max-width: 980px){
  .layout{ grid-template-columns: 320px 1fr; }
  .grid2{ grid-template-columns: 1fr; }
  .grid3{ grid-template-columns: 1fr; }
  .root-layout{ grid-template-columns: 1fr; }
}
@media (max-width: 760px){
  .layout{ grid-template-columns: 1fr; }
  /* mobile: lista primeiro, chat entra ao abrir conversa */
  .sidebar{ display:block; }
  .chat{ display:none; }
  body.mobile-chat-open .sidebar{ display:none; }
  body.mobile-chat-open .chat{ display:block; }
  .chat-header{ position:sticky; top:0; z-index:5; }
  .digisac-tabs{ position:sticky; top:0; z-index:6; background: #f5f6f8; padding-top:10px; }
}


/* ===== DigiSac-like tweaks (Sprint 2) ===== */
.topbar-blue{
  /* azul clarinho (tema) */
  background: #4f78c8;
  color: #fff;
  border-bottom: 1px solid rgba(0,0,0,.15);
}
.topbar-blue .title{ color:#fff; }
.topbar-blue .subtitle{ color: rgba(255,255,255,.85); }
.topbar-blue .logo{
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.18);
  color:#fff;
}
.topbar-blue .chip{
  background: rgba(255,255,255,.12);
  color:#fff;
  border: 1px solid rgba(255,255,255,.22);
}
.topbar-blue .chip:hover{ background: rgba(255,255,255,.18); }

.digisac-tabs .tab{
  background: rgba(255,255,255,.75);
  border: 1px solid rgba(0,0,0,.06);
}
.digisac-tabs .tab.active{
  background: #e8f4f1;
  border-color: rgba(0,0,0,.08);
}

.subtabs{
  display:flex;
  gap:8px;
  padding: 10px 12px 0;
}
.subtabs .subtab{
  flex:1;
  padding:10px 10px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.06);
  background: rgba(255,255,255,.65);
  cursor:pointer;
  font-weight:600;
}
.subtabs .subtab.active{
  background:#fff;
  border-color: rgba(0,0,0,.10);
}

.badge.mini{
  margin-left:6px;
  padding:2px 7px;
  border-radius:999px;
  font-size:12px;
}

/* Input bar: mic circular right */
.composer{
  display:flex;
  align-items:center;
  gap:10px;
}
.composer .left-actions{ display:flex; align-items:center; gap:8px; }
.composer .right-actions{ display:flex; align-items:center; gap:8px; }
.icon-btn.circle{
  width:40px;
  height:40px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background: #4f78c8;
  color:#fff;
  border:none;
}
.icon-btn.circle:hover{ filter: brightness(1.05); }
.icon-btn.circle.recording{ background:#c0392b; }


/* --- Sprint3 UI polish --- */
.grid2.tight { gap: 10px; }
.actions-row { display:flex; gap:10px; align-items:center; }
.tablebox { border:1px solid rgba(0,0,0,0.08); border-radius:12px; overflow:hidden; background:#fff; }
.tablebox table { width:100%; border-collapse:collapse; font-size:13px; }
.tablebox th, .tablebox td { padding:10px 12px; border-bottom:1px solid rgba(0,0,0,0.06); text-align:left; }
.tablebox th { background: rgba(19,41,74,0.06); font-weight:700; color:#1a2a44; }
.tablebox tr:last-child td { border-bottom:none; }
.badge { display:inline-flex; align-items:center; padding:4px 8px; border-radius:999px; font-size:12px; background:rgba(19,41,74,0.08); color:#1a2a44; }
.badge.off { background: rgba(0,0,0,0.06); color:#444; }
.badge.ok { background: rgba(0,128,0,0.10); color:#0d5a24; }
.badge.warn { background: rgba(255,165,0,0.14); color:#7a4a00; }
.btn-mini { padding:6px 10px; border-radius:10px; font-size:12px; border:1px solid rgba(0,0,0,0.12); background:#fff; cursor:pointer; }
.btn-mini.danger { background: rgba(255,0,0,0.06); }
.btn-mini.primary { background: rgba(0,128,0,0.10); border-color: rgba(0,128,0,0.25); }
.cardsoft { border:1px solid rgba(0,0,0,0.08); border-radius:14px; padding:12px; background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(255,255,255,0.92)); box-shadow: 0 6px 18px rgba(0,0,0,0.04); }
.cardsoft-title { font-weight:800; margin-bottom:10px; color:#1a2a44; }
.dashlist { display:flex; flex-direction:column; gap:10px; }
.dashitem { display:flex; justify-content:space-between; gap:12px; padding:10px 12px; border-radius:14px; border:1px solid rgba(0,0,0,0.08); background:#fff; }
.dashitem .left { display:flex; flex-direction:column; gap:4px; }
.dashitem .title { font-weight:800; color:#1a2a44; }
.dashitem .meta { display:flex; gap:8px; flex-wrap:wrap; }
.dashitem .right { display:flex; gap:8px; align-items:center; }
.hint { font-size:12px; color:#42526e; line-height:1.35; }
.small { font-size:12px; }



/* ===== Chat background (claro, estilo DigiSac) ===== */
.messages{
  background-color: #efeae2;
  background-image: url("/assets/bg-doodles.svg?v=2026-02-03_patch6");
  background-repeat: repeat;
  background-size: 300px 300px;
}

/* Sidebar actions */
.sidebar-actions{ padding: 8px 10px; }
.chip.full{ width:100%; justify-content:center; }

/* Drawer rename */
.drawer-name-row{ display:flex; align-items:center; justify-content:space-between; gap:8px; }
.rename-row{ display:flex; gap:8px; margin-top:10px; }
.rename-row input{ flex:1; }

/* Emoji picker */
.emoji-picker{
  position: absolute;
  left: 44px;
  bottom: 64px;
  width: 280px;
  max-height: 220px;
  overflow:auto;
  padding: 8px;
  border-radius: 14px;
  background: rgba(20,25,30,.98);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 12px 30px rgba(0,0,0,.35);
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
  z-index: 50;
}
.emoji-picker button{
  border: 0;
  background: transparent;
  padding: 6px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 18px;
}
.emoji-picker button:hover{
  background: rgba(255,255,255,.10);
}

/* Message media */
.bubble .media-thumb{
  margin-top: 6px;
  border-radius: 12px;
  overflow: hidden;
  max-width: 280px;
}
.bubble img.media-img{ display:block; max-width: 280px; height:auto; }
.bubble audio.media-audio{ width: 240px; margin-top: 6px; }
.bubble .media-file{
  margin-top: 6px;
  display:flex;
  gap:10px;
  align-items:center;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(0,0,0,.16);
}

/* Forward button */
.msg-actions{
  display:flex;
  gap:6px;
  margin-top: 6px;
  opacity: .7;
}
.msg-actions button{
  border:0;
  background: rgba(255,255,255,.10);
  color: inherit;
  padding: 6px 8px;
  border-radius: 10px;
  cursor:pointer;
  font-size: 12px;
}
.msg-actions button:hover{ background: rgba(255,255,255,.16); }



.att-preview{ margin-top:8px; }
.att-img{ max-width: 220px; border-radius: 12px; display:block; }
.att-audio{ width: 240px; }
.target{ padding:8px 6px; border-radius:12px; }
.target:hover{ background: rgba(255,255,255,.06); }
.icon-btn.small{ padding:6px 8px; font-size:12px; }
.primary.small{ padding:6px 10px; font-size:12px; }
.muted.small{ font-size:12px; opacity:.75; }


/* Recording pill (não tapa o botão) */
.recording-pill{
  display:flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border-radius: 999px;
  border:1px solid rgba(0,0,0,0.10);
  background: rgba(255,255,255,0.75);
  box-shadow: 0 6px 14px rgba(0,0,0,0.06);
  font-size:12px;
  margin-bottom:6px;
}
.recording-pill .rec-text{ opacity:.85; }
.rec-dot{
  width:8px;
  height:8px;
  border-radius:999px;
  background: #d93025;
  box-shadow: 0 0 0 0 rgba(217,48,37,.35);
  animation: recpulse 1.2s infinite;
}
@keyframes recpulse{
  0%{ box-shadow:0 0 0 0 rgba(217,48,37,.35);} 
  70%{ box-shadow:0 0 0 10px rgba(217,48,37,0);}
  100%{ box-shadow:0 0 0 0 rgba(217,48,37,0);}
}

/* Attachments preview */
.attachment-chip{
  display:grid;
  grid-template-columns: 26px 1fr auto;
  grid-template-areas: 'ico info rm' 'pv pv pv';
  gap:8px;
  align-items:center;
}
.attachment-chip .att-ico{ grid-area: ico; }
.attachment-chip .att-info{ grid-area: info; }
.attachment-chip .att-remove{ grid-area: rm; }
.attachment-chip .att-preview{ grid-area: pv; margin-top:8px; }
.att-img{ max-width: 260px; border-radius: 12px; display:block; }
.att-video{ max-width: 260px; border-radius: 12px; display:block; }
.att-audio{ width: 260px; }

/* Recording pill (não cobre o botão) */
.recording-pill{
  display:flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(0,0,0,0.10);
  background: rgba(255,255,255,0.85);
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
  margin: 0 0 8px 0;
  font-size:12px;
  color:#1a2a44;
}
.rec-dot{
  width:8px;
  height:8px;
  border-radius:999px;
  background:#e11d48;
  box-shadow: 0 0 0 6px rgba(225,29,72,0.12);
  animation: recPulse 1.05s infinite;
}
@keyframes recPulse{
  0%{ transform: scale(1); opacity:1; }
  60%{ transform: scale(1.15); opacity:.75; }
  100%{ transform: scale(1); opacity:1; }
}

/* Attachment previews */
.attachment-chip{ position: relative; }
.att-preview{ width:100%; margin-top:8px; }
.att-img{ max-width: 260px; border-radius: 12px; display:block; }
.att-video{ width: 260px; border-radius: 12px; display:block; }
.att-audio{ width: 260px; }
.att-ico{ font-size:18px; }

/* --- FIX5: voice recorder pill controls --- */
.recording-pill .rec-timer{
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  opacity: .9;
}
.recording-pill .rec-cancel{
  margin-left: auto;
  border: none;
  background: rgba(0,0,0,0.05);
  color: rgba(0,0,0,0.7);
  width: 24px;
  height: 24px;
  border-radius: 999px;
  cursor: pointer;
  display:flex;
  align-items:center;
  justify-content:center;
}
.recording-pill .rec-cancel:hover{ background: rgba(0,0,0,0.08); }

.back-btn{ display:none; }
@media (max-width: 760px){ .back-btn{ display:inline-flex; } }


/* Emoji picker (WhatsApp-like) */
#emojiPicker{
  position:absolute;
  bottom:74px;
  left:12px;
  width: 360px;
  max-width: calc(100vw - 24px);
  background: #fff;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(0,0,0,.12);
  padding: 10px;
  z-index: 50;
}
#emojiPicker.hidden{ display:none; }

.emojiHead{ display:flex; flex-direction:column; gap:8px; }
.emojiSearch{
  width:100%;
  border:1px solid rgba(0,0,0,.10);
  border-radius: 12px;
  padding: 10px 12px;
  outline:none;
}
.emojiSearch:focus{
  border-color: rgba(31,111,191,.55);
  box-shadow: 0 0 0 4px rgba(31,111,191,.12);
}
.emojiCats{ display:flex; gap:6px; overflow:auto; padding-bottom:2px; }
.emojiCatBtn{
  border:1px solid rgba(0,0,0,.08);
  background: #f7f8fa;
  border-radius: 12px;
  padding: 6px 10px;
  cursor:pointer;
}
.emojiCatBtn.active{
  background: rgba(31,111,191,.10);
  border-color: rgba(31,111,191,.25);
}
.emojiGrid{
  margin-top: 10px;
  display:grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
  max-height: 220px;
  overflow:auto;
  padding-right: 4px;
}
.emojiBtn{
  border:none;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  padding: 6px;
  border-radius: 10px;
  cursor:pointer;
}
.emojiBtn:hover{
  background: rgba(0,0,0,.06);
}
@media (max-width: 520px){
  #emojiPicker{ left: 8px; bottom: 70px; }
  .emojiGrid{ grid-template-columns: repeat(9, 1fr); }
}

/* === Emoji Picker (v2) === */
.emoji-picker{position:absolute;bottom:64px;left:56px;width:360px;max-width:calc(100vw - 24px);background:#fff;border:1px solid rgba(0,0,0,.08);border-radius:14px;box-shadow:0 16px 50px rgba(0,0,0,.18);padding:10px;display:flex;flex-direction:column;gap:8px;z-index:50;}
.emoji-header{display:flex;gap:8px;align-items:center;}
.emoji-search{flex:1;padding:10px 12px;border-radius:10px;border:1px solid rgba(0,0,0,.12);outline:none;}
.emoji-search:focus{border-color:rgba(36,99,235,.45);box-shadow:0 0 0 3px rgba(36,99,235,.12);}
.emoji-cats{display:flex;gap:6px;overflow:auto;padding:2px 0 6px 0;}
.emoji-cat-btn{min-width:34px;height:34px;border-radius:10px;border:1px solid rgba(0,0,0,.08);background:#f6f7fb;cursor:pointer;}
.emoji-cat-btn.active{background:rgba(36,99,235,.12);border-color:rgba(36,99,235,.35);}
.emojiGridWrap{max-height:220px;overflow:auto;border-radius:12px;border:1px solid rgba(0,0,0,.06);padding:8px;}
#emojiGrid{display:grid;grid-template-columns:repeat(8,1fr);gap:6px;}
.emojiBtn{height:34px;border-radius:10px;border:0;background:transparent;cursor:pointer;font-size:22px;line-height:1;color:#111;font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji","Twemoji Mozilla",system-ui,sans-serif;}
.emojiBtn:hover{background:rgba(0,0,0,.06);} 
.emojiBtn:active{background:rgba(0,0,0,.1);} 


/* === Notifications & Toggles === */
.notifBtn{position:relative;}
.notifBadge{position:absolute;top:-6px;right:-6px;min-width:18px;height:18px;padding:0 5px;border-radius:999px;background:#ef4444;color:#fff;font-size:12px;display:flex;align-items:center;justify-content:center;}
.hidden{display:none !important;}
.notifPanel{position:fixed;top:66px;right:14px;width:240px;background:#fff;border:1px solid rgba(0,0,0,.10);border-radius:14px;box-shadow:0 14px 45px rgba(0,0,0,.20);padding:12px;z-index:80;}
.notifTitle{font-weight:800;margin-bottom:8px;}
.chk{display:flex;gap:10px;align-items:center;margin:8px 0;user-select:none;}
.btnMini{border:0;border-radius:10px;padding:9px 10px;background:rgba(36,99,235,.12);cursor:pointer;font-weight:700;}
.btnMini:hover{background:rgba(36,99,235,.18);} 
.rowInline{display:flex;gap:10px;align-items:center;}
.toggle{display:inline-flex;align-items:center;gap:10px;cursor:pointer;user-select:none;}
.toggle input{display:none;}
.toggleTrack{width:44px;height:26px;border-radius:999px;background:rgba(0,0,0,.14);position:relative;display:inline-block;}
.toggleThumb{width:22px;height:22px;border-radius:999px;background:#fff;position:absolute;top:2px;left:2px;transition:all .2s ease;box-shadow:0 3px 10px rgba(0,0,0,.25);} 
.toggle input:checked + .toggleTrack{background:rgba(36,99,235,.55);} 
.toggle input:checked + .toggleTrack .toggleThumb{left:20px;} 
.smallMuted{font-size:12px;color:rgba(0,0,0,.55);} 


/* =====================
   PATCH4 — Emoji + Fundo + Listas
   ===================== */

/* Fundo doodles mais “WhatsApp” e sutil */
.chat:before{
  opacity: 0.10;
  background-size: 560px 560px;
  background-position: 0 0;
}

/* Força layout do emoji picker mesmo que exista CSS antigo .emoji-picker */
#emojiPicker{
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#emojiPicker .emojiHead{
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#emojiPicker .emojiSearch{
  width: 100%;
}
#emojiPicker .emojiCats{
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
#emojiPicker .emojiCatBtn{
  width: 34px;
  height: 34px;
  font-size: 18px;
}
#emojiPicker .emojiGrid{
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 6px;
  max-height: 320px;
  overflow: auto;
  padding-right: 6px;
}
#emojiPicker .emojiBtn{
  width: 38px;
  height: 38px;
  font-size: 22px; /* “tamanho de foto”, como você pediu */
  line-height: 1;
}

/* Listas dentro das mensagens (emoji + bullets) */
.bubble ul, .bubble ol{
  margin: 6px 0 6px 18px;
  padding: 0;
}
.bubble li{
  margin: 2px 0;
}
