:root {
  --bg: #eef2f6;
  --panel: #fff;
  --border: #d8dee6;
  --text: #12161c;
  --muted: #5b6473;
  --accent: #0f766e;
  --accent-soft: #ecfdf5;
  --warn: #d97706;
  --sidebar-w: 220px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; }
body.admin-body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: #0f172a;
  color: #e2e8f0;
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.admin-brand {
  font-size: 0.95rem;
  font-weight: 800;
  padding: 8px 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  margin-bottom: 6px;
}
.admin-brand small {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  color: #94a3b8;
  margin-top: 4px;
}
.admin-nav a {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
}
.admin-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.admin-nav a.active { background: var(--accent); color: #fff; }
.admin-nav-home {
  margin-bottom: 6px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  color: #f8fafc !important;
}
.admin-nav-home:hover { background: rgba(255,255,255,.1) !important; }
.admin-sidebar-foot { margin-top: auto; padding-top: 12px; }
.admin-sidebar-foot a, .admin-sidebar-foot button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 0.82rem;
  cursor: pointer;
  border-radius: 8px;
}
.admin-sidebar-foot a:hover, .admin-sidebar-foot button:hover { background: rgba(255,255,255,.06); color: #fff; }
.admin-main { flex: 1; min-width: 0; padding: 18px 16px 40px; }
.admin-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.admin-top h1 { font-size: 1.35rem; font-weight: 800; }
.admin-who { font-size: 0.82rem; color: var(--muted); margin-top: 4px; }
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 8px 24px rgba(15,23,42,.05);
}
.card h2 { font-size: 0.95rem; margin-bottom: 10px; }
.stat { font-size: 0.88rem; color: var(--muted); line-height: 1.65; }
.stat strong { color: var(--text); }
label { display: block; font-size: 0.8rem; font-weight: 600; margin: 8px 0 4px; }
input, select {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 0.95rem;
  background: #fff;
}
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.row > * { flex: 1; min-width: 120px; }
.btn {
  padding: 10px 14px;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.88rem;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-sm { background: #f1f5f9; border: 1px solid var(--border); color: var(--text); }
.btn-primary.btn-sm,
.btn.btn-primary.btn-sm {
  background: var(--accent);
  color: #fff;
  border: none;
}
.btn-warn { background: var(--warn); color: #fff; }
.btn-manual-done {
  background: #6366f1;
  color: #fff;
  margin-top: 0;
  font-size: 0.72rem;
  padding: 6px 10px;
  white-space: nowrap;
}
.btn-manual-done:hover { background: #4f46e5; }
.btn-manual-done:disabled { opacity: 0.6; cursor: wait; }
.btn-manual-send { margin-top: 0; font-size: 0.72rem; padding: 6px 10px; white-space: nowrap; }
.btn-manual-send:disabled { opacity: 0.6; cursor: wait; }
.report-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.btn-cancel-pay { font-size: 0.72rem; padding: 6px 10px; white-space: nowrap; color: #64748b; }
.btn-cancel-pay:disabled { opacity: 0.6; cursor: wait; }
.msg { padding: 10px; border-radius: 10px; margin-bottom: 10px; font-size: 0.85rem; display: none; }
.msg.on { display: block; }
.msg.err { background: #fef2f2; color: #991b1b; }
.msg.ok { background: #ecfdf5; color: #065f46; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
table.data th, table.data td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  line-height: 1.35;
}
table.data th { color: var(--muted); font-weight: 600; white-space: nowrap; }
.date-input {
  min-width: 160px;
  padding: 10px 12px;
  font-size: 0.95rem;
  cursor: pointer;
}
.date-input::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.85;
  transform: scale(1.2);
}
.cell-with-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.btn-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f8fafc;
  color: #64748b;
  cursor: pointer;
  flex-shrink: 0;
}
.btn-copy:hover { background: #e2e8f0; color: #0f172a; }
.btn-copy.copied { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }
.copy-target-muted { color: var(--muted); word-break: break-all; font-size: 0.72rem; }
.ton-send-amt { font-size: 1rem; color: #0f766e; }
.manual-send-box {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  font-size: 0.72rem;
  line-height: 1.45;
}
.manual-send-box strong { color: #0f766e; }
.manual-send-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}
.manual-send-row span { flex: 1; word-break: break-all; }
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  font-size: 0.72rem;
  white-space: nowrap;
}
.badge.ok { background: #d1fae5; color: #065f46; }
.badge.wait { background: #fef3c7; color: #92400e; }
.badge.bad { background: #fee2e2; color: #991b1b; }
.badge.neutral { background: #e2e8f0; color: #334155; }
.budget-panel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 0 12px;
}
.budget-chip {
  border-radius: 12px;
  padding: 10px 8px;
  text-align: center;
  border: 1px solid var(--border);
  background: #f8fafc;
}
.budget-chip .n {
  display: block;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.2;
}
.budget-chip .l {
  display: block;
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 2px;
}
.budget-panel.has-funds {
  background: linear-gradient(180deg, #ecfdf5, #fff);
  border-radius: 14px;
  padding: 8px;
  border: 1px solid #a7f3d0;
}
.budget-panel.has-funds .budget-chip.total,
.budget-panel.has-funds .budget-chip.remaining {
  background: #d1fae5;
  border-color: #6ee7b7;
}
.budget-panel.has-funds .budget-chip.total .n,
.budget-panel.has-funds .budget-chip.remaining .n {
  color: #047857;
}
.budget-panel.empty {
  background: #fffbeb;
  border-radius: 14px;
  padding: 8px;
  border: 1px dashed #fcd34d;
}
.budget-panel.empty .budget-chip .n { color: #b45309; }
.budget-panel.flash {
  animation: budgetFlash 1.2s ease;
}
@keyframes budgetFlash {
  0% { box-shadow: 0 0 0 0 rgba(16,185,129,.55); }
  70% { box-shadow: 0 0 0 10px rgba(16,185,129,0); }
  100% { box-shadow: none; }
}
.budget-saved {
  font-size: 0.82rem;
  font-weight: 700;
  color: #047857;
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  border-radius: 10px;
  padding: 8px 10px;
  margin: 0 0 10px;
}
.budget-saved.warn {
  color: #92400e;
  background: #fffbeb;
  border-color: #fcd34d;
}
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0 0 8px;
}
.card-budget-binance { border-left: 4px solid #f59e0b; }
.card-budget-bybit { border-left: 4px solid #0098ea; }
.btn-add-budget { background: var(--accent); color: #fff; border: none; }
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.summary-box {
  background: var(--accent-soft);
  border: 1px solid #a7f3d0;
  border-radius: 12px;
  padding: 10px 12px;
}
.summary-box .n { font-size: 1.2rem; font-weight: 800; color: var(--accent); }
.summary-box .l { font-size: 0.75rem; color: var(--muted); }
.report-pre {
  white-space: pre-wrap;
  font-size: 0.75rem;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  max-height: 180px;
  overflow: auto;
}
.thumb-link {
  display: inline-block;
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 600;
}
.card-exchange-route.route-fallback { border-color: #f59e0b; background: #fffbeb; }
.card-exchange-route.route-down-all { border-color: #ef4444; background: #fef2f2; }
.exchange-summary { font-size: 0.88rem; margin: 0 0 10px; font-weight: 600; }
.exchange-route-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.exchange-route-box {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  background: #fff;
}
.exchange-route-box.route-active { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(13,148,136,.15); }
.exchange-route-box.route-down { background: #fef2f2; border-color: #fecaca; }
.route-title { font-weight: 700; font-size: 0.85rem; margin-bottom: 6px; }
.route-tag { font-size: 0.72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; margin-left: 6px; }
.route-tag.ok { background: #dcfce7; color: #166534; }
.route-tag.bad { background: #fee2e2; color: #991b1b; }
.route-reason { font-size: 0.75rem; color: var(--muted); margin: 0; min-height: 2.4em; }
.exchange-route-hint { margin: 10px 0 0; font-size: 0.75rem; }
.report-exchange { margin-top: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.badge-exchange { font-weight: 700; }
.report-exchange-label { font-size: 0.72rem; color: var(--muted); }
.report-note {
  margin-top: 6px;
  font-size: 0.72rem;
  padding: 6px 8px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid var(--border);
}
.report-note.warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.report-note.bad { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
[hidden] { display: none !important; }
@media (max-width: 760px) {
  .admin-shell { flex-direction: column; }
  .admin-sidebar {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
  .admin-nav { display: flex; gap: 6px; flex-wrap: wrap; }
  .admin-sidebar-foot { margin-top: 0; width: 100%; }
}

/* Yoga portal admin sidebar: match /yoga/app.html exactly. */
.yoga-admin-body .admin-sidebar {
  background: #0c1222;
  padding: 16px 10px;
  gap: 0;
}
.yoga-admin-body .admin-brand {
  font-size: 0.9rem;
  padding: 8px 10px 16px;
  margin-bottom: 10px;
}
.yoga-admin-body .admin-nav a {
  margin-bottom: 4px;
}
.yoga-admin-body .admin-sidebar-foot {
  margin-top: auto;
  padding: 12px 10px 4px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.yoga-admin-body .admin-sidebar-foot .yoga-btn-logout {
  width: 100%;
  text-align: center;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.06);
  color: #fca5a5;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.yoga-admin-body .admin-sidebar-foot .yoga-btn-logout:hover {
  background: rgba(239,68,68,.15);
  border-color: rgba(239,68,68,.35);
  color: #fca5a5;
}

/* Встраивание бюджета в video-hub админку */
html.donat-embed-budget .admin-sidebar,
html.donat-embed-budget .admin-sidebar-foot {
  display: none !important;
}
html.donat-embed-budget .admin-shell {
  display: block;
}
html.donat-embed-budget .admin-main {
  width: 100%;
  max-width: none;
  padding: 12px 14px 20px;
}
html.donat-embed-budget .admin-top h1 {
  font-size: 1.1rem;
}
html.donat-embed-budget .admin-top .admin-who {
  display: none;
}
html.donat-embed-budget .admin-main > .card:not(#card-exchange-route):not(.card-budget-binance):not(.card-budget-bybit) {
  display: none !important;
}
