/* =====================================================
   AGV admin — синий, красный, чёрный, серый, белый
   ===================================================== */
:root {
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, Menlo, monospace;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  /* AGV: синий, красный, чёрный, серый, белый */
  --blue: #2f6bff;
  --blue-soft: #4c8dff;
  --red: #ff3b4a;
  --ok: #4c8dff;
  --warn: #aab6d3;
  --bad: #ff3b4a;
  --info: #7c9cff;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --radius: 10px;
  --side: 232px;
  --top: 60px;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #05060a;
  --bg-soft: #090b12;
  --panel: #0c0f18;
  --ink: #f4f6fb;
  --muted: #8d96ab;
  --dim: #566077;
  --line: #182036;
  --line2: #26304d;
  --glow: rgba(47, 107, 255, .16);
  --accent: #2f6bff;
  --on-accent: #ffffff;
  --shade: rgba(0, 0, 0, .65);
}
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f5fb;
  --bg-soft: #ffffff;
  --panel: #ffffff;
  --ink: #0a0d16;
  --muted: #566080;
  --dim: #98a1bb;
  --line: #dde3f1;
  --line2: #c9d1e6;
  --glow: rgba(47, 107, 255, .12);
  --accent: #2f6bff;
  --on-accent: #ffffff;
  --shade: rgba(10, 13, 22, .35);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background .3s ease, color .3s ease;
  overflow-x: hidden;
}
a { color: inherit; }
h1, h2, h3 { font-weight: 500; letter-spacing: -.03em; line-height: 1.1; margin: 0; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { display: block; flex: none; }
.mono { font-family: var(--mono); font-size: 11.5px; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); }
.code { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.ic { width: 18px; height: 18px; }

/* ---------- layout ---------- */
.top {
  position: sticky; top: 0; z-index: 40; height: var(--top);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top-in { height: 100%; display: flex; align-items: center; gap: 16px; padding: 0 20px; }
.logo { display: flex; align-items: center; gap: 9px; text-decoration: none; font-weight: 600; font-size: 17px; letter-spacing: -.03em; }
.logo svg { width: 22px; height: 22px; }
.logo:hover svg { animation: spin 2.4s linear infinite; }
.logo small { font-family: var(--mono); font-size: 11px; color: var(--dim); font-weight: 400; letter-spacing: .02em; }
@keyframes spin { to { transform: rotate(360deg); } }
.top-title { font-size: 15px; color: var(--muted); padding-left: 16px; border-left: 1px solid var(--line); }
.top-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.status { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.status i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(61, 220, 132, .5); animation: pulse 2s infinite; }
.status.warn i { background: var(--warn); animation: none; }
.status.bad i { background: var(--bad); animation: none; }
.status.busy i { background: var(--info); animation: pulse-info 1.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(61, 220, 132, .5); } 70%, 100% { box-shadow: 0 0 0 9px rgba(61, 220, 132, 0); } }
@keyframes pulse-info { 0% { box-shadow: 0 0 0 0 rgba(90, 169, 255, .55); } 70%, 100% { box-shadow: 0 0 0 9px rgba(90, 169, 255, 0); } }

.shell { display: flex; min-height: calc(100vh - var(--top)); }
.side {
  width: var(--side); flex: none; border-right: 1px solid var(--line);
  position: sticky; top: var(--top); height: calc(100vh - var(--top));
  display: flex; flex-direction: column; padding: 18px 12px; gap: 2px;
}
.side .mono { padding: 6px 12px 10px; }
.nav-btn {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 12px; border-radius: 8px; border: 1px solid transparent;
  background: none; color: var(--muted); cursor: pointer; text-align: left; font-size: 14.5px;
  transition: color .2s, background .2s, border-color .2s;
}
.nav-btn:hover { color: var(--ink); background: var(--panel); }
.nav-btn.active { color: var(--ink); background: var(--panel); border-color: var(--line2); box-shadow: inset 3px 0 0 var(--accent); }
.nav-btn .n { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--dim); }
.side-foot { margin-top: auto; padding: 12px; border-top: 1px solid var(--line); }

.main { flex: 1; min-width: 0; padding: 32px 32px 80px; position: relative; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; position: relative; }
.page-head h1 { font-size: clamp(28px, 4vw, 44px); }
.page-head .mono { display: block; margin-bottom: 10px; }
.ghost {
  position: absolute; right: 0; top: -18px; pointer-events: none; user-select: none;
  font-family: var(--mono); font-weight: 700; font-size: clamp(60px, 10vw, 128px); line-height: 1;
  color: var(--ink); opacity: .04;
}
.tab-enter { animation: tabIn .35s var(--ease); }
@keyframes tabIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* bottom nav (phone) */
.bnav { display: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border-radius: 6px;
  background: var(--accent); color: var(--on-accent); border: 1px solid var(--accent);
  font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .25s var(--ease), opacity .25s, background .25s, border-color .25s, color .25s;
}
.btn:hover { transform: translateY(-2px); opacity: .92; }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn .ic { width: 16px; height: 16px; }
.btn-line { background: transparent; color: var(--ink); border-color: var(--line2); }
.btn-line:hover { background: var(--panel); border-color: var(--muted); opacity: 1; }
.btn-ghost { background: transparent; color: var(--muted); border-color: transparent; }
.btn-ghost:hover { color: var(--ink); background: var(--panel); opacity: 1; }
.btn-danger { background: transparent; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line2)); }
.btn-danger:hover { background: color-mix(in srgb, var(--bad) 10%, transparent); opacity: 1; }
.btn-sm { min-height: 32px; padding: 0 11px; font-size: 13px; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; flex: none;
  background: transparent; color: var(--ink); border: 1px solid var(--line2); border-radius: 6px; cursor: pointer;
  transition: border-color .25s var(--ease), background .25s var(--ease), transform .25s var(--ease), color .2s;
}
.icon-btn:hover { border-color: var(--muted); background: var(--panel); transform: translateY(-2px); }
.icon-btn.sm { width: 32px; height: 32px; }
.icon-btn.sm .ic { width: 15px; height: 15px; }
.icon-btn.bare { border-color: transparent; color: var(--muted); }
.icon-btn.bare:hover { color: var(--ink); border-color: var(--line2); }
.icon-btn.danger:hover { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line2)); }
html[data-theme="dark"] .i-sun { display: none; }
html[data-theme="light"] .i-moon { display: none; }
.spin { animation: spin 1s linear infinite; }

/* ---------- cards ---------- */
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 22px; position: relative; overflow: hidden;
}
.card.glow::before { content: ""; position: absolute; inset: 0; background: radial-gradient(420px circle at 50% 0, var(--glow), transparent 55%); pointer-events: none; }
.card > * { position: relative; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head h2 { font-size: 20px; }
.card-head .mono { display: block; margin-bottom: 6px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.hatch { height: 12px; border-radius: 6px; background: repeating-linear-gradient(-45deg, transparent 0 6px, var(--line) 6px 7px); }

/* stats strip — как на сайте */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg); }
.stats > div { padding: 22px; border-right: 1px solid var(--line); min-width: 0; }
.stats > div:last-child { border-right: 0; }
.stats b { display: block; font-size: clamp(26px, 3vw, 38px); font-weight: 500; letter-spacing: -.03em; line-height: 1.1; }
.stats .mono { display: block; margin-top: 6px; }
.stats small { display: block; color: var(--dim); font-size: 12px; margin-top: 4px; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-family: var(--mono); font-size: 11px; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); }
.field .hint { font-size: 12px; color: var(--dim); }
.field > label.switch { font-family: var(--sans); font-size: inherit; text-transform: none; letter-spacing: 0; color: var(--ink); }
.input, .select, .textarea {
  width: 100%; min-height: 40px; padding: 9px 12px;
  background: var(--bg); border: 1px solid var(--line2); border-radius: 8px; outline: none;
  transition: border-color .2s, box-shadow .2s; font-size: 14px;
}
.textarea { min-height: 96px; resize: vertical; font-family: var(--mono); font-size: 12.5px; line-height: 1.55; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--muted); box-shadow: 0 0 0 3px var(--glow); }
.input::placeholder, .textarea::placeholder { color: var(--dim); }
.select { appearance: none; padding-right: 34px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 17px, calc(100% - 12px) 17px; background-size: 5px 5px; background-repeat: no-repeat; }
.input-group { display: flex; gap: 8px; align-items: stretch; }
.input-group .input { flex: 1; min-width: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }

/* switch */
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .tr { width: 38px; height: 22px; border-radius: 22px; background: var(--line2); position: relative; flex: none; transition: background .2s; }
.switch .tr::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); transition: transform .25s var(--ease); }
.switch input:checked + .tr { background: var(--ok); }
.switch input:checked + .tr::after { transform: translateX(16px); }
.switch input:focus-visible + .tr { box-shadow: 0 0 0 3px var(--glow); }
.switch .t { font-size: 14px; }
.switch .t small { display: block; color: var(--dim); font-size: 12px; }

/* segmented */
.seg { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line2); border-radius: 8px; background: var(--bg); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { border: 0; background: none; color: var(--muted); padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 13.5px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--panel); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line2); }
.seg .n { font-family: var(--mono); font-size: 11px; color: var(--dim); }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px; font-family: var(--mono); font-size: 11px; letter-spacing: .02em; border: 1px solid var(--line2); color: var(--muted); white-space: nowrap; }
.badge i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, var(--line2)); }
.badge.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, var(--line2)); }
.badge.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, var(--line2)); }
.badge.info { color: var(--info); border-color: color-mix(in srgb, var(--info) 35%, var(--line2)); }
.tdot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }

/* ---------- links (видны целиком и на телефоне) ---------- */
.link-box {
  display: flex; align-items: flex-start; gap: 8px; padding: 10px 10px 10px 12px;
  background: var(--bg); border: 1px solid var(--line2); border-radius: 8px;
}
.link-box .code { flex: 1; min-width: 0; word-break: break-all; overflow-wrap: anywhere; line-height: 1.5; padding-top: 6px; user-select: all; }
.link-box .lbl { display: block; font-family: var(--mono); font-size: 10.5px; color: var(--dim); text-transform: uppercase; margin-bottom: 2px; user-select: none; }

/* ---------- list / table ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .search { flex: 1; min-width: 200px; position: relative; }
.toolbar .search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--dim); width: 16px; height: 16px; }
.toolbar .search .input { padding-left: 36px; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-family: var(--mono); font-size: 11px; font-weight: 400; text-transform: uppercase; letter-spacing: .03em; color: var(--dim); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: var(--bg-soft); }
.table .chk { width: 36px; }
.table-wrap { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--panel); }
.cell-title { font-weight: 600; }
.cell-sub { font-size: 12.5px; color: var(--dim); }
.clickable { cursor: pointer; }
input[type="checkbox"].cb { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.bar { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin-top: 6px; min-width: 70px; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.bar.warn > i { background: var(--warn); }
.bar.bad > i { background: var(--bad); }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty .ic { width: 28px; height: 28px; margin: 0 auto 12px; color: var(--dim); }

/* карточки-строки для телефона */
.cards { display: none; flex-direction: column; gap: 10px; }
.item-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.item-card .top-row { display: flex; align-items: flex-start; gap: 10px; }
.item-card .meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; font-size: 13px; }
.item-card .meta .mono { display: block; font-size: 10.5px; }

.pager { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.pager .info { margin-left: auto; font-family: var(--mono); font-size: 11.5px; color: var(--dim); }

/* bulk bar */
.bulk {
  position: sticky; bottom: 16px; z-index: 30; margin-top: 14px;
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding: 10px 12px; background: var(--panel); border: 1px solid var(--line2); border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .35); animation: tabIn .25s var(--ease);
}

/* ---------- modal / drawer ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; background: var(--shade); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal { width: 100%; max-width: 560px; max-height: calc(100vh - 40px); overflow: auto; background: var(--panel); border: 1px solid var(--line2); border-radius: 16px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); animation: pop .3s var(--ease); }
.modal.wide { max-width: 760px; }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; background: var(--panel); border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 19px; }
.modal-body { padding: 20px; }
.modal-foot { position: sticky; bottom: 0; display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; background: var(--panel); border-top: 1px solid var(--line); flex-wrap: wrap; }
.overlay.drawer { justify-content: flex-end; padding: 0; align-items: stretch; }
.overlay.drawer .modal { max-width: 620px; max-height: none; height: 100%; border-radius: 0; border-width: 0 0 0 1px; animation: slideIn .35s var(--ease); }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }

.section { padding: 18px 0; border-bottom: 1px solid var(--line); }
.section:first-child { padding-top: 0; }
.section:last-child { border-bottom: 0; padding-bottom: 0; }
.section > .mono { display: block; margin-bottom: 12px; }
.kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.kv > div { padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); min-width: 0; }
.kv b { display: block; font-size: 18px; font-weight: 500; letter-spacing: -.02em; overflow-wrap: anywhere; }
.kv .mono { display: block; font-size: 10.5px; margin-top: 2px; }
.ip-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.ip-row:last-child { border-bottom: 0; }
.hist { font-size: 13px; }
.hist li { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.hist li:last-child { border-bottom: 0; }
.hist .mono { flex: none; width: 118px; font-size: 10.5px; padding-top: 2px; }
ul.plain { list-style: none; margin: 0; padding: 0; }

/* ---------- toast ---------- */
.toasts { position: fixed; z-index: 200; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line2); border-radius: 10px; box-shadow: 0 18px 50px rgba(0, 0, 0, .4); font-size: 14px; animation: pop .25s var(--ease); transition: opacity .3s, transform .3s; }
.toast .ic { width: 16px; height: 16px; margin-top: 2px; }
.toast.ok .ic { color: var(--ok); }
.toast.error .ic { color: var(--bad); }
.toast.info .ic { color: var(--info); }

/* ---------- parser ---------- */
.src { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.src-row { display: flex; gap: 8px; align-items: flex-start; }
.src-row .num { font-family: var(--mono); font-size: 11px; color: var(--dim); padding-top: 11px; width: 18px; flex: none; }
/* поле ссылки растягивается по высоте — ссылку видно целиком даже на телефоне */
.url-input { flex: 1; min-width: 0; resize: none; overflow: hidden; min-height: 40px; font-family: var(--mono); font-size: 12.5px; line-height: 1.5; word-break: break-all; }
.src-stat { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding-left: 26px; font-size: 12.5px; color: var(--muted); }
.src-stat .err { color: var(--bad); }
.timeline { display: flex; flex-direction: column; }
.timeline .t-row { display: grid; grid-template-columns: 112px 1fr auto; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.timeline .t-row:last-child { border-bottom: 0; }
.server-name { font-weight: 500; overflow-wrap: anywhere; }
.proto { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; color: var(--dim); }

/* tariffs */
.tariff { display: flex; flex-direction: column; gap: 14px; border-top: 3px solid var(--tc, var(--line2)); }
.tariff .price { font-size: 34px; font-weight: 500; letter-spacing: -.03em; }
.tariff .price small { font-size: 14px; color: var(--muted); font-weight: 400; }
.tariff ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--muted); }
.tariff ul li { display: flex; gap: 8px; align-items: center; }
.tariff ul .ic { width: 15px; height: 15px; color: var(--ink); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-check { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--line2); border-radius: 999px; cursor: pointer; font-size: 13px; user-select: none; }
.chip-check input { accent-color: var(--accent); }
.chip-check:has(input:checked) { border-color: var(--accent); background: var(--bg); }

/* skeleton */
.skeleton { height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--line) 0%, var(--line2) 50%, var(--line) 100%); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* footer word как на сайте */
.word { margin-top: 60px; font-size: clamp(64px, 14vw, 180px); font-weight: 700; letter-spacing: -.06em; line-height: .8; text-align: center; color: transparent; background: repeating-linear-gradient(180deg, var(--line2) 0 2px, transparent 2px 7px); -webkit-background-clip: text; background-clip: text; user-select: none; overflow: hidden; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: flex; flex-direction: column; }
.login-main { flex: 1; display: grid; place-items: center; padding: 40px 20px; }
.login-card { width: 100%; max-width: 420px; }
.login-card h1 { font-size: clamp(30px, 6vw, 44px); margin: 14px 0 8px; }
.login-card h1 mark { background: var(--accent); color: var(--on-accent); padding: 0 .12em; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats > div:nth-child(2) { border-right: 0; }
  .stats > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  :root { --top: 56px; }
  .side { display: none; }
  .top-in { padding: 0 16px; gap: 10px; }
  .top-title { display: none; }
  .main { padding: 22px 16px 110px; }
  .page-head { margin-bottom: 18px; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .kv { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card { padding: 16px; border-radius: 12px; }
  .table-wrap.responsive { display: none; }
  .cards { display: flex; }
  .bnav {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bnav button { display: flex; flex-direction: column; align-items: center; gap: 3px; background: none; border: 0; color: var(--dim); padding: 6px 0; font-size: 10.5px; cursor: pointer; min-width: 0; }
  .bnav button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bnav button .ic { width: 20px; height: 20px; }
  .bnav button.active { color: var(--ink); }
  .toasts { bottom: calc(76px + env(safe-area-inset-bottom)); right: 12px; left: 12px; max-width: none; }
  .bulk { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .overlay { padding: 0; align-items: flex-end; }
  .modal { max-height: 92vh; border-radius: 16px 16px 0 0; border-width: 1px 0 0; animation: up .3s var(--ease); }
  @keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
  .overlay.drawer .modal { max-height: 94vh; height: auto; border-radius: 16px 16px 0 0; border-width: 1px 0 0; }
  .modal-foot .btn { flex: 1; }
  .timeline .t-row { grid-template-columns: 1fr auto; }
  .timeline .t-row .when { grid-column: 1 / -1; }
  .ghost { display: none; }
  .src-row { flex-wrap: wrap; justify-content: flex-end; }
  .src-row .num { display: none; }
  .src-row .url-input { flex: 1 1 100%; }
  .src-stat { padding-left: 0; }
  .hide-sm { display: none !important; }
}
@media (max-width: 480px) {
  .stats > div { padding: 16px; }
  .toolbar .search { min-width: 100%; }
  .btn { min-height: 42px; }
  .hist .mono { width: 92px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* AGV: красная опасная кнопка и акценты */
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.icon-btn.danger:hover { color: var(--red); border-color: var(--red); }
.logo .mark { width: 24px; height: 24px; border-radius: 7px; background: linear-gradient(135deg, var(--blue), #1b3fb8); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; letter-spacing: -.02em; }
.logo:hover .mark { background: linear-gradient(135deg, var(--red), #b3162a); transition: background .4s; }

/* Безопасность и 2FA */
.sec-list { display: flex; flex-direction: column; }
.sec-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.sec-item:last-child { border-bottom: 0; }
.sec-item .grow b { display: block; font-weight: 600; font-size: 14px; }
.sec-item .grow span { color: var(--dim); font-size: 12.5px; }
.qr-box { display: grid; place-items: center; width: 212px; height: 212px; padding: 10px; background: #fff; border-radius: 12px; margin: 0 auto; }
.qr-box svg, .qr-box img { width: 100%; height: 100%; display: block; }
.secret { font-family: var(--mono); font-size: 14px; letter-spacing: .08em; word-break: break-all; text-align: center; padding: 10px; border: 1px dashed var(--line2); border-radius: 8px; user-select: all; }
.rec-codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; font-family: var(--mono); font-size: 14px; padding: 14px; border: 1px solid var(--line2); border-radius: 10px; background: var(--bg); }
.rec-codes span { text-align: center; user-select: all; }
.otp-input { text-align: center; font-family: var(--mono); font-size: 26px; letter-spacing: .4em; padding-left: .4em; }

/* =====================================================
   AGV design v2: Onest + Unbounded, синий и красный по делу, без капса и водяных знаков
   ===================================================== */
:root {
  --sans: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --display: "Unbounded", "Onest", system-ui, sans-serif;
  --radius: 14px;
}
body { font-family: var(--sans); font-size: 15px; letter-spacing: 0; }
h1, h2, h3 { font-family: var(--sans); letter-spacing: -.01em; }

/* подписи: обычный регистр, без моноширинного капса */
.mono { font-family: var(--sans); font-size: 12.5px; letter-spacing: 0; text-transform: none; color: var(--muted); }
.table .mono, .t-row .mono { font-family: var(--mono); font-size: 12px; }
.page-head > div > .mono, .card-head .mono, .side > .mono, .login-card > .mono { display: none; }
.ghost, .word { display: none !important; }
.page-head { align-items: center; margin-bottom: 22px; }
.page-head h1 { font-family: var(--display); font-size: clamp(21px, 3vw, 28px); font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
.card-head h2 { font-size: 18px; font-weight: 600; }

/* шапка: тонкая «линия сигнала» синий → красный */
.top { position: sticky; }
.top::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: linear-gradient(90deg, var(--blue) 0%, var(--blue) 60%, var(--red) 100%); opacity: .85; pointer-events: none; }
.logo { font-family: var(--display); font-weight: 600; font-size: 15px; letter-spacing: .02em; }
.logo small { font-family: var(--sans); font-size: 12px; letter-spacing: 0; }
.logo .mark { background: linear-gradient(135deg, var(--blue) 0 56%, var(--red) 56% 100%); border-radius: 8px; width: 26px; height: 26px; font-family: var(--display); font-size: 12px; }
.logo:hover .mark { background: linear-gradient(135deg, var(--blue) 0 56%, var(--red) 56% 100%); transition: none; }
.top-title { font-weight: 500; }
.status { font-family: var(--sans); text-transform: none; letter-spacing: 0; font-size: 12.5px; }

/* меню */
.nav-btn { border-radius: 10px; font-weight: 500; }
.nav-btn:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.nav-btn.active { background: color-mix(in srgb, var(--blue) 15%, transparent); border-color: color-mix(in srgb, var(--blue) 38%, transparent); box-shadow: none; color: var(--ink); }
.nav-btn.active .ic { color: var(--blue-soft); }
.nav-btn .n { font-family: var(--sans); }

/* карточки и поля */
.card { border-radius: 16px; background: var(--panel); }
.card.glow::before { display: none; }
.btn { border-radius: 10px; font-weight: 600; }
.btn:hover { opacity: 1; filter: brightness(1.12); transform: none; }
.btn-line:hover { filter: none; }
.input, .select, .textarea { border-radius: 10px; }
.btn:focus-visible, .icon-btn:focus-visible, .nav-btn:focus-visible, .seg button:focus-visible, .input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: 2px solid var(--blue-soft); outline-offset: 2px; }
.seg { border-radius: 12px; }
.seg button.on { background: color-mix(in srgb, var(--blue) 18%, var(--panel)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--blue) 45%, transparent); }
.badge { font-family: var(--sans); font-size: 12px; text-transform: none; letter-spacing: 0; }

/* таблицы */
.table th { font-family: var(--sans); font-size: 12.5px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--muted); }
.table tbody tr:hover { background: color-mix(in srgb, var(--blue) 6%, transparent); }

/* плитки с цифрами */
.stats { border: 0; background: none; gap: 12px; border-radius: 0; overflow: visible; }
.stats > div { border: 1px solid var(--line); border-radius: 16px; background: var(--panel); padding: 18px 20px; }
.stats b { font-family: var(--display); font-size: clamp(22px, 2.6vw, 30px); font-weight: 600; letter-spacing: -.02em; }
.stats .mono { margin-top: 8px; font-size: 13px; color: var(--ink); font-weight: 500; }
.stats small { margin-top: 2px; }
.stats > div.hot { border-color: color-mix(in srgb, var(--red) 55%, var(--line)); background: color-mix(in srgb, var(--red) 9%, var(--panel)); }
.stats > div.hot b { color: var(--red); }

/* полоса «Нужно внимание» */
.attn { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.attn a { display: inline-flex; align-items: center; gap: 12px; padding: 11px 16px; border-radius: 12px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 14px; border: 1px solid color-mix(in srgb, var(--red) 50%, var(--line)); background: color-mix(in srgb, var(--red) 10%, var(--panel)); transition: border-color .2s; }
.attn a:hover { border-color: var(--red); }
.attn a b { font-family: var(--display); font-size: 17px; color: var(--red); }
.attn a.blue { border-color: color-mix(in srgb, var(--blue) 50%, var(--line)); background: color-mix(in srgb, var(--blue) 11%, var(--panel)); }
.attn a.blue:hover { border-color: var(--blue); }
.attn a.blue b { color: var(--blue-soft); }
.attn .calm { display: inline-flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--blue) 35%, var(--line)); background: color-mix(in srgb, var(--blue) 8%, var(--panel)); font-weight: 500; }
.attn .calm i { width: 8px; height: 8px; border-radius: 50%; background: var(--blue-soft); box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 25%, transparent); }

/* вход */
.login-wrap { background: radial-gradient(900px 520px at 12% -5%, rgba(47, 107, 255, .20), transparent 60%), radial-gradient(700px 440px at 100% 105%, rgba(255, 59, 74, .12), transparent 60%); }
.login-card h1 { font-family: var(--display); font-size: clamp(24px, 5vw, 32px); font-weight: 600; letter-spacing: -.02em; margin: 0 0 8px; }
.login-card .card { border-radius: 18px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-head h1 { font-size: 22px; }
  .main { padding: 20px 16px 96px; }
  .attn a, .attn .calm { width: 100%; }
}

/* плитка с цифрой: обзор, магазин, рефералка */
.tile { border: 1px solid var(--line); border-radius: 16px; background: var(--panel); padding: 16px 18px; min-width: 0; }
.tile b { display: block; font-family: var(--display); font-size: clamp(20px, 2.3vw, 26px); font-weight: 600; letter-spacing: -.02em; line-height: 1.15; }
.tile span { display: block; margin-top: 8px; font-size: 13px; font-weight: 500; color: var(--ink); }
.tile.hot { border-color: color-mix(in srgb, var(--red) 55%, var(--line)); background: color-mix(in srgb, var(--red) 9%, var(--panel)); }
.tile.hot b { color: var(--red); }

/* цифры набираем Onest: у Unbounded «0» читается как буква «О» */
.stats b, .tile b, .attn a b { font-family: var(--sans); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stats b { font-size: clamp(24px, 2.8vw, 32px); }
.tile b { font-size: clamp(22px, 2.4vw, 28px); }
.tariff .price { font-size: 22px; font-weight: 600; line-height: 1.25; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.tariff .price small { font-size: 13px; font-weight: 400; color: var(--muted); white-space: nowrap; }

/* подписи полей: обычный регистр */
.field > label, .field > .label, label.lbl { font-family: var(--sans); text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 500; color: var(--muted); }
.hint { font-family: var(--sans); font-size: 12.5px; }
.login-card .mark.big { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 15px; margin-bottom: 18px; background: linear-gradient(135deg, var(--blue) 0 56%, var(--red) 56% 100%); color: #fff; font-family: var(--display); font-weight: 700; font-size: 22px; }

.dotx { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--dim); }
.dotx.red { background: var(--red); box-shadow: 0 0 0 4px color-mix(in srgb, var(--red) 20%, transparent); }
.dotx.gray { background: var(--muted); }
