/* ===========================================================
   TradePro - Mobile-first UI
   =========================================================== */

:root {
  --bg: #0a0d14;
  --bg-elev: #131826;
  --bg-elev-2: #1a2030;
  --border: #232938;
  --text: #e8eaed;
  --text-dim: #8b93a5;
  --text-muted: #5c6478;
  --accent: #22c55e;
  --accent-2: #10b981;
  --accent-grad: linear-gradient(135deg, #22c55e 0%, #10b981 100%);
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  --shadow: 0 4px 24px rgba(0,0,0,.35);
  --radius: 16px;
  --radius-sm: 10px;
}

[data-theme="light"] {
  --bg: #f4f6fb;
  --bg-elev: #ffffff;
  --bg-elev-2: #f9fafc;
  --border: #e4e8f0;
  --text: #11141c;
  --text-dim: #495264;
  --text-muted: #8993a8;
  --shadow: 0 4px 24px rgba(20,30,60,.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.5;
  padding-bottom: env(safe-area-inset-bottom);
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }

.theme-dark .theme-light-only,
[data-theme="dark"] .theme-light-only { display: none; }
.theme-light .theme-dark-only,
[data-theme="light"] .theme-dark-only { display: none; }

/* ----------- TOP BAR ----------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding-top: calc(12px + env(safe-area-inset-top));
}
.brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 17px; color: var(--text);
}
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--accent-grad); color: #fff; font-weight: 800;
}
.topbar-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  background: var(--bg-elev); border: 1px solid var(--border);
  width: 38px; height: 38px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text); cursor: pointer; font-size: 16px;
  transition: .2s;
}
.icon-btn:hover { background: var(--bg-elev-2); color: var(--accent); }
.notif-dot {
  position: absolute; top: 7px; right: 8px;
  width: 9px; height: 9px; border-radius: 50%; background: var(--danger);
  border: 2px solid var(--bg);
}
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--accent-grad);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; text-decoration: none;
}

/* ----------- PAGE ----------- */
.page {
  max-width: 560px; margin: 0 auto;
  padding: 16px 14px 24px;
}
.page.has-bottom-nav { padding-bottom: 100px; }

h1, h2, h3, h4 { color: var(--text); margin-top: 0; }
.page-title { font-size: 22px; font-weight: 700; margin: 4px 0 14px; }
.section-title {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-muted); margin: 18px 0 10px;
}
.section-title a { font-size: 12px; }

/* ----------- CARDS ----------- */
.card-x {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.card-x.flat { box-shadow: none; }

/* Balance hero */
.balance-hero {
  background: var(--accent-grad);
  color: #fff; border-radius: var(--radius);
  padding: 22px 20px; margin-bottom: 14px;
  position: relative; overflow: hidden;
}
.balance-hero::before {
  content: ''; position: absolute; right: -40px; top: -40px;
  width: 160px; height: 160px; border-radius: 50%;
  background: rgba(255,255,255,.08);
}
.balance-hero::after {
  content: ''; position: absolute; right: -20px; bottom: -60px;
  width: 120px; height: 120px; border-radius: 50%;
  background: rgba(255,255,255,.06);
}
.balance-hero .label { font-size: 13px; opacity: .9; }
.balance-hero .amount {
  font-size: 32px; font-weight: 800; margin-top: 2px;
  letter-spacing: -.5px;
}
.balance-hero .amount small { font-size: 16px; opacity: .85; font-weight: 600; }
.balance-hero .sub {
  display: flex; justify-content: space-between; gap: 8px;
  margin-top: 16px; padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,.18);
}
.balance-hero .sub div { flex: 1; }
.balance-hero .sub .k { font-size: 11px; opacity: .8; text-transform: uppercase; letter-spacing: .05em; }
.balance-hero .sub .v { font-size: 16px; font-weight: 700; margin-top: 2px; }

/* Stat cards grid */
.stats-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
}
.stat {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px;
}
.stat .ico {
  width: 36px; height: 36px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(34,197,94,.12); color: var(--accent); font-size: 16px;
  margin-bottom: 8px;
}
.stat.warn .ico { background: rgba(245,158,11,.12); color: var(--warning); }
.stat.info .ico { background: rgba(59,130,246,.12); color: var(--info); }
.stat.dang .ico { background: rgba(239,68,68,.12); color: var(--danger); }
.stat .l { font-size: 12px; color: var(--text-muted); }
.stat .v { font-size: 18px; font-weight: 700; margin-top: 2px; }

/* Claim button */
.claim-card {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; text-align: center;
}
.claim-btn {
  width: 100%; padding: 18px;
  background: var(--accent-grad); color: #fff;
  border: none; border-radius: 14px;
  font-weight: 700; font-size: 17px;
  cursor: pointer; transition: .2s;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
}
.claim-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(34,197,94,.4); }
.claim-btn:disabled {
  background: var(--bg-elev-2); color: var(--text-muted);
  cursor: not-allowed; transform: none; box-shadow: none;
}
.claim-timer {
  font-family: 'SF Mono', Menlo, monospace; font-size: 20px;
  color: var(--text); margin-top: 8px; letter-spacing: 1px;
}

/* ----------- BUTTONS ----------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: 14px;
  border: 1px solid var(--border); background: var(--bg-elev); color: var(--text);
  cursor: pointer; transition: .15s; text-decoration: none;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary {
  background: var(--accent-grad); color: #fff; border: none;
}
.btn-primary:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(34,197,94,.35); }
.btn-danger { background: var(--danger); color: #fff; border: none; }
.btn-danger:hover { color: #fff; opacity: .9; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 12px; font-size: 13px; }
.btn-link { background: transparent; border: none; color: var(--accent); padding: 4px 0; }

/* ----------- FORMS ----------- */
.field { margin-bottom: 14px; }
.field label {
  display: block; font-size: 13px; color: var(--text-dim);
  margin-bottom: 6px; font-weight: 500;
}
.input, select.input, textarea.input {
  width: 100%; padding: 13px 14px;
  background: var(--bg-elev-2); border: 1px solid var(--border);
  color: var(--text); border-radius: 12px;
  font-size: 15px; font-family: inherit;
  transition: .15s;
}
.input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(34,197,94,.15);
}
.input::placeholder { color: var(--text-muted); }
textarea.input { resize: vertical; min-height: 90px; }

.input-group { position: relative; display: flex; align-items: center; }
.input-group .input { padding-right: 84px; }
.input-group .input-suffix {
  position: absolute; right: 6px; top: 6px; bottom: 6px;
  display: inline-flex; align-items: center; padding: 0 12px;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 8px; font-size: 13px; cursor: pointer; color: var(--text);
}
.input-group .input-suffix:hover { color: var(--accent); }

.file-drop {
  border: 2px dashed var(--border); border-radius: 12px;
  padding: 22px; text-align: center; cursor: pointer;
  background: var(--bg-elev-2); transition: .15s;
}
.file-drop:hover { border-color: var(--accent); }
.file-drop i { font-size: 28px; color: var(--text-muted); display: block; margin-bottom: 6px; }
.file-drop input { display: none; }
.file-preview { margin-top: 10px; max-width: 100%; border-radius: 10px; max-height: 220px; }

/* ----------- AUTH PAGES ----------- */
.auth-wrap {
  max-width: 420px; margin: 8vh auto 2rem;
  padding: 30px 22px;
}
.auth-logo {
  text-align: center; margin-bottom: 22px;
}
.auth-logo .brand-mark {
  width: 64px; height: 64px; border-radius: 18px; font-size: 30px;
}
.auth-logo h1 { font-size: 22px; margin: 12px 0 4px; }
.auth-logo p { color: var(--text-muted); margin: 0; font-size: 13px; }
.auth-card {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 18px; padding: 24px;
  box-shadow: var(--shadow);
}
.auth-foot { text-align: center; margin-top: 16px; font-size: 14px; color: var(--text-muted); }

/* ----------- LISTS ----------- */
.list { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 14px; border-bottom: 1px solid var(--border);
  color: var(--text); text-decoration: none;
}
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: var(--bg-elev-2); color: var(--text); }
.list-item .li-ico {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--bg-elev-2); display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 16px;
}
.list-item.tx-deposit .li-ico { background: rgba(34,197,94,.12); color: var(--accent); }
.list-item.tx-withdrawal .li-ico { background: rgba(239,68,68,.12); color: var(--danger); }
.list-item.tx-profit .li-ico { background: rgba(245,158,11,.12); color: var(--warning); }
.list-item.tx-referral_bonus .li-ico { background: rgba(59,130,246,.12); color: var(--info); }
.list-item .li-body { flex: 1; min-width: 0; }
.list-item .li-title { font-weight: 600; font-size: 14px; }
.list-item .li-sub { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.list-item .li-amt { font-weight: 700; text-align: right; }
.amt-pos { color: var(--accent); }
.amt-neg { color: var(--danger); }

/* ----------- BADGES ----------- */
.badge-x {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: .02em;
}
.badge-pending { background: rgba(245,158,11,.15); color: var(--warning); }
.badge-approved { background: rgba(34,197,94,.15); color: var(--accent); }
.badge-rejected, .badge-banned, .badge-suspended { background: rgba(239,68,68,.15); color: var(--danger); }
.badge-active { background: rgba(34,197,94,.15); color: var(--accent); }
.badge-info { background: rgba(59,130,246,.15); color: var(--info); }

/* ----------- BOTTOM NAV ----------- */
.bottom-nav {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0;
  width: 100%; max-width: 560px;
  background: var(--bg-elev); border-top: 1px solid var(--border);
  display: flex; justify-content: space-around; align-items: center;
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
  z-index: 40;
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 10px; color: var(--text-muted); padding: 6px 8px; flex: 1;
  text-decoration: none;
}
.bottom-nav a i { font-size: 20px; }
.bottom-nav a.active { color: var(--accent); }
.bottom-nav .claim-fab {
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--accent-grad); color: #fff !important;
  margin-top: -22px; box-shadow: 0 6px 16px rgba(34,197,94,.45);
}
.bottom-nav .claim-fab i { font-size: 24px; }

/* ----------- ALERTS ----------- */
.alert {
  padding: 12px 14px; border-radius: 12px; margin-bottom: 14px;
  font-size: 14px; display: flex; align-items: center; gap: 8px;
  border: 1px solid transparent;
}
.alert-success { background: rgba(34,197,94,.1); color: var(--accent); border-color: rgba(34,197,94,.25); }
.alert-danger { background: rgba(239,68,68,.1); color: var(--danger); border-color: rgba(239,68,68,.25); }
.alert-info { background: rgba(59,130,246,.1); color: var(--info); border-color: rgba(59,130,246,.25); }
.alert-warning { background: rgba(245,158,11,.1); color: var(--warning); border-color: rgba(245,158,11,.25); }

/* ----------- TABS ----------- */
.tabs {
  display: flex; background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 12px; padding: 4px; margin-bottom: 14px;
}
.tabs .tab {
  flex: 1; text-align: center; padding: 9px;
  border-radius: 9px; font-size: 13px; font-weight: 600;
  color: var(--text-muted); cursor: pointer;
  background: transparent; border: none; outline: none;
  font-family: inherit; transition: background-color 0.15s, color 0.15s;
}
.tabs .tab:hover { color: var(--text); }
.tabs .tab.active { background: var(--accent-grad); color: #fff; }

/* ----------- LIVE PRICES ----------- */
.price-list { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.price-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-bottom: 1px solid var(--border);
}
.price-row:last-child { border-bottom: none; }
.price-row .coin {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--bg-elev-2);
}
.price-row .coin img { width: 100%; height: 100%; border-radius: 50%; }
.price-row .name { flex: 1; }
.price-row .name b { font-size: 14px; }
.price-row .name small { color: var(--text-muted); font-size: 11px; text-transform: uppercase; }
.price-row .px { font-weight: 700; font-size: 14px; }
.price-row .chg {
  font-size: 12px; padding: 2px 7px; border-radius: 6px; margin-left: 8px;
  min-width: 64px; text-align: right;
}
.chg.up { color: var(--accent); background: rgba(34,197,94,.1); }
.chg.dn { color: var(--danger); background: rgba(239,68,68,.1); }

/* ----------- ADMIN ----------- */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 230px; background: var(--bg-elev); border-right: 1px solid var(--border);
  padding: 16px 10px; flex-shrink: 0;
}
.admin-sidebar .brand { padding: 0 6px 14px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.admin-sidebar a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  color: var(--text-dim); font-size: 14px; font-weight: 500;
  text-decoration: none; margin-bottom: 2px;
}
.admin-sidebar a:hover { background: var(--bg-elev-2); color: var(--text); }
.admin-sidebar a.active { background: var(--accent-grad); color: #fff; }
.admin-sidebar a i { width: 18px; font-size: 15px; }
.admin-main { flex: 1; padding: 20px; min-width: 0; }

.admin-topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}

.admin-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
@media (max-width: 900px) { .admin-stats { grid-template-columns: repeat(2,1fr); } }

table.tbl {
  width: 100%; border-collapse: collapse;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
table.tbl th, table.tbl td {
  padding: 11px 12px; border-bottom: 1px solid var(--border);
  font-size: 13px; text-align: left;
}
table.tbl th {
  background: var(--bg-elev-2); color: var(--text-muted);
  font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
}
table.tbl tr:last-child td { border-bottom: none; }
table.tbl tr:hover td { background: var(--bg-elev-2); }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Mobile admin */
@media (max-width: 768px) {
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
  .admin-sidebar { display: flex; gap: 4px; overflow-x: auto; padding: 10px; }
  .admin-sidebar .brand { display: none; }
  .admin-sidebar a { white-space: nowrap; padding: 8px 12px; }
  .admin-stats { grid-template-columns: repeat(2,1fr); }
}

/* Wallet box */
.wallet-box {
  background: var(--bg-elev-2); border: 1px dashed var(--border);
  border-radius: 12px; padding: 14px; font-family: monospace;
  word-break: break-all; font-size: 13px; margin-bottom: 10px;
}

/* Ticket chat */
.chat { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; max-height: 60vh; overflow-y: auto; }
.msg { margin-bottom: 12px; max-width: 80%; }
.msg .bub { padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.45; }
.msg.user { margin-left: auto; text-align: right; }
.msg.user .bub { background: var(--accent-grad); color: #fff; border-bottom-right-radius: 4px; }
.msg.admin .bub { background: var(--bg-elev-2); color: var(--text); border-bottom-left-radius: 4px; }
.msg .meta { font-size: 10px; color: var(--text-muted); margin-top: 4px; }

/* Misc */
.divider { height: 1px; background: var(--border); margin: 14px 0; }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-center { text-align: center; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; }
.flex { display: flex; } .flex-1 { flex: 1; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.between { justify-content: space-between; } .center { align-items: center; }

/* Loader */
.spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.3); border-top-color: #fff;
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Empty state */
.empty {
  text-align: center; padding: 30px 14px; color: var(--text-muted);
}
.empty i { font-size: 40px; display: block; margin-bottom: 8px; opacity: .5; }

/* Modal-ish */
.note { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

/* === Additional admin/profile/transaction classes === */

/* Admin layout extras */
.admin-brand { display: flex; align-items: center; gap: 10px; padding: 6px; margin-bottom: 14px; border-bottom: 1px solid var(--border); padding-bottom: 14px; }
.ab-title { font-weight: 700; font-size: 15px; }
.ab-sub { font-size: 11px; color: var(--text-muted); }
.admin-nav { display: flex; flex-direction: column; gap: 2px; }
.admin-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--text-muted); text-decoration: none; font-size: 14px; transition: .15s; }
.admin-nav a:hover { background: var(--bg-elev-2); color: var(--text); }
.admin-nav a.active { background: var(--accent-grad); color: #fff; }
.admin-nav a i { width: 18px; font-size: 15px; }
.admin-burger { display: none; }
.admin-title { font-size: 18px; font-weight: 600; flex: 1; }
.admin-body { }
.nav-badge { margin-left: auto; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 10px; }

@media (max-width: 992px) {
  .admin-layout { flex-direction: column; }
  .admin-sidebar { position: fixed; top: 0; left: -260px; width: 260px; height: 100vh; transition: .25s; z-index: 1000; padding: 16px; background: var(--bg-elev); border-right: 1px solid var(--border); }
  .admin-sidebar.open { left: 0; box-shadow: 0 0 30px rgba(0,0,0,.3); }
  .admin-main { padding: 12px; }
  .admin-burger { display: inline-flex; }
}

/* Stats cards */
.admin-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
@media (max-width: 768px) { .admin-stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .admin-stats { grid-template-columns: 1fr 1fr; } }
.astat { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; display: flex; gap: 12px; align-items: center; }
.astat-ic { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.astat-v { font-size: 18px; font-weight: 700; line-height: 1.2; }
.astat-l { font-size: 12px; color: var(--text-muted); }

/* Cards & titles */
.card-title { font-size: 15px; font-weight: 600; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.card-title i { color: var(--accent); }

/* Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-x { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 600px; }
.table-x th, .table-x td { padding: 10px 8px; text-align: left; border-bottom: 1px solid var(--border); }
.table-x th { color: var(--text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .3px; background: var(--bg-elev-2); }
.table-x tbody tr:hover { background: var(--bg-elev-2); }
.proof-thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }

/* Key-value rows */
.kv { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; font-size: 13px; color: var(--text-muted); border-bottom: 1px dashed var(--border); }
.kv:last-child { border-bottom: none; }
.kv > div:last-child { color: var(--text); font-weight: 600; }

/* Chips */
.chips { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 14px; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
.chip { padding: 7px 14px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 999px; color: var(--text-muted); font-size: 13px; text-decoration: none; white-space: nowrap; flex-shrink: 0; }
.chip:hover { color: var(--text); }
.chip-active { background: var(--accent-grad); color: #fff; border-color: transparent; }
.chip-active:hover { color: #fff; }

/* Pager */
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 4px 4px; font-size: 13px; color: var(--text-muted); }

/* Profile */
.profile-hero { display: flex; gap: 14px; align-items: center; padding: 16px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 14px; }
.avatar-lg { width: 56px; height: 56px; font-size: 22px; }

/* Tabs panes */
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* KYC grid */
.kyc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kyc-grid a { display: block; text-align: center; text-decoration: none; color: var(--text-muted); font-size: 11px; }
.kyc-grid img { width: 100%; height: 90px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); margin-bottom: 4px; }

/* Chat (new bubbles - aliases for msg-out / msg-in) */
.msg-out { margin-left: auto; text-align: right; max-width: 80%; margin-bottom: 12px; }
.msg-in  { margin-right: auto; text-align: left;  max-width: 80%; margin-bottom: 12px; }
.msg-out .msg-bubble { background: var(--accent-grad); color: #fff; padding: 10px 14px; border-radius: 14px 14px 4px 14px; display: inline-block; max-width: 100%; }
.msg-in  .msg-bubble { background: var(--bg-elev-2); color: var(--text); padding: 10px 14px; border-radius: 14px 14px 14px 4px; display: inline-block; max-width: 100%; }
.msg-meta { font-size: 10px; opacity: .75; margin-bottom: 4px; }
.msg-att img { display: block; max-width: 200px; margin-top: 8px; border-radius: 8px; }

/* Bigger brand mark on auth pages */
.brand-mark-lg { width: 60px; height: 60px; font-size: 28px; border-radius: 16px; }

/* Buttons */
.btn-success { background: var(--ok); color: #fff; border: none; }
.btn-success:hover { color: #fff; opacity: .9; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg-elev-2); color: var(--text); }

/* Modal tweaks for theme */
.modal-content { background: var(--bg-elev); color: var(--text); border: 1px solid var(--border); }
.modal-header, .modal-footer { border-color: var(--border); }
.btn-close { filter: invert(1); }
.theme-light .btn-close { filter: none; }

/* tx-type icons (used in transactions.php) */
.li-ico.tx-in     { background: rgba(34,197,94,.15);  color: #22c55e; }
.li-ico.tx-out    { background: rgba(239,68,68,.15);  color: #ef4444; }
.li-ico.tx-profit { background: rgba(245,158,11,.15); color: #f59e0b; }

/* Auth page tweaks */
.auth-logo { text-align: center; margin-bottom: 12px; }


/* Auth headings */
.auth-title { font-size: 22px; font-weight: 700; margin: 6px 0 2px; text-align: center; }
.auth-sub { text-align: center; margin-bottom: 18px; font-size: 13px; }


/* === LIVE PRICES — real-time visual feedback === */

/* Smooth transitions on price text */
.price-row [data-px] {
  transition: background-color 0.15s ease;
  border-radius: 6px;
  padding: 2px 6px;
  display: inline-block;
}

/* Flash green when price goes up */
@keyframes flashUp {
  0%   { background: rgba(34, 197, 94, 0.5); color: #fff; transform: translateY(-1px); }
  100% { background: transparent;            color: inherit; transform: none; }
}
.price-row [data-px].flash-up {
  animation: flashUp 1s ease-out;
}

/* Flash red when price goes down */
@keyframes flashDn {
  0%   { background: rgba(239, 68, 68, 0.5);  color: #fff; transform: translateY(1px); }
  100% { background: transparent;             color: inherit; transform: none; }
}
.price-row [data-px].flash-dn {
  animation: flashDn 1s ease-out;
}

/* Pulsing LIVE dot */
.live-pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--primary, #22c55e);
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
  animation: livePulse 1.6s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); opacity: 1; }
  70%      { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);   opacity: 0.7; }
}

/* Last-updated label */
.price-updated {
  font-size: 11px;
  color: var(--text-muted, #9aa3b2);
  margin-left: 8px;
  font-weight: 400;
}

/* 24h change transitions */
.price-row .chg {
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* Data source badge */
.price-source {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin: 0 4px;
}
.price-source.src-binance      { background: rgba(243, 186, 47, 0.2); color: #f3ba2f; }
.price-source.src-cryptocompare{ background: rgba(59, 130, 246, 0.2); color: #3b82f6; }
.price-source.src-coingecko    { background: rgba(139, 195, 74, 0.2); color: #8bc34a; }
.price-source.src-none         { background: rgba(239, 68, 68, 0.2);  color: #ef4444; }

/* Stronger flash animations - more visible on mobile */
@keyframes flashUp {
  0%   { background: rgba(34, 197, 94, 0.65); color: #fff; transform: scale(1.06); box-shadow: 0 0 12px rgba(34, 197, 94, 0.5); }
  50%  { background: rgba(34, 197, 94, 0.35); color: #fff; transform: scale(1.03); }
  100% { background: transparent;             color: inherit; transform: none; box-shadow: none; }
}
.price-row [data-px].flash-up {
  animation: flashUp 1.2s ease-out;
}

@keyframes flashDn {
  0%   { background: rgba(239, 68, 68, 0.65); color: #fff; transform: scale(1.06); box-shadow: 0 0 12px rgba(239, 68, 68, 0.5); }
  50%  { background: rgba(239, 68, 68, 0.35); color: #fff; transform: scale(1.03); }
  100% { background: transparent;             color: inherit; transform: none; box-shadow: none; }
}
.price-row [data-px].flash-dn {
  animation: flashDn 1.2s ease-out;
}

/* ============ MARKETS PAGE ============ */
.coin-pills {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 8px 4px 12px; margin: 0 -16px 14px;
  padding-left: 16px; padding-right: 16px;
  scrollbar-width: thin; -webkit-overflow-scrolling: touch;
}
.coin-pills::-webkit-scrollbar { height: 4px; }
.coin-pills::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.coin-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px;
  background: var(--bg-elev); border: 1px solid var(--border);
  color: var(--text-muted); font-weight: 600; font-size: 13px;
  text-decoration: none; white-space: nowrap; flex-shrink: 0;
  transition: all 0.15s;
}
.coin-pill img {
  width: 18px; height: 18px; border-radius: 50%;
}
.coin-pill:hover { color: var(--text); border-color: var(--accent); }
.coin-pill.active {
  background: var(--accent-grad); color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.3);
}

/* Chart container */
.chart-card {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0;
  overflow: hidden;
}
.chart-header {
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.chart-pair {
  display: flex; align-items: center; gap: 10px;
}
.chart-pair img { width: 32px; height: 32px; border-radius: 50%; }
.chart-symbol { font-weight: 700; font-size: 16px; }
.chart-name { color: var(--text-muted); font-size: 12px; }

/* Main TradingView iframe height */
#tvchart {
  height: 480px; width: 100%; min-height: 380px;
}
#tvchart .tradingview-widget-container__widget {
  height: 100% !important; width: 100% !important;
}
#tvoverview {
  height: 280px; width: 100%;
}
#tvoverview .tradingview-widget-container__widget {
  height: 100% !important; width: 100% !important;
}
@media (max-width: 540px) {
  #tvchart { height: 420px; }
  #tvoverview { height: 240px; }
}

/* ============ TICKER TAPE ============ */
.ticker-card {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 12px; padding: 6px 0; overflow: hidden;
  margin-bottom: 14px;
}
.ticker-card .tradingview-widget-container__widget {
  min-height: 40px;
}

/* Clickable price rows on dashboard */
.price-row.clickable {
  cursor: pointer; transition: background-color 0.15s;
}
.price-row.clickable:hover {
  background: var(--bg-elev-2);
}
.price-row.clickable:active {
  background: rgba(34, 197, 94, 0.08);
}

/* ============ PWA INSTALL UI ============ */
.pwa-install-btn {
  position: fixed;
  bottom: 92px;
  right: 16px;
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(34, 197, 94, 0.4);
  animation: pwaSlideIn 0.4s ease-out;
}
.pwa-install-btn:active { transform: scale(0.96); }
.pwa-install-btn i { font-size: 16px; }

@keyframes pwaSlideIn {
  from { transform: translateY(80px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

/* iOS install hint (bottom banner) */
.pwa-ios-hint {
  position: fixed;
  bottom: 84px;
  left: 12px;
  right: 12px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  z-index: 1000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: pwaSlideIn 0.4s ease-out;
}
.pwa-ios-hint-body { flex: 1; font-size: 13px; line-height: 1.5; }
.pwa-ios-hint-body strong { display: block; margin-bottom: 4px; color: var(--accent); }
.pwa-ios-hint-body i { color: var(--accent); }
.pwa-ios-hint-close {
  background: transparent; border: none; color: var(--text-muted);
  font-size: 24px; cursor: pointer; padding: 0 4px; line-height: 1;
}
.pwa-ios-hint-close:hover { color: var(--text); }

/* When running as installed PWA, add extra padding for status bar */
@media (display-mode: standalone) {
  .topbar { padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
  body { padding-bottom: env(safe-area-inset-bottom, 0px); }
}

/* Referral milestone progress bar */
.progress-bar {
  height: 10px;
  background: var(--bg-elev-2);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #10b981, #06b6d4);
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.progress-fill::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: progressShine 2s linear infinite;
}
@keyframes progressShine {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100%); }
}

/* ============ reCAPTCHA ============ */
/* Hide the floating badge (required: legal attribution text shown instead) */
.grecaptcha-badge {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.recaptcha-legal {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin: 14px auto 8px;
  max-width: 380px;
  line-height: 1.5;
}
.recaptcha-legal a {
  color: var(--text-muted);
  text-decoration: underline;
}
.recaptcha-legal a:hover { color: var(--text); }

/* ============ IMPERSONATION BANNER ============ */
.impersonation-banner {
  position: sticky;
  top: 0;
  z-index: 9999;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.3);
  flex-wrap: wrap;
}
.impersonation-banner i { font-size: 18px; }
.impersonation-banner span { flex: 1; min-width: 140px; }
.impersonation-banner strong { font-weight: 800; }
.impersonation-exit {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 5px 12px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: background 0.15s;
}
.impersonation-exit:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

/* Subtle outline on body to remind admin */
body.is-impersonating {
  outline: 2px solid #ef4444;
  outline-offset: -2px;
}

/* ============ MAINTENANCE TOGGLE CARDS ============ */
.card-maint-on {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(239, 68, 68, 0.05));
  border-color: rgba(245, 158, 11, 0.3);
}
.card-maint-off {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.08), rgba(16, 185, 129, 0.03));
  border-color: rgba(34, 197, 94, 0.25);
}
.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff; border: none;
}
.btn-danger:hover { opacity: 0.9; color: #fff; }
