body { min-height: 100vh; }
.sim-banner { display: flex; align-items: center; justify-content: center; gap: 10px; background: #07090C; border-bottom: 1px solid var(--line); color: #8E98A8; font-family: var(--mono); font-size: 11.5px; letter-spacing: .04em; padding: 8px 16px; text-align: center; }
.sb-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 8px var(--warn); flex: none; }
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: calc(100vh - 34px); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--white); font-family: var(--display); font-weight: 700; font-size: 19px; text-decoration: none !important; }

.sidebar { border-right: 1px solid var(--line); padding: 22px 14px; display: flex; flex-direction: column; gap: 28px; position: sticky; top: 0; height: calc(100vh - 34px); background: #07090C; }
.sidebar .brand { padding: 0 8px; }
#nav { display: flex; flex-direction: column; gap: 2px; }
#nav button { background: none; border: 0; text-align: left; padding: 9px 12px; border-radius: 9px; color: #8A94A3; font-weight: 500; font-size: 14px; cursor: pointer; display: flex; gap: 11px; align-items: center; position: relative; transition: color .15s, background .15s; }
#nav .ic { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; opacity: .9; }
#nav .count { margin-left: auto; }
#nav button:hover { color: #fff; background: rgba(255,255,255,.03); }
#nav button.active { color: #fff; background: rgba(255,255,255,.05); }
#nav button.active::before { content: ''; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 2px; border-radius: 2px; background: var(--azure); box-shadow: 0 0 10px var(--azure); }
#nav button.active .ic { color: var(--azure); }
.count { background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 7px; }
.side-foot { margin-top: auto; }

.main { min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 32px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: rgba(5, 6, 8, .78); backdrop-filter: blur(16px) saturate(140%); z-index: 5; flex-wrap: wrap; }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.topbar h1 { font-size: 19px; font-weight: 600; letter-spacing: -0.03em; }
.view { padding: 28px 32px 72px; outline: none; max-width: 1560px; }

.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 34px; height: 20px; border-radius: 999px; background: var(--line-2); position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + .track { background: var(--azure); }
.switch input:checked + .track::after { transform: translateX(14px); }
.switch input:focus-visible + .track { outline: 2px solid var(--azure); outline-offset: 2px; }

.grid { display: grid; gap: 16px; }
.kpis { grid-template-columns: repeat(4, 1fr); }
.two { grid-template-columns: 1.4fr 1fr; align-items: start; }
.card { background: linear-gradient(180deg, #0C0F14 0%, #090B0F 100%); border: 1px solid var(--line); border-radius: 14px; padding: 20px; min-width: 0; box-shadow: inset 0 1px 0 rgba(255,255,255,.035), 0 20px 40px -24px rgba(0,0,0,.8); }
.card h2 { font-size: 15.5px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 4px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head p { color: var(--muted); font-size: 13px; }
.kpi { position: relative; overflow: hidden; }
.kpi .label { color: #7D8796; font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.kpi .value { font-family: var(--display); font-weight: 600; font-size: 30px; letter-spacing: -0.03em; color: #fff; margin-top: 10px; font-variant-numeric: tabular-nums; position: relative; }
.kpi .value .mono { font-family: var(--display); }
.spark { position: absolute; left: 0; right: 0; bottom: 0; height: 34px; opacity: .85; width: 100%; pointer-events: none; }
.spark path.l { fill: none; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.spark path.a { stroke: none; }
.kpi .sub { color: #7D8796; font-size: 12.5px; margin-top: 4px; position: relative; }
.stack { display: grid; gap: 16px; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; color: #6E7887; font-family: var(--mono); font-weight: 500; font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: rgba(255,255,255,.015); }
tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
td.num, th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.acct-name { font-weight: 600; color: var(--white); }
.acct-sub { color: var(--muted); font-size: 12px; }
.role { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; margin-left: 6px; vertical-align: middle; }
.role.leader { background: rgba(46,155,255,.14); color: #8CCBFF; box-shadow: inset 0 0 0 1px rgba(46,155,255,.35); }
.role.follower { background: rgba(255,255,255,.05); color: #B7C0CC; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }

.group-map { display: grid; gap: 8px; }
.gm-leader { border: 1px solid rgba(46,155,255,.3); background: linear-gradient(90deg, rgba(46,155,255,.1), rgba(46,155,255,.02)); border-radius: 10px; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.gm-follower { border: 1px solid var(--line); background: rgba(255,255,255,.012); border-radius: 10px; padding: 12px 16px; display: grid; grid-template-columns: 1.3fr 1.15fr .8fr .9fr auto; align-items: center; gap: 12px; margin-left: 22px; position: relative; }
.gm-follower::before { content: ''; position: absolute; left: -16px; top: 50%; width: 12px; border-top: 1px dashed var(--azure-line); }
.gm-follower.drift { border-color: rgba(245, 184, 65, .5); }
.gm-follower.offline { border-color: rgba(255, 90, 95, .5); }
.gm-follower.disabled { opacity: .55; }
.positions { font-family: var(--mono); font-size: 13px; }

.log { font-size: 13px; }
.log-row { display: grid; grid-template-columns: 76px 18px 1fr auto; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line); align-items: start; }
.log-row:last-child { border-bottom: 0; }
.log-row .t { color: var(--muted); font-family: var(--mono); font-size: 12px; padding-top: 1px; }
.lvl { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; background: var(--muted); }
.lvl.success { background: var(--ok); } .lvl.warn { background: var(--warn); } .lvl.error { background: var(--bad); } .lvl.info { background: var(--azure); }
.log-row .meta { color: var(--muted); font-family: var(--mono); font-size: 12px; white-space: nowrap; text-align: right; }
.log-scroll { max-height: 520px; overflow-y: auto; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.ticket { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; align-items: end; }
.ticket .btns { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
.btn-buy { background: var(--azure); border-color: var(--azure); color: #fff; }
.btn-sell { background: #fff; border-color: #fff; color: var(--black); }

label.field { display: grid; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 500; }
input[type=text], input[type=number], input[type=time], input[type=search], select {
  background: var(--black); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 8px 10px; color: var(--text); width: 100%; min-width: 0;
}
input:focus, select:focus { border-color: var(--azure); outline: none; box-shadow: 0 0 0 3px var(--azure-soft); }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; color: var(--text); cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--azure); }
.hint { color: var(--muted); font-size: 12.5px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.error-text { color: #FF8A8E; font-size: 13px; min-height: 18px; }

.follower-edit { display: grid; grid-template-columns: auto 1.5fr .8fr 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.follower-edit:last-of-type { border-bottom: 0; }
.toggles { display: grid; gap: 10px; margin: 14px 0; }

dialog { background: #0C0F14; color: var(--text); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: 0 40px 100px -20px rgba(0,0,0,.9); padding: 0; width: min(560px, calc(100% - 32px)); max-height: calc(100vh - 48px); }
dialog::backdrop { background: rgba(2, 3, 5, .7); backdrop-filter: blur(4px); }
#modal-form { padding: 22px; display: grid; gap: 16px; }
.modal-head h2 { font-size: 19px; }
.modal-head p { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

.check-list { display: grid; gap: 8px; }
.check-item { display: grid; grid-template-columns: 24px 1fr; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.check-item .ic { font-weight: 700; }
.check-item.ok .ic { color: var(--ok); } .check-item.warn .ic { color: var(--warn); } .check-item.error .ic { color: var(--bad); }
.check-item .d { color: var(--muted); font-size: 13px; }
.banner { border-radius: var(--radius); padding: 14px 16px; font-weight: 600; margin-bottom: 16px; display: flex; gap: 10px; align-items: center; }
.banner.ok { background: rgba(61, 214, 140, .08); border: 1px solid rgba(61, 214, 140, .35); color: var(--ok); }
.banner.bad { background: rgba(255, 90, 95, .08); border: 1px solid rgba(255, 90, 95, .4); color: #FF8A8E; }
.banner.warn { background: rgba(245, 184, 65, .08); border: 1px solid rgba(245, 184, 65, .35); color: var(--warn); }

#toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 50; max-width: min(380px, calc(100% - 32px)); }
.toast { background: rgba(16, 20, 27, .92); backdrop-filter: blur(12px); border: 1px solid var(--line-2); border-left: 2px solid var(--azure); padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13.5px; box-shadow: 0 8px 24px rgba(0, 0, 0, .4); animation: in .18s ease-out; }
.toast.error { border-left-color: var(--bad); } .toast.success { border-left-color: var(--ok); } .toast.warn { border-left-color: var(--warn); }
@keyframes in { from { transform: translateY(8px); opacity: 0; } }
.empty { color: var(--muted); text-align: center; padding: 28px 10px; }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .two { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--line); gap: 12px; overflow-x: auto; }
  #nav { flex-direction: row; }
  #nav button { white-space: nowrap; }
  #nav button.active { box-shadow: inset 0 -2px 0 var(--azure); }
  .side-foot { display: none; }
  .sidebar .brand span { display: none; }
  .topbar { padding: 12px 16px; position: static; }
  .view { padding: 16px 16px 48px; }
  .gm-follower { grid-template-columns: 1fr 1fr; margin-left: 10px; }
  .follower-edit { grid-template-columns: auto 1fr 1fr; }
  .ticket { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .log-row { grid-template-columns: 64px 12px 1fr; }
  .log-row .meta { grid-column: 3; text-align: left; white-space: normal; }
}
@media (max-width: 520px) { .kpis { grid-template-columns: 1fr 1fr; } .kpi .value { font-size: 22px; } }

/* premium details */
body { background: #050608; }
.main { background: radial-gradient(1200px 500px at 70% -10%, rgba(46,155,255,.06), transparent 60%); }
.pill { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; font-weight: 500; padding: 4px 10px; }
.btn-buy { box-shadow: 0 8px 20px -10px rgba(46,155,255,.8); }
.btn-buy:hover { background: var(--azure-strong); }
.btn-sell:hover { background: #EAF4FF; }
.positions { font-size: 12.5px; }
.log-row { padding: 9px 4px; }
.log-row .t { color: #5E6876; }
input[type=text], input[type=number], input[type=time], input[type=search], select { background: #07090C; border-color: rgba(255,255,255,.1); border-radius: 9px; padding: 9px 11px; }
