/* ==========================================================================
   Dashboard v2 — professional layout: search topbar, icon sidebar, chart,
   market overview, performance donut, bot statistics, full bots table.
   Desktop only (#app) — the mobile shell is untouched and unaffected.
   ========================================================================== */

/* ---------------- topbar: search + profile chip ---------------- */
.topbar-search {
    flex: 1; max-width: 420px; margin: 0 24px;
    display: flex; align-items: center; gap: 8px;
    background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px;
    padding: 9px 14px; color: var(--text-dim); font-size: 13px;
}
.topbar-search input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-size: 13px; font-family: inherit; }
.profile-chip { display: flex; align-items: center; gap: 10px; padding-left: 10px; margin-left: 4px; border-left: 1px solid var(--border); cursor: pointer; }
.profile-chip .avatar {
    width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg, var(--cyan), var(--green));
    display: flex; align-items: center; justify-content: center; font-weight: 800; color: #04121c; font-size: 13px;
}
.profile-chip .info { line-height: 1.3; }
.profile-chip .pname { font-size: 12.5px; font-weight: 700; color: var(--text); }
.profile-chip .prole { font-size: 10.5px; color: var(--gold); font-weight: 600; }

/* ---------------- sidebar v2 ---------------- */
#sidebar { justify-content: space-between; }
.sidebar-scroll { flex: 1; overflow-y: auto; }
.nav-item .nav-icon { font-size: 15px; width: 18px; text-align: center; flex-shrink: 0; }
.sidebar-support {
    margin: 14px 16px 4px; padding: 14px; border-radius: 12px;
    background: var(--panel-2); border: 1px solid var(--border);
}
.sidebar-support .st-title { font-size: 12.5px; font-weight: 700; margin-bottom: 3px; }
.sidebar-support .st-sub { font-size: 11px; color: var(--text-dim); line-height: 1.4; margin-bottom: 10px; }
.sidebar-support button {
    width: 100%; padding: 8px 0; border-radius: 8px; border: 1px solid var(--border);
    background: var(--panel); color: var(--text); font-size: 12px; font-weight: 600; cursor: pointer;
}
.sidebar-version { text-align: center; font-size: 10.5px; color: var(--text-dim); opacity: 0.6; padding: 10px 0 2px; }

/* ---------------- generic v2 panel ---------------- */
.v2-panel { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; }
.v2-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.v2-panel-head h3 { font-size: 14px; font-weight: 700; margin: 0; display: flex; align-items: center; gap: 8px; }
.v2-panel-head .view-all { font-size: 12px; color: var(--cyan); cursor: pointer; font-weight: 600; }

/* ---------------- dashboard grid ---------------- */
.v2-row2 { display: grid; grid-template-columns: 1.7fr 1.1fr 1.1fr; gap: 16px; margin-bottom: 20px; align-items: start; }
.v2-col-stack { display: flex; flex-direction: column; gap: 16px; }

/* performance overview */
.perf-tabs { display: flex; gap: 4px; background: var(--panel-2); border-radius: 8px; padding: 3px; }
.perf-tab { padding: 5px 11px; border-radius: 6px; font-size: 11.5px; font-weight: 600; color: var(--text-dim); cursor: pointer; }
.perf-tab.active { background: var(--panel); color: var(--cyan); }
.perf-ministats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.perf-ministat .label { font-size: 11px; color: var(--text-dim); margin-bottom: 3px; }
.perf-ministat .val { font-size: 15px; font-weight: 700; }
.perf-chart-wrap { position: relative; height: 220px; }

/* running bots */
.rb-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.rb-row:last-child { border-bottom: none; }
.rb-icon { width: 32px; height: 32px; border-radius: 9px; background: var(--panel-2); display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.rb-name { font-size: 12.5px; font-weight: 700; }
.rb-sub { font-size: 10.5px; color: var(--text-dim); margin-top: 1px; }
.rb-right { margin-left: auto; text-align: right; }
.rb-pnl { font-size: 12px; font-weight: 700; }
.rb-status { font-size: 9px; font-weight: 700; padding: 2px 7px; border-radius: 5px; margin-top: 3px; display: inline-block; }
.rb-status.on { background: var(--green-soft); color: var(--green); }
.rb-status.off { background: var(--panel-2); color: var(--text-dim); }

/* row 3: active bots performance + recent activity */
.v2-row3 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; align-items: start; }
.row-action-icon { width: 26px; height: 26px; border-radius: 6px; border: none; background: none; color: var(--text-dim); cursor: pointer; font-size: 13px; }
.row-action-icon:hover { color: var(--cyan); background: var(--panel-2); }

/* recent activity feed */
.activity-row { display: flex; gap: 11px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.activity-row:last-child { border-bottom: none; }
.activity-icon { width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.activity-body { flex: 1; min-width: 0; }
.activity-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.activity-title { font-size: 12.5px; font-weight: 700; }
.activity-time { font-size: 10px; color: var(--text-dim); flex-shrink: 0; }
.activity-detail { font-size: 11px; color: var(--text-dim); margin-top: 2px; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* quick actions */
.qa-btn {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 14px; margin-bottom: 8px;
    border-radius: 10px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text);
    font-size: 12.5px; font-weight: 600; cursor: pointer; text-align: left;
}
.qa-btn:last-child { margin-bottom: 0; }
.qa-btn:hover { border-color: var(--cyan); color: var(--cyan); }
.qa-btn.primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.qa-btn.primary:hover { color: #fff; opacity: 0.9; }

/* market overview */
.mo-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.mo-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.mo-label { font-size: 12.5px; font-weight: 700; }
.mo-right { margin-left: auto; text-align: right; }
.mo-price { font-size: 12.5px; font-weight: 700; }
.mo-change { font-size: 10.5px; font-weight: 600; }

/* performance summary donut */
.donut-wrap { display: flex; align-items: center; gap: 18px; }
.donut-canvas-box { position: relative; width: 110px; height: 110px; flex-shrink: 0; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut-center .pct { font-size: 20px; font-weight: 800; }
.donut-center .lbl { font-size: 9px; color: var(--text-dim); }
.donut-stats { flex: 1; }
.donut-stat-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 12px; border-bottom: 1px solid var(--border); }
.donut-stat-row:last-child { border-bottom: none; }
.donut-stat-row span:last-child { font-weight: 700; color: var(--text); }

/* bot statistics / trading pairs */
.v2-row5 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 20px; }
.stat-line { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.stat-line:last-child { border-bottom: none; }
.stat-line .si { font-size: 14px; width: 18px; }
.stat-line .sv { margin-left: auto; font-weight: 700; }
.pair-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }

/* full bots table */
.v2-table-wrap { overflow-x: auto; }
.v2-table-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 12px; }
.v2-search-box {
    display: flex; align-items: center; gap: 8px; background: var(--panel-2); border: 1px solid var(--border);
    border-radius: 9px; padding: 8px 12px; font-size: 12.5px; color: var(--text-dim); min-width: 240px;
}
.v2-search-box input { border: none; background: none; outline: none; color: var(--text); font-size: 12.5px; flex: 1; font-family: inherit; }
.v2-manage-btn { padding: 6px 14px; border-radius: 7px; border: 1px solid var(--cyan); color: var(--cyan); background: none; font-size: 11.5px; font-weight: 700; cursor: pointer; }
.v2-manage-btn:hover { background: var(--cyan-soft); }
.v2-pagination { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 14px; }
.v2-page-btn { width: 30px; height: 30px; border-radius: 7px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text-dim); font-size: 12px; font-weight: 600; cursor: pointer; }
.v2-page-btn.active { background: var(--cyan-soft); color: var(--cyan); border-color: var(--cyan); }
.v2-page-btn:disabled { opacity: 0.4; cursor: default; }

/* generic simple page (profile/security/alerts) */
.simple-page-card { max-width: 640px; }
