/* MissionPaisa – shared site styles (dark trading-desk theme, gold accent) */
:root {
  --bg: #0a0d13; --panel: #10141c; --panel2: #151a24; --line: #222a38; --line2: #2c3547;
  --text: #d9dee8; --muted: #7d879b; --gold: #f5b70a; --gold2: #d99e00;
  --pos: #22c55e; --neg: #ef4444; --blue: #3b82f6; --radius: 10px;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
* { box-sizing: border-box; }
body.site { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font-size: 14px; }
a { color: var(--gold); }
.pos { color: var(--pos) !important; } .neg { color: var(--neg) !important; } .flat { color: var(--muted); }
.num, td.num { font-variant-numeric: tabular-nums; text-align: right; }
.hidden { display: none !important; }

/* ---------- top nav (shared with trade page) */
.mp-top { height: 54px; display: flex; align-items: center; gap: 18px; padding: 0 20px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #121722, #0d1118); position: sticky; top: 0; z-index: 20; }
.mp-brand { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-size: 16px; letter-spacing: .2px; white-space: nowrap; }
.mp-brand b { color: var(--gold); }
.mp-nav { display: flex; gap: 2px; }
.mp-nav a { color: var(--muted); text-decoration: none; padding: 7px 11px; border-radius: 7px; font-weight: 500; white-space: nowrap; }
.mp-nav a:hover { color: var(--text); background: var(--panel2); }
.mp-nav a.on { color: var(--gold); background: #f5b70a14; }
.mp-who { margin-left: auto; display: flex; align-items: center; gap: 7px; color: var(--text); text-decoration: none; padding: 5px 10px; border: 1px solid var(--line2); border-radius: 20px; font-weight: 600; white-space: nowrap; }
.mp-who i { width: 9px; height: 9px; border-radius: 50%; }
.mp-who small { color: var(--muted); font-weight: 400; font-size: 11px; }
.mp-who:hover { border-color: var(--gold); }
.mp-out { color: var(--muted); text-decoration: none; font-size: 17px; padding: 4px 6px; }
.mp-out:hover { color: var(--neg); }

.page { max-width: 1320px; margin: 0 auto; padding: 22px 20px 60px; }
.page h1 { font-size: 22px; margin: 0 0 4px; }
.sub { color: var(--muted); margin: 0 0 18px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card h3 { margin: 0 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 600; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- buttons & inputs */
.btn { height: 34px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--gold2); background: var(--gold); color: #111; font-weight: 600; cursor: pointer; font: inherit; font-weight: 600; white-space: nowrap; }
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: var(--line2); color: var(--text); font-weight: 500; }
.btn.ghost:hover { background: var(--panel2); }
.btn.danger { background: var(--neg); border-color: #b91c1c; color: #fff; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
input, select, textarea { font: inherit; color: var(--text); background: #0c1017; border: 1px solid var(--line2); border-radius: 8px; padding: 7px 10px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px #f5b70a22; }
textarea { width: 100%; resize: vertical; line-height: 1.45; }
.fld { display: flex; flex-direction: column; gap: 5px; margin: 10px 0; }
.fld > span { font-size: 12px; color: var(--muted); }
.fld em { color: var(--gold); font-style: normal; font-size: 11px; }

/* segmented filters */
.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; color: var(--muted); padding: 6px 12px; border-radius: 7px; cursor: pointer; font: inherit; font-size: 13px; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--panel2); color: var(--gold); box-shadow: inset 0 0 0 1px var(--line2); }

/* tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 600; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; background: var(--panel); }
.tbl td { padding: 8px 10px; border-bottom: 1px solid #1a2030; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl tr:hover td { background: #141a25; }
.tbl .dot, i.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; }
.tbl td.wrap { white-space: normal; min-width: 180px; max-width: 320px; color: #b8c0d0; }
.table-scroll { overflow-x: auto; }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 14px 0; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.kpi small { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
.kpi b { display: block; font-size: 21px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi em { font-style: normal; color: var(--muted); font-size: 12px; }

.progress { height: 8px; border-radius: 6px; background: #1b2230; overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 6px; background: var(--c, var(--gold)); transition: width .5s; }

.empty { color: var(--muted); padding: 28px; text-align: center; }
.st { padding: 2px 7px; border-radius: 10px; font-size: 11px; background: #1e2533; color: var(--muted); }
.st.done { background: #14532d55; color: var(--pos); } .st.error, .st.expired, .st.unknown { background: #7f1d1d55; color: #fca5a5; }
.st.pending, .st.sent { background: #78350f55; color: #fcd34d; }

/* toasts */
#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: 380px; }
.toast { background: #182030; border: 1px solid var(--line2); border-left: 3px solid var(--blue); color: var(--text); padding: 10px 14px; border-radius: 8px; box-shadow: 0 8px 30px #0008; opacity: 0; transform: translateY(8px); transition: .25s; font-size: 13px; }
.toast.in { opacity: 1; transform: none; }
.toast.ok { border-left-color: var(--pos); } .toast.err { border-left-color: var(--neg); }

/* modal (also used on trade page) */
.modal-bg { position: fixed; inset: 0; background: #0009; display: grid; place-items: center; z-index: 60; backdrop-filter: blur(2px); }
.modal.confirm { width: min(440px, 92vw); background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; box-shadow: 0 20px 60px #000a; }
.modal.confirm .modal-head { padding: 14px 16px; font-weight: 700; font-size: 15px; border-bottom: 1px solid var(--line); }
.modal.confirm .modal-body { padding: 14px 16px; line-height: 1.5; }
.modal.confirm .modal-foot { display: flex; padding: 12px 16px; border-top: 1px solid var(--line); gap: 8px; }
.modal.confirm .spacer { flex: 1; }
.modal.confirm .btn.danger { background: var(--neg); border-color: #b91c1c; color: #fff; }
.cf-grid { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; }
.cf-grid span { color: var(--muted); }
.cf-j { margin: 12px 0 0; padding: 10px; background: #0c1017; border-radius: 8px; color: #b8c0d0; font-style: italic; max-height: 120px; overflow: auto; white-space: pre-wrap; }

/* ---------- login */
.login-body { display: grid; place-items: center; background: radial-gradient(1000px 500px at 50% -10%, #f5b70a14, transparent), var(--bg); }
.login-wrap { width: min(420px, 92vw); padding: 30px 0; }
.login-wrap .card.wide { width: min(620px, 92vw); margin-left: 50%; transform: translateX(-50%); }
.login-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 22px; justify-content: center; }
.login-brand h1 { margin: 0; font-size: 26px; } .login-brand h1 b { color: var(--gold); }
.login-brand p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.login-card { padding: 24px; text-align: center; }
.login-card h2 { margin: 0 0 16px; font-size: 16px; font-weight: 600; }
.pin-dots { display: flex; gap: 12px; justify-content: center; margin-bottom: 14px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line2); transition: .15s; }
.pin-dots i.on { background: var(--gold); border-color: var(--gold); }
#pin { position: absolute; opacity: 0; pointer-events: none; width: 1px; }
.form-err { color: #fca5a5; margin-bottom: 10px; font-size: 13px; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.keypad button { height: 58px; border-radius: 12px; border: 1px solid var(--line2); background: var(--panel2); color: var(--text); font-size: 22px; cursor: pointer; font-family: inherit; }
.keypad button:hover { border-color: var(--gold); }
.keypad button:active { transform: scale(.97); }
.keypad .go { background: var(--gold); color: #111; border-color: var(--gold2); font-weight: 700; }
.who-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.who { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 20px 10px; border-radius: 12px; border: 1px solid var(--line2); background: var(--panel2); color: var(--text); cursor: pointer; font: inherit; transition: .15s; }
.who:hover { border-color: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 25%, transparent); transform: translateY(-2px); }
.who .av { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: #0b0e14; font-weight: 800; font-size: 22px; }
.who b { font-size: 16px; } .who small { color: var(--muted); }
.muted-link { color: var(--muted); font-size: 13px; }

/* ---------- leaderboard */
.podium { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 14px 0; }
.racer { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; border-top: 3px solid var(--c); }
.racer .rank { position: absolute; right: 14px; top: 12px; font-size: 26px; font-weight: 800; color: #2a3346; }
.racer.first .rank { color: var(--gold); }
.racer h2 { margin: 0; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.racer .big { font-size: 28px; font-weight: 800; margin: 8px 0 2px; font-variant-numeric: tabular-nums; }
.racer .meta { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.racer .meta b { display: block; color: var(--text); font-size: 14px; }
.chart-box { height: 320px; position: relative; }
.legend-row { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.legend-row span { display: flex; align-items: center; gap: 6px; }
.legend-row i { width: 12px; height: 3px; border-radius: 2px; display: inline-block; }
.cmp-tbl td:first-child { color: var(--muted); }
.cmp-tbl td.best { font-weight: 700; }
.cmp-tbl td.best::after { content: ' ★'; color: var(--gold); }
.heat td { text-align: center; }
.heat .cell { display: inline-block; min-width: 64px; padding: 4px 6px; border-radius: 6px; }

/* settings */
.set-row { display: grid; grid-template-columns: 40px 1fr 140px 90px; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.set-row input[type=color] { width: 40px; height: 34px; padding: 2px; }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 8px 16px; font-size: 13px; }
.kv span { color: var(--muted); }
code { background: #0c1017; border: 1px solid var(--line); padding: 1px 6px; border-radius: 5px; font-size: 12px; }

@media (max-width: 860px) {
  .mp-top { gap: 8px; padding: 0 10px; overflow-x: auto; }
  .mp-brand span { display: none; }
  .mp-who small { display: none; }
  .grid2 { grid-template-columns: 1fr; }
  .page { padding: 16px 12px 50px; }
  .set-row { grid-template-columns: 36px 1fr 100px; }
  .set-row .muted { display: none; }
}
