/**
 * AUVANO DARK LUXURY DESIGN SYSTEM
 * Stealth Mode - High-End Trading Terminal Aesthetic
 * Version: 2.0 - Dark Luxury Edition
 */

/* ========== CSS VARIABLES ========== */
:root {
  /* Dark Luxury Color Palette */
  --bg-body: #050505;
  --bg-card: #141414;
  --bg-sidebar: #0A0A0A;
  --bg-elevated: #1A1A1A;
  --bg-hover: #1F1F1F;
  
  /* Borders - Extremely Subtle */
  --border: #2A2A2A;
  --border-light: rgba(255, 255, 255, 0.05);
  --border-medium: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.12);
  
  /* Text - High Contrast */
  --text-primary: #FFFFFF;
  --text-secondary: #A1A1AA;
  --text-muted: #71717A;
  --text-subtle: #52525B;
  
  /* Gold - Use Sparingly */
  --gold-start: #CBA44A;
  --gold-end: #E3C76A;
  --gold-primary: linear-gradient(135deg, #CBA44A 0%, #E3C76A 100%);
  --gold-glow: rgba(203, 164, 74, 0.2);
  --gold-glow-strong: rgba(203, 164, 74, 0.4);
  
  /* Status Colors - Muted */
  --success: #10B981;
  --success-bg: rgba(16, 185, 129, 0.1);
  --error: #EF4444;
  --error-bg: rgba(239, 68, 68, 0.1);
  --warning: #F59E0B;
  --warning-bg: rgba(245, 158, 11, 0.1);
  --info: #3B82F6;
  --info-bg: rgba(59, 130, 246, 0.1);
  
  /* Sharp Radius - Professional */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  
  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  
  /* Shadows - Subtle Glows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.8);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.9);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.95);
  --shadow-gold: 0 0 20px var(--gold-glow);
  --shadow-gold-strong: 0 0 40px var(--gold-glow-strong);
  
  /* Transitions - Snappy */
  --transition-fast: 120ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Typography */
  --font-display: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', monospace;
  
  /* Z-index */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-tooltip: 1070;
}

/* ========== RESET & BASE ========== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-body);
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ========== TYPOGRAPHY ========== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 800;
}

h2 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
}

h3 {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 700;
}

h4 {
  font-size: clamp(20px, 2.5vw, 24px);
  font-weight: 600;
}

p {
  margin-bottom: var(--space-md);
  color: var(--text-secondary);
}

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

a:hover {
  color: var(--gold-end);
}

/* ========== BUTTONS ========== */
.btn,
button:not(.close-btn) {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  transition: all var(--transition-normal);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn:active {
  transform: scale(0.98);
}

/* Primary Button - Gold Gradient (Use Sparingly) */
.btn-primary,
.primary-btn,
.btn-dashboard {
  background: var(--gold-primary);
  color: #000000;
  font-weight: 700;
  box-shadow: var(--shadow-gold);
  border: none;
}

.btn-primary:hover,
.primary-btn:hover,
.btn-dashboard:hover {
  box-shadow: var(--shadow-gold-strong);
  transform: translateY(-2px);
}

/* Secondary Button - Subtle Dark */
.btn-secondary,
.secondary-btn {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover,
.secondary-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-medium);
  box-shadow: var(--shadow-md);
}

/* Ghost Button */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
}

.btn-ghost:hover {
  background: var(--bg-card);
  border-color: var(--border-light);
  color: var(--text-primary);
}

/* Outline Button */
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.btn-outline:hover {
  border-color: var(--gold-start);
  box-shadow: var(--shadow-gold);
}

/* Button Sizes */
.btn-sm {
  padding: 8px 16px;
  font-size: 12px;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 16px;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

/* ========== CARDS ========== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  backdrop-filter: blur(20px);
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-sm);
}

.card:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-md);
}

.card-glass {
  background: rgba(20, 20, 20, 0.8);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-light);
}

.card-elevated {
  background: var(--bg-elevated);
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.card-body {
  padding: var(--space-md) 0;
}

.card-footer {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ========== FORMS ========== */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-label,
label {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
  font-size: 13px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.form-input,
.form-select,
.form-textarea,
input[type="email"],
input[type="password"],
input[type="text"],
input[type="number"] {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-body);
  transition: all var(--transition-normal);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus,
input:focus {
  outline: none;
  border-color: var(--gold-start);
  box-shadow: 0 0 0 1px var(--gold-start), var(--shadow-gold);
  background: var(--bg-card);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

.form-helper {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

.form-error {
  font-size: 12px;
  color: var(--error);
  margin-top: var(--space-xs);
}

/* ========== BADGES ========== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: var(--font-display);
}

.badge-primary {
  background: var(--gold-primary);
  color: #000000;
}

.badge-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success);
}

.badge-error {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid var(--error);
}

.badge-warning {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid var(--warning);
}

.badge-info {
  background: var(--info-bg);
  color: var(--info);
  border: 1px solid var(--info);
}

/* ========== ALERTS ========== */
.alert {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  border-left: 3px solid;
  margin-bottom: var(--space-md);
  backdrop-filter: blur(10px);
}

.alert-success {
  background: var(--success-bg);
  border-color: var(--success);
  color: var(--success);
}

.alert-error {
  background: var(--error-bg);
  border-color: var(--error);
  color: var(--error);
}

.alert-warning {
  background: var(--warning-bg);
  border-color: var(--warning);
  color: var(--warning);
}

.alert-info {
  background: var(--info-bg);
  border-color: var(--info);
  color: var(--info);
}

/* ========== LOADING ========== */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--gold-start);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner-lg {
  width: 48px;
  height: 48px;
  border-width: 4px;
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(5, 5, 5, 0.95);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
}

/* ========== GRADIENTS ========== */
.gradient-gold {
  background: var(--gold-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-bg-gold {
  background: var(--gold-primary);
}

/* ========== UTILITIES ========== */
.container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

.p-sm { padding: var(--space-sm); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }

.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }

/* ========== ANIMATIONS ========== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.animate-fade-in {
  animation: fadeIn var(--transition-normal) ease-out;
}

.animate-slide-in {
  animation: slideInRight var(--transition-normal) ease-out;
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-body);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gold-start);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border) var(--bg-body);
}

/* ========== RESPONSIVE DESIGN ========== */

/* Mobile Menu Toggle Button — hidden on desktop, shown on mobile via media query */
.mobile-menu-toggle {
  display: none !important;
  position: fixed;
  top: 20px;
  left: 12px;
  z-index: 1002;
  width: 36px;
  height: 36px;
  background: var(--bg-card);
  border: 1px solid rgba(203, 164, 74, 0.4);
  border-radius: 50%;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all var(--transition-normal);
  box-shadow: 0 0 12px rgba(203, 164, 74, 0.15);
  padding: 0;
}

.mobile-menu-toggle:hover {
  border-color: rgba(203, 164, 74, 0.8);
  box-shadow: 0 0 18px rgba(203, 164, 74, 0.3);
  background: rgba(203, 164, 74, 0.08);
}

.mobile-menu-toggle span {
  width: 16px;
  height: 1.5px;
  background: linear-gradient(135deg, #CBA44A, #E3C76A);
  transition: all var(--transition-normal);
  border-radius: 2px;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(4px, 4px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Overlay — covers only main content, not the sidebar or toggle */
.mobile-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 998;
}

.mobile-overlay.active {
  display: block;
}

/* Tablet Breakpoint (1024px) */
@media (max-width: 1024px) {
  :root {
    font-size: 15px;
  }
  
  .container {
    padding: 0 var(--space-md);
  }
  
  .sidebar {
    width: 240px;
  }

  .main-content {
    left: 240px;
  }
  
  .search-bar {
    width: 220px;
  }
  
  /* Adjust grid layouts */
  .metrics-row {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .activity-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile Breakpoint (768px) */
@media (max-width: 768px) {
  :root {
    font-size: 14px;
  }
  
  body {
    overflow-x: hidden;
  }
  
  .container {
    padding: 0 var(--space-sm);
  }
  
  /* Mobile Menu Toggle */
  .mobile-menu-toggle {
    display: flex !important;
  }
  
  /* Sidebar - Mobile Drawer */
  .sidebar {
    position: fixed;
    left: 0;
    width: 280px;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 1000;
    box-shadow: none;
  }
  
  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.8);
  }
  
  /* Main Content - Full Width on Mobile */
  .main-content {
    left: 0 !important;
    right: 0 !important;
  }
  
  /* Top Bar - Mobile Adjustments */
  .top-bar {
    padding: 0 var(--space-md) 0 4.5rem;
    height: 64px;
    flex-wrap: nowrap;
    align-items: center;
  }
  
  .top-bar-left {
    flex: 1;
    min-width: 0;
    overflow: hidden;
  }
  
  .top-bar-left h1 {
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }
  
  .top-bar-right {
    flex-wrap: wrap;
    gap: var(--space-sm);
  }
  
  .search-bar {
    width: 100%;
    max-width: 200px;
  }
  
  /* Content Area */
  .content-area {
    padding: var(--space-md);
  }
  
  /* Buttons */
  .btn {
    padding: 10px 20px;
    font-size: 13px;
  }
  
  .btn-sm {
    padding: 8px 14px;
    font-size: 11px;
  }
  
  .btn-lg {
    padding: 14px 28px;
    font-size: 15px;
  }
  
  /* Cards */
  .card {
    padding: var(--space-md);
  }
  
  /* Metrics - Single Column */
  .metrics-row {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
  
  .metric-card {
    padding: var(--space-md);
  }
  
  /* Activity Grid - Single Column */
  .activity-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
  
  .activity-panel {
    max-height: 400px;
  }
  
  /* Forms - Better Touch Targets */
  .form-input,
  .form-select,
  .form-textarea,
  input[type="email"],
  input[type="password"],
  input[type="text"],
  input[type="number"],
  select {
    padding: 14px 16px;
    font-size: 16px; /* Prevents zoom on iOS */
  }
  
  textarea {
    min-height: 120px;
  }
  
  /* Modal - Full Screen on Mobile */
  .modal-content {
    width: 100%;
    max-width: calc(100% - 2rem);
    margin: 1rem;
  }
  
  /* Tables - Horizontal Scroll */
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  table {
    min-width: 600px;
  }
}

/* Small Mobile Breakpoint (480px) */
@media (max-width: 480px) {
  :root {
    font-size: 13px;
  }
  
  /* Top Bar - Simplified */
  .top-bar {
    padding: var(--space-sm) var(--space-sm) var(--space-sm) 3.5rem;
  }
  
  .top-bar-left h1 {
    font-size: 16px;
  }
  
  .search-bar {
    max-width: 150px;
  }
  
  .notification-btn {
    width: 36px;
    height: 36px;
  }
  
  /* Content Area */
  .content-area {
    padding: var(--space-sm);
  }
  
  /* Metrics - Compact */
  .metric-card {
    padding: var(--space-sm) var(--space-md);
  }
  
  .metric-value {
    font-size: 24px;
  }
  
  /* Activity Items - Compact */
  .activity-item {
    padding: var(--space-sm);
  }
  
  /* Buttons - Full Width Option */
  .btn-mobile-full {
    width: 100%;
  }
  
  /* Card Headers - Stack on Mobile */
  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }
  
  /* Modal - Almost Full Screen */
  .modal-content {
    max-width: calc(100% - 1rem);
    margin: 0.5rem;
    max-height: calc(100vh - 1rem);
    overflow-y: auto;
  }
}

/* ========== SPECIAL EFFECTS ========== */
.glow-gold {
  box-shadow: var(--shadow-gold);
}

.glow-gold-strong {
  box-shadow: var(--shadow-gold-strong);
}

.glow-gold-subtle {
  box-shadow: 0 0 15px rgba(203, 164, 74, 0.15);
}

/* Trading Terminal Aesthetic */
.terminal-border {
  border: 1px solid var(--border-light);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.luxury-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-md);
}

/* ========== GLASSMORPHISM ========== */
.glass-panel {
  background: rgba(20, 20, 20, 0.6);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.glass-card {
  background: rgba(20, 20, 20, 0.7);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: all var(--transition-normal);
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow-md);
}

/* ========== DASHBOARD LAYOUT ========== */
.dashboard-layout {
  height: 100vh;
  background: var(--bg-body);
  overflow: hidden;
  position: relative;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  border-right: 1px solid rgba(203, 164, 74, 0.25);
  box-shadow: 1px 0 0 0 rgba(203, 164, 74, 0.08), inset -1px 0 20px rgba(203, 164, 74, 0.03);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
  z-index: 100;
  transition: width var(--transition-slow), border-color var(--transition-slow);
  overflow: hidden;
}

/* Collapsed sidebar — only the toggle button shows */
.sidebar.collapsed {
  width: 56px;
  border-right-color: var(--border);
  box-shadow: none;
}

.sidebar.collapsed .sidebar-nav,
.sidebar.collapsed .sidebar-footer,
.sidebar.collapsed .sidebar-brand {
  display: none;
}

.sidebar.collapsed .sidebar-header {
  height: 100%;
  border-bottom: none;
  justify-content: center;
  padding: 0;
}

.sidebar-header {
  padding: 0 14px;
  height: 90px;
  border-bottom: 1px solid rgba(203, 164, 74, 0.15);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* Sidebar toggle button */
.sidebar-toggle-btn {
  width: 32px;
  height: 32px;
  min-width: 32px;
  max-width: 32px;
  min-height: 32px;
  max-height: 32px;
  border-radius: 50%;
  background: rgba(203, 164, 74, 0.1);
  border: 1.5px solid rgba(203, 164, 74, 0.5);
  display: flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0 !important;
  transition: all var(--transition-normal);
  box-shadow: 0 0 8px rgba(203, 164, 74, 0.12);
}

.sidebar-toggle-btn:hover {
  background: rgba(203, 164, 74, 0.2);
  border-color: rgba(203, 164, 74, 0.9);
  box-shadow: 0 0 16px rgba(203, 164, 74, 0.35);
}

/* Brand takes remaining space, logo centered within it */
.sidebar-brand {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.sidebar-logo-icon {
  height: 44px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  display: block;
  margin-left: 8px;
  filter: brightness(1.2) drop-shadow(0 0 14px rgba(203, 164, 74, 0.35));
  transition: all var(--transition-slow);
}


.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: var(--space-sm) 0;
  overflow: hidden;
  justify-content: space-evenly;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 9px 20px;
  color: var(--text-secondary);
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.2;
  font-weight: 500;
  transition: all var(--transition-fast);
  border-left: 3px solid transparent;
  position: relative;
  white-space: nowrap;
}

.nav-item:hover {
  color: var(--text-primary);
  background: rgba(203, 164, 74, 0.05);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(203, 164, 74, 0.1), rgba(227, 199, 106, 0.1));
  border-left: 3px solid #CBA44A;
  color: #CBA44A;
}

.nav-label {
  transition: opacity var(--transition-slow);
}

.sidebar-footer {
  padding: var(--space-md);
  border-top: 1px solid rgba(203, 164, 74, 0.15);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
  cursor: pointer;
}

.user-profile:hover {
  background: rgba(255, 255, 255, 0.03);
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: font-size var(--transition-fast), opacity var(--transition-slow);
}

.user-role {
  font-size: 11px;
  color: var(--gold-start);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
  transition: opacity var(--transition-slow);
}

/* Main Content */
.main-content {
  position: absolute;
  top: 0;
  left: 260px;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: left var(--transition-slow);
}

.main-content.sidebar-collapsed {
  left: 56px;
}

.top-bar {
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-sidebar);
  flex-shrink: 0;
  width: 100%;
}

.top-bar-left h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.search-bar {
  width: 300px;
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  transition: all var(--transition-normal);
}

.search-bar:focus {
  outline: none;
  border-color: var(--gold-start);
  box-shadow: 0 0 0 1px var(--gold-start);
}

.notification-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.notification-btn:hover {
  border-color: var(--border-medium);
  background: var(--bg-hover);
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 8px;
  height: 8px;
  background: var(--error);
  border-radius: 50%;
  border: 2px solid var(--bg-sidebar);
}

/* Content Area */
.content-area {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-xl);
  background: var(--bg-body);
}

/* Dashboard no-scroll: fit everything in viewport */
.dashboard-no-scroll {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 20px;
}

.dashboard-no-scroll .metrics-row {
  margin-bottom: 0;
  flex-shrink: 0;
}

.dashboard-no-scroll .activity-grid {
  flex: 1;
  min-height: 0;
  margin-bottom: 0;
}

.dashboard-no-scroll .activity-panel {
  max-height: 100%;
  min-height: 0;
  overflow-y: auto;
}

/* Metrics Row */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: var(--space-lg);
}

.metric-card {
  background: rgba(20, 20, 20, 0.7);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  transition: all var(--transition-normal);
}

.metric-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.metric-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.metric-value {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 2px;
  line-height: 1.2;
}

.metric-change {
  font-size: 11px;
  font-weight: 600;
}

.metric-change.positive {
  color: var(--success);
}

.metric-change.negative {
  color: var(--error);
}

/* Activity Feed */
.activity-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.activity-panel {
  background: rgba(20, 20, 20, 0.7);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  max-height: 500px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.panel-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.panel-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: rgba(203, 164, 74, 0.1);
  color: var(--gold-end);
  font-weight: 700;
}

/* Green status badges for LIVE and ACTIVE */
.panel-badge-live,
.panel-badge-active {
  background: rgba(16, 185, 129, 0.12);
  color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  position: relative;
  padding-left: 18px;
}

.panel-badge-live::before,
.panel-badge-active::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 6px #10B981;
  animation: pulse 2s infinite;
}

/* Activity Item */
.activity-item {
  padding: var(--space-md);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  transition: all var(--transition-fast);
}

.activity-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.activity-time {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-xs);
}

.activity-content {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Dashboard Layout Responsive Overrides */
@media (max-width: 1024px) {
  .activity-grid {
    grid-template-columns: 1fr;
  }

  .metrics-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Ensure dashboard no-scroll activity grid stays 2-col on large screens */
@media (min-width: 1025px) {
  .dashboard-no-scroll .activity-grid {
    grid-template-columns: 1.5fr 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar-brand,
  .user-info,
  .nav-item span {
    display: block !important;
  }

  .metrics-row {
    grid-template-columns: 1fr;
  }

  .sidebar-toggle-btn {
    display: none !important;
  }

  .sidebar-header {
    justify-content: center;
  }

  .main-content.sidebar-collapsed {
    left: 0 !important;
  }
}
