:root {
  --ink: #1b2a3a;
  --paper: #eef4fb;
  --card: #ffffff;
  --line: #d8e3ef;
  --blue: #2aabee;
  --blue-dark: #229ed9;
  --blue-soft: #e8f4fc;
  --muted: #6b7c8f;
  --chat-bg: #7b92a8;
  --bubble-in: #ffffff;
  --bubble-out: #effdde;
  --accent: #2aabee;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.45 "Segoe UI", system-ui, sans-serif;
}
aside {
  width: 220px;
  padding: 24px 16px;
  background: #1f3347;
  color: #eef4fb;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
aside a {
  color: inherit;
  text-decoration: none;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 14px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
aside a.on, aside a:hover { background: rgba(42, 171, 238, 0.18); color: #fff; }
.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
}
.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sidebar-account {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
}
.sidebar-account-avatar {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(145deg, #3eb5f0, #1a6fa8);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.sidebar-account-meta { min-width: 0; }
.sidebar-account-meta strong {
  display: block;
  font-size: 14px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-account-meta span {
  display: block;
  font-size: 11px;
  line-height: 1.35;
  color: rgba(238, 244, 251, 0.72);
  margin-top: 2px;
}
aside a.sidebar-logout {
  margin-top: 0;
  opacity: 0.85;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.12);
}
aside a.sidebar-logout:hover {
  background: rgba(229, 57, 53, 0.25);
  color: #fff;
}
.nav-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #e53935;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  flex-shrink: 0;
}
.brand { font-weight: 700; margin-bottom: 16px; letter-spacing: 0.02em; color: #fff; }
.muted { opacity: 0.75; }
main { flex: 1; padding: 24px 28px; max-width: 1320px; }
.page-head { margin-bottom: 16px; }
.page-head h1 { margin: 6px 0 0; font-size: 26px; }
.back { color: var(--blue-dark); text-decoration: none; font-size: 14px; }
.workspace, .dialogs { display: flex; gap: 18px; align-items: stretch; }
.complaint-page { min-height: calc(100vh - 110px); }
.case-panel { flex: 1; min-width: 0; display: grid; gap: 14px; align-content: start; }
.panel-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: 0 8px 24px rgba(31, 51, 71, 0.06);
}
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.info-table { width: 100%; border-collapse: collapse; }
.info-table th, .info-table td {
  text-align: left;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.info-table th { width: 160px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.info-table td { font-size: 14px; }
.gallery { margin-top: 14px; }
.gallery-title { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin-bottom: 8px; }
.gallery-grid { display: flex; gap: 10px; flex-wrap: wrap; }
.shot-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  flex: 0 0 120px;
}
.shot {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  display: block;
}
.shot img { width: 100%; height: 100%; object-fit: cover; }
.shot-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 5;
  border: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.shot-badge-lock {
  width: 28px;
  height: 28px;
  background: rgba(15, 23, 42, 0.38);
  color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(2px);
  pointer-events: none;
}
.shot-badge-delete {
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.92);
  color: #c92a2a;
  cursor: pointer;
  pointer-events: auto;
  z-index: 6;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
  padding: 0;
}
.shot-badge-delete:hover {
  background: #fff;
  color: #a61e1e;
}
.profile-plate { padding: 12px 14px; }
.profile-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.avatar.sm.has-photo,
.avatar.has-photo,
.users-detail-avatar.has-photo {
  padding: 0;
  overflow: hidden;
  background: #e8eef4;
}
.avatar.sm img,
.avatar.has-photo img,
.users-detail-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.avatar.sm {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  font-size: 14px;
  border-radius: 10px;
}
.profile-line {
  margin: 0;
  flex: 1;
  min-width: 200px;
  font-size: 12px;
  line-height: 1.45;
  color: #5f6f80;
}
.profile-line strong { color: #1b2a3a; font-size: 12px; }
.profile-line a { font-size: 12px; }
.profile-line .pill { font-size: 10px; padding: 2px 8px; vertical-align: middle; }
.tg-link {
  font-size: 12px;
  color: var(--blue-dark);
  text-decoration: none;
  border: 1px solid #cfe6f7;
  background: #f4faff;
  padding: 5px 10px;
  border-radius: 8px;
  white-space: nowrap;
  flex: 0 0 auto;
}
.case-tabs-card { padding: 14px 16px 16px; }
.case-tabs {
  display: flex;
  gap: 22px;
  border-bottom: 1px solid #dfe7ef;
  margin: 0 0 16px;
}
a.case-tab {
  display: inline-block;
  text-decoration: none;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: #8b98a5 !important;
  font-size: 15px;
  font-weight: 500;
  padding: 0 0 11px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent !important;
  border-radius: 0 !important;
}
a.case-tab.on {
  color: #2aabee !important;
  font-weight: 600;
  border-bottom-color: #2aabee !important;
}
.tab-pane { display: none !important; }
.tab-pane.on { display: block !important; }
.tab-pane.on { padding-top: 2px; }
.tab-pane.on > * + * { margin-top: 12px; }
.field-grid.compact .field-row { padding: 8px 10px; }
.field-grid.compact .field-row span { font-size: 10px; }
.field-grid.compact .field-row strong { font-size: 12px; }
.field-grid { display: grid; gap: 8px; }
.field-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdff;
}
.field-row.block { flex-direction: column; }
.field-row span {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #7a8794;
  font-weight: 600;
}
.field-row strong { font-size: 14px; color: #1b2a3a; text-align: right; }
.field-row.block strong { text-align: left; white-space: pre-wrap; }
.log-list { display: grid; gap: 8px; max-height: 420px; overflow: auto; }
.log-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fbfdff;
}
.log-item.empty { color: #7a8794; font-size: 13px; }
.log-status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.log-status .arrow { color: #9aa8b5; }
.log-actor { margin-top: 4px; font-size: 13px; color: #5f6f80; }
.log-note { margin-top: 4px; font-size: 13px; color: #1b2a3a; }
.log-item time { display: block; margin-top: 6px; font-size: 11px; color: #9aa8b5; }
.ticket-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.ticket-head h2 { margin: 0; font-size: 18px; }
.ticket-card { display: grid; gap: 14px; }
.swal-label { display: grid; gap: 6px; text-align: left; margin-top: 10px; font-size: 13px; color: #5f6f80; }
.swal-base-fields { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--line, #e2e8f0); }
.swal-base-fields[hidden] { display: none !important; }
.swal-input { width: 100%; font: inherit; padding: 8px 10px; border-radius: 8px; border: 1px solid #d8e3ef; }
.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.status-new { background: var(--blue-soft); color: var(--blue-dark); }
.status-in_review { background: #e3ecff; color: #3b5bdb; }
.status-approved { background: #e6f6ed; color: #2f9e44; }
.status-rejected { background: #fdecec; color: #c92a2a; }
.chat-panel {
  width: 420px;
  flex: 0 0 420px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(31, 51, 71, 0.08);
  height: calc(100vh - 110px);
  min-height: 560px;
}
.chat-head {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}
.chat-head .chat-name {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: #1b2a3a;
  line-height: 1.2;
}
.avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--blue), var(--blue-dark));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 18px;
  flex: 0 0 46px;
}
.chat-head span { color: #5f6f80; font-size: 12px; display: block; margin-top: 2px; }
.chat-body {
  flex: 1;
  min-height: 0;
  background: #eef2f6;
}
.bubbles {
  height: 100%;
  overflow: auto;
  padding: 12px 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.msg-row { display: flex; width: 100%; }
.msg-row.in { justify-content: flex-start; }
.msg-row.out { justify-content: flex-end; }
.msg-row.system { justify-content: center; }
.msg-card {
  width: min(92%, 320px);
  background: #ffffff;
  border: 1px solid #e3eaf2;
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: 0 1px 2px rgba(31, 51, 71, 0.06);
  color: #1b2a3a;
}
.msg-row.out .msg-card {
  background: #e1f1fb;
  border: 1px solid #d3e8f6;
}
.system-card {
  width: auto;
  max-width: 92%;
  background: #f8fafc;
  border: 1px solid #e3eaf2;
  color: #5f6f80;
  font-size: 12px;
  padding: 7px 12px;
  box-shadow: none;
}
.msg-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.msg-label { font-size: 12px; font-weight: 700; color: #3b6ea8; }
.msg-row.in .msg-label { color: #5f6f80; }
.msg-actions { display: flex; gap: 4px; opacity: 0; transition: opacity 0.15s; }
.msg-card:hover .msg-actions { opacity: 1; }
.msg-act {
  border: 0;
  background: rgba(31, 51, 71, 0.08);
  color: #1f3347;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  padding: 0;
}
.msg-quote {
  border-left: 3px solid var(--blue);
  background: rgba(42, 171, 238, 0.08);
  padding: 6px 8px;
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 12px;
  color: #4a6175;
}
.msg-quote strong { display: block; font-size: 11px; margin-bottom: 2px; }
.msg-text { white-space: pre-wrap; font-size: 14px; line-height: 1.4; color: #1b2a3a; }
.msg-text.deleted { font-style: italic; color: #7a8794; }
.msg-card img { max-width: 100%; border-radius: 10px; display: block; margin-top: 6px; }
.msg-image-wrap { margin-top: 8px; }
.msg-image-link { display: block; cursor: zoom-in; }
.msg-image-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.msg-image-actions .btn.sm { padding: 4px 10px; font-size: 12px; }
.composer-photo-hint {
  font-size: 12px;
  color: var(--muted);
  padding: 4px 2px 0;
}
.msg-meta { display: flex; justify-content: flex-end; gap: 6px; margin-top: 6px; font-size: 11px; color: #7a8794; }
.msg-meta .edited { color: #5c7fa0; }
.chat-rating-bar {
  flex: 0 0 auto;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, #f8fbff 0%, #fff 100%);
}
.chat-rating-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  font-size: 13px;
}
.chat-rating-label { color: var(--muted); font-weight: 600; }
.chat-rating-stars {
  color: #f5a623;
  letter-spacing: 1px;
  font-size: 16px;
}
.chat-rating-score {
  color: var(--ink);
  font-weight: 700;
  font-size: 13px;
}
.rating-swal-popup { border-radius: 16px !important; }
.rating-swal { padding: 4px 0 0; }
.rating-swal-emoji { font-size: 4rem; line-height: 1.1; margin-bottom: 8px; }
.rating-swal-text { margin: 0 0 10px; font-size: 16px; color: #1b2a3a; }
.rating-swal-stars { font-size: 28px; color: #f5a623; letter-spacing: 3px; }
.rating-swal-festive .rating-swal-emoji { animation: rating-pop 0.55s ease; }
@keyframes rating-pop {
  0% { transform: scale(0.6); opacity: 0.4; }
  70% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}
.chat-foot { padding: 10px; border-top: 1px solid var(--line); background: #fff; position: relative; }
.composer-wrap { display: grid; gap: 8px; }
.composer-shell {
  position: relative;
}
.composer { display: flex; gap: 8px; align-items: flex-end; position: relative; }
.composer-send-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
  position: relative;
}
.composer-emoji-btn {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  font-size: 16px;
  border-radius: 8px;
  margin-bottom: 0;
}
.composer-emoji-btn:hover { background: #f0f4f8; }
.composer-text,
.composer input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: #f8fbff;
  min-height: 72px;
  max-height: 160px;
  resize: vertical;
  font: inherit;
  line-height: 1.4;
}
.composer-attach-btn {
  color: #5f6f80;
  margin-bottom: 4px;
}
.composer-attach-btn:hover { background: #f0f4f8; }
.btn-send-icon {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin-bottom: 2px;
  box-shadow: 0 2px 8px rgba(34, 139, 230, 0.35);
}
.btn-send-icon:hover { background: var(--blue-dark); }
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 26px;
  line-height: 1;
  flex: 0 0 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  align-self: center;
}
.emoji-panel {
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  left: auto;
  top: auto;
  width: min(340px, calc(100vw - 48px));
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 2px;
  background: #ffffff;
  border: 1px solid #e6edf5;
  border-radius: 16px;
  padding: 12px 10px;
  box-shadow: 0 10px 28px rgba(31, 51, 71, 0.14);
}
.emoji-item {
  border: 0;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
  border-radius: 8px;
  padding: 6px 2px;
  line-height: 1;
  box-shadow: none;
}
.emoji-item:hover { background: #f3f6fa; }
.reply-bar {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  background: #eef4fb;
  border: 1px solid #d8e3ef;
  border-radius: 10px;
  padding: 6px 8px;
  font-size: 12px;
}
.edit-bar {
  background: #fff7e8;
  border-color: #f0dfc0;
}
.edit-bar strong { color: #9a6b00; }
.reply-bar span { display: block; color: #5f6f80; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font: inherit;
}
.btn.primary { background: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-dark); }
.btn.ghost {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn.ghost:hover { background: #f6f9fc; }
.btn.send { background: var(--blue); color: #fff; min-width: 96px; }
.btn.wide { width: 100%; }
.hidden { display: none !important; }
main:has(.crm-page) {
  max-width: none;
  width: 100%;
  padding: 16px 20px 20px;
}
.crm-page {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 36px);
  max-height: calc(100vh - 36px);
  overflow: hidden;
}
.crm-topbar {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #dce5ef;
}
.crm-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
}
.crm-shell {
  flex: 1;
  display: flex;
  min-height: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(31, 51, 71, 0.08);
  height: calc(100vh - 100px);
}
.crm-sidebar {
  width: 340px;
  flex: 0 0 340px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: #fafcfe;
}
.crm-search-wrap { padding: 14px 14px 10px; border-bottom: 1px solid #e8eef4; background: #fff; }
.crm-search {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px 10px 36px;
  background: #f8fbff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%238a9aae' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242 1.1a5.5 5.5 0 1 1 0-11 5.5 5.5 0 0 1 0 11z'/%3E%3C/svg%3E") no-repeat 12px center;
  font-size: 14px;
}
.crm-thread-list {
  flex: 1;
  overflow: auto;
  padding: 8px 0;
}
.crm-thread {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 16px;
  text-decoration: none;
  color: inherit;
  border-left: 3px solid transparent;
  transition: background 0.12s ease;
}
.crm-thread:hover { background: #f3f8fd; }
.crm-thread.on {
  background: #eef6fc;
  border-left-color: var(--blue);
}
.crm-thread.hidden { display: none; }
.crm-thread-body { min-width: 0; flex: 1; display: grid; gap: 4px; padding-right: 8px; }
.crm-thread-name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
  word-break: break-word;
}
.crm-thread-time { font-size: 12px; color: #8a9aae; }
.crm-thread-snippet {
  display: block;
  font-size: 12px;
  line-height: 1.35;
  color: #5f6f80;
  word-break: break-word;
  margin-top: 1px;
}
.crm-thread.search-match .crm-thread-time {
  margin-top: 2px;
}
.crm-thread.search-match { background: #f7fbff; }
.search-hit {
  background: #ffe066;
  color: inherit;
  padding: 0 1px;
  border-radius: 3px;
}
.msg-text .search-hit,
.msg-card.system-card .search-hit,
.msg-quote .search-hit {
  background: #ffe066;
  color: inherit;
  padding: 0 1px;
  border-radius: 3px;
}
.crm-load-more-wrap {
  padding: 10px 12px 14px;
  border-top: 1px solid #e8eef4;
  background: #fff;
  flex: 0 0 auto;
}
.crm-load-more {
  display: block;
  text-align: center;
  text-decoration: none;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #f8fbff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}
.crm-load-more:hover { background: #eef6fc; border-color: #cfe6f7; color: var(--blue-dark); }
.note-dot {
  position: absolute;
  top: 14px;
  right: 12px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59f00;
  box-shadow: 0 0 0 2px #fff;
}
.crm-empty-list { padding: 24px 16px; color: var(--muted); font-size: 14px; margin: 0; }
.crm-chat.chat-panel {
  flex: 1;
  width: auto;
  min-width: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.crm-chat .chat-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.crm-chat .bubbles {
  flex: 1;
  min-height: 0;
  height: auto;
  overflow-y: auto;
}
.crm-chat .chat-foot { flex: 0 0 auto; }
.chat-head-text { min-width: 0; flex: 1; }
.chat-head-text .chat-name {
  word-break: break-word;
  line-height: 1.3;
}
.crm-chat-head {
  flex-wrap: wrap;
  gap: 12px;
}
.chat-head-main { display: flex; gap: 12px; align-items: center; flex: 1; min-width: 0; }
.chat-sub { color: #5f6f80; font-size: 12px; display: block; margin-top: 2px; line-height: 1.45; }
.chat-tg-link { color: var(--blue-dark); text-decoration: none; font-weight: 600; }
.chat-head-actions { display: flex; gap: 8px; align-items: center; flex: 0 0 auto; }
.chat-head-actions .btn.ghost {
  white-space: nowrap;
  padding: 8px 12px;
  font-size: 13px;
}
.btn-note {
  border: 1px solid #d8e3ef;
  background: #fff;
  color: var(--ink);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font: inherit;
}
.btn-note:hover { background: #f6f9fc; }
.btn-note.filled {
  border-color: #f0dfc0;
  background: #fff9eb;
  color: #9a6b00;
}
.crm-note-panel {
  padding: 12px 16px;
  background: #fffbf0;
  border-bottom: 1px solid #f0dfc0;
}
.crm-note-label { display: grid; gap: 8px; font-size: 12px; color: #7a6520; font-weight: 600; }
.crm-note-label textarea {
  width: 100%;
  resize: vertical;
  min-height: 72px;
  border: 1px solid #ecd9a8;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}
.crm-note-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.crm-chat-empty { display: grid; place-items: center; background: #f8fafc; }
.crm-placeholder { text-align: center; color: var(--muted); font-size: 15px; max-width: 360px; padding: 24px; }

.broadcasts-page { max-width: 720px; margin: 0 auto; padding: 8px 0 32px; }
.broadcasts-stub {
  text-align: center;
  padding: 40px 32px 36px;
  margin-top: 8px;
}
.broadcasts-stub-art {
  max-width: 320px;
  margin: 0 auto 24px;
}
.broadcasts-stub-art svg { width: 100%; height: auto; display: block; }
.broadcasts-stub-title {
  margin: 0 0 12px;
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
}
.broadcasts-stub-lead {
  margin: 0 auto 20px;
  max-width: 520px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
}
.broadcasts-stub-list {
  list-style: none;
  margin: 0 auto 28px;
  padding: 0;
  max-width: 400px;
  text-align: left;
  font-size: 14px;
  line-height: 1.5;
  color: #4a5d6e;
}
.broadcasts-stub-list li {
  position: relative;
  padding: 6px 0 6px 22px;
}
.broadcasts-stub-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 13px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
}
.broadcasts-stub-badge {
  display: inline-block;
  margin: 0;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #9a6b00;
  background: #fff8e6;
  border: 1px solid #f0d48a;
}

.payments-page { max-width: 1100px; }
.payments-head { margin-bottom: 16px; }
.payments-title { margin: 0 0 6px; font-size: 28px; }
.payments-lead { margin: 0; }
.payments-table-wrap { margin-top: 0; }
.payments-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.payments-user-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.payments-user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}
.payments-user-sub {
  font-size: 12px;
  color: var(--muted);
}
.payments-plan {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 3px 8px;
  border-radius: 999px;
  margin-right: 6px;
}
.payments-plan-pro {
  background: #fff8e6;
  color: #9a6b00;
  border: 1px solid #f0d48a;
}
.payments-plan-free {
  background: #f0f4f8;
  color: #6b7c8f;
  border: 1px solid #e2e8f0;
}
.payments-plan-until,
.payments-plan-left {
  display: block;
  font-size: 12px;
  color: #5c6f80;
  line-height: 1.35;
}
.payments-plan-left { color: var(--muted); font-size: 11px; }
.payments-plan-muted { color: var(--muted); }
.payments-amount { font-variant-numeric: tabular-nums; }
.payments-when { white-space: nowrap; color: #5c6f80; font-size: 12px; }
.payments-col-action { width: 1%; white-space: nowrap; text-align: right; }
.payments-detail-btn { padding: 6px 12px !important; font-size: 12px !important; }
.payment-status {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 4px 10px;
  border-radius: 999px;
}
.payment-status-pending {
  background: #fff4e6;
  color: #d9480f;
  border: 1px solid #ffc9a8;
}
.payment-status-paid {
  background: #ebfbee;
  color: #2b8a3e;
  border: 1px solid #b2f2bb;
}
.payment-detail-dialog {
  border: 0;
  border-radius: 16px;
  padding: 0;
  max-width: 440px;
  width: calc(100% - 32px);
  box-shadow: 0 20px 50px rgba(20, 40, 60, 0.18);
}
.payment-detail-dialog::backdrop {
  background: rgba(15, 30, 45, 0.45);
}
.payment-detail-form { margin: 0; }
.payment-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid #e8eef4;
}
.payment-detail-head h2 {
  margin: 0;
  font-size: 18px;
}
.payment-detail-close {
  border: 0;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
}
.payment-detail-close:hover { background: #f0f4f8; color: var(--ink); }
.payment-detail-dl {
  margin: 0;
  padding: 16px 20px;
  display: grid;
  gap: 10px;
}
.payment-detail-dl div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px;
  align-items: start;
}
.payment-detail-dl dt {
  margin: 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 600;
}
.payment-detail-dl dd {
  margin: 0;
  font-size: 14px;
  color: var(--ink);
  word-break: break-word;
}
.payment-detail-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  padding: 12px 20px 18px;
  border-top: 1px solid #e8eef4;
}
.payment-detail-foot .hidden { display: none; }
main:has(.users-page) { max-width: none; width: 100%; }
main:has(.settings-welcome-layout),
main:has(.settings-page-welcome) { max-width: none; width: 100%; }
.settings-page-welcome { width: 100%; }
.settings-access-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 420px;
  margin-top: 12px;
}
.settings-access-notice {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
}
.settings-access-notice.ok {
  background: #e8f6ef;
  color: #1a6b4a;
  border: 1px solid #b8e0cc;
}
.settings-access-notice.err {
  background: #fef2f2;
  color: #9b2c2c;
  border: 1px solid #f5c2c2;
}
.users-page { height: calc(100vh - 36px); max-height: calc(100vh - 36px); overflow: hidden; display: flex; flex-direction: column; }
.users-crm { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.users-subnav {
  display: flex;
  gap: 28px;
  padding: 0 4px 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid #dce5ef;
  flex: 0 0 auto;
}
.users-crm-title { margin: 0 0 10px; font-size: 26px; font-weight: 700; }
.users-crm-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  flex: 0 0 auto;
  flex-wrap: wrap;
}
.users-filter-pills { flex: 1; min-width: 280px; display: grid; gap: 8px; }
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.filter-row-label {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  color: #9aabb8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 2px;
}
.filter-pills { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.filter-pill {
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: 1px solid #e6edf5;
  background: #fff;
  color: #1b2a3a;
  line-height: 1.2;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.filter-pill:hover {
  border-color: #c5d8ea;
  background: #f8fbfe;
}
.filter-pill.on {
  background: color-mix(in srgb, var(--pill-color, var(--blue)) 14%, white);
  border-color: color-mix(in srgb, var(--pill-color, var(--blue)) 38%, white);
  color: color-mix(in srgb, var(--pill-color, var(--blue-dark)) 78%, black);
}
.filter-pill-pro.on {
  background: #fff8e6;
  border-color: #f0d48a;
  color: #9a6b00;
}
.filter-crown { font-size: 12px; margin-right: 2px; }
.users-search-compact {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.users-search-field {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.users-search-input {
  width: 200px;
  padding: 8px 28px 8px 10px !important;
  font-size: 13px !important;
  border-radius: 10px !important;
}
.users-search-clear {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #8a9aae;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.users-search-clear:hover {
  background: #eef3f8;
  color: #4a5d6e;
}
.users-search-input.users-search-busy {
  opacity: 0.88;
}
.users-sort-wrap { display: grid; gap: 4px; }
.users-sort-label { font-size: 11px; color: #9aabb8; font-weight: 600; }
.users-sort-select {
  padding: 8px 10px !important;
  font-size: 13px !important;
  border-radius: 10px !important;
  min-width: 148px;
}
.users-search-btn {
  padding: 8px 14px !important;
  font-size: 13px !important;
  border-radius: 10px !important;
}
.users-tab {
  text-decoration: none;
  color: #8a9aae;
  font-weight: 600;
  font-size: 15px;
  padding-bottom: 10px;
  margin-bottom: -13px;
  border-bottom: 2px solid transparent;
}
.users-tab.on { color: var(--ink); border-bottom-color: var(--blue); }

.subcategory-nav {
  margin: 0 0 1.15rem;
}
.subcategory-nav-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 10px;
}
.subcategory-pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.subcategory-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  border: 1px solid #d4e0ea;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(15, 35, 55, 0.04);
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.subcategory-pill:hover {
  border-color: var(--blue);
  color: var(--blue);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
}
.subcategory-pill.on {
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  border-color: #2563eb;
  color: #fff;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.28);
}
.subcategory-pill.on:hover {
  color: #fff;
  border-color: #1d4ed8;
}
@media (max-width: 520px) {
  .subcategory-pill {
    padding: 7px 12px;
    font-size: 12px;
  }
}
.users-hint { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
.users-source-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  flex: 0 0 auto;
}
.source-pill-wrap { display: inline-flex; align-items: center; gap: 2px; }
.source-pill {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.source-copy {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  padding: 4px 6px;
  border-radius: 8px;
}
.source-copy:hover { background: #eef6fc; color: var(--blue-dark); }
.source-pill.on {
  background: color-mix(in srgb, var(--pill-color, var(--blue)) 12%, white);
  border-color: color-mix(in srgb, var(--pill-color, var(--blue)) 40%, white);
  color: var(--ink);
}
.users-search {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex: 0 0 auto;
}
.users-search input { flex: 1; max-width: 360px; }
.users-shell {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 14px;
  overflow: hidden;
}
.users-table-wrap {
  flex: 1;
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: auto;
  display: flex;
  flex-direction: column;
}
.users-table-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
  background: #f8fbff;
}
.users-table { width: 100%; border-collapse: collapse; border-radius: 0; background: transparent; }
.users-table th, .users-table td { padding: 11px 12px; border-bottom: 1px solid #e8eef4; vertical-align: middle; font-size: 13px; }
.users-table th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); background: #fafcfe; position: sticky; top: 0; }
.users-row.on { background: #eef6fc; }
.users-lead { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; min-width: 0; }
.users-lead-name { font-weight: 600; word-break: break-word; line-height: 1.3; }
.tg-cell { color: var(--blue-dark); text-decoration: none; font-weight: 600; }
.source-badge {
  display: inline-flex;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: color-mix(in srgb, var(--src-color, var(--blue)) 14%, white);
  color: color-mix(in srgb, var(--src-color, var(--blue)) 70%, black);
}
.users-load-more { margin: 12px; text-align: center; }
.users-detail {
  width: 380px;
  flex: 0 0 380px;
  align-self: stretch;
  overflow: auto;
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 16px 16px 18px;
}
.users-detail-empty { display: grid; place-items: center; color: var(--muted); }
.users-detail-head { display: flex; gap: 12px; align-items: center; }
.users-detail-head-v2 { display: flex; gap: 12px; align-items: center; }
.users-detail-avatar {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(145deg, #3eb5ef, #1f8fd4);
  box-shadow: 0 6px 16px rgba(42, 171, 238, 0.28);
  flex: 0 0 52px;
}
.users-detail-title { min-width: 0; }
.users-detail-title .chat-name {
  display: block;
  font-size: 17px;
  line-height: 1.25;
  margin-bottom: 2px;
  color: #1b2a3a;
  font-weight: 700;
}
.users-detail-title .chat-sub { font-size: 12px; color: var(--muted); line-height: 1.35; }
.users-detail-source { color: #8a9aae; font-weight: 700; letter-spacing: 0.03em; }
.users-kv { margin: 0; display: grid; gap: 10px; }
.users-kv div { display: grid; grid-template-columns: 120px 1fr; gap: 8px; font-size: 13px; }
.users-kv dt { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
.users-kv dd { margin: 0; word-break: break-word; }
.users-pro-form { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.users-pro-form label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
a.tg-open-btn.btn.primary.wide {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  text-align: center;
  text-decoration: none;
}
.categories-card { max-width: 920px; }
.category-add { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.category-add input { flex: 1; min-width: 220px; }
.category-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.category-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafcfe;
  flex-wrap: wrap;
}
.category-main { display: flex; align-items: center; gap: 10px; }
.category-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 10px; }
.category-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.link-copy {
  border: 0;
  background: transparent;
  color: var(--blue-dark);
  font-size: 12px;
  cursor: pointer;
  text-align: left;
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0;
}
.pill.mini { font-size: 10px; padding: 2px 8px; }
.btn.danger { background: #e03131; color: #fff; }
.btn.mini { padding: 6px 10px; font-size: 12px; }
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: #1f3347;
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  z-index: 20;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
.users-empty { text-align: center; color: var(--muted); padding: 24px; }
.users-bulk-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
  padding: 10px 14px;
  background: #e8f4fc;
  border: 1px solid #b8dcf5;
  border-radius: 12px;
}
.users-bulk-bar.hidden { display: none; }
.bulk-count { font-size: 14px; font-weight: 700; color: #1b2a3a; margin-right: 4px; }
.bulk-select { min-width: 160px; padding: 8px 12px; border-radius: 10px; border: 1px solid #d8e3ef; font: inherit; background: #fff; }
.bulk-apply-btn { background: #fff !important; color: var(--ink) !important; border: 1px solid #d8e3ef !important; }
.bulk-delete-btn {
  background: #ffe8e8 !important;
  color: #c92a2a !important;
  border: 1px solid #f3c4c4 !important;
  font-weight: 600;
}
.bulk-delete-btn:hover { background: #ffdcdc !important; }
.bulk-pro-days { width: 72px; padding: 8px 10px; }
.users-table thead .col-check input { cursor: pointer; }
.users-table .col-check { width: 36px; }
.users-table .col-status { width: 40px; text-align: center; }
.lead-status {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  vertical-align: middle;
  box-shadow: 0 0 0 2px #fff;
}
.lead-status-lg { width: 14px; height: 14px; }
.lead-status-active { background: #2f9e44; }
.lead-status-muted { background: #f59f00; }
.lead-status-guest { background: #868e96; }
.lead-status-blocked { background: #e03131; }
.lead-status-pro {
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: 16px;
  line-height: 1;
}
.lead-status-pro::before { content: "👑"; }
.categories-screen {
  flex: 1;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px 24px 28px;
  box-shadow: 0 8px 24px rgba(31, 51, 71, 0.06);
}
.categories-title { margin: 0 0 8px; font-size: 24px; font-weight: 700; color: var(--ink); }
.categories-lead { margin: 0 0 18px; font-size: 14px; color: var(--muted); line-height: 1.5; max-width: 720px; }
.category-add-v3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.category-input {
  flex: 1;
  min-width: 240px;
  max-width: 420px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font: inherit;
  background: #fff;
}
.category-color {
  width: 44px;
  height: 44px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}
.category-add-btn { padding: 11px 18px; border-radius: 12px; }
.category-list-v3 { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.category-row-v3 {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid #e6edf5;
  border-radius: 14px;
  background: #fff;
}
.category-row-main {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}
.category-bot-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--blue-dark);
  text-decoration: none;
}
.category-bot-link:hover { text-decoration: underline; }
.category-start-param {
  font-size: 12px;
  font-weight: 600;
  color: #9aabb8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.category-name-up { font-size: 14px; letter-spacing: 0.05em; color: var(--ink); }
.category-social-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  box-shadow: 0 4px 14px rgba(31, 51, 71, 0.12);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.category-social-btn svg { width: 22px; height: 22px; }
.category-social-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(31, 51, 71, 0.16); }
.category-social-instagram { background: linear-gradient(135deg, #f58529, #dd2a7b 45%, #8134af); }
.category-social-facebook { background: #1877f2; }
.category-social-youtube { background: #ff0000; }
.category-social-telegram { background: #2aabee; }
.category-social-btn:not(.category-social-instagram):not(.category-social-facebook):not(.category-social-youtube):not(.category-social-telegram) {
  background: linear-gradient(135deg, #6b7c8f, #4a6075);
}
.category-lock {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #b0bec8;
  background: #f4f7fa;
  border-radius: 12px;
  border: 1px solid #e6edf5;
}
.category-lock svg { width: 18px; height: 18px; }
.category-trash {
  width: 40px;
  height: 40px;
  border: 1px solid #f3c4c4;
  background: #fff5f5;
  color: #c92a2a;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.category-trash svg { width: 18px; height: 18px; }
.category-trash:hover { background: #ffe8e8; }
.users-search select { min-width: 180px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); font: inherit; }
.users-detail-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  border-bottom: 1px solid #dfe7ef;
  margin-bottom: 4px;
  padding-bottom: 2px;
}
.users-detail-tab {
  border: 0;
  background: transparent;
  padding: 8px 0 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.users-detail-tab.on { color: var(--ink); border-bottom-color: var(--blue); }
.users-detail-pane { display: none; }
.users-detail-pane.on { display: grid; gap: 12px; }
.users-info-rows { margin: 0; display: grid; gap: 8px; }
.users-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border: 1px solid #e6edf5;
  border-radius: 12px;
  background: #fff;
}
.users-info-row dt {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  color: #9aabb8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.users-info-row dd {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  text-align: right;
  word-break: break-word;
}
.users-dialog-link { text-align: center; text-decoration: none; }
.users-field-stack { display: grid; gap: 12px; }
.users-field { display: grid; gap: 6px; }
.users-field-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.users-field select,
.users-field textarea,
.users-field input.short {
  font: inherit;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}
.users-field-note textarea { min-height: 160px; resize: vertical; line-height: 1.45; }
.users-pro-wrap { display: grid; gap: 10px; }
.users-pro-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #f6f8fb;
}
.users-pro-alert.is-pro {
  border-color: #f0dfa8;
  background: linear-gradient(135deg, #fffbeb 0%, #fff 55%);
}
.users-pro-alert.is-free { background: #f8fafc; }
.users-pro-alert-main { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.users-pro-alert-text { display: grid; gap: 2px; min-width: 0; }
.users-pro-alert-text strong { font-size: 14px; color: #1b2a3a; font-weight: 700; }
.users-pro-alert-text span { font-size: 12px; color: var(--muted); line-height: 1.35; }
#user-pane-card .users-pro-alert { margin-top: 10px; margin-bottom: 4px; }
.users-pro-gear-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid #dce4ee;
  background: #fff;
  color: #4a6078;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.users-pro-gear-btn:hover { background: #eef4fb; border-color: #c5d6ea; color: var(--blue-dark); }
.users-pro-gear-btn.on {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  color: #fff;
}
.users-pro-settings {
  padding: 14px;
  border: 1px solid #e6edf5;
  border-radius: 14px;
  background: #f8fbfe;
  display: grid;
  gap: 12px;
}
.users-pro-settings.hidden { display: none !important; }
.users-pro-settings-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.users-pro-hint { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.45; }
.users-pro-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 6px 10px;
  border-radius: 10px;
  background: #fff8e6;
  color: #9a6b00;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}
.users-pro-revoke { color: #c92a2a !important; border-color: #f3c4c4 !important; }
.users-save-idle {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  line-height: 1.4;
}
.users-save-idle.hidden { display: none; }
#user-save-status.hidden { display: none; }
.kyc-autocomplete-wrap { display: grid; gap: 8px; overflow: visible; }
.complaint-new-form.card { overflow: visible; }
.kyc-input-wrap { position: relative; z-index: 5; }
.kyc-suggest {
  list-style: none;
  margin: 0;
  padding: 6px;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 4px;
  z-index: 50;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(20, 40, 70, 0.12);
  max-height: 220px;
  overflow: auto;
}
.kyc-suggest-empty {
  padding: 10px 12px;
  font-size: 13px;
  color: var(--muted);
}
.kyc-suggest.hidden { display: none !important; }
.kyc-suggest-item {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  display: grid;
  gap: 4px;
  background: #fff !important;
  color: var(--ink) !important;
  border: 0 !important;
  box-shadow: none !important;
}
.kyc-suggest-item:hover,
.kyc-suggest-item:focus-visible {
  background: #f0f2f5 !important;
  outline: none;
}
.kyc-suggest-kyc { display: block; font-size: 14px; color: #1b2a3a; margin-bottom: 4px; }
.kyc-suggest-kyc-label { font-weight: 700; color: #3d4f63; margin-right: 4px; }
.kyc-suggest-kyc strong { font-weight: 700; }
.kyc-suggest-sub { display: block; font-size: 12px; color: var(--muted); line-height: 1.35; }
.scammer-preview-kyc { font-size: 17px; font-weight: 700; color: #1b2a3a; line-height: 1.35; margin-bottom: 6px; }
.scammer-preview-kyc > span { color: #3d4f63; font-weight: 700; margin-right: 6px; }
.scammer-preview-kyc.is-missing { color: #9a6b00; }
.scammer-preview-note { font-size: 12px; color: var(--muted); line-height: 1.45; margin-top: 8px; }
.scammer-preview-note > span { font-weight: 700; color: #3d4f63; }
.scammer-preview {
  border: 1px solid #dce8f3;
  border-radius: 14px;
  background: #f8fbfe;
  padding: 14px;
  display: grid;
  gap: 12px;
}
.scammer-preview.hidden { display: none !important; }
.scammer-preview-head { display: grid; gap: 4px; }
.scammer-preview-meta { font-size: 12px; color: var(--muted); line-height: 1.4; margin-top: 2px; }
.scammer-preview-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 700; }
.scammer-preview-section { display: grid; gap: 6px; }
.scammer-preview-links,
.scammer-preview-timeline {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  color: #1b2a3a;
}
.scammer-preview-links { list-style: none; padding-left: 0; display: grid; gap: 8px; }
.scammer-preview-links li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.scammer-preview-exchange { font-weight: 700; font-size: 13px; }
.scammer-preview-link-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  color: #1a6fa8;
  background: #fff;
  border: 1px solid #c5d9ea;
  box-shadow: none;
}
.scammer-preview-link-btn:hover {
  background: #eef6fc;
  color: #145a88;
}
.complaint-new-actions-hint {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
  max-width: 520px;
}
.complaint-new-actions-hint.hidden { display: none; }
.scammer-preview-desc { font-size: 12px; color: var(--muted); margin-top: 2px; }
.scammer-preview-hint { margin: 0; font-size: 12px; color: #2f6fab; line-height: 1.4; }
.btn.sm { padding: 8px 12px; font-size: 13px; }

.promotions-page { max-width: 720px; }
.promotions-subnav {
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 16px 24px;
  position: relative;
  z-index: 2;
}
.promotions-subnav .promotions-tab {
  position: relative;
  z-index: 1;
  cursor: pointer;
  white-space: nowrap;
}
.promotions-subnav .promotions-tab:hover {
  color: var(--ink);
}
.promo-preview {
  padding: 12px 14px;
  border-radius: 12px;
  background: #f8fbfe;
  border: 1px solid var(--line);
  font-size: 13px;
  color: #5f6f80;
  line-height: 1.5;
}
.promo-preview strong { color: #1b2a3a; display: block; margin-bottom: 6px; }
.users-field-check { display: flex !important; align-items: center; gap: 8px; grid-template-columns: none !important; color: var(--ink); font-weight: 600; }
.settings-subnav { margin-bottom: 18px; }
.settings-subnav .users-tab {
  cursor: pointer;
  position: relative;
  z-index: 2;
}
.sidebar-settings-subnav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 4px 0 10px 12px;
  padding-left: 10px;
  border-left: 2px solid rgba(255, 255, 255, 0.12);
}
.sidebar-settings-subnav a {
  display: block;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  border-radius: 8px;
  line-height: 1.3;
}
.sidebar-settings-subnav a:hover {
  color: #fff;
  background: rgba(42, 171, 238, 0.14);
}
.sidebar-settings-subnav a.on {
  color: #fff;
  background: rgba(42, 171, 238, 0.22);
}
.settings-welcome-layout {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
  gap: 24px;
  align-items: stretch;
  width: 100%;
}
.settings-welcome-form,
.settings-welcome-preview {
  max-width: none;
  width: 100%;
  min-width: 0;
}
.settings-welcome-preview {
  position: sticky;
  top: 16px;
  align-self: start;
  color: var(--ink);
}
.settings-welcome-preview .welcome-preview-shell {
  width: 100%;
  max-width: none;
}
.settings-preview-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}
@media (max-width: 980px) {
  .settings-welcome-layout { grid-template-columns: 1fr; }
  .settings-welcome-preview { position: static; }
}
.welcome-textarea { width: 100%; min-height: 180px; font: inherit; line-height: 1.5; padding: 12px; border-radius: 12px; border: 1px solid var(--line); }
.welcome-buttons-fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 10px; margin: 0; }
.welcome-buttons-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 8px; }
.welcome-btn-check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); cursor: pointer; }
.welcome-image-block { display: grid; gap: 12px; margin-top: 8px; }
.welcome-image-preview { display: grid; gap: 8px; }
.welcome-image-preview img { max-width: 320px; border-radius: 14px; border: 1px solid var(--line); box-shadow: 0 8px 20px rgba(31, 51, 71, 0.08); }
.welcome-preview-block { display: grid; gap: 8px; margin-top: 4px; }
.welcome-preview-shell {
  width: 100%;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #f7fafc 0%, #eef3f8 100%);
  display: grid;
  gap: 10px;
}
.welcome-preview-photo-wrap img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
}
.welcome-preview-text {
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  color: #000;
}
.welcome-preview-text :where(b, strong, i, em, span, p, div) {
  color: #000;
}
.welcome-preview-keys { display: grid; gap: 6px; padding-top: 4px; }
.welcome-preview-key-row { display: flex; flex-wrap: wrap; gap: 6px; }
.welcome-preview-inline-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border-radius: 8px;
  background: #eef6fc;
  border: 1px solid #9ec5e8;
  font-size: 13px;
  color: #1a5a8a;
  font-weight: 600;
}
.welcome-preview-inline .welcome-preview-key-row { justify-content: flex-start; }
.welcome-image-thumb-wrap { display: grid; gap: 6px; }
.welcome-image-thumb {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: 0 6px 16px rgba(31, 51, 71, 0.08);
}
.users-field-inline { flex: 1; min-width: 100px; }
.users-delete-lead { margin-top: 4px; }
.users-kv.compact { gap: 8px; margin-bottom: 12px; }
.users-manage { display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
.users-manage label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.users-manage select,
.users-manage textarea {
  font: inherit;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}
.users-manage-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.user-log-list { display: grid; gap: 10px; max-height: 420px; overflow: auto; }
.users-detail .log-item { color: #1b2a3a; }
.users-detail .log-status,
.users-detail .log-status span { color: #1b2a3a; }
.users-detail .log-item.empty { color: #7a8794; }
h1 { margin: 0 0 18px; font-size: 28px; }
h2 { margin: 28px 0 10px; font-size: 18px; }
a { color: var(--blue-dark); }
table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 12px; overflow: hidden; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.dash-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (min-width: 1100px) {
  .dash-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.dash-head h1 { margin: 0 0 0.35rem; }
.dash-chart-card { margin-top: 1rem; }
.dash-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.dash-chart-head h2 { margin: 0; font-size: 18px; }
.dash-period-tabs { display: flex; gap: 6px; }
.dash-period {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
}
.dash-period.on {
  background: var(--blue-soft);
  border-color: #b8dff5;
  color: var(--blue-dark);
  font-weight: 600;
}
.dash-chart-wrap { height: 320px; position: relative; }
.dash-chart-legend { margin: 10px 0 0; }
.dash-managers-card { margin-top: 1rem; }
.dash-managers-card h2 { margin: 0 0 0.5rem; }
.mgr-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metrics article { background: var(--card); border: 1px solid var(--line); padding: 14px 16px; border-radius: 14px; }
.metrics span { display: block; color: var(--muted); font-size: 13px; }
.metrics strong { font-size: 28px; }
.bar { display: inline-block; height: 8px; background: var(--blue); border-radius: 99px; min-width: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px; display: grid; gap: 12px; }
.narrow { max-width: 420px; margin: 10vh auto; }
label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
input, select, button, textarea { font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: white; color: var(--ink); }
button:not(.btn):not(.emoji-item):not(.icon-btn):not(.msg-act):not(.users-detail-tab):not(.category-social-btn):not(.category-trash):not(.category-copy):not(.btn-delete-cat):not(.btn-note):not(.link-copy):not(.source-copy):not(.media-lightbox-backdrop):not(.media-lightbox-close):not(.admin-modal-close):not(.dash-period):not(.shot-badge-delete):not(.kyc-suggest-item) {
  background: var(--blue);
  color: white;
  cursor: pointer;
  border: 0;
}
button.danger { background: #e03131; }
.users-detail-tab {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 8px 0 10px !important;
  border-radius: 0 !important;
  color: #8a9aae !important;
}
.users-detail-tab.on {
  color: var(--ink) !important;
  border-bottom: 2px solid var(--blue) !important;
}
.tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { text-decoration: none; padding: 7px 12px; border-radius: 10px; color: var(--ink); background: #fff; border: 1px solid var(--line); font-size: 14px; }
.tabs a.on { background: var(--blue); color: white; border-color: var(--blue); }
main:has(.complaints-page) {
  max-width: none;
  width: 100%;
}
.complaints-page { width: 100%; }
.complaints-head { margin-bottom: 18px; }
.complaints-head h1 { margin: 0; font-size: 26px; }
.complaints-head-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.complaints-new-btn {
  flex-shrink: 0;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.complaints-sub { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.5; }
.complaint-new-layout {
  display: grid;
  grid-template-columns: minmax(0, 720px) minmax(300px, 1fr);
  gap: 20px;
  align-items: start;
}
.complaint-new-side {
  position: sticky;
  top: 16px;
  min-width: 0;
  width: 100%;
  max-width: 420px;
  justify-self: start;
}
.complaint-new-page .complaint-new-layout {
  width: 100%;
  max-width: 1200px;
}
.complaint-new-side-placeholder {
  margin: 0;
  padding: 18px 16px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  border: 1px dashed #dce4ee;
  border-radius: 14px;
  background: #fafbfc;
}
.complaint-new-side:has(.scammer-preview:not(.hidden)) .complaint-new-side-placeholder {
  display: none;
}
.complaint-new-form { padding: 22px 24px; max-width: none; display: block; }
.complaint-new-form label { text-align: left; justify-items: start; }
.complaint-new-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 20px;
}
.complaint-new-grid .span-2 { grid-column: 1 / -1; }
.complaint-new-grid .field-block { display: flex; flex-direction: column; gap: 6px; }
.complaint-new-grid .field-label { font-size: 13px; font-weight: 600; color: #3d4f63; }
.complaint-new-grid input[type="text"],
.complaint-new-grid input[type="url"],
.complaint-new-grid select,
.complaint-new-grid textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
}
.complaint-new-grid .field-hint { font-size: 12px; color: var(--muted); }
.complaint-new-grid input[type="radio"],
.complaint-new-grid input[type="file"] {
  width: auto;
  max-width: none;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  accent-color: var(--blue);
}
.complaint-new-grid input[type="file"] {
  display: block;
  width: 100%;
  padding: 8px 0;
  font-size: 14px;
  text-align: left;
}
.complaint-new-outcome { border: 0; padding: 0; margin: 0; text-align: left; }
.complaint-new-outcome legend.field-label { margin-bottom: 8px; padding: 0; }
.complaint-new-outcome .radio-line {
  display: flex !important;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin: 8px 0;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  width: 100%;
  text-align: left;
}
.complaint-new-outcome .radio-line input[type="radio"] {
  flex: 0 0 auto;
}
.complaint-new-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-top: 22px;
}
.complaint-new-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.form-error-banner {
  background: #fff0f0;
  border: 1px solid #f5c2c2;
  color: #9b2c2c;
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  max-width: 720px;
}
@media (max-width: 640px) {
  .complaint-new-layout { grid-template-columns: 1fr; }
  .complaint-new-side { position: static; }
  .complaint-new-grid { grid-template-columns: 1fr; }
  .complaint-new-grid .span-2 { grid-column: auto; }
}
.complaints-tabs { margin-bottom: 18px; }
.complaints-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(31, 51, 71, 0.07);
}
.complaint-table { width: 100%; border-collapse: collapse; background: transparent; border-radius: 0; }
.complaint-table thead th {
  padding: 14px 16px;
  font-size: 11px;
  letter-spacing: 0.05em;
  background: #f6f9fc;
  border-bottom: 1px solid var(--line);
}
.complaint-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid #e8eef4;
  vertical-align: middle;
}
.complaint-table tbody tr:last-child td { border-bottom: 0; }
.complaint-table tbody tr:not(.empty-row):hover { background: #f8fbff; }
.complaint-table .col-id { width: 72px; }
.complaint-table .col-time { white-space: nowrap; color: #5f6f80; font-size: 13px; }
.complaint-table .col-action { width: 120px; text-align: right; }
.complaint-id {
  font-weight: 700;
  font-size: 14px;
  color: var(--blue-dark);
  text-decoration: none;
}
.complaint-id:hover { text-decoration: underline; }
.reporter-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.reporter-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.reporter-meta strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reporter-meta span {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.counterparty-cell {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.counterparty-type {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #8a9aae;
}
.counterparty-value {
  font-size: 13px;
  color: var(--ink);
  word-break: break-all;
  font-variant-numeric: tabular-nums;
}
a.btn-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 96px;
  padding: 9px 16px;
  border-radius: 10px;
  background: linear-gradient(180deg, #3bb8f6 0%, #229ed9 100%);
  color: #fff !important;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(34, 158, 217, 0.35);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}
a.btn-open::after {
  content: "→";
  font-size: 14px;
  opacity: 0.95;
}
a.btn-open:hover {
  filter: brightness(1.03);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(34, 158, 217, 0.42);
}
.complaint-table .empty-row td {
  text-align: center;
  padding: 36px 20px;
  color: var(--muted);
  font-size: 14px;
}
.media-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.58);
}
.media-lightbox-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
}
.media-lightbox-inner {
  position: relative;
  z-index: 1;
  max-width: min(920px, 94vw);
  max-height: 90vh;
  display: grid;
  gap: 12px;
  justify-items: center;
  padding: 44px 16px 16px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.35);
}
.media-lightbox-inner img {
  max-width: 100%;
  max-height: calc(90vh - 120px);
  border-radius: 10px;
  object-fit: contain;
  background: #f4f7fb;
}
.media-lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  padding: 0;
  margin: 0;
  background: #f1f5f9;
  color: #334155;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
}
.media-lightbox-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}
.media-lightbox-inner #lightbox-download {
  justify-self: center;
}
.error { color: #e03131; }
.inline { display: flex; gap: 8px; margin-bottom: 16px; }
.short { width: 72px; }
.status { display: inline-block; padding: 4px 10px; background: var(--blue-soft); color: var(--blue-dark); border-radius: 999px; font-size: 12px; font-weight: 700; }
.scammers-page { display: grid; gap: 16px; }
.scammers-kyc-search {
  padding: 16px 18px;
  display: grid;
  gap: 8px;
}
.scammers-kyc-search-label {
  font-size: 13px;
  font-weight: 700;
  color: #3d4f63;
}
.scammers-kyc-search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.scammers-kyc-search-row input[type="search"] {
  flex: 1 1 220px;
  min-width: 180px;
  max-width: 420px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
}
.scammers-kyc-search-hint {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
.scammer-kyc-cell { max-width: 160px; font-size: 13px; }
.scammer-row-clickable { cursor: pointer; }
.scammer-row-clickable:hover td { background: #f8fbfe; }
.scammers-table-wrap { margin-top: 4px; }
.scammers-table .col-actions { width: 148px; text-align: right; white-space: nowrap; }
.scammer-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.scammer-value {
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 12px;
  background: #f4f7fb;
  padding: 3px 8px;
  border-radius: 6px;
}
.scammer-exchange { background: #e8f2ff; color: #1c5db8; font-weight: 600; }
.scammer-exchange-removed {
  background: #eef1f4;
  color: #6b7c8f;
  font-weight: 600;
  border: 1px solid #d8e0e8;
}
.scammer-link { font-weight: 600; }
.scammer-note-cell { max-width: 220px; color: var(--muted); }
.scammers-empty { text-align: center; color: var(--muted); padding: 28px 12px !important; }
.swal-scammer-meta {
  display: grid;
  gap: 10px;
  text-align: left;
  margin-bottom: 14px;
  padding: 12px 14px;
  background: #f6f9fc;
  border-radius: 10px;
  font-size: 13px;
}
.swal-scammer-meta .swal-k,
.swal-scammer-block .swal-k {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7c8f;
  margin-bottom: 4px;
}
.swal-scammer-links-wrap strong { display: block; font-weight: normal; }
.swal-scammer-links {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.swal-scammer-links li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.swal-scammer-link-ex { font-weight: 700; font-size: 12px; }
.swal-scammer-link-btn {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  color: #1a6fa8;
  background: #fff;
  border: 1px solid #c5d9ea;
}
.swal-scammer-link-btn:hover { background: #eef6fc; }
.swal-scammer-timeline {
  margin: 8px 0 0;
  padding-left: 20px;
  text-align: left;
  display: grid;
  gap: 12px;
}
.swal-timeline-head { font-size: 13px; margin-bottom: 4px; }
.swal-timeline-text { max-height: 96px; margin-top: 4px; }
.swal-timeline-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.4;
}
.swal-timeline-note span { font-weight: 700; color: #3d4f63; }
.swal-timeline-complaint {
  display: inline-block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #1a6fa8;
}
.swal-source-complaint { margin: 14px 0 0; text-align: left; }
.swal-scammer-block { text-align: left; margin-top: 12px; }
.swal-scammer-text {
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  max-height: 120px;
  overflow: auto;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #e8eef4;
  border-radius: 8px;
}
.swal-complaint-link {
  display: inline-block;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--blue, #228be6);
  color: #fff !important;
  font-weight: 600;
  font-size: 13px;
}
.managers-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 1.25rem;
}
.managers-head h2 { margin: 0 0 0.35rem; }
.manager-list { display: flex; flex-direction: column; gap: 12px; }
.manager-empty { margin: 0; color: var(--muted); padding: 1rem 0; }
.manager-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
  box-shadow: 0 4px 16px rgba(31, 51, 71, 0.05);
}
.manager-card.is-inactive { opacity: 0.72; background: #f4f6f9; }
.manager-card-avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--blue-soft), #cfe9f8);
  color: var(--blue-dark);
  font-weight: 700;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.manager-card-body { flex: 1; min-width: 0; }
.manager-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.manager-card-title strong { font-size: 16px; }
.manager-card-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.manager-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eceff3;
  color: var(--muted);
}
.manager-pill.on { background: #e6f7ed; color: #1b7a3d; }
.manager-perm-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.mgr-tag {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  font-weight: 600;
}
.manager-card-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}
body.modal-open { overflow: hidden; }
.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.admin-modal.hidden { display: none; }
.admin-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 28, 42, 0.45);
  backdrop-filter: blur(3px);
}
.admin-modal-panel {
  position: relative;
  width: min(480px, 100%);
  max-height: min(90vh, 720px);
  overflow: auto;
  background: var(--card);
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: 0 24px 64px rgba(15, 28, 42, 0.22);
  padding: 0;
}
.admin-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.admin-modal-head h3 { margin: 0; font-size: 17px; }
.admin-modal-close {
  border: 0;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
}
.admin-modal-close:hover { background: var(--paper); color: var(--ink); }
.manager-modal-form { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 12px; }
.manager-perms-fieldset { border: 0; margin: 0; padding: 0; }
.manager-perms-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin-top: 6px;
}
.manager-active-check { margin-top: 4px; }
.admin-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
@media (max-width: 980px) {
  body { display: block; }
  aside { width: auto; flex-direction: row; flex-wrap: wrap; }
  .workspace, .complaint-page { flex-direction: column; }
  .chat-panel { width: auto; flex: 1; max-height: none; }
  main { padding: 16px; }
  .crm-shell { flex-direction: column; height: auto; min-height: 70vh; }
  .crm-sidebar { width: auto; flex: 0 0 auto; max-height: 240px; border-right: 0; border-bottom: 1px solid var(--line); }
}

body.pro-portal-page {
  display: block;
}
body.pro-portal-page .pro-portal-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}
.pro-portal-account {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--muted);
}
.pro-portal-account strong {
  color: var(--ink);
}
.pro-portal-denied {
  max-width: 520px;
  padding-top: 48px;
}
.pro-portal-denied h1 {
  font-size: 22px;
  margin: 0 0 12px;
}
.pro-portal-denied p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}
.pro-portal-head .complaints-sub { display: none; }
.pro-portal-tabs {
  flex-wrap: wrap;
  gap: 8px;
}
.pro-portal-toolbar {
  margin: 16px 0 14px;
  background: linear-gradient(165deg, #f7fafc 0%, #fff 55%);
  border: 1px solid #dce5ee;
  border-radius: 16px;
  box-shadow: 0 4px 18px rgba(27, 42, 58, 0.06);
}
.pro-portal-toolbar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px 20px;
  padding: 16px 18px;
}
.pro-portal-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: 12px 14px;
  flex: 1 1 320px;
  max-width: 920px;
}
.pro-filter-kyc {
  grid-column: span 2;
  min-width: 0;
}
.pro-filter-kyc-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d4dde8;
  border-radius: 10px;
  font: inherit;
  background: #fff;
}
.pro-kyc-search-btn {
  align-self: end;
  justify-self: start;
  height: 42px;
}
.pro-portal-filters > .btn.ghost.sm {
  align-self: end;
  height: 42px;
}
.pro-filter {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}
.pro-filter-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7c8f;
}
.pro-filter-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: #e8f0f7;
  color: #3d6d8f;
  font-size: 10px;
  line-height: 1;
}
.pro-filter-sort .pro-filter-icon {
  background: #e6f4f1;
  color: #1a8a7a;
}
.pro-filter-select {
  width: 100%;
  padding: 10px 36px 10px 12px;
  border: 1px solid #cfd9e4;
  border-radius: 11px;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7c8f' d='M3 4.5 6 7.5 9 4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  appearance: none;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-shadow: inset 0 1px 2px rgba(27, 42, 58, 0.04);
}
.pro-filter-select:hover {
  border-color: #b8c9d9;
}
.pro-filter-select:focus {
  outline: none;
  border-color: var(--accent, #1a8a7a);
  box-shadow: 0 0 0 3px rgba(26, 138, 122, 0.18);
}
.pro-portal-summary {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 500;
  color: #4a5d70;
  background: #eef3f8;
  border: 1px solid #dde6ef;
  border-radius: 999px;
  white-space: nowrap;
}
.pro-summary-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent, #1a8a7a);
  flex-shrink: 0;
}
@media (max-width: 860px) {
  .pro-portal-toolbar {
    margin: 10px 0 8px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(27, 42, 58, 0.05);
  }
  .pro-portal-toolbar-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 12px;
  }
  .pro-portal-filters {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: none;
  }
  .pro-filter {
    gap: 4px;
  }
  .pro-filter-label {
    font-size: 10px;
    gap: 5px;
    letter-spacing: 0.03em;
  }
  .pro-filter-icon {
    width: 15px;
    height: 15px;
    border-radius: 5px;
    font-size: 9px;
  }
  .pro-filter-select {
    padding: 7px 30px 7px 10px;
    font-size: 13px;
    border-radius: 9px;
    background-position: right 10px center;
  }
  .pro-portal-summary {
    justify-content: center;
    align-self: center;
    padding: 6px 11px;
    font-size: 12px;
    gap: 6px;
  }
  .pro-summary-dot {
    width: 6px;
    height: 6px;
  }
}
.pro-portal-table-desktop .th-sortable a {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.pro-portal-table-desktop .th-sortable a:hover {
  color: var(--accent);
}
.pro-portal-table-desktop .th-sortable.sorted a::after {
  content: "";
  border: 4px solid transparent;
  margin-top: 2px;
}
.pro-portal-table-desktop .th-sortable.sorted-desc a::after {
  border-top-color: var(--accent);
}
.pro-portal-table-desktop .th-sortable.sorted-asc a::after {
  border-bottom-color: var(--accent);
  margin-top: -2px;
}
.pro-portal-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 16px;
  margin-top: 20px;
}
.pro-pager-meta {
  font-size: 14px;
  color: var(--muted);
}
.pro-portal-pager .btn.disabled {
  opacity: 0.45;
  pointer-events: none;
}
.copy-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  max-width: 100%;
}
.copy-chip-muted {
  border: none;
  background: transparent;
  color: #8a97a8;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  padding: 0;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  flex-shrink: 0;
}
.copy-chip-muted:hover {
  color: var(--ink);
  background: #eef3f8;
}
.pro-portal-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 148px;
}
.pro-portal-actions .btn { width: 100%; justify-content: center; }
.pro-portal-cards { display: none; }
.pro-scammer-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 14px 12px;
  margin-bottom: 12px;
  box-shadow: 0 1px 0 rgba(27, 42, 58, 0.04);
}
.pro-card-row {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 8px 10px;
  align-items: start;
  padding: 6px 0;
  border-bottom: 1px solid #eef3f8;
}
.pro-card-row:last-of-type { border-bottom: 0; }
.pro-card-k {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}
.pro-card-v { min-width: 0; word-break: break-word; }
.pro-card-note { white-space: pre-wrap; }
.pro-scammer-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}
.pro-scammer-card-actions-single {
  grid-template-columns: 1fr;
}
.pro-scammer-card-actions .btn { width: 100%; justify-content: center; }
.copy-toast {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  background: #1f3347;
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  z-index: 9999;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
.swal-copy-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: start;
}
.swal-copy-row .swal-k { grid-column: 1 / -1; }
.swal-copy-val { word-break: break-all; }
.swal-copy-val code { font-size: 13px; }
@media (max-width: 860px) {
  body.pro-portal-page .pro-portal-shell { padding: 16px 12px 32px; }
  .pro-portal-table-desktop { display: none; }
  .pro-portal-cards { display: block; }
  .pro-portal-table-wrap { overflow: visible; }
  .users-subnav.pro-portal-tabs a {
    flex: 1 1 auto;
    text-align: center;
    min-width: calc(50% - 4px);
  }
}
@media (max-width: 420px) {
  .pro-scammer-card-actions { grid-template-columns: 1fr; }
}
.scammer-taxonomy-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.scammer-taxonomy-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  background: var(--surface);
}
.scammer-taxonomy-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 0.75rem;
}
.card.nested {
  background: var(--surface-muted, #f8fafc);
  border: 1px dashed var(--line);
  box-shadow: none;
}
