/* ═══════════════════════════════════════════════════════════════
   dap · админ-панель
   ═══════════════════════════════════════════════════════════════ */

:root {
  --bg: #08060e;
  --panel: #100c19;
  --panel-2: #151020;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #f4f0fb;
  --muted: #a39ab7;
  --muted-2: #756d89;
  --pink: #ff3d6e;
  --pink-soft: #ff7a97;
  --green: #3ddc97;
  --violet: #a566ff;
  --amber: #ffc857;
  --red: #ff5470;
  --grad: linear-gradient(120deg, #ff5478, #d91a4b);
  --font-body: "Manrope", "Segoe UI", system-ui, sans-serif;
  --font-display: "Unbounded", "Manrope", sans-serif;
  --r: 18px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body.no-scroll {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.03em;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

img {
  display: block;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: radial-gradient(900px 500px at 50% -10%, #1a0d22, transparent 60%), var(--bg);
}

.bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
}

.bg-glow-1 {
  width: 520px;
  height: 520px;
  top: -240px;
  right: -100px;
  background: rgba(255, 61, 110, 0.28);
}

.bg-glow-2 {
  width: 560px;
  height: 560px;
  bottom: -260px;
  left: -200px;
  background: rgba(109, 51, 201, 0.2);
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.024) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.024) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent 70%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent 70%);
}

/* ── бренд ───────────────────────────────────────────────── */

.admin-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.admin-brand img {
  border-radius: 10px;
  box-shadow: 0 6px 16px rgba(225, 29, 72, 0.3);
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.06em;
  line-height: 1;
  background: linear-gradient(180deg, #fff 30%, #ffb7c6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.admin-brand-tag {
  padding: 3px 7px;
  border: 1px solid rgba(255, 61, 110, 0.28);
  border-radius: 5px;
  background: rgba(255, 61, 110, 0.08);
  color: var(--pink-soft);
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ── вход ────────────────────────────────────────────────── */

.login-view {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  padding: 40px 36px;
  border: 1px solid var(--line-2);
  border-radius: 24px;
  background:
    radial-gradient(360px 180px at 50% -10%, rgba(255, 61, 110, 0.16), transparent 70%),
    linear-gradient(180deg, #161021, #0d0a15);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
}

.login-card .admin-brand {
  margin-bottom: 30px;
}

.login-card h1 {
  margin-bottom: 8px;
  font-size: 1.65rem;
}

.login-sub {
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 0.85rem;
}

.login-label {
  display: block;
  margin-bottom: 8px;
  color: #cfc7de;
  font-size: 0.76rem;
  font-weight: 700;
}

.password-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 50px;
  margin-bottom: 14px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.3);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.password-wrap:focus-within {
  border-color: rgba(255, 84, 120, 0.65);
  box-shadow: 0 0 0 3px rgba(255, 61, 110, 0.12);
}

.password-wrap .icon {
  width: 16px;
  height: 16px;
  color: var(--muted-2);
}

.password-wrap input {
  flex: 1;
  width: 100%;
  border: 0;
  background: none;
  outline: none;
  font-size: 0.9rem;
}

.password-wrap input::placeholder {
  color: var(--muted-2);
}

.login-error {
  display: none;
  margin-bottom: 12px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 84, 112, 0.3);
  border-radius: 8px;
  background: rgba(255, 84, 112, 0.08);
  color: #ff9aaa;
  font-size: 0.76rem;
}

.login-error.is-visible {
  display: block;
}

.btn-login {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 50px;
  border: 0;
  border-radius: 11px;
  background: var(--grad);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 800;
  box-shadow:
    0 12px 28px rgba(225, 29, 72, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.btn-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(225, 29, 72, 0.4);
}

.btn-login:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

.btn-login .icon {
  width: 16px;
  height: 16px;
}

.login-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 22px;
  color: var(--muted-2);
  font-size: 0.68rem;
}

.login-note .icon {
  width: 12px;
  height: 12px;
}

/* ── каркас ──────────────────────────────────────────────── */

.admin-app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 26px 18px 20px;
  border-right: 1px solid var(--line);
  background: rgba(12, 9, 19, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.sidebar .admin-brand {
  padding: 0 8px;
  margin-bottom: 34px;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.side-link {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: none;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
  text-align: left;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.side-link .icon {
  width: 17px;
  height: 17px;
}

.side-link:hover {
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
}

.side-link.is-active {
  border-color: rgba(255, 61, 110, 0.2);
  background: linear-gradient(100deg, rgba(255, 61, 110, 0.14), rgba(255, 61, 110, 0.03));
  color: #fff;
}

.side-link.is-active .icon {
  color: var(--pink-soft);
}

.side-count {
  margin-left: auto;
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted-2);
  font-size: 0.62rem;
  font-weight: 800;
}

.side-foot {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.side-foot a,
.side-foot button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--muted-2);
  font-size: 0.77rem;
  font-weight: 600;
  text-align: left;
  transition: background 0.2s, color 0.2s;
}

.side-foot a:hover,
.side-foot button:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.side-foot .icon {
  width: 15px;
  height: 15px;
}

.admin-main {
  width: 100%;
  max-width: 1440px;
  padding: 30px 38px 56px;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.admin-eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--muted-2);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.topbar h1 {
  font-size: 1.7rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.updated-at {
  color: var(--muted-2);
  font-size: 0.7rem;
  white-space: nowrap;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  transition: background 0.2s, color 0.2s, transform 0.2s;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.icon-btn.is-loading .icon {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.admin-alert {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-bottom: 22px;
  padding: 13px 16px;
  border: 1px solid rgba(255, 200, 87, 0.22);
  border-radius: 12px;
  background: rgba(255, 200, 87, 0.06);
}

.admin-alert .icon {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  color: var(--amber);
  flex-shrink: 0;
}

.admin-alert p {
  color: #cfc3ad;
  font-size: 0.76rem;
  line-height: 1.6;
}

.admin-alert strong {
  color: #f1e3c4;
}

.admin-alert code {
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.07);
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.68rem;
  color: #ffe0a3;
}

/* ── статистика ──────────────────────────────────────────── */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat-card {
  position: relative;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
  overflow: hidden;
}

.stat-card-accent {
  background:
    radial-gradient(280px 130px at 100% 0%, rgba(255, 61, 110, 0.2), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
  border-color: rgba(255, 61, 110, 0.2);
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.stat-label {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.stat-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(255, 61, 110, 0.1);
  color: var(--pink-soft);
}

.stat-icon .icon {
  width: 15px;
  height: 15px;
}

.stat-icon-green {
  background: rgba(61, 220, 151, 0.09);
  color: var(--green);
}

.stat-icon-violet {
  background: rgba(165, 102, 255, 0.1);
  color: #c3a6ff;
}

.stat-value {
  display: block;
  margin-bottom: 5px;
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.1;
}

.stat-foot {
  color: var(--muted-2);
  font-size: 0.68rem;
  line-height: 1.45;
}

.stat-foot b {
  color: #c3bbd3;
  font-weight: 700;
}

/* ── панели ──────────────────────────────────────────────── */

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}

.panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012));
  min-width: 0;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.panel-head h2 {
  margin-bottom: 3px;
  font-family: var(--font-body);
  font-size: 0.97rem;
  font-weight: 800;
  letter-spacing: -0.015em;
}

.panel-head p {
  color: var(--muted-2);
  font-size: 0.7rem;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted-2);
  font-size: 0.66rem;
  white-space: nowrap;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chart-legend i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.dot-pink { background: var(--pink); }
.dot-green { background: var(--green); }

.chart-wrap {
  position: relative;
  width: 100%;
}

#trafficChart {
  display: block;
  width: 100%;
  height: 240px;
}

.chart-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted-2);
  font-size: 0.77rem;
}

.sources-list {
  display: flex;
  flex-direction: column;
  gap: 17px;
}

.source-row {
  display: grid;
  gap: 6px;
}

.source-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.source-name {
  overflow: hidden;
  color: #d4cddf;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.source-count {
  color: var(--muted-2);
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
}

.source-bar {
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.source-bar i {
  display: block;
  width: var(--p);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(255, 61, 110, 0.7), rgba(165, 102, 255, 0.7));
}

.empty-note {
  padding: 24px 0;
  color: var(--muted-2);
  font-size: 0.77rem;
  text-align: center;
}

.text-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--pink-soft);
  font-size: 0.72rem;
  font-weight: 700;
}

.text-btn .icon {
  width: 13px;
  height: 13px;
}

.text-btn:hover {
  color: #ffb0c2;
}

/* ── таблицы ─────────────────────────────────────────────── */

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.orders-table {
  min-width: 900px;
}

.data-table th {
  padding: 0 12px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table td {
  padding: 13px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #d7d0e4;
  font-size: 0.78rem;
  vertical-align: middle;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr {
  transition: background 0.15s;
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.018);
}

.empty-cell {
  padding: 34px 12px !important;
  color: var(--muted-2) !important;
  font-size: 0.78rem !important;
  text-align: center;
}

.cell-main {
  display: block;
  color: #e9e3f3;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.cell-sub {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 0.66rem;
  white-space: nowrap;
}

.email-cell {
  color: #ded6eb;
  font-size: 0.76rem;
  word-break: break-all;
  max-width: 200px;
}

.amount-cell {
  font-weight: 800;
  white-space: nowrap;
}

.key-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}

.key-code {
  color: #cfc6df;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.69rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.copy-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted-2);
  transition: color 0.2s, background 0.2s;
}

.copy-icon:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.copy-icon .icon {
  width: 12px;
  height: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 0.61rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.badge-paid {
  background: rgba(61, 220, 151, 0.1);
  color: #68e5af;
}

.badge-pending {
  background: rgba(255, 200, 87, 0.1);
  color: #ffd37d;
}

.badge-canceled {
  background: rgba(255, 84, 112, 0.1);
  color: #ff8fa1;
}

.badge-demo {
  margin-left: 5px;
  padding: 1px 5px;
  border: 1px solid rgba(165, 102, 255, 0.28);
  border-radius: 4px;
  color: #c3a6ff;
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.mini-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
  color: #cfc7dd;
  font-size: 0.65rem;
  font-weight: 700;
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.mini-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.24);
  color: #fff;
}

.mini-btn .icon {
  width: 12px;
  height: 12px;
}

.mini-btn-green {
  border-color: rgba(61, 220, 151, 0.25);
  background: rgba(61, 220, 151, 0.07);
  color: #7cebbd;
}

.mini-btn-green:hover {
  background: rgba(61, 220, 151, 0.14);
  border-color: rgba(61, 220, 151, 0.4);
}

.mini-btn-muted {
  color: var(--muted-2);
}

.mini-btn-danger:hover {
  border-color: rgba(255, 84, 112, 0.4);
  background: rgba(255, 84, 112, 0.1);
  color: #ff9aaa;
}

/* ── тулбар заказов ──────────────────────────────────────── */

.orders-head {
  align-items: center;
}

.outline-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.03);
  color: #d3cbdf;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s;
}

.outline-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.24);
}

.outline-btn .icon {
  width: 14px;
  height: 14px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  min-width: 220px;
  max-width: 340px;
  height: 40px;
  padding: 0 13px;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.24);
  transition: border-color 0.2s;
}

.search-wrap:focus-within {
  border-color: rgba(255, 84, 120, 0.55);
}

.search-wrap .icon {
  width: 15px;
  height: 15px;
  color: var(--muted-2);
}

.search-wrap input {
  flex: 1;
  width: 100%;
  border: 0;
  background: none;
  outline: none;
  font-size: 0.78rem;
}

.search-wrap input::placeholder {
  color: var(--muted-2);
}

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.2);
}

.segmented button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--muted-2);
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}

.segmented button span {
  color: inherit;
  opacity: 0.65;
  font-size: 0.6rem;
}

.segmented button:hover {
  color: var(--text);
}

.segmented button.is-active {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

.table-hint {
  margin-top: 14px;
  color: var(--muted-2);
  font-size: 0.68rem;
  line-height: 1.55;
}

/* ── toast ───────────────────────────────────────────────── */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 200;
  max-width: calc(100vw - 32px);
  padding: 11px 18px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(26, 19, 38, 0.97);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  transform: translate(-50%, 18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s var(--ease);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ── адаптив ─────────────────────────────────────────────── */

@media (max-width: 1240px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1080px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .admin-main {
    padding: 26px 24px 46px;
  }
}

@media (max-width: 860px) {
  .admin-app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    height: 64px;
    padding: 0 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: rgba(10, 8, 16, 0.92);
  }

  .sidebar .admin-brand {
    padding: 0;
    margin: 0;
    flex-shrink: 0;
  }

  .sidebar .admin-brand img {
    width: 30px;
    height: 30px;
    border-radius: 8px;
  }

  .sidebar .brand-name {
    font-size: 1.2rem;
  }

  .sidebar .admin-brand-tag {
    display: none;
  }

  .side-nav {
    flex-direction: row;
    gap: 2px;
    margin-left: auto;
    overflow-x: auto;
  }

  .side-link {
    width: auto;
    padding: 8px 10px;
    font-size: 0.76rem;
  }

  .side-link .icon {
    width: 15px;
    height: 15px;
  }

  .side-count {
    display: none;
  }

  .side-foot {
    flex-direction: row;
    margin: 0;
    padding: 0;
    border: 0;
  }

  .side-foot a {
    display: none;
  }

  .side-foot button {
    padding: 8px;
  }

  .side-foot button {
    font-size: 0;
    gap: 0;
  }

  .side-foot button .icon {
    width: 17px;
    height: 17px;
  }

  .topbar {
    margin-bottom: 20px;
  }

  .topbar h1 {
    font-size: 1.4rem;
  }

  .updated-at {
    display: none;
  }

  .stat-value {
    font-size: 1.55rem;
  }
}

@media (max-width: 620px) {
  .admin-main {
    padding: 20px 14px 40px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 16px;
  }

  .panel-head {
    flex-wrap: wrap;
    margin-bottom: 16px;
  }

  .chart-legend {
    margin-left: 0;
  }

  #trafficChart {
    height: 200px;
  }

  .toolbar {
    align-items: stretch;
  }

  .search-wrap {
    max-width: none;
  }

  .segmented {
    width: 100%;
    overflow-x: auto;
  }

  .login-card {
    padding: 30px 22px;
  }

  .login-card h1 {
    font-size: 1.4rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
