/* ================================================
   TRADING SYSTEM - Main Stylesheet
   ================================================ */

/* CSS Variables - Dark Trading Theme */
:root {
  --background: #09090b;
  --foreground: #fafafa;
  --card: #0a0a0c;
  --card-foreground: #fafafa;
  --popover: #0a0a0c;
  --popover-foreground: #fafafa;
  --primary: #3b82f6;
  --primary-foreground: #fafafa;
  --secondary: #1e293b;
  --secondary-foreground: #fafafa;
  --muted: #1e293b;
  --muted-foreground: #94a3b8;
  --accent: #1e40af;
  --accent-foreground: #fafafa;
  --destructive: #ef4444;
  --destructive-foreground: #fafafa;
  --success: #22c55e;
  --success-foreground: #fafafa;
  --border: #1e293b;
  --input: #1e293b;
  --ring: #3b82f6;
  --radius: 0.5rem;
}

/* Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.5;
  min-height: 100vh;
}

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

/* ================================================
   LAYOUT
   ================================================ */

.app-container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  background-color: var(--card);
  border-right: 1px solid var(--border);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
}

.main-content {
  flex: 1;
  margin-left: 240px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.header {
  height: 64px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  background-color: var(--card);
  position: sticky;
  top: 0;
  z-index: 10;
}

.page-content {
  flex: 1;
  padding: 1.5rem;
}

/* ================================================
   SIDEBAR
   ================================================ */

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 0.5rem;
  margin-bottom: 2rem;
}

.sidebar-logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-logo-icon svg {
  width: 20px;
  height: 20px;
  color: white;
}

.sidebar-logo-text {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--foreground);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-section {
  margin-bottom: 1.5rem;
}

.sidebar-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0 0.75rem;
  margin-bottom: 0.5rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius);
  color: var(--muted-foreground);
  transition: all 0.15s ease;
}

.sidebar-link:hover {
  background-color: var(--secondary);
  color: var(--foreground);
}

.sidebar-link.active {
  background-color: var(--primary);
  color: var(--primary-foreground);
}

.sidebar-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-link span {
  font-size: 0.875rem;
  font-weight: 500;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* ================================================
   HEADER
   ================================================ */

.header-title {
  font-size: 1.25rem;
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.header-user:hover {
  background-color: var(--secondary);
}

.header-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
}

.header-user-info {
  display: flex;
  flex-direction: column;
}

.header-user-name {
  font-size: 0.875rem;
  font-weight: 500;
}

.header-user-email {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* ================================================
   CARDS
   ================================================ */

.card {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--foreground);
}

.card-description {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-top: 0.25rem;
}

.card-content {
  padding: 1.25rem;
}

/* Stat Cards */
.stat-card {
  padding: 1.25rem;
}

.stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.stat-card-label {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  font-weight: 500;
}

.stat-card-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background-color: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-card-icon svg {
  width: 18px;
  height: 18px;
  color: var(--primary);
}

.stat-card-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 0.25rem;
}

.stat-card-change {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.stat-card-change.positive {
  color: var(--success);
}

.stat-card-change.negative {
  color: var(--destructive);
}

/* ================================================
   GRID LAYOUTS
   ================================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stats-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.two-column-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* Mobile Menu Button */
.mobile-menu-btn {
  display: none;
  padding: 0.5rem;
  background: transparent;
  border: none;
  color: var(--foreground);
  cursor: pointer;
}

.mobile-menu-btn svg {
  width: 24px;
  height: 24px;
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 40;
}

.sidebar-overlay.active {
  display: block;
}

/* Tablet Breakpoint */
@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }

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

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

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

/* Mobile Breakpoint */
@media (max-width: 768px) {
  .mobile-menu-btn {
    display: flex;
  }

  .sidebar {
    position: fixed;
    left: -100%;
    top: 0;
    height: 100vh;
    z-index: 50;
    transition: left 0.3s ease;
  }

  .sidebar.open {
    left: 0;
  }

  .main-content {
    margin-left: 0;
  }

  .header {
    padding: 0 1rem;
  }

  .header-title {
    font-size: 1rem;
  }

  .header-user-info {
    display: none;
  }

  .page-content {
    padding: 1rem;
  }

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

  .two-column-grid {
    grid-template-columns: 1fr;
  }

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

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .picker-container {
    width: 100%;
    justify-content: center;
  }

  .stat-card-value {
    font-size: 1.25rem;
  }

  .chart-container {
    height: 250px;
  }

  .table th,
  .table td {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
  }

  .account-details {
    grid-template-columns: 1fr;
  }

  .heatmap-grid {
    gap: 2px;
  }

  .heatmap-cell {
    font-size: 0.5rem;
  }
}

/* Small Mobile Breakpoint */
@media (max-width: 480px) {
  .stats-grid,
  .stats-grid-4 {
    grid-template-columns: 1fr;
  }

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

  .picker-display {
    min-width: 140px;
    font-size: 0.75rem;
  }

  .stat-card {
    padding: 1rem;
  }

  .stat-card-value {
    font-size: 1.125rem;
  }

  .stat-card-label {
    font-size: 0.75rem;
  }

  .card-header {
    padding: 0.75rem 1rem;
  }

  .card-content {
    padding: 1rem;
  }

  .chart-container {
    height: 200px;
  }

  .login-card {
    padding: 1rem;
  }
}

/* ================================================
   TABLES
   ================================================ */

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

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.table th {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background-color: var(--secondary);
}

.table td {
  font-size: 0.875rem;
}

.table tbody tr:hover {
  background-color: var(--secondary);
}

/* ================================================
   BUTTONS
   ================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--primary-foreground);
}

.btn-primary:hover {
  background-color: #2563eb;
}

.btn-secondary {
  background-color: var(--secondary);
  color: var(--secondary-foreground);
}

.btn-secondary:hover {
  background-color: #334155;
}

.btn-ghost {
  background-color: transparent;
  color: var(--muted-foreground);
}

.btn-ghost:hover {
  background-color: var(--secondary);
  color: var(--foreground);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
}

/* ================================================
   FORM ELEMENTS
   ================================================ */

.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
  margin-bottom: 0.5rem;
}

.form-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  background-color: var(--input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--foreground);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.form-input::placeholder {
  color: var(--muted-foreground);
}

/* Date/Month/Year Pickers */
.picker-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.picker-btn {
  padding: 0.5rem;
  background-color: var(--secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--foreground);
  cursor: pointer;
  transition: all 0.15s ease;
}

.picker-btn:hover {
  background-color: var(--muted);
}

.picker-display {
  padding: 0.5rem 1rem;
  background-color: var(--secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  min-width: 180px;
  text-align: center;
}

/* ================================================
   BADGES
   ================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
}

.badge-success {
  background-color: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.badge-destructive {
  background-color: rgba(239, 68, 68, 0.15);
  color: var(--destructive);
}

.badge-primary {
  background-color: rgba(59, 130, 246, 0.15);
  color: var(--primary);
}

.badge-secondary {
  background-color: var(--secondary);
  color: var(--muted-foreground);
}

/* ================================================
   CHARTS
   ================================================ */

.chart-container {
  position: relative;
  height: 300px;
  width: 100%;
}

.chart-container.small {
  height: 200px;
}

/* ================================================
   METRICS
   ================================================ */

.metric-item {
  padding: 1rem;
  background-color: var(--secondary);
  border-radius: var(--radius);
}

.metric-label {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  margin-bottom: 0.375rem;
}

.metric-value {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--foreground);
}

/* ================================================
   ACCOUNT CARDS
   ================================================ */

.account-card {
  cursor: pointer;
  transition: all 0.15s ease;
}

.account-card:hover {
  border-color: var(--primary);
}

.account-card.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.account-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.account-name {
  font-size: 1rem;
  font-weight: 600;
}

.account-badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
  background-color: var(--secondary);
  color: var(--muted-foreground);
}

.account-equity {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.account-details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.account-detail-item {
  display: flex;
  flex-direction: column;
}

.account-detail-label {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.account-detail-value {
  font-size: 0.875rem;
  font-weight: 500;
}

/* ================================================
   HEATMAP
   ================================================ */

.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.heatmap-header {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  text-align: center;
  padding: 0.5rem 0;
}

.heatmap-cell {
  aspect-ratio: 1;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.heatmap-cell:hover {
  transform: scale(1.1);
}

.heatmap-cell.empty {
  background-color: transparent;
}

.heatmap-cell.neutral {
  background-color: var(--secondary);
  color: var(--muted-foreground);
}

.heatmap-cell.positive-1 {
  background-color: rgba(34, 197, 94, 0.2);
  color: var(--success);
}

.heatmap-cell.positive-2 {
  background-color: rgba(34, 197, 94, 0.4);
  color: var(--success);
}

.heatmap-cell.positive-3 {
  background-color: rgba(34, 197, 94, 0.6);
  color: white;
}

.heatmap-cell.negative-1 {
  background-color: rgba(239, 68, 68, 0.2);
  color: var(--destructive);
}

.heatmap-cell.negative-2 {
  background-color: rgba(239, 68, 68, 0.4);
  color: var(--destructive);
}

.heatmap-cell.negative-3 {
  background-color: rgba(239, 68, 68, 0.6);
  color: white;
}

/* ================================================
   LOGIN PAGE
   ================================================ */

.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-card {
  width: 100%;
  max-width: 400px;
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.login-logo svg {
  width: 28px;
  height: 28px;
  color: white;
}

.login-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.login-subtitle {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login-btn {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
}

/* ================================================
   UTILITIES
   ================================================ */

.text-success {
  color: var(--success);
}
.text-destructive {
  color: var(--destructive);
}
.text-muted {
  color: var(--muted-foreground);
}
.text-primary {
  color: var(--primary);
}
/* Added text-warning utility class for Goal Missing card */
.text-warning {
  color: #f59e0b;
}

.font-mono {
  font-family: "JetBrains Mono", "Fira Code", monospace;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Page Header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--background);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--muted-foreground);
}






/* ALX Style */

.logo-color{
  color: #f59e0b;
}