/* Админ-панель: чёрно-белый. Строгая типографика, тонкие линии, без цвета кроме смысловых акцентов. */

:root {
  --bg: #ffffff;
  --bg-soft: #fafafa;
  --bg-hover: #f4f4f5;
  --line: #e6e6e8;
  --line-soft: #f0f0f1;
  --ink: #0a0a0a;
  --ink-2: #3f3f46;
  --ink-3: #71717a;
  --ink-4: #a1a1aa;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.04);
  --shadow: 0 16px 48px rgba(0,0,0,.10);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

.ad-shell {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: inherit;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.ad-center { display: grid; place-items: center; padding: 24px; }
.ad-loading { color: var(--ink-3); font-size: 14px; }

/* ── Вход ─────────────────────────────────────────────── */
.ad-login {
  width: 100%;
  max-width: 360px;
  display: grid;
  gap: 16px;
  padding: 36px 32px;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.ad-login-head { display: grid; gap: 4px; margin-bottom: 8px; }
.ad-login-head h1 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -.03em; }
.ad-login-head span { color: var(--ink-3); font-size: 13px; }
.ad-field { display: grid; gap: 6px; }
.ad-field > span { color: var(--ink-3); font-size: 12px; font-weight: 550; }
.ad-field input {
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.ad-field input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(0,0,0,.06); }

/* ── Кнопки ───────────────────────────────────────────── */
.ad-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
  transition: background .14s, border-color .14s, color .14s, opacity .14s;
}
.ad-btn:hover:not(:disabled) { background: var(--bg-hover); border-color: #d4d4d8; }
.ad-btn:disabled { opacity: .4; cursor: not-allowed; }
.ad-btn.is-solid { background: var(--ink); border-color: var(--ink); color: #fff; }
.ad-btn.is-solid:hover:not(:disabled) { background: #262626; border-color: #262626; }
.ad-btn.is-ghost { border-color: transparent; color: var(--ink-2); }
.ad-btn.is-ghost:hover:not(:disabled) { background: var(--bg-hover); color: var(--ink); }
.ad-btn.is-ghost.is-danger { color: #b42318; }
.ad-btn.is-mini { height: 28px; padding: 0 10px; font-size: 12px; }
.ad-btn.is-wide { width: 100%; height: 42px; }
.ad-btn.is-danger { color: #b42318; border-color: #f3d3d0; }
.ad-btn.is-danger:hover:not(:disabled) { background: #fef5f4; border-color: #e8b4ae; }

/* ── Шапка ────────────────────────────────────────────── */
.ad-top {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 60px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(12px);
}
.ad-brand { display: flex; align-items: baseline; gap: 7px; white-space: nowrap; }
.ad-brand b { font-size: 15px; font-weight: 700; letter-spacing: -.02em; }
.ad-brand-sub { color: var(--ink-4); font-size: 11px; font-weight: 550; text-transform: uppercase; letter-spacing: .08em; }
.ad-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink); align-self: center; }

.ad-nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.ad-nav::-webkit-scrollbar { display: none; }
.ad-nav button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-3);
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background .14s, color .14s;
}
.ad-nav button:hover { background: var(--bg-hover); color: var(--ink); }
.ad-nav button.is-on { background: var(--ink); color: #fff; font-weight: 600; }
.ad-nav button.is-on .ad-badge { background: rgba(255,255,255,.22); color: #fff; }
.ad-badge {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 5px;
  background: var(--bg-hover);
  color: var(--ink-3);
  font-size: 10.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.ad-top-right { display: flex; align-items: center; gap: 4px; }
.ad-sync { color: var(--ink-4); font-size: 11.5px; font-variant-numeric: tabular-nums; margin-right: 8px; }

/* ── Контент ──────────────────────────────────────────── */
.ad-main { max-width: 1100px; margin: 0 auto; padding: 28px 24px 96px; display: grid; gap: 36px; }
.ad-section { display: grid; gap: 16px; }
.ad-section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.ad-section-head h2 { margin: 0; font-size: 12px; font-weight: 650; color: var(--ink-4); text-transform: uppercase; letter-spacing: .09em; }
.ad-meta { color: var(--ink-4); font-size: 12px; font-weight: 450; }

/* ── Индикаторы сервера ───────────────────────────────── */
.ad-gauges { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.ad-gauge { padding: 20px 22px; border-right: 1px solid var(--line); display: grid; gap: 11px; }
.ad-gauge:last-child { border-right: 0; }
.ad-gauge-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ad-gauge-label { display: block; font-size: 13.5px; font-weight: 600; }
.ad-gauge-sub { display: block; color: var(--ink-4); font-size: 10.5px; margin-top: 2px; text-transform: uppercase; letter-spacing: .07em; }
.ad-gauge-pct { font-size: 22px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.ad-gauge-bar { height: 5px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.ad-gauge-bar i { display: block; height: 100%; background: var(--ink); border-radius: 999px; transition: width .55s cubic-bezier(.4,0,.2,1); }
.ad-gauge.is-warn .ad-gauge-bar i { background: #52525b; }
.ad-gauge.is-critical .ad-gauge-bar i { background: #b42318; }
.ad-gauge.is-critical .ad-gauge-pct { color: #b42318; }
.ad-gauge-foot { margin: 0; color: var(--ink-3); font-size: 12px; }

/* ── Показатели ───────────────────────────────────────── */
.ad-range { display: flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; }
.ad-range button {
  height: 26px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-3);
  font: inherit;
  font-size: 12px;
  font-weight: 550;
  cursor: pointer;
}
.ad-range button:hover { color: var(--ink); }
.ad-range button.is-on { background: var(--ink); color: #fff; }

.ad-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.ad-stat { padding: 16px 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; gap: 3px; }
.ad-stat > span { color: var(--ink-3); font-size: 12px; }
.ad-stat > b { font-size: 23px; font-weight: 700; letter-spacing: -.035em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.ad-stat > small { color: var(--ink-4); font-size: 11.5px; }

/* ── Панели и графики ─────────────────────────────────── */
.ad-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.ad-panel { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; display: grid; gap: 14px; }
.ad-panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.ad-panel-head h3 { margin: 0; font-size: 13.5px; font-weight: 650; letter-spacing: -.01em; }

.ad-chart { position: relative; }
.ad-chart svg { display: block; width: 100%; height: 132px; overflow: visible; }
.ad-chart-hit { position: absolute; inset: 0; display: flex; }
.ad-chart-hit span { flex: 1; cursor: crosshair; }
.ad-chart-tip {
  position: absolute;
  top: -6px;
  transform: translateX(-50%);
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-size: 11.5px;
  font-weight: 550;
  white-space: nowrap;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}

/* ── Списки ───────────────────────────────────────────── */
.ad-list { display: grid; }
.ad-list-row {
  display: grid;
  grid-template-columns: 24px 1fr auto auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 4px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
  border-radius: 6px;
  transition: background .12s;
}
.ad-list-row:last-child { border-bottom: 0; }
.ad-list-row:hover { background: var(--bg-hover); }
.ad-rank { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 5px; background: var(--bg-hover); color: var(--ink-3); font-size: 10.5px; font-weight: 700; font-style: normal; }
.ad-list-name { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-list-phone { color: var(--ink-4); font-size: 12px; font-variant-numeric: tabular-nums; }
.ad-list-value { font-weight: 650; font-variant-numeric: tabular-nums; }

.ad-sysbar {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  color: var(--ink-4);
  font-size: 12px;
}
.ad-sysbar b { color: var(--ink-2); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ── Таблица ──────────────────────────────────────────── */
.ad-tools { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ad-tools input {
  flex: 1;
  min-width: 180px;
  max-width: 340px;
  height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.ad-tools input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(0,0,0,.06); }

.ad-table { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.ad-row {
  display: grid;
  grid-template-columns: minmax(140px, 1.5fr) 1fr .8fr .7fr .9fr 24px;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px 18px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
  transition: background .12s;
}
.ad-row:last-child { border-bottom: 0; }
.ad-row:hover:not(.ad-row-head) { background: var(--bg-soft); }
.ad-row.is-static { cursor: default; }
.ad-row.is-static:hover { background: transparent; }
.ad-row-head {
  padding: 10px 18px;
  background: var(--bg-soft);
  color: var(--ink-4);
  font-size: 10.5px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .07em;
  cursor: default;
}
.ad-row > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-cell-user { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ad-cell-user b { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-cell-go { color: var(--ink-4); text-align: right; transition: transform .14s, color .14s; }
.ad-row:hover .ad-cell-go { color: var(--ink); transform: translateX(2px); }
.ad-status { width: 7px; height: 7px; border-radius: 50%; background: #d4d4d8; flex: none; }
.ad-status.is-online { background: #16a34a; box-shadow: 0 0 0 3px rgba(22,163,74,.14); }
.ad-status.is-blocked { background: #b42318; }
.ad-status.is-off { background: #e4e4e7; }
.ad-row-staff { grid-template-columns: minmax(140px, 1.5fr) .9fr .8fr 1fr 1fr 28px; }
.ad-del-btn {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #c4c4cc;
  font: inherit;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  transition: background .14s, color .14s;
}
.ad-del-btn:hover:not(:disabled) { background: #fef2f2; color: #b42318; }
.ad-del-btn:disabled { opacity: .4; cursor: not-allowed; }
.ad-note { max-width: 640px; line-height: 1.55; }
.ad-phone { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ad-strong { font-weight: 650; font-variant-numeric: tabular-nums; }
.ad-dim { color: var(--ink-4); }
.ad-mono { font-family: var(--mono); font-size: 12px; }

.ad-tag { display: inline-flex; align-items: center; height: 19px; padding: 0 7px; border-radius: 5px; background: var(--bg-hover); color: var(--ink-3); font-size: 10.5px; font-weight: 600; font-style: normal; white-space: nowrap; }
.ad-tag.is-danger { background: #fef2f2; color: #b42318; }
.ad-tag.is-ok { background: #f0fdf4; color: #15803d; }

.ad-empty { margin: 28px 0; color: var(--ink-4); font-size: 13px; text-align: center; }
.ad-alert { padding: 10px 12px; border-radius: 9px; font-size: 13px; }
.ad-alert.is-err { background: #fef2f2; color: #b42318; }

/* ── Журнал ───────────────────────────────────────────── */
.ad-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.ad-chips button {
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg);
  color: var(--ink-3);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .14s;
}
.ad-chips button:hover { color: var(--ink); border-color: #d4d4d8; }
.ad-chips button.is-on { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }

.ad-log { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; max-height: 620px; overflow-y: auto; }
.ad-log-row {
  display: grid;
  grid-template-columns: 128px 72px 1fr auto;
  gap: 14px;
  align-items: baseline;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}
.ad-log-row:last-child { border-bottom: 0; }
.ad-log-row:hover { background: var(--bg-soft); }
.ad-log-time { color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.ad-log-kind { display: inline-block; padding: 2px 7px; border-radius: 5px; background: var(--bg-hover); color: var(--ink-2); font-size: 10.5px; font-weight: 600; text-align: center; }
.ad-log-text { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; }
.ad-log-actor { color: var(--ink-4); font-size: 11.5px; font-variant-numeric: tabular-nums; }

/* ── Рассылка ─────────────────────────────────────────── */
.ad-compose { max-width: 620px; }
.ad-segment { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 9px; justify-self: start; }
.ad-segment button {
  height: 30px;
  padding: 0 14px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-3);
  font: inherit;
  font-size: 12.5px;
  font-weight: 550;
  cursor: pointer;
  transition: all .14s;
}
.ad-segment button:hover { color: var(--ink); }
.ad-segment button.is-on { background: var(--ink); color: #fff; }

.ad-select {
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  outline: none;
  cursor: pointer;
}
.ad-select:focus { border-color: var(--ink); }
.ad-textarea {
  min-height: 130px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  line-height: 1.55;
  resize: vertical;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.ad-textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(0,0,0,.06); }
.ad-compose-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ── Модалка аккаунта ─────────────────────────────────── */
.ad-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(10,10,10,.34);
  backdrop-filter: blur(3px);
  animation: ad-fade .16s ease-out;
}
@keyframes ad-fade { from { opacity: 0; } to { opacity: 1; } }
.ad-dialog {
  width: 100%;
  max-width: 500px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 24px;
  border-radius: 18px;
  background: var(--bg);
  box-shadow: var(--shadow);
  display: grid;
  gap: 18px;
  animation: ad-rise .2s cubic-bezier(.2,.8,.3,1);
}
@keyframes ad-rise { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
.ad-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.ad-dialog-head h2 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -.025em; }
.ad-dialog-head p { margin: 3px 0 0; color: var(--ink-3); font-size: 13px; font-variant-numeric: tabular-nums; }
.ad-close {
  width: 30px;
  height: 30px;
  flex: none;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-3);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background .14s, color .14s;
}
.ad-close:hover { background: var(--bg-hover); color: var(--ink); }
.ad-close svg { display: block; }
.ad-close path { fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; }
.ad-dialog-badges { display: flex; gap: 6px; flex-wrap: wrap; }

.ad-dl { margin: 0; display: grid; border: 1px solid var(--line-soft); border-radius: 10px; overflow: hidden; }
.ad-dl > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 9px 14px; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.ad-dl > div:last-child { border-bottom: 0; }
.ad-dl dt { margin: 0; color: var(--ink-3); font-size: 12.5px; }
.ad-dl dd { margin: 0; font-weight: 550; text-align: right; word-break: break-word; }

.ad-block { display: grid; gap: 10px; padding-top: 6px; border-top: 1px solid var(--line-soft); }
.ad-block h4 { margin: 0; color: var(--ink-4); font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; }
.ad-inline { display: flex; gap: 8px; flex-wrap: wrap; }
.ad-input {
  flex: 1;
  min-width: 120px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.ad-input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(0,0,0,.06); }
.ad-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.ad-history { display: grid; border: 1px solid var(--line-soft); border-radius: 9px; overflow: hidden; }
.ad-history-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 12px; border-bottom: 1px solid var(--line-soft); font-size: 12.5px; }
.ad-history-row:last-child { border-bottom: 0; }
.ad-pos { color: #15803d; font-weight: 650; font-variant-numeric: tabular-nums; }
.ad-neg { color: #b42318; font-weight: 650; font-variant-numeric: tabular-nums; }

/* ── Всплывающее ──────────────────────────────────────── */
.ad-flash {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  padding: 10px 18px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 550;
  box-shadow: var(--shadow);
  animation: ad-pop .22s ease-out;
}
@keyframes ad-pop { from { opacity: 0; transform: translateX(-50%) translateY(-6px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
.ad-flash.is-ok { background: var(--ink); color: #fff; }
.ad-flash.is-err { background: #b42318; color: #fff; }

/* ── Адаптив ──────────────────────────────────────────── */
@media (max-width: 860px) {
  .ad-row { grid-template-columns: minmax(120px,1.4fr) 1fr auto 20px; }
  .ad-col-role, .ad-col-act, .ad-col-dev { display: none; }
  .ad-log-row { grid-template-columns: 1fr auto; gap: 4px 12px; }
  .ad-log-text { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .ad-top { flex-wrap: wrap; height: auto; padding: 10px 14px; gap: 10px; }
  .ad-nav { order: 3; width: 100%; flex: none; }
  .ad-top-right { margin-left: auto; }
  .ad-sync { display: none; }
  .ad-main { padding: 18px 14px 80px; gap: 26px; }
  .ad-gauges { grid-template-columns: 1fr; }
  .ad-gauge { border-right: 0; border-bottom: 1px solid var(--line); }
  .ad-gauge:last-child { border-bottom: 0; }
  .ad-stats { grid-template-columns: repeat(2, 1fr); }
  .ad-row { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 13px 14px; }
  .ad-cell-user { flex: 1 1 100%; }
  .ad-cell-go { display: none; }
  .ad-charts { grid-template-columns: 1fr; }
  .ad-dialog { padding: 20px; border-radius: 14px; }
  .ad-list-row { grid-template-columns: 22px 1fr auto; }
  .ad-list-phone { display: none; }
}

/* ══ ТОВАРЫ В АДМИНКЕ ═══════════════════════════════════════════════ */
.ad-input {
  width: 100%;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid #e3e8ef;
  border-radius: 12px;
  background: #fff;
  font-size: 14px;
  color: #1d2939;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.ad-input:focus {
  border-color: #38b6ff;
  box-shadow: 0 0 0 3px rgba(56, 182, 255, 0.14);
}
.ad-form-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.ad-field {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #667085;
}
.ad-field .ad-input { margin-top: 6px; }
.ad-check {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  color: #344054;
  cursor: pointer;
}
.ad-check input {
  width: 18px;
  height: 18px;
  accent-color: #38b6ff;
  cursor: pointer;
}
.ad-thumb {
  display: flex;
  justify-content: center;
  padding: 10px;
  border-radius: 14px;
  background: #f7f9fc;
}
.ad-thumb img {
  max-height: 140px;
  border-radius: 10px;
  object-fit: contain;
}
.ad-products {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ad-product {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid #eef1f5;
  border-radius: 14px;
  background: #fff;
}
.ad-product-photo {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  overflow: hidden;
  border-radius: 12px;
  background: #f2f6fb;
  color: #98a2b3;
  font-size: 20px;
  font-weight: 700;
}
.ad-product-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ad-product-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.ad-product-body b {
  font-size: 14px;
  color: #1d2939;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ad-product-body small {
  font-size: 12px;
  color: #667085;
}
.ad-product-actions {
  display: flex;
  gap: 6px;
}
.ad-product-actions .ad-btn {
  padding: 8px 12px;
  font-size: 13px;
}
.ad-btn.is-danger {
  color: #d92d20;
  background: #fef3f2;
}
.ad-btn.is-danger:hover { background: #fee4e2; }

@media (max-width: 760px) {
  .ad-form-row { grid-template-columns: 1fr; }
  .ad-product { grid-template-columns: 48px minmax(0, 1fr); }
  .ad-product-photo { width: 48px; height: 48px; }
  .ad-product-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}


/* ══ ЗОНА ПЕРЕТАСКИВАНИЯ ФОТО В АДМИНКЕ ═════════════════════════════ */
.ad-drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 140px;
  padding: 20px;
  border: 2px dashed #d0d5dd;
  border-radius: 14px;
  background: #fafbfc;
  color: #667085;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.ad-drop:hover,
.ad-drop:focus-visible {
  border-color: #38b6ff;
  background: #f5fbff;
}
.ad-drop.is-over {
  border-color: #38b6ff;
  background: #eaf6ff;
  box-shadow: inset 0 0 0 2px rgba(56, 182, 255, 0.18);
}
.ad-drop-icon {
  width: 40px;
  height: 40px;
  fill: #98a2b3;
}
.ad-drop b {
  font-size: 14px;
  font-weight: 600;
  color: #344054;
}
.ad-drop span {
  font-size: 12px;
  color: #98a2b3;
}
.ad-drop-img {
  max-height: 160px;
  max-width: 100%;
  border-radius: 10px;
  object-fit: contain;
}
.ad-drop-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: rgba(29, 41, 57, 0.72);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  backdrop-filter: blur(4px);
}
.ad-drop-remove:hover { background: rgba(217, 45, 32, 0.85); }
.ad-drop-err {
  margin-top: 6px;
  font-size: 13px;
  color: #d92d20;
}


/* ══ АДМИН: ДОСТАВКИ ══════════════════════════════════════════════ */
.ad-orders { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }

.ad-order.is-closed {
  background: #f7f8fa;
  border-color: #eaecf0;
}
.ad-order.is-closed .ad-order-info dd { color: #667085; }

.ad-order {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #eaecf0;
  border-radius: 14px;
  background: #fff;
}
.ad-order header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.ad-order header b { display: block; font-size: 14.5px; font-weight: 700; color: #101828; }
.ad-order-date { display: block; margin-top: 2px; font-size: 12px; color: #98a2b3; }
.ad-order header strong { font-size: 14.5px; font-weight: 700; color: #101828; white-space: nowrap; }

.ad-order-info { display: grid; gap: 5px; margin: 0; }
.ad-order-info div { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.ad-order-info dt { font-size: 12.5px; color: #667085; }
.ad-order-info dd { margin: 0; font-size: 12.5px; font-weight: 650; color: #101828; text-align: right; word-break: break-word; }

.ad-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.ad-legend span {
  padding: 3px 9px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 650;
  background: #f2f6fb;
  color: #475467;
}
.ad-legend span.is-created { background: #eef6ff; color: #157fbe; }
.ad-legend span.is-shipped { background: #fff6e5; color: #b54708; }
.ad-legend span.is-arrived { background: #e7f7ee; color: #027a48; }
.ad-legend span.is-picked { background: #ecfdf3; color: #067647; }
.ad-legend span.is-canceled { background: #fef3f2; color: #b42318; }

.ad-order-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid #f2f4f7;
}
.ad-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  background: #f2f6fb;
  color: #475467;
}
.ad-pill.is-created { background: #eef6ff; color: #157fbe; }
.ad-pill.is-shipped { background: #fff6e5; color: #b54708; }
.ad-pill.is-arrived { background: #e7f7ee; color: #027a48; }
.ad-pill.is-picked { background: #ecfdf3; color: #067647; }
.ad-pill.is-canceled { background: #fef3f2; color: #b42318; }

.ad-status-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.ad-status-btn {
  padding: 6px 11px;
  border: 1px solid #e4e7ec;
  border-radius: 9px;
  background: #fff;
  color: #475467;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}
.ad-status-btn:hover:not(:disabled) { background: #f8fafc; color: #101828; }
.ad-status-btn.is-on {
  background: #eef6ff;
  border-color: #9ad4ff;
  color: #157fbe;
  cursor: default;
}
.ad-status-btn:disabled { opacity: 0.55; cursor: default; }


/* ══ КОММЕНТАРИЙ И ОТМЕНА ЗАКАЗА ═══════════════════════════════════ */
.ad-order-tools {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #eef2f7;
}
.ad-note-box { display: flex; flex-direction: column; gap: 8px; }
.ad-note-box .ad-btn { align-self: flex-start; }
.ad-note-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ad-status-btn.ad-danger {
  border-color: #fecdca;
  color: #b42318;
  background: #fff;
}
.ad-order-tools > .ad-status-btn.ad-danger { align-self: flex-start; margin-top: 2px; }
.ad-status-btn.ad-danger:hover:not(:disabled) { background: #fef3f2; }
.ad-cancel-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #fecdca;
  background: #fffbfa;
}
.ad-cancel-box > b { font-size: 13.5px; font-weight: 700; color: #b42318; }
.ad-cancel-box .ad-meta { margin: 0; font-size: 12px; }
.ad-cancel-err { margin: 0; font-size: 12px; font-weight: 600; color: #b42318; }
.ad-canceled {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 12px;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1px solid #fecdca;
  background: #fef3f2;
}
.ad-canceled b { font-size: 13px; font-weight: 700; color: #b42318; }
.ad-canceled span { font-size: 12.5px; color: #912018; }
.ad-canceled small { font-size: 11.5px; color: #b42318; opacity: 0.8; }


/* Клиент забрал заказ — статус менять нельзя */
.ad-locked {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border: 1px solid #d0d5dd;
  border-radius: 9px;
  background: #f2f4f7;
  color: #475467;
  font-size: 12px;
  font-weight: 650;
}

/* ══ Боковая панель ═════════════════════════════════════════════════ */
.ad-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  background: #f3f6fb;
}
.ad-shell.ad-center {
  display: grid;
  grid-template-columns: 1fr;
  background: #f3f6fb;
}
.ad-login {
  background: #fff;
  border-color: #e4e7ec;
  box-shadow: 0 18px 50px rgba(16, 24, 40, 0.08);
}
.ad-btn.is-solid,
.ad-btn.is-solid:hover:not(:disabled) {
  background: #157fbe;
  border-color: #157fbe;
}
.ad-side {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: 100vh;
  padding: 22px 14px 16px;
  background: #10233d;
  color: #fff;
}
.ad-side .ad-brand {
  align-items: center;
  gap: 10px;
  padding: 0 8px;
}
.ad-side .ad-brand b { font-size: 18px; letter-spacing: -0.03em; }
.ad-side .ad-brand-sub {
  display: block;
  margin-top: 2px;
  color: #98a2b3;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: none;
}
.ad-side .ad-dot { background: #38b6ff; width: 8px; height: 8px; }
.ad-side .ad-nav {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
  flex: 1;
  overflow: auto;
  padding-right: 2px;
}
.ad-nav-group { display: grid; gap: 4px; }
.ad-nav-label {
  padding: 0 10px 4px;
  color: #98a2b3;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.ad-side .ad-nav button {
  width: 100%;
  justify-content: space-between;
  height: 36px;
  color: #e4e7ec;
  background: transparent;
}
.ad-side .ad-nav button:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.ad-side .ad-nav button.is-on { background: #157fbe; color: #fff; }
.ad-side .ad-badge { background: rgba(255, 255, 255, 0.14); color: #fff; }
.ad-side-foot {
  display: grid;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.ad-side .ad-sync { margin: 0 8px 4px; color: #98a2b3; }
.ad-side .ad-btn,
.ad-side .ad-btn.is-ghost {
  justify-content: flex-start;
  width: 100%;
  background: transparent;
  border-color: transparent;
  color: #e4e7ec;
}
.ad-side .ad-btn:hover:not(:disabled),
.ad-side .ad-btn.is-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.08); border-color: transparent; color: #fff; }
.ad-work { min-width: 0; }
.ad-work .ad-top {
  height: 72px;
  padding: 0 28px;
  border-bottom: 0;
  background: transparent;
  backdrop-filter: none;
}
.ad-work .ad-top h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.ad-work .ad-main { max-width: 1180px; padding-top: 8px; }
.ad-panel,
.ad-gauges,
.ad-stats,
.ad-table,
.ad-log,
.ad-sysbar {
  background: #fff;
}
.ad-gauge-bar i,
.ad-range button.is-on { background: #157fbe; }
.ad-field input:focus { border-color: #157fbe; box-shadow: 0 0 0 3px rgba(21, 127, 190, 0.15); }
.ad-chart-tip { background: #10233d; }

@media (max-width: 860px) {
  .ad-shell { grid-template-columns: 1fr; }
  .ad-side {
    position: sticky;
    top: 0;
    z-index: 40;
    height: auto;
    padding: 12px;
    gap: 10px;
  }
  .ad-side .ad-nav {
    flex-direction: row;
    overflow-x: auto;
    gap: 14px;
  }
  .ad-nav-group { display: flex; align-items: center; gap: 4px; }
  .ad-nav-label { display: none; }
  .ad-side .ad-nav button { width: auto; }
  .ad-side-foot { display: flex; align-items: center; border-top: 0; padding-top: 0; }
  .ad-side .ad-btn.is-ghost { width: auto; }
  .ad-work .ad-top { height: auto; padding: 16px 16px 0; }
  .ad-work .ad-top .ad-meta { display: none; }
}

/* Крестик админки — без фона, как во всех окнах */
.ad-close {
  width: 36px !important; height: 36px !important; padding: 0 !important;
  border: 0 !important; border-radius: 0 !important;
  background: transparent !important; box-shadow: none !important;
  color: var(--ink-3) !important; font-size: 22px !important; font-weight: 400 !important;
  display: inline-flex !important; align-items: center !important; justify-content: center !important;
  flex: 0 0 36px !important; cursor: pointer !important;
}
.ad-close:hover { background: transparent !important; color: var(--ink) !important; }
.ad-close svg { width: 18px !important; height: 18px !important; display: block !important; }
.ad-close path { fill: none !important; stroke: currentColor !important; stroke-width: 1.75 !important; stroke-linecap: round !important; }

/* ad-ship-min */
@media (min-width: 861px) {
  .ad-shell { display: block; background: #f3f6fb; }
  .ad-side {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 248px;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    z-index: 30;
    background: #10233d;
  }
  .ad-side .ad-nav { min-height: 0; overflow: auto; }
  .ad-work { margin-left: 248px; min-height: 100dvh; background: #f3f6fb; }
}
.ad-ships { display: flex; flex-direction: column; gap: 8px; }
.ad-ship {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid #eaecf0;
  border-radius: 12px;
  background: #fff;
}
.ad-ship.is-closed { background: #f8fafc; }
.ad-ship-top { display: flex; align-items: center; gap: 12px; }
.ad-ship-title { min-width: 0; flex: 1; }
.ad-ship-title b { display: block; font-size: 14px; font-weight: 650; color: #101828; }
.ad-ship-title span { display: block; margin-top: 2px; color: #98a2b3; font-size: 12px; }
.ad-ship-top strong { font-size: 14px; font-weight: 650; white-space: nowrap; }
.ad-ship-who {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 0;
  color: #667085;
  font-size: 13px;
}
.ad-ship-steps { display: flex; flex-wrap: wrap; gap: 4px; }
.ad-ship-steps button {
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: #f2f4f7;
  color: #344054;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.ad-ship-steps button.is-on { background: #10233d; color: #fff; }
.ad-ship-steps button:disabled { cursor: default; }
.ad-ship-state { margin: 0; font-size: 12px; color: #067647; }
.ad-ship-state.is-bad { color: #b42318; }
.ad-ship-tools { display: flex; flex-direction: column; gap: 8px; }
.ad-ship-note, .ad-ship-actions { display: flex; align-items: center; gap: 8px; }
.ad-ship-note input {
  flex: 1;
  min-width: 0;
  height: 32px;
  border: 1px solid #eaecf0;
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
  font: inherit;
  font-size: 13px;
  color: #101828;
}
.ad-ship-note input:focus { outline: none; border-color: #157fbe; }
.ad-ship-save, .ad-ship-muted {
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.ad-ship-save { color: #157fbe; }
.ad-ship-muted { color: #667085; }
.ad-ship-muted.is-danger, .ad-ship .ad-danger { color: #d92d20; background: transparent; }
.ad-ship .ad-cancel-box { display: flex; flex-direction: column; gap: 8px; }
.ad-ship .ad-cancel-box p { margin: 0; }
.ad-ship .ad-input { height: 32px; }
