/* ================= Каркас: боковая панель + верхняя полоса ================= */
:root { --menu: var(--card); --side-w: 248px; --side-bg: var(--bg2); }
.ico { width: 20px; height: 20px; flex: none; }

body.has-shell { display: flex; min-height: 100vh; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.main > .wrap { width: 100%; }

.sidebar {
  position: sticky; top: 0; height: 100vh; width: var(--side-w); flex: none;
  display: flex; flex-direction: column; gap: 6px; padding: 18px 12px 14px;
  background: var(--side-bg); border-right: 1px solid var(--line); overflow-y: auto; z-index: 15;
}
.logo i {
  width: 30px; height: 30px; border-radius: 9px; flex: none; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #ff4fa3); color: #fff; font: 700 14px/1 var(--display); font-style: normal;
}
.sidebar .logo { padding: 4px 8px 16px; font-size: 14px; white-space: normal; line-height: 1.25; }
.logo span { overflow: hidden; text-overflow: ellipsis; }

.snav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.snav a {
  position: relative; display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 11px;
  color: var(--muted); font-weight: 550; font-size: 14.5px; border: 1px solid transparent;
}
.snav a:hover { color: var(--text); background: var(--card); }
.snav a.on { color: var(--text); background: var(--card2); border-color: var(--line); }
.snav a.on::before { content: ""; position: absolute; left: -1px; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: var(--accent); }
.snav a.on .ico { color: var(--accent2); }
.snav a span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.snav a em { font-style: normal; font-size: 11px; font-weight: 700; color: #fff; background: var(--bad); border-radius: 9px; padding: 1px 7px; }
.snav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 14px 12px 6px; opacity: .8; }
.snav a.snav-back { font-size: 13.5px; }
.sfoot { border-top: 1px solid var(--line); padding: 14px 6px 0; margin-top: 10px; }
.sfoot b { display: block; margin: 2px 0; overflow-wrap: anywhere; }
.sfoot .btn .ico { width: 16px; height: 16px; }

.topbar {
  position: sticky; top: 0; z-index: 12; display: flex; align-items: center; gap: 12px;
  padding: 12px 24px; min-height: 64px;
  background: color-mix(in srgb, var(--bg) 75%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
.topbar .tools { margin-left: auto; }
.mobile-logo { display: none; }
.icon-btn {
  position: relative; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--card); border: 1px solid var(--line); color: var(--text); cursor: pointer;
}
.icon-btn:hover { color: var(--text); border-color: var(--accent); }
.icon-btn.on { background: color-mix(in srgb, var(--accent) 22%, var(--card)); border-color: var(--accent); color: #fff; }
.icon-btn .cnt, summary.icon-btn .cnt {
  position: absolute; top: -4px; right: -4px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px;
}
.dd-menu, .sel-list { background: var(--menu); }

/* Горизонтальное меню админки — только на телефоне */
.admin-nav { display: none; }

/* ================= Нижняя панель (Liquid Glass) ================= */
.tabbar { display: none; }
@media (max-width: 900px) {
  .sidebar { display: none; }
  .mobile-logo { display: flex; font-size: 14px; }
  .topbar { padding: 10px var(--gutter); min-height: 58px; }
  .main > .wrap { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
  .admin-nav { display: flex; }

  .tabbar {
    position: fixed; z-index: 40; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom));
    max-width: 520px; margin: 0 auto; height: 66px; padding: 6px;
    display: flex; align-items: center; justify-content: space-between; gap: 6px;
    border-radius: 24px;
    background:
      linear-gradient(135deg, rgba(120, 170, 255, .18), rgba(255, 255, 255, .04) 45%, rgba(90, 140, 255, .12)),
      rgba(12, 20, 44, .42);
    backdrop-filter: blur(26px) saturate(190%) brightness(1.08); -webkit-backdrop-filter: blur(26px) saturate(190%) brightness(1.08);
    border: 1px solid rgba(180, 210, 255, .22);
    box-shadow: 0 18px 44px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .28), inset 0 0 0 1px rgba(255, 255, 255, .03);
  }
  .tabbar::before { /* блик по верхней кромке */
    content: ""; position: absolute; left: 18%; right: 18%; top: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .7), transparent); pointer-events: none;
  }
  .tab {
    position: relative; flex: 1; height: 54px; border-radius: 18px; display: flex; align-items: center; justify-content: center; gap: 7px;
    color: rgba(225, 235, 255, .72); transition: background .25s, color .2s, flex .3s;
  }
  .tab span { max-width: 0; overflow: hidden; white-space: nowrap; font-size: 12.5px; font-weight: 600; transition: max-width .3s; }
  .tab .ico { width: 23px; height: 23px; }
  .tab:hover { color: #fff; }
  .tab.on {
    flex: 1.9; color: #fff;
    background: linear-gradient(180deg, rgba(150, 190, 255, .26), rgba(120, 160, 255, .1));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -8px 16px rgba(80, 130, 255, .12);
  }
  .tab.on span { max-width: 80px; }
  .tab-plus {
    flex: none; width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; color: #fff;
    background: linear-gradient(160deg, #7fb2ff, #2f6bff 55%, #1c48d8);
    box-shadow: 0 10px 24px rgba(40, 100, 255, .5), inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 -3px 8px rgba(0, 20, 90, .35);
  }
  .tab-plus .ico { width: 26px; height: 26px; stroke-width: 2.2; }
  .tab-plus:active, .tab:active { transform: scale(.95); }
}

/* ================= Зона загрузки файлов ================= */
.drop {
  position: relative; border: 1.5px dashed color-mix(in srgb, var(--muted) 45%, transparent); border-radius: 14px;
  background: color-mix(in srgb, var(--bg2) 70%, transparent); transition: border-color .15s, background .15s;
}
.drop > input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.drop.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--bg2)); }
.drop-body { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 20px 16px; text-align: center; }
.drop-body b { font-weight: 600; font-size: 14px; }
.drop-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--accent2); background: color-mix(in srgb, var(--accent) 14%, transparent); margin-bottom: 4px; }
.drop-ico svg { width: 22px; height: 22px; }
.drop-body .row { margin-top: 6px; }
.drop-err { color: var(--bad); }
.drop-list { display: grid; gap: 8px; padding: 0 12px; }
.drop.has-files .drop-list { padding-bottom: 12px; }
.drop-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); min-width: 0; }
.drop-item img, .drop-item video { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; flex: none; background: #000; }
.drop-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.drop-x { width: 28px; height: 28px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); font-size: 20px; cursor: pointer; flex: none; }
.drop-x:hover { background: var(--card2); color: var(--bad); }
.media-row { display: flex; flex-wrap: wrap; gap: 8px; }
.media-row .proof { max-width: 160px; max-height: 110px; object-fit: cover; }

/* ================= Выплаты, права, способы ================= */
.conv { margin: -4px 0 14px; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 10%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.conv span { color: var(--muted); font-size: 12.5px; }
.rate-pair { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.method-list { display: grid; gap: 12px; padding: 12px 20px 20px; }
.method-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: color-mix(in srgb, var(--bg2) 60%, transparent); }
.method-card:last-child { border-style: dashed; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.perm-grid.one { grid-template-columns: 1fr; gap: 4px; }
.perm { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line); cursor: pointer; background: color-mix(in srgb, var(--bg2) 60%, transparent); }
.perm-grid.one .perm { padding: 6px 8px; }
.perm:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.perm:has(input:checked) { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); background: color-mix(in srgb, var(--accent) 9%, transparent); }
.perm.locked { opacity: .5; cursor: not-allowed; }
.perm input { margin-top: 1px; }
.perm b { display: block; font-size: 13.5px; font-weight: 600; }
.perm small { display: block; color: var(--muted); font-size: 12px; line-height: 1.35; }

/* ================= Выбор темы ================= */
.theme-card { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: var(--r); border: 1.5px solid var(--line); background: var(--card); cursor: pointer; }
.theme-card input { position: absolute; opacity: 0; pointer-events: none; }
.theme-card.on { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.theme-preview { position: relative; height: 110px; border-radius: 10px; overflow: hidden; display: block; margin-bottom: 6px; }
.theme-preview i { position: absolute; border-radius: 6px; }
.theme-preview i:nth-child(1) { left: 0; top: 0; bottom: 0; width: 26%; }
.theme-preview i:nth-child(2) { left: 32%; top: 14%; right: 8%; height: 30%; border-radius: 8px; }
.theme-preview i:nth-child(3) { left: 32%; top: 54%; width: 34%; height: 30%; border-radius: 8px; }
.tp-midnight { background: #0d0f14; }
.tp-midnight i:nth-child(1) { background: #141821; }
.tp-midnight i:nth-child(2), .tp-midnight i:nth-child(3) { background: #1f2432; border: 1px solid #2a3042; }
.tp-violet { background: radial-gradient(120% 90% at 0 0, #2a1452, #0a0712 60%); }
.tp-violet i:nth-child(1) { background: #120b1f; }
.tp-violet i:nth-child(2), .tp-violet i:nth-child(3) { background: #1b1230; border: 1px solid #3a2766; box-shadow: 0 0 18px #8b5cf640; }
.tp-glass { background: radial-gradient(60% 70% at 80% 20%, #1e63ff 0, transparent 60%), radial-gradient(50% 60% at 15% 90%, #00c2ff 0, transparent 60%), #040b1c; }
.tp-glass i { background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .25); backdrop-filter: blur(6px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4); }

/* ================= Тема «Неон» ================= */
[data-theme=violet] {
  --bg: #0a0712; --bg2: #110b1c; --card: #150f22; --card2: #1e1531; --line: #2b2142;
  --text: #efeaff; --muted: #9b90b8; --accent: #8b5cf6; --accent2: #b9a2ff; --side-bg: #0e0918;
}
[data-theme=violet] body { background: radial-gradient(900px 600px at 0 0, #2a145255, transparent 70%), radial-gradient(800px 600px at 100% 100%, #4a103a33, transparent 70%), var(--bg); background-attachment: fixed; }
[data-theme=violet] h1 { font-weight: 800; letter-spacing: -.01em; }
[data-theme=violet] h2 { font: 700 17px/1.25 var(--display); letter-spacing: -.01em; }
[data-theme=violet] .card { background: linear-gradient(180deg, #17102580, #130d1f80), var(--card); }
[data-theme=violet] .snav a.on { background: linear-gradient(90deg, #8b5cf62e, #8b5cf60a); border-color: #8b5cf655; box-shadow: 0 0 24px #8b5cf62a; }
[data-theme=violet] .snav a.on::before { box-shadow: 0 0 12px var(--accent); }
[data-theme=violet] .btn:not(.ghost):not(.bad):not(.ok) { background: linear-gradient(135deg, #8b5cf6, #a855f7); box-shadow: 0 6px 18px #8b5cf640; }
[data-theme=violet] .logo i { background: linear-gradient(135deg, #8b5cf6, #c026d3); }

/* ================= Тема «Liquid Glass» (синяя) ================= */
[data-theme=glass] {
  --bg: #040b1c; --bg2: rgba(255, 255, 255, .045); --card: rgba(255, 255, 255, .065); --card2: rgba(255, 255, 255, .11);
  --line: rgba(255, 255, 255, .13); --text: #eef4ff; --muted: #9db0d4; --accent: #3b82f6; --accent2: #8ab8ff;
  --menu: rgba(10, 22, 50, .9); --side-bg: rgba(255, 255, 255, .04);
}
[data-theme=glass] body { background: #040b1c; }
/* Три источника света за стеклом медленно дрейфуют — стекло «оживает» */
[data-theme=glass] .bg-fx {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 0%, #0a1a3f 0%, #050d22 55%, #030816 100%);
}
[data-theme=glass] .bg-fx i {
  position: absolute; display: block; border-radius: 50%; filter: blur(70px); opacity: .75; will-change: transform;
}
[data-theme=glass] .bg-fx i:nth-child(1) {
  width: 46vmax; height: 46vmax; left: 52%; top: -14%;
  background: radial-gradient(circle, rgba(46, 110, 255, .85), rgba(46, 110, 255, 0) 68%);
  animation: drift-a 34s ease-in-out infinite alternate;
}
[data-theme=glass] .bg-fx i:nth-child(2) {
  width: 40vmax; height: 40vmax; left: -12%; top: 48%;
  background: radial-gradient(circle, rgba(0, 196, 255, .6), rgba(0, 196, 255, 0) 68%);
  animation: drift-b 41s ease-in-out infinite alternate;
}
[data-theme=glass] .bg-fx i:nth-child(3) {
  width: 32vmax; height: 32vmax; left: 30%; top: 30%;
  background: radial-gradient(circle, rgba(110, 90, 255, .5), rgba(110, 90, 255, 0) 68%);
  animation: drift-c 29s ease-in-out infinite alternate;
}
@keyframes drift-a { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-18vw, 14vh) scale(1.12); } 100% { transform: translate(-6vw, 30vh) scale(.92); } }
@keyframes drift-b { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(22vw, -18vh) scale(.9); } 100% { transform: translate(40vw, -4vh) scale(1.1); } }
@keyframes drift-c { 0% { transform: translate(0, 0) scale(.95); } 50% { transform: translate(16vw, 20vh) scale(1.15); } 100% { transform: translate(-20vw, 6vh) scale(1); } }
@media (prefers-reduced-motion: reduce) { [data-theme=glass] .bg-fx i { animation: none; } }
[data-theme=glass] .card, [data-theme=glass] .sidebar, [data-theme=glass] .topbar, [data-theme=glass] .plat,
[data-theme=glass] .dd-menu, [data-theme=glass] .sel-list, [data-theme=glass] .icon-btn, [data-theme=glass] .tabs a,
[data-theme=glass] .method-card, [data-theme=glass] .theme-card {
  backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%);
}
[data-theme=glass] .card, [data-theme=glass] .theme-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .035));
  border-color: rgba(255, 255, 255, .14);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .16);
}
[data-theme=glass] .sidebar { border-right-color: rgba(255, 255, 255, .1); }
[data-theme=glass] .topbar { background: rgba(5, 14, 36, .4); }
[data-theme=glass] .snav a.on { background: linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .06)); border-color: rgba(255, 255, 255, .2); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3); }
[data-theme=glass] .snav a.on::before { background: #60a5fa; box-shadow: 0 0 12px #60a5fa; }
[data-theme=glass] input[type=text], [data-theme=glass] input[type=email], [data-theme=glass] input[type=password],
[data-theme=glass] input[type=number], [data-theme=glass] input[type=url], [data-theme=glass] textarea, [data-theme=glass] .sel-btn, [data-theme=glass] select {
  background-color: rgba(3, 10, 28, .45); border-color: rgba(255, 255, 255, .14);
}
[data-theme=glass] .btn:not(.ghost):not(.bad):not(.ok) {
  background: linear-gradient(180deg, #5b9bff, #2563eb); border: 1px solid rgba(255, 255, 255, .25);
  box-shadow: 0 6px 20px rgba(37, 99, 235, .45), inset 0 1px 0 rgba(255, 255, 255, .45);
}
[data-theme=glass] .btn.ghost { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .16); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14); }
[data-theme=glass] .stat.accent { background: linear-gradient(135deg, rgba(59, 130, 246, .35), rgba(6, 182, 212, .15)); border-color: rgba(138, 184, 255, .4); }
[data-theme=glass] .logo i { background: linear-gradient(135deg, #60a5fa, #2563eb); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5); }
[data-theme=glass] .table th { background: rgba(255, 255, 255, .04); }
[data-theme=glass] .chart .line { stroke: #8ab8ff; }
[data-theme=glass] .chart .dot { fill: #8ab8ff; stroke: #0a1838; }

/* ================= Полоса прокрутки ================= */
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--accent) 45%, var(--line)) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--accent) 38%, var(--card2)); border-radius: 10px;
  border: 3px solid transparent; background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background-color: color-mix(in srgb, var(--accent) 65%, var(--card2)); }
::-webkit-scrollbar-button, ::-webkit-scrollbar-corner { display: none; background: transparent; }

/* ================= Мелочи ================= */
.uid { display: inline-block; font: 600 11.5px/1.6 ui-monospace, "Cascadia Mono", Consolas, monospace; padding: 0 7px; border-radius: 6px; color: var(--accent2); background: color-mix(in srgb, var(--accent) 14%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); white-space: nowrap; vertical-align: middle; }
.uid.lg { font-size: 13px; padding: 2px 9px; }
.with-ico { display: flex; gap: 6px; align-items: flex-start; }
.with-ico .ico, .flag .ico, .pin .ico, .tabs .ico, .btn .ico { width: 16px; height: 16px; flex: none; }
.with-ico .ico { margin-top: 2px; }
.flag { display: flex; gap: 8px; align-items: flex-start; }
.flag .ico { margin-top: 1px; }
.pin { display: inline-flex; align-items: center; gap: 5px; }
.tabs a { display: inline-flex; align-items: center; gap: 6px; }
.task { display: flex; gap: 16px; align-items: flex-start; border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.task-ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex: none; color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.task-ico .ico { width: 24px; height: 24px; }
.task-body { flex: 1; min-width: 0; }
.task-grid { display: flex; gap: 22px; flex-wrap: wrap; }
.task-grid b { display: block; font-size: 16px; }
.skin-form { display: grid; gap: 6px; margin-top: 8px; min-width: 210px; }

.skin-card { display: flex; gap: 14px; align-items: flex-start; margin: -2px 0 14px; padding: 14px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--warn) 40%, var(--line)); background: color-mix(in srgb, var(--warn) 7%, transparent); }
.skin-line { display: flex; justify-content: space-between; gap: 14px; padding: 3px 0; font-size: 14px; }
.skin-line span { color: var(--muted); }
.skin-card > div:last-child { flex: 1; min-width: 0; }
.msg-form { display: grid; gap: 10px; }
.msg-form textarea { min-height: 80px; }
.msg-form .btn { justify-self: start; }
.msg-list { display: grid; gap: 8px; margin-top: 14px; }
.msg { padding: 10px 12px; border-radius: 12px 12px 12px 4px; background: color-mix(in srgb, var(--accent) 10%, var(--card)); border: 1px solid var(--line); white-space: pre-wrap; }

/* ================= Liquid Glass: материал ================= */
/* Стекло: размытие + усиление цвета того, что под ним, светлая кромка сверху и блик, который следует за курсором */
[data-theme=glass] .card, [data-theme=glass] .sidebar, [data-theme=glass] .theme-card, [data-theme=glass] .method-card {
  position: relative; isolation: isolate;
  backdrop-filter: blur(22px) saturate(175%) brightness(1.06); -webkit-backdrop-filter: blur(22px) saturate(175%) brightness(1.06);
}
[data-theme=glass] .card::before, [data-theme=glass] .theme-card::before {
  /* кромка-«линза»: ярче сверху-слева, гаснет к низу */
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; z-index: -1;
  background: linear-gradient(150deg, rgba(255, 255, 255, .5), rgba(255, 255, 255, .08) 32%, rgba(255, 255, 255, 0) 55%, rgba(140, 190, 255, .22));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
[data-theme=glass] .card { border-color: rgba(255, 255, 255, .1); }
[data-theme=glass] .card.pad0 { overflow: hidden; }
[data-theme=glass] .btn, [data-theme=glass] .pbtn, [data-theme=glass] .icon-btn, [data-theme=glass] .tab-plus { transition: transform .18s cubic-bezier(.3, 1.6, .5, 1), filter .15s; }
[data-theme=glass] .btn:active, [data-theme=glass] .icon-btn:active { transform: scale(.96); }
[data-theme=glass] .icon-btn { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .18); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25); }
[data-theme=glass] .topbar { background: rgba(5, 14, 36, .28); border-bottom-color: rgba(255, 255, 255, .08); }

/* ================= Нижняя панель сжимается при прокрутке вниз ================= */
@media (max-width: 900px) {
  .tabbar { transition: height .3s cubic-bezier(.3, 1.3, .5, 1), left .3s, right .3s, border-radius .3s, bottom .3s; }
  .tabbar.compact { height: 54px; left: 22%; right: 22%; border-radius: 20px; bottom: calc(8px + env(safe-area-inset-bottom)); }
  .tabbar.compact .tab { height: 42px; border-radius: 14px; }
  .tabbar.compact .tab span { max-width: 0; }
  .tabbar.compact .tab.on { flex: 1.2; }
  .tabbar.compact .tab-plus { width: 44px; height: 44px; border-radius: 14px; }
  .tabbar.compact .tab .ico, .tabbar.compact .tab-plus .ico { width: 21px; height: 21px; }
}

/* ================= Плавность ================= */
/* Переход между страницами: боковая панель, шапка и нижняя панель стоят на месте, меняется только содержимое */
@view-transition { navigation: auto; }
.sidebar { view-transition-name: sidebar; }
.topbar { view-transition-name: topbar; }
.tabbar { view-transition-name: tabbar; }
.top { view-transition-name: guest-top; }
::view-transition-old(root) { animation: vt-out .18s ease-in both; }
::view-transition-new(root) { animation: vt-in .32s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }

/* Появление блоков страницы — лёгкий подъём по очереди */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.main > .wrap > *, body.guest .wrap > * { animation: rise .45s cubic-bezier(.2, .8, .2, 1) both; }
.main > .wrap > *:nth-child(2) { animation-delay: .04s; }
.main > .wrap > *:nth-child(3) { animation-delay: .08s; }
.main > .wrap > *:nth-child(4) { animation-delay: .12s; }
.main > .wrap > *:nth-child(5) { animation-delay: .16s; }
.main > .wrap > *:nth-child(n+6) { animation-delay: .2s; }
.grid > .card { animation: rise .45s cubic-bezier(.2, .8, .2, 1) both; }
.grid > .card:nth-child(2) { animation-delay: .05s; }
.grid > .card:nth-child(3) { animation-delay: .1s; }
.grid > .card:nth-child(4) { animation-delay: .15s; }

/* Меню, выпадающие списки, вкладки */
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
details.dd[open] > .dd-menu { animation: pop .18s cubic-bezier(.2, .8, .2, 1); transform-origin: top right; }
.snav a, .tabs a, .admin-nav a, .tab, .btn, .pbtn, .icon-btn, .perm, .theme-card, .notif, .sel-btn {
  transition: background-color .22s ease, color .2s ease, border-color .22s ease, box-shadow .25s ease, transform .18s ease, opacity .2s ease, flex .3s ease;
}
.snav a.on::before { animation: grow .3s cubic-bezier(.2, .8, .2, 1); }
@keyframes grow { from { transform: scaleY(0); } }
.tabs a.on, .admin-nav a.on { animation: tab-on .25s ease; }
@keyframes tab-on { from { background-color: transparent; } }
.alert { animation: rise .35s cubic-bezier(.2, .8, .2, 1) both; }
.drop-item { animation: rise .25s ease both; }
.skin-card:not([hidden]), .conv:not([hidden]), #pay-image:not([hidden]) { animation: rise .25s ease both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after, ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) {
    animation: none !important; transition: none !important;
  }
}

/* ================= Отступы между соседними кнопками ================= */
/* Кнопки и инлайн-формы подряд без flex-контейнера получают ровный промежуток */
:where(.btn, .pbtn, form.inline) + :where(.btn, .pbtn, form.inline) { margin-left: 8px; }
:where(.row, .tools, .modal-actions, .drop-body .row, .skin-form .row) > :where(.btn, .pbtn, form.inline) + :where(.btn, .pbtn, form.inline) { margin-left: 0; }
td > :where(.btn, form.inline) { vertical-align: middle; }
.plat-toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; margin-right: 6px; }
.plat-toggle .pbtn { pointer-events: none; }
.plat-toggle input:not(:checked) + .pbtn { opacity: .45; filter: grayscale(.6); }

/* ================= ID-чип с копированием ================= */
button.uid { cursor: pointer; display: inline-flex; align-items: center; gap: 5px; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
button.uid .ico { width: 12px; height: 12px; opacity: .7; }
button.uid:hover { border-color: var(--accent); color: #fff; }
button.uid:active { transform: scale(.96); }

/* ================= Тост и модальное окно ================= */
.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 200; transform: translate(-50%, 12px);
  padding: 10px 16px; border-radius: 12px; background: var(--menu); border: 1px solid var(--line); color: var(--text);
  box-shadow: 0 12px 30px #0008; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 901px) { .toast { bottom: 28px; } }
.modal-wrap { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 20px; background: rgba(3, 6, 16, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade .16s ease; }
.modal-wrap.closing { opacity: 0; transition: opacity .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(420px, 100%); padding: 24px; border-radius: 18px; background: var(--menu); border: 1px solid var(--line); box-shadow: 0 24px 60px #000a; animation: pop .2s cubic-bezier(.2, .8, .2, 1); }
.modal h2 { margin-bottom: 8px; }
.modal p { margin-bottom: 16px; }
.modal .check { margin-bottom: 18px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
[data-theme=glass] .modal { backdrop-filter: blur(26px) saturate(170%); -webkit-backdrop-filter: blur(26px) saturate(170%); box-shadow: 0 24px 60px #000a, inset 0 1px 0 rgba(255, 255, 255, .2); }

/* ================= Тарифы, ссылка-карточка, режим оплаты ================= */
.tariff { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.tariff:first-child { padding-top: 0; }
.tariff:last-child { border-bottom: 0; padding-bottom: 0; }
.tariff-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; color: var(--accent2); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.tariff-info { flex: 1; min-width: 0; display: grid; gap: 2px; }
.tariff-price { text-align: right; display: grid; gap: 2px; }
.tariff-price b { font-size: 16px; white-space: nowrap; }
.link-card { display: flex; align-items: center; gap: 14px; color: var(--text); }
.link-card > span { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; color: var(--accent2); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.link-card:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); color: var(--text); }
.mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode-opt { display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); cursor: pointer; background: color-mix(in srgb, var(--bg2) 60%, transparent); }
.mode-opt input { position: absolute; opacity: 0; pointer-events: none; }
.mode-opt.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.mode-opt:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
@media (max-width: 640px) { .mode-switch { grid-template-columns: 1fr; } .tariff { flex-wrap: wrap; } .tariff-price { text-align: left; width: 100%; padding-left: 54px; } }

/* Таблицы с полями ввода (тарифы, валюты) */
.edit-table th { white-space: nowrap; }
.edit-table td { vertical-align: middle; }
.cell-actions { display: flex; gap: 8px; align-items: center; white-space: nowrap; }
/* Боковая панель всегда прилипает к экрану (правило стекла выше задаёт position: relative) */
[data-theme=glass] .sidebar { position: sticky; top: 0; }

/* Ровные формы-карточки: одинаковый промежуток между рядами и подвал с действиями */
.form-grid { gap: 0 12px; }
.method-card > .field, .method-card > .form-grid { margin-bottom: 0; }
.method-card > * + * { margin-top: 12px; }
.method-card .field { margin-bottom: 0; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--line); }
@media (max-width: 900px) { .form-grid { gap: 12px; } .form-grid .field[style*="span 2"] { grid-column: auto !important; } }
/* Заголовки колонок и бейджи не разрываются на строки */
.table th, .badge { white-space: nowrap; }

/* ================= Баннеры ================= */
.banner-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.banner { display: grid; gap: 12px; align-content: start; padding: 14px; }
.banner.off { opacity: .55; }
.banner-preview { aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: repeating-conic-gradient(#ffffff08 0 25%, transparent 0 50%) 0 0 / 16px 16px, var(--bg2); display: grid; place-items: center; }
.banner-preview img, .banner-preview video { width: 100%; height: 100%; object-fit: contain; display: block; }
.banner-file { display: grid; place-items: center; gap: 6px; color: var(--muted); font-weight: 700; }
.banner-file .ico { width: 34px; height: 34px; }
.banner-body { display: grid; gap: 2px; min-width: 0; }
.banner-body b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.banner .field { margin: 0; }
.banner .card-foot { padding-top: 10px; }
.stack { display: grid; gap: 14px; }
.stack .field { margin: 0; }

/* ================= Условия оплаты в профиле ================= */
.rate-plat { padding: 12px 0; border-top: 1px solid var(--line); }
.rate-plat:first-of-type { border-top: 0; }
.rate-plat-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.rate-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.rate-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; color: var(--accent2); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.rate-ico .ico { width: 17px; height: 17px; }
.rate-name { flex: 1; min-width: 0; }
@media (max-width: 640px) { .rate-row { flex-wrap: wrap; } .rate-row b { width: 100%; padding-left: 40px; } }
/* На телефоне форма загрузки баннеров — над списком */
@media (max-width: 900px) { .banners-admin > div:last-child { order: -1; } }

/* ================= Превью баннера при наведении ================= */
.banner-preview { position: relative; }
.banner-preview.is-video { cursor: pointer; }
.banner-preview .play-hint {
  position: absolute; right: 8px; bottom: 8px; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  color: #fff; background: rgba(0, 0, 0, .5); transition: opacity .2s; pointer-events: none;
}
.banner-preview .play-hint .ico { width: 16px; height: 16px; }
.banner-preview.playing .play-hint { opacity: 0; }
.banner-file small { font-weight: 400; font-size: 12px; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid color-mix(in srgb, var(--muted) 35%, transparent); border-top-color: var(--accent2); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ================= Подключение платформ ================= */
.integ-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.integ-head .pbtn { pointer-events: none; }
.integ.later { opacity: .75; }
.integ-steps { margin: 16px 0; padding-left: 22px; display: grid; gap: 8px; line-height: 1.5; }
.integ-steps li::marker { color: var(--accent2); font-weight: 700; }
.copy-field { display: flex; gap: 8px; }
.copy-field input { flex: 1; min-width: 0; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13.5px; }

/* ================= Тема «Графит»: переливающаяся сетка + дымчатое стекло ================= */
[data-theme=graphite] {
  --bg: #000; --bg2: rgba(255, 255, 255, .035); --card: rgba(16, 16, 16, .62); --card2: rgba(255, 255, 255, .075);
  --line: rgba(255, 255, 255, .1); --text: #f2f2f2; --muted: #8e8e8e; --accent: #d9d9d9; --accent2: #ffffff;
  --menu: rgba(18, 18, 18, .9); --side-bg: rgba(10, 10, 10, .55);
}
[data-theme=graphite] body { background: #000; }
[data-theme=graphite] .bg-fx { position: fixed; inset: 0; z-index: -1; pointer-events: none; background: #000; }
[data-theme=graphite] .bg-fx i { display: none; }
#bg-grid { display: none; }
[data-theme=graphite] #bg-grid { position: absolute; inset: 0; display: block; }

/* Стекло: дымчатое, с лёгкой светлой кромкой сверху */
[data-theme=graphite] .card, [data-theme=graphite] .sidebar, [data-theme=graphite] .topbar, [data-theme=graphite] .dd-menu,
[data-theme=graphite] .sel-list, [data-theme=graphite] .modal, [data-theme=graphite] .theme-card, [data-theme=graphite] .method-card,
[data-theme=graphite] .plat, [data-theme=graphite] .icon-btn, [data-theme=graphite] .toast {
  backdrop-filter: blur(16px) saturate(115%); -webkit-backdrop-filter: blur(16px) saturate(115%);
}
[data-theme=graphite] .card, [data-theme=graphite] .theme-card {
  position: relative; isolation: isolate;
  background: linear-gradient(180deg, rgba(28, 28, 28, .72), rgba(12, 12, 12, .7));
  border-color: rgba(255, 255, 255, .09);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .07);
}
[data-theme=graphite] .card::before, [data-theme=graphite] .theme-card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; z-index: -1;
  background: linear-gradient(160deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, .03) 35%, transparent 60%, rgba(255, 255, 255, .06));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
[data-theme=graphite] .card.pad0 { overflow: hidden; }
[data-theme=graphite] .sidebar { position: sticky; top: 0; border-right-color: rgba(255, 255, 255, .07); }
[data-theme=graphite] .topbar { background: rgba(0, 0, 0, .35); border-bottom-color: rgba(255, 255, 255, .06); }
[data-theme=graphite] h1 { font-weight: 700; }
[data-theme=graphite] a { color: #e6e6e6; }
[data-theme=graphite] a:hover { color: #fff; }
[data-theme=graphite] .muted { color: var(--muted); }

/* Кнопки: светлое «стекло» с тонким кольцом, как на образце */
[data-theme=graphite] .btn:not(.ghost):not(.bad):not(.ok) {
  color: #fff; border: 1px solid rgba(255, 255, 255, .55);
  background: linear-gradient(180deg, #5a5a5a, #343434);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .6), 0 6px 18px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .28);
}
[data-theme=graphite] .btn:not(.ghost):not(.bad):not(.ok):hover { filter: none; background: linear-gradient(180deg, #686868, #3c3c3c); }
[data-theme=graphite] .btn.ghost { background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .14); color: #eee; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06); }
[data-theme=graphite] .btn.ghost:hover { border-color: rgba(255, 255, 255, .3); }
[data-theme=graphite] .logo i { background: linear-gradient(180deg, #6a6a6a, #2a2a2a); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35); }
[data-theme=graphite] .logo { color: #fff; }

/* Поля ввода */
[data-theme=graphite] input[type=text], [data-theme=graphite] input[type=email], [data-theme=graphite] input[type=password],
[data-theme=graphite] input[type=number], [data-theme=graphite] input[type=url], [data-theme=graphite] textarea,
[data-theme=graphite] .sel-btn, [data-theme=graphite] select {
  background-color: rgba(0, 0, 0, .45); border-color: rgba(255, 255, 255, .12); color: #f2f2f2;
}
[data-theme=graphite] input:focus, [data-theme=graphite] textarea:focus, [data-theme=graphite] .sel.open .sel-btn, [data-theme=graphite] .sel-btn:focus-visible {
  border-color: rgba(255, 255, 255, .5); box-shadow: 0 0 0 3px rgba(255, 255, 255, .08);
}
[data-theme=graphite] input[type=checkbox]:checked { background-color: #e8e8e8; border-color: #e8e8e8;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m5 10.5 3.2 3L15 6.5' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }

/* Меню и вкладки */
[data-theme=graphite] .snav a.on { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .12); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06); }
[data-theme=graphite] .snav a.on::before { background: #fff; box-shadow: 0 0 10px rgba(255, 255, 255, .6); }
[data-theme=graphite] .snav a.on .ico { color: #fff; }
[data-theme=graphite] .tabs a.on, [data-theme=graphite] .admin-nav a.on { border-color: rgba(255, 255, 255, .4); background: rgba(255, 255, 255, .07); }
[data-theme=graphite] .icon-btn { background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .12); }
[data-theme=graphite] .icon-btn.on { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .4); }
[data-theme=graphite] .stat.accent { background: linear-gradient(180deg, rgba(60, 60, 60, .6), rgba(20, 20, 20, .7)); border-color: rgba(255, 255, 255, .18); }
[data-theme=graphite] .uid, [data-theme=graphite] .badge { color: #e6e6e6; background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .14); }
[data-theme=graphite] .badge.pending { color: var(--warn); } [data-theme=graphite] .badge.approved, [data-theme=graphite] .badge.paid { color: var(--ok); }
[data-theme=graphite] .badge.rejected, [data-theme=graphite] .badge.banned { color: var(--bad); }
[data-theme=graphite] .table th { background: rgba(255, 255, 255, .03); }
[data-theme=graphite] .bar i { background: linear-gradient(90deg, #8a8a8a, #fff); }
[data-theme=graphite] .chart .line { stroke: #e8e8e8; }
[data-theme=graphite] .chart .dot { fill: #e8e8e8; stroke: #111; }
[data-theme=graphite] .tariff-ico, [data-theme=graphite] .rate-ico, [data-theme=graphite] .link-card > span, [data-theme=graphite] .drop-ico { color: #fff; background: rgba(255, 255, 255, .08); }

/* Нижняя панель на телефоне — дымчатая */
@media (max-width: 900px) {
  [data-theme=graphite] .tabbar {
    background: linear-gradient(180deg, rgba(60, 60, 60, .38), rgba(20, 20, 20, .55)), rgba(0, 0, 0, .35);
    border-color: rgba(255, 255, 255, .16);
  }
  [data-theme=graphite] .tab.on { background: linear-gradient(180deg, rgba(255, 255, 255, .2), rgba(255, 255, 255, .07)); }
  [data-theme=graphite] .tab-plus { background: linear-gradient(180deg, #f2f2f2, #9a9a9a); color: #000; box-shadow: 0 8px 22px rgba(0, 0, 0, .6), inset 0 1px 0 #fff; }
}

/* Карточка выбора темы */
.tp-graphite { background:
  repeating-linear-gradient(90deg, transparent 0 4px, #000 4px 5px),
  repeating-linear-gradient(0deg, transparent 0 14px, #000 14px 17px),
  radial-gradient(60% 70% at 70% 30%, #3a3a3a, #101010 70%), #000; }
.tp-graphite i { background: rgba(24, 24, 24, .8); border: 1px solid rgba(255, 255, 255, .18); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15); }
@media (max-width: 1100px) { .grid.g4 > .theme-card { min-width: 0; } }
