@import url('./sidebar-brand.css?v=20260818-1');

:root {
  --bg: #070b10;
  --bg-soft: #0b1219;
  --panel: #0f1822;
  --panel-2: #111d29;
  --line: #1d2a36;
  --text: #f2f4f7;
  --muted: #9aa6b2;
  --orange: #ff7a00;
  --orange-soft: rgba(255, 122, 0, 0.16);
  --green: #39d36a;
  --red: #ff4b4b;
  --yellow: #f6b73c;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { min-width: 320px; }
button, select { font: inherit; }

.app-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; border-right: 1px solid var(--line); background: linear-gradient(180deg, #080d13 0%, #071019 100%); padding: 24px 16px; display: flex; flex-direction: column; }
.brand { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 32px; }
.brand-mark { width: 120px; aspect-ratio: 1; border-radius: 50%; border: 2px solid var(--orange); display: grid; place-items: center; font-size: 40px; font-weight: 800; letter-spacing: -4px; background: radial-gradient(circle at 50% 35%, #161d25 0%, #090d12 65%); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), 0 0 24px rgba(255,122,0,.08); }
.brand-logo { width: 104px; height: auto; max-height: 104px; object-fit: contain; border-radius: 0; border: 0; box-shadow: none; background: transparent; display: block; }
.brand-name { font-size: 22px; font-weight: 700; }
.brand-name span { color: var(--orange); }
.nav { display: flex; flex-direction: column; gap: 8px; }
.nav-item { color: #c6cdd5; text-decoration: none; border: 1px solid transparent; padding: 12px 14px; border-radius: 10px; }
.nav-item:hover { background: #0d151e; }
.nav-item.active { background: linear-gradient(90deg, rgba(255,122,0,.35), rgba(255,122,0,.15)); border-color: rgba(255,122,0,.65); color: #fff; }
.nav-item.folder-open { margin-bottom: -4px; }
.account-subnav { position: relative; display: flex; flex-direction: column; gap: 3px; margin: 0 0 3px 18px; padding: 3px 0 5px 13px; border-left: 1px solid rgba(198,205,213,.28); }
.account-subnav-item { display: flex; align-items: center; gap: 7px; min-width: 0; padding: 7px 8px 7px 0; border-radius: 7px; color: #9fb0bf; text-decoration: none; font-size: 12px; }
.account-subnav-item:hover { color: #fff; background: rgba(255,255,255,.04); }
.account-subnav-item.active { color: #fff; background: rgba(20,120,212,.22); }
.account-tree-marker { flex: 0 0 auto; width: 15px; color: #60778c; transform: translateX(-1px); }
.account-subnav-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.account-subnav-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; }
.account-subnav-text small { margin-top: 2px; color: #70869a; font-size: 10px; }
.account-subnav-group { margin: 6px 0 2px 15px; color: #678096; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.account-subnav-loading,.account-subnav-empty { padding: 6px 8px 6px 15px; color: #70869a; font-size: 10px; }
.app-version { margin: 12px 14px 0; color: #718093; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.sidebar-footer { margin-top: auto; display: grid; gap: 14px; }
.user-card { display: flex; gap: 10px; align-items: center; padding: 12px; background: #0d151e; border: 1px solid var(--line); border-radius: 12px; }
.user-avatar { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--orange); display: grid; place-items: center; color: var(--orange); }
.user-card small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.text-button { border: 0; background: transparent; color: var(--muted); text-align: left; padding: 8px; cursor: pointer; }

.content { padding: 0 22px 22px; min-width: 0; }
.topbar { min-height: 88px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.topbar h1 { margin: 0; font-size: 28px; }
.topbar p { margin: 4px 0 0; color: var(--muted); }
.topbar-actions { display: flex; gap: 12px; align-items: center; }
.date-range, .profile-button { border: 1px solid var(--line); background: #0a1118; color: var(--text); border-radius: 10px; padding: 10px 14px; }
.profile-button { cursor: pointer; }

.kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 12px; margin: 18px 0; }
.kpi-card { padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(180deg, var(--panel) 0%, #0c151e 100%); min-height: 118px; }
.kpi-label { display: block; color: var(--muted); margin-bottom: 14px; }
.kpi-card strong { display: block; font-size: clamp(20px, 2vw, 28px); margin-bottom: 8px; }
.kpi-card small { color: var(--muted); }
.positive { color: var(--green) !important; }
.negative { color: var(--red) !important; }
.warning { color: var(--yellow) !important; }
.online { color: var(--green) !important; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); display: inline-block; margin-right: 6px; }

.panel { border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(180deg, var(--panel) 0%, #0b141d 100%); margin-bottom: 16px; overflow: hidden; }
.panel-header { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 18px; }
.panel-header h2 { margin: 0; font-size: 20px; }
.panel-header h2 span { color: var(--muted); font-weight: 400; }
.panel-header select { background: #0a1118; color: var(--text); border: 1px solid var(--line); border-radius: 9px; padding: 9px 34px 9px 12px; }
.panel-subtitle { color: var(--muted); margin: 5px 0 0; font-size: 13px; }
.chart-panel { width: 100%; }
.chart-wrap { height: 360px; padding: 0 18px 18px; }
#equityChart, #accountEquityChart { width: 100%; height: 100%; display: block; }
.link-button { border: 0; background: transparent; color: var(--orange); cursor: pointer; }
.table-wrap { overflow-x: auto; padding: 0 18px 12px; }
table { width: 100%; border-collapse: collapse; min-width: 850px; }
th, td { border-bottom: 1px solid var(--line); text-align: left; padding: 14px 10px; }
thead th { color: var(--muted); font-weight: 500; }
tfoot th, tfoot td { border-bottom: 0; }
.status-online { display: inline-flex; align-items:center; gap:7px; }
.status-online::before { content:""; width:9px; height:9px; border-radius:50%; background:var(--green); }
.account-link { color:var(--text); text-decoration:none; font-weight:600; }
.account-link:hover { color:var(--orange); }

.account-topbar { min-height:112px; }
.back-link { color:var(--orange); font-size:13px; text-decoration:none; display:inline-block; margin-bottom:6px; }
.account-live { border:1px solid var(--line); border-radius:10px; background:#0a1118; padding:10px 14px; text-align:right; min-width:220px; }
.account-live span { display:block; color:var(--muted); font-size:12px; margin-bottom:4px; }
.account-live strong { font-size:14px; }
.period-switch { display:inline-flex; gap:6px; padding:6px; margin:18px 0 0; border:1px solid var(--line); border-radius:12px; background:#0a1118; }
.period-button { min-width:88px; border:1px solid transparent; background:transparent; color:var(--muted); padding:9px 15px; border-radius:8px; cursor:pointer; }
.period-button:hover { color:var(--text); }
.period-button.active { color:#fff; background:linear-gradient(180deg,#d86200,#a94700); border-color:rgba(255,122,0,.7); }
.account-kpi-grid { margin-top:14px; }
.account-chart-wrap { height:390px; }
.detail-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.detail-panel { min-height:300px; }
.metric-list { padding:0 18px 16px; }
.metric-list > div { min-height:40px; display:flex; align-items:center; justify-content:space-between; gap:18px; border-top:1px solid var(--line); }
.metric-list > div:first-child { border-top:0; }
.metric-list span { color:var(--muted); }
.metric-list strong { text-align:right; }
.risk-badge { display:inline-flex; align-items:center; padding:5px 10px; border-radius:999px; font-size:12px; font-weight:700; letter-spacing:.04em; }
.risk-badge.normal { color:var(--green); background:rgba(57,211,106,.10); border:1px solid rgba(57,211,106,.35); }
.period-table { min-width:980px; }

.footer { display:flex; justify-content:space-between; color:var(--muted); border-top:1px solid var(--line); padding:18px 4px 0; font-size:14px; }

@media (max-width:1100px) {
  .app-shell { grid-template-columns:80px minmax(0,1fr); }
  .brand-name, .nav-item, .user-card div:not(.user-avatar), .text-button, .app-version { font-size:0; }
  .brand-mark { width:52px; height:52px; font-size:18px; letter-spacing:-2px; }
  .brand-logo { width:52px; height:auto; max-height:52px; }
  .nav-item { min-height:44px; }
  .account-subnav { display:none; }
  .kpi-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .kpi-grid .kpi-card:last-child { grid-column:span 2; }
  .detail-grid { grid-template-columns:1fr; }
}

@media (max-width:720px) {
  .app-shell { display:block; }
  .sidebar { position:sticky; top:0; z-index:50; width:100%; height:auto; display:block; padding:8px 10px; border-right:0; border-bottom:1px solid var(--line); overflow:hidden; }
  .brand { display:none; }
  .nav { flex-direction:row; gap:6px; overflow-x:auto; overscroll-behavior-x:contain; scrollbar-width:none; padding-bottom:2px; }
  .nav::-webkit-scrollbar { display:none; }
  body.mobile-ui .nav-item { flex:0 0 auto; display:inline-flex; align-items:center; min-height:40px; padding:8px 11px; font-size:12px; line-height:1; white-space:nowrap; border-radius:9px; }
  body.mobile-ui .admin-nav-root, body.mobile-ui .admin-subnav { display:none!important; }
  body.mobile-ui .account-subnav { display:none!important; }
  .sidebar-footer, .app-version { display:none; }
  .content { padding:0 10px 16px; }
  .topbar { min-height:auto; align-items:flex-start; padding:14px 2px; flex-direction:column; gap:10px; }
  .topbar h1 { font-size:23px; }
  .topbar p { font-size:13px; }
  .topbar-actions { width:100%; justify-content:space-between; flex-wrap:wrap; }
  .date-range, .profile-button { padding:8px 10px; font-size:13px; }
  .account-live { width:100%; text-align:left; min-width:0; }
  .period-switch { display:grid; grid-template-columns:repeat(4,1fr); width:100%; margin-top:10px; }
  .period-button { min-width:0; padding:8px 4px; font-size:12px; }
  .kpi-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin:12px 0; }
  .kpi-grid .kpi-card:last-child { grid-column:auto; }
  .kpi-card { min-height:96px; padding:12px; }
  .kpi-label { margin-bottom:8px; font-size:12px; }
  .kpi-card strong { font-size:19px; margin-bottom:5px; }
  .kpi-card small { font-size:11px; }
  .panel { border-radius:10px; margin-bottom:10px; }
  .panel-header { min-height:52px; padding:10px 12px; align-items:flex-start; }
  .panel-header h2 { font-size:16px; }
  .panel-subtitle { font-size:11px; }
  .chart-wrap, .account-chart-wrap { height:245px; padding:0 6px 8px; }
  .detail-grid { gap:10px; }
  .metric-list { padding:0 12px 12px; }
  .metric-list > div { min-height:38px; font-size:13px; }
  .table-wrap { padding:0 8px 10px; -webkit-overflow-scrolling:touch; }
  th, td { padding:10px 8px; font-size:12px; }
  .footer { flex-direction:column; gap:8px; font-size:12px; }
}

@media (max-width:430px) {
  .kpi-grid { grid-template-columns:1fr; }
  .topbar h1 { font-size:21px; }
  body.mobile-ui .nav-item { padding:8px 10px; font-size:11px; }
}
