/* =========================
   Referral Dashboard (BS3 panels fallback)
   ========================= */
.refdash {
  --bg: rgba(18, 20, 30, 0.72);
  --bg2: rgba(18, 20, 30, 0.86);
  --border: rgba(255,255,255,0.08);
  --text: rgba(255,255,255,0.88);
  --muted: rgba(255,255,255,0.60);
  --shadow: 0 10px 28px rgba(0,0,0,0.35);
  color: var(--text);
}

/* Заголовок страницы */
.refdash .page-title {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg);
  box-shadow: var(--shadow);
}
.refdash .page-title span {
  font-size: 18px;
  font-weight: 700;
}

/* Сетка (если тема поломала row/col-*) */
.refdash .row {
  margin-left: -10px;
  margin-right: -10px;
}
.refdash [class*="col-"] {
  padding-left: 10px;
  padding-right: 10px;
}

/* Panel (аналог Bootstrap 3) */
.refdash .panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 18px;
}
.refdash .panel-heading {
  padding: 10px 14px;
  font-weight: 700;
  color: rgba(255,255,255,0.92);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}
.refdash .panel-body {
  padding: 14px;
}

/* Цветные панели сверху (primary/success/warning/info) */
.refdash .panel-primary { border-color: rgba(51,122,183,0.35); }
.refdash .panel-success { border-color: rgba(92,184,92,0.35); }
.refdash .panel-warning { border-color: rgba(240,173,78,0.35); }
.refdash .panel-info    { border-color: rgba(91,192,222,0.35); }

.refdash .panel-primary .panel-body { background: linear-gradient(180deg, rgba(51,122,183,0.18), rgba(0,0,0,0)); }
.refdash .panel-success .panel-body { background: linear-gradient(180deg, rgba(92,184,92,0.16), rgba(0,0,0,0)); }
.refdash .panel-warning .panel-body { background: linear-gradient(180deg, rgba(240,173,78,0.16), rgba(0,0,0,0)); }
.refdash .panel-info .panel-body    { background: linear-gradient(180deg, rgba(91,192,222,0.16), rgba(0,0,0,0)); }

/* Центровка как у тебя в коде */
.refdash .text-center { text-align: center; }

/* Чуть “прибрать” огромные цифры */
.refdash .panel-body h2 {
  margin: 0 !important;
  font-size: 44px !important; /* было 48 */
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: 0.2px;
}
.refdash .panel-body small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

/* Progress */
.refdash .progress {
  height: 12px;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.refdash .progress-bar {
  height: 100%;
  display: block;
  background: rgba(92,184,92,0.95);
  color: rgba(0,0,0,0.75);
  font-weight: 700;
  font-size: 11px;
  line-height: 12px;
  text-align: center;
  white-space: nowrap;
}

/* Alerts */
.refdash .alert {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  margin-bottom: 12px;
}
.refdash .alert-info    { border-color: rgba(91,192,222,0.35); background: rgba(91,192,222,0.10); }
.refdash .alert-warning { border-color: rgba(240,173,78,0.35); background: rgba(240,173,78,0.10); }

.refdash .alert strong { color: rgba(255,255,255,0.92); }

/* Code (твой inline style делал белый фон; для темной темы лучше так) */
.refdash code {
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(202,162,87,0.45);
  background: rgba(202,162,87,0.10);
  color: rgba(255,255,255,0.92);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* Input */
.refdash .form-control {
  width: 100%;
  height: 42px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.25);
  color: rgba(255,255,255,0.9);
  outline: none;
}
.refdash .form-control:focus {
  border-color: rgba(202,162,87,0.55);
  box-shadow: 0 0 0 3px rgba(202,162,87,0.12);
}

/* Адаптив: чтобы 4 карточки красиво переходили в 2 и 1 */
@media (max-width: 992px) {
  .refdash .col-md-3 { width: 50%; float: left; }
}
@media (max-width: 520px) {
  .refdash .col-md-3 { width: 100%; float: none; }
}


/* =========================================
   Referral System page (styles for your PHP)
   Scope: .referral-wrap
   ========================================= */

.referral-wrap{
  --bg: rgba(18, 20, 30, .78);
  --bg2: rgba(18, 20, 30, .90);
  --border: rgba(255,255,255,.08);
  --text: rgba(255,255,255,.88);
  --muted: rgba(255,255,255,.60);
  --shadow: 0 10px 28px rgba(0,0,0,.35);

  color: var(--text);
}

/* Make grid usable even if theme broke Bootstrap */
.referral-wrap .row{ margin-left:-10px; margin-right:-10px; }
.referral-wrap [class*="col-"]{ padding-left:10px; padding-right:10px; }

/* --- Quick stats alerts (top 4 blocks) --- */
.referral-wrap .alert{
  background: var(--bg);
  color: var(--text);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 14px 14px;
  margin: 0 0 14px;
}

.referral-wrap .alert h4{
  margin: 0;
  font-size: 34px;
  line-height: 1.05;
  font-weight: 800;
  color: rgba(255,255,255,.95);
}

.referral-wrap .alert small{
  display:block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .2px;
}

.referral-wrap .alert-info    { border-color: rgba(91,192,222,.35); background: linear-gradient(180deg, rgba(91,192,222,.12), rgba(0,0,0,0)); }
.referral-wrap .alert-success { border-color: rgba(92,184,92,.35);  background: linear-gradient(180deg, rgba(92,184,92,.12),  rgba(0,0,0,0)); }
.referral-wrap .alert-warning { border-color: rgba(240,173,78,.35); background: linear-gradient(180deg, rgba(240,173,78,.12), rgba(0,0,0,0)); }
/* В Bootstrap 3 alert-primary нет — добавляем */
.referral-wrap .alert-primary { border-color: rgba(51,122,183,.35); background: linear-gradient(180deg, rgba(51,122,183,.12), rgba(0,0,0,0)); }

/* --- Panel (Share block) --- */
.referral-wrap .panel{
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.referral-wrap .panel-heading{
  padding: 12px 14px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}
.referral-wrap .panel-heading h4{
  margin: 0;
  font-size: 16px;
  font-weight: 800;
}
.referral-wrap .panel-body{ padding: 14px; }
.referral-wrap code{
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(202,162,87,.45);
  background: rgba(202,162,87,.10);
  color: rgba(255,255,255,.92);
}

/* --- Buttons --- */
.referral-wrap .btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  text-decoration: none;
  font-weight: 700;
  color: rgba(255,255,255,.92);
  background: rgba(255,255,255,.05);
}
.referral-wrap .btn:hover{
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.16);
}
.referral-wrap .btn-block{ width: 100%; }

.referral-wrap .btn-primary{ background: rgba(51,122,183,.95); border-color: rgba(51,122,183,.55); }
.referral-wrap .btn-info{ background: rgba(91,192,222,.95); border-color: rgba(91,192,222,.55); }
.referral-wrap .btn-default{ background: rgba(255,255,255,.04); border-color: var(--border); }

/* --- Table (My Referrals) --- */
.referral-wrap h3{
  margin: 18px 0 10px;
  font-weight: 800;
}

.referral-wrap .table{
  width: 100%;
  border-collapse: collapse;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.referral-wrap .table thead th{
  padding: 12px 14px;
  text-align: left;
  font-size: 12px;
  letter-spacing: .2px;
  color: var(--muted);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}
.referral-wrap .table tbody td{
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.referral-wrap .table tbody tr:hover td{
  background: rgba(255,255,255,.03);
}
.referral-wrap .table tbody tr:last-child td{ border-bottom: 0; }

/* Responsive tweak: make top stats wrap nicely if needed */
@media (max-width: 992px){
  .referral-wrap .col-md-3{ width:50%; float:left; }
}
@media (max-width: 520px){
  .referral-wrap .col-md-3{ width:100%; float:none; }
}


/* === Referral System: Tracking (Bootstrap-like, dark) === */
.referral-wrap.referral-tracking{
  --bg: rgba(18, 18, 24, .72);
  --bd: rgba(255,255,255,.08);
  --txt: rgba(255,255,255,.82);
  --muted: rgba(255,255,255,.55);
  --gold: #d7b46a;
  --shadow: 0 12px 32px rgba(0,0,0,.45);
  color: var(--txt);
}

/* Page title spacing if theme doesn't style it */
.referral-wrap.referral-tracking + .page-title,
.page-title + .referral-wrap.referral-tracking{
  margin-top: 8px;
}

.referral-wrap.referral-tracking .panel{
  background: var(--bg);
  border: 1px solid var(--bd);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 16px;
}

.referral-wrap.referral-tracking .panel-heading{
  background: rgba(255,255,255,.03);
  border-bottom: 1px solid var(--bd);
  padding: 14px 16px;
}

.referral-wrap.referral-tracking .panel-heading h4{
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: .2px;
}

.referral-wrap.referral-tracking .panel-body{
  padding: 14px 16px;
}

/* Table */
.referral-wrap.referral-tracking .table{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0;
}

.referral-wrap.referral-tracking .table thead th{
  text-transform: none;
  font-weight: 700;
  font-size: 13px;
  color: var(--gold);
  padding: 12px 10px;
  border-bottom: 1px solid var(--bd);
  background: rgba(255,255,255,.02);
}

.referral-wrap.referral-tracking .table tbody td{
  padding: 12px 10px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  color: var(--txt);
  font-size: 13px;
  vertical-align: middle;
}

.referral-wrap.referral-tracking .table-hover tbody tr:hover td{
  background: rgba(255,255,255,.03);
}

.referral-wrap.referral-tracking .table tbody tr:last-child td{
  border-bottom: 0;
}

/* Progress */
.referral-wrap.referral-tracking .progress{
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  overflow: hidden;
  margin: 0;
}

.referral-wrap.referral-tracking .progress-bar{
  height: 100%;
  border-radius: 999px;
  font-size: 11px;
  line-height: 10px;
  white-space: nowrap;
  color: rgba(0,0,0,.0); /* hide text inside bar, we'll show it via tooltip-like? */
}

/* If you WANT text inside bar, comment line above and use padding below */
/* .referral-wrap.referral-tracking .progress-bar{ color:#fff; padding-left:8px; } */

.referral-wrap.referral-tracking .progress-bar-info{
  background: linear-gradient(90deg, #4aa3ff, #2f7ef7);
}
.referral-wrap.referral-tracking .progress-bar-success{
  background: linear-gradient(90deg, #31d07f, #18b86a);
}
.referral-wrap.referral-tracking .progress-bar-danger{
  background: linear-gradient(90deg, #ff5d5d, #e83b3b);
}

/* Labels (status badges) */
.referral-wrap.referral-tracking .label{
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  color: var(--txt);
}

.referral-wrap.referral-tracking .label-warning{
  background: rgba(255, 193, 7, .14);
  border-color: rgba(255, 193, 7, .22);
  color: #ffd27a;
}
.referral-wrap.referral-tracking .label-success{
  background: rgba(46, 204, 113, .14);
  border-color: rgba(46, 204, 113, .22);
  color: #8ff0bd;
}
.referral-wrap.referral-tracking .label-danger{
  background: rgba(231, 76, 60, .14);
  border-color: rgba(231, 76, 60, .22);
  color: #ff9a9a;
}

/* Info panel text */
.referral-wrap.referral-tracking .panel-info .panel-heading{
  color: var(--gold);
}
.referral-wrap.referral-tracking .panel-info ul{
  margin: 8px 0 0 18px;
  color: var(--muted);
}
.referral-wrap.referral-tracking .panel-info p{
  margin: 0 0 8px;
  color: var(--txt);
}

/* Mobile: horizontal scroll instead of breaking layout */
@media (max-width: 992px){
  .referral-wrap.referral-tracking .panel-body{
    overflow-x: auto;
  }
  .referral-wrap.referral-tracking .table{
    min-width: 820px;
  }
}

.referral-wrap.referral-tracking h5{
  font-size: 13px;
  letter-spacing: .2px;
}
.referral-wrap.referral-tracking ul{
  padding-left: 18px;
}
.referral-wrap.referral-tracking li{
  margin: 6px 0;
}


/* === Referral System: Leaderboard / Top Referrers === */
.referral-wrap.referral-leaderboard{
  --bg: rgba(18, 18, 24, .72);
  --bd: rgba(255,255,255,.08);
  --txt: rgba(255,255,255,.82);
  --muted: rgba(255,255,255,.55);
  --gold: #d7b46a;
  --shadow: 0 12px 32px rgba(0,0,0,.45);
  color: var(--txt);
}

.referral-wrap.referral-leaderboard .panel{
  background: var(--bg);
  border: 1px solid var(--bd);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 16px;
}

.referral-wrap.referral-leaderboard .panel-heading{
  background: rgba(255,255,255,.03);
  border-bottom: 1px solid var(--bd);
  padding: 14px 16px;
}

.referral-wrap.referral-leaderboard .panel-heading h4,
.referral-wrap.referral-leaderboard .panel-heading h3{
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: .2px;
}

.referral-wrap.referral-leaderboard .panel-body{
  padding: 14px 16px;
}

/* “Your ranking” card (если выводишь текстом как на скрине) */
.referral-wrap.referral-leaderboard .leaderboard-summary{
  padding: 14px 16px;
  border: 1px solid var(--bd);
  border-radius: 14px;
  background: rgba(255,255,255,.02);
  box-shadow: 0 10px 26px rgba(0,0,0,.25);
  margin-bottom: 16px;
}
.referral-wrap.referral-leaderboard .leaderboard-summary .k{
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}
.referral-wrap.referral-leaderboard .leaderboard-summary .v{
  color: var(--gold);
  font-weight: 900;
  font-size: 22px;
  letter-spacing: .2px;
}
.referral-wrap.referral-leaderboard .leaderboard-summary .note{
  color: var(--muted);
  margin-top: 10px;
  font-size: 13px;
}

/* Table */
.referral-wrap.referral-leaderboard .table{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0;
}

.referral-wrap.referral-leaderboard .table thead th{
  font-weight: 800;
  font-size: 13px;
  color: var(--gold);
  padding: 12px 10px;
  border-bottom: 1px solid var(--bd);
  background: rgba(255,255,255,.02);
}

.referral-wrap.referral-leaderboard .table tbody td{
  padding: 12px 10px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  color: var(--txt);
  font-size: 13px;
  vertical-align: middle;
}

.referral-wrap.referral-leaderboard .table-hover tbody tr:hover td{
  background: rgba(255,255,255,.03);
}

.referral-wrap.referral-leaderboard .table tbody tr:last-child td{
  border-bottom: 0;
}

/* Rank cell / crown */
.referral-wrap.referral-leaderboard .rank-badge{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  font-weight: 900;
  color: var(--gold);
}
.referral-wrap.referral-leaderboard .rank-badge.is-1{
  background: linear-gradient(180deg, rgba(215,180,106,.22), rgba(255,255,255,.02));
  border-color: rgba(215,180,106,.28);
}

/* CTA block at bottom */
.referral-wrap.referral-leaderboard .leaderboard-cta{
  text-align: center;
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,.06);
  color: var(--muted);
}
.referral-wrap.referral-leaderboard .leaderboard-cta .title{
  color: var(--gold);
  font-weight: 900;
  margin-bottom: 6px;
}
.referral-wrap.referral-leaderboard .leaderboard-cta a{
  color: var(--gold);
  font-weight: 800;
  text-decoration: none;
}
.referral-wrap.referral-leaderboard .leaderboard-cta a:hover{
  text-decoration: underline;
}

/* Mobile: allow scroll */
@media (max-width: 992px){
  .referral-wrap.referral-leaderboard .panel-body{ overflow-x:auto; }
  .referral-wrap.referral-leaderboard .table{ min-width: 760px; }
}

/* =========================
   Better form readability + statuses
   (works with Bootstrap 3 and simple forms)
   ========================= */

/* 1) Typography / contrast */
#content h1, #content h2, #content h3, #content h4 {
  color: rgba(255,255,255,0.92) !important;
  letter-spacing: 0.2px;
}

#content label,
#content .control-label {
  color: rgba(255,255,255,0.88) !important;
  font-weight: 700 !important;
  margin-bottom: 6px !important;
}

#content .help-block,
#content .form-text,
#content small,
#content .text-muted {
  color: rgba(230,235,255,0.70) !important;
}

/* 2) Space to reduce “mess” */
#content .form-group {
  margin-bottom: 16px !important;
}

#content .form-group .help-block {
  margin-top: 6px !important;
  margin-bottom: 0 !important;
}

/* 3) Inputs: stronger text + clearer border */
#content .form-control,
#content input[type="text"],
#content input[type="password"],
#content input[type="email"],
#content input[type="number"],
#content input[type="search"],
#content input[type="url"],
#content input[type="tel"],
#content select,
#content textarea {
  background: rgba(10, 12, 18, 0.92) !important;
  color: rgba(245, 248, 255, 0.95) !important; /* brighter text */

  border: 1px solid rgba(255, 205, 120, 0.45) !important;
  border-radius: 10px !important;

  padding: 11px 12px !important;
  line-height: 1.25 !important;

  box-shadow: 0 6px 18px rgba(0,0,0,0.45) !important;
}

/* Placeholder brighter */
#content ::placeholder {
  color: rgba(245, 248, 255, 0.50) !important;
  opacity: 1 !important;
}

/* Focus */
#content .form-control:focus,
#content input:focus,
#content select:focus,
#content textarea:focus {
  outline: none !important;
  border-color: rgba(255, 205, 120, 0.95) !important;
  box-shadow:
    0 0 0 3px rgba(255, 205, 120, 0.18),
    0 10px 30px rgba(0,0,0,0.55) !important;
}

/* 4) SUCCESS / ERROR messages (alerts) */
#content .alert {
  border-radius: 12px !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  padding: 12px 14px !important;
  color: rgba(255,255,255,0.92) !important;
}

#content .alert-success {
  background: rgba(40, 167, 69, 0.16) !important;
  border-color: rgba(40, 167, 69, 0.55) !important;
}

#content .alert-danger,
#content .alert-error {
  background: rgba(220, 53, 69, 0.16) !important;
  border-color: rgba(220, 53, 69, 0.55) !important;
}

#content .alert-warning {
  background: rgba(255, 193, 7, 0.14) !important;
  border-color: rgba(255, 193, 7, 0.55) !important;
}

/* 5) Field highlight if Bootstrap validation classes exist */
#content .has-error .form-control {
  border-color: rgba(220, 53, 69, 0.85) !important;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.12) !important;
}

#content .has-success .form-control {
  border-color: rgba(40, 167, 69, 0.85) !important;
  box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.12) !important;
}

#content .has-error .help-block { color: rgba(255, 160, 170, 0.95) !important; }
#content .has-success .help-block { color: rgba(160, 255, 190, 0.95) !important; }

/* 6) Buttons a bit clearer */
#content .btn,
#content button,
#content input[type="submit"] {
  border-radius: 12px !important;
}

/* Buttons */
#content .btn,
#content button,
#content input[type="submit"],
#content input[type="button"] {
  background: rgba(255, 205, 120, 0.10);
  color: #ffd89a;

  border: 1px solid rgba(255, 205, 120, 0.75);
  border-radius: 10px;

  padding: 10px 16px;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-transform: uppercase;

  box-shadow: 0 10px 26px rgba(0,0,0,0.45);
}

#content .btn:hover,
#content button:hover,
#content input[type="submit"]:hover,
#content input[type="button"]:hover {
  background: rgba(255, 205, 120, 0.18);
  border-color: rgba(255, 205, 120, 1);
  color: #fff2dc;
}
