/* MIS Student System — brand colours only, one light theme (instruction #7). */
:root {
  --gold: #c5a059;
  --gold-dark: #a8853f;
  --gold-soft: #f6efe2;
  --green: #2d5a27;
  --green-soft: #e5eee3;
  --navy: #223248;
  --navy-2: #2e4260;
  --navy-soft: #e7ebf1;
  --bg: #f4f7f9;
  --card: #ffffff;
  --line: #e1e6ec;
  --text: #223248;
  --muted: #6a778a;
  --red: #a3392b;       /* losses / danger only — the one non-brand colour */
  --red-soft: #f7e6e3;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(34, 50, 72, .06), 0 4px 16px rgba(34, 50, 72, .05);
  --font: "Noto Sans HK", -apple-system, BlinkMacSystemFont, "PingFang HK", "Microsoft JhengHei", sans-serif;
  --num: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--navy); }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.hidden { display: none !important; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: var(--navy); color: #fff; padding: 22px 16px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; }
.brand { padding: 4px 10px 22px; }
.brand .logo { font: 800 30px/1 var(--num); color: var(--gold); letter-spacing: .5px; }
.brand .sub { font-size: 12px; color: #c4cede; margin-top: 4px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: #dfe5ee; text-decoration: none; font-weight: 500; }
.nav a:hover { background: var(--navy-2); }
.nav a.on { background: var(--gold); color: var(--navy); }
.nav svg { width: 18px; height: 18px; flex: none; }
.side .me { margin-top: auto; border-top: 1px solid rgba(255,255,255,.12); padding: 14px 6px 0; display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--gold); color: var(--navy); display: grid; place-items: center; font-weight: 700; flex: none; }
.me .who { min-width: 0; flex: 1; }
.me .who b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.me .who span { font-size: 12px; color: #c4cede; }
.iconbtn { background: none; border: 0; color: #c4cede; cursor: pointer; padding: 6px; border-radius: 8px; }
.iconbtn:hover { background: var(--navy-2); color: #fff; }
.iconbtn svg { width: 18px; height: 18px; display: block; }

main { padding: 30px 34px 60px; max-width: 1280px; width: 100%; min-width: 0; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.head h1 { margin: 0; font-size: 30px; line-height: 1.2; }
.head p { margin: 4px 0 0; color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.viewing { background: var(--gold-soft); border: 1px solid var(--gold); color: var(--navy); border-radius: 12px; padding: 10px 14px; margin-bottom: 18px; display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; min-width: 0; }
.card h2 { font-size: 17px; margin: 0 0 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stack { display: grid; gap: 16px; }
.row { display: flex; gap: 10px; align-items: center; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }

/* ---------- buttons & forms ---------- */
.btn { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 9px 14px; cursor: pointer; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; justify-content: center; white-space: nowrap; }
.btn:hover { border-color: var(--navy); }
.btn svg { width: 16px; height: 16px; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--navy); }
.btn.gold:hover { background: var(--gold-dark); border-color: var(--gold-dark); }
.btn.navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.btn.danger { color: var(--red); border-color: #e3b5ae; background: #fff; }
.btn.danger:hover { background: var(--red-soft); border-color: var(--red); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.block { width: 100%; padding: 12px; }
.btn.sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-sq { width: 34px; height: 34px; padding: 0; border-radius: 9px; }
label.f { display: grid; gap: 5px; font-size: 13px; font-weight: 600; color: var(--muted); }
.in, select.in, textarea.in { width: 100%; border: 1px solid var(--line); background: #fbfcfd; border-radius: 10px; padding: 10px 12px; color: var(--text); font-weight: 400; font-size: 15px; }
.in:focus { outline: 2px solid var(--gold); outline-offset: 0; border-color: var(--gold); background: #fff; }
.in.tiny { padding: 6px 8px; font-size: 14px; border-radius: 8px; }
.in.missing { border-color: var(--red); background: var(--red-soft); }
.in.missing::placeholder { color: var(--red); }
.fgrid { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.fgrid .full { grid-column: 1 / -1; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; background: var(--bg); padding: 5px; border-radius: 12px; }
.seg button { border: 0; background: transparent; padding: 9px 6px; border-radius: 9px; cursor: pointer; font-weight: 600; color: var(--muted); font-size: 14px; line-height: 1.25; }
.seg button.on { background: #fff; color: var(--navy); box-shadow: var(--shadow); }
.pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pick button { border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: 10px; font-weight: 700; cursor: pointer; color: var(--muted); }
.pick button.on.buy { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.pick button.on.sell { border-color: var(--red); background: var(--red-soft); color: var(--red); }
.pick button.on.neutral { border-color: var(--navy); background: var(--navy-soft); color: var(--navy); }
.confirm { display: flex; gap: 10px; align-items: flex-start; background: var(--gold-soft); border: 1px solid #e8d8b8; border-radius: 10px; padding: 12px; font-size: 14px; cursor: pointer; }
.confirm input { margin-top: 3px; accent-color: var(--green); width: 16px; height: 16px; flex: none; }
.hint { font-size: 13px; color: var(--muted); background: var(--bg); border-radius: 10px; padding: 9px 12px; }
.hint.xp { background: var(--gold-soft); color: var(--navy); }
.tkinfo { font-size: 13px; font-weight: 500; color: var(--muted); margin-top: 2px; min-height: 0; }
.tkinfo.ok { color: var(--green); }
.tkinfo.bad { color: var(--red); }
.cur-in { display: flex; align-items: stretch; border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden; background: #fbfcfd; }
.cur-in:focus-within { border-color: var(--gold); outline: 2px solid var(--gold); }
.cur-in .cur { display: grid; place-items: center; padding: 0 12px; font: 800 14px var(--num); color: #fff; letter-spacing: .3px; }
.cur-in.usd .cur { background: var(--navy); } .cur-in.hkd .cur { background: var(--green); }
.cur-in .in { border: 0; border-radius: 0; background: transparent; outline: none; }
.cur-word { font-weight: 800; padding: 0 4px; border-radius: 4px; }
.cur-word.usd { color: var(--navy); background: var(--navy-soft); } .cur-word.hkd { color: var(--green); background: var(--green-soft); }
.xfer { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; background: var(--bg); border-radius: 12px; padding: 14px; }
.xfer div { display: grid; gap: 4px; } .xfer b { font: 800 20px var(--num); } .xfer b.usd { color: var(--navy); } .xfer b.hkd { color: var(--green); }
.xfer .arrow-x { font-size: 22px; color: var(--gold); }
.confirm-layer { z-index: 55; }
.split-box { display: grid; gap: 8px; background: var(--bg); border-radius: 12px; padding: 12px; }
.split-row { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 4px 10px; align-items: center; font-size: 14px; font-weight: 600; }
.split-row [data-tag] { grid-column: 2; font-weight: 400; }
.split-row [data-tag]:empty { display: none; }
.split-row input[readonly] { color: var(--muted); }
@media (max-width: 760px) { .split-row { grid-template-columns: 1fr; gap: 4px; } }
.rate-in { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text); }
.rate-in .in { width: 110px; }
.all-btn { margin-top: 6px; }
.err { color: var(--red); font-size: 14px; min-height: 0; }

/* ---------- game hero ---------- */
.hero { background: linear-gradient(135deg, var(--navy) 0%, #1a2738 100%); color: #fff; border: 0; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; border: 28px solid rgba(197,160,89,.13); pointer-events: none; }
.hero .lvl { display: flex; align-items: center; gap: 14px; }
.hero .badge-lvl { width: 58px; height: 58px; border-radius: 16px; background: var(--gold); color: var(--navy); display: grid; place-items: center; font: 800 24px/1 var(--num); flex: none; }
.hero h3 { margin: 0; font-size: 20px; }
.hero .muted { color: #c4cede; }
.xpbar { height: 10px; background: rgba(255,255,255,.12); border-radius: 99px; overflow: hidden; margin: 14px 0 6px; }
.xpbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), #e2c387); border-radius: 99px; transition: width .6s ease; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.chip { background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.14); padding: 6px 11px; border-radius: 99px; font-size: 13px; font-weight: 600; }
.chip.hot { background: rgba(197,160,89,.22); border-color: var(--gold); }
.quests { display: grid; gap: 8px; }
.quest { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.07); border-radius: 12px; padding: 10px 12px; }
.quest .tick { width: 24px; height: 24px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); display: grid; place-items: center; flex: none; font-size: 13px; }
.quest.done .tick { background: var(--gold); border-color: var(--gold); color: var(--navy); font-weight: 800; }
.quest .q { flex: 1; min-width: 0; font-size: 14px; }
.quest .q span { display: block; font-size: 12px; color: #c4cede; }
.quest .xp { font: 700 12px var(--num); color: var(--gold); white-space: nowrap; }
.hero .btn { border-color: rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: #fff; }
.hero .btn.gold { background: var(--gold); color: var(--navy); border-color: var(--gold); }

/* ---------- pots ---------- */
.flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.pot { position: relative; padding: 18px 18px 16px; border-top: 4px solid var(--line); }
.pot.saving { border-top-color: var(--green); }
.pot.investing { border-top-color: var(--navy); }
.pot.spending { border-top-color: var(--gold); }
.pot.broker { border-top-color: var(--gold-dark); background: var(--gold-soft); }
.pot .lbl { font-size: 14px; color: var(--muted); font-weight: 600; display: flex; justify-content: space-between; gap: 8px; }
.pot .amt { font: 700 26px/1.2 var(--num); margin: 8px 0 4px; letter-spacing: -.3px; overflow-wrap: anywhere; }
.pot.saving .amt { color: var(--green); }
.pot.spending .amt.neg { color: var(--red); }
.pot .foot { font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; }
.bar { height: 8px; background: var(--bg); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; background: var(--gold); border-radius: 99px; }
.bar.navy i { background: var(--navy); }
.bar.red i { background: var(--red); }
.arrow { position: absolute; right: -14px; top: 50%; width: 12px; height: 12px; border-top: 2px solid var(--line); border-right: 2px solid var(--line); transform: translateY(-50%) rotate(45deg); }
.rules { display: flex; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.rules span { background: #fff; border: 1px solid var(--line); border-radius: 99px; padding: 4px 10px; }

.first-capital { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; border: 1.5px dashed var(--gold); background: var(--gold-soft); }
.first-capital .big { font-size: 40px; }
.first-capital h3 { margin: 0 0 4px; }
.first-capital p { margin: 0; color: var(--muted); font-size: 14px; }
.connect { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; border: 1.5px dashed var(--gold); background: var(--gold-soft); }
.connect .big { font-size: 40px; }
.connect h3 { margin: 0 0 4px; }
.connect p { margin: 0; color: var(--muted); font-size: 14px; }

.cats { display: grid; gap: 10px; }
.cat { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; font-size: 14px; }
.cat .bar { margin-top: 4px; }

/* ---------- tables ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: left; } /* instruction #21: everything in tables aligns left */
.tbl .nw, .tbl.nowrap td, .tbl.nowrap th { white-space: nowrap; }
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.empty { text-align: center; color: var(--muted); padding: 34px 10px; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--bg); color: var(--muted); white-space: nowrap; }
.tag.green { background: var(--green-soft); color: var(--green); }
.tag.gold { background: var(--gold-soft); color: var(--gold-dark); }
.tag.navy { background: var(--navy-soft); color: var(--navy); }
.tag.red { background: var(--red-soft); color: var(--red); }

/* ---------- 總覽 flow + 支出 ---------- */
.flow-svg { width: 100%; max-width: 640px; height: auto; display: block; margin: 0 auto; }
.flow-svg .fs-l { font: 600 15px var(--font); fill: var(--text); }
.flow-svg .fs-v, .donut .fs-v { font: 700 20px var(--num); fill: var(--text); }
.flow-svg .fs-s, .donut .fs-s { font: 500 13px var(--num); fill: var(--muted); }
.donut-wrap { display: grid; grid-template-columns: 240px 1fr; gap: 24px; align-items: center; }
.donut { width: 100%; max-width: 240px; }
.legend { display: grid; gap: 10px; }
.lg-row { display: grid; grid-template-columns: 14px 1fr auto; gap: 10px; align-items: center; font-size: 14px; }
.lg-row .sw { width: 14px; height: 14px; border-radius: 4px; }
.sp-kpis .kpi-l { padding: 14px 16px; }
.kpi-l .k { font-size: 12px; color: var(--muted); font-weight: 600; }
.kpi-l .v { font-size: 22px; font-weight: 700; margin-top: 2px; }
.day-head { display: flex; justify-content: space-between; padding: 12px 10px 4px; border-top: 1px solid var(--line); margin-top: 6px; font-size: 14px; }
.day-head:first-of-type { border-top: 0; margin-top: 0; }
.exp-tbl { table-layout: fixed; min-width: 520px; }
.exp-tbl col.c-ic { width: 44px; } .exp-tbl col.c-pay { width: 140px; } .exp-tbl col.c-amt { width: 130px; } .exp-tbl col.c-ed { width: 64px; }
.exp-tbl td:last-child { overflow: visible; }
.exp-tbl td { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 760px) { .donut-wrap { grid-template-columns: 1fr; justify-items: center; } .legend { width: 100%; } .sp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } }

/* ---------- portfolio ---------- */
.total { background: linear-gradient(135deg, var(--navy), #1a2738); color: #fff; border: 0; }
.total .big { font: 800 40px/1.1 var(--num); letter-spacing: -.5px; margin: 6px 0 18px; overflow-wrap: anywhere; }
.kpi { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.kpi .k { font-size: 11px; letter-spacing: .4px; text-transform: uppercase; color: #c4cede; font-weight: 600; }
.kpi .v { font: 700 19px/1.3 var(--num); margin-top: 4px; overflow-wrap: anywhere; }
.kpi .v.pos { color: #9fd394; }
.kpi .v.neg { color: #f0a497; }
.kpi.roi { border-color: var(--gold); background: rgba(197,160,89,.16); }
.pf-grid { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 16px; align-items: start; }
.plan-tbl { table-layout: fixed; min-width: 760px; }
.plan-tbl col.c-stock { width: 18%; }
.plan-tbl col.c-pct { width: 11%; }
.plan-tbl col.c-strat { width: 19%; }
.plan-tbl col.c-del { width: 48px; }
.plan-tbl td { padding: 9px 8px; vertical-align: middle; }
.plan-tbl th { padding: 8px; }
.plan-tbl .in.tiny { width: 100%; }
.pct-in { position: relative; }
.pct-in .in { padding-right: 26px; text-align: left; }
.pct-in span { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; pointer-events: none; }
.pct-in input::-webkit-outer-spin-button, .pct-in input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pct-in input { -moz-appearance: textfield; }
.usedbar { width: 100%; max-width: 120px; margin: 6px 0 0 0; height: 6px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.usedbar i { display: block; height: 100%; background: var(--navy); }
.usedbar i.full { background: var(--gold); }
.usedbar i.over { background: var(--red); }
.bar-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; }
.bar-legend span { display: inline-flex; align-items: center; gap: 6px; }
.bar-legend .lg { display: inline-block; width: 18px; height: 6px; border-radius: 99px; }
.lg.navy { background: var(--navy); } .lg.gold { background: var(--gold); } .lg.red { background: var(--red); }
.pricecell { display: flex; align-items: center; gap: 6px; }
.pricecell .in { width: 92px; }
.alert { display: flex; align-items: center; gap: 12px; justify-content: space-between; flex-wrap: wrap; background: var(--red-soft); border: 1px solid #e6b9b2; color: var(--red); border-radius: 12px; padding: 12px 14px; font-weight: 600; }

.records-btn { display: flex; align-items: center; gap: 14px; padding: 20px; border-radius: var(--radius); background: var(--navy); color: #fff; text-decoration: none; box-shadow: var(--shadow); }
.records-btn:hover { background: var(--navy-2); }
.records-btn .ic { font-size: 30px; }
.records-btn .t { flex: 1; min-width: 0; display: grid; gap: 2px; }
.records-btn .t b { font-size: 18px; }
.records-btn .t span { font-size: 13px; color: #c4cede; }
.records-btn .go { font-size: 24px; color: var(--gold); }
.records-btn .tag.red { background: #f7e6e3; }

/* ---------- records ---------- */
.filters { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; padding: 10px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs button { border: 0; background: transparent; padding: 8px 14px; border-radius: 9px; font-weight: 600; cursor: pointer; color: var(--muted); }
.tabs button.on { background: var(--navy); color: #fff; }
.search { position: relative; }
.search .in { padding-left: 34px; width: 260px; max-width: 100%; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.rec { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.rec + .rec { margin-top: 10px; }
.rec .ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; background: var(--bg); }
.rec .ic.buy { background: var(--green-soft); }
.rec .ic.sell { background: var(--red-soft); }
.rec .ic.money { background: var(--navy-soft); }
.rec .ic.div, .rec .ic.opt { background: var(--gold-soft); }
.rec .t { font-weight: 700; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.rec .t .muted { font-weight: 400; font-size: 13px; }
.rec .d { font-size: 14px; margin-top: 2px; overflow-wrap: anywhere; }
.rec .note { display: inline-block; margin-top: 6px; background: var(--bg); border-radius: 8px; padding: 4px 9px; font-size: 13px; font-style: italic; overflow-wrap: anywhere; }
.rec .right { text-align: right; display: flex; align-items: center; gap: 8px; }
.rec .amt { font: 700 16px var(--num); white-space: nowrap; }
.rec .sub { font-size: 12px; }
.rec .meta { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- badges ---------- */
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.bdg { border: 1px solid var(--line); border-radius: 12px; padding: 12px; text-align: center; background: #fff; }
.bdg .e { font-size: 28px; line-height: 1.2; }
.bdg b { display: block; font-size: 14px; margin-top: 4px; }
.bdg span { font-size: 12px; color: var(--muted); display: block; }
.bdg.locked { background: var(--bg); }
.bdg.locked .e { filter: grayscale(1); opacity: .35; }
.bdg.earned { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.xpparts { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- modal & toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(20, 30, 45, .45); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 460px; max-height: calc(100vh - 32px); overflow: auto; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal h3 { margin: 0 0 12px; font-size: 20px; }
.modal .btns { display: grid; gap: 8px; margin-top: 16px; }
.modal ul { background: var(--bg); border-radius: 10px; padding: 12px 12px 12px 30px; margin: 10px 0; }
.toast-box { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 60; width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--navy); color: #fff; border-radius: 12px; padding: 12px 16px; box-shadow: 0 10px 30px rgba(0,0,0,.2); font-weight: 600; animation: pop .25s ease; }
.toast.gold { background: var(--gold); color: var(--navy); }
.toast.bad { background: var(--red); }
@keyframes pop { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
canvas.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; }
.pw { font: 700 22px var(--num); letter-spacing: 1px; background: var(--gold-soft); border: 1px dashed var(--gold); border-radius: 10px; padding: 12px; text-align: center; user-select: all; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(circle at 20% 10%, #fff 0, var(--bg) 50%), var(--bg); }
.login .card { width: 100%; max-width: 400px; padding: 34px 28px; }
.login .logo { text-align: center; font: 800 44px/1 var(--num); color: var(--navy); }
.login .logo span { color: var(--gold); }
.login .tag-line { text-align: center; color: var(--muted); margin: 8px 0 26px; }
.login form { display: grid; gap: 14px; }
.login .foot { text-align: center; font-size: 13px; color: var(--muted); margin-top: 18px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .arrow { display: none; }
  .pf-grid { grid-template-columns: minmax(0, 1fr); }
  .g5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; flex-direction: row; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); z-index: 40; gap: 0; }
  .brand, .side .me { display: none; }
  .nav { display: flex; width: 100%; justify-content: space-around; }
  .nav a { flex-direction: column; gap: 2px; font-size: 11px; padding: 6px 8px; }
  main { padding: 18px 16px 96px; }
  .head h1 { font-size: 24px; }
  .g2, .g3, .g4, .g5, .flow { grid-template-columns: minmax(0, 1fr); }
  .g5.kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .connect, .first-capital { grid-template-columns: 1fr; text-align: center; }
  .rec { grid-template-columns: 40px minmax(0, 1fr); }
  .rec .ic { width: 40px; height: 40px; }
  .rec .right { grid-column: 1 / -1; justify-content: space-between; }
  .search .in { width: 100%; }
  .search, .filters .tabs { width: 100%; }
  .total .big { font-size: 32px; }
  .fgrid { grid-template-columns: 1fr; }
  .mobile-only { display: inline-flex !important; }
}
.mobile-only { display: none !important; }
