/* Admin · Atendimento (chat próprio) */
.adm-atd {
  --atd-line: color-mix(in srgb, var(--brand, #009436) 18%, #e2e8f0);
  --atd-soft: color-mix(in srgb, var(--brand, #009436) 10%, transparent);
  font-family: Inter, system-ui, sans-serif;
  min-height: 100%;
  background: #f4f6fb;
  color: #151923;
}
.adm-atd-top {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--atd-line);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 5;
}
.adm-atd-back {
  color: #526789;
  text-decoration: none;
  font-size: .875rem;
  white-space: nowrap;
  margin-top: .35rem;
}
.adm-atd-back:hover { color: var(--brand, #009436); }
.adm-atd-top-main { flex: 1; min-width: 0; }
.adm-atd-top h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 750;
  letter-spacing: -.02em;
}
.adm-atd-top p {
  margin: .2rem 0 0;
  color: #526789;
  font-size: .875rem;
}
.adm-atd-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 .4rem;
  border-radius: 999px;
  background: var(--brand, #009436);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  margin-left: .4rem;
}
.adm-atd-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr;
  min-height: calc(100vh - 78px);
}
@media (max-width: 900px) {
  .adm-atd-layout { grid-template-columns: 1fr; }
  .adm-atd-layout.is-chat .adm-atd-list-pane { display: none; }
  .adm-atd-layout:not(.is-chat) .adm-atd-chat-pane { display: none; }
}
.adm-atd-list-pane {
  border-right: 1px solid var(--atd-line);
  background: #fff;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.adm-atd-tabs {
  display: flex;
  gap: .25rem;
  padding: .75rem .75rem .25rem;
  flex-wrap: wrap;
}
.adm-atd-tab {
  border: 0;
  background: transparent;
  color: #526789;
  font: inherit;
  font-size: .8125rem;
  font-weight: 600;
  padding: .45rem .7rem;
  border-radius: .55rem;
  cursor: pointer;
}
.adm-atd-tab.is-active {
  background: var(--atd-soft);
  color: var(--brand, #009436);
}
.adm-atd-search {
  padding: .5rem .75rem .75rem;
}
.adm-atd-search input {
  width: 100%;
  border: 1px solid var(--atd-line);
  border-radius: .55rem;
  padding: .55rem .7rem;
  font: inherit;
  font-size: .875rem;
  background: #f8fafc;
}
.adm-atd-search input:focus {
  outline: 2px solid color-mix(in srgb, var(--brand, #009436) 35%, transparent);
  border-color: var(--brand, #009436);
  background: #fff;
}
.adm-atd-list {
  flex: 1;
  overflow: auto;
  min-height: 0;
}
.adm-atd-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid #eef2f7;
  background: #fff;
  padding: .85rem .9rem;
  cursor: pointer;
  font: inherit;
}
.adm-atd-item:hover { background: #f8fafc; }
.adm-atd-item.is-active {
  background: var(--atd-soft);
  box-shadow: inset 3px 0 0 var(--brand, #009436);
}
.adm-atd-item-top {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .2rem;
}
.adm-atd-item-name {
  font-weight: 650;
  font-size: .9rem;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.adm-atd-item-meta {
  color: #7a8ba8;
  font-size: .75rem;
  white-space: nowrap;
}
.adm-atd-item-sub {
  color: #526789;
  font-size: .8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.adm-atd-pill {
  display: inline-flex;
  align-items: center;
  height: 1.15rem;
  padding: 0 .4rem;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 700;
  background: #e2e8f0;
  color: #334155;
}
.adm-atd-pill.warn { background: #fef3c7; color: #92400e; }
.adm-atd-pill.unread { background: var(--brand, #009436); color: #fff; }
.adm-atd-muted {
  color: #7a8ba8;
  font-size: .875rem;
  padding: 1.25rem;
  text-align: center;
}
.adm-atd-chat-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #f4f6fb;
}
.adm-atd-chat-head {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .85rem 1rem;
  background: #fff;
  border-bottom: 1px solid var(--atd-line);
  flex-wrap: wrap;
}
.adm-atd-chat-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}
.adm-atd-chat-head .adm-atd-actions {
  margin-left: auto;
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
}
.adm-atd-btn {
  border: 1px solid var(--atd-line);
  background: #fff;
  color: #151923;
  font: inherit;
  font-size: .8125rem;
  font-weight: 600;
  padding: .45rem .7rem;
  border-radius: .5rem;
  cursor: pointer;
}
.adm-atd-btn:hover { background: #f8fafc; }
.adm-atd-btn.primary {
  background: var(--brand, #009436);
  border-color: var(--brand, #009436);
  color: #fff;
}
.adm-atd-btn.primary:hover { filter: brightness(.95); }
.adm-atd-btn:disabled { opacity: .55; cursor: not-allowed; }
.adm-atd-messages {
  flex: 1;
  overflow: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: .65rem;
  min-height: 0;
}
.adm-atd-bubble {
  max-width: min(78%, 560px);
  padding: .65rem .8rem;
  border-radius: .85rem;
  font-size: .9rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}
.adm-atd-bubble.is-user {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--atd-line);
  border-bottom-left-radius: .25rem;
}
.adm-atd-bubble.is-team {
  align-self: flex-end;
  background: color-mix(in srgb, var(--brand, #009436) 88%, #000);
  color: #fff;
  border-bottom-right-radius: .25rem;
}
.adm-atd-bubble.is-auto {
  align-self: center;
  background: #eef2f7;
  color: #475569;
  font-size: .8rem;
  max-width: 90%;
}
.adm-atd-bubble-meta {
  display: block;
  margin-top: .35rem;
  font-size: .7rem;
  opacity: .75;
}
.adm-atd-compose {
  display: flex;
  gap: .5rem;
  padding: .75rem 1rem 1rem;
  background: #fff;
  border-top: 1px solid var(--atd-line);
}
.adm-atd-compose textarea {
  flex: 1;
  min-height: 44px;
  max-height: 140px;
  resize: vertical;
  border: 1px solid var(--atd-line);
  border-radius: .65rem;
  padding: .65rem .75rem;
  font: inherit;
  font-size: .9rem;
}
.adm-atd-compose textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--brand, #009436) 35%, transparent);
  border-color: var(--brand, #009436);
}
.adm-atd-side {
  width: 100%;
  padding: 0 1rem 1rem;
}
.adm-atd-side-card {
  background: #fff;
  border: 1px solid var(--atd-line);
  border-radius: .75rem;
  padding: .85rem 1rem;
  font-size: .85rem;
}
.adm-atd-side-card a {
  color: var(--brand, #009436);
  font-weight: 600;
  text-decoration: none;
}
.adm-atd-empty-chat {
  margin: auto;
  text-align: center;
  color: #7a8ba8;
  padding: 2rem;
}
.adm-atd-empty-chat strong {
  display: block;
  color: #151923;
  margin-bottom: .35rem;
}
/* Overlay no shell SPA */
.adm-atd-host {
  position: absolute;
  inset: 0;
  z-index: 40;
  overflow: auto;
  background: #f4f6fb;
  opacity: 0;
  visibility: hidden;
  transition: opacity .15s ease;
}
.adm-atd-host.is-ready {
  opacity: 1;
  visibility: visible;
}
body.adm-atd-open [data-slot="sidebar-inset"] > *:not(.adm-atd-host) {
  visibility: hidden;
}
