/* Общие блоки страниц: таблицы, карточка пользователя, тосты, бейджи.
   Значения берутся из токенов admin.css — цвета здесь не задаются числом,
   иначе смена палитры требует обхода всех файлов разделов. */

/* ===================== ТАБЛИЦЫ ===================== */

.data-table-wrap{
  width:100%; margin:20px auto 0;
  background:var(--surface-2);
  border:1px solid var(--border);
  border-radius:var(--radius);
  overflow:hidden;
  box-shadow:var(--shadow-soft);
}
.data-table-scroll{
  overflow-x:auto; overflow-y:hidden; border-radius:inherit;
  -webkit-overflow-scrolling:touch;
}
.data-table{
  width:100%; min-width:1200px; border-collapse:collapse; table-layout:auto;
  font-size:14px; color:var(--text);
}
.data-table thead{
  background:rgba(255,255,255,.025);
  position:sticky; top:0; z-index:2;
  -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px);
}
.data-table th{
  font-family:Roboto-Medium; font-size:12.5px; letter-spacing:.03em;
  text-transform:uppercase; color:var(--muted);
  border-bottom:1px solid var(--border);
}
.data-table th,
.data-table td{
  padding:12px 14px; text-align:center; vertical-align:middle;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.data-table tbody tr{ background:transparent; transition:background var(--fast) }
.data-table tbody tr:hover{ background:rgba(255,255,255,.03) }
.data-table tbody tr:not(:last-child){ border-bottom:1px solid var(--border) }
.data-table--narrow{ min-width:760px }

/* Ширины колонок повторяют оригинальные страницы. Без них раскладка
   расползается: у таблиц table-layout:auto и колонки тянутся по контенту. */
.data-table--users{ min-width:1080px }
.data-table--users th:nth-child(1){ width:160px } /* ID */
.data-table--users th:nth-child(2){ width:170px } /* Родитель */
.data-table--users th:nth-child(3){ width:170px } /* Авторизация */
.data-table--users th:nth-child(4){ width:170px } /* Имя */
.data-table--users th:nth-child(5){ width:160px } /* Юзернейм */
.data-table--users th:nth-child(6){ width:120px } /* Баланс */
.data-table--users th:nth-child(7){ width:130px } /* Подписка */
.data-table--users th:nth-child(8){ width:110px } /* Инфо */

.data-table--top-refs{ min-width:1080px }
.data-table--top-refs th:nth-child(1){ width:160px }
.data-table--top-refs th:nth-child(2){ width:120px }
.data-table--top-refs th:nth-child(3){ width:170px }
.data-table--top-refs th:nth-child(4){ width:170px }
.data-table--top-refs th:nth-child(5){ width:160px }
.data-table--top-refs th:nth-child(6){ width:120px }
.data-table--top-refs th:nth-child(7){ width:130px }
.data-table--top-refs th:nth-child(8){ width:110px }

.data-table--orders{ min-width:1200px }
.data-table--orders th:nth-child(1){ width:200px }
.data-table--orders th:nth-child(2){ width:110px }
.data-table--orders th:nth-child(3){ width:170px }
.data-table--orders th:nth-child(4){ width:110px }
.data-table--orders th:nth-child(5){ width:170px }
.data-table--orders th:nth-child(6){ width:120px }
.data-table--orders th:nth-child(7){ width:160px }

/* Аватар в колонке «Имя»: круг над подписью, как в оригинале. */
.user-avatar-cell{
  width:30px; height:30px; border-radius:50%;
  background-size:cover; background-position:center;
  margin:0 auto 8px;
  box-shadow:0 0 0 1px var(--border);
}
.user-avatar-cell--empty{
  display:flex; align-items:center; justify-content:center;
  font-family:Roboto-Medium; font-size:14px;
  background:var(--surface-3); color:var(--muted);
}

/* Ячейка авторизации: иконка и подпись. */
.auth-cell{ display:inline-flex; align-items:center; gap:8px; justify-content:center }
.auth-cell i{ color:var(--accent); opacity:.9 }

/* Кликабельные заголовки сортировки. */
th[data-sort-by]{ cursor:pointer; user-select:none; transition:color var(--fast) }
th[data-sort-by]:hover{ color:var(--text-dim) }
th[data-sort-by] i{ opacity:.6; margin-left:6px }

/* position + overflow обязательны: по кнопке идёт волна нажатия, а её
   круг радиусом с диагональ элемента без обрезки расползается по всей
   строке таблицы. */
.btn-info-more-order{
  position:relative; overflow:hidden;
  display:inline-flex; align-items:center; gap:8px;
  padding:8px 13px; border-radius:var(--radius-sm);
  border:1px solid var(--border); color:var(--text-dim);
  background:var(--surface-3);
  transition:background var(--fast), color var(--fast), border-color var(--fast), transform var(--fast);
}
.btn-info-more-order:hover{
  background:var(--accent-soft); color:#fff;
  border-color:var(--border-accent); transform:translateY(-1px);
}

.link-table{ color:var(--accent); text-decoration:none; transition:color var(--fast) }
.link-table:hover{ color:var(--accent-hover); text-decoration:underline }

/* ===================== БЕЙДЖИ СОСТОЯНИЙ ===================== */

.status-pill-ok,
.status-pill-bad,
.status-pill-wait{
  display:inline-flex; align-items:center; justify-content:center; gap:6px;
  min-width:92px; height:28px; padding:0 12px; border-radius:999px; font-size:12.5px;
  border:1px solid transparent;
}
.status-pill-ok{ color:var(--good); background:var(--good-soft); border-color:rgba(48,209,88,.26) }
.status-pill-bad{ color:var(--bad); background:var(--bad-soft); border-color:rgba(255,69,58,.26) }
.status-pill-wait{ color:var(--warn); background:var(--warn-soft); border-color:rgba(255,159,10,.26) }

.btn-copy{ margin-left:5px; opacity:.5; transition:opacity var(--fast), color var(--fast) }
.click-copy{ cursor:pointer }
.click-copy:hover .btn-copy{ opacity:1; color:var(--accent) }

.btn-open-config{
  display:inline-block; background:var(--accent-soft); color:var(--accent);
  padding:9px 14px; border-radius:var(--radius-sm); font-size:13.5px;
  border:1px solid transparent;
  transition:background var(--fast), color var(--fast), border-color var(--fast);
}
.btn-open-config:hover{ background:var(--accent-soft); color:#fff; border-color:var(--border-accent) }
.btn-open-config i{ margin-left:4px; font-size:11px }

/* Покупатель: аватар + ID + копия */
.buyer-cell{ white-space:normal }
.buyer-wrap{
  display:flex; flex-direction:column; align-items:center;
  justify-content:center; gap:8px;
}
.user-avatar-mini{
  width:30px; height:30px; border-radius:50%;
  background:var(--surface-3) center/cover no-repeat;
  box-shadow:0 0 0 1px var(--border);
}
.user-avatar-lg{
  width:76px; height:76px; border-radius:50%;
  background:var(--surface-3) center/cover no-repeat;
  box-shadow:0 0 0 1px var(--border-strong);
}

.table-spinner{ text-align:center; padding:18px }
.table-empty{ text-align:center; padding:28px; color:var(--muted) }

/* ===================== ТОСТЫ ===================== */

.toast-stack{
  position:fixed; left:50%; bottom:26px; transform:translateX(-50%);
  display:flex; flex-direction:column; gap:8px; z-index:200; align-items:center;
  pointer-events:none;
}
/* Подложка тоста — та же поверхность, что у карточек, только полупрозрачная
   под размытием. Прежний rgba(17,26,44,…) был синим и на графитовом фоне
   выглядел как чужой элемент. */
.toast{
  background:rgba(21,21,23,.96);
  -webkit-backdrop-filter:blur(12px); backdrop-filter:blur(12px);
  color:var(--text); border:1px solid var(--border-strong);
  border-radius:14px; padding:13px 18px; font-size:14px;
  box-shadow:var(--shadow); display:flex; align-items:center; gap:10px;
  animation:toast-in .26s var(--ease) both;
}
@keyframes toast-in{ from{ opacity:0; transform:translateY(12px) scale(.97) } to{ opacity:1; transform:none } }
.toast i{ color:var(--good) }
.toast--err{ border-color:rgba(255,69,58,.4) }
.toast--err i{ color:var(--bad) }
/* Предупреждения (toast.warn — проверки форм тарифов) выводились с зелёной
   галочкой по умолчанию: правила для этого вида в общем слое не было. */
.toast--warn{ border-color:rgba(255,159,10,.4) }
.toast--warn i{ color:var(--warn) }

/* ===================== КАРТОЧКА ПОЛЬЗОВАТЕЛЯ ===================== */

.user-card{
  display:grid; grid-template-columns:96px 1fr;
  gap:14px; align-items:center;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:16px;
  box-shadow:var(--shadow-soft);
}
.user-avatar{
  width:96px; height:96px; border-radius:50%;
  background:var(--surface-3) center/cover no-repeat;
  /* Тень нейтральная: прежний rgba(3,7,18,…) подсинивал ореол аватара. */
  box-shadow:0 0 0 2px var(--border-strong), 0 8px 24px rgba(0,0,0,.5);
}
.user-meta{ display:grid; grid-template-columns:repeat(3, minmax(220px,1fr)); gap:12px 14px }
.meta-line{ display:flex; align-items:center; gap:10px; min-height:34px }
.meta-label{ color:var(--muted); white-space:nowrap; font-size:13.5px }
.meta-label i{ color:var(--accent); opacity:.85; margin-right:2px }
.meta-value{ color:var(--text); display:flex; align-items:center; gap:8px; flex-wrap:wrap }
.meta-value a{ color:var(--accent); text-decoration:none }
.meta-value a:hover{ text-decoration:underline }
.copy-ico{ cursor:pointer; opacity:.5; transition:opacity var(--fast), color var(--fast) }
.copy-ico:hover{ opacity:1; color:var(--accent) }

.balance-badge{
  display:inline-flex; align-items:center; gap:8px;
  padding:7px 12px; border-radius:var(--radius-sm);
  background:var(--surface-3); border:1px solid var(--border); color:var(--text);
}
.balance-badge i{ color:var(--accent) }
.balance-badge input{
  width:64px; background:transparent; border:0; outline:none;
  color:var(--text); text-align:right; font-family:inherit; font-size:15px;
}
.badge-rub{ color:var(--muted) }

.status-badge{ font-family:Roboto-Medium }
.status-active{ color:var(--good) }
.status-inactive{ color:var(--bad) }

.section{
  margin-top:14px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:16px;
}
.section-title{
  font-size:15.5px; font-family:Roboto-Medium; margin:0 2px 14px; color:var(--text);
  display:flex; align-items:center; justify-content:space-between; gap:10px;
}

.table-scroll{ max-height:380px; overflow:auto; border-radius:var(--radius-sm) }
.data{ width:100%; min-width:900px; border-collapse:collapse; color:var(--text); font-size:14px }
.data thead{ background:var(--surface-3); position:sticky; top:0; z-index:1 }
/* 12.5px — общий размер шапки таблиц. Здесь стояло 12px, и оба
   потребителя .data (.section в user-edit.css, .vip-page в vip-traffic.css)
   молча возвращали 12.5px у себя. Правим в основании. */
.data th{
  font-family:Roboto-Medium; font-size:12.5px; letter-spacing:.03em;
  text-transform:uppercase; color:var(--muted);
}
.data th, .data td{
  padding:11px 13px; text-align:center; white-space:nowrap;
  overflow:hidden; text-overflow:ellipsis;
}
.data tbody tr{ background:transparent; transition:background var(--fast) }
.data tbody tr:hover{ background:rgba(255,255,255,.03) }
.data tbody tr:not(:last-child){ border-bottom:1px solid var(--border) }

/* См. .btn-info-more-order: волна нажатия должна остаться внутри кнопки. */
.btn-info-more{
  position:relative; overflow:hidden;
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:8px 13px; border-radius:var(--radius-sm); border:1px solid var(--border);
  color:var(--text-dim); background:var(--surface-3);
  transition:background var(--fast), color var(--fast), border-color var(--fast);
}
.btn-info-more:hover{ background:var(--accent-soft); color:#fff; border-color:var(--border-accent) }

.status-vip-badge{
  display:inline-flex; align-items:center; justify-content:center;
  min-width:92px; height:26px; padding:0 12px; border-radius:999px; font-size:12px;
  color:var(--good); background:var(--good-soft); border:1px solid rgba(48,209,88,.26);
}
.counts-days-val{ display:inline-block; color:var(--muted); font-size:12px; margin-top:4px }
.cell-link{ white-space:normal; word-break:break-word; overflow-wrap:anywhere; text-align:left }

.badge-test{ color:var(--muted); background:rgba(255,255,255,.08); padding:4px 11px; border-radius:999px; font-size:12px }
.badge-ban{ color:var(--bad); background:var(--bad-soft); padding:4px 11px; border-radius:999px; font-size:12px }

@media(max-width: 1000px){
  .user-meta{ grid-template-columns:1fr }
  .user-card{ grid-template-columns:1fr; justify-items:center; text-align:center }
}

.amount-plus{ color:var(--good) }
.amount-minus{ color:var(--bad) }

.pager{ display:flex; align-items:center; justify-content:center; gap:10px; margin-top:22px }
.pager button{
  position:relative; overflow:hidden;
  background:var(--surface-3); border:1px solid var(--border); color:var(--text-dim);
  padding:11px 18px; border-radius:12px; cursor:pointer; font-family:inherit; font-size:14px;
  transition:background var(--fast), color var(--fast), border-color var(--fast);
}
.pager button:hover:not(:disabled){ background:var(--accent-soft); color:#fff; border-color:var(--border-accent) }
.pager button:disabled{ opacity:.35; cursor:default }

@media(max-width: 500px){
  .header-nav-url-row{ display:block }
  .cont-urls{ margin-bottom:20px }
  .filters-tables{ display:block }
  .btn-go-search{ margin-top:15px; width:100%; margin-left:0 }
  .filter-type-search{ width:100%; margin-bottom:15px }
  .form-search-inp{ width:100% }
}
