/* ==========================================
   USER DASHBOARD - REDESIGNED LAYOUT
   Dark Orange Premium Design (Original Theme)
   ========================================== */

/* ==========================================
   THEME VARIABLES - DARK ORANGE (ORIGINAL)
   ========================================== */
:root {
  /* Orange accent — unique to dashboard theme */
  --primary-orange: rgb(249, 115, 22);
  --primary-orange-light: rgb(251, 146, 60);
  --primary-orange-glow: rgba(249, 115, 22, 0.4);
  --primary-orange-dim: rgba(249, 115, 22, 0.1);
  --primary-orange-border: rgba(249, 115, 22, 0.2);
  --bg-dark: #18181b;
  --bg-elevated: rgba(63, 63, 70, 0.65);
  --bg-modal: #27272a;
  --success-green: var(--trading-green, #22c55e);
  --danger-red: var(--trading-red, #ef4444);
  --success-rgb: 34, 197, 94;
  --danger-rgb: 239, 68, 68;

  /* z-index scale — fallback when variables.css is not loaded */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-toast: 1080;

  /* Semantic tokens — fallback when variables.css is not loaded.
     theme-loader.js may later override these from Firestore. */
  --bg-card: rgba(26, 31, 46, 0.75);
  --text-primary: #f8fafc;
  --text-secondary: #e2e8f0;
  --text-muted: #94a3b8;
  --border-color: #2d3748;
}

/* ==========================================
   GLASSMORPHISM - Card Transparency
   ========================================== */
.balance-card,
.stock-card,
.market-item,
.news-item,
.ihsg-summary,
.skeleton-card,
.dashboard-header-card,
.user-header,
.autocomplete-dropdown,
.stock-table th {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ==========================================
   BASE STYLES
   ========================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body.user-dashboard {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  overflow-x: hidden;
  min-height: 100vh;
}

/* ==========================================
   CUSTOM SCROLLBAR (DARK THEME)
   ========================================== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-orange);
}

/* For Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) var(--bg-dark);
}

/* ==========================================
   HEADER - STICKY TOP BAR (ORANGE THEME)
   ========================================== */
.user-header {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: var(--z-dropdown);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hamburger-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-orange-dim);
  border: 1px solid var(--primary-orange);
  border-radius: 10px;
  cursor: pointer;
  color: var(--primary-orange);
  transition: all 0.3s;
}

.hamburger-btn:hover {
  background: var(--primary-orange);
  color: white;
  box-shadow: 0 0 15px var(--primary-orange-glow);
}

.hamburger-btn svg {
  width: 20px;
  height: 20px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-icon-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  cursor: pointer;
  color: var(--text-secondary);
  position: relative;
  transition: all 0.3s;
}

.header-icon-btn:hover {
  background: var(--primary-orange-dim);
  border-color: var(--primary-orange);
  color: var(--primary-orange);
}

.header-icon-btn svg {
  width: 20px;
  height: 20px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: transparent;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
}

.logo-icon svg {
  width: 18px;
  height: 18px;
  color: white;
}

.logo-text {
  font-family: "Playfair Display", serif;
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(
    135deg,
    var(--primary-orange) 0%,
    var(--primary-orange-light) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 10px;
  height: 10px;
  background: var(--primary-orange);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--primary-orange-glow);
}

/* ==========================================
   SEARCH BAR
   ========================================== */
.search-bar-container {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(24, 24, 27, 0.98);
  backdrop-filter: blur(16px);
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  transform: translateY(-100%);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 99;
}

.search-bar-container.active {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-input-wrapper input {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 16px;
  padding-right: 48px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: all 0.3s;
}

.search-input-wrapper input:focus {
  border-color: var(--primary-orange);
  box-shadow: 0 0 0 2px var(--primary-orange-dim);
}

.search-input-wrapper button {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s;
}

.search-input-wrapper button:hover {
  color: var(--text-primary);
}

.search-input-wrapper button svg {
  width: 18px;
  height: 18px;
}

.search-results {
  margin-top: 16px;
  max-height: 300px;
  overflow-y: auto;
}

/* ==========================================
   SIDEBAR (ORANGE THEME)
   ========================================== */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: var(--z-sticky);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

.user-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 300px;
  height: 100vh;
  background: var(--bg-dark);
  border-right: 1px solid #27272a;
  z-index: var(--z-fixed);
  transform: translateX(-100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  overflow-y: auto;
  padding: 24px 0;
}

.user-sidebar.active {
  transform: translateX(0);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
}

.sidebar-header {
  padding: 0 24px 24px;
  border-bottom: 1px solid var(--primary-orange-dim);
  position: relative;
}

.sidebar-close {
  position: absolute;
  top: 0;
  right: 20px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.3s;
}

.sidebar-close:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--danger-red);
  color: var(--danger-red);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.sidebar-logo-icon {
  width: 48px;
  height: 48px;
  background: transparent;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
}

.sidebar-logo-icon svg {
  width: 24px;
  height: 24px;
  color: white;
}

.sidebar-title {
  font-family: "Playfair Display", serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-orange);
}

.sidebar-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.sidebar-menu {
  padding: 24px 0;
}

.menu-section-title {
  padding: 12px 24px 8px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 24px;
  color: rgba(229, 231, 235, 0.7);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s;
  border-left: 3px solid transparent;
}

.menu-item:hover,
.menu-item.active {
  background: var(--nav-active-dim, var(--primary-orange-dim));
  color: var(--nav-active-color, var(--primary-orange));
  border-left-color: var(--nav-active-color, var(--primary-orange));
}

.menu-item svg {
  width: 20px;
  height: 20px;
}

.sidebar-footer {
  padding: 24px;
  border-top: 1px solid var(--nav-active-dim, var(--primary-orange-dim));
}

.logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  background: rgba(var(--danger-rgb, 239, 68, 68), 0.1);
  border: 1px solid rgba(var(--danger-rgb, 239, 68, 68), 0.3);
  border-radius: 10px;
  color: var(--danger-red);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.logout-btn:hover {
  background: var(--danger-red);
  color: white;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

/* ==========================================
   MAIN CONTENT
   ========================================== */
.user-main {
  padding: 0 20px 100px;
  max-width: 600px;
  margin: 0 auto;
}

/* ==========================================
   USER PROFILE SECTION
   ========================================== */
.profile-section {
  text-align: left;
  padding: 12px 0 28px;
}

.user-name-small {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.balance-main {
  font-size: 34px; /* Reduced by ~20% from 42px */
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  margin-bottom: 8px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  font-variant-numeric: tabular-nums;
}

.balance-change {
  font-size: 14px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  display: inline-block;
}

.balance-change.positive {
  color: var(--success-green);
  background: rgba(var(--success-rgb, 34, 197, 94), 0.15);
  border: 1px solid rgba(var(--success-rgb, 34, 197, 94), 0.3);
}

.balance-change.negative {
  color: var(--danger-red);
  background: rgba(var(--danger-rgb, 239, 68, 68), 0.15);
  border: 1px solid rgba(var(--danger-rgb, 239, 68, 68), 0.3);
}

/* ==========================================
   BALANCE CARDS
   ========================================== */
.balance-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.balance-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 14px;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* Left align */
  justify-content: center;
  text-align: left; /* Left align */
  min-height: 70px; /* Increased by ~10% from 64px */
}

.balance-card:hover {
  border-color: var(--primary-orange);
  box-shadow: 0 0 15px var(--primary-orange-dim);
}

.balance-card-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.2;
  width: 100%; /* Ensure full width for left alignment */
}

.balance-card-value {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  width: 100%; /* Ensure full width for left alignment */
  font-variant-numeric: tabular-nums;
}

/* Live tick flash for stock card prices */
.stock-price.tick-up, .balance-card-value.tick-up {
  color: var(--success-green) !important;
  text-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
  transition: color 0.15s, text-shadow 0.15s;
}
.stock-price.tick-down, .balance-card-value.tick-down {
  color: var(--danger-red) !important;
  text-shadow: 0 0 6px rgba(239, 68, 68, 0.5);
  transition: color 0.15s, text-shadow 0.15s;
}

.stock-price {
  font-variant-numeric: tabular-nums;
  transition: color 0.3s, text-shadow 0.3s;
}

/* ==========================================
   📈 GENERIC LIVE TICK FLASH CLASSES
   Used by live-ticker.js across all pages
   ========================================== */
.tick-up {
  color: var(--success-green) !important;
  text-shadow: 0 0 8px rgba(var(--success-rgb, 34, 197, 94), 0.5);
  transition: color 0.15s, text-shadow 0.15s;
}
.tick-down {
  color: var(--danger-red) !important;
  text-shadow: 0 0 8px rgba(var(--danger-rgb, 239, 68, 68), 0.5);
  transition: color 0.15s, text-shadow 0.15s;
}
.wl-price { font-variant-numeric: tabular-nums; transition: color 0.3s, text-shadow 0.3s; }
.wl-price.tick-up { color: var(--success-green) !important; text-shadow: 0 0 8px rgba(var(--success-rgb, 34, 197, 94), 0.5); }
.wl-price.tick-down { color: var(--danger-red) !important; text-shadow: 0 0 8px rgba(var(--danger-rgb, 239, 68, 68), 0.5); }
.wl-data-val.tick-up { color: var(--success-green) !important; text-shadow: 0 0 6px rgba(var(--success-rgb, 34, 197, 94), 0.4); }
.wl-data-val.tick-down { color: var(--danger-red) !important; text-shadow: 0 0 6px rgba(var(--danger-rgb, 239, 68, 68), 0.4); }
.pf-card-value.tick-up { color: var(--success-green) !important; text-shadow: 0 0 8px rgba(var(--success-rgb, 34, 197, 94), 0.5); }
.pf-card-value.tick-down { color: var(--danger-red) !important; text-shadow: 0 0 8px rgba(var(--danger-rgb, 239, 68, 68), 0.5); }
td.tick-up { color: var(--success-green) !important; text-shadow: 0 0 6px rgba(var(--success-rgb, 34, 197, 94), 0.4); }
td.tick-down { color: var(--danger-red) !important; text-shadow: 0 0 6px rgba(var(--danger-rgb, 239, 68, 68), 0.4); }
.ihsg-price.tick-up { color: var(--success-green) !important; text-shadow: 0 0 10px rgba(var(--success-rgb, 34, 197, 94), 0.5); }
.ihsg-price.tick-down { color: var(--danger-red) !important; text-shadow: 0 0 10px rgba(var(--danger-rgb, 239, 68, 68), 0.5); }

/* ==========================================
   ACTION BUTTONS (ORANGE THEME)
   ========================================== */
.action-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 32px;
}

.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s;
  cursor: pointer;
  border: none;
}

.action-btn.primary {
  background: linear-gradient(
    135deg,
    var(--button-color, var(--primary-orange)) 0%,
    var(--button-color-dark, var(--primary-orange-light)) 100%
  );
  color: white;
  box-shadow: 0 4px 20px var(--button-color-glow, var(--primary-orange-glow));
}

.action-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px var(--button-color-glow, var(--primary-orange-glow));
}

.action-btn.secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.action-btn.secondary:hover {
  background: var(--bg-elevated);
  border-color: var(--primary-orange);
  color: var(--primary-orange);
}

.action-btn svg {
  width: 20px;
  height: 20px;
}

/* ==========================================
   SECTION HEADER
   ========================================== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.section-link {
  font-size: 13px;
  color: var(--primary-orange);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.section-link:hover {
  color: var(--primary-orange-light);
}

/* ==========================================
   STOCK CARDS - HORIZONTAL SCROLL (ORANGE)
   ========================================== */
.stock-cards-section {
  margin-bottom: 32px;
}

.stock-cards-scroll {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.stock-cards-scroll::-webkit-scrollbar {
  display: none;
}

.stock-card {
  flex: 0 0 85px; /* Reduced from 110px */
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 8px;
  text-decoration: none;
  transition: all 0.3s;
}

.stock-card:hover {
  border-color: var(--primary-orange);
  transform: translateY(-4px);
  box-shadow:
    0 8px 25px rgba(0, 0, 0, 0.3),
    0 0 15px var(--primary-orange-dim);
}

.stock-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.stock-logo {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--primary-orange-dim);
  border: 1px solid var(--primary-orange-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: var(--primary-orange);
}

.stock-name {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stock-symbol {
  font-size: 11px;
  color: var(--text-muted);
}

.stock-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.stock-price {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
}

.stock-change {
  font-size: 9px;
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 3px;
}

.stock-change.positive {
  color: var(--success-green);
  background: rgba(var(--success-rgb, 34, 197, 94), 0.15);
}

.stock-change.negative {
  color: var(--danger-red);
  background: rgba(var(--danger-rgb, 239, 68, 68), 0.15);
}

.stock-chart {
  height: 30px;
  width: 100%;
}

.stock-chart canvas {
  width: 100% !important;
  height: 100% !important;
}

.stock-chart-mini {
  height: 40px;
  width: 100%;
  transition: filter 0.3s;
}

/* ==========================================
   MARKET LIST WITH TABS (ORANGE THEME)
   ========================================== */
.market-section {
  margin-bottom: 32px;
}

.market-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.market-tab {
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.3s;
}

.market-tab:hover {
  border-color: var(--primary-orange);
  color: var(--primary-orange);
}

.market-tab.active {
  background: var(--primary-orange);
  border-color: var(--primary-orange);
  color: white;
  box-shadow: 0 2px 10px var(--primary-orange-glow);
}

.market-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.market-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.3s;
}

.market-item:hover {
  border-color: var(--primary-orange);
  box-shadow: 0 0 15px var(--primary-orange-dim);
}

.market-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--primary-orange-dim);
  border: 1px solid var(--primary-orange-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-orange);
}

.market-info {
  flex: 1;
  min-width: 0;
}

.market-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.market-symbol {
  font-size: 12px;
  color: var(--text-muted);
}

.market-chart {
  width: 60px;
  height: 30px;
  transition: filter 0.3s;
}

.market-chart canvas {
  width: 100% !important;
  height: 100% !important;
}

.market-price-info {
  text-align: right;
  min-width: 80px;
}

.market-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  transition: color 0.3s;
}

/* Live price tick flash */
.market-price.tick-up {
  color: var(--success-green);
  text-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}
.market-price.tick-down {
  color: var(--danger-red);
  text-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

.market-change {
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: color 0.3s;
}

.market-change.positive {
  color: var(--success-green);
}

.market-change.negative {
  color: var(--danger-red);
}

/* ==========================================
   NEWS SECTION (ORANGE THEME)
   ========================================== */
.news-section {
  margin-bottom: 32px;
}

.news-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.news-item {
  display: flex;
  gap: 14px;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  text-decoration: none;
  transition: all 0.3s;
}

.news-item:hover {
  border-color: var(--primary-orange);
  box-shadow: 0 0 15px var(--primary-orange-dim);
}

.news-image {
  width: 80px;
  height: 60px;
  border-radius: 8px;
  background: var(--bg-elevated);
  object-fit: cover;
  flex-shrink: 0;
}

.news-content {
  flex: 1;
  min-width: 0;
}

.news-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-meta {
  font-size: 11px;
  color: var(--text-muted);
}

/* ==========================================
   BOTTOM NAVIGATION (ORANGE THEME)
   ========================================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-color);
  padding: 8px 16px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: space-around;
  z-index: 99;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 10px;
  font-weight: 600;
  transition: all 0.3s;
  border-radius: 10px;
}

.nav-item svg {
  width: 22px;
  height: 22px;
}

.nav-item.active,
.nav-item:hover {
  color: var(--nav-active-color, var(--primary-orange));
  background: var(--nav-active-dim, var(--primary-orange-dim));
}

/* ==========================================
   MARKET PAGE SPECIFIC STYLES
   ========================================== */
.market-page {
  padding-bottom: 120px;
}

.pull-refresh-indicator {
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 12px;
  text-align: center;
  transform: translateY(-100%);
  transition: transform 0.3s;
  z-index: 90;
}

.pull-refresh-indicator.active {
  transform: translateY(0);
}

.pull-refresh-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--primary-orange-dim);
  border-top-color: var(--primary-orange);
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.pull-refresh-text {
  margin-left: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}

.market-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 20px 0;
  gap: 16px;
}

.market-header-content {
  flex: 1;
}

.market-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.market-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

.ihsg-summary {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 16px;
  min-width: 140px;
  transition: all 0.3s;
}

.ihsg-summary:hover {
  border-color: var(--primary-orange);
  box-shadow: 0 0 12px var(--primary-orange-dim);
}

.ihsg-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 4px;
}

.ihsg-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.ihsg-change {
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.ihsg-change.positive {
  color: var(--success-green);
}

.ihsg-change.negative {
  color: var(--danger-red);
}

.search-section {
  margin-bottom: 20px;
}

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 40px 12px 44px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: all 0.3s;
}

.search-input:focus {
  border-color: var(--primary-orange);
  box-shadow: 0 0 0 2px var(--primary-orange-dim);
}

.search-clear {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-clear:hover {
  color: var(--text-primary);
}

.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  margin-top: 8px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 10;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.tabs-section {
  margin-bottom: 16px;
}

.tabs-wrapper {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.tabs-wrapper::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.3s;
}

.tab-btn:hover {
  border-color: var(--primary-orange);
  color: var(--primary-orange);
}

.tab-btn.active {
  background: var(--primary-orange);
  border-color: var(--primary-orange);
  color: white;
  box-shadow: 0 2px 10px var(--primary-orange-glow);
}

.tab-icon {
  width: 14px;
  height: 14px;
}

.filters-section {
  margin-bottom: 20px;
}

.filters-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.filter-group {
  flex: 1;
}

.filter-label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 600;
}

.select-wrapper {
  position: relative;
}

.filter-select {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 36px 10px 12px;
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
  outline: none;
  appearance: none;
  transition: all 0.3s;
}

.filter-select:focus {
  border-color: var(--primary-orange);
  box-shadow: 0 0 0 2px var(--primary-orange-dim);
}

.select-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.view-toggle {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 4px;
}

.view-btn {
  padding: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.view-btn:hover {
  color: var(--primary-orange);
}

.view-btn.active {
  background: var(--primary-orange);
  color: white;
}

.stock-info-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  font-size: 12px;
  color: var(--text-muted);
}

.stock-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stock-table-wrapper {
  overflow-x: auto;
  margin-bottom: 20px;
}

.stock-table {
  width: 100%;
  border-collapse: collapse;
}

.stock-table th {
  background: var(--bg-card);
  padding: 12px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

.stock-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
  color: var(--text-primary);
}

.stock-table tr:hover {
  background: var(--bg-card);
}

.text-right {
  text-align: right;
}

.text-center {
  text-align: center;
}

.loading-container,
.error-container,
.empty-container {
  text-align: center;
  padding: 40px 20px;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.skeleton-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px;
  min-height: 120px;
}

.error-icon,
.empty-icon {
  color: var(--text-muted);
  margin-bottom: 16px;
}

.error-title,
.empty-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.error-message,
.empty-message {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.btn-retry,
.btn-clear {
  background: var(--button-color, var(--primary-orange));
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s;
}

.btn-retry:hover,
.btn-clear:hover {
  background: var(--button-color-dark, var(--primary-orange-light));
  box-shadow: 0 4px 15px var(--button-color-glow, var(--primary-orange-glow));
}

.load-more-container {
  text-align: center;
  padding: 20px;
}

.btn-load-more {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s;
}

.btn-load-more:hover {
  border-color: var(--primary-orange);
  color: var(--primary-orange);
}

.load-more-info {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.all-loaded {
  text-align: center;
  padding: 20px;
  font-size: 14px;
  color: var(--success-green);
}

.hidden {
  display: none !important;
}

.hide-mobile {
  display: none;
}

@media (min-width: 640px) {
  .hide-mobile {
    display: table-cell;
  }
}

/* ==========================================
   SKELETON LOADING
   ========================================== */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-elevated) 25%,
    #4a4a52 50%,
    var(--bg-elevated) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (min-width: 768px) {
  .user-main {
    max-width: 700px;
    padding: 0 32px 60px;
  }

  .bottom-nav {
    display: none;
  }

  .balance-main {
    font-size: 52px;
  }

  .stock-card {
    flex: 0 0 160px;
  }
}

/* ==========================================
   QUICK MENU STYLES (ENHANCED)
   ========================================== */
.quick-menu-grid {
  display: grid !important;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px 8px;
  padding: 4px 0 12px 0;
}

.quick-menu-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  cursor: pointer;
  text-decoration: none;
  color: var(--text-primary);
  transition: transform 0.2s;
}

.quick-menu-item:hover {
  transform: translateY(-2px);
}

.quick-menu-item:active {
  transform: scale(0.95);
}

.quick-menu-item span {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  letter-spacing: 0.3px;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.quick-menu-icon {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.quick-menu-item:hover .quick-menu-icon {
  filter: brightness(1.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

@media (max-width: 480px) {
  .quick-menu-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 12px 6px;
  }
  .quick-menu-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
  }
  .quick-menu-item span {
    font-size: 10px;
  }
}

/* ==========================================
   STICKY HEADER CARD STYLES
   ========================================== */
.dashboard-header-card {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-card);
  margin: -60px -20px 24px -20px; /* Negative margin to cover parent padding if needed */
  padding: 60px 24px 24px 24px; /* Extra top padding for safe area/status bar */
  border-bottom-left-radius: 32px;
  border-bottom-right-radius: 32px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* user-main padding handled by original definition at L482 */

.header-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.greeting-text {
  font-size: 13px;
  color: var(--text-secondary);
}

.user-name-display {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.notification-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  cursor: pointer;
}

.balance-display-area {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.balance-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.balance-amount {
  font-size: 36px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.balance-gain {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  width: fit-content;
}

.balance-gain.positive {
  background: rgba(var(--success-rgb, 34, 197, 94), 0.15);
  color: var(--success-green);
}

.balance-gain.negative {
  background: rgba(var(--danger-rgb, 239, 68, 68), 0.15);
  color: var(--danger-red);
}

/* Desktop Adjustments */
@media (min-width: 768px) {
  .dashboard-header-card {
    position: relative; /* On desktop, maybe just static card? Or still sticky? */
    top: auto;
    border-radius: 24px;
    margin: 0 0 32px 0;
    padding: 32px;
  }

  .user-main {
    padding-top: 16px !important;
  }
}

/* Duplicate .user-header, .dashboard-header-card, .user-main removed — 
   original definitions at L102, L1682, L482 are the single source of truth.
   Removed to fix CSS-1, CSS-2, CSS-3 conflicts. */
