:root{
  --bg-900:#0f1117; --bg-800:#131826; --card:#151a28; --edge:#2b3046;
  --text:#E6E8F0; --muted:#97A2B3;
  --accent:#6c5ce7; --accent-2:#4f46e5; --accent-3:#7c6df0;
  --good:#6c5ce7; --bad:#ef4444;
}

/* ============== Базовые перетяжки ============== */
body{background:var(--bg-900)!important;color:var(--text)!important;}
.header, .topbar{background:linear-gradient(180deg,#15192c,#121623)!important;border-bottom:1px solid var(--edge)!important}
a, .link{color:var(--accent)!important}

.btn, button, .button{
  border-radius:10px; padding:10px 16px; font-weight:600; border:0; transition:.2s;
}
.btn--primary, .btn-primary, .btn.primary, button.primary{
  background:linear-gradient(180deg,var(--accent),var(--accent-2))!important;
  color:#fff!important;
}
.btn--primary:hover{filter:brightness(1.05)}
.btn--outline{
  background:transparent!important; color:var(--accent)!important;
  border:1px solid var(--accent)!important;
}
.btn--outline:hover{background:linear-gradient(180deg,var(--accent),var(--accent-2))!important;color:#fff!important}

/* ============== Карточки/контейнеры ============== */
.card, .mh-card{
  background:radial-gradient(120% 120% at 0% 0%, #171b2a 0%, #131826 60%)!important;
  border:1px solid var(--edge)!important; border-radius:16px!important;
  box-shadow:0 8px 24px rgba(10,12,22,.4)!important;
}

/* ============== Профиль ============== */
.mh-profile{display:grid;gap:24px}
.mh-hero{display:grid;grid-template-columns:1fr 320px;gap:20px;align-items:stretch}
.mh-hero .card{padding:20px}
.mh-title{font-size:22px;margin:0 0 10px}
.mh-kpis{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-top:6px}
.kpi{padding:12px;background:#121624;border:1px solid var(--edge);border-radius:12px}
.kpi__label{font-size:12px;color:var(--muted)}
.kpi__value{font-size:18px;margin-top:6px}
.kpi__value.bad{color:var(--bad)}
.kpi__sub{font-size:12px;color:var(--muted)}

.mh-actions{margin-top:14px;display:flex;gap:10px;flex-wrap:wrap}

.mh-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.mh-list .miner{padding:14px}
.mh-list .miner__hdr{display:flex;gap:8px;align-items:center;margin-bottom:8px}
.mh-list .miner__idx{opacity:.7}
.mh-list .miner__model{font-weight:700}
.mh-list .miner__row{
  display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px
}
.mh-list .miner__item{
  padding:10px;border:1px dashed var(--edge);border-radius:10px;background:#121624
}
.mh-list .miner .lbl{font-size:11px;color:var(--muted)}
.mh-list .miner .val{font-size:14px;margin-top:4px}
.mh-list .miner .muted{color:var(--muted);font-size:12px;margin-left:4px}

/* ============== Статистика ============== */
.stats-card{max-width:1100px;margin:0 auto}
.stats-card canvas{height:160px!important}

/* ============== Сайдбар: скрыть на мобиле ============== */
@media (max-width: 991.98px){
  .sidebar{display:none!important}
  .content, .page-content, .container{margin-left:0!important}
  .mh-hero{grid-template-columns:1fr}
  .mh-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
  .mh-list{grid-template-columns:1fr}
  .mh-list .miner__row{grid-template-columns:1fr 1fr}
}
/* очень узкие телефоны */
@media (max-width: 420px){
  .mh-kpis{grid-template-columns:1fr}
  .mh-list .miner__row{grid-template-columns:1fr}
}

/* Пурпурные индикации выбора/фокуса */
.sidebar .menu-item.active,
.sidebar .menu-item:focus{
  outline:0!important;
  box-shadow:0 0 0 2px rgba(108,92,231,.35) inset!important;
  border-color:var(--accent)!important;
}

/* ====== APP FIXES (mobile + purple theme)  ====== */
:root{
  /* фиолетовый акцент */
  --accent:#6c5ce7;
  --accent-2:#5748c8;
  --accent-3:#4033a8;
  /* перетираем «успешный» зелёный, чтобы не светился в UI */
  --good:#6c5ce7;
}
/* кнопки */
button,.btn,.btn-primary,.btn--primary{
  white-space: normal;            /* переносить текст */
  line-height: 1.15;
  min-height: 44px;
  font-weight: 600;
  border-radius: 12px;
}
.btn-primary,.btn--primary{
  background: linear-gradient(180deg,var(--accent) 0%,var(--accent-2) 100%) !important;
  border: 0 !important;
  color: #fff !important;
}
.btn-outline,.btn--outline,.btn-outline-primary,.btn-secondary.outline{
  background: transparent !important;
  border: 1px solid var(--accent) !important;
  color: #e6e9ff !important;
}
.btn-success,.bg-success,.border-success{ 
  background: var(--accent) !important; 
  border-color: var(--accent) !important; 
}
.text-success{ color: var(--accent) !important; }

/* карточки / панели / таблицы по умолчанию темнее */
.card,.panel,.box,.table{
  background: #151528;
  border: 1px solid #30304a;
  border-radius: 16px;
}

/* сайдбар: актив — без зелёной обводки */
.sidebar .menu-item.active,
.sidebar .menu-item:focus,
.sidebar .menu-item:hover{
  box-shadow: 0 0 0 2px rgba(108,92,231,.22) inset !important;
  border-color: var(--accent) !important;
}

/* Майнеры (таблица) — убираем зелёный фон/рамки если встречаются */
.page-miners table td,
.page-miners table th{
  background: transparent !important;
  border-color: #30304a !important;
}
.page-miners .badge-success,
.page-miners .status-active{
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #fff !important;
}

/* Финансы — прибираем зелёные элементы */
.page-fin .badge-success,
.page-fin .text-success,
.page-fin .btn-success,
.page-fin .bg-success{
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #fff !important;
}

/* ======= Мобильная адаптация: таблицы -> карточки  ======= */
@media (max-width: 991.98px){

  /* общие отступы контента */
  .content,.main-content,.page-content,.layout__content{
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  /* компактнее карточки */
  .card{ padding: 12px; }

  /* таблицы превращаем в плитки */
  table.mh-mob-cards{
    display: block;
    width: 100%;
    border-collapse: separate !important;
    border-spacing: 0 !important;
  }
  table.mh-mob-cards thead{ display: none; }
  table.mh-mob-cards tbody{ display: grid; gap: 12px; }
  table.mh-mob-cards tr{
    display: grid;
    padding: 12px;
    border: 1px solid #30304a;
    border-radius: 14px;
    background: #151528;
  }
  table.mh-mob-cards td{
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 6px 0;
    border: 0 !important;
  }
  table.mh-mob-cards td::before{
    content: attr(data-label);
    opacity: .65;
    margin-right: 12px;
    font-weight: 500;
  }

  /* кнопки во всю ширину, чтобы текст не вылезал */
  .btn,button,.btn--primary,.btn-outline{ width: 100%; }
}

/* === USDT-only Deposit UI === */
.usdt-only{ padding:16px; border-radius:16px; background:var(--card,#0f1018); box-shadow:var(--g-glow,0 0 0 1px rgba(108,92,231,.12),0 8px 24px rgba(108,92,231,.1)); }
.usdt-only .grid2{ display:grid; gap:12px; grid-template-columns:1fr 1fr; }
@media (max-width: 640px){ .usdt-only .grid2{ grid-template-columns:1fr; } }
.usdt-only .box{ background:rgba(108,92,231,.05); padding:12px; border-radius:12px; border:1px solid rgba(108,92,231,.15); }
.usdt-only .lbl{ font-size:12px; opacity:.75; margin-bottom:6px; }
.usdt-only .addr{ font-family: ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; padding:8px 10px; background: #0b0d14; border-radius:8px; margin:6px 0 10px; border:1px dashed rgba(108,92,231,.25); }
.usdt-only .actions{ display:flex; flex-wrap:wrap; gap:10px; align-items:center; }
.usdt-only .actions .sep{ flex:0 0 1px; height:28px; background:rgba(255,255,255,.06); margin:0 6px; }
.usdt-only .ok{ color:#6fe7b1; }
.usdt-only .err{ color:#ff6b6b; }
