/* Universal Custom Luxury Scrollbar - 100% Theme Matched */
* {
  scrollbar-width: thin !important;
  scrollbar-color: #c5a059 #08080a !important;
}
::-webkit-scrollbar {
  width: 6px !important;
  height: 6px !important;
}
::-webkit-scrollbar-track {
  background: #08080a !important;
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #f1e3ad 0%, #c5a059 50%, #997836 100%) !important;
  border-radius: 10px !important;
  border: 1px solid #08080a !important;
}
::-webkit-scrollbar-thumb:hover {
  background: #f1e3ad !important;
  box-shadow: 0 0 10px rgba(197, 160, 89, 0.4) !important;
}
::-webkit-scrollbar-corner {
  background: #08080a !important;
}

:root, [data-theme="dark"] {
  --bg-deep: #08080a;
  --bg-surface: #101014;
  --card-bg: #14141a;
  --card-bg-elevated: #1a1a24;
  --card-border: rgba(197, 160, 89, 0.18);
  --card-border-hover: rgba(197, 160, 89, 0.45);
  
  --gold-primary: #c5a059;
  --gold-light: #f1e3ad;
  --gold-dark: #997836;
  --gold-metallic: #c5a059;
  --gold-champagne: #f5e6b3;
  --gold-gradient: linear-gradient(135deg, #f1e3ad 0%, #c5a059 50%, #997836 100%);
  --gold-glow: rgba(197, 160, 89, 0.28);
  --gold-subtle: rgba(197, 160, 89, 0.08);
  
  --text-main: #f8f9fa;
  --text-sub: #a0a0b0;
  --text-muted: #6c757d;
  
  --green: #10b981;
  --red: #ef4444;
  --sidebar-width: 290px;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', 'Inter', -apple-system, sans-serif;
  --transition-smooth: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
  --bg-deep: #f6f7f9;
  --bg-surface: #ffffff;
  --card-bg: #ffffff;
  --card-bg-elevated: #f8f9fb;
  --card-border: rgba(163, 125, 50, 0.22);
  --card-border-hover: rgba(163, 125, 50, 0.5);
  
  --gold-primary: #a37d32;
  --gold-light: #d4b26f;
  --gold-dark: #7a5b1e;
  --gold-metallic: #b8860b;
  --gold-champagne: #e2c992;
  --gold-gradient: linear-gradient(135deg, #d4b26f 0%, #a37d32 50%, #7a5b1e 100%);
  --gold-glow: rgba(163, 125, 50, 0.18);
  --gold-subtle: rgba(163, 125, 50, 0.08);
  
  --text-main: #0c0d12;
  --text-sub: #4a4c58;
  --text-muted: #717488;
  
  --green: #059669;
  --red: #dc2626;
  --sidebar-width: 290px;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', 'Inter', -apple-system, sans-serif;
  --transition-smooth: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Plus Jakarta Sans', sans-serif; }

html, body {
  margin: 0 !important;
  padding: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  overflow: hidden !important;
  display: flex !important;
  background: var(--bg-deep) !important;
  color: var(--text-main) !important;
  font-family: 'Plus Jakarta Sans', sans-serif !important;
}

.sidebar {
  width: var(--sidebar-width); 
  background: rgba(10, 11, 16, 0.94);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex; flex-direction: column; padding: 22px 16px; flex-shrink: 0; z-index: 10; overflow-y: auto;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.brand-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; padding: 0 6px; }
.brand-icon {
  background: var(--gold-gradient);
  width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: #0a0a0c; 
  box-shadow: 0 8px 24px var(--gold-glow);
  border-top: 1px solid rgba(255, 255, 255, 0.6);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.brand-header:hover .brand-icon { transform: scale(1.05); }
.brand-title { font-size: 1.15rem; font-weight: 900; letter-spacing: -0.5px; color: var(--text-main); line-height: 1.2; font-family: var(--font-sans); }
.brand-title span { display: block; font-size: 0.65rem; font-weight: 800; color: var(--gold-primary); letter-spacing: 1.5px; text-transform: uppercase; }

.nav-section-title { font-size: 0.65rem; font-weight: 800; color: var(--gold-primary); text-transform: uppercase; letter-spacing: 1.3px; margin: 16px 8px 6px 8px; }
.nav-menu { display: flex; flex-direction: column; gap: 4px; list-style: none; }

.nav-item button {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 11px; border: 1px solid transparent; background: transparent; color: var(--text-sub); font-size: 0.82rem; font-weight: 600; cursor: pointer; transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1); text-align: left;
  user-select: none;
}
.nav-item button:hover { 
  background: rgba(255, 255, 255, 0.04); 
  color: #ffffff; 
  border-color: rgba(255, 255, 255, 0.1); 
  border-top-color: rgba(255, 255, 255, 0.18);
  transform: translateX(3px); 
}
.nav-item button.active {
  background: linear-gradient(90deg, rgba(197, 160, 89, 0.16) 0%, rgba(197, 160, 89, 0.03) 100%); 
  color: var(--gold-primary); 
  border-color: rgba(197, 160, 89, 0.35); 
  border-top-color: rgba(245, 230, 179, 0.45);
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 4px 14px rgba(0, 0, 0, 0.25);
}
.nav-item button i { width: 16px; height: 16px; flex-shrink: 0; transition: transform 0.2s ease; }
.nav-item button.active i { color: var(--gold-primary); transform: scale(1.08); }

.sidebar-user { 
  margin-top: auto; padding: 12px 14px; 
  background: rgba(18, 19, 27, 0.7); 
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08); 
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px; 
  display: flex; align-items: center; gap: 10px; 
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1); 
}
.sidebar-user:hover {
  border-color: rgba(197, 160, 89, 0.35);
  transform: translateY(-1px);
}
.user-avatar { 
  width: 34px; height: 34px; border-radius: 10px; 
  background: var(--gold-gradient-soft); 
  border: 1.5px solid var(--gold-primary); 
  border-top: 1.5px solid #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 900; color: var(--gold-primary); font-size: 0.8rem; 
}
.user-info { display: flex; flex-direction: column; }
.user-name { font-size: 0.82rem; font-weight: 800; color: #ffffff; }
.user-role { font-size: 0.68rem; color: var(--gold-primary); font-weight: 700; }

.main-wrapper { flex: 1; display: flex; flex-direction: column; overflow: hidden; height: 100vh; position: relative; }
.top-bar { 
  height: 68px; 
  border-bottom: 1px solid rgba(255, 255, 255, 0.08); 
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding: 0 28px; 
  display: flex; align-items: center; justify-content: space-between; 
  background: rgba(10, 11, 16, 0.82); 
  backdrop-filter: blur(24px) saturate(180%); 
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1); 
  flex-shrink: 0; 
}
.page-info h2 { font-size: 1.2rem; font-weight: 800; letter-spacing: -0.4px; color: #ffffff; }
.page-info p { font-size: 0.74rem; color: var(--text-sub); margin-top: 2px; }

.top-bar-actions { display: flex; align-items: center; gap: 12px; }

.theme-toggle-btn {
  display: inline-flex; align-items: center; gap: 8px; 
  background: rgba(255, 255, 255, 0.04); 
  border: 1px solid rgba(255, 255, 255, 0.08); 
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  padding: 7px 16px; border-radius: 9999px; color: var(--gold-primary); font-size: 0.72rem; font-weight: 800; cursor: pointer; 
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1); 
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}
.theme-toggle-btn:hover { 
  border-color: rgba(197, 160, 89, 0.4); 
  transform: scale(1.02); 
}
.theme-toggle-btn:active { transform: scale(0.97); }
.theme-icon-circle {
  width: 20px; height: 20px; border-radius: 50%; background: var(--gold-gradient); color: #0a0a0c; display: flex; align-items: center; justify-content: center; font-size: 0.75rem;
}

.status-badge { 
  display: inline-flex; align-items: center; gap: 8px; 
  background: rgba(16, 185, 129, 0.1); 
  border: 1px solid rgba(16, 185, 129, 0.25); 
  border-top: 1px solid rgba(16, 185, 129, 0.4);
  padding: 6px 14px; border-radius: 9999px; font-size: 0.7rem; font-weight: 800; color: #86efac; letter-spacing: -0.2px; 
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}
.status-dot { width: 8px; height: 8px; background: #10b981; border-radius: 50%; box-shadow: 0 0 10px #10b981; animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(0.85); } }

.content-area { flex: 1; position: relative; width: 100%; height: calc(100vh - 68px); background: #050508; }
iframe { width: 100%; height: 100%; border: none; background: transparent; display: block; transition: opacity 0.2s ease; }

/* Luxury Fast Loading Overlay */
.module-loader {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(5, 5, 8, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px;
  z-index: 5;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.module-loader.active {
  opacity: 1;
  pointer-events: auto;
}
.loader-spinner {
  width: 44px; height: 44px;
  border: 3px solid rgba(197, 160, 89, 0.15);
  border-top: 3px solid var(--gold-primary);
  border-right: 3px solid rgba(245, 230, 179, 0.5);
  border-radius: 50%;
  animation: hubSpin 0.7s cubic-bezier(0.5, 0.1, 0.5, 0.9) infinite;
}
@keyframes hubSpin { to { transform: rotate(360deg); } }
.loader-text {
  font-size: 0.78rem; font-weight: 800; color: var(--gold-primary); letter-spacing: 1.2px; text-transform: uppercase;
}
/* ============================================================
   EXECUTIVE AUTH SPLIT-CARD · ULTRA LUXURY PRIVATE CONSOLE
   Design System: Champagne Gold, Obsidian Glass & Dimensional Depth
   ============================================================ */
#nexus-auth-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 45%, rgba(229, 192, 123, 0.12) 0%, rgba(14, 15, 22, 0.94) 50%, #040507 100%) !important;
  z-index: 9999999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  padding: 1.5rem;
  overflow-y: auto;
  backdrop-filter: blur(28px) saturate(180%);
}

.auth-split-wrapper {
  background: linear-gradient(145deg, rgba(18, 19, 27, 0.94) 0%, rgba(9, 10, 15, 0.98) 100%) !important;
  border: 1px solid rgba(229, 192, 123, 0.3) !important;
  border-radius: 26px !important;
  max-width: 980px;
  width: 100%;
  box-shadow: 
    0 40px 100px -15px rgba(0, 0, 0, 0.95),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset,
    0 1px 0 rgba(255, 245, 214, 0.4) inset,
    0 20px 60px rgba(200, 156, 70, 0.14) !important;
  display: flex;
  overflow: hidden;
  position: relative;
  backdrop-filter: blur(24px);
}

.auth-portrait-side {
  flex: 1.15;
  position: relative;
  min-height: 560px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2.5rem 2.25rem;
  background: #08090d;
  overflow: hidden;
}

.auth-portrait-bg {
  position: absolute;
  inset: 0;
  background: url('/sergio_serra_portrait.jpg') center top / cover no-repeat;
  opacity: 0.94;
  filter: contrast(1.08) brightness(0.96);
  transform: scale(1.02);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-portrait-side:hover .auth-portrait-bg {
  transform: scale(1.04);
}

.auth-portrait-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 9, 13, 0.25) 0%, rgba(8, 9, 13, 0.1) 30%, rgba(8, 9, 13, 0.78) 65%, #08090d 100%);
  pointer-events: none;
}

.auth-portrait-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent 0%, rgba(229, 192, 123, 0.35) 30%, rgba(229, 192, 123, 0.15) 70%, transparent 100%);
  pointer-events: none;
}

.auth-pill-header {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(14, 15, 22, 0.75);
  border: 1px solid rgba(229, 192, 123, 0.35);
  padding: 6px 14px;
  border-radius: 20px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 245, 214, 0.2);
}

.auth-pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #e5c07b;
  box-shadow: 0 0 8px #e5c07b;
}

.auth-pill-text {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 1.6px;
  color: #f7e7b4;
  text-transform: uppercase;
}

.auth-role-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(229, 192, 123, 0.12);
  border: 1px solid rgba(229, 192, 123, 0.35);
  color: #f9e8be;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-radius: 20px;
  margin-bottom: 8px;
  backdrop-filter: blur(8px);
  box-shadow: inset 0 0 10px rgba(229, 192, 123, 0.08);
}

.auth-author-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.35rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.1;
  margin: 0 0 4px 0;
  background: linear-gradient(180deg, #ffffff 20%, #f6e8c3 60%, #dfba73 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.6));
}

.auth-author-sub {
  color: #d8b775;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin: 0 0 14px 0;
}

.auth-author-desc {
  color: #9ea1b5;
  font-size: 0.78rem;
  line-height: 1.55;
  margin: 0 0 18px 0;
  max-width: 380px;
}

.auth-feature-pill {
  background: rgba(14, 15, 22, 0.65);
  border: 1px solid rgba(229, 192, 123, 0.22);
  padding: 5px 11px;
  border-radius: 8px;
  font-size: 0.66rem;
  font-weight: 700;
  color: #eceef8;
  backdrop-filter: blur(8px);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.auth-feature-pill:hover {
  border-color: rgba(229, 192, 123, 0.5);
  transform: translateY(-1px);
}

.auth-console-side {
  flex: 1;
  padding: 3rem 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #0b0c12;
  position: relative;
}

.auth-monogram-seal {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: linear-gradient(135deg, #FFF3CF 0%, #DEB972 32%, #AF8127 70%, #F5DE9B 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 
    inset 0 1px 1px rgba(255, 255, 255, 0.9),
    inset 0 -1px 2px rgba(0, 0, 0, 0.5),
    0 10px 30px rgba(200, 156, 70, 0.35);
  margin-bottom: 16px;
  border: 1px solid rgba(255, 245, 214, 0.6);
  position: relative;
}

.auth-monogram-seal span {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 900;
  font-size: 1.25rem;
  color: #08090d;
  letter-spacing: -0.5px;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.4));
}

.auth-console-title {
  color: #ffffff;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.4px;
  margin: 0 0 4px 0;
}

.auth-console-subtitle {
  color: #888b9c;
  font-size: 0.78rem;
  font-weight: 500;
  margin: 0;
}

.auth-form-label {
  font-size: 0.68rem;
  color: #d1b47b;
  font-weight: 800;
  display: block;
  margin-bottom: 0.45rem;
  text-transform: uppercase;
  letter-spacing: 1.1px;
}

.auth-input-field {
  width: 100%;
  padding: 0.9rem 1.05rem;
  border-radius: 11px;
  background: rgba(7, 8, 12, 0.75);
  border: 1px solid rgba(229, 192, 123, 0.22);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 500;
  outline: none;
  box-sizing: border-box;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
  transition: all 0.2s ease;
}

.auth-input-field:focus {
  border-color: #d4af37;
  box-shadow: 
    0 0 0 3px rgba(212, 175, 55, 0.16),
    inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

.auth-input-field::placeholder {
  color: #555768;
}

.auth-submit-gold-btn {
  width: 100%;
  padding: 0.95rem;
  border-radius: 11px;
  border: none;
  background: linear-gradient(180deg, #FFF6D8 0%, #E8C882 25%, #C89C46 65%, #9E7324 100%);
  color: #08090d;
  font-weight: 900;
  font-size: 0.85rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 
    inset 0 1px 1px rgba(255, 255, 255, 0.85),
    inset 0 -1px 2px rgba(0, 0, 0, 0.4),
    0 10px 30px -3px rgba(200, 156, 70, 0.45);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.auth-submit-gold-btn:hover {
  transform: translateY(-1.5px);
  filter: brightness(1.05);
  box-shadow: 
    inset 0 1px 1px rgba(255, 255, 255, 0.95),
    inset 0 -1px 2px rgba(0, 0, 0, 0.4),
    0 16px 40px -2px rgba(200, 156, 70, 0.6);
}

.auth-submit-gold-btn:active {
  transform: translateY(0.5px);
  filter: brightness(0.96);
  box-shadow: 
    inset 0 1px 1px rgba(0, 0, 0, 0.4),
    0 4px 15px rgba(200, 156, 70, 0.3);
}

.auth-divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(229, 192, 123, 0.25) 50%, transparent 100%);
}

.auth-divider-text {
  font-size: 0.66rem;
  color: #717488;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 700;
}

.auth-footer-security {
  font-size: 0.67rem;
  color: #55586b;
  line-height: 1.4;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

@media (max-width: 880px) {
  .auth-split-wrapper {
    flex-direction: column !important;
    max-width: 460px !important;
  }
  .auth-portrait-side {
    min-height: 280px !important;
    padding: 1.75rem 1.5rem !important;
  }
  .auth-console-side {
    padding: 2.2rem 1.5rem !important;
  }
}