.console-body { background: var(--bg-soft); }

.app-shell { min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; width: 236px; z-index: 40;
  background: #0a0b11; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 18px 14px;
}
.sidebar .logo { padding: 2px 8px 18px; }
.side-nav { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }
.nav-group-title { font-size: 10.5px; letter-spacing: 1px; color: var(--text-mute); padding: 16px 12px 6px; font-weight: 600; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 9px;
  color: var(--text-dim); font-size: 13px; font-weight: 500;
  cursor: pointer; border: 1px solid transparent; transition: all 0.15s ease;
  background: none; width: 100%; text-align: left;
}
.nav-item svg { width: 17px; height: 17px; flex: none; opacity: 0.85; }
.nav-item:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.nav-item.active {
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.18), rgba(34, 211, 238, 0.07));
  border-color: rgba(124, 92, 255, 0.3); color: #fff;
}
.nav-item.active svg { color: #a5b4fc; opacity: 1; }
.nav-item .nav-badge { margin-left: auto; font-size: 10.5px; background: rgba(248, 113, 113, 0.16); color: #fca5a5; padding: 1px 6px; border-radius: 999px; }

.side-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.side-credit-card {
  border-radius: 12px; padding: 14px;
  background: linear-gradient(150deg, rgba(124, 92, 255, 0.2), rgba(34, 211, 238, 0.08));
  border: 1px solid rgba(124, 92, 255, 0.28);
}
.side-credit-card .label { font-size: 11px; color: rgba(255, 255, 255, 0.62); }
.side-credit-card .amount { font-size: 22px; font-weight: 750; letter-spacing: -0.5px; margin: 2px 0 2px; }
.side-credit-card .amount span { font-size: 11.5px; font-weight: 500; color: rgba(255, 255, 255, 0.6); margin-left: 3px; }
.side-credit-card .btn { margin-top: 10px; height: 30px; font-size: 12px; width: 100%; }
.side-user {
  display: flex; align-items: center; gap: 9px; padding: 9px 8px;
  border-radius: 10px; cursor: pointer; transition: background 0.15s;
}
.side-user:hover { background: rgba(255, 255, 255, 0.05); }
.side-user .meta { min-width: 0; }
.side-user .meta strong { display: block; font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user .meta span { font-size: 10.5px; color: var(--text-mute); }

/* ---------- Layout ---------- */
.main { margin-left: 236px; min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  height: 64px; padding: 0 28px; position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  background: rgba(11, 13, 20, 0.82); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.topbar-title { font-size: 14px; font-weight: 600; }
.topbar-crumb { font-size: 11.5px; color: var(--text-mute); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.credits-chip {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px;
  border-radius: 999px; cursor: pointer; font-size: 12.5px; font-weight: 600;
  background: rgba(251, 191, 36, 0.08); border: 1px solid rgba(251, 191, 36, 0.25); color: #fcd34d;
}
.credits-chip:hover { background: rgba(251, 191, 36, 0.14); }
.credits-chip svg { width: 14px; height: 14px; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03); color: var(--text-dim);
  display: grid; place-items: center; cursor: pointer;
}
.icon-btn:hover { color: #fff; border-color: var(--line-strong); }
.content { padding: 24px 28px 64px; width: 100%; max-width: 1480px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-title { font-size: 22px; font-weight: 700; letter-spacing: -0.4px; }
.page-desc { font-size: 12.5px; color: var(--text-mute); margin-top: 4px; }

.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: var(--gradient); color: #fff; font-size: 12px; font-weight: 700;
  display: grid; place-items: center; overflow: hidden;
}
.avatar.lg { width: 44px; height: 44px; font-size: 16px; }

.user-menu-wrap { position: relative; }
.user-menu {
  position: absolute; right: 0; top: 44px; width: 208px; z-index: 60;
  background: #141726; border: 1px solid var(--line-strong); border-radius: 12px;
  box-shadow: var(--shadow); padding: 6px; display: none;
}
.user-menu.open { display: block; }
.user-menu .um-head { padding: 10px 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 5px; }
.user-menu .um-head strong { display: block; font-size: 13px; }
.user-menu .um-head span { font-size: 11px; color: var(--text-mute); }
.um-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 8px 10px; border-radius: 7px; border: none; background: none; cursor: pointer;
  color: var(--text-dim); font-size: 12.5px; text-align: left;
}
.um-item:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.um-item svg { width: 15px; height: 15px; }

/* ---------- Stat cards ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat-card { padding: 18px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); position: relative; overflow: hidden; }
.stat-card .sc-label { font-size: 12px; color: var(--text-mute); display: flex; align-items: center; gap: 6px; }
.stat-card .sc-value { font-size: 26px; font-weight: 750; letter-spacing: -0.6px; margin-top: 8px; }
.stat-card .sc-value small { font-size: 12px; font-weight: 500; color: var(--text-mute); margin-left: 3px; }
.stat-card .sc-foot { font-size: 11.5px; color: var(--text-mute); margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.stat-card .sc-ico { position: absolute; right: 14px; top: 14px; width: 32px; height: 32px; border-radius: 9px; background: rgba(255, 255, 255, 0.04); display: grid; place-items: center; color: var(--text-mute); }
.stat-card.accent { background: linear-gradient(150deg, rgba(124, 92, 255, 0.16), rgba(15, 17, 26, 0.9)); border-color: rgba(124, 92, 255, 0.28); }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); }
table.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table thead th {
  text-align: left; font-weight: 600; font-size: 11.5px; color: var(--text-mute);
  padding: 12px 14px; background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table tbody td { padding: 13px 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.045); color: var(--text-dim); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: rgba(255, 255, 255, 0.018); }
.table .strong { color: var(--text); font-weight: 600; }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; }
.table .cell-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.table .cell-main .meta { min-width: 0; }
.table .cell-main .meta strong { display: block; color: var(--text); font-weight: 600; font-size: 12.5px; }
.table .cell-main .meta span { font-size: 11px; color: var(--text-mute); }

/* ---------- Toolbar ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.search-box { position: relative; }
.search-box svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--text-mute); }
.search-box .input { padding-left: 34px; width: 240px; }
.seg { display: inline-flex; gap: 2px; padding: 3px; background: rgba(255, 255, 255, 0.05); border-radius: 9px; }
.seg button {
  border: none; background: transparent; color: var(--text-mute); font-size: 12px;
  padding: 5px 11px; border-radius: 7px; cursor: pointer; font-weight: 500;
}
.seg button.active { background: var(--panel-3); color: #fff; }

/* ---------- Charts ---------- */
.chart-box { padding: 18px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.chart-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.chart-head h3 { font-size: 13.5px; font-weight: 600; }
.chart-legend { display: flex; gap: 14px; font-size: 11px; color: var(--text-mute); }
.chart-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }
.chart-svg { width: 100%; height: 190px; display: block; }

.progress { height: 5px; border-radius: 4px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 4px; background: var(--gradient); transition: width 0.3s; }

/* ---------- Mobile ---------- */
.mobile-toggle { display: none; }
@media (max-width: 1080px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .sidebar {
    width: 100%; height: auto; bottom: auto; right: 0; border-right: none;
    border-bottom: 1px solid var(--line); padding: 10px 14px;
    flex-direction: row; align-items: center; gap: 10px;
  }
  .sidebar .logo { padding: 0; }
  .side-nav { flex-direction: row; overflow-x: auto; margin: 0; gap: 2px; }
  .nav-group-title, .side-bottom { display: none; }
  .nav-item { white-space: nowrap; padding: 7px 10px; }
  .nav-item span { display: none; }
  .nav-item svg { width: 18px; height: 18px; }
  .main { margin-left: 0; margin-top: 57px; }
  .content { padding: 18px 16px 50px; }
  .topbar { height: 56px; padding: 0 16px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .search-box .input { width: 160px; }
}
