/* =========================================
   PTC PRIME DASHBOARD - FINTECH DESIGN SYSTEM
   Theme Engine & Design Tokens (Dark / Light)
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');

:root,
[data-theme="dark"] {
  /* Color Palette - Dark Mode (Default) */
  --bg-app: #0A0E14;
  --bg-surface: #121824;
  --bg-card: #1A2232;
  --bg-card-hover: #222B3E;
  --bg-glass: rgba(18, 24, 36, 0.75);
  --bg-input: #151D2A;
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-hover: rgba(0, 229, 160, 0.3);
  
  --text-main: #F0F4F8;
  --text-muted: #8A99AD;
  --text-inverse: #0A0E14;
  
  /* Brand Accents */
  --accent-emerald: #00E5A0;
  --accent-emerald-glow: rgba(0, 229, 160, 0.15);
  --accent-violet: #7C5CFF;
  --accent-violet-glow: rgba(124, 92, 255, 0.15);
  --accent-blue: #38BDF8;
  
  /* Status Colors */
  --color-success: #00E5A0;
  --color-success-bg: rgba(0, 229, 160, 0.1);
  --color-warning: #FFB800;
  --color-warning-bg: rgba(255, 184, 0, 0.1);
  --color-danger: #FF5C72;
  --color-danger-bg: rgba(255, 92, 114, 0.1);
  --color-info: #38BDF8;
  --color-info-bg: rgba(56, 189, 248, 0.1);

  /* Sidebar Tokens */
  --sidebar-bg: #0E131D;
  --sidebar-width: 270px;
  --header-height: 74px;
  --sidebar-text: #94A3B8;
  --sidebar-text-hover: #FFFFFF;
  --sidebar-text-active: #FFFFFF;
  --sidebar-icon: #64748B;
  --sidebar-icon-hover: #00E5A0;
  --sidebar-border: rgba(255, 255, 255, 0.06);
  --sidebar-hover-bg: rgba(255, 255, 255, 0.05);
  --sidebar-active-bg: linear-gradient(90deg, rgba(0, 229, 160, 0.15) 0%, rgba(0, 229, 160, 0.02) 100%);
  --sidebar-submenu-text: #8A99AD;
  --sidebar-submenu-hover-bg: rgba(255, 255, 255, 0.03);
  --sidebar-footer-bg: rgba(0, 0, 0, 0.2);
  --sidebar-footer-name: #FFFFFF;
  --sidebar-scrollbar: rgba(255, 255, 255, 0.1);
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 25px rgba(0, 229, 160, 0.12);

  /* Typography */
  --font-heading: 'Space Grotesk', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

[data-theme="light"] {
  /* Color Palette - Light Mode */
  --bg-app: #EEF2F7;
  --bg-surface: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F0F4F8;
  --bg-glass: rgba(255, 255, 255, 0.92);
  --bg-input: #F1F5F9;

  /* Stronger border & shadow — critical for card visibility on light bg */
  --border-color: #CBD5E1;
  --border-color-hover: rgba(0, 190, 130, 0.55);

  --text-main: #0F172A;
  --text-muted: #64748B;
  --text-inverse: #FFFFFF;

  /* Light sidebar that follows theme */
  --sidebar-bg: #FFFFFF;
  --sidebar-text: #475569;
  --sidebar-text-hover: #0F172A;
  --sidebar-text-active: #0F172A;
  --sidebar-icon: #94A3B8;
  --sidebar-icon-hover: #059669;
  --sidebar-border: #E2E8F0;
  --sidebar-hover-bg: #F1F5F9;
  --sidebar-active-bg: linear-gradient(90deg, rgba(0, 229, 160, 0.10) 0%, rgba(0, 229, 160, 0.02) 100%);
  --sidebar-submenu-text: #64748B;
  --sidebar-submenu-hover-bg: #F8FAFC;
  --sidebar-footer-bg: #F8FAFC;
  --sidebar-footer-name: #0F172A;
  --sidebar-scrollbar: rgba(0, 0, 0, 0.08);

  /* Stronger shadows so cards "lift" from background */
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 6px 20px rgba(15, 23, 42, 0.10);
  --shadow-glow: 0 4px 20px rgba(0, 229, 160, 0.18);
}

/* =========================================
   BASE STYLES & RESET OVERRIDES
   ========================================= */
body {
  background-color: var(--bg-app) !important;
  color: var(--text-main) !important;
  font-family: var(--font-body) !important;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

/* Override main.css white table body */
.table tbody,
.table-premium tbody {
  background-color: transparent !important;
  border: 0 !important;
}

[data-theme="dark"] .table tbody,
[data-theme="dark"] .table-premium tbody {
  background-color: transparent !important;
}

[data-theme="dark"] .table tbody tr,
[data-theme="dark"] .table-premium tbody tr {
  background: var(--bg-card, #1A2232) !important;
}

/* Remove Bootstrap white from card base */
[data-theme="dark"] .card {
  background-color: var(--bg-card, #1A2232) !important;
}



h1, h2, h3, h4, h5, h6, .font-heading {
  font-family: var(--font-heading) !important;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.font-mono, .amount-text, .balance-value, .trx-amount {
  font-family: var(--font-mono) !important;
}

/* Glassmorphism utility */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
  border-color: var(--border-color-hover);
  box-shadow: var(--shadow-md);
}

/* =========================================
   LAYOUT ENGINE (SHELL)
   ========================================= */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* Sidebar */
.dashboard-sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1040;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease;
}

.sidebar-header {
  height: var(--header-height);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-brand-logo img {
  max-height: 38px;
  object-fit: contain;
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 14px;
}

.sidebar-content::-webkit-scrollbar {
  width: 4px;
}
.sidebar-content::-webkit-scrollbar-thumb {
  background: var(--sidebar-scrollbar);
  border-radius: 4px;
}

.nav-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  opacity: 0.6;
  margin: 18px 12px 8px;
}

.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-item {
  margin-bottom: 4px;
}

.nav-link-custom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  color: var(--sidebar-text);
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none !important;
  transition: all 0.2s ease;
  position: relative;
}

.nav-link-custom:hover {
  color: var(--sidebar-text-hover);
  background: var(--sidebar-hover-bg);
}

.nav-link-custom.active {
  color: var(--sidebar-text-active) !important;
  background: var(--sidebar-active-bg);
  border-left: 3px solid var(--accent-emerald);
  font-weight: 600;
}

.nav-link-custom.active .nav-icon {
  color: var(--accent-emerald) !important;
}

.nav-icon {
  font-size: 1.2rem;
  margin-right: 12px;
  color: var(--sidebar-icon);
  transition: color 0.2s ease;
}

.nav-link-custom:hover .nav-icon {
  color: var(--sidebar-icon-hover);
}

.arrow-icon {
  font-size: 0.75rem;
  transition: transform 0.25s ease;
}

.has-submenu.open .arrow-icon {
  transform: rotate(90deg);
}

.sidebar-submenu-custom {
  list-style: none;
  padding: 4px 0 4px 38px;
  margin: 0;
  display: none;
}

.has-submenu.open .sidebar-submenu-custom {
  display: block;
}

.submenu-link-custom {
  display: block;
  padding: 8px 12px;
  color: var(--sidebar-submenu-text);
  font-size: 0.82rem;
  text-decoration: none !important;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.submenu-link-custom:hover,
.submenu-link-custom.active {
  color: var(--accent-emerald);
  background: var(--sidebar-submenu-hover-bg);
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--sidebar-border);
  background: var(--sidebar-footer-bg);
}

.user-quick-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar-circle {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  min-height: 38px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, var(--accent-emerald), var(--accent-violet));
  color: #0A0E14;
  font-weight: 700;
  display: flex !important;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  border: 2px solid var(--sidebar-border);
  overflow: hidden !important;
  flex-shrink: 0 !important;
}

.user-avatar-circle img,
.user-avatar-circle .user-avatar-img {
  width: 38px !important;
  height: 38px !important;
  max-width: none !important;
  object-fit: cover !important;
  object-position: center center !important;
  display: block !important;
  border-radius: 50% !important;
}

/* Profile photos in dashboard / settings — beat global img { height: auto } */
img.user-profile-photo {
  object-fit: cover !important;
  object-position: center;
  max-width: none !important;
  flex-shrink: 0;
}

/* Main Content Area */
.dashboard-main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: margin-left 0.3s ease;
}

/* Topbar Header */
.dashboard-topbar {
  height: var(--header-height);
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1030;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-page-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Balance Pill in Header */
.header-balance-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  padding: 6px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-balance-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}

.header-balance-amount {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-emerald);
  font-size: 0.95rem;
}

/* Theme Toggle Button */
.theme-switch-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s ease;
}

.theme-switch-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-emerald);
  color: var(--accent-emerald);
  transform: translateY(-1px);
}

/* Mobile Sidebar Toggle */
.mobile-sidebar-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
}

/* Main Dashboard Body Container */
.dashboard-content-body {
  padding: 30px;
  flex: 1;
}

/* Overlay for Mobile Sidebar */
.sidebar-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 14, 20, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1035;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-backdrop.show {
  display: block;
  opacity: 1;
}

/* =========================================
   RESPONSIVE DESIGN BREAKPOINTS
   ========================================= */
@media (max-width: 991px) {
  .dashboard-sidebar {
    transform: translateX(-100%);
  }

  .dashboard-sidebar.sidebar-open {
    transform: translateX(0);
  }

  .dashboard-main-wrapper {
    margin-left: 0;
  }

  .mobile-sidebar-toggle {
    display: flex;
  }

  .dashboard-topbar {
    padding: 0 16px;
  }

  .dashboard-content-body {
    padding: 20px 16px;
  }
}

/* =========================================
   SaaS FINTECH iziToast OVERHAUL
   ========================================= */
.iziToast-wrapper {
  z-index: 999999 !important;
}

.iziToast {
  border-radius: 14px !important;
  padding: 12px 18px !important;
  min-height: 52px !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  font-family: var(--font-body) !important;
}

.iziToast > .iziToast-body {
  margin: 0 !important;
  padding: 0 !important;
  display: flex !items-center !important;
}

.iziToast > .iziToast-body .iziToast-message {
  font-size: 0.88rem !important;
  font-weight: 500 !important;
  line-height: 1.4 !important;
}

/* Success Toast */
.iziToast-status-success,
.iziToast.iziToast-color-green {
  background: rgba(18, 24, 36, 0.95) !important;
  border-left: 4px solid var(--accent-emerald, #00E5A0) !important;
}
.iziToast-status-success .iziToast-message,
.iziToast.iziToast-color-green .iziToast-message {
  color: #FFFFFF !important;
}

/* Error Toast */
.iziToast-status-error,
.iziToast.iziToast-color-red {
  background: rgba(18, 24, 36, 0.95) !important;
  border-left: 4px solid #FF5C72 !important;
}
.iziToast-status-error .iziToast-message,
.iziToast.iziToast-color-red .iziToast-message {
  color: #FFFFFF !important;
}

/* Info Toast */
.iziToast-status-info,
.iziToast.iziToast-color-blue {
  background: rgba(18, 24, 36, 0.95) !important;
  border-left: 4px solid #38BDF8 !important;
}

/* Warning Toast */
.iziToast-status-warning,
.iziToast.iziToast-color-yellow {
  background: rgba(18, 24, 36, 0.95) !important;
  border-left: 4px solid #FFB800 !important;
}

/* Referral Page Filter Buttons */
.ref-filter-btn {
  background: var(--bg-card) !important;
  color: var(--text-main) !important;
  border: 1px solid var(--border-color) !important;
  transition: all 0.2s ease;
}

.ref-filter-btn:hover {
  background: var(--bg-card-hover) !important;
  border-color: var(--accent-emerald) !important;
  color: var(--accent-emerald) !important;
}

.ref-badge-count {
  background: rgba(128, 128, 128, 0.15) !important;
  color: var(--text-main) !important;
}

[data-theme="dark"] .ref-badge-count {
  background: rgba(255, 255, 255, 0.15) !important;
  color: #FFFFFF !important;
}



