@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@500;600;700;800&family=Montserrat:wght@400;500;600;700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

body {
  font-family: 'Montserrat', 'Segoe UI', sans-serif;
  background: #FAFAFE;
}

h1, h2, h3, h4, h5, h6, .font-display {
  font-family: 'Poppins', 'Segoe UI', sans-serif;
}

.font-mono-num {
  font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  font-variant-numeric: tabular-nums lining-nums;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #E1DEEC; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #BFBACE; }

/* Skeleton shimmer */
.skeleton { position: relative; overflow: hidden; background: #EFEDF7; border-radius: 8px; }
.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,0.7) 50%, transparent 80%);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fade-up { animation: fadeInUp 0.4s cubic-bezier(0.16,1,0.3,1) both; }

@keyframes pulseDot {
  0% { box-shadow: 0 0 0 0 rgba(22,163,74,0.5); }
  70% { box-shadow: 0 0 0 6px rgba(22,163,74,0); }
  100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); }
}
.animate-pulse-dot { animation: pulseDot 1.8s infinite; }

/* Drawer / modal transition helpers (toggled via JS) */
.drawer-panel { transition: transform 0.32s cubic-bezier(0.16,1,0.3,1); }
.drawer-overlay-fade { transition: opacity 0.2s ease; }
.modal-pop { transition: transform 0.2s cubic-bezier(0.16,1,0.3,1), opacity 0.2s ease; }

/* Sidebar submenu chevron rotation */
.chevron-rotate { transition: transform 0.18s ease; }
.chevron-rotate.is-open { transform: rotate(180deg); }

/* Sort icon active state (can't easily do via Tailwind peer for SVG fill) */
.sort-icon-active { color: #7C3AED !important; }

/* =========================================================
   Responsive sidebar
   - Mobile (<768px): always icon-rail, 72px, labels hidden
   - Tablet/Desktop (≥768px): 240px expanded, or 72px if
     user toggled "is-collapsed" via the collapse button
   ========================================================= */
.ps-sidebar {
  width: 72px;
}
.sidebar-label {
  display: none;
}
@media (min-width: 768px) {
  .ps-sidebar {
    width: 260px;
  }
  .ps-sidebar.is-collapsed {
    width: 72px;
  }
  .ps-sidebar:not(.is-collapsed) .sidebar-label:not(.hidden) {
    display: block;
  }
  .ps-sidebar:not(.is-collapsed) span.sidebar-label:not(.hidden) {
    display: inline;
  }
  .ps-sidebar:not(.is-collapsed) img.sidebar-label:not(.hidden) {
    display: block;
  }
  .ps-sidebar:not(.is-collapsed) .sidebar-submenu.sidebar-label:not(.hidden) {
    display: flex;
  }
}

#main-content {
  margin-left: 72px !important;
  width: calc(100% - 72px) !important;
  transition: margin-left 0.2s cubic-bezier(0.16,1,0.3,1), width 0.2s cubic-bezier(0.16,1,0.3,1);
}
@media (min-width: 768px) {
  #main-content {
    margin-left: 260px !important;
    width: calc(100% - 260px) !important;
  }
  #main-content.main-collapsed {
    margin-left: 72px !important;
    width: calc(100% - 72px) !important;
  }
}

/* Mobile: header search box and balance pill compact down */
@media (max-width: 639px) {
  .header-search-label,
  .header-balance-label {
    display: none;
  }
}

/* Sidebar collapsed icon logic */
.sidebar-icon {
  display: block;
}
@media (min-width: 768px) {
  .ps-sidebar:not(.is-collapsed) .sidebar-icon {
    display: none;
  }
}

