/* Muborak Hamkor — premium to'q-oltin dashboard */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #141017; --card: #1e1826; --card2: #251d30;
  --gold: #e3b95c; --gold2: #be8129; --cream: #fff6e4;
  --dim: #a99bb8; --line: #362b44; --green: #6fcf97; --red: #ff7a7a;
}
html, body { background: var(--bg); color: var(--cream);
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif; min-height: 100%; }
.hidden { display: none !important; }

/* ---------- Kirish ---------- */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: 100%; max-width: 420px; background: var(--card);
  border: 1px solid var(--line); border-radius: 24px; padding: 36px 28px;
  text-align: center; box-shadow: 0 24px 80px rgba(0,0,0,.5); }
.brand-mark { width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f3d590, #cf9436 55%, #a96c1c);
  display: flex; align-items: center; justify-content: center;
  font-family: Georgia, serif; font-size: 38px; color: #fffbf2;
  box-shadow: 0 8px 30px rgba(207,148,54,.35); }
.brand-mark.sm { width: 40px; height: 40px; font-size: 22px; margin: 0; }
.brand h1 { font-size: 26px; font-weight: 800; letter-spacing: .5px; }
.brand h1 span { color: var(--gold); }
.brand-sub { color: var(--dim); font-size: 14px; line-height: 1.55; margin: 10px 0 24px; }
.login-buttons { display: flex; flex-direction: column; gap: 14px; align-items: center; margin-bottom: 18px; }
.btn-tg { display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 300px; padding: 12px; border: none; border-radius: 22px; cursor: pointer;
  background: #2AABEE; color: #fff; font-size: 15px; font-weight: 600; }
.btn-tg:active { transform: scale(.98); }

.login-note { color: var(--dim); font-size: 12.5px; line-height: 1.5; }
.login-err { margin-top: 14px; color: var(--red); font-size: 13px; }
.btn-gold { display: block; background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: #241e14; font-weight: 700; text-decoration: none; padding: 14px;
  border-radius: 14px; margin-bottom: 12px; }
.btn-ghost { background: none; border: 1px solid var(--line); color: var(--dim);
  padding: 12px 18px; border-radius: 12px; cursor: pointer; font-size: 14px; width: 100%;
  transition: border-color .15s, color .15s; }
.btn-ghost:hover { border-color: var(--gold2); color: var(--cream); }
.btn-ghost.sm { width: auto; padding: 8px 14px; font-size: 13px; }

/* ---------- Dashboard ---------- */
.dash { max-width: 860px; margin: 0 auto; padding: 18px 16px 40px; }
.topbar { display: flex; align-items: center; justify-content: space-between;
  padding: 8px 2px 22px; gap: 12px; }
.brand-row { display: flex; align-items: center; gap: 12px; }
.top-title { font-weight: 800; font-size: 17px; }
.top-sub { color: var(--dim); font-size: 13px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--gold2); }
/* Rasm yuklanmasa (Google avatarlari ko'pincha) — bosh harfli doira */
.avatar-fallback { width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #f3d590, #cf9436 55%, #a96c1c);
  color: #2a1d07; font-weight: 800; font-size: 17px;
  font-family: Georgia, serif; flex-shrink: 0; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .stats { grid-template-columns: 1fr; } }
.stat { background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; padding: 18px; transition: border-color .15s; }
.stat:hover { border-color: #473a58; }
.stat.gold { background: linear-gradient(135deg, #2c2210, #3a2c12);
  border-color: #57431c; }
.stat-label { color: var(--dim); font-size: 12.5px; letter-spacing: .4px;
  text-transform: uppercase; }
.stat-value { font-size: 29px; font-weight: 800; margin: 8px 0 4px; color: var(--cream);
  letter-spacing: -.5px; }
.stat.gold .stat-value { color: var(--gold); }
.stat-sub { color: var(--dim); font-size: 12px; }

.sec-title { font-size: 13px; font-weight: 700; letter-spacing: .8px;
  text-transform: uppercase; color: #8c7f9c; margin: 30px 4px 12px; }

.codes { display: grid; gap: 12px; }
.code-card { background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; padding: 18px; display: grid; gap: 16px; }
.code-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.code-chip { position: relative; font-family: ui-monospace, monospace; font-size: 21px;
  font-weight: 800; letter-spacing: 3px; background: var(--card2);
  border: 1px dashed var(--gold2); color: var(--gold); padding: 11px 18px;
  border-radius: 12px; cursor: pointer; transition: background .15s, border-color .15s; }
.code-chip:hover { background: #2e2439; border-color: var(--gold); }
.code-chip:active { transform: scale(.97); }
.copy-hint { display: block; font-family: inherit; font-size: 10px; font-weight: 600;
  letter-spacing: .6px; color: var(--dim); text-transform: uppercase; margin-top: 3px; }
.code-chip:hover .copy-hint { color: var(--gold2); }
.code-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 560px) { .code-meta { grid-template-columns: repeat(2, 1fr); } }
.cm-label { color: var(--dim); font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; }
.cm-value { font-size: 17px; font-weight: 700; margin-top: 3px; }
.cm-value.gold { color: var(--gold); }
.badge { font-size: 11px; font-weight: 700; padding: 5px 11px; border-radius: 100px;
  letter-spacing: .3px; white-space: nowrap; }
.badge.on { background: rgba(111,207,151,.15); color: var(--green); }
.badge.off { background: rgba(255,122,122,.15); color: var(--red); }
.badge.wait { background: rgba(227,185,92,.15); color: var(--gold); }

/* Chiqarishlar tarixi */
.pay-table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-top: 16px; }
.pay-table th { text-align: left; color: var(--dim); font-size: 11px; letter-spacing: .5px;
  text-transform: uppercase; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.pay-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); }
.pay-table tr:last-child td { border-bottom: none; }
.mono-cell { font-family: ui-monospace, monospace; white-space: nowrap; }
.pay-table td:first-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
/* Tor ekranda jadval o'z ichida suriladi — belgi/summa chetdan chiqib ketmasin */
#payouts { overflow-x: auto; margin-top: 4px; }
.pay-table td:nth-child(3) { white-space: nowrap; }
@media (max-width: 520px) {
  .pay-table { font-size: 12px; }
  .pay-table th, .pay-table td { padding: 8px 7px; }
  .mono-cell { font-size: 11.5px; }
}
#wd-amount { width: 160px; }

/* Ulush taqsimot chizig'i */
.split { }
.split-bar { height: 10px; border-radius: 100px; overflow: hidden;
  display: flex; background: var(--card2); }
.split-you { background: linear-gradient(90deg, var(--gold), var(--gold2)); }
.split-us { background: #4a3c5e; }
.split-legend { display: flex; justify-content: space-between;
  font-size: 12px; color: var(--dim); margin-top: 6px; }
.split-legend b { color: var(--gold); }

.new-code { background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; padding: 18px; }
.nc-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.nc-row input { background: var(--card2); border: 1px solid var(--line);
  color: var(--cream); border-radius: 12px; padding: 13px 14px; font-size: 15px;
  min-width: 0; transition: border-color .15s, background .15s; }
.nc-row input::placeholder { color: #6f6480; }
.nc-row input:focus { outline: none; border-color: var(--gold2); background: #2a2135; }
.nc-row input:disabled { opacity: .45; cursor: not-allowed; }
#nc-code, #wd-card { flex: 1 1 200px; font-family: ui-monospace, monospace;
  letter-spacing: 2px; font-weight: 700; }
#wd-amount { flex: 0 1 215px; }
.nc-pct { display: flex; align-items: center; gap: 8px; color: var(--dim); font-size: 14px; }
#nc-percent { width: 74px; text-align: center; }
.nc-btn { border: none; cursor: pointer; font-size: 15px; font-weight: 700;
  padding: 13px 26px; margin-bottom: 0; border-radius: 12px; white-space: nowrap;
  transition: filter .15s, transform .1s; }
.nc-btn:hover:not(:disabled) { filter: brightness(1.08); }
.nc-btn:active:not(:disabled) { transform: scale(.98); }
.nc-btn:disabled { opacity: .4; cursor: not-allowed; }
.nc-note { color: var(--dim); font-size: 12.5px; margin-top: 12px; line-height: 1.55; }
.nc-note b { color: var(--gold); }
@media (max-width: 520px) {
  .nc-row { flex-direction: column; align-items: stretch; }
  .nc-btn { width: 100%; }
  /* Ustun rejimida flex-basis BALANDLIKKA aylanadi — bekor qilamiz */
  #nc-code, #wd-card, #wd-amount, #nc-percent { flex: 0 0 auto; width: 100%; }
  .nc-pct { justify-content: space-between; }
  #nc-percent { width: 90px; }
}

.table-wrap { background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; overflow-x: auto; }
@media (max-width: 520px) {
  table { font-size: 12.5px; }
  th, td { padding: 9px 8px; }
  td:first-child { white-space: nowrap; }
}
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--dim); font-size: 11.5px; letter-spacing: .5px;
  text-transform: uppercase; padding: 12px 14px; border-bottom: 1px solid var(--line); }
td { padding: 12px 14px; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: none; }
.td-earn { color: var(--gold); font-weight: 700; }
.num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.dim { color: var(--dim); }
/* Foiz yorliqlari — summaning yonida, kim qancha olgani darrov ko'rinsin */
.pct { display: inline-block; font-size: 10.5px; font-weight: 700; margin-left: 6px;
  padding: 2px 6px; border-radius: 100px; letter-spacing: .3px; vertical-align: 1px; }
.pct.you { background: rgba(227,185,92,.16); color: var(--gold); }
.pct.us  { background: rgba(122,108,148,.2); color: #a99bb8; }
.pct.off { background: rgba(111,207,151,.15); color: var(--green); }
.code-meta { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 760px) { .code-meta { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 480px) { .code-meta { grid-template-columns: repeat(2, 1fr); } }
.empty { padding: 28px; text-align: center; color: var(--dim); font-size: 14px; }
.foot { text-align: center; color: var(--dim); font-size: 12px; margin-top: 28px; }

/* GSI yuklanmaganda ko'rsatiladigan izoh */
.hint {
  font-size: 13px;
  color: rgba(255, 255, 255, .55);
  text-align: center;
  line-height: 1.5;
}
