/* ============================================================ DM MODERASYON */
.dm-mod-page { display: flex; flex-direction: column; gap: 0; }

.dm-mod-topbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 12px;
}
.dm-mod-purge {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  padding: 10px 16px !important;
  border-radius: 12px !important;
  font-weight: 800 !important;
  background: linear-gradient(145deg, rgba(255, 70, 60, .22), rgba(180, 40, 35, .16)) !important;
  border: 1px solid rgba(255, 120, 100, .42) !important;
  box-shadow: 0 8px 20px -12px rgba(255, 60, 50, .5);
}
.dm-mod-purge svg { width: 15px; height: 15px; flex-shrink: 0; }
.dm-mod-purge:hover {
  background: linear-gradient(145deg, rgba(255, 85, 70, .32), rgba(200, 45, 40, .24)) !important;
  border-color: rgba(255, 150, 130, .55) !important;
}

.dm-mod-hero {
  background:
    linear-gradient(155deg, rgba(26, 14, 16, .96) 0%, rgba(16, 9, 11, .98) 55%, rgba(14, 8, 5, .94) 100%);
  border: 1px solid rgba(214, 59, 54, .18);
  box-shadow: 0 10px 28px -16px rgba(0, 0, 0, .65);
}
.dm-mod-hero .ph-stat {
  background: rgba(12, 6, 8, .82);
  border-color: color-mix(in srgb, var(--ps) 32%, rgba(255, 255, 255, .08));
}

.dm-mod-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  flex-wrap: wrap;
}
.dm-mod-search {
  flex: 1;
  min-width: 240px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  height: 46px;
  border-radius: 14px;
  background: rgba(16, 9, 11, .92);
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
  transition: border-color .18s, box-shadow .18s;
}
.dm-mod-search:focus-within {
  border-color: rgba(255, 154, 107, .5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .05),
    0 0 0 3px rgba(214, 59, 54, .1);
}
.dm-mod-search svg { width: 17px; height: 17px; color: var(--peach); flex-shrink: 0; opacity: .75; }
.dm-mod-search input {
  flex: 1; min-width: 0; border: 0; background: transparent;
  color: var(--text); font: inherit; font-size: 13.5px; outline: none;
}
.dm-mod-search input::placeholder { color: var(--dim); }

.dm-convo-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dm-convo-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px 20px;
  align-items: center;
  padding: 18px 20px;
  border-radius: 16px;
  background:
    linear-gradient(160deg, rgba(16, 10, 7, .97) 0%, rgba(16, 9, 11, .98) 100%);
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow:
    0 8px 22px -14px rgba(0, 0, 0, .7),
    inset 0 1px 0 rgba(255, 255, 255, .04);
  cursor: pointer;
  transition: border-color .16s, transform .16s, box-shadow .16s;
}
.dm-convo-card:hover {
  border-color: rgba(255, 154, 107, .42);
  box-shadow:
    0 12px 28px -12px rgba(255, 90, 50, .22),
    inset 0 1px 0 rgba(255, 255, 255, .05);
}
.dm-convo-users {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  grid-column: 1 / -1;
}
.dm-convo-users.compact { grid-column: auto; flex: 1; min-width: 0; }
.dm-convo-vs {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: var(--peach);
  background: rgba(214, 59, 54, .1);
  border: 1px solid rgba(255, 154, 107, .22);
}
.dm-convo-vs svg { width: 15px; height: 15px; }

.dm-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(6, 4, 3, .75);
  color: var(--text);
  font: inherit;
  cursor: default;
  transition: border-color .14s, background .14s, box-shadow .14s;
}
.dm-user-chip.is-link { cursor: pointer; }
.dm-user-chip.is-link:hover {
  border-color: rgba(91, 200, 245, .45);
  background: rgba(91, 200, 245, .08);
  box-shadow: 0 6px 16px -10px rgba(91, 200, 245, .35);
}
.dm-user-chip .ava-wrap { position: relative; flex-shrink: 0; }
.dm-user-chip .avatar-wrap-inner { display: block; line-height: 0; }
.dm-user-chip .avatar {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 800;
  background: rgba(255, 255, 255, .08);
  border: 1.5px solid rgba(255, 255, 255, .12);
}
.dm-user-chip .avatar-img { object-fit: cover; }
.dm-user-chip .presence {
  position: absolute; bottom: 0; right: 0;
  width: 10px; height: 10px; border-radius: 50%;
  background: rgba(255, 255, 255, .2);
  border: 2px solid rgba(8, 6, 12, .95);
}
.dm-user-chip .presence.on {
  background: #4ade80;
  box-shadow: 0 0 8px rgba(74, 222, 128, .55);
}
.dm-user-chip-meta { display: flex; flex-direction: column; gap: 2px; text-align: left; min-width: 0; }
.dm-user-chip-meta b {
  font-size: 13.5px; font-weight: 800;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px;
}
.dm-user-chip-meta i {
  font-style: normal; font-size: 11px; color: var(--dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px;
}

.dm-convo-preview { min-width: 0; grid-column: 1; }
.dm-convo-preview p {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--text);
  opacity: .88;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.dm-convo-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--dim);
  font-weight: 700;
}
.dm-convo-meta b { color: var(--peach); font-weight: 800; font-size: 12px; }

.dm-convo-open {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 16px !important;
  border-radius: 12px !important;
  font-weight: 800 !important;
  background: linear-gradient(145deg, rgba(214, 59, 54, .22), rgba(255, 90, 50, .14)) !important;
  border: 1px solid rgba(255, 154, 107, .38) !important;
  box-shadow: 0 6px 16px -10px rgba(255, 90, 50, .45);
}
.dm-convo-open svg { width: 15px; height: 15px; flex-shrink: 0; }
.dm-convo-open:hover {
  background: linear-gradient(145deg, rgba(214, 59, 54, .32), rgba(255, 90, 50, .22)) !important;
  border-color: rgba(255, 170, 130, .5) !important;
}

.dm-edited-tag, .dm-read-tag, .dm-unread-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 7px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.dm-edited-tag { background: rgba(255, 197, 109, .16); color: #ffc56d; border: 1px solid rgba(255, 197, 109, .22); }
.dm-read-tag { background: rgba(126, 226, 160, .14); color: #7ee2a0; border: 1px solid rgba(126, 226, 160, .22); }
.dm-unread-tag { background: rgba(255, 138, 112, .14); color: #ff8a70; border: 1px solid rgba(255, 138, 112, .22); }
.dm-edited-inline { font-style: italic; color: var(--dim); font-size: 12px; }

.dm-empty {
  padding: 40px 24px;
  text-align: center;
  color: var(--dim);
  font-size: 13.5px;
  border-radius: 14px;
  background: rgba(16, 9, 11, .85);
  border: 1px dashed rgba(255, 255, 255, .12);
}

/* —— Thread modal —— */
.modal.xl:has(.dm-thread-view) { width: min(860px, 96vw); }
.modal-body:has(.dm-thread-view) {
  padding: 18px 20px 20px;
  overflow: hidden;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.dm-thread-view {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: min(78vh, 700px);
}

.dm-thread-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(16, 9, 11, .92);
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
  flex-wrap: wrap;
  flex-shrink: 0;
}
.dm-thread-del-all {
  display: inline-flex !important;
  align-items: center;
  gap: 7px;
  padding: 9px 14px !important;
  border-radius: 11px !important;
}
.dm-thread-del-all svg { width: 14px; height: 14px; }

.dm-thread-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(12, 6, 8, .88);
  border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: inset 0 2px 12px rgba(0, 0, 0, .35);
}
.dm-thread-scroll {
  scrollbar-width: thin;
  scrollbar-color: rgba(214, 59, 54, .45) rgba(20, 10, 12, .85);
}
.dm-thread-scroll::-webkit-scrollbar { width: 9px; }
.dm-thread-scroll::-webkit-scrollbar-track {
  background: rgba(20, 10, 12, .85);
  border-radius: 99px;
  margin: 4px 0;
}
.dm-thread-scroll::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(255, 154, 107, .55), rgba(255, 90, 50, .42));
  border-radius: 99px;
  border: 2px solid rgba(20, 10, 12, .9);
}
.dm-thread-scroll::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(255, 170, 130, .7), rgba(255, 110, 70, .55));
}

.dm-thread-older {
  align-self: center;
  margin-bottom: 4px;
  padding: 8px 16px !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, .05) !important;
  border: 1px solid rgba(255, 255, 255, .1) !important;
}
.dm-thread-msgs {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dm-thread-row { display: flex; width: 100%; }
.dm-thread-row.from-a { justify-content: flex-start; }
.dm-thread-row.from-b { justify-content: flex-end; }

.dm-thread-bubble {
  width: min(92%, 640px);
  min-width: min(72%, 420px);
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(14, 10, 8, .95);
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 8px 20px -14px rgba(0, 0, 0, .65);
}
.dm-thread-row.from-b .dm-thread-bubble {
  background: linear-gradient(155deg, rgba(28, 14, 10, .98), rgba(18, 10, 7, .96));
  border-color: rgba(255, 154, 107, .28);
  box-shadow: 0 8px 22px -12px rgba(255, 90, 50, .18);
}
.dm-thread-bubble-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.dm-thread-sender {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.dm-thread-ava .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  background: rgba(255, 255, 255, .08);
  border: 1.5px solid rgba(255, 255, 255, .12);
  flex-shrink: 0;
}
.dm-thread-ava .avatar-img { object-fit: cover; }
.dm-thread-sender-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.dm-thread-who {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--peach);
  letter-spacing: .2px;
}
.dm-thread-handle {
  font-style: normal;
  font-size: 11px;
  color: var(--dim);
  font-weight: 600;
}
.dm-thread-head-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.dm-thread-time {
  font-size: 11.5px;
  color: var(--dim);
  font-weight: 600;
}
.dm-thread-text {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}
@media (max-width: 720px) {
  .dm-convo-card { grid-template-columns: 1fr; }
  .dm-convo-card .dm-convo-open { width: 100%; justify-content: center; }
  .dm-thread-bubble { min-width: 88%; width: 88%; }
  .modal.xl:has(.dm-thread-view) { width: 96vw; }
}

