/* =========================================================================
   Leadgid CPA Broadcaster — design tokens
   ========================================================================= */
:root {
  /* brand */
  --brand-500: #3B7BFB;
  --brand-600: #1E5EE6;
  --brand-gradient: linear-gradient(135deg, #3B7BFB 0%, #1E5EE6 100%);

  /* ink (text + dark surfaces) */
  --ink-900: #1A1A2E;
  --ink-700: #2B2D3A;
  --ink-500: #6B7280;
  --ink-300: #9CA3AF;

  /* surfaces */
  --surface: #FFFFFF;
  --surface-alt: #F5F7FA;
  --surface-blue: #EEF2FB;

  /* borders */
  --border: #E5E7EB;
  --border-soft: #F0F0F0;

  /* status */
  --success-500: #22C55E;
  --success-50:  #DCFCE7;
  --success-700: #15803D;
  --warn-500: #F59E0B;
  --warn-50:  #FEF3C7;
  --warn-700: #B45309;
  --danger-500: #EF4444;
  --danger-50:  #FEE2E2;
  --danger-700: #B91C1C;
  --info-50:    #DBEAFE;

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

  /* radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  /* shadows */
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.06);

  /* font */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter",
               "Helvetica Neue", Arial, sans-serif;
}

/* =========================================================================
   Reset
   ========================================================================= */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--ink-900);
  background: var(--surface-alt);
  line-height: 1.45;
}
a { color: var(--brand-500); text-decoration: none; }
a:hover { color: var(--brand-600); text-decoration: underline; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
hr { border: none; border-top: 1px solid var(--border); margin: var(--space-4) 0; }

/* =========================================================================
   Typography utility classes
   ========================================================================= */
.t-h1 { font-size: 24px; font-weight: 800; margin: 0; }
.t-h2 { font-size: 18px; font-weight: 700; margin: 0; }
.t-h3 { font-size: 14px; font-weight: 700; margin: 0; }
.t-body { font-size: 13px; font-weight: 400; margin: 0; }
.t-meta { font-size: 11px; font-weight: 400; color: var(--ink-500); margin: 0; }
.t-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--ink-500);
  margin: 0;
}
.t-number { font-size: 32px; font-weight: 800; line-height: 1.1; margin: 0; }
.t-number--md { font-size: 20px; font-weight: 800; line-height: 1.1; margin: 0; }

/* =========================================================================
   Layout — app-shell with sidebar
   ========================================================================= */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 245px;
  flex: 0 0 245px;
  background: var(--ink-900);
  color: #fff;
  padding: var(--space-4) var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar__brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: var(--space-2) var(--space-3);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  text-decoration: none;
  color: #fff;
  transition: opacity 0.15s ease;
}
.sidebar__brand:hover { opacity: 0.85; text-decoration: none; color: #fff; }
.sidebar__logo { height: 18px; width: auto; display: block; }
.sidebar__sep { color: #00B5E7; font-size: 15px; line-height: 1; }
.sidebar__product { color: #00B5E7; }

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.sidebar__section { border: none; padding: 0; margin: 0; }
.sidebar__section > summary {
  list-style: none;
  cursor: pointer;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-300);
  padding: 12px 16px 6px;
  text-align: center;
  user-select: none;
}
.sidebar__section > summary::-webkit-details-marker { display: none; }
.sidebar__section > summary:hover { color: #fff; }
.sidebar__section[open] > summary { color: #cfd2d6; }

.sidebar__item {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--ink-300);
  font-size: 13px;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.sidebar__item:hover {
  background: var(--ink-700);
  color: #fff;
  text-decoration: none;
}
.sidebar__item.is-active {
  background: var(--brand-500);
  color: #fff;
  font-weight: 600;
}
.sidebar__item--cta {
  margin-top: var(--space-2);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  color: #fff;
}
/* Одиночный пункт (модуль без подразделов) — рендерится как «заголовок секции»,
   чтобы по типографике встать в ряд с TELEGRAM-КАМПАНИИ / EMAIL-КАМПАНИИ.
   Без фона на hover/active — только смена цвета текста, как у summary-заголовков. */
.sidebar__item--solo {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 12px 16px 6px;
}
.sidebar__item--solo:hover,
.sidebar__item--solo.is-active {
  background: transparent;
  color: #fff;
  font-weight: normal;
}
.sidebar__item .badge {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
}

.sidebar__spacer { flex: 1; }

.sidebar__tg-status {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--ink-700);
  padding: 12px;
  border-radius: 12px;
  color: #fff;
  text-decoration: none;
}
.sidebar__tg-status:hover { text-decoration: none; }
.sidebar__tg-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 8px;
}
.sidebar__tg-status.is-connected .sidebar__tg-dot { background: var(--success-500); }
.sidebar__tg-status.is-disconnected .sidebar__tg-dot { background: var(--ink-300); }
.sidebar__tg-meta { min-width: 0; }
.sidebar__tg-name { font-size: 13px; font-weight: 600; }
.sidebar__tg-status .t-label,
.sidebar__tg-status .t-meta { color: rgba(255, 255, 255, 0.6); }

.sidebar__user {
  border-top: 1px solid var(--ink-700);
  padding-top: var(--space-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
.sidebar__user-email {
  color: rgba(255, 255, 255, 0.7);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar__user-logout { margin: 0; }

.main {
  flex: 1;
  padding: var(--space-6);
  background: var(--surface-alt);
  min-width: 0;
}
.container {
  max-width: 1280px;
  margin: 0 auto;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}
.page-header__left { display: flex; flex-direction: column; gap: var(--space-1); }
.page-header__right { display: flex; gap: var(--space-2); align-items: center; }
.crumb {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-500);
}
.crumb a { color: var(--ink-500); }
.crumb a:hover { color: var(--brand-500); }

/* =========================================================================
   Auth layout — centered card
   ========================================================================= */
.auth-body {
  background: var(--surface-alt);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.auth-shell {
  width: 100%;
  max-width: 420px;
  margin: 80px auto;
  padding: 0 var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
.auth-shell__brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-900);
  transition: opacity 0.15s ease;
}
.auth-shell__brand:hover { opacity: 0.8; text-decoration: none; color: var(--ink-900); }
.auth-shell__logo { height: 20px; width: auto; display: block; }
.auth-shell__sep { color: #00B5E7; font-size: 16px; line-height: 1; }
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* =========================================================================
   Responsive — collapse sidebar under 1024px
   ========================================================================= */
@media (max-width: 1024px) {
  .app-shell { flex-direction: column; }
  .sidebar {
    width: 100%;
    flex: 0 0 auto;
    flex-direction: row;
    flex-wrap: wrap;
    position: static;
    height: auto;
    overflow-y: visible;
  }
  .sidebar__spacer { display: none; }
  .sidebar__nav { flex-direction: row; flex-wrap: wrap; }
}

/* =========================================================================
   Cards
   ========================================================================= */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
}
.card--dark {
  background: var(--ink-700);
  color: #fff;
  border: none;
}
.card--dark .t-label,
.card--dark .t-meta { color: rgba(255, 255, 255, 0.7); }

.card--hero {
  background: var(--brand-gradient);
  color: #fff;
  border: none;
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-md);
}
.card--hero .t-label,
.card--hero .t-meta { color: rgba(255, 255, 255, 0.8); }

.card--info {
  background: var(--surface-blue);
  border: 1px solid #C7D7F5;
  color: var(--brand-600);
}

.card__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--ink-500);
}
.card--dark .card__label,
.card--hero .card__label { color: rgba(255, 255, 255, 0.7); }
.card__number {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.1;
  margin-top: var(--space-2);
}
.card__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-3);
}
.card__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4);
}

/* =========================================================================
   Buttons
   ========================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease,
              box-shadow 0.15s ease, transform 0.05s ease;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
}
.btn:active:not(:disabled) {
  transform: translateY(1px);
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

.btn-primary {
  background: var(--brand-500);
  color: #fff;
  box-shadow: 0 2px 6px rgba(30, 94, 230, 0.28), inset 0 -1px 0 rgba(0, 0, 0, 0.08);
}
.btn-primary:hover {
  background: var(--brand-600);
  color: #fff;
  box-shadow: 0 4px 12px rgba(30, 94, 230, 0.35), inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}
.btn-primary:active:not(:disabled) {
  box-shadow: 0 1px 2px rgba(30, 94, 230, 0.25), inset 0 1px 2px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink-900);
  border-color: var(--border);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}
.btn-secondary:hover {
  background: var(--surface-alt);
  color: var(--ink-900);
  box-shadow: 0 2px 6px rgba(16, 24, 40, 0.08);
}
.btn-secondary:active:not(:disabled) {
  box-shadow: inset 0 1px 2px rgba(16, 24, 40, 0.08);
}

.btn-danger {
  background: var(--danger-50);
  color: var(--danger-700);
  border-color: #FECACA;
  box-shadow: 0 1px 2px rgba(185, 28, 28, 0.1);
}
.btn-danger:hover {
  background: #FECACA;
  color: var(--danger-700);
  box-shadow: 0 2px 6px rgba(185, 28, 28, 0.18);
}
.btn-danger:active:not(:disabled) {
  box-shadow: inset 0 1px 2px rgba(185, 28, 28, 0.15);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-500);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--surface-alt); color: var(--ink-900); }
.btn-ghost--dark {
  color: rgba(255, 255, 255, 0.6);
}
.btn-ghost--dark:hover { background: var(--ink-900); color: #fff; }

.btn-sm { padding: 4px 10px; font-size: 11px; border-radius: 8px; }

/* =========================================================================
   Chips (status pills)
   ========================================================================= */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
}
.chip__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.chip--success { background: var(--success-50); color: var(--success-700); }
.chip--warn    { background: var(--warn-50);    color: var(--warn-700); }
.chip--danger  { background: var(--danger-50);  color: var(--danger-700); }
.chip--info    { background: var(--info-50);    color: var(--brand-600); }
.chip--muted   { background: var(--surface-alt); color: var(--ink-500); }
.chip--brand   { background: rgba(59, 123, 251, 0.1); color: var(--brand-600); }

.chip--pulse .chip__dot {
  animation: chip-pulse 1.2s ease-in-out infinite;
}
@keyframes chip-pulse {
  0%, 100% { opacity: 1;   transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(1.25); }
}
@media (prefers-reduced-motion: reduce) {
  .chip--pulse .chip__dot { animation: none; }
}

/* =========================================================================
   Forms
   ========================================================================= */
.input, .select, .textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.4;
  background: var(--surface);
  color: var(--ink-900);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}
.input, .select:not([multiple]) {
  height: 36px;
}
.select:not([multiple]) {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px 12px;
}
.input:focus, .select:focus, .textarea:focus,
.input:focus-visible, .select:focus-visible, .textarea:focus-visible {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(59, 123, 251, 0.12);
}
.textarea { resize: vertical; min-height: 120px; font-family: inherit; }

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.field__label {
  font-size: 11px;
  font-weight: 400;
  color: var(--ink-500);
}
.field__hint {
  font-size: 11px;
  color: var(--ink-500);
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: end;
}
.form-row .field { flex: 1 1 180px; min-width: 0; }

.form-row--grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-2);
  align-items: end;
}
.form-row--grid > * { min-width: 0; }
.form-row--grid .input,
.form-row--grid .select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
@media (max-width: 900px) {
  .form-row--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .form-row--grid { grid-template-columns: 1fr; }
}

/* Tag picker / select picker (shared visual style) */
.tag-picker-row {
  display: flex;
  align-items: stretch;
  gap: 6px;
  min-width: 0;
}
.tag-picker,
.select-picker {
  position: relative;
  flex: 1;
  min-width: 0;
}
.tag-picker__control,
.select-picker__control {
  min-height: 36px;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 4px 26px 4px 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font-size: 13px;
  box-sizing: border-box;
  position: relative;
}
.tag-picker__control:focus,
.select-picker__control:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(59, 123, 251, 0.12);
}
.tag-picker__chips {
  display: contents;
}
.tag-picker__placeholder,
.select-picker__value {
  color: var(--ink-900);
  pointer-events: none;
}
.tag-picker__placeholder {
  color: var(--ink-500);
}
.tag-picker__chevron,
.select-picker__chevron {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-60%);
  color: var(--ink-500);
  pointer-events: none;
  font-size: 16px;
  line-height: 1;
}
.tag-picker__chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--brand-50, #eef4ff);
  color: var(--ink-900);
  border-radius: 4px;
  padding: 2px 4px 2px 8px;
  font-size: 12px;
  line-height: 1.4;
}
.tag-picker__chip-x {
  background: none;
  border: none;
  color: var(--ink-500);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  font-size: 14px;
  border-radius: 3px;
}
.tag-picker__chip-x:hover { color: var(--ink-900); background: rgba(0,0,0,0.05); }
.tag-picker__dropdown,
.select-picker__dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 240px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,0.10);
  z-index: 20;
  padding: 4px;
}
.tag-picker__option,
.select-picker__option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  cursor: pointer;
  border-radius: 4px;
  font-size: 13px;
}
.select-picker__option {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--ink-900);
  text-align: left;
  font: inherit;
}
.tag-picker__option:hover,
.select-picker__option:hover { background: rgba(0,0,0,0.04); }
.tag-picker__option input { margin: 0; }
.select-picker__option[data-selected] { background: var(--brand-50, #eef4ff); }
.tag-picker__empty {
  padding: 8px;
  color: var(--ink-500);
  font-size: 13px;
  text-align: center;
}
.tag-picker__clear {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-500);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.tag-picker__clear:hover { color: #c0392b; border-color: #c0392b; background: #fff5f5; }

.form-actions {
  display: flex;
  gap: var(--space-2);
  justify-content: flex-end;
  margin-top: var(--space-4);
}

.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 13px;
}

/* =========================================================================
   Tables
   ========================================================================= */
.table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.table-scroll {
  max-height: 420px;
  overflow-y: auto;
}
.table-scroll .table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}
.table-scroll .table thead th,
.table-scroll .table tbody td {
  padding-left: 10px;
  padding-right: 10px;
}
.table-scroll .table tbody td {
  white-space: nowrap;
}
.table-scroll .table td.is-truncate {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.table-scroll .table td.is-truncate > .t-body {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.table thead th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--ink-500);
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface);
}
.table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 13px;
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--surface-alt); }
.table td.is-num { font-variant-numeric: tabular-nums; }
.table td.is-actions { text-align: right; white-space: nowrap; }
.table td.is-empty {
  text-align: center;
  color: var(--ink-500);
  padding: var(--space-6);
}

/* =========================================================================
   Progress bar
   ========================================================================= */
.progress {
  height: 6px;
  background: var(--surface-alt);
  border-radius: 6px;
  overflow: hidden;
}
.progress__bar {
  height: 100%;
  background: var(--brand-500);
  border-radius: 6px;
  transition: width 0.3s ease;
}
.progress--on-hero { background: rgba(255, 255, 255, 0.2); }
.progress--on-hero .progress__bar { background: #fff; }

/* =========================================================================
   Live feed
   ========================================================================= */
.feed { padding: 0; }
.feed__head {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.feed__row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 12px;
}
.feed__row:last-child { border-bottom: none; }
.feed__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex: 0 0 6px;
}
.feed__dot--success { background: var(--success-500); }
.feed__dot--info    { background: var(--brand-500); }
.feed__dot--warn    { background: var(--warn-500); }
.feed__dot--danger  { background: var(--danger-500); }
.feed__time {
  font-size: 11px;
  color: var(--ink-500);
  font-variant-numeric: tabular-nums;
}
.feed__partner { flex: 1; color: var(--ink-900); }
.feed__msg { color: var(--ink-500); font-size: 11px; }
.feed__empty {
  padding: var(--space-4);
  color: var(--ink-500);
  text-align: center;
  font-size: 12px;
}

/* =========================================================================
   Banner (info / warning above content)
   ========================================================================= */
.banner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
  background: var(--surface-blue);
  border: 1px solid #C7D7F5;
  border-radius: var(--radius-md);
  color: var(--brand-600);
}
.banner__icon { font-size: 18px; }
.banner__body { flex: 1; }
.banner__title { font-weight: 700; font-size: 13px; }
.banner__text  { font-size: 12px; color: var(--ink-500); }

/* =========================================================================
   Wizard steps indicator
   ========================================================================= */
.steps {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.steps__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 12px;
  color: var(--ink-500);
}
.steps__num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  font-weight: 700;
}
.steps__item.is-active { color: var(--ink-900); font-weight: 600; }
.steps__item.is-active .steps__num {
  background: var(--brand-500);
  color: #fff;
  border-color: var(--brand-500);
}
.steps__item.is-done .steps__num {
  background: var(--success-500);
  color: #fff;
  border-color: var(--success-500);
}
.steps__sep {
  flex: 0 0 24px;
  height: 1px;
  background: var(--border);
}

/* =========================================================================
   Flash message (HTMX OOB)
   ========================================================================= */
.flash {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  z-index: 100;
  background: var(--ink-900);
  color: #fff;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  font-size: 13px;
}
.flash:empty { display: none; }

/* =========================================================================
   Utility: stack
   ========================================================================= */
.stack { display: flex; flex-direction: column; gap: var(--space-4); }
.stack--sm { gap: var(--space-2); }
.stack--lg { gap: 32px; }
.row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* =========================================================================
   Connections screen
   ========================================================================= */
.connection-row {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  border-bottom: 1px solid var(--border);
}
.connection-row:last-child { border-bottom: none; }
.connection-row__icon { font-size: 24px; text-align: center; }
.connection-row__title { font-weight: 600; }
.connection-row.is-connected .connection-row__title::before {
  content: '● '; color: var(--success-500);
}
.connection-row.is-disconnected .connection-row__title::before {
  content: '○ '; color: var(--ink-300);
}

/* =========================================================================
   Telegram dashboard — KPI row
   ========================================================================= */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.kpi-card__label {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.kpi-card__value {
  font-size: 28px;
  font-weight: 700;
  color: var(--ink-900);
  line-height: 1.1;
}
.kpi-card__meta {
  font-size: 12px;
  color: var(--ink-300);
}

/* =========================================================================
   Telegram dashboard — connection summary bar
   ========================================================================= */
.connection-summary {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-alt);
  margin-bottom: var(--space-5);
}
.connection-summary.is-connected { border-color: var(--success-500); background: var(--success-50); }
.connection-summary.is-disconnected { border-color: var(--border); }
.connection-summary__icon { font-size: 20px; flex-shrink: 0; }
.connection-summary__text { flex: 1; font-size: 14px; }

/* =========================================================================
   Telegram dashboard — recent campaigns list
   ========================================================================= */
.recent-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.recent-list__item {
  border-top: 1px solid var(--border-soft);
}
.recent-list__item:first-child { border-top: none; }
.recent-list__link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  text-decoration: none;
  color: var(--ink-900);
  font-size: 14px;
  transition: background 0.15s;
}
.recent-list__link:hover { background: var(--surface-alt); }
.recent-list__time { color: var(--ink-300); font-size: 12px; white-space: nowrap; }
.recent-list__title { flex: 1; font-weight: 500; }
.recent-list__stat { color: var(--ink-500); font-size: 12px; white-space: nowrap; }
.recent-list__status { font-size: 11px; color: var(--ink-300); white-space: nowrap; }

/* card header row */
.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-4) var(--space-3);
  border-bottom: 1px solid var(--border-soft);
}
