:root{
  --bg:#070b10; --card:#0c121a; --muted:#93a4b8; --text:#eaf2ff;
  --teal:#19e7d7; --border:rgba(255,255,255,.08);
  --shadow: 0 20px 60px rgba(0,0,0,.5);
  --radius:18px;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial;
}
*{box-sizing:border-box}
body{margin:0; color:var(--text); background:radial-gradient(1200px 600px at 20% -10%, rgba(25,231,215,.12), transparent 60%), var(--bg);}
a{color:var(--teal); text-decoration:none}
.muted{color:var(--muted)}
.hidden{display:none !important}

.topbar{
  display:flex; align-items:center; justify-content:space-between;
  padding:18px 22px; border-bottom:1px solid var(--border);
  position:sticky; top:0; background:rgba(7,11,16,.8); backdrop-filter: blur(10px);
}
.brand{display:flex; gap:12px; align-items:center}
.logo{width:40px;height:40px;border-radius:12px;display:grid;place-items:center;background:rgba(25,231,215,.12);border:1px solid rgba(25,231,215,.25);color:var(--teal);font-weight:800}
.brandTitle{font-weight:800}
.brandSub{font-size:12px;color:var(--muted)}
.topActions{display:flex; gap:10px; align-items:center}
.userChip{padding:10px 12px;border:1px solid var(--border);border-radius:999px;background:rgba(255,255,255,.03)}

.container{max-width:1100px;margin:0 auto;padding:22px}
.heroCard{
  border:1px solid var(--border); border-radius:var(--radius); padding:18px 18px;
  background:linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  box-shadow: var(--shadow);
}
.card{
  border:1px solid var(--border); border-radius:var(--radius); padding:16px;
  background:linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  box-shadow: var(--shadow);
}
.cardHead{display:flex;justify-content:space-between;align-items:center}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-top:16px}
.grid3{display:grid;grid-template-columns:1fr 1fr 1fr;gap:16px;margin-top:16px}
@media(max-width:900px){.grid2,.grid3{grid-template-columns:1fr}}

h1{margin:0 0 8px 0}
h2{margin:0 0 12px 0; font-size:18px}

.form{display:grid; gap:10px}
label{font-size:12px;color:var(--muted)}
input,select{
  width:100%; padding:12px 12px; border-radius:12px;
  border:1px solid var(--border); background:rgba(0,0,0,.25); color:var(--text);
}
.row{display:flex; gap:10px; margin-top:6px}
.btnPrimary,.btnGhost,.btnMini{
  border-radius:12px; border:1px solid var(--border); padding:12px 14px;
  background:rgba(25,231,215,.12); color:var(--text); cursor:pointer;
}
.btnGhost{background:rgba(255,255,255,.03)}
.btnMini{padding:8px 10px; border-radius:10px}
.btnPrimary:hover{border-color:rgba(25,231,215,.5)}
.btnGhost:hover{border-color:rgba(255,255,255,.18)}

.tableWrap{overflow:auto;border-radius:14px;border:1px solid var(--border)}
.table{width:100%; border-collapse:collapse; min-width:760px}
th,td{padding:10px 12px;border-bottom:1px solid var(--border);font-size:13px}
th{color:var(--muted);text-align:left}
.right{text-align:right}
.badge{padding:4px 8px;border:1px solid var(--border);border-radius:999px;background:rgba(255,255,255,.03)}
.netPos{color:#7CFFB2}
.netNeg{color:#FF7C8A}

.statsRow{display:flex;gap:12px;margin-top:12px}
.stat{flex:1;border:1px solid var(--border);border-radius:14px;padding:12px;background:rgba(255,255,255,.02)}
.statLabel{font-size:12px;color:var(--muted)}
.statValue{font-size:20px;font-weight:800}

.toast{
  margin-top:12px; border:1px solid rgba(25,231,215,.25); background:rgba(25,231,215,.08);
  border-radius:14px; padding:12px; position:relative;
}
.toastTitle{font-weight:800;margin-bottom:4px}
.toastClose{position:absolute; right:10px; top:8px; background:transparent; border:none; color:var(--text); font-size:20px; cursor:pointer}

.authPage{min-height:100vh; display:grid; place-items:center; padding:20px}
.authCard{width:min(420px, 100%); border:1px solid var(--border); border-radius:var(--radius); padding:18px; background:rgba(255,255,255,.03); box-shadow:var(--shadow)}
.authForm{display:grid; gap:10px; margin-top:10px}
.alert{border:1px solid rgba(255,124,138,.35); background:rgba(255,124,138,.08); border-radius:14px; padding:10px; margin:10px 0}
.list{display:grid; gap:10px}
.listRow{display:grid; grid-template-columns: 1fr auto auto; gap:10px; padding:10px; border:1px solid var(--border); border-radius:14px; background:rgba(255,255,255,.02)}
.statCard .statBig{font-size:28px;font-weight:900}

/* -------- Mobile responsiveness fixes -------- */
html, body { overflow-x: hidden; }

@media (max-width: 900px) {
  .container { padding: 14px; }
  .topbar { padding: 14px; gap: 10px; flex-wrap: wrap; }
  .topActions { flex-wrap: wrap; justify-content: flex-start; }

  .row { flex-direction: column; }
  .btnPrimary, .btnGhost { width: 100%; }

  .statsRow { flex-direction: column; }

  /* Keep table scrolling INSIDE its container */
  .tableWrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table { min-width: 680px; } /* smaller than before so less painful on mobile */

  th, td { padding: 8px 10px; font-size: 12px; }
}

