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

:root {
  --bg-deep: #06060d;
  --bg-0: #0a0a16;

  --glass: rgba(20, 20, 38, 0.55);
  --glass-strong: rgba(26, 26, 48, 0.78);
  --glass-soft: rgba(255, 255, 255, 0.035);

  --stroke: rgba(255, 255, 255, 0.08);
  --stroke-strong: rgba(255, 255, 255, 0.16);
  --stroke-weak: rgba(255, 255, 255, 0.05);
  --stroke-glow: rgba(139, 92, 246, 0.5);

  --text: #ececf5;
  --muted: #8a8ba8;
  --muted-2: #5f6082;

  --accent: #8b5cf6;
  --accent-2: #ec4899;
  --accent-soft: rgba(139, 92, 246, 0.14);
  --accent-glow: rgba(139, 92, 246, 0.45);
  --accent-grad: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
  --accent-grad-soft: linear-gradient(135deg, rgba(139,92,246,.18), rgba(236,72,153,.18));

  --green: #34d399;
  --red: #fb7185;
  --yellow: #fbbf24;
  --blue: #60a5fa;

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 18px;
  --radius-xl: 22px;

  --shadow-sm: 0 4px 16px rgba(0,0,0,.28);
  --shadow-card: 0 10px 40px rgba(0,0,0,.42);
  --shadow-lg: 0 28px 80px rgba(0,0,0,.55);
  --shadow-glow: 0 0 30px rgba(139, 92, 246, 0.25);

  --blur: 22px;
  --ease: cubic-bezier(.4, 0, .2, 1);
}

html, body { height: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg-deep);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.011em;
}

body::before, body::after {
  content: '';
  position: fixed;
  z-index: 0;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.55;
}
body::before {
  width: 560px; height: 560px;
  background: radial-gradient(circle, rgba(139,92,246,.55), transparent 70%);
  top: -200px; left: -180px;
  animation: floatA 22s ease-in-out infinite alternate;
}
body::after {
  width: 640px; height: 640px;
  background: radial-gradient(circle, rgba(236,72,153,.42), transparent 70%);
  bottom: -240px; right: -200px;
  animation: floatB 28s ease-in-out infinite alternate;
}
@keyframes floatA { from { transform: translate(0, 0); } to { transform: translate(90px, 60px); } }
@keyframes floatB { from { transform: translate(0, 0); } to { transform: translate(-100px, -40px); } }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.16); }
::selection { background: rgba(139,92,246,.45); color: #fff; }

.layout { display: flex; min-height: 100vh; position: relative; z-index: 1; }

.sidebar {
  width: 244px;
  min-height: 100vh;
  background: var(--glass-strong);
  backdrop-filter: blur(var(--blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
  border-right: 1px solid var(--stroke);
  display: flex;
  flex-direction: column;
  padding: 26px 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}
.sidebar::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(139,92,246,.4), transparent);
}
.sidebar-logo {
  display: flex; align-items: center; gap: 12px;
  padding: 0 22px 22px;
  border-bottom: 1px solid var(--stroke-weak);
  margin-bottom: 14px;
}
.sidebar-logo .icon {
  width: 40px; height: 40px;
  background: var(--accent-grad);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  box-shadow: 0 4px 18px rgba(139, 92, 246, .42);
  color: #fff;
}
.sidebar-logo .name {
  font-weight: 700;
  font-size: 17px;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.02em;
}

nav { padding: 0 12px; flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(139,92,246,.3) transparent; }
nav::-webkit-scrollbar { width: 4px; }
nav::-webkit-scrollbar-thumb { background: rgba(139,92,246,.3); border-radius: 4px; }
nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-radius: 10px;
  margin: 1px 0;
  cursor: pointer;
  position: relative;
  transition: color .2s var(--ease), background .2s var(--ease), transform .2s var(--ease);
}
nav a:hover {
  color: var(--text);
  background: var(--glass-soft);
}
nav a.active {
  color: #fff;
  background: var(--accent-grad-soft);
  border: 1px solid rgba(139,92,246,.28);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
nav a.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 22px;
  border-radius: 4px;
  background: var(--accent-grad);
  box-shadow: 0 0 12px rgba(139, 92, 246, .7);
}
nav a .nav-icon {
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  flex-shrink: 0;
  transition: color .2s var(--ease);
}
nav a:hover .nav-icon, nav a.active .nav-icon { color: var(--accent); }
nav a.active .nav-icon { color: #c4b5fd; }
nav a .nav-icon svg { width: 18px; height: 18px; stroke-width: 1.8; }

.sidebar-section-label {
  padding: 10px 14px 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.sidebar-bottom {
  padding: 12px 14px 4px;
  border-top: 1px solid var(--stroke-weak);
  flex-shrink: 0;
}
.user-info {
  padding: 12px;
  border-radius: 12px;
  background: var(--glass-soft);
  border: 1px solid var(--stroke-weak);
  font-size: 13px;
  margin-bottom: 10px;
}
.user-info .uname {
  font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.user-info .uname::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}
.user-info .ucredits {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
  display: flex; align-items: center; gap: 6px;
}
.user-info .ucredits b {
  color: var(--text);
  font-weight: 600;
}

.sidebar-actions { display: flex; gap: 8px; margin-top: 8px; }
.logout-btn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 10px;
  color: var(--red);
  cursor: pointer;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
  background: var(--glass-soft);
  border: 1px solid var(--stroke-weak);
  flex: 1; text-align: center;
  transition: background .2s var(--ease), border-color .2s var(--ease);
}
.logout-btn:hover {
  background: rgba(251, 113, 133, .1);
  border-color: rgba(251, 113, 133, .28);
}
.logout-btn.settings-btn { color: var(--text-muted, #aaa); }
.logout-btn.settings-btn:hover { background: rgba(139,92,246,.1); border-color: rgba(139,92,246,.28); color: var(--accent); }
.logout-btn svg { width: 15px; height: 15px; stroke-width: 1.8; flex-shrink: 0; }

.main {
  margin-left: 244px;
  flex: 1;
  padding: 32px 40px 48px;
  position: relative;
  z-index: 1;
  min-width: 0;
}

.screen { display: none; animation: fadeIn .35s var(--ease); }
.screen.active { display: block; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  letter-spacing: -0.02em;
}
.page-title .title-icon {
  width: 38px; height: 38px;
  background: var(--accent-grad-soft);
  border: 1px solid rgba(139,92,246,.28);
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  color: #c4b5fd;
}
.page-title .title-icon svg { width: 19px; height: 19px; stroke-width: 1.8; }

.card {
  background: var(--glass);
  backdrop-filter: blur(var(--blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.14), transparent);
}
.card + .card { margin-top: 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .2s var(--ease), border-color .2s var(--ease), transform .15s var(--ease), box-shadow .2s var(--ease);
  font-family: inherit;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.btn:active:not(:disabled) { transform: translateY(1px) scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 4px 16px rgba(139, 92, 246, .4), inset 0 1px 0 rgba(255,255,255,.25);
}
.btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 24px rgba(139, 92, 246, .55), inset 0 1px 0 rgba(255,255,255,.3);
  transform: translateY(-1px);
}

.btn-danger {
  background: rgba(251, 113, 133, .12);
  color: var(--red);
  border: 1px solid rgba(251, 113, 133, .24);
}
.btn-danger:hover:not(:disabled) {
  background: rgba(251, 113, 133, .22);
  border-color: rgba(251, 113, 133, .4);
}

.btn-ghost {
  background: var(--glass-soft);
  color: var(--text);
  border: 1px solid var(--stroke);
}
.btn-ghost:hover:not(:disabled) {
  background: rgba(255,255,255,.08);
  border-color: var(--stroke-strong);
}

.btn-success {
  background: rgba(52, 211, 153, .12);
  color: var(--green);
  border: 1px solid rgba(52, 211, 153, .26);
}
.btn-success:hover:not(:disabled) {
  background: rgba(52, 211, 153, .22);
  border-color: rgba(52, 211, 153, .42);
}

.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 8px; }
.btn-xs { padding: 4px 9px; font-size: 11px; border-radius: 7px; }

.inp {
  background: rgba(0,0,0,.28);
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 10px 13px;
  color: var(--text);
  font-size: 14px;
  width: 100%;
  outline: none;
  font-family: inherit;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
}
.inp:focus {
  border-color: rgba(139, 92, 246, .55);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, .18);
  background: rgba(0,0,0,.36);
}
.inp::placeholder { color: var(--muted-2); }
.inp-row { display: flex; gap: 8px; align-items: stretch; }
.inp-row .inp { flex: 1; }
label.lbl {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 7px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.01em;
  border: 1px solid transparent;
}
.badge-green  { background: rgba(52,211,153,.12);  color: var(--green);  border-color: rgba(52,211,153,.26); }
.badge-red    { background: rgba(251,113,133,.12); color: var(--red);    border-color: rgba(251,113,133,.26); }
.badge-gray   { background: rgba(156,163,175,.12); color: #9ca3af;   border-color: rgba(156,163,175,.26); }
.badge-yellow { background: rgba(251,191,36,.12);  color: var(--yellow); border-color: rgba(251,191,36,.26); }
.badge-blue   { background: rgba(96,165,250,.12);  color: var(--blue);   border-color: rgba(96,165,250,.26); }
.badge-muted  { background: rgba(138,139,168,.12); color: var(--muted);  border-color: rgba(138,139,168,.22); }
.badge-orange { background: rgba(251,146,60,.12);  color: #fb923c;  border-color: rgba(251,146,60,.26); }
.badge-accent { background: var(--accent-grad-soft); color: #c4b5fd; border-color: rgba(139,92,246,.32); }

.token-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.token-card {
  background: var(--glass);
  backdrop-filter: blur(var(--blur)) saturate(135%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(135%);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 12px 16px;
  position: relative;
  transition: background .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.token-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.16), transparent);
}
.token-card:hover {
  background: rgba(28, 28, 50, .65);
  border-color: var(--stroke-strong);
  box-shadow: 0 10px 28px rgba(0,0,0,.5);
}
.token-card.selected {
  border-color: rgba(139,92,246,.6);
  background: rgba(139, 92, 246, .07);
  box-shadow: 0 0 0 1px rgba(139,92,246,.5), 0 10px 28px rgba(139,92,246,.18);
}
.tc-check {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}
.tc-num {
  font-size: 11px;
  color: var(--text-muted, #888);
  min-width: 20px;
  text-align: right;
  line-height: 1;
  user-select: none;
}
.tokens-total-count {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted, #888);
  margin-left: 8px;
  padding: 2px 8px;
  background: var(--bg-secondary, rgba(255,255,255,.07));
  border-radius: 10px;
  vertical-align: middle;
}
.tc-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
  border: 1px solid var(--border);
  text-decoration: none; cursor: pointer;
  transition: opacity .15s;
}
.tc-avatar:hover { opacity: .8; }
.tc-avatar.has-img { cursor: zoom-in; }
.tc-avatar-ph {
  display: flex; align-items: center; justify-content: center;
  background: rgba(139,92,246,.25); color: #c4b5fd;
  font-size: 16px; font-weight: 700;
  position: relative; overflow: hidden;
}
.tc-avatar-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  display: none;
}
.tc-avatar-ph.has-img .tc-avatar-img { display: block; }
.tc-reg {
  font-size: 11px; color: var(--muted);
}
.deal-tok-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.deal-tok-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(139,92,246,.25); color: #c4b5fd;
  font-size: 14px; font-weight: 700;
  position: relative; overflow: hidden; cursor: pointer;
}
.deal-tok-avatar img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: none;
}
.deal-tok-avatar.has-img img { display: block; }
.deal-tok-info { flex: 1; min-width: 0; }
.deal-tok-phone { font-size: 13px; font-weight: 600; }
.deal-tok-name { font-size: 12px; color: var(--muted); font-weight: 400; }
.deal-tok-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 3px; }
.deal-tok-meta-item { font-size: 11px; color: var(--muted); }
.deal-sel-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: 8px; cursor: pointer;
  transition: background .12s;
}
.deal-sel-item:hover { background: var(--surface); }
.deal-sel-item input[type=checkbox] { flex-shrink: 0; width: 16px; height: 16px; cursor: pointer; }
.tc-main {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0;
}
.tc-info-col {
  flex: 0 1 auto;
  min-width: 150px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  padding-right: 14px;
}
.tc-id { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.token-phone {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.token-name {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 240px;
}
.tc-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.tc-2fa {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px 3px 10px;
  background: rgba(251, 191, 36, .1);
  border: 1px solid rgba(251, 191, 36, .24);
  border-radius: 8px;
  font-size: 12px;
}
.tc-2fa-unknown {
  background: rgba(138, 139, 168, .08);
  border-color: rgba(138, 139, 168, .22);
  color: var(--muted);
}
.tc-2fa-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--yellow);
  text-transform: uppercase;
}
.tc-2fa-unknown .tc-2fa-label { color: var(--muted); }
.tc-2fa-pwd {
  font-family: 'JetBrains Mono', 'SF Mono', ui-monospace, monospace;
  font-size: 12px;
  color: var(--text);
  user-select: all;
  padding: 0 2px;
}
.tc-2fa-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 2px;
  display: inline-flex;
  align-items: center;
  border-radius: 5px;
  transition: color .15s var(--ease), background .15s var(--ease);
}
.tc-2fa-btn:hover { color: var(--text); background: rgba(255,255,255,.08); }
.token-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px;
  width: 155px;
  flex-shrink: 0;
  align-self: flex-start;
  margin-left: auto;
  padding-left: 14px;
  border-left: 1px solid var(--stroke);
}
.token-actions .btn { width: 100%; }
.token-actions button[data-act="copy"],
.token-actions button[data-act="check"] { grid-column: 1 / -1; }
.token-actions .tc-dropdown { width: 100%; }
.token-actions .tc-dropdown > .btn { width: 100%; }
.ta-full { grid-column: 1 / -1; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--stroke-weak);
  font-size: 13px;
  vertical-align: middle;
}
.tbl th {
  color: var(--muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--stroke);
}
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background .15s var(--ease); }
.tbl tbody tr:hover { background: rgba(255,255,255,.03); }

.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(4,4,10,.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  opacity: 0; pointer-events: none;
  transition: opacity .25s var(--ease);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--glass-strong);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  border: 1px solid var(--stroke-strong);
  border-radius: var(--radius-xl);
  padding: 26px;
  width: 500px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(.94) translateY(10px);
  transition: transform .25s var(--ease);
  box-shadow: var(--shadow-lg);
  position: relative;
}
.modal::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.22), transparent);
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }
.modal-lg { width: 680px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 22px;
}
.modal-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.modal-close {
  background: var(--glass-soft);
  border: 1px solid var(--stroke);
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  width: 32px; height: 32px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.modal-close:hover { background: rgba(255,255,255,.1); color: var(--text); border-color: var(--stroke-strong); }
.modal-footer { display: flex; gap: 8px; justify-content: flex-end; margin-top: 22px; }
.form-group { margin-bottom: 16px; }

/* ── Bot config modal ── */

.bcfg-section {
  background: rgba(0, 0, 0, .22);
  border: 1px solid var(--stroke-weak);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.bcfg-section .sub-title {
  margin-bottom: 12px;
}
.bcfg-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--stroke-weak);
}
.bcfg-row:first-of-type { padding-top: 0; }
.bcfg-row-label { flex: 1; min-width: 0; }
.bcfg-select {
  width: auto;
  min-width: 150px;
  padding-top: 8px;
  padding-bottom: 8px;
}
.bcfg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.bcfg-list {
  max-height: 200px;
  overflow-y: auto;
  background: rgba(0, 0, 0, .32);
  border: 1px solid var(--stroke-weak);
  border-radius: 10px;
  padding: 10px;
  margin-top: 10px;
}
.bcfg-list .check-item {
  padding: 7px 8px;
  border-bottom: 1px solid var(--stroke-weak);
  border-radius: 0;
}
.bcfg-list .check-item:last-child { border-bottom: none; }
.bcfg-list .check-item:hover { background: rgba(255, 255, 255, .04); }

.seg {
  display: inline-flex;
  background: rgba(0, 0, 0, .3);
  border: 1px solid var(--stroke-weak);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
.seg input { display: none; }
.seg-item {
  cursor: pointer;
  padding: 6px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  transition: background .2s var(--ease), color .2s var(--ease);
  user-select: none;
}
.seg-item:hover { color: var(--text); }
.seg-item:has(input:checked) {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 2px 8px rgba(139, 92, 246, .42);
}
.seg-item span { pointer-events: none; }

.bcfg-cmd {
  display: flex !important;
  align-items: center;
  gap: 12px;
  padding: 10px 8px !important;
  border-bottom: 1px solid var(--stroke-weak);
  border-radius: 0;
  flex-wrap: wrap;
}
.bcfg-cmd:last-child { border-bottom: none; }
.bcfg-cmd input { flex-shrink: 0; margin: 0; }
.bcfg-cmd-name {
  font-family: 'JetBrains Mono', 'SF Mono', ui-monospace, monospace;
  font-size: 13px;
  font-weight: 700;
  color: #c4b5fd;
  min-width: 48px;
}
.bcfg-cmd-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
  flex: 1;
  min-width: 0;
}

.spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2.5px solid rgba(139,92,246,.22);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.alert {
  padding: 11px 14px;
  border-radius: 11px;
  font-size: 13px;
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
  border: 1px solid transparent;
}
.alert-error   { background: rgba(251,113,133,.1); color: var(--red);    border-color: rgba(251,113,133,.24); }
.alert-success { background: rgba(52,211,153,.1);  color: var(--green);  border-color: rgba(52,211,153,.24); }
.alert-info    { background: rgba(96,165,250,.1);  color: var(--blue);   border-color: rgba(96,165,250,.24); }
.alert-warn    { background: rgba(251,191,36,.1); color: var(--yellow); border-color: rgba(251,191,36,.24); }

.drop-zone {
  border: 2px dashed var(--stroke);
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  transition: border-color .2s var(--ease), background .2s var(--ease), transform .15s var(--ease);
  cursor: pointer;
  background: var(--glass-soft);
}
.drop-zone:hover { border-color: rgba(139, 92, 246, .4); background: rgba(139, 92, 246, .04); }
.drop-zone.drag-over {
  border-color: var(--accent);
  background: rgba(139, 92, 246, .08);
  transform: scale(1.01);
}
.drop-zone input[type="file"] { display: none; }

.qr-img {
  display: block;
  margin: 0 auto;
  max-width: 220px;
  border-radius: 12px;
  background: white;
  padding: 10px;
  box-shadow: var(--shadow-glow);
}

.code-block {
  background: rgba(0,0,0,.4);
  border: 1px solid var(--stroke-weak);
  border-radius: 11px;
  padding: 14px;
  font-family: 'JetBrains Mono', 'SF Mono', ui-monospace, monospace;
  font-size: 12px;
  color: var(--muted);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 180px;
  overflow-y: auto;
  line-height: 1.55;
}

.section-title { font-size: 16px; font-weight: 700; margin-bottom: 14px; letter-spacing: -0.015em; }
.sub-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted-2);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.search-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  background: var(--card);
  border: 1.5px solid rgba(139,92,246,.35);
  border-radius: var(--radius);
  margin-bottom: 8px;
}
.search-icon { font-size: 16px; flex-shrink: 0; }
.search-input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text); font-size: 15px;
}
.search-input::placeholder { color: var(--muted); }
.filter-panel {
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
}
.filter-panel-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.filter-title {
  font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em;
}
.filter-count {
  font-size: 12px; color: var(--accent);
}
.filter-reset { margin-left: auto; }
.tc-dropdown { position: relative; display: inline-block; }
.tc-drop-menu {
  position: absolute; bottom: calc(100% + 6px); left: 0;
  background: #1e1b2e;
  border: 1px solid rgba(139,92,246,.4);
  border-radius: 10px; padding: 4px;
  display: flex; flex-direction: column; gap: 2px;
  min-width: 130px; z-index: 100;
  box-shadow: 0 8px 32px rgba(0,0,0,.6), 0 0 0 1px rgba(139,92,246,.1);
  backdrop-filter: blur(12px);
}
.tc-drop-menu button {
  background: transparent; border: none; cursor: pointer;
  color: var(--text); font-size: 13px; text-align: left;
  padding: 7px 10px; border-radius: 6px; width: 100%;
  transition: background .12s;
}
.tc-drop-menu button:hover { background: var(--surface); }
.filter-blocks {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.filter-block {
  background: var(--surface);
  border: 1.5px solid rgba(139,92,246,.35);
  border-radius: 8px;
  padding: 10px 12px;
  min-width: 140px;
  box-shadow: 0 0 0 1px rgba(139,92,246,.08);
}
.filter-block-title {
  font-size: 11px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em;
  margin-bottom: 8px;
}
.filter-block-inputs {
  display: flex; align-items: center; gap: 6px;
}
.filter-sep {
  font-size: 12px; color: var(--muted);
}
.filter-input {
  width: 62px; padding: 5px 8px;
  background: var(--card); border: 1.5px solid rgba(139,92,246,.4);
  border-radius: 6px; color: var(--text); font-size: 13px;
  outline: none; transition: border-color .15s;
}
.filter-input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(139,92,246,.18); }
.filter-input::-webkit-inner-spin-button,
.filter-input::-webkit-outer-spin-button { display: none; }
.filter-input[type=number] { -moz-appearance: textfield; }
.reg-age-row {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 5px;
}
.reg-age-row:last-child { margin-bottom: 0; }
.reg-age-label {
  min-width: 20px;
  text-align: right;
  flex-shrink: 0;
}
.reg-age-num {
  width: 48px !important;
  flex-shrink: 0;
}
.reg-age-unit {
  flex: 1;
  padding: 5px 6px;
  background: var(--card);
  border: 1.5px solid rgba(139,92,246,.4);
  border-radius: 6px;
  color: var(--text);
  font-size: 12px;
  outline: none;
  cursor: pointer;
  transition: border-color .15s;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238a8ba8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  padding-right: 20px;
}
.reg-age-unit:focus { border-color: var(--accent); }
.reg-age-unit option { background: #1a1a2e; color: var(--text); }
.filter-toggle {
  display: flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden;
}
.ftog-btn {
  padding: 5px 12px; font-size: 12px;
  background: transparent; color: var(--muted);
  border: none; cursor: pointer; transition: background .15s, color .15s;
}
.ftog-btn:hover { background: var(--card); color: var(--text); }
.ftog-btn.active { background: var(--accent); color: #fff; }
/* ── Token toolbar (sort + pagination top) ── */
.token-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.token-toolbar .token-pagination { margin: 0; flex: 1; }

/* ── Sort dropdown ── */
.sort-dropdown { position: relative; }
.sort-btn { gap: 5px; }
.sort-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: auto;
  right: 0;
  background: #16162a;
  border: 1px solid var(--stroke-strong);
  border-radius: var(--radius-sm);
  padding: 6px;
  min-width: 210px;
  z-index: 200;
  box-shadow: 0 12px 36px rgba(0,0,0,.5);
}
.sort-menu-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 4px 8px 8px;
}
.sort-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 7px 10px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: background .12s, color .12s;
  text-align: left;
  gap: 8px;
}
.sort-item:hover { background: var(--glass); color: var(--text); }
.sort-item.active { background: var(--accent-soft); color: var(--accent); }
.sort-item-name { flex: 1; }
.sort-item-dir {
  font-size: 11px;
  opacity: .7;
  white-space: nowrap;
}

.bulk-toolbar {
  display: flex; gap: 10px; align-items: center;
  padding: 12px 16px;
  background: var(--accent-grad-soft);
  border: 1px solid rgba(139,92,246,.28);
  border-radius: var(--radius);
  margin-bottom: 16px;
  box-shadow: 0 4px 18px rgba(139, 92, 246, .12);
}
.bulk-toolbar .count {
  font-size: 13px;
  color: #c4b5fd;
  font-weight: 600;
}
.bulk-hint {
  font-size: 11px;
  color: rgba(196,181,253,.5);
  flex: 1;
}

.screen-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.screen-header .page-title { margin-bottom: 0; }
.screen-header .header-actions { display: flex; gap: 8px; margin-left: auto; align-items: center; }

.member-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--stroke-weak);
}
.member-row:last-child { border-bottom: none; }

.settings-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--stroke-weak);
}
.settings-row:last-child { border-bottom: none; }
.settings-row .lbl-main { font-size: 14px; font-weight: 600; flex: 1; }
.settings-row .lbl-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }

.toggle-wrap { display: flex; align-items: center; gap: 8px; }
.toggle {
  position: relative;
  display: inline-block;
  width: 42px; height: 24px;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer;
  inset: 0;
  background: var(--stroke);
  border-radius: 24px;
  transition: .25s var(--ease);
  border: 1px solid var(--stroke);
}
.toggle-slider:before {
  content: '';
  position: absolute;
  height: 18px; width: 18px;
  left: 2px; top: 2px;
  background: #fff;
  border-radius: 50%;
  transition: .25s var(--ease);
  box-shadow: 0 2px 6px rgba(0,0,0,.4);
}
.toggle input:checked + .toggle-slider {
  background: var(--accent-grad);
  border-color: transparent;
  box-shadow: 0 0 12px rgba(139, 92, 246, .45);
}
.toggle input:checked + .toggle-slider:before { transform: translateX(18px); }

input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }
input[type="radio"] { accent-color: var(--accent); cursor: pointer; }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
  font-size: 14px;
}
.empty-state .icon {
  font-size: 44px;
  margin-bottom: 14px;
  opacity: .5;
}

.tabs {
  display: flex; gap: 4px;
  border-bottom: 1px solid var(--stroke);
  margin-bottom: 22px;
}
.tab-btn {
  padding: 11px 20px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .2s var(--ease), border-color .2s var(--ease);
  font-family: inherit;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
  color: #c4b5fd;
  border-bottom-color: var(--accent);
}

.gap-8 { gap: 8px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.mt-4 { margin-top: 4px; }
.mt-6 { margin-top: 6px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-6 { margin-bottom: 6px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.w-full { width: 100%; }
.text-muted { color: var(--muted); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.mono { font-family: 'JetBrains Mono', 'SF Mono', ui-monospace, monospace; }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-yellow { color: var(--yellow); }
.text-blue { color: var(--blue); }
.text-accent { color: var(--accent); }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.ml-4 { margin-left: 4px; }
.badge-sm { font-size: 10px; padding: 2px 7px; }

.progress-bar {
  height: 6px;
  background: var(--stroke);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 10px;
}
.progress-fill {
  height: 100%;
  background: var(--accent-grad);
  border-radius: 4px;
  transition: width .35s var(--ease);
}

.check-list { display: flex; flex-direction: column; gap: 9px; }
.check-item {
  display: flex; align-items: center; gap: 9px;
  font-size: 14px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
  transition: background .15s var(--ease);
}
.check-item:hover { background: var(--glass-soft); }
.check-item input { cursor: pointer; }

.bot-card {
  background: var(--glass);
  backdrop-filter: blur(var(--blur)) saturate(135%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(135%);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex; align-items: center; gap: 14px;
  transition: border-color .2s var(--ease), transform .2s var(--ease);
  position: relative;
  overflow: hidden;
}
.bot-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.12), transparent);
}
.bot-card:hover { border-color: var(--stroke-strong); transform: translateY(-2px); }
.bot-card + .bot-card { margin-top: 10px; }
.bot-card-info { flex: 1; min-width: 0; }
.bot-card-name { font-weight: 700; font-size: 14px; }
.bot-card-meta { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.bot-card-actions { display: flex; gap: 6px; }

.team-card {
  background: var(--glass);
  backdrop-filter: blur(var(--blur)) saturate(135%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(135%);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  padding: 18px;
  transition: border-color .2s var(--ease), transform .2s var(--ease);
  position: relative;
  overflow: hidden;
}
.team-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.12), transparent);
}
.team-card:hover { border-color: var(--stroke-strong); transform: translateY(-2px); }
.team-card + .team-card { margin-top: 10px; }

.ws-card {
  background: var(--glass);
  backdrop-filter: blur(var(--blur)) saturate(135%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(135%);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  transition: border-color .2s var(--ease), transform .2s var(--ease);
  position: relative;
  overflow: hidden;
}
.ws-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.12), transparent);
}
.ws-card:hover { border-color: var(--stroke-strong); transform: translateY(-2px); }
.ws-card + .ws-card { margin-top: 10px; }

select.inp {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8ba8' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

textarea.inp { resize: both; min-height: 80px; line-height: 1.5; }

/* ── Mobile: burger drawer ── */

.burger {
  display: none;
  position: fixed;
  top: 14px; left: 14px;
  z-index: 120;
  width: 44px; height: 44px;
  background: var(--glass-strong);
  backdrop-filter: blur(var(--blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
  border: 1px solid var(--stroke-strong);
  border-radius: 12px;
  color: var(--text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(4,4,10,.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99;
  opacity: 0;
  transition: opacity .25s var(--ease);
}
.sidebar-overlay.show { display: block; opacity: 1; }

@media (max-width: 880px) {
  .burger { display: flex; }

  .sidebar {
    position: fixed;
    top: 0; bottom: 0; left: 0;
    width: 270px;
    min-height: 100vh;
    transform: translateX(-110%);
    transition: transform .28s var(--ease);
    padding-top: 24px;
    z-index: 110;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar::after { display: none; }

  .main {
    margin-left: 0;
    padding: 64px 16px 40px;
  }

  .screen-header {
    flex-wrap: wrap;
    gap: 8px;
    margin-left: 56px;
    margin-bottom: 18px;
  }
  .screen-header .page-title { font-size: 18px; gap: 8px; }
  .screen-header .page-title .title-icon { width: 32px; height: 32px; border-radius: 9px; }
  .screen-header .page-title .title-icon svg { width: 16px; height: 16px; }
  .screen-header .header-actions {
    margin-left: 0;
    width: 100%;
    justify-content: flex-end;
  }

  .page-title { font-size: 18px; }

  /* Bot config: rows stack */
  .bcfg-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .bcfg-select { width: 100%; min-width: 0; }
  .bcfg-head { flex-direction: column; align-items: stretch; }
  .bcfg-list { max-height: 240px; }

  /* Token cards: stack everything */
  .token-card {
    padding: 12px;
    gap: 8px;
    flex-direction: column;
    align-items: stretch;
  }
  .tc-check { align-self: flex-start; }
  .tc-main {
    width: 100%;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .tc-id {
    min-width: 0;
    flex-direction: row;
    align-items: baseline;
    gap: 8px;
  }
  .token-name { max-width: none; }
  .tc-meta { gap: 5px; }
  .token-actions {
    width: 100%;
    grid-template-columns: 1fr 1fr;
  }

  /* Bulk toolbar */
  .bulk-toolbar {
    flex-wrap: wrap;
    gap: 6px;
  }
  .bulk-toolbar .count { width: 100%; flex-basis: 100%; }

  /* Cards: full width */
  .card { padding: 14px; border-radius: var(--radius); }

  /* Forms: stack */
  .inp-row { flex-direction: column; gap: 8px; }
  .inp-row .inp { width: 100%; }
  .inp-row .btn { width: 100%; }

  /* Top-up grid → single column */
  #screen-topup > div[style*="grid-template-columns"],
  #screen-teams > div div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

  /* History table → horizontal scroll without breaking */
  #hist-table-wrap { padding: 6px; }
  #hist-table-wrap .tbl th,
  #hist-table-wrap .tbl td { padding: 8px 10px; font-size: 12px; }

  /* Modals: full-screen on mobile */
  .modal {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    min-height: 100vh;
    padding: 16px;
    padding-top: 56px;
  }
  .modal-overlay {
    padding: 0;
    align-items: stretch;
  }
  .modal-header { margin-bottom: 16px; }
  .modal-footer { justify-content: stretch; }
  .modal-footer .btn { flex: 1; }

  /* Alerts: stacked content */
  .alert { font-size: 12px; }

  /* Lists: smaller paddings */
  .member-row, .settings-row { gap: 8px; padding: 8px 0; }
  .bot-card { padding: 12px; flex-wrap: wrap; gap: 10px; }
  .bot-card-info { width: 100%; flex-basis: 100%; }
  .bot-card-actions { flex-wrap: wrap; }
  .team-card { padding: 14px; }
  .ws-card { padding: 12px; }

  /* Tabs: scrollable */
  .tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .tab-btn { white-space: nowrap; padding: 10px 14px; }

  /* Spinner code block */
  .code-block { font-size: 11px; padding: 10px; }

  /* SMS code display */
  #sms-code-display { font-size: 28px !important; letter-spacing: 6px !important; }

  /* Pool/chats lists inside team detail */
  #team-detail-content .inp-row { flex-direction: column; }
  #team-detail-content .inp-row .inp { max-width: none !important; }
  #team-detail-content .inp-row .btn { width: 100%; }

  /* Body bg blobs smaller */
  body::before { width: 320px; height: 320px; }
  body::after { width: 380px; height: 380px; }
}

/* ── Loading states for card actions ── */

.btn-spinner {
  display: inline-block;
  width: 12px; height: 12px;
  border: 2px solid rgba(255,255,255,.28);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  flex-shrink: 0;
  margin-right: 2px;
  vertical-align: -2px;
}
.btn.is-loading {
  cursor: wait;
  pointer-events: none;
  opacity: .85;
}
.btn-primary.is-loading { box-shadow: 0 4px 16px rgba(139, 92, 246, .55); }
.btn-primary.is-loading .btn-spinner { border-color: rgba(255,255,255,.4); border-top-color: #fff; }
.btn-danger.is-loading .btn-spinner { border-color: rgba(251,113,133,.35); border-top-color: var(--red); }
.btn-success.is-loading .btn-spinner { border-color: rgba(52,211,153,.35); border-top-color: var(--green); }
.btn-ghost.is-loading .btn-spinner { border-color: rgba(255,255,255,.22); border-top-color: var(--text); }

.token-card.busy {
  position: relative;
}
.token-card.busy::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  background: rgba(20, 20, 38, .35);
  backdrop-filter: blur(1px);
  pointer-events: none;
  animation: cardBusyPulse 1.2s ease-in-out infinite;
}
.token-card.busy .token-actions button:not(.is-loading):not(:disabled) {
  opacity: .35;
}
@keyframes cardBusyPulse {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}

.token-actions button[data-act] { transition: opacity .2s var(--ease), transform .15s var(--ease); }
.token-actions button[data-act]:not(:disabled):active { transform: scale(.94); }

.bulk-toolbar .count { transition: opacity .2s var(--ease); }
.bulk-toolbar button:disabled { opacity: .45; cursor: wait; }
/* ── Deals ── */
.deals-tabs { display:flex; gap:4px; margin-bottom:20px; }
.deal-tab { padding:8px 16px; border-radius:8px; border:none; background:rgba(255,255,255,.06); color:var(--text-muted,#888); font-size:13px; cursor:pointer; transition:.15s; }
.deal-tab.active { background:var(--accent,#5865f2); color:#fff; }
.deal-tab-content.hidden { display:none; }
.deal-card { background:var(--card,#1c1c22); border:1px solid var(--border,#2a2a32); border-radius:12px; padding:16px; margin-bottom:12px; cursor:pointer; transition:border-color .15s; }
.deal-card:hover { border-color:var(--accent,#5865f2); }
.deal-card-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:8px; }
.deal-card-meta { font-size:13px; color:var(--text-muted,#888); }
.badge-blue { background:rgba(88,101,242,.15); color:#818cf8; }
.badge-purple { background:rgba(139,92,246,.15); color:#a78bfa; }
/* ── ZIP token list ── */
.zip-tok-row { background:var(--glass-soft); border:1px solid var(--stroke-weak); border-radius:8px; padding:10px 12px; }
.zip-tok-token { font-family:ui-monospace,monospace; font-size:11px; color:var(--text-muted,#888); word-break:break-all; margin-bottom:4px; }
.zip-tok-meta { font-size:12px; color:var(--text); }
.zip-tok-status { font-size:12px; margin-top:4px; min-height:16px; }

/* ---- Pagination ---- */
.token-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 10px 0;
}
.pg-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--stroke);
  background: var(--glass-soft);
  color: var(--text);
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  transition: background .2s var(--ease), border-color .2s var(--ease);
}
.pg-btn:hover:not(.pg-disabled):not(.pg-active) {
  background: rgba(255,255,255,.08);
  border-color: var(--stroke-strong);
}
.pg-btn.pg-active {
  background: var(--accent-grad);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
  cursor: default;
}
.pg-btn.pg-disabled {
  opacity: 0.3;
  cursor: default;
}
.pg-dots {
  display: inline-flex;
  align-items: center;
  padding: 0 4px;
  color: var(--muted);
  font-size: 14px;
}

.token-show-more {
  display: flex;
  justify-content: center;
  padding: 4px 0 2px;
}

.tc-2fa-row {
  display: flex;
  align-items: center;
  margin-top: 4px;
}
.tc-reg-row {
  margin-top: 3px;
}

/* ---- Token notes ---- */
.tc-notes {
  flex: 1 1 160px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  min-width: 160px;
  padding: 0 14px;
  border-left: 1px solid var(--stroke);
}
.tc-notes-input {
  min-height: 90px;
  width: 100%;
  resize: vertical;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-xs);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  line-height: 1.5;
  padding: 6px 8px;
  transition: border-color .2s var(--ease), background .2s var(--ease);
  outline: none;
  box-sizing: border-box;
}
.tc-notes-input::placeholder { color: var(--muted-2); }
.tc-notes-input:focus {
  border-color: var(--accent);
  background: rgba(139,92,246,.07);
}
.tc-notes-status {
  font-size: 11px;
  color: var(--muted);
  height: 14px;
  line-height: 14px;
}


/* ── TAGS ── */
.tags-panel {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 0 4px;
}
.tags-filter-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
}
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  background: var(--tag-color, #6366f1);
  color: #fff;
  border: 2px solid transparent;
  transition: opacity .15s, border-color .15s, transform .1s;
  user-select: none;
  white-space: nowrap;
}
.tag-chip:hover { opacity: .82; transform: scale(1.04); }
.tag-chip.active { border-color: rgba(255,255,255,.8); box-shadow: 0 0 0 2px var(--tag-color, #6366f1); }
.tags-manage-btn { flex-shrink: 0; }

/* Token card tags column */
.tc-tags-col {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 60px;
  max-width: 130px;
  justify-content: center;
  padding: 0 14px;
  border-left: 1px solid var(--stroke);
}
.tc-tag-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  background: var(--tag-color, #6366f1);
  color: #fff;
  user-select: none;
  opacity: .9;
  transition: opacity .15s;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tc-tag-chip:hover { opacity: 1; }
.tc-tag-add {
  background: none;
  border: 1px dashed var(--stroke);
  color: var(--muted);
  border-radius: 10px;
  font-size: 12px;
  line-height: 1;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color .15s, color .15s;
  flex-shrink: 0;
}
.tc-tag-add:hover { border-color: var(--accent); color: var(--accent); }

/* Tags management modal */
.tags-modal-section-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.tags-modal-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
  min-height: 16px;
  max-height: 220px;
  overflow-y: auto;
}
.tags-modal-divider {
  border: none;
  border-top: 1px solid var(--stroke);
  margin: 16px 0;
}
.tags-modal-create {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tag-name-input {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 12px;
  background: var(--card, #1a1a2e);
  border: 1.5px solid rgba(139,92,246,.4);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.tag-name-input::placeholder { color: var(--muted); }
.tag-name-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139,92,246,.18);
}
.tag-manage-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px 4px 11px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  background: var(--tag-color, #6366f1);
  color: #fff;
  white-space: nowrap;
  user-select: none;
}
.tag-manage-del {
  background: rgba(0,0,0,.25);
  border: none;
  color: #fff;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  font-size: 10px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  opacity: .75;
  transition: opacity .12s, background .12s;
  flex-shrink: 0;
}
.tag-manage-del:hover { opacity: 1; background: rgba(0,0,0,.45); }

/* Color picker */
.tag-color-picker {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.tag-color-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  outline: 2px solid transparent;
  transition: transform .1s, outline-color .1s;
  flex-shrink: 0;
}
.tag-color-swatch:hover { transform: scale(1.12); }
.tag-color-swatch.selected { outline-color: var(--text); outline-offset: 2px; }

/* Tag assign popup */
.tag-assign-popup {
  position: fixed;
  z-index: 9999;
  background: var(--bg-card, #1e1e2e);
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 6px;
  min-width: 190px;
  max-height: 260px;
  overflow-y: auto;
  box-shadow: 0 10px 32px rgba(0,0,0,.45);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tag-assign-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  transition: background .12s;
}
.tag-assign-item:hover { background: var(--glass); }
.tag-assign-item input[type=checkbox] { cursor: pointer; accent-color: var(--accent); width:15px; height:15px; flex-shrink:0; }

/* ── Bulk tags modal ── */

.bulk-tags-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}
.bulk-tag-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--glass-soft, rgba(255,255,255,.04));
  border: 1px solid var(--stroke-weak, rgba(255,255,255,.05));
  cursor: pointer;
  transition: background .15s var(--ease), border-color .15s var(--ease);
}
.bulk-tag-item:hover {
  background: rgba(255,255,255,.07);
  border-color: var(--stroke, rgba(255,255,255,.1));
}
.bulk-tag-item input[type=checkbox] {
  cursor: pointer;
  accent-color: var(--tag-color, var(--accent));
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.bulk-tag-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 20px;
  background: var(--tag-color, #6366f1);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  user-select: none;
  letter-spacing: -0.01em;
}
.bulk-tag-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-muted, rgba(255,255,255,.4));
  white-space: nowrap;
}
