/* ====================================================
   Fidelity Resolve Center - Core Design System & Theme
   Matches Reference Images: Dark Crypto Wallet / Fintech
   ==================================================== */

:root {
  --bg-darkest: #070a12;
  --bg-dark: #0b1020;
  --bg-surface: #101524;
  --bg-card: #141b2d;
  --bg-card-hover: #192238;
  --bg-input: #0f1626;
  
  --primary: #00d2ff;
  --primary-glow: rgba(0, 210, 255, 0.35);
  --primary-gradient: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 100%);
  
  --secondary: #8b5cf6;
  --secondary-glow: rgba(139, 92, 246, 0.35);
  --accent-purple: #9d4edd;
  
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.25);
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.25);
  --warning: #f59e0b;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(0, 210, 255, 0.5);
  --glass-bg: rgba(20, 27, 45, 0.75);
  --glass-border: rgba(255, 255, 255, 0.1);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;
  
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px var(--primary-glow);
  
  --transition-fast: 0.18s ease;
  --transition-normal: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-darkest);
  background-image: 
    radial-gradient(circle at 20% 15%, rgba(0, 210, 255, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(11, 16, 32, 0.5) 0%, transparent 100%);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Demo Banner */
.demo-banner {
  background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
  color: #000;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 6px 16px;
  text-align: center;
  letter-spacing: 0.04em;
  position: sticky;
  top: 0;
  z-index: 9999;
}

/* Typography & Links */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition-fast);
}
a:hover {
  color: #60a5fa;
}

/* Containers & Grid */
.container-custom {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Cards & Surfaces */
.card-dark {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  transition: var(--transition-normal);
  position: relative;
  overflow: hidden;
}
.card-dark:hover {
  border-color: rgba(0, 210, 255, 0.2);
}

.card-glass {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

/* Portfolio Hero Card (Matches Reference Image) */
.portfolio-hero-card {
  background: linear-gradient(145deg, #161e33 0%, #0e1526 100%);
  border: 1px solid rgba(0, 210, 255, 0.15);
  border-radius: var(--radius-xl);
  padding: 2.2rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.6), 0 0 30px rgba(0, 210, 255, 0.05);
}

.portfolio-hero-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(0, 210, 255, 0.15) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.portfolio-balance-label {
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.portfolio-balance-amount {
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
  margin: 0.35rem 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.portfolio-change-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-full);
}
.badge-positive {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.badge-negative {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Quick Action Buttons (Deposit, Withdraw, Invest, Transfer) */
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}

.quick-action-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-normal);
  text-decoration: none;
}
.quick-action-btn:hover {
  background: rgba(0, 210, 255, 0.1);
  border-color: rgba(0, 210, 255, 0.4);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--primary-glow);
}

.action-icon-wrapper {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  transition: var(--transition-fast);
}
.icon-deposit {
  background: rgba(0, 210, 255, 0.15);
  color: #00d2ff;
}
.icon-withdraw {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
}
.icon-invest {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}
.icon-transfer {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

/* Tab Navigation (Crypto / Investments / NFTs) */
.fintech-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.25rem;
  padding-bottom: 0.25rem;
}

.fintech-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  position: relative;
}
.fintech-tab-btn:hover {
  color: var(--text-main);
}
.fintech-tab-btn.active {
  color: #00d2ff;
}
.fintech-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 18px;
  right: 18px;
  height: 2px;
  background: #00d2ff;
  border-radius: 2px;
  box-shadow: 0 0 10px #00d2ff;
}

/* Asset Rows List (Matches Reference Image) */
.asset-list-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.asset-row-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
  text-decoration: none;
  color: inherit;
}
.asset-row-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(0, 210, 255, 0.25);
  transform: translateX(4px);
}

.asset-left-col {
  display: flex;
  align-items: center;
  gap: 12px;
}

.asset-icon-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.asset-details {
  display: flex;
  flex-direction: column;
}
.asset-title-group {
  display: flex;
  align-items: center;
  gap: 6px;
}
.asset-name {
  font-weight: 700;
  font-size: 0.98rem;
  color: #fff;
}
.asset-symbol-pill {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  color: var(--text-muted);
}
.asset-price-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  gap: 6px;
  align-items: center;
}

.asset-right-col {
  text-align: right;
  display: flex;
  flex-direction: column;
}
.asset-user-val-usd {
  font-weight: 700;
  font-size: 0.98rem;
  color: #fff;
}
.asset-user-balance-crypto {
  font-size: 0.82rem;
  color: var(--text-dim);
}

/* App Layout & Sidebar */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

.app-sidebar {
  width: 270px;
  background: #090e1c;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 0.75rem 1.75rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
  text-decoration: none;
}
.sidebar-logo-img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
}
.sidebar-brand-name {
  font-weight: 800;
  font-size: 1.05rem;
  color: #fff;
  letter-spacing: -0.02em;
}

.sidebar-nav-list {
  list-style: none;
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-grow: 1;
}

.sidebar-nav-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  transition: var(--transition-fast);
}
.sidebar-nav-item a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}
.sidebar-nav-item a.active {
  background: linear-gradient(90deg, rgba(0, 210, 255, 0.15) 0%, rgba(0, 210, 255, 0.03) 100%);
  color: #00d2ff;
  border-left: 3px solid #00d2ff;
  font-weight: 700;
}

.sidebar-nav-icon {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
}

.app-main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.app-topbar {
  height: 72px;
  background: rgba(11, 16, 32, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-right-controls {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.user-badge-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
}
.user-avatar-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: #000;
}

.content-body {
  padding: 2rem;
  flex-grow: 1;
}

/* Mobile Bottom Navigation (Matches Reference Image) */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 68px;
  background: rgba(9, 14, 28, 0.95);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-color);
  z-index: 999;
  justify-content: space-around;
  align-items: center;
  padding: 0 0.5rem;
}

.mobile-nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-dim);
  font-size: 0.72rem;
  font-weight: 600;
  text-decoration: none;
  flex: 1;
  padding: 6px 0;
  transition: var(--transition-fast);
}
.mobile-nav-link i {
  font-size: 1.25rem;
}
.mobile-nav-link.active {
  color: #00d2ff;
}

/* Forms, Inputs & Buttons */
.form-group {
  margin-bottom: 1.25rem;
}
.form-label {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.form-control-custom {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: var(--transition-fast);
}
.form-control-custom:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 210, 255, 0.15);
}

.btn-custom {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition-fast);
}
.btn-primary-custom {
  background: var(--primary-gradient);
  color: #000;
  box-shadow: 0 4px 15px var(--primary-glow);
}
.btn-primary-custom:hover {
  filter: brightness(1.1);
  box-shadow: 0 6px 22px var(--primary-glow);
  color: #000;
}

.btn-secondary-custom {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid var(--border-color);
}
.btn-secondary-custom:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* Tables */
.table-responsive-custom {
  width: 100%;
  overflow-x: auto;
}
.table-custom {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.table-custom th {
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-dim);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  border-bottom: 1px solid var(--border-color);
}
.table-custom td {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.92rem;
  color: var(--text-main);
}
.table-custom tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Flash Alerts */
.alert-custom {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.92rem;
  font-weight: 500;
}
.alert-success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}
.alert-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}
.alert-info {
  background: rgba(0, 210, 255, 0.12);
  border: 1px solid rgba(0, 210, 255, 0.3);
  color: #38bdf8;
}

/* ========================================================
   RESPONSIVE RULES — Dashboard & Admin
   ======================================================== */

.portfolio-hero-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.portfolio-balance-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.portfolio-sub-breakdown {
  font-size: 0.84rem;
  color: var(--text-dim);
}

.timeframe-pills-container {
  display: flex;
  gap: 4px;
  background: rgba(0, 0, 0, 0.35);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.timeframe-pill-btn {
  padding: 4px 10px;
  font-size: 0.75rem;
  background: transparent;
  color: var(--text-dim);
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-fast);
}
.timeframe-pill-btn:hover {
  color: #fff;
}
.timeframe-pill-btn.active {
  background: var(--primary-glow);
  color: #00d2ff;
}

/* Reusable Responsive Grids */
.dashboard-main-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 1.75rem;
  width: 100%;
}

.admin-stats-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  width: 100%;
}

.admin-stats-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  width: 100%;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.auth-card-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  width: 100%;
  max-width: 950px;
  padding: 0;
  overflow: hidden;
}

/* Mobile Sidebar Toggle Button */
.mobile-sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  color: #fff;
  font-size: 1.1rem;
  transition: var(--transition-fast);
  flex-shrink: 0;
}
.mobile-sidebar-toggle:hover { background: rgba(255,255,255,0.12); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 200;
  backdrop-filter: blur(4px);
}
.sidebar-overlay.open { display: block; }
.app-sidebar.mobile-open {
  transform: translateX(0) !important;
}

@media (max-width: 1200px) {
  .app-sidebar { width: 240px; }
  .content-body { padding: 1.5rem; }
}

@media (max-width: 992px) {
  .app-sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    z-index: 250;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
    width: 280px;
    display: flex;
  }
  .mobile-bottom-nav { display: flex; }
  .mobile-sidebar-toggle { display: flex; }
  .content-body { padding: 1.25rem; padding-bottom: 90px; }
  .app-topbar { padding: 0 1.25rem; }
  .quick-actions-grid { grid-template-columns: repeat(4, 1fr); gap: 0.6rem; }
  .portfolio-hero-card { padding: 1.5rem; }
  .portfolio-balance-amount { font-size: 2.1rem; }
  
  .dashboard-main-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }
  .admin-stats-grid-4 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .admin-stats-grid-2 {
    grid-template-columns: 1fr !important;
  }
  .dashboard-two-col { grid-template-columns: 1fr !important; }
  .dashboard-three-col { grid-template-columns: 1fr 1fr !important; }
  .dashboard-four-col { grid-template-columns: repeat(2, 1fr) !important; }
}

@media (max-width: 768px) {
  .portfolio-hero-top-row {
    flex-direction: column;
    align-items: stretch;
  }
  .timeframe-pills-container {
    justify-content: space-between;
    width: 100%;
  }
  .portfolio-balance-amount { font-size: 1.8rem; }
  .quick-actions-grid { grid-template-columns: repeat(4, 1fr); gap: 0.4rem; }
  .quick-action-btn { padding: 0.65rem 0.25rem; font-size: 0.75rem; }
  .action-icon-wrapper { width: 40px; height: 40px; font-size: 1.1rem; }
  .content-body { padding: 0.9rem; padding-bottom: 90px; }
  .app-topbar { height: 60px; padding: 0 1rem; }

  .asset-row-item {
    padding: 0.85rem 0.9rem;
    gap: 8px;
  }
  .asset-left-col {
    gap: 10px;
    min-width: 0;
  }
  .asset-name {
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .asset-user-val-usd {
    font-size: 0.9rem;
  }
  .asset-user-balance-crypto {
    font-size: 0.75rem;
  }

  .fintech-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    gap: 4px;
  }
  .fintech-tab-btn {
    padding: 6px 12px;
    font-size: 0.85rem;
  }

  .card-dark { padding: 1.1rem; }
  .auth-card-grid { grid-template-columns: 1fr !important; }
  .form-row-2 { grid-template-columns: 1fr !important; gap: 0 !important; }
  .admin-stats-grid-4 { grid-template-columns: 1fr 1fr !important; gap: 0.75rem !important; }
  .table-responsive-custom { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-custom th, .table-custom td { white-space: nowrap; }
  .hide-mobile { display: none !important; }
}

@media (max-width: 480px) {
  .portfolio-balance-amount { font-size: 1.55rem; }
  .quick-actions-grid { gap: 0.3rem; }
  .quick-action-btn { padding: 0.55rem 0.15rem; font-size: 0.68rem; }
  .action-icon-wrapper { width: 34px; height: 34px; font-size: 0.9rem; }
  .admin-stats-grid-4 { grid-template-columns: 1fr !important; }
  .card-dark { border-radius: var(--radius-md); }
}
