:root{
  --bg:#f6f8fc;
  --panel:#fff;
  --text:#172033;
  --muted:#7e899b;
  --line:#e8edf4;
  --green:#11b981;
  --red:#ee5c68;
  --orange:#e6a23c;
  --blue:#3478f6;
  --shadow:0 10px 30px rgba(27,42,72,.06);
}
*{box-sizing:border-box}
body{
  margin:0;
  font-family:Inter,system-ui,-apple-system,"Segoe UI",Arial,sans-serif;
  background:var(--bg);
  color:var(--text);
}
.topbar{
  height:66px;background:#fff;border-bottom:1px solid var(--line);
  display:flex;align-items:center;justify-content:space-between;
  padding:0 26px;position:sticky;top:0;z-index:10
}
.brand{display:flex;align-items:center;gap:11px}
.brand-mark{
  width:40px;height:40px;border-radius:13px;background:#161f31;color:#fff;
  display:grid;place-items:center;font-weight:900;font-size:17px
}
.brand strong{display:block;font-size:16px}
.brand span{display:block;font-size:11px;color:var(--muted);margin-top:2px}
.updated{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:12px}
.updated i{width:8px;height:8px;border-radius:50%;background:var(--green)}
.container{max-width:1480px;margin:auto;padding:26px}
.summary,.broker-section{
  background:#fff;border:1px solid var(--line);border-radius:22px;
  box-shadow:var(--shadow);padding:22px
}
.summary-head,.section-head{
  display:flex;align-items:center;justify-content:space-between;gap:14px
}
.summary-head h1,.section-head h2{margin:3px 0 0}
.summary-head h1{font-size:24px}
.section-head h2{font-size:18px}
.eyebrow{font-size:10px;font-weight:800;letter-spacing:.12em;color:#939dad}
.brokers,.muted,.server{font-size:11px;color:var(--muted)}
.summary-grid{
  display:grid;grid-template-columns:repeat(6,1fr);gap:11px;margin-top:19px
}
.summary-card,.metric{
  background:#f9fbfd;border:1px solid #edf1f6;border-radius:14px;padding:13px
}
.summary-card span,.metric span{display:block;font-size:10px;color:var(--muted);margin-bottom:6px}
.summary-card strong{font-size:19px}
.positive{color:var(--green)!important}
.negative{color:var(--red)!important}
.broker-section{margin-top:18px}
.table-wrap{overflow:auto;margin-top:12px}
table{width:100%;border-collapse:collapse;min-width:720px}
th,td{padding:12px 9px;border-bottom:1px solid #eff2f6;text-align:right;font-size:12px}
th{font-size:10px;color:var(--muted);text-transform:uppercase}
th:first-child,td:first-child{text-align:left}
.broker-cell{display:flex;align-items:center;gap:9px}
.broker-logo{
  width:30px;height:30px;border-radius:9px;background:#fff;border:1px solid #e7ecf3;
  display:inline-flex;align-items:center;justify-content:center;overflow:hidden;flex:none
}
.broker-logo img{width:20px;height:20px;object-fit:contain}
.broker-logo-lg{width:44px;height:44px;border-radius:12px}
.broker-logo-lg img{width:28px;height:28px}
.broker-fallback{font-weight:900;color:#57647a;background:#f0f3f8}
.accounts-section{margin-top:26px}
.accounts-head{align-items:end}
#searchBox{
  width:260px;height:40px;border:1px solid var(--line);border-radius:12px;background:#fff;
  padding:0 13px;outline:none
}
.tabs{display:flex;gap:8px;flex-wrap:wrap;margin:15px 0}
.tab{
  border:1px solid var(--line);background:#fff;color:#687387;border-radius:999px;
  padding:9px 13px;font-size:12px;font-weight:700;cursor:pointer
}
.tab b{
  display:inline-grid;place-items:center;min-width:21px;height:21px;padding:0 5px;
  border-radius:999px;background:#f0f3f7;margin-left:5px;color:#4f5c72
}
.tab.active{background:#172033;color:#fff;border-color:#172033}
.tab.active b{background:rgba(255,255,255,.14);color:#fff}
.accounts{display:grid;grid-template-columns:repeat(3,1fr);gap:17px}
.account-card{
  background:#fff;border:1px solid var(--line);border-radius:18px;padding:16px;
  box-shadow:0 7px 24px rgba(27,42,72,.045)
}
.card-head{display:flex;justify-content:space-between;gap:10px}
.identity{display:flex;gap:10px;min-width:0;cursor:pointer}
.identity-copy{min-width:0}
.account-name{
  font-size:15px;font-weight:850;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:250px
}
.server{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:270px;margin-top:2px}
.card-actions{display:flex;align-items:flex-start;gap:6px}
.status{
  padding:5px 8px;border-radius:999px;font-size:9px;font-weight:800;white-space:nowrap
}
.status.live,.live{background:#e8faf4;color:#0f946c}
.status.stale,.stale{background:#fff6df;color:#b47a12}
.status.offline,.offline{background:#f2f4f7;color:#7b8596}
.delete-btn{
  width:28px;height:28px;border:1px solid #f1dadd;background:#fff7f8;color:#cf4c59;
  border-radius:9px;font-size:18px;line-height:1;cursor:pointer
}
.live-pnl{margin-top:18px;cursor:pointer}
.live-pnl span{display:block;font-size:10px;color:var(--muted)}
.live-pnl strong{display:block;font-size:27px;margin-top:3px}
.metrics{
  display:grid;grid-template-columns:repeat(2,1fr);gap:8px;margin-top:14px;cursor:pointer
}
.metric strong{font-size:13px}
.card-foot{
  display:grid;grid-template-columns:repeat(3,1fr);gap:5px;margin-top:12px;padding-top:11px;
  border-top:1px dashed #e8edf4;font-size:9px;color:var(--muted)
}
.card-foot span{text-align:center}
.card-foot b{display:block;color:var(--text);font-size:10px;margin-top:3px}
.empty{
  grid-column:1/-1;background:#fff;border:1px dashed #d9e0ea;border-radius:17px;
  padding:48px;text-align:center;color:var(--muted)
}
.modal-backdrop{
  position:fixed;inset:0;background:rgba(19,28,44,.48);display:none;
  align-items:center;justify-content:center;padding:18px;z-index:30
}
.modal{
  width:min(900px,96vw);max-height:90vh;overflow:auto;background:#fff;border-radius:20px;
  padding:20px;box-shadow:0 24px 80px rgba(0,0,0,.23)
}
.modal-head,.modal-title{display:flex;align-items:center}
.modal-head{justify-content:space-between}
.modal-title{gap:10px}
.close{width:36px;height:36px;border:0;background:#f1f4f7;border-radius:10px;font-size:19px;cursor:pointer}
.detail-grid{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:250px}
@media(max-width:1180px){
  .summary-grid{grid-template-columns:repeat(3,1fr)}
  .accounts{grid-template-columns:repeat(2,1fr)}
}
@media(max-width:760px){
  .container{padding:14px}
  .topbar{padding:0 14px}
  .summary-grid{grid-template-columns:repeat(2,1fr)}
  .accounts{grid-template-columns:1fr}
  .accounts-head{align-items:flex-start;flex-direction:column}
  #searchBox{width:100%}
  .detail-grid{grid-template-columns:repeat(2,1fr)}
}
