:root{
  --bg:#f6f8fb;
  --panel:#fff;
  --text:#162033;
  --muted:#7e899c;
  --line:#e9edf4;
  --green:#12b886;
  --red:#ef5b65;
  --blue:#3276f4;
  --shadow:0 12px 32px rgba(31,45,75,.07);
}
*{box-sizing:border-box}
body{
  margin:0;
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Arial,sans-serif;
  color:var(--text);
  background:var(--bg);
}
.topbar{
  height:64px;background:#fff;border-bottom:1px solid var(--line);
  display:flex;align-items:center;justify-content:space-between;
  padding:0 22px;position:sticky;top:0;z-index:10;
}
.brand{display:flex;align-items:center;gap:10px}
.brand-mark{
  width:38px;height:38px;border-radius:12px;display:grid;place-items:center;
  background:#fff6d7;border:1px solid #f1e2a7;font-size:21px
}
.brand strong{display:block;font-size:16px}
.brand span{display:block;color:var(--muted);font-size:11px;margin-top:1px}
.updated{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:12px}
.updated i{width:8px;height:8px;background:var(--green);border-radius:50%;box-shadow:0 0 0 4px rgba(18,184,134,.1)}
.container{max-width:1450px;margin:0 auto;padding:26px}
.hero{display:grid;grid-template-columns:.95fr 2.05fr;gap:20px}
.mascot-panel,.summary-panel{
  background:#fff;border:1px solid var(--line);border-radius:22px;box-shadow:var(--shadow)
}
.mascot-panel{
  position:relative;min-height:315px;padding:24px;overflow:hidden;
  background:linear-gradient(135deg,#fffdf6 0%,#fff7df 100%)
}
.pill{
  display:inline-flex;padding:6px 10px;border-radius:999px;background:#fff;
  font-size:11px;border:1px solid #eee2ba;color:#6d644a
}
.hero-copy{margin-top:22px;position:relative;z-index:2}
.hero-copy h1{font-size:25px;line-height:1.15;margin:0 0 10px}
.hero-copy p{font-size:14px;color:var(--muted);line-height:1.55;max-width:390px;margin:0}
.elephant{position:absolute;bottom:24px;left:34px;font-size:88px;filter:drop-shadow(0 10px 12px rgba(31,45,75,.08))}
.summary-panel{padding:22px}
.panel-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
.panel-head h2{margin:3px 0 0;font-size:18px}
.panel-head.compact{align-items:center}
.eyebrow{font-size:10px;font-weight:800;letter-spacing:.12em;color:#8e99aa}
.mini{font-size:11px;color:var(--muted)}
.kpis{display:grid;gap:10px;margin:18px 0}
.kpis.five{grid-template-columns:repeat(5,1fr)}
.kpi{
  background:#f9fafc;border:1px solid var(--line);border-radius:15px;padding:13px;
  min-width:0
}
.kpi span{display:block;font-size:10px;color:var(--muted);margin-bottom:6px}
.kpi strong{font-size:18px;white-space:nowrap}
.positive{color:var(--green)!important}
.negative{color:var(--red)!important}
.table-wrap{overflow-x:auto;border-top:1px solid var(--line);padding-top:6px}
.broker-table{width:100%;border-collapse:collapse;min-width:650px}
.broker-table th,.broker-table td{
  padding:11px 8px;border-bottom:1px solid #f0f2f6;text-align:right;font-size:12px
}
.broker-table th{font-size:10px;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}
.broker-table th:first-child,.broker-table td:first-child{text-align:left}
.broker-cell{display:flex;align-items:center;gap:9px}
.broker-logo{
  width:29px;height:29px;border-radius:9px;border:1px solid #e8ecf3;background:#fff;
  display:inline-flex;align-items:center;justify-content:center;overflow:hidden;flex:0 0 auto
}
.broker-logo img{width:20px;height:20px;object-fit:contain}
.broker-logo-lg{width:43px;height:43px;border-radius:12px}
.broker-logo-lg img{width:27px;height:27px}
.broker-fallback{font-weight:900;color:#536079;background:#f1f4f8}
.accounts-section{margin-top:28px}
.accounts-head{display:flex;align-items:end;justify-content:space-between;gap:14px;margin-bottom:14px}
.accounts-head h2{margin:2px 0 0;font-size:20px}
.filters{display:flex;gap:9px;flex-wrap:wrap}
select,input{
  height:40px;border:1px solid var(--line);background:#fff;border-radius:11px;
  padding:0 12px;color:var(--text);outline:none
}
input{min-width:220px}
.accounts{display:grid;grid-template-columns:repeat(3,1fr);gap:17px}
.card{
  background:#fff;border:1px solid var(--line);border-radius:18px;padding:16px;
  box-shadow:0 8px 24px rgba(31,45,75,.05);cursor:pointer;transition:.17s
}
.card:hover{transform:translateY(-2px);box-shadow:0 12px 34px rgba(31,45,75,.09)}
.card-top{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}
.account-identity{display:flex;gap:10px;min-width:0}
.account-name{font-size:15px;font-weight:850;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:260px}
.account-sub,.server{font-size:10px;color:var(--muted);margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:275px}
.live{
  padding:5px 8px;border-radius:999px;font-size:9px;font-weight:800;
  background:#e9faf4;color:#0c9368;white-space:nowrap
}
.main-pnl{margin-top:17px}
.main-pnl span{display:block;font-size:10px;color:var(--muted);margin-bottom:4px}
.main-pnl strong{font-size:25px}
.pnl-track{height:4px;background:#edf1f4;border-radius:999px;margin:12px 0 14px;overflow:hidden}
.pnl-track span{display:block;height:100%;width:100%;background:#42cfa8;border-radius:inherit}
.card-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:9px}
.metric{background:#f8fafc;border-radius:12px;padding:10px;border:1px solid #f1f3f7}
.metric span{display:block;font-size:9px;color:var(--muted);margin-bottom:4px}
.metric strong{font-size:13px}
.card-bottom{
  margin-top:12px;padding-top:11px;border-top:1px dashed #e9edf3;
  display:grid;grid-template-columns:repeat(4,1fr);gap:5px;
  font-size:9px;color:var(--muted)
}
.card-bottom span{text-align:center}
.card-bottom b{display:block;color:var(--text);font-size:11px;margin-top:2px}
.empty{background:#fff;border:1px dashed #dce1ea;padding:46px;text-align:center;border-radius:16px;color:var(--muted)}
.modal-backdrop{
  position:fixed;inset:0;background:rgba(18,27,43,.45);display:none;
  align-items:center;justify-content:center;padding:18px;z-index:30
}
.modal{
  width:min(880px,96vw);max-height:90vh;overflow:auto;background:#fff;border-radius:20px;
  padding:20px;box-shadow:0 24px 80px rgba(0,0,0,.22)
}
.modal-top{display:flex;justify-content:space-between;align-items:center}
.modal-account-title{display:flex;align-items:center;gap:11px}
.name{font-weight:850;font-size:17px}
.sub{font-size:11px;color:var(--muted);margin-top:3px}
.close{width:36px;height:36px;border:0;border-radius:10px;background:#f2f4f7;font-size:19px;cursor:pointer}
.detail-kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:9px;margin:18px 0}
.chart-wrap{border:1px solid var(--line);border-radius:15px;padding:14px}
canvas{width:100%;height:240px}
@media(max-width:1120px){
  .hero{grid-template-columns:1fr}
  .kpis.five{grid-template-columns:repeat(3,1fr)}
  .accounts{grid-template-columns:repeat(2,1fr)}
}
@media(max-width:720px){
  .container{padding:14px}
  .topbar{padding:0 14px}
  .kpis.five{grid-template-columns:repeat(2,1fr)}
  .accounts{grid-template-columns:1fr}
  .accounts-head{align-items:flex-start;flex-direction:column}
  .filters{width:100%}
  select,input{flex:1;min-width:0}
  .detail-kpis{grid-template-columns:repeat(2,1fr)}
}
