
:root {
  --bg: #0b0e14;
  --sidebar: #0f131b;
  --panel: #131923;
  --panel-hover: #19212d;
  --border: #252e3b;
  --text: #e7ebf2;
  --muted: #8994a5;
  --green: #24c78b;
  --red: #f16b75;
  --blue: #5c91ff;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}

button, a {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 245px;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 25px 17px;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 19px;
  font-weight: 750;
  padding: 0 8px;
  margin-bottom: 48px;
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #315fbd;
  color: white;
  font-weight: 800;
}

.brand-light {
  color: var(--muted);
  font-weight: 500;
}

.sidebar-label {
  color: #687587;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 1.4px;
  padding: 0 10px;
  margin-bottom: 13px;
}

.secondary-label {
  margin-top: 35px;
}

.navigation {
  display: grid;
  gap: 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 11px;
  border-radius: 8px;
  color: #9ba6b6;
  transition: 0.2s;
}

.nav-link:hover,
.nav-link.active {
  background: #1b2636;
  color: #fff;
}

.nav-link.active {
  box-shadow: inset 3px 0 var(--blue);
}

.nav-icon {
  width: 19px;
  text-align: center;
  font-size: 17px;
}

.sidebar-bottom {
  margin-top: auto;
}

.user-profile {
  border-top: 1px solid var(--border);
  padding: 18px 3px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #263b5e;
  color: #c4d8ff;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.user-info {
  display: grid;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.user-info strong {
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-info span {
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logout-button {
  color: var(--muted);
  background: transparent;
  border: 0;
  font-size: 20px;
}

.main-content {
  margin-left: 245px;
  padding: 0 36px 30px;
  max-width: 1800px;
}

.topbar {
  min-height: 91px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.topbar-left,
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.breadcrumb {
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 5px;
}

.topbar h1 {
  font-size: 21px;
  font-weight: 700;
}

.live-indicator {
  color: var(--muted);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px #24c78b77;
}

.button {
  border: 0;
  border-radius: 7px;
  padding: 11px 16px;
  font-weight: 650;
  transition: 0.2s;
}

.button-primary {
  color: white;
  background: #3269ce;
}

.button-primary:hover {
  background: #427de5;
}

.mobile-menu {
  display: none;
  color: var(--text);
  background: transparent;
  border: 0;
  font-size: 22px;
}

.welcome-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 32px 0 25px;
}

.welcome-section h2 {
  font-size: 18px;
  margin-bottom: 7px;
}

.welcome-section p,
.date-display {
  color: var(--muted);
  font-size: 12px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 17px;
  margin-bottom: 20px;
}

.stat-card,
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.stat-card {
  padding: 19px;
  min-height: 139px;
}

.stat-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.stat-icon {
  color: #86aaff;
  font-size: 19px;
}

.stat-value {
  font-size: 27px;
  font-weight: 750;
  margin: 17px 0 6px;
  letter-spacing: -0.7px;
}

.stat-description {
  color: #718096;
  font-size: 11px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.7fr);
  gap: 17px;
  margin-bottom: 17px;
}

.panel {
  padding: 20px;
  min-width: 0;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.panel-header h3 {
  font-size: 14px;
  margin-bottom: 6px;
}

.panel-header p {
  color: var(--muted);
  font-size: 11px;
}

.performance-list {
  display: grid;
}

.performance-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid #222b37;
  color: #aab4c2;
  font-size: 12px;
}

.performance-row:last-child {
  border-bottom: 0;
}

.performance-row strong {
  color: var(--text);
  font-size: 12px;
}

.positive {
  color: var(--green) !important;
}

.negative {
  color: var(--red) !important;
}

.text-link {
  color: #83aaff;
  font-size: 11px;
  white-space: nowrap;
}

.table-wrapper {
  overflow-x: auto;
}

.trades-table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
  text-align: left;
}

.trades-table th {
  color: #738096;
  font-size: 10px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0 12px 13px;
}

.trades-table td {
  padding: 14px 12px;
  border-top: 1px solid #222b37;
  font-size: 11px;
}

.trades-table tbody tr:hover {
  background: var(--panel-hover);
}

.empty-cell {
  text-align: center;
  color: var(--muted);
  padding: 35px 10px !important;
}

.direction-badge,
.outcome-badge {
  display: inline-block;
  padding: 5px 8px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
}

.badge-long,
.badge-win {
  background: #123b30;
  color: #45d8a4;
}

.badge-short,
.badge-loss {
  background: #42232b;
  color: #ff8992;
}

.badge-neutral {
  background: #303746;
  color: #bdc5d2;
}

.bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 17px;
}

.summary-placeholder {
  color: var(--muted);
  font-size: 12px;
  padding: 10px 0;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #222b37;
  font-size: 12px;
}

.summary-row:last-child {
  border-bottom: 0;
}

.dashboard-footer {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  color: #647084;
  font-size: 10px;
  padding: 27px 3px 0;
}

.loading-message,
.error-message {
  padding: 22px;
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  margin: 20px 0;
}

.error-message {
  color: var(--red);
  border: 1px solid #63313b;
}

.hidden {
  display: none !important;
}

@media (max-width: 1100px) {
  .main-content {
    padding-left: 24px;
    padding-right: 24px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
    padding: 0 15px 25px;
  }

  .topbar {
    min-height: 75px;
  }

  .mobile-menu {
    display: block;
  }

  .live-indicator {
    display: none;
  }

  .topbar h1 {
    font-size: 18px;
  }

  .button-primary {
    padding: 10px 11px;
    font-size: 11px;
  }

  .welcome-section {
    align-items: flex-start;
    flex-direction: column;
    margin-top: 25px;
  }

  .stats-grid {
    gap: 10px;
  }

  .stat-card {
    padding: 14px;
    min-height: 125px;
  }

  .stat-value {
    font-size: 23px;
  }

  .panel {
    padding: 15px;
  }

  .bottom-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-footer {
    flex-direction: column;
  }
}
