:root {
  --bg:        var(--tg-theme-bg-color, #0f1115);
  --bg-sec:    var(--tg-theme-secondary-bg-color, #171a21);
  --text:      var(--tg-theme-text-color, #e9edf1);
  --hint:      var(--tg-theme-hint-color, #8a92a3);
  --link:      var(--tg-theme-link-color, #5aa0ff);
  --accent:    var(--tg-theme-button-color, #3d8bfd);
  --accent-tx: var(--tg-theme-button-text-color, #ffffff);
  --green:     #2fbf6a;
  --red:       #ef5757;
  --amber:     #d99a2b;
  --radius:    14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Vazirmatn", Tahoma, sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ── auth screen ─────────────────────────── */
.auth-error {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-error-box { text-align: center; max-width: 320px; }
.auth-error-icon { font-size: 40px; margin-bottom: 12px; }
#auth-error-text { color: var(--hint); line-height: 1.8; }

/* ── layout ───────────────────────────────── */
.app { display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.topbar h1 { font-size: 17px; margin: 0; font-weight: 700; }
.admin-name { font-size: 12px; color: var(--hint); }

.tabs {
  display: flex;
  overflow-x: auto;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  flex: 0 0 auto;
  background: var(--bg-sec);
  color: var(--text);
  border: none;
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 13px;
  white-space: nowrap;
  position: relative;
}
.tab-btn.active {
  background: var(--accent);
  color: var(--accent-tx);
  font-weight: 600;
}
.badge {
  display: inline-block;
  min-width: 16px;
  padding: 0 4px;
  margin-inline-start: 4px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  line-height: 16px;
}
.badge:empty { display: none; }

.content { flex: 1; padding: 14px 12px 40px; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.panel-head h2 { font-size: 15px; margin: 0; }
.refresh-btn {
  background: var(--bg-sec);
  color: var(--text);
  border: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 16px;
}

.hint { color: var(--hint); font-size: 12.5px; line-height: 1.8; margin: 0 0 12px; }

/* ── cards / list items ──────────────────── */
.list { display: flex; flex-direction: column; gap: 10px; }

.card {
  background: var(--bg-sec);
  border-radius: var(--radius);
  padding: 14px;
}

.item-card { }
.item-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 4px 0;
  border-bottom: 1px dashed rgba(255,255,255,0.06);
}
.item-row:last-of-type { border-bottom: none; }
.item-row .k { color: var(--hint); }
.item-row .v { font-weight: 600; text-align: left; direction: ltr; }

.proof-box { margin: 10px 0; }
.proof-box img, .proof-box video { width: 100%; border-radius: 10px; display: block; }
.proof-box audio { width: 100%; }
.proof-text {
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
  padding: 10px;
  font-size: 13px;
  line-height: 1.8;
  white-space: pre-wrap;
}

.actions { display: flex; gap: 8px; margin-top: 10px; }

input[type=text], input[type=number], select, textarea {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  margin: 4px 0 10px;
  direction: ltr;
  text-align: right;
}
select { direction: rtl; }
label { font-size: 12.5px; color: var(--hint); }

button {
  cursor: pointer;
  font-family: inherit;
}

.primary-btn, .ok-btn, .reject-btn, .small-btn {
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 600;
}

.primary-btn {
  width: 100%;
  background: var(--accent);
  color: var(--accent-tx);
  margin-top: 4px;
}

.ok-btn { flex: 1; background: var(--green); color: #fff; }
.reject-btn { flex: 1; background: var(--red); color: #fff; }
.small-btn { background: rgba(255,255,255,0.08); color: var(--text); }

.empty-state {
  text-align: center;
  color: var(--hint);
  padding: 40px 10px;
  font-size: 13.5px;
}

.toast {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: #222;
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  z-index: 999;
  opacity: 0;
  transition: opacity .2s;
}
.toast.show { opacity: 1; }

.wallet-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(255,255,255,0.06);
  font-size: 12.5px;
}
.wallet-row:last-of-type { border-bottom: none; }
.wallet-addr { direction: ltr; text-align: left; word-break: break-all; flex: 1; }
.wallet-net { color: var(--hint); flex: 0 0 55px; }
.wallet-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.wallet-inactive { opacity: .45; }

.add-wallet-card { margin-top: 14px; }
.add-wallet-card h3 { margin: 0 0 10px; font-size: 14px; }
