@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@500;600;700&display=swap');

:root {
  --bg-canvas: #f4f6f9;
  --bg-shell: #ffffff;
  --bg-soft: #f7f8fb;
  --bg-glass: rgba(255, 255, 255, 0.82);

  --text-strong: #111827;
  --text-main: #1f2937;
  --text-muted: #667085;

  --accent: #0b78f2;
  --accent-strong: #045ec0;
  --accent-soft: #e8f2ff;

  --success-bg: #e9f9ef;
  --success-text: #116733;
  --danger-bg: #fdecec;
  --danger-text: #9b1c1c;

  --border-soft: #e6e8ee;
  --border-strong: #d8dde8;

  --shadow-soft: 0 10px 30px rgba(17, 24, 39, 0.05);
  --shadow-card: 0 20px 55px rgba(17, 24, 39, 0.08);

  --radius-s: 10px;
  --radius-m: 14px;
  --radius-l: 20px;
  --radius-xl: 28px;

  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 20px;
  --space-5: 24px;
  --space-6: 32px;

  --transition-fast: 0.18s ease;
  --transition-base: 0.28s ease;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: 'Manrope', sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(1000px 420px at -10% -12%, #d5e8ff 0%, transparent 56%),
    radial-gradient(760px 420px at 120% 8%, #f8f1dc 0%, transparent 52%),
    var(--bg-canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: 'Plus Jakarta Sans', sans-serif;
  letter-spacing: -0.02em;
  color: var(--text-strong);
}

p {
  margin: 0;
}

.admin-shell {
  padding: var(--space-5);
}

.layout {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  gap: var(--space-4);
  min-height: calc(100vh - (var(--space-5) * 2));
}

.sidebar {
  position: sticky;
  top: var(--space-5);
  align-self: start;
  max-height: calc(100vh - (var(--space-5) * 2));
  overflow-y: auto;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  padding: var(--space-5) var(--space-4);
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: var(--space-5);
}

.brand-badge {
  width: fit-content;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
}

.brand-title {
  font-size: 26px;
  line-height: 1.1;
}

.brand-subtitle {
  color: var(--text-muted);
  font-size: 13px;
}

.menu {
  display: grid;
  gap: var(--space-1);
}

.menu-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  border-radius: var(--radius-m);
  padding: 11px 12px;
  color: #334155;
  font-weight: 600;
  transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.menu-link::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d3d9e4;
  transition: transform var(--transition-fast), background var(--transition-fast);
}

.menu-link:hover {
  background: #f5f7fc;
  color: var(--text-strong);
  transform: translateX(2px);
}

.menu-link.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.menu-link.active::before {
  background: var(--accent);
  transform: scale(1.15);
}

.sidebar-footer {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-soft);
}

.main {
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: var(--bg-glass);
  border: 1px solid rgba(214, 218, 229, 0.7);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px);
}

.topbar-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 22px;
  color: var(--text-strong);
}

.topbar-meta {
  font-size: 13px;
  color: var(--text-muted);
}

.nav-toggle {
  display: none;
}

.page-header {
  margin-bottom: var(--space-4);
  animation: riseIn 0.38s ease both;
}

.page-title {
  font-size: clamp(26px, 3.2vw, 40px);
  line-height: 1.1;
}

.page-subtitle {
  margin-top: 8px;
  color: var(--text-muted);
}

.content {
  display: grid;
  gap: var(--space-4);
}

.card {
  background: var(--bg-shell);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-l);
  padding: var(--space-5);
  box-shadow: var(--shadow-soft);
  animation: riseIn 0.46s ease both;
}

.card-soft {
  background: linear-gradient(180deg, #ffffff 0%, #fafbff 100%);
}

.card-title {
  font-size: 20px;
}

.card-subtitle {
  margin-top: 6px;
  font-size: 14px;
  color: var(--text-muted);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.row {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.grid-2 {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}

.stat {
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-l);
  padding: var(--space-4);
  box-shadow: var(--shadow-soft);
  animation: riseIn 0.52s ease both;
}

.stat-label {
  font-size: 14px;
  color: var(--text-muted);
}

.stat-value {
  margin-top: 10px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(26px, 3vw, 34px);
  color: var(--text-strong);
  line-height: 1;
}

.tiny {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--space-3);
}

.kpi {
  grid-column: span 2;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-l);
  padding: var(--space-4);
  box-shadow: var(--shadow-soft);
  animation: riseIn 0.48s ease both;
}

.kpi-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.kpi-label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7b8495;
  font-weight: 800;
}

.kpi-value {
  margin-top: 10px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(22px, 2.8vw, 32px);
  line-height: 1.05;
  color: var(--text-strong);
}

.kpi-sub,
.kpi-meta {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 650;
}

.kpi-meta {
  margin-top: 0;
  font-size: 12px;
  white-space: nowrap;
}

.gauge {
  margin-top: 14px;
  height: 10px;
  border-radius: 999px;
  background: #eef2fb;
  border: 1px solid rgba(214, 218, 229, 0.85);
  overflow: hidden;
}

.gauge>i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(11, 120, 242, 0.95), rgba(0, 214, 180, 0.9));
  transition: width var(--transition-base);
}

.window-tiles {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--space-2);
}

.tile {
  border: 1px solid var(--border-soft);
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
  border-radius: var(--radius-m);
  padding: 12px 12px;
  box-shadow: 0 12px 30px rgba(17, 24, 39, 0.05);
}

.tile-k {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tile-v {
  margin-top: 10px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 18px;
  color: var(--text-strong);
  font-weight: 800;
}

.split-list {
  display: grid;
  gap: var(--space-2);
}

.split-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-2);
  padding: 10px 12px;
  border-radius: var(--radius-m);
  border: 1px solid var(--border-soft);
  background: #fff;
}

.split-k {
  font-weight: 750;
  color: var(--text-strong);
}

.progress {
  margin-top: 8px;
  height: 8px;
  border-radius: 999px;
  background: #eef2fb;
  overflow: hidden;
  border: 1px solid rgba(214, 218, 229, 0.75);
}

.progress>i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(11, 120, 242, 0.85), rgba(11, 120, 242, 0.25));
}

.muted {
  color: var(--text-muted);
}

form {
  margin: 0;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 700;
}

input,
textarea,
select,
button,
.button {
  font: inherit;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-m);
  padding: 11px 13px;
  background: #fff;
  color: var(--text-main);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #85b8ff;
  box-shadow: 0 0 0 4px rgba(11, 120, 242, 0.14);
  background: #fff;
}

input:disabled,
textarea:disabled,
select:disabled {
  background: #f4f6fb;
  color: #8a95a7;
}

textarea {
  resize: vertical;
  min-height: 84px;
}

.btn,
button,
.button {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.btn:hover,
button:hover,
.button:hover {
  transform: translateY(-1px);
}

.btn:active,
button:active,
.button:active {
  transform: translateY(0);
}

.btn-primary,
button,
button.primary {
  background: linear-gradient(180deg, #1785f7 0%, #0b78f2 100%);
  color: #fff;
  box-shadow: 0 12px 22px rgba(11, 120, 242, 0.22);
}

.btn-primary:hover,
button:hover,
button.primary:hover {
  box-shadow: 0 14px 26px rgba(11, 120, 242, 0.28);
}

.btn-secondary,
button.secondary,
.button.secondary {
  background: #fff;
  border-color: var(--border-strong);
  color: #344054;
  box-shadow: none;
}

.btn-secondary:hover,
button.secondary:hover,
.button.secondary:hover {
  background: #f5f7fc;
  box-shadow: none;
}

.btn-danger,
button.danger,
.button.danger {
  background: #fff;
  border-color: #f5c5c5;
  color: #b42318;
  box-shadow: none;
}

.btn-danger:hover,
button.danger:hover,
.button.danger:hover {
  background: #fff2f1;
}

.btn-ghost,
button.ghost,
.button.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
  box-shadow: none;
}

.form-row {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--success-text);
  background: var(--success-bg);
}

.chip::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
}

.chip.banned {
  background: var(--danger-bg);
  color: var(--danger-text);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-m);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  text-align: left;
  padding: 13px 12px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
  font-size: 14px;
}

th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #7b8495;
  font-weight: 700;
  background: #fafbff;
}

tr:last-child td {
  border-bottom: none;
}

.actions-col {
  display: grid;
  gap: var(--space-2);
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.user-name {
  font-weight: 700;
  color: var(--text-strong);
}

.user-live {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(214, 218, 229, 0.85);
  background: #fbfcff;
  box-shadow: 0 10px 22px rgba(17, 24, 39, 0.04);
  font-size: 12px;
}

.pill-k {
  color: var(--text-muted);
  font-weight: 800;
  letter-spacing: 0.02em;
}

.pill-v {
  color: var(--text-strong);
  font-weight: 900;
}

.pill-u {
  color: #7b8495;
  font-weight: 800;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-bottom: var(--space-3);
}

.filter-btn {
  padding: 8px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border-strong);
  color: #45556d;
  font-size: 13px;
  font-weight: 700;
  box-shadow: none;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.filter-btn:hover {
  background: #f5f7fc;
  color: var(--text-strong);
  transform: translateY(-1px);
}

.filter-btn.is-active {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: #b9d8ff;
}

.table-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.table-tools input[type="search"] {
  max-width: 420px;
}

.small {
  font-size: 12px;
}

.range-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.range-btn {
  padding: 8px 13px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border-strong);
  color: #45556d;
  box-shadow: none;
}

.range-btn.is-active {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: #b9d8ff;
}

.chart-wrap {
  position: relative;
}

.chart {
  width: 100%;
  min-height: 220px;
}

.chart-compact .chart {
  min-height: 180px;
}

.range-group-tight {
  margin-top: -6px;
}

.mini-charts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}

.mini-chart {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-l);
  padding: var(--space-4);
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
  box-shadow: var(--shadow-soft);
}

.mini-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: 10px;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: var(--space-3);
}

.thread-list {
  padding: 0;
  overflow: hidden;
}

.thread-list-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-soft);
  font-weight: 700;
  color: var(--text-strong);
}

.thread-scroll {
  max-height: 72vh;
  overflow-y: auto;
}

.thread-item {
  display: block;
  padding: 12px 16px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--border-soft);
  transition: background var(--transition-fast);
}

.thread-item:hover {
  background: #f7f9ff;
}

.thread-item.active {
  background: var(--accent-soft);
}

.thread-name {
  font-weight: 700;
  color: var(--text-strong);
}

.thread-preview {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thread-time {
  margin-top: 4px;
  font-size: 12px;
  color: #8d96a8;
}

.thread-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: linear-gradient(180deg, #f04438 0%, #d92d21 100%);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(240, 68, 56, 0.35);
}

.sidebar-badge {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: linear-gradient(180deg, #f04438 0%, #d92d21 100%);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  margin-left: 6px;
  box-shadow: 0 2px 6px rgba(240, 68, 56, 0.3);
  vertical-align: middle;
}

.thread-item--unread {
  background: #f0f5ff;
}

.thread-item--unread .thread-name {
  font-weight: 900;
  color: var(--text-strong);
}

.thread-item--unread .thread-preview {
  color: var(--text-strong);
  font-weight: 600;
}

.thread-search-wrap {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-soft);
}

.thread-search {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-m);
  padding: 8px 11px;
  font-size: 13px;
  background: #fff;
}

.thread-load-more {
  display: block;
  text-align: center;
  padding: 14px 16px;
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  border-top: 1px solid var(--border-soft);
  transition: background var(--transition-fast);
}

.thread-load-more:hover {
  background: #f7f9ff;
}

.chat-wrap {
  display: flex;
  flex-direction: column;
  min-height: 72vh;
}

.chat-head {
  border-bottom: 1px solid var(--border-soft);
  padding-bottom: var(--space-3);
  margin-bottom: var(--space-3);
}

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
  margin-bottom: var(--space-3);
}

.bubble {
  max-width: min(74%, 660px);
  border-radius: 16px;
  padding: 11px 13px;
  margin-bottom: 8px;
  white-space: pre-wrap;
  line-height: 1.4;
  animation: fadeIn 0.26s ease both;
}

.bubble.in {
  background: #f2f4f8;
  border: 1px solid #e3e7ee;
}

.bubble.out {
  margin-left: auto;
  color: #fff;
  background: linear-gradient(180deg, #2d97ff 0%, #0b78f2 100%);
  box-shadow: 0 14px 24px rgba(11, 120, 242, 0.24);
}

.bubble-meta {
  font-size: 11px;
  margin-top: 6px;
  opacity: 0.8;
}

.empty {
  padding: var(--space-4);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-m);
  color: var(--text-muted);
  background: #fcfdff;
}

.login-page {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: var(--space-5);
}

.login-panel {
  width: min(460px, 100%);
  background: var(--bg-glass);
  border: 1px solid rgba(214, 218, 229, 0.75);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(8px);
  padding: var(--space-6) var(--space-5);
  animation: riseIn 0.52s ease both;
}

.login-panel h1 {
  font-size: 34px;
}

.login-subtitle {
  margin-top: 8px;
  margin-bottom: var(--space-5);
  color: var(--text-muted);
}

.error {
  margin-bottom: var(--space-3);
  border-radius: var(--radius-m);
  border: 1px solid #f6c7c7;
  background: #fff2f2;
  color: #b42318;
  padding: 10px 12px;
}

.login-form {
  display: grid;
  gap: var(--space-3);
}

.login-form button {
  width: 100%;
  margin-top: var(--space-1);
}

.compact-form {
  max-width: 520px;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@media (max-width: 1200px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi {
    grid-column: span 1;
  }

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

  .mini-charts {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 980px) {
  .admin-shell {
    padding: var(--space-3);
  }

  .layout {
    grid-template-columns: 1fr;
    gap: var(--space-3);
    min-height: auto;
  }

  .sidebar {
    position: relative;
    top: auto;
    max-height: none;
    display: none;
  }

  .sidebar.open {
    display: block;
  }

  .topbar {
    padding: var(--space-3);
  }

  .topbar-left {
    display: flex;
    align-items: center;
    gap: var(--space-2);
  }

  .nav-toggle {
    display: inline-flex;
    border-radius: 999px;
    border: 1px solid var(--border-strong);
    background: #fff;
    color: #334155;
    padding: 8px 12px;
    box-shadow: none;
  }

  .split-layout,
  .grid-2,
  .grid-3,
  .stat-grid,
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .window-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card {
    padding: var(--space-4);
  }

  .bubble {
    max-width: 92%;
  }
}

/* ── Прогресс-бар рассылки ── */
.broadcast-progress {
  margin-top: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-m);
  border: 1px solid var(--border-soft);
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  box-shadow: var(--shadow-soft);
  animation: riseIn 0.38s ease both;
}

.broadcast-progress-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: var(--space-2);
}

.broadcast-status-icon {
  font-size: 20px;
  line-height: 1;
}

.broadcast-status-icon.sending {
  animation: pulse-icon 1.2s ease-in-out infinite;
}

.broadcast-status-text {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-strong);
}

.broadcast-progress-track {
  height: 14px;
  border-radius: 999px;
  background: #eef2fb;
  border: 1px solid rgba(214, 218, 229, 0.85);
  overflow: hidden;
}

.broadcast-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1785f7 0%, #00d6b4 100%);
  transition: width 0.5s ease;
  position: relative;
}

.broadcast-progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
      transparent 0%,
      rgba(255, 255, 255, 0.3) 50%,
      transparent 100%);
  animation: shimmer 1.8s infinite;
}

.broadcast-progress-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.broadcast-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.broadcast-percent {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: var(--accent);
}

@keyframes pulse-icon {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.6;
    transform: scale(1.15);
  }
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(200%);
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ------------- REALTIME CHAT REDESIGN ------------- */
.chat-modern {
  display: flex;
  gap: var(--space-4);
  position: relative;
  height: calc(100vh - 250px);
  min-height: 400px;
  overflow: hidden;
  padding: 0 !important;
}

.chat-modern .thread-list {
  flex: 0 0 320px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.thread-list-head {
  padding: var(--space-4);
  font-weight: 700;
  font-size: 18px;
  border-bottom: 1px solid var(--border-soft);
  background: #fafbff;
}

.thread-search-wrap {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-soft);
}

.thread-scroll {
  flex: 1;
  overflow-y: auto;
}

.thread-item {
  display: block;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid transparent;
  text-decoration: none;
  transition: background var(--transition-fast);
}

.thread-item:hover {
  background: #f5f7fc;
}

.thread-item.active {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
}

.thread-name-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.thread-name {
  font-weight: 700;
  color: var(--text-strong);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-preview {
  font-size: 13px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unread-badge {
  background: #e94e4e;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
}

.chat-modern .chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0;
  position: relative;
  overflow: hidden;
}

.chat-head-modern {
  padding: var(--space-3) var(--space-4);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-soft);
  background: #fff;
  z-index: 2;
  box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.chat-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.chat-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0b78f2, #1785f7);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
}

.chat-user-meta .name {
  font-weight: 700;
  color: var(--text-strong);
  font-size: 16px;
}

.chat-user-meta .status {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.chat-user-meta .status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ccc;
}
.chat-user-meta .status.active-status::before {
  background: #116733;
}
.chat-user-meta .status.banned-status::before {
  background: #e94e4e;
}

.info-toggle-btn {
  background: #f4f6f9;
  border: 1px solid var(--border-soft);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: var(--radius-m);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.info-toggle-btn:hover {
  background: #e6e8ee;
}

.chat-body-modern {
  flex: 1;
  padding: var(--space-4);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #fafbff;
}

.bubble {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.45;
  position: relative;
  word-wrap: break-word;
  animation: riseIn 0.2s ease;
}

.bubble.in {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--border-soft);
  color: var(--text-main);
  border-bottom-left-radius: 4px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}

.bubble.out {
  align-self: flex-end;
  background: linear-gradient(135deg, #0b78f2, #1785f7);
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 15px rgba(11, 120, 242, 0.2);
}

.bubble-meta {
  font-size: 11px;
  margin-top: 6px;
  opacity: 0.6;
  text-align: right;
  display: block;
}
.bubble.in .bubble-meta {
  color: var(--text-muted);
}
.bubble.out .bubble-meta {
  color: #fff;
}

.chat-input-modern {
  padding: var(--space-3) var(--space-4);
  background: #fff;
  border-top: 1px solid var(--border-soft);
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.chat-input-modern textarea {
  flex: 1;
  resize: none;
  min-height: 50px;
  max-height: 150px;
  border-radius: var(--radius-m);
  padding: 12px;
  border: 1px solid var(--border-strong);
  font-family: inherit;
}

.chat-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-send {
  background: linear-gradient(135deg, #0b78f2, #1785f7);
  color: #fff;
  border: none;
  border-radius: var(--radius-m);
  padding: 12px 20px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 15px rgba(11, 120, 242, 0.2);
}
.btn-send:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(11, 120, 242, 0.3);
}

/* User Info Panel Slider */
.user-info-slider {
  position: absolute;
  top: 0;
  right: -360px;
  width: 340px;
  height: 100%;
  background: var(--bg-shell);
  border-left: 1px solid var(--border-soft);
  box-shadow: -10px 0 30px rgba(0,0,0,0.05);
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10;
  display: flex;
  flex-direction: column;
}

.user-info-slider.open {
  right: 0;
}

.slider-head {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fafbff;
}

.slider-title {
  font-weight: 700;
  font-size: 16px;
}

.slider-close {
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
}
.slider-close:hover {
  color: var(--text-strong);
}

.slider-body {
  padding: var(--space-4);
  overflow-y: auto;
  flex: 1;
}

.profile-card {
  text-align: center;
  margin-bottom: var(--space-5);
}
.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e8f2ff, #d1e5ff);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 800;
  margin: 0 auto 16px;
}
.profile-name {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-strong);
}
.profile-id {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
}

.info-block {
  background: #fafbff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-m);
  padding: var(--space-3);
  margin-bottom: var(--space-3);
}
.info-block-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  color: #7b8495;
  margin-bottom: 8px;
  letter-spacing: 0.04em;
}
.info-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid #f0f2f7;
  font-size: 14px;
}
.info-row:last-child {
  border-bottom: none;
}
.info-k {
  color: var(--text-muted);
  font-weight: 600;
}
.info-v {
  font-weight: 700;
  color: var(--text-strong);
}

.empty-chat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  text-align: center;
}
.empty-chat-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}