/* VELOURS — панель команды. Один тёмный лист, без внешних зависимостей. */
:root {
  --bg: #0e0d12;
  --panel: #17151d;
  --panel-2: #1e1b26;
  --line: #2a2733;
  --line-2: #38343f;
  --ink: #ece9f1;
  --muted: #9a94a8;
  --faint: #6c6678;
  --gold: #c9a86a;
  --gold-ink: #1a1710;
  --green: #6fbf8a;
  --red: #e07a7a;
  --amber: #d9b45a;
  --blue: #7fa8d8;
  --violet: #a99bd6;
  --radius: 12px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }
/* Классы .gate/.app задают display:grid — он перебивает браузерное
   [hidden]{display:none}. Возвращаем атрибуту силу, иначе форма входа и панель
   показываются одновременно. */
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; cursor: pointer; }
input, textarea, select {
  font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 9px 11px; width: 100%;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--gold); }
textarea { resize: vertical; }

.brand {
  font-weight: 700; letter-spacing: .14em; font-size: 15px;
}
.brand span { color: var(--gold); margin-left: .4em; font-weight: 400; }

/* --- buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  border: 1px solid var(--line-2); background: var(--panel-2); color: var(--ink);
  border-radius: var(--radius-sm); padding: 8px 14px; font-size: 14px; transition: .12s;
}
.btn:hover { border-color: var(--faint); }
.btn-primary { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); font-weight: 600; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--red); border-color: #4a2b2b; }
.btn-danger:hover { background: #2a1b1b; }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-icon {
  width: 34px; height: 34px; padding: 0; border-radius: 50%;
  font-size: 19px; line-height: 1; flex: none;
}

/* --- gate --- */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.gate-card {
  width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px 26px;
}
.gate-card .brand { text-align: center; margin-bottom: 22px; font-size: 17px; }
.form h1 { font-size: 19px; margin: 0 0 18px; font-weight: 600; }
.form label { display: block; margin-bottom: 13px; font-size: 13px; color: var(--muted); }
.form label input, .form label textarea, .form label select { margin-top: 5px; }
.form .btn-primary { width: 100%; margin-top: 6px; padding: 11px; }
.form-switch { text-align: center; margin: 14px 0 0; font-size: 13px; color: var(--muted); }
.form-error {
  background: #2a1b1b; border: 1px solid #4a2b2b; color: var(--red);
  padding: 9px 11px; border-radius: var(--radius-sm); font-size: 13px; margin: 0 0 12px;
}

/* --- app shell --- */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side {
  background: var(--panel); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 20px 16px; position: sticky; top: 0; height: 100vh;
}
.side .brand { padding: 0 8px 20px; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: transparent; border: none; color: var(--muted); padding: 9px 10px;
  border-radius: var(--radius-sm); font-size: 14px;
}
.nav button:hover { background: var(--panel-2); color: var(--ink); }
.nav button.on { background: var(--panel-2); color: var(--ink); font-weight: 600; }
.nav .count { margin-left: auto; background: var(--gold); color: var(--gold-ink); border-radius: 20px;
  font-size: 11px; font-weight: 700; padding: 1px 7px; }
.side-foot { border-top: 1px solid var(--line); padding-top: 14px; }
.who { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 13px; }
.who #who-name { font-weight: 600; }
.side-foot .btn { width: 100%; }

.view { padding: 26px 30px 60px; max-width: 1180px; }
.view h1 { font-size: 22px; margin: 0 0 4px; font-weight: 600; }
.view .sub { color: var(--muted); margin: 0 0 22px; font-size: 14px; }
.head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.head-row h1 { margin: 0; }

/* --- chips / badges --- */
.chip {
  display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .03em;
  padding: 2px 8px; border-radius: 20px; background: var(--panel-2); color: var(--muted);
  border: 1px solid var(--line-2); text-transform: uppercase;
}
.chip.role-admin { color: var(--gold); border-color: #4a3f28; }
.chip.role-curator { color: var(--blue); border-color: #2f3d4f; }
.chip.role-worker { color: var(--green); border-color: #2c4436; }
.chip.st-applied { color: var(--amber); border-color: #4a4028; }
.chip.st-approved { color: var(--green); border-color: #2c4436; }
.chip.st-rejected { color: var(--red); border-color: #4a2b2b; }
.chip.st-active { color: var(--green); border-color: #2c4436; }
.chip.st-disabled { color: var(--faint); }

/* --- cards / grid --- */
.grid { display: grid; gap: 16px; }
.tiles { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 24px; }
.tile {
  background: linear-gradient(160deg, var(--panel-2), var(--panel) 60%);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
}
.tile .n { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.tile .k { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }
.tile .n small { font-size: 14px; color: var(--muted); font-weight: 400; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
.card h2 { font-size: 15px; margin: 0 0 14px; font-weight: 600; }
.card h2 .muted { color: var(--muted); font-weight: 400; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } }

/* --- tables --- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--panel-2); }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }

/* --- copy-field: click any value to copy it --- */
.copy-field { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 6px; cursor: pointer; }
.copy-field:hover { background: var(--panel); }
.copy-field:active { background: var(--line); }
.copy-field .cf-label { color: var(--muted); font-size: 12px; min-width: 78px; flex-shrink: 0; }
.copy-field .cf-val { font-weight: 600; }

/* --- personal links --- */
.personal-links { display: flex; flex-direction: column; gap: 12px; }
.personal-link {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 17px; margin-bottom: 12px; transition: border-color .12s;
}
.personal-links .personal-link { margin-bottom: 0; }
.personal-link:hover { border-color: var(--line-2); }
.personal-link-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.personal-link-top .city { font-weight: 600; }
/* Коэффициент — единственная цифра в шапке карточки, и он же то, ради чего в неё
   заходят: золотом, чтобы читался с одного взгляда по всему списку. */
.chip.chip-mult { color: var(--gold); border-color: #4a3f28; font-size: 12px; }
.personal-link-actions { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.personal-link-actions .btn.is-active { border-color: var(--gold); color: var(--gold); }
.personal-link-url { display: flex; gap: 8px; align-items: center; }
.personal-link-url input { background: var(--bg); font-family: ui-monospace, monospace; font-size: 12.5px; }
/* Редактор ссылки — то, что раскрывает кнопка «Изменить»: салон, на который она
   смотрит, и коэффициент, по которому продаёт. Отбит от ссылки пунктиром, чтобы
   было видно: это не часть карточки, а её изнанка. */
.personal-link-mult { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
/* Страна и город — те же два селекта, что и в форме выпуска, поэтому и вид у них
   тот же (.inline-form); тянутся оба поровну, ширины карточки на них хватает. */
.pl-edit-row label { flex: 1 1 160px; }
.pl-edit-row select { width: 100%; }
.pl-mult-row { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.personal-link-mult input { width: 88px; }
.pl-hint { font-size: 12.5px; line-height: 1.45; margin: 10px 0 0; }
/* Статистика карточки — пилюлями, а не строкой через запятую: числа так
   держат строй по всему списку. */
.pl-stats { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.pl-stat {
  background: var(--bg); border: 1px solid var(--line); border-radius: 20px;
  padding: 3px 11px; font-size: 12.5px; color: var(--muted);
}
.pl-stat b { color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 600; }
.mult-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.mult-presets .btn.is-active { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }

/* Форма выпуска ссылки — раскрывается кнопкой в заголовке раздела. */
.pl-create { margin-bottom: 16px; }
/* Город тянется, коэффициент — нет: это одно число, и растянутое на пол-формы
   поле обещало бы, что туда пишут что-то длинное. */
.pl-create .inline-form label { flex: 3 1 240px; }
.pl-create .inline-form label + label { flex: 0 1 150px; }
.pl-create-presets { margin-top: 12px; }
.pl-create .btn-primary { margin-top: 14px; }

/* Заголовок раздела внутри страницы — тише, чем h1 вкладки. */
.section-head, .dash-head { align-items: center; }
.section-head { margin-top: 30px; }
.section-head .section-title { font-size: 17px; font-weight: 600; margin: 0 0 3px; }
.head-row .sub { margin-bottom: 0; }

/* --- feed --- */
.feed { display: flex; flex-direction: column; gap: 8px; }
.feed-item { display: flex; gap: 12px; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-sm); }
.feed-item.k-booked { border-color: #3a4a30; background: #171e15; }
.feed-item.k-arrived { border-color: var(--line-2); }
.feed-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex: none; background: var(--faint); }
.feed-item.k-arrived .feed-dot { background: var(--blue); }
.feed-item.k-progress .feed-dot { background: var(--amber); }
.feed-item.k-booked .feed-dot { background: var(--green); }
.feed-item.k-back .feed-dot { background: var(--blue); }
.feed-item.k-away .feed-dot { background: var(--faint); }
.feed-item.k-left .feed-dot { background: var(--red); }
.feed-item.k-away, .feed-item.k-left { background: var(--bg); }
.feed-item.k-away .feed-title, .feed-item.k-left .feed-title { font-weight: 500; color: var(--muted); }
.feed-item.k-pay { border-color: var(--line-2); background: var(--panel-2); }
.feed-item.k-pay .feed-dot { background: var(--violet); }
.feed-item.k-pay.by-guest .feed-dot { background: var(--blue); }
.feed-item.k-pay .feed-title { font-weight: 500; }
.feed-body { flex: 1; min-width: 0; }
.feed-title { font-weight: 600; }
.feed-meta { color: var(--muted); font-size: 12.5px; margin-top: 3px; word-break: break-word; }

/* Управление оплатой прямо в ленте: карточки стойки над хроникой клиента. */
.feed-pay { margin-bottom: 14px; }
.feed-pay-head { font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); margin-bottom: 8px; }
.feed-pay .card { margin-bottom: 10px; }
.feed-time { color: var(--faint); font-size: 12px; white-space: nowrap; }
.feed-new { animation: flash 1.4s ease; }
@keyframes flash { from { background: #2a2418; } }

/* --- лента по клиентам: колонка слева, логи выбранного справа --- */
.feed-split { display: grid; grid-template-columns: 272px 1fr; gap: 16px; align-items: start; }
.feed-clients {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px; display: flex; flex-direction: column; gap: 3px;
  position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow-y: auto;
}
.feed-clients-head {
  color: var(--faint); font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  padding: 6px 10px 8px;
}
.feed-client {
  display: flex; flex-direction: column; gap: 4px; width: 100%; text-align: left;
  background: transparent; border: 1px solid transparent; border-radius: var(--radius-sm);
  color: var(--ink); padding: 9px 10px; transition: .12s;
}
.feed-client:hover { background: var(--panel-2); }
.feed-client.on { background: var(--panel-2); border-color: var(--line-2); }
.feed-client.on .fc-name { color: var(--gold); }
.feed-client .fc-name { font-weight: 600; font-size: 13px; }
.feed-client .fc-sub {
  color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.feed-client .fc-tags { display: flex; align-items: center; gap: 8px; font-size: 12px; }
/* Круглая зелёная метка в этой панели значит одно — «сейчас на странице»
   (.dot-live). Клиента с заявкой отмечает подписанный чип, и ничего кроме:
   лента — это история, про онлайн она не знает. */
.feed-log-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.feed-log-head h2 { font-size: 16px; margin: 0 0 3px; font-weight: 600; }
.feed-log-head p { margin: 0; font-size: 12.5px; }

/* Онлайн — подписанным словом. Точка рядом только как акцент к тексту, сама по
   себе она в этой панели уже занята («сейчас на сайте» в «Гостях»). */
.feed-state { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; text-align: right; }
.fs-badge {
  font-size: 12px; font-weight: 600; letter-spacing: .02em; white-space: nowrap;
  border: 1px solid var(--line-2); border-radius: 20px; padding: 3px 10px; color: var(--faint);
}
.feed-state.is-here .fs-badge { color: var(--green); border-color: #2c4436; background: #16211a; }
.feed-state.is-bg .fs-badge { color: var(--amber); border-color: #4a4028; background: #201c12; }
.fs-ago { font-size: 12px; color: var(--faint); white-space: nowrap; }
.fc-live { margin-left: auto; font-size: 11px; font-weight: 600; white-space: nowrap; }
.fc-live.is-here { color: var(--green); }
.fc-live.is-bg { color: var(--amber); }
.fc-live.is-off { color: var(--faint); }
.fc-live.is-here::before, .fc-live.is-bg::before {
  content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; margin-right: 5px; vertical-align: middle;
}
.fc-live.is-off::before {
  content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  border: 1px solid currentColor; margin-right: 5px; vertical-align: middle; box-sizing: border-box;
}

/* Непрочитанное в переписке и последняя реплика — прямо в колонке клиентов:
   очередь разбирают глазами по ней, а не открывая чаты по одному. */
.feed-client .fc-msg {
  color: var(--faint); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.feed-client.has-new .fc-name { color: var(--ink); }
.feed-client.has-new .fc-msg { color: var(--ink); }
.chip.fc-unread { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); font-weight: 700; }

/* Выключатель звука стоит в шапке ленты — там, где чаты, и там же, где его
   ищут, когда он надоел. Выключенный подписан словом, а не перечёркнутым
   колокольчиком: слово читается без разглядывания. */
.sound-toggle { flex: none; font-size: 13px; padding: 6px 12px; }
.sound-toggle.is-off { color: var(--faint); }

/* --- поддержка: переписка с гостем ---------------------------------------- */
/* Чат и хроника — про одного человека, но читаются в разные стороны: чат снизу
   вверх, лента сверху вниз. Поэтому вкладки, а не один список. */
.feed-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.feed-tabs button {
  display: inline-flex; align-items: center; gap: 7px;
  background: transparent; border: 1px solid var(--line-2); border-radius: 20px;
  color: var(--muted); padding: 5px 14px; font-size: 13px; transition: .12s;
}
.feed-tabs button:hover { color: var(--ink); }
.feed-tabs button.on { background: var(--panel-2); color: var(--ink); border-color: var(--faint); font-weight: 600; }
.feed-tabs .count {
  background: var(--gold); color: var(--gold-ink); border-radius: 20px;
  font-size: 11px; font-weight: 700; padding: 1px 7px;
}

.chat {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  display: flex; flex-direction: column; overflow: hidden;
}
.chat-log {
  display: flex; flex-direction: column; gap: 10px;
  padding: 16px; min-height: 260px; max-height: calc(100vh - 320px); overflow-y: auto;
}
.chat-day {
  align-self: center; color: var(--faint); font-size: 11px; text-transform: uppercase;
  letter-spacing: .05em; padding: 2px 0;
}
.chat-msg { display: flex; flex-direction: column; gap: 3px; max-width: 74%; }
.chat-msg.is-guest { align-self: flex-start; }
.chat-msg.is-staff { align-self: flex-end; align-items: flex-end; }
.chat-bubble {
  border-radius: var(--radius); padding: 9px 13px; font-size: 14px; line-height: 1.5;
  overflow-wrap: anywhere;
}
.chat-msg.is-guest .chat-bubble { background: var(--panel-2); border: 1px solid var(--line-2); }
.chat-msg.is-staff .chat-bubble { background: var(--gold); color: var(--gold-ink); }
.chat-meta { font-size: 11px; color: var(--faint); }

.chat-sys {
  align-self: center; max-width: 90%; text-align: center;
  color: var(--muted); font-size: 12.5px; line-height: 1.45;
  padding: 6px 12px; border-radius: 999px; background: var(--panel-2);
}
.chat-sys-time { display: inline-block; margin-left: 8px; color: var(--faint); font-size: 11px; }

.chat-closed {
  border-top: 1px solid var(--line); padding: 14px 16px; background: var(--panel-2);
  color: var(--muted); font-size: 13px; text-align: center;
}

.chat-form {
  display: flex; flex-direction: column; gap: 8px;
  border-top: 1px solid var(--line); padding: 12px; background: var(--panel-2);
}
.chat-name {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 12px; color: var(--muted);
}
.chat-name input {
  font: inherit; font-size: 14px; color: var(--ink);
  padding: 8px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); background: var(--panel);
}
.chat-name input:focus { outline: none; border-color: var(--gold); }
.chat-op {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 13px; color: var(--muted);
}
.chat-op-as b { color: var(--ink); font-weight: 600; }
.chat-compose { display: flex; gap: 8px; align-items: flex-end; }
.chat-compose textarea { flex: 1; resize: none; min-height: 40px; line-height: 1.45; }
.chat-compose .btn { flex: none; }
.chat-form textarea { resize: none; min-height: 40px; line-height: 1.45; }
.chat-form .btn { flex: none; }

@media (max-width: 900px) {
  .feed-split { grid-template-columns: 1fr; }
  .feed-clients { position: static; max-height: 300px; }
  .chat-log { max-height: 60vh; }
}

/* --- live visitors --- */
.live-row { display: flex; gap: 10px; align-items: baseline; }
.dot-live { width: 8px; height: 8px; border-radius: 50%; background: var(--green); display: inline-block; }
.dot-idle { background: var(--faint); }

/* --- misc --- */
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.empty { color: var(--faint); text-align: center; padding: 40px; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.inline-form label { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.inline-form input, .inline-form select { min-width: 120px; }
/* --- sselect: поисковый комбобокс вместо длинного <select> --- */
.sselect { position: relative; min-width: 200px; }
.sselect-menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 40;
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  max-height: 264px; overflow-y: auto; padding: 4px;
  box-shadow: 0 16px 40px rgba(0,0,0,.45);
}
.sselect-item {
  display: block; width: 100%; text-align: left; background: transparent; border: none;
  border-radius: 6px; color: var(--ink); padding: 8px 10px; font-size: 14px; font: inherit;
}
.sselect-item:hover, .sselect-item.is-active { background: var(--panel); }
.sselect-item.is-selected { color: var(--gold); }
.sselect-item .muted { font-size: 12.5px; }
.sselect-empty { color: var(--faint); padding: 10px; font-size: 13px; text-align: center; }

.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--panel-2); border: 1px solid var(--line-2); color: var(--ink);
  padding: 11px 18px; border-radius: var(--radius-sm); font-size: 14px; z-index: 50;
  box-shadow: 0 8px 30px rgba(0,0,0,.4);
}
.toast.err { border-color: #4a2b2b; color: var(--red); }
.personal-links-btn.is-empty { color: var(--faint); border-style: dashed; }

/* --- modal --- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(9,8,12,.6); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 24px; z-index: 100;
  animation: modal-in .14s ease;
}
@keyframes modal-in { from { opacity: 0; } }
.modal {
  width: 100%; max-width: 420px; max-height: calc(100vh - 48px); overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 24px 70px rgba(0,0,0,.55);
}
.modal.modal-wide { max-width: 560px; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 18px 0 22px; position: sticky; top: 0; background: var(--panel);
}
.modal-head h2 { font-size: 17px; margin: 0; font-weight: 600; }
.modal-close {
  flex: none; width: 30px; height: 30px; display: grid; place-items: center;
  background: transparent; border: none; border-radius: 50%; color: var(--muted); font-size: 15px;
}
.modal-close:hover { background: var(--panel-2); color: var(--ink); }
.modal-body { padding: 16px 22px 22px; }
.modal-body .form label { margin-bottom: 12px; }
.modal-body .form .btn-primary { margin-top: 8px; }
.modal-personal-links-list { margin-bottom: 4px; }
.modal-personal-links-list .personal-link:last-child { margin-bottom: 0; }
.modal-add-personal-link { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.split { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pay-status { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.pay-status .fc-live { margin-left: 0; }
details.trail { margin-top: 6px; }
details.trail summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.trail-line { font-size: 12.5px; color: var(--muted); padding: 2px 0; }

@media (max-width: 720px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .side-foot { border: none; padding: 0; margin-left: auto; }
  .view { padding: 18px; }
}

.admin-link { color: var(--gold); font-size: 14px; }
a.admin-link:hover { text-decoration: underline; }

/* --- куратор: выбор/открепление, «мои воркеры» --- */
.curator-pick { display: flex; flex-direction: column; gap: 10px; }
.curator-pick-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.curator-pick-name { font-weight: 600; font-size: 14px; }
.curator-pick-bio { font-size: 13px; line-height: 1.5; margin: 6px 0 0; max-width: 480px; white-space: pre-wrap; }

/* --- телеграм-уведомления в профиле --- */
.tg-status { font-size: 14px; margin: 0 0 12px; }
.tg-status.on { color: var(--green); }
.tg-hint { font-size: 13px; margin: 12px 0 0; }

/* --- переключатель сайта ---------------------------------------------------
   Панель ведёт несколько сайтов сразу, и всё, что она показывает — визиты,
   личные ссылки, заявки, оплаты — принадлежит одному из них. Переключатель стоит над
   навигацией, потому что он меняет не вкладку, а то, про что все вкладки. */
.site-switch { padding: 0 16px 12px; }
.site-switch select {
  width: 100%; padding: 8px 10px; border-radius: 8px;
  background: var(--panel, #171717); color: inherit;
  border: 1px solid var(--line, #2a2a2a); font: inherit;
}
.site-switch label { display: block; font-size: 11px; letter-spacing: .06em;
  text-transform: uppercase; opacity: .55; margin-bottom: 6px; }

/* Метка сайта на строке в общем списке — тише обычной, это не статус, а
   принадлежность. */
.chip-site { background: rgba(255,255,255,.06); opacity: .8; }

/* --- домены ---------------------------------------------------------------- */
.domain-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 0; border-bottom: 1px solid var(--line, #2a2a2a); }
.domain-row .host { font-weight: 600; }
.domain-row .grow { flex: 1 1 auto; }
.domain-off { opacity: .5; }
