/*
 * Numbstr Theme - "Rational Clarity"
 * Neutral, emotionless design philosophy for data-driven financial decisions.
 * No color manipulation, no gamification, no psychological tricks.
 * ---------------------------------------------------------------------------
 */

/* ===== Light Mode (default) ===== */
:root,
[data-bs-theme="light"] {
  /* Primary palette - muted, professional */
  --bs-primary: #5A6A85;
  --bs-primary-rgb: 90, 106, 133;
  --bs-primary-bg-subtle: #e8ebf0;
  --bs-primary-border-subtle: #c5ccd8;
  --bs-primary-text-emphasis: #3d4860;

  /* Secondary - neutral gray */
  --bs-secondary: #8592A3;
  --bs-secondary-rgb: 133, 146, 163;

  /* Success - muted sage, not celebratory */
  --bs-success: #6B8E6B;
  --bs-success-rgb: 107, 142, 107;
  --bs-success-bg-subtle: #e5ede5;
  --bs-success-border-subtle: #c0d4c0;
  --bs-success-text-emphasis: #4a6449;

  /* Info - muted steel blue */
  --bs-info: #6B8EA3;
  --bs-info-rgb: 107, 142, 163;
  --bs-info-bg-subtle: #e5edf1;
  --bs-info-border-subtle: #c0d4de;
  --bs-info-text-emphasis: #4a6472;

  /* Warning - muted amber/khaki */
  --bs-warning: #B8A06B;
  --bs-warning-rgb: 184, 160, 107;
  --bs-warning-bg-subtle: #f3efe5;
  --bs-warning-border-subtle: #e2d8c0;
  --bs-warning-text-emphasis: #80704a;

  /* Danger - muted rose */
  --bs-danger: #A36B6B;
  --bs-danger-rgb: 163, 107, 107;
  --bs-danger-bg-subtle: #f1e5e5;
  --bs-danger-border-subtle: #dec0c0;
  --bs-danger-text-emphasis: #724a4a;

  /* Body & text */
  --bs-body-color: #646e78;
  --bs-body-bg: #f5f5f9;
  --bs-heading-color: #384551;
  --bs-secondary-color: #8592A3;
  --bs-border-color: #dbdfe5;

  /* Card / paper background */
  --bs-paper-bg: #ffffff;

  /* Link colors */
  --bs-link-color: #5A6A85;
  --bs-link-hover-color: #3d4860;
}

/* ===== Dark Mode ===== */
[data-bs-theme="dark"] {
  /* Primary - lighter slate for dark backgrounds */
  --bs-primary: #7B8CA6;
  --bs-primary-rgb: 123, 140, 166;
  --bs-primary-bg-subtle: #2a3040;
  --bs-primary-border-subtle: #4a5468;
  --bs-primary-text-emphasis: #9fafc4;

  /* Secondary */
  --bs-secondary: #8592A3;
  --bs-secondary-rgb: 133, 146, 163;

  /* Success - muted sage for dark */
  --bs-success: #7FA37F;
  --bs-success-rgb: 127, 163, 127;
  --bs-success-bg-subtle: #263026;
  --bs-success-border-subtle: #4a644a;

  /* Info - muted steel blue for dark */
  --bs-info: #7FA3B8;
  --bs-info-rgb: 127, 163, 184;
  --bs-info-bg-subtle: #26303a;
  --bs-info-border-subtle: #4a6470;

  /* Warning - muted amber for dark */
  --bs-warning: #C4B07F;
  --bs-warning-rgb: 196, 176, 127;
  --bs-warning-bg-subtle: #3a3426;
  --bs-warning-border-subtle: #64584a;

  /* Danger - muted rose for dark */
  --bs-danger: #B87F7F;
  --bs-danger-rgb: 184, 127, 127;
  --bs-danger-bg-subtle: #3a2626;
  --bs-danger-border-subtle: #644a4a;

  /* Body & surfaces */
  --bs-body-color: #C5CAD3;
  --bs-body-bg: #1A1D2E;
  --bs-heading-color: #DFE2E7;
  --bs-secondary-color: #8592A3;
  --bs-border-color: #3b3f54;

  /* Card / paper background */
  --bs-paper-bg: #232640;

  /* Link colors */
  --bs-link-color: #7B8CA6;
  --bs-link-hover-color: #9fafc4;

  color-scheme: dark;
}

/* ===== Financial Data Rules ===== */

/* P&L values: plain numbers, NO color coding */
.pl-value,
.pnl-value,
[data-financial-value] {
  color: var(--bs-body-color);
  font-variant-numeric: tabular-nums;
}

/* Direction indicators: neutral arrows only */
.direction-up::before {
  content: "\2191 ";  /* up arrow */
  color: var(--bs-secondary-color);
}
.direction-down::before {
  content: "\2193 ";  /* down arrow */
  color: var(--bs-secondary-color);
}

/* Badges: outlined/bordered, not filled */
.badge-neutral {
  background-color: transparent;
  border: 1px solid var(--bs-border-color);
  color: var(--bs-body-color);
}

/* Chart colors: distinct muted hues for data legibility */
:root {
  --chart-color-1: #5A6A85;
  --chart-color-2: #6B8E6B;
  --chart-color-3: #B8A06B;
  --chart-color-4: #A36B6B;
  --chart-color-5: #6B8EA3;
  --chart-color-6: #7B6B8E;
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===== Typography Refinements ===== */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Tabular numbers for financial data */
.table td,
.table th,
.stat-value,
.price-value {
  font-variant-numeric: tabular-nums;
}

/* ===== Selection Color ===== */
::selection {
  background: var(--bs-primary);
  color: #ffffff;
}

/* ===== Layout Fixes (essential, moved from demo.css) ===== */

/* Sidebar branding */
.menu .app-brand {
  height: 64px;
  margin-top: 12px;
}

/* Sidebar always expanded - never collapse to icon-only */
@media (min-width: 1200px) {
  .layout-menu {
    width: 16.25rem !important;
    transform: translate3d(0, 0, 0) !important;
  }
  .layout-menu .menu-inner > .menu-item > .menu-link .menu-text,
  .layout-menu .menu-inner > .menu-item .menu-sub,
  .layout-menu .menu-inner > .menu-item .menu-toggle::after,
  .layout-menu .menu-header {
    opacity: 1 !important;
    overflow: visible !important;
  }
}

/* Brand logo - matches old template .logo { height: 2.5rem } */
.app-brand-logo {
  flex-shrink: 0;
}
.app-brand-logo img {
  height: 2.5rem;
  width: auto;
  display: block;
}

/* Auth page brand logo - larger for centered auth pages */
.authentication-wrapper .app-brand-logo img {
  height: 3rem;
}

/* Brand text styling */
.app-brand-text {
  font-size: 1.75rem;
  letter-spacing: -0.5px;
}


/* Navbar z-index fix */
.content-wrapper .navbar {
  z-index: auto;
}

/* ===== Skip Navigation Link ===== */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  z-index: 9999;
  padding: 0.75rem 1.5rem;
  background: var(--bs-primary);
  color: #ffffff;
  text-decoration: none;
  border-radius: 0 0 0.375rem 0;
}
.skip-link:focus {
  top: 0;
  color: #ffffff;
}
