/* Giavang.mobi — Gold Price Dashboard CSS Stylesheet */

/* --- CSS Variables & Design Tokens --- */
:root {
  /* Color Palette */
  --bg-color: #F0F2F5;          /* Crisp light grey background */
  --card-bg: #FFFFFF;          /* Pure white card backgrounds */
  --text-primary: #111111;      /* Deep black */
  --text-secondary: #3A3A3C;    /* Dark slate gray */
  --text-muted: #636366;        /* Readable medium gray */
  
  --gold-primary: #C59B27;      /* Deeper gold for light mode contrast */
  --gold-light: #F9EBB9;        /* Warm gold background tint */
  --gold-dark: #8E6D15;         /* Deep rich contrast gold */
  --gold-gradient: linear-gradient(135deg, #F3E5AB 0%, #C59B27 50%, #8E6D15 100%);
  --gold-gradient-hover: linear-gradient(135deg, #FFF0B2 0%, #D4AF37 50%, #AA7C11 100%);
  --gold-glow: rgba(197, 155, 39, 0.15);
  
  --trend-up: #059669;          /* Darker emerald for text contrast */
  --trend-up-bg: #D1FAE5;       /* High contrast light green */
  --trend-down: #DC2626;        /* Deeper crimson for contrast */
  --trend-down-bg: #FEE2E2;     /* High contrast light red */
  
  --border-color: #D8D8DC;      /* Darker borders for light mode card visibility */
  --border-focus: #A87C11;

  /* Typography */
  --font-serif: 'Be Vietnam Pro', sans-serif;
  --font-sans: 'Inter', sans-serif;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 24px -8px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 20px 48px -12px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-gold: 0 10px 30px -10px rgba(197, 155, 39, 0.25);
  
  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Dark Theme Variables --- */
html.dark-theme,
body.dark-theme {
  --bg-color: #09090B;          /* Solid deep black */
  --card-bg: #18181B;          /* Solid dark card background */
  --text-primary: #FFFFFF;      /* Pure white text */
  --text-secondary: #D1D1D6;    /* High-contrast light gray */
  --text-muted: #8E8E93;        /* High-contrast medium gray */
  
  --gold-primary: #E5C158;      /* Brighter gold for dark mode contrast */
  --gold-light: #342D15;        /* Deep gold background tint */
  --gold-dark: #F5D374;         /* Glowing contrast gold */
  --gold-gradient: linear-gradient(135deg, #F5D374 0%, #E5C158 50%, #9E7D23 100%);
  --gold-gradient-hover: linear-gradient(135deg, #FFE7A3 0%, #F5D374 50%, #B89330 100%);
  --gold-glow: rgba(229, 193, 88, 0.12);
  
  --trend-up: #34D399;          /* Bright emerald */
  --trend-up-bg: #064E3B;       /* Deep green background */
  --trend-down: #FB7185;        /* Bright crimson */
  --trend-down-bg: #7F1D1D;     /* Deep red background */
  
  --border-color: #2E2E33;      /* Darker grey borders for cards */
  --border-focus: #E5C158;
}

/* --- Base & Reset Rules --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

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

/* --- Announcement Bar --- */
.announcement-bar {
  background-color: #111113;
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(212, 175, 55, 0.15);
  padding: 8px 0;
}

.announcement-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.pulse-indicator {
  display: inline-block;
  width: 6px;
  height: 6px;
  background-color: var(--trend-up);
  border-radius: 50%;
  margin-right: 6px;
  box-shadow: 0 0 8px var(--trend-up);
  animation: pulse-dot 2s infinite;
}

.announcement-text {
  color: #E2E2E5;
  flex-grow: 1;
}

.gold-price-ticker {
  color: #C5C5CA;
}

.gold-price-ticker strong {
  color: var(--gold-primary);
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* --- Premium Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
}

.btn-primary-gold {
  background: var(--gold-gradient);
  color: #111113;
  box-shadow: var(--shadow-gold);
}

.btn-primary-gold:hover {
  background: var(--gold-gradient-hover);
  transform: translateY(-1px);
  box-shadow: 0 12px 36px -8px rgba(212, 175, 55, 0.35);
}

.btn-primary-gold:active {
  transform: translateY(0);
}

.btn-secondary-gold {
  background-color: transparent;
  color: var(--gold-dark);
  border: 1px solid var(--gold-primary);
}

.btn-secondary-gold:hover {
  background-color: rgba(212, 175, 55, 0.05);
  border-color: var(--gold-dark);
  color: var(--gold-dark);
}

.btn-full {
  width: 100%;
}

.btn-large {
  padding: 14px 28px;
  font-size: 14px;
}

/* --- Header Layout --- */
.main-header {
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 16px 0;
}

.header-container {
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-logo-img {
  display: block;
  width: 180px;
  max-width: 42vw;
  height: auto;
}

.gold-monogram {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gold-gradient);
  border-radius: 8px;
  color: #111113;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  box-shadow: var(--shadow-gold);
}

.logo-text h1 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.1;
}

.sub-logo {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.main-nav ul {
  display: flex;
  gap: 18px;
  list-style: none;
}

.main-nav {
  margin-right: auto;
}

.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  position: relative;
  padding: 8px 0;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--gold-primary);
  transition: width var(--transition-fast);
}

.nav-link:hover::after, .nav-link.active::after {
  width: 100%;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.site-header-search {
  flex: 0 1 300px;
  max-width: 320px;
  display: flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 7px 0 11px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  margin-left: auto;
}

.site-header-search svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.site-header-search input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 13px;
}

.site-header-search input::placeholder {
  color: var(--text-muted);
}

.site-header-search button {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  border: 0;
  border-radius: 50%;
  background: var(--gold-primary);
  color: #111827;
  cursor: pointer;
}

.site-header-search button svg {
  width: 14px;
  height: 14px;
}

.market-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(8, 31, 71, 0.96), rgba(10, 83, 156, 0.9) 46%, rgba(2, 18, 45, 0.96));
  border: 1px solid rgba(87, 197, 255, 0.65);
  padding: 8px 14px;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 800;
  color: #7ddcff;
  box-shadow:
    0 0 12px rgba(37, 150, 255, 0.26),
    inset 0 0 14px rgba(120, 220, 255, 0.14);
}

.market-badge::before {
  content: "";
  position: absolute;
  inset: -60% -35%;
  background: linear-gradient(110deg, transparent 32%, rgba(255, 255, 255, 0.36) 48%, transparent 64%);
  transform: translateX(-55%);
  animation: metal-sweep 4.5s linear infinite;
  pointer-events: none;
}

.market-badge span {
  position: relative;
  background: linear-gradient(90deg, #74c8ff, #e8fbff, #2f8dff, #9ee8ff);
  background-size: 260% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 10px rgba(74, 172, 255, 0.58);
  animation: blue-metal-text 3.8s ease-in-out infinite;
}

.market-badge i {
  position: relative;
  color: #80dcff;
  width: 14px;
  height: 14px;
  filter: drop-shadow(0 0 6px rgba(88, 188, 255, 0.85));
}

@keyframes metal-sweep {
  0% { transform: translateX(-60%) rotate(0.001deg); }
  58%, 100% { transform: translateX(60%) rotate(0.001deg); }
}

@keyframes blue-metal-text {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@media (max-width: 1180px) and (min-width: 769px) {
  .header-container {
    gap: 16px;
  }

  .main-nav ul {
    gap: 14px;
  }

  .nav-link {
    font-size: 13px;
  }

  .site-header-search {
    flex-basis: 280px;
  }

  .market-badge {
    display: none;
  }
}

/* --- Common Layout Elements --- */
.badge-tag {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin-bottom: 6px;
}

.card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  padding: 24px;
  transition: box-shadow var(--transition-normal), border-color var(--transition-normal);
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

/* --- Main Dashboard Grid Layout --- */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2.1fr 0.9fr;
  gap: 24px;
  padding-top: 32px;
  padding-bottom: 60px;
  min-width: 0;
}

.overview-section {
  grid-column: span 2;
  margin-bottom: 8px;
  min-width: 0;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 20px;
}

.section-header h1,
.section-header h2 {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.time-stamp {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.time-stamp i {
  width: 14px;
  height: 14px;
}

/* --- Overview Metrics Grid & Cards --- */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  min-width: 0;
}

.metric-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 22px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  min-width: 0;
}

.gold-border-hover::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--gold-gradient);
  opacity: 0.3;
  transition: opacity var(--transition-fast);
}

.gold-border-hover:hover::before {
  opacity: 1;
}

.gold-border-hover:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), 0 0 20px rgba(212, 175, 55, 0.05);
  border-color: rgba(212, 175, 55, 0.25);
}

.card-glow {
  position: absolute;
  top: 0;
  right: 0;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, var(--gold-glow) 0%, rgba(255, 255, 255, 0) 70%);
  opacity: 0;
  transition: opacity var(--transition-normal);
  pointer-events: none;
}

.metric-card:hover .card-glow {
  opacity: 1;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.metric-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.metric-icon {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 4px 8px;
  border-radius: 4px;
}

.gold-accent-icon {
  background-color: var(--gold-light);
  color: var(--gold-dark);
}

.pnj-accent-icon {
  background-color: #E2EAF8;
  color: #1E3A8A;
}

.doji-accent-icon {
  background-color: #FEE2E2;
  color: #991B1B;
}

.btmc-accent-icon {
  background-color: #FEF3C7;
  color: #92400E;
}

.btmh-accent-icon {
  background-color: #FFF7ED;
  color: #9A3412;
  font-size: 8px;
}

.phuquy-accent-icon {
  background-color: #ECFDF5;
  color: #047857;
}

.mihong-accent-icon {
  background-color: #FCE7F3;
  color: #BE185D;
}

.ngoctham-accent-icon {
  background-color: #E0F2FE;
  color: #0369A1;
}

.global-accent-icon {
  background-color: #F3F4F6;
  color: #374151;
  display: flex;
  align-items: center;
  justify-content: center;
}

.global-accent-icon i {
  width: 12px;
  height: 12px;
}

.home-news-slider {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(220px, 1fr);
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 8px;
}

.home-news-card {
  scroll-snap-align: start;
  display: grid;
  gap: 8px;
  min-height: 210px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px;
  color: var(--text-primary);
  text-decoration: none;
  background: var(--bg-secondary);
}

.home-news-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 6px;
}

.home-news-card span {
  color: var(--gold-primary);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.home-news-card strong {
  font-size: 14px;
  line-height: 1.35;
}

.news-sidebar-card {
  display: grid;
  gap: 16px;
}

.article-sidebar .news-sidebar-card {
  padding: 20px;
}

.news-sidebar-list {
  display: grid;
  gap: 0;
}

.news-sidebar-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border-color);
}

.news-sidebar-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.news-sidebar-item:last-child {
  padding-bottom: 0;
}

.news-sidebar-item img {
  width: 72px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.news-sidebar-content {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.news-sidebar-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--gold-primary);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.news-sidebar-meta span {
  color: var(--text-muted);
  font-weight: 600;
}

.news-sidebar-item strong {
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-sidebar-item:hover strong {
  color: var(--gold-dark);
}

@media (min-width: 1180px) {
  .home-news-slider {
    grid-auto-columns: calc((100% - 24px) / 3);
  }
}

.metric-price-row {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
  min-width: 0;
}

.price-box {
  flex: 1;
  min-width: 0;
}

.price-title {
  display: block;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.price-val {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.unit-val {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-left: 2px;
}

.price-divider {
  width: 1px;
  height: 32px;
  background-color: var(--border-color);
  margin: 0 16px;
}

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

.trend-up {
  color: var(--trend-up);
  background-color: var(--trend-up-bg);
}

.trend-down {
  color: var(--trend-down);
  background-color: var(--trend-down-bg);
}

.spread-info {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* --- Interactive Chart Section --- */
.chart-section {
  display: flex;
  flex-direction: column;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.chart-title-area h3 {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
}

.chart-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.chart-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.premium-select {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  outline: none;
  transition: all var(--transition-fast);
}

.premium-select:hover, .premium-select:focus {
  border-color: var(--gold-primary);
}

.premium-select-full {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  outline: none;
  transition: all var(--transition-fast);
}

.premium-select-full:focus {
  border-color: var(--gold-primary);
}

.timeframe-buttons {
  display: flex;
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 3px;
}

.tf-btn {
  background: none;
  border: none;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 6px 12px;
  cursor: pointer;
  border-radius: 6px;
  transition: all var(--transition-fast);
}

.tf-btn:hover {
  color: var(--text-primary);
}

.tf-btn.active {
  background-color: var(--card-bg);
  color: var(--gold-dark);
  box-shadow: var(--shadow-sm);
}

.chart-canvas-container {
  position: relative;
  height: 320px;
  width: 100%;
}

.chart-summary-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--border-color);
  margin-top: 24px;
  padding-top: 16px;
  gap: 16px;
}

.chart-summary-item {
  display: flex;
  flex-direction: column;
}

.summary-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.summary-val {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

/* --- Sidebar Section Layout --- */
.sidebar-layout {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar-card {
  display: flex;
  flex-direction: column;
}

.sidebar-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.sidebar-card-header h4 {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.gold-icon {
  color: var(--gold-primary);
  width: 18px;
  height: 18px;
}

.sidebar-card-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.4;
}

/* --- Calculator Form CSS --- */
.calc-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-group label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background-color: var(--bg-color);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.input-wrapper:focus-within {
  border-color: var(--gold-primary);
}

.input-wrapper input {
  flex-grow: 1;
  background: none;
  border: none;
  outline: none;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 14px;
  color: var(--text-primary);
}

.calc-select {
  background-color: var(--card-bg);
  border: none;
  border-left: 1px solid var(--border-color);
  outline: none;
  padding: 0 12px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
}

.input-suffix {
  display: flex;
  align-items: center;
  padding: 0 12px;
  background-color: var(--card-bg);
  border-left: 1px solid var(--border-color);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.input-prefix {
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-right: 1px solid var(--border-color);
  color: var(--text-muted);
}

.input-prefix i {
  width: 14px;
  height: 14px;
}

.calc-results {
  background-color: var(--bg-color);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.result-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
}

.result-val {
  font-size: 14px;
  font-weight: 700;
}

.result-val.highlight {
  font-size: 16px;
  color: var(--gold-dark);
}

/* --- Sentiment & Insight bullet points --- */
.sentiment-indicator {
  margin-bottom: 16px;
}

.sentiment-bar {
  height: 6px;
  background-color: #E2E8F0;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.sentiment-fill-bullish {
  height: 100%;
  background: var(--gold-gradient);
  border-radius: 3px;
}

.sentiment-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.insight-bullet {
  display: flex;
  gap: 10px;
  font-size: 12px;
  line-height: 1.4;
  margin-top: 12px;
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
}

.insight-bullet i {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
}

.insight-bullet strong {
  color: var(--text-primary);
}

/* --- Data Grid Section & Table CSS --- */
.grid-section {
  grid-column: span 2;
}

.grid-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.grid-header h3 {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
}

.grid-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  width: 240px;
}

.search-box input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-primary);
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  outline: none;
  transition: all var(--transition-fast);
}

.search-box input:focus {
  border-color: var(--gold-primary);
  width: 280px; /* Expands slightly when focused */
}

.search-box i,
.search-box svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.filter-tabs {
  display: flex;
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 3px;
}

.filter-tab {
  background: none;
  border: none;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 6px 14px;
  cursor: pointer;
  border-radius: 6px;
  transition: all var(--transition-fast);
}

.filter-tab:hover {
  color: var(--text-primary);
}

.filter-tab.active {
  background-color: var(--card-bg);
  color: var(--gold-dark);
  box-shadow: var(--shadow-sm);
}

.table-scroll-container {
  overflow-x: auto;
  margin: 0 -24px;
  padding: 0 24px;
}

.table-scroll-wrapper {
  position: relative;
  min-width: 0;
}

.table-scroll-cue {
  display: none;
}

.luxury-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.luxury-table th {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  padding: 14px 16px;
  user-select: none;
}

.luxury-table th.sortable {
  cursor: pointer;
  transition: color var(--transition-fast);
}

.luxury-table th.sortable:hover {
  color: var(--text-primary);
}

.sort-icon {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 4px;
  vertical-align: middle;
  opacity: 0.5;
}

.luxury-table td {
  padding: 16px;
  font-size: 13px;
  font-weight: 500;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.luxury-table tbody tr {
  transition: background-color var(--transition-fast);
}

.luxury-table tbody tr:hover {
  background-color: rgba(250, 249, 246, 0.6);
}

.brand-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon-sm {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
}

.brand-name-info {
  display: flex;
  flex-direction: column;
}

.brand-subname {
  font-size: 11px;
  color: var(--text-muted);
}

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

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

.trend-indicator-cell {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
}

.spread-cell {
  color: var(--text-secondary);
}

#market-grid .table-scroll-container {
  border: 1px solid color-mix(in srgb, var(--gold-primary) 18%, var(--border-color));
  border-radius: 8px;
  padding: 0;
  margin: 0;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--gold-light) 30%, transparent), transparent 44%),
    var(--card-bg);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--gold-primary) 14%, transparent);
}

#market-grid .luxury-table {
  border-collapse: separate;
  border-spacing: 0;
}

#market-grid .luxury-table thead th {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--gold-light) 70%, var(--card-bg)), color-mix(in srgb, var(--card-bg) 94%, var(--gold-primary)));
  color: var(--gold-dark);
  border-bottom-color: color-mix(in srgb, var(--gold-primary) 30%, var(--border-color));
}

#market-grid .luxury-table thead th:first-child {
  border-top-left-radius: 8px;
}

#market-grid .luxury-table thead th:last-child {
  border-top-right-radius: 8px;
}

#market-grid .luxury-table tbody tr:nth-child(odd) td {
  background-color: color-mix(in srgb, var(--gold-light) 10%, transparent);
}

#market-grid .luxury-table tbody tr:hover td {
  background-color: color-mix(in srgb, var(--gold-light) 26%, var(--card-bg));
}

#market-grid .luxury-table tbody td {
  border-bottom-color: color-mix(in srgb, var(--gold-primary) 10%, var(--border-color));
}

#market-grid .luxury-table tbody td:nth-child(2) {
  color: var(--trend-up);
}

#market-grid .luxury-table tbody td:nth-child(3) {
  color: var(--trend-down);
}

#market-grid .luxury-table .spread-cell,
#market-grid .luxury-table tbody td:nth-child(4) {
  color: var(--gold-dark);
  font-weight: 700;
}

html.dark-theme #market-grid .table-scroll-container,
body.dark-theme #market-grid .table-scroll-container {
  background:
    linear-gradient(135deg, rgba(229, 193, 88, 0.1), transparent 48%),
    color-mix(in srgb, var(--card-bg) 92%, #000);
}

html.dark-theme #market-grid .luxury-table thead th,
body.dark-theme #market-grid .luxury-table thead th {
  background:
    linear-gradient(180deg, rgba(229, 193, 88, 0.15), rgba(229, 193, 88, 0.055));
}

.brand-detail-view .table-scroll-container {
  border: 1px solid color-mix(in srgb, var(--gold-primary) 22%, var(--border-color));
  border-radius: 8px;
  padding: 0;
  margin: 0;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--gold-light) 38%, transparent), transparent 42%),
    var(--card-bg);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--gold-primary) 18%, transparent);
}

.brand-detail-view .luxury-table {
  border-collapse: separate;
  border-spacing: 0;
}

.brand-detail-view .luxury-table thead th {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--gold-light) 72%, var(--card-bg)), color-mix(in srgb, var(--card-bg) 92%, var(--gold-primary)));
  color: var(--gold-dark);
  border-bottom-color: color-mix(in srgb, var(--gold-primary) 34%, var(--border-color));
}

.brand-detail-view .luxury-table thead th:first-child {
  border-top-left-radius: 8px;
}

.brand-detail-view .luxury-table thead th:last-child {
  border-top-right-radius: 8px;
}

.brand-detail-view .luxury-table tbody tr:nth-child(odd) td {
  background-color: color-mix(in srgb, var(--gold-light) 12%, transparent);
}

.brand-detail-view .luxury-table tbody tr:hover td {
  background-color: color-mix(in srgb, var(--gold-light) 28%, var(--card-bg));
}

.brand-detail-view .luxury-table tbody td {
  border-bottom-color: color-mix(in srgb, var(--gold-primary) 12%, var(--border-color));
}

.brand-detail-view .luxury-table tbody td:first-child strong {
  color: var(--text-primary);
}

.brand-detail-view .luxury-table tbody td:nth-child(2) {
  color: var(--trend-up);
}

.brand-detail-view .luxury-table tbody td:nth-child(3) {
  color: var(--trend-down);
}

.brand-detail-view .luxury-table .spread-cell,
.brand-detail-view .luxury-table tbody td:nth-child(4) {
  color: var(--gold-dark);
  font-weight: 700;
}

html.dark-theme .brand-detail-view .table-scroll-container,
body.dark-theme .brand-detail-view .table-scroll-container {
  background:
    linear-gradient(135deg, rgba(229, 193, 88, 0.11), transparent 48%),
    color-mix(in srgb, var(--card-bg) 92%, #000);
}

html.dark-theme .brand-detail-view .luxury-table thead th,
body.dark-theme .brand-detail-view .luxury-table thead th {
  background:
    linear-gradient(180deg, rgba(229, 193, 88, 0.16), rgba(229, 193, 88, 0.06));
}

/* --- Footer CSS --- */
.main-footer {
  background-color: #111113;
  color: #C5C5CA;
  border-top: 1px solid rgba(212, 175, 55, 0.1);
  padding: 60px 0 30px;
  margin-top: 60px;
}

.footer-content {
  display: grid;
  grid-template-columns: minmax(260px, 1.1fr) minmax(0, 1.6fr);
  gap: 60px;
  margin-bottom: 40px;
}

.logo-area-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  color: #FFFFFF;
}

.footer-logo-img {
  display: block;
  width: 180px;
  max-width: 100%;
  height: auto;
  filter: drop-shadow(0 8px 18px rgba(197, 155, 39, 0.18));
}

.logo-area-footer h2 {
  font-family: var(--font-serif);
  font-size: 20px;
  letter-spacing: 0.08em;
}

.footer-info p {
  font-size: 13px;
  line-height: 1.6;
  max-width: 480px;
  color: #8E8E93;
}

.footer-contact-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
  max-width: 520px;
  color: #aeb0b7;
  font-size: 13px;
  line-height: 1.55;
}

.footer-contact-list strong {
  color: #f1d57a;
}

.footer-contact-list a {
  color: #d9dde7;
  text-decoration: none;
}

.footer-contact-list a:hover {
  color: var(--gold-primary);
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 34px;
}

.links-group h5 {
  font-family: var(--font-serif);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #FFFFFF;
  margin-bottom: 16px;
  text-transform: uppercase;
}

.links-group ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.links-group ul a {
  font-size: 13px;
  color: #8E8E93;
}

.links-group ul a:hover {
  color: var(--gold-primary);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 12px;
  color: #55555A;
}

.footer-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: rgba(229, 193, 88, 0.08);
  border: 1px solid rgba(229, 193, 88, 0.22);
  color: #e5c158;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* --- Premium Modal Dialog CSS --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(17, 17, 19, 0.4);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  max-width: 480px;
  width: 90%;
  padding: 36px;
  position: relative;
  transform: translateY(20px);
  transition: transform var(--transition-normal);
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

.modal-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close-btn:hover {
  color: var(--text-primary);
}

.modal-close-btn i {
  width: 18px;
  height: 18px;
}

.modal-header {
  text-align: center;
  margin-bottom: 24px;
}

.modal-icon-container {
  width: 48px;
  height: 48px;
  background-color: var(--gold-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.modal-icon-container i {
  width: 20px;
  height: 20px;
}

.modal-header h3 {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

.modal-header p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cms-post-content {
  color: var(--text-secondary);
  font-size: 13.5px;
  line-height: 1.6;
}

.cms-post-content p,
.about-modal-content p {
  margin-bottom: 10px;
}

.modal-row-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.terms-agree {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 4px;
  margin-bottom: 8px;
}

.terms-agree input {
  margin-top: 4px;
  accent-color: var(--gold-dark);
}

.terms-agree label {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
  cursor: pointer;
}

/* --- Toast Notifications Stack --- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 2000;
  pointer-events: none;
}

.toast {
  background-color: #111113;
  color: #FFFFFF;
  padding: 14px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: auto;
  border-left: 3px solid var(--gold-primary);
  animation: toast-in var(--transition-normal) forwards;
}

.toast i {
  width: 16px;
  height: 16px;
}

.toast-success i {
  color: var(--trend-up);
}

.toast-info i {
  color: var(--gold-primary);
}

@keyframes toast-in {
  to { transform: translateY(0); opacity: 1; }
}

.toast.fade-out {
  animation: toast-out var(--transition-normal) forwards;
}

@keyframes toast-out {
  to { transform: translateY(10px); opacity: 0; }
}

/* --- Responsive Adjustments --- */
@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .overview-section {
    grid-column: span 1;
  }
  .grid-section {
    grid-column: span 1;
  }
}

@media (max-width: 768px) {
  html, body {
    overflow-x: hidden;
  }
  .container {
    padding-left: 16px;
    padding-right: 16px;
  }
  .dashboard-grid,
  .overview-section,
  .main-left-column,
  .sidebar-layout,
  .grid-section,
  .chart-section,
  .card {
    min-width: 0;
  }
  .main-header {
    padding: 12px 0;
  }
  .header-container {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px 12px;
    align-items: center;
  }
  .logo-area {
    flex: 1 1 auto;
    min-width: 0;
  }
  .site-logo-img {
    width: 150px;
    max-width: 58vw;
  }
  .main-nav {
    order: 3;
    display: none;
    width: 100%;
    margin-right: 0;
  }
  .site-header-search {
    order: 4;
    display: none;
    flex: 1 1 100%;
    width: 100%;
    margin-top: 10px;
  }
  .mobile-menu-open .site-header-search {
    display: flex;
  }
  .mobile-menu-open .main-nav {
    display: block;
  }
  .main-nav ul {
    flex-direction: column;
    gap: 0;
    width: 100%;
    min-width: 100%;
    padding: 8px 0 0;
    border-top: 1px solid var(--border-color);
  }
  .nav-link {
    display: block;
    width: 100%;
    padding: 12px 0;
    font-size: 13px;
  }
  .header-actions {
    width: auto;
    margin-left: auto;
    justify-content: flex-end;
    gap: 8px;
  }
  .market-badge {
    display: none;
  }
  .mobile-menu-toggle {
    display: inline-flex;
  }
  .sub-nav-bar {
    display: none;
    padding: 0 0 12px;
  }
  .mobile-menu-open .sub-nav-bar {
    display: block;
  }
  .sub-nav-container {
    justify-content: stretch;
  }
  #header-nav-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    min-width: 100%;
    gap: 8px;
  }
  .sub-nav-link {
    display: block;
    text-align: center;
    white-space: nowrap;
  }
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .chart-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .chart-controls {
    width: 100%;
    justify-content: space-between;
  }
  .chart-summary-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .modal-row-grid {
    grid-template-columns: 1fr;
  }
  .footer-content {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .footer-links {
    flex-wrap: wrap;
  }
  .grid-header {
    align-items: stretch;
  }
  .grid-actions {
    width: 100%;
    align-items: stretch;
  }
  .search-box {
    width: 100%;
  }
  .search-box input:focus {
    width: 100%;
  }
  .filter-tabs {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .filter-tab {
    flex: 1 0 auto;
    white-space: nowrap;
  }
  #market-grid .luxury-table,
  .brand-detail-view .luxury-table {
    min-width: 620px;
  }
}

@media (max-width: 480px) {
  .metrics-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .metric-card,
  .card,
  .org-card {
    width: 100%;
    max-width: 100%;
    padding: 16px;
  }
  .metric-price-row {
    gap: 10px;
    align-items: stretch;
  }
  .price-box {
    min-width: 0;
  }
  .price-divider {
    margin: 0 6px;
  }
  .price-val {
    font-size: 18px;
    word-break: break-word;
  }
  .card-footer,
  .org-card-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
  .chart-summary-row {
    grid-template-columns: 1fr;
  }
  .table-scroll-container {
    margin: 0;
    padding: 0;
    max-width: 100%;
  }
  .luxury-table th, .luxury-table td {
    padding: 12px 8px;
    font-size: 12px;
  }
  .section-title-wrapper h2,
  .section-header h1,
  .section-header h2 {
    font-size: 22px;
  }
  .grid-header h3,
  .chart-title-area h3 {
    font-size: 18px;
  }
}

/* --- Global Theme Transitions --- */
.card, .metric-card, .org-card, .main-header, .main-footer, 
.luxury-table th, .luxury-table td, .luxury-table tr, 
input, select, button, .input-wrapper, .filter-tabs, .timeframe-buttons,
.announcement-bar, .market-badge {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* --- Theme Toggle Button --- */
.theme-toggle-btn {
  padding: 8px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background-color: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  cursor: pointer;
}
.theme-toggle-btn:hover {
  background-color: var(--bg-color);
  color: var(--gold-primary);
  border-color: var(--gold-primary);
}

.mobile-menu-toggle {
  display: none;
}

/* --- Main Left Column Layout --- */
.main-left-column {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* --- Org Rates Section (8 Brands) --- */
.org-rates-section {
  grid-column: span 2;
  margin-bottom: 8px;
}
.section-title-wrapper {
  margin-bottom: 20px;
}
.section-title-wrapper h2 {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.org-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.org-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-normal);
}
.org-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(212, 175, 55, 0.25);
}
.org-card:focus-visible {
  outline: 2px solid var(--gold-primary);
  outline-offset: 3px;
}
.org-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.org-logo-wrapper {
  height: 24px;
  display: flex;
  align-items: center;
}
.org-logo-svg {
  height: 20px;
  max-width: 90px;
}
.org-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-serif);
  letter-spacing: 0.03em;
}
.org-price-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  border-top: 1px dashed var(--border-color);
  border-bottom: 1px dashed var(--border-color);
  padding: 10px 0;
  margin: 4px 0;
}
.org-price-box {
  display: flex;
  flex-direction: column;
}
.org-price-lbl {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 2px;
  letter-spacing: 0.02em;
}
.org-price-val {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.org-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.org-spread {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}

@media (max-width: 1024px) {
  .org-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 580px) {
  .org-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Sticky Header Wrapper --- */
.sticky-header-wrapper {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.mobile-menu-overlay {
  display: none;
}

/* --- Sub Navigation Bar --- */
.sub-nav-bar {
  background-color: var(--card-bg);
  padding: 10px 0;
  overflow-x: auto;
  white-space: nowrap;
}
.sub-nav-container {
  display: flex;
  justify-content: center;
}
#header-nav-2 {
  display: flex;
  gap: 16px;
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
}
#header-nav-2 li {
  display: inline-block;
}
#header-nav-2 li a {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
}
#header-nav-2 li a:hover {
  color: var(--gold-primary);
  background-color: rgba(197, 155, 39, 0.05);
}
#header-nav-2 li.active a {
  background-color: var(--gold-light);
  color: var(--gold-dark);
  border-color: var(--gold-primary);
}
/* For dark theme */
html.dark-theme #header-nav-2 li.active a,
body.dark-theme #header-nav-2 li.active a {
  background-color: var(--gold-light); /* deep gold bg in dark theme */
  color: var(--text-primary);
  border-color: var(--gold-primary);
}

.back-to-top-btn {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1100;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--gold-primary) 40%, var(--border-color));
  background: var(--gold-gradient);
  color: #111113;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-lg), var(--shadow-gold);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.back-to-top-btn.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top-btn:hover {
  box-shadow: var(--shadow-lg), 0 0 0 4px color-mix(in srgb, var(--gold-primary) 18%, transparent);
}

.back-to-top-btn i,
.back-to-top-btn svg {
  width: 19px;
  height: 19px;
  stroke-width: 2.5;
}

/* --- Brand Detail View Layout --- */
.brand-detail-header-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 24px;
  margin-bottom: 24px;
}
.back-to-dashboard-btn {
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand-detail-title-area {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-grow: 1;
}
.brand-detail-logo {
  height: 36px;
  display: flex;
  align-items: center;
}
.brand-detail-logo .org-logo-svg {
  height: 28px;
  max-width: 120px;
}
.brand-detail-info h1,
.brand-detail-info h2 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
}
.detail-brand-sub {
  font-size: 12px;
  color: var(--text-secondary);
}
.brand-detail-grid {
  display: grid;
  grid-template-columns: 2.1fr 0.9fr;
  gap: 24px;
  margin-bottom: 60px;
}
.about-brand-text {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.about-brand-text p {
  margin-bottom: 12px;
}

.brand-seo-article {
  max-height: 700px;
  overflow-y: auto;
  padding-right: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-primary) color-mix(in srgb, var(--gold-light) 35%, transparent);
}

.brand-seo-article::-webkit-scrollbar {
  width: 8px;
}

.brand-seo-article::-webkit-scrollbar-track {
  background: color-mix(in srgb, var(--gold-light) 30%, transparent);
  border-radius: 999px;
}

.brand-seo-article::-webkit-scrollbar-thumb {
  background: var(--gold-primary);
  border-radius: 999px;
}

.home-seo-section {
  width: 100%;
  margin-bottom: 0;
}

.home-seo-section .section-title-wrapper {
  max-width: 920px;
}

.home-seo-article {
  margin-top: 18px;
}

.sitemap-page {
  padding-top: 32px;
  padding-bottom: 36px;
}

.sitemap-hero {
  margin-bottom: 22px;
  padding: 28px;
}

.sitemap-hero h1 {
  margin: 10px 0 8px;
  font-family: var(--font-serif);
  font-size: 34px;
  line-height: 1.15;
  color: var(--text-primary);
}

.sitemap-hero p {
  max-width: 760px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.sitemap-hero a,
.sitemap-link-card {
  color: var(--gold-dark);
}

.sitemap-list-card {
  padding: 24px;
}

.sitemap-link-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.sitemap-link-card {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--gold-primary) 24%, var(--border-color));
  border-radius: 8px;
  background: color-mix(in srgb, var(--gold-light) 18%, var(--card-bg));
  text-decoration: none;
}

.sitemap-link-card:hover {
  border-color: var(--gold-primary);
  box-shadow: var(--shadow-sm);
}

.sitemap-link-card span {
  color: var(--text-primary);
  font-weight: 800;
}

.sitemap-link-card small {
  color: var(--text-muted);
  word-break: break-all;
}

@media (max-width: 768px) {
  .sitemap-page {
    padding-top: 20px;
  }

  .sitemap-hero,
  .sitemap-list-card {
    padding: 18px;
  }

  .sitemap-hero h1 {
    font-size: 26px;
  }

  .sitemap-link-grid {
    grid-template-columns: 1fr;
  }
}

body:has(#dashboard) .dashboard-grid {
  padding-bottom: 24px;
}

body:has(#dashboard) .main-footer {
  margin-top: 28px;
}

.brand-seo-article h3 {
  color: var(--text-primary);
  font-family: var(--font-serif);
  font-size: 19px;
  line-height: 1.35;
  margin: 22px 0 10px;
}

.brand-seo-article h3:first-child {
  margin-top: 0;
}

.brand-seo-article a {
  color: var(--gold-dark);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.brand-seo-figure {
  width: 640px;
  max-width: 100%;
  margin: 22px auto;
}

.brand-seo-figure img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 2 / 1;
  object-fit: cover;
  border: 1px solid color-mix(in srgb, var(--gold-primary) 28%, var(--border-color));
  border-radius: 8px;
  background: #0b1726;
}

.brand-seo-figure figcaption {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 8px;
}
@media (max-width: 1024px) {
  .brand-detail-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Public Article Page --- */
.article-page {
  padding: 32px 0 72px;
}

.article-shell {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.article-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}

.article-breadcrumb a {
  color: var(--text-secondary);
}

.article-breadcrumb a:hover {
  color: var(--gold-dark);
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}

.article-main-card,
.article-side-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
}

.article-main-card {
  overflow: hidden;
}

.article-hero {
  padding: 30px 34px 24px;
  border-bottom: 1px solid var(--border-color);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

.article-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.article-meta i {
  width: 15px;
  height: 15px;
}

.article-category {
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--gold-light);
  color: var(--gold-dark);
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: 11px;
}

.article-hero h1 {
  max-width: 900px;
  color: var(--text-primary);
  font-family: var(--font-serif);
  font-size: clamp(30px, 3.2vw, 44px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: 0;
  margin-bottom: 16px;
}

.article-excerpt {
  max-width: 860px;
  color: var(--text-secondary);
  font-size: 18px;
  line-height: 1.7;
  margin-bottom: 22px;
}

.article-thumb {
  display: block;
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.article-toc {
  margin: 26px 34px 0;
  padding: 18px 20px;
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--gold-primary);
  border-radius: 8px;
  background: rgba(197, 155, 39, 0.06);
}

.article-toc strong {
  display: block;
  color: var(--text-primary);
  font-family: var(--font-serif);
  font-size: 18px;
  margin-bottom: 10px;
}

.article-toc ol {
  margin-left: 18px;
  color: var(--text-secondary);
  line-height: 1.7;
  font-weight: 600;
}

.article-toc li {
  padding-left: 4px;
}

.article-toc li.is-sub {
  margin-left: 16px;
  color: var(--text-muted);
}

.article-body {
  padding: 28px 34px 38px;
  color: var(--text-secondary);
  font-size: 17px;
  line-height: 1.85;
}

.article-body > *:first-child {
  margin-top: 0;
}

.article-body p {
  margin: 0 0 18px;
}

.article-body h2,
.article-body h3,
.article-body h4 {
  color: var(--text-primary);
  font-family: var(--font-serif);
  letter-spacing: 0;
}

.article-body h2 {
  font-size: 28px;
  line-height: 1.28;
  margin: 36px 0 14px;
  padding-top: 8px;
}

.article-body h3 {
  font-size: 22px;
  line-height: 1.35;
  margin: 28px 0 12px;
}

.article-body h4 {
  font-size: 18px;
  line-height: 1.4;
  margin: 22px 0 10px;
}

.article-body ul,
.article-body ol {
  margin: 0 0 22px 24px;
  padding: 0;
}

.article-body li {
  margin: 8px 0;
  padding-left: 4px;
}

.article-body a {
  color: var(--gold-dark);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 24px auto;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.article-body blockquote {
  margin: 24px 0;
  padding: 16px 20px;
  border-left: 4px solid var(--gold-primary);
  border-radius: 0 8px 8px 0;
  background: rgba(197, 155, 39, 0.08);
  color: var(--text-primary);
  font-weight: 600;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  overflow: hidden;
  border-radius: 8px;
}

.article-body th,
.article-body td {
  border: 1px solid var(--border-color);
  padding: 12px;
  text-align: left;
}

.article-body th {
  background: var(--gold-light);
  color: var(--text-primary);
}

.article-sidebar {
  position: sticky;
  top: 142px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.article-side-card {
  padding: 20px;
}

.article-side-card h2 {
  color: var(--text-primary);
  font-family: var(--font-serif);
  font-size: 20px;
  line-height: 1.3;
  margin: 8px 0 10px;
}

.article-side-card p {
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 16px;
}

.article-brand-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.article-brand-links a {
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-color);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
}

.article-brand-links a:hover {
  border-color: var(--gold-primary);
  color: var(--gold-dark);
}

@media (max-width: 1080px) {
  .article-layout {
    grid-template-columns: 1fr;
  }

  .article-sidebar {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .article-page {
    padding: 20px 0 48px;
  }

  .article-hero,
  .article-body {
    padding-left: 18px;
    padding-right: 18px;
  }

  .article-hero h1 {
    font-size: 30px;
  }

  .article-excerpt {
    font-size: 16px;
  }

  .article-toc {
    margin-left: 18px;
    margin-right: 18px;
  }

  .article-sidebar {
    grid-template-columns: 1fr;
  }
}

/* --- News Index Page --- */
.news-index-shell {
  display: grid;
  gap: 24px;
}

.news-index-hero {
  max-width: 860px;
}

.news-index-hero h1 {
  color: var(--text-primary);
  font-family: var(--font-serif);
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1.08;
  letter-spacing: 0;
  margin: 10px 0 14px;
}

.news-index-hero p {
  color: var(--text-secondary);
  font-size: 17px;
  line-height: 1.7;
}

.news-index-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.news-index-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  overflow: hidden;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  color: var(--text-primary);
}

.news-index-card:hover {
  border-color: var(--gold-primary);
  transform: translateY(-2px);
}

.news-index-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-bottom: 1px solid var(--border-color);
}

.news-index-card-body {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.news-index-card h2 {
  color: var(--text-primary);
  font-family: var(--font-serif);
  font-size: 21px;
  line-height: 1.32;
  letter-spacing: 0;
}

.news-index-card p {
  color: var(--text-secondary);
  line-height: 1.65;
}

.news-index-pagination {
  display: flex;
  justify-content: center;
}

.frontend-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.frontend-page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-fast), color var(--transition-fast), background-color var(--transition-fast), transform var(--transition-fast);
}

.frontend-page-link svg {
  width: 17px;
  height: 17px;
}

.frontend-page-link:hover {
  border-color: var(--gold-primary);
  color: var(--gold-primary);
  transform: translateY(-1px);
}

.frontend-page-link-active {
  background: var(--gold-gradient);
  border-color: var(--gold-primary);
  color: #111827;
}

.frontend-page-link-disabled {
  color: var(--text-muted);
  background: var(--bg-secondary);
  box-shadow: none;
  pointer-events: none;
}

.news-index-empty {
  padding: 26px;
}

@media (max-width: 1080px) {
  .news-index-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .news-index-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard-grid > .overview-section,
  .dashboard-grid > .org-rates-section,
  .dashboard-grid > .main-left-column,
  .dashboard-grid > .sidebar-layout,
  .dashboard-grid > .grid-section,
  .dashboard-grid > .chart-section {
    grid-column: 1 / -1;
    min-width: 0;
  }
}

@media (max-width: 768px) {
  body {
    padding-top: var(--mobile-sticky-header-height, 0px);
  }

  .announcement-bar {
    display: none;
  }

  .sticky-header-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 3000;
    max-height: 100dvh;
    overflow-y: auto;
    background: var(--card-bg);
    box-shadow: var(--shadow-lg);
  }

  .sticky-header-wrapper::before {
    content: none;
  }

  .sticky-header-wrapper.mobile-menu-open::before {
    content: none;
  }

  .mobile-menu-overlay {
    display: block;
    position: fixed;
    inset: var(--mobile-sticky-header-height, 0px) 0 0;
    z-index: 2990;
    background: rgba(5, 12, 24, 0.46);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast);
  }

  .sticky-header-wrapper.mobile-menu-open + .mobile-menu-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-menu-toggle {
    display: inline-flex;
  }

  .main-header {
    position: relative;
    z-index: 2;
  }

  .main-nav {
    position: static;
    display: none;
    order: 3;
    flex: 1 0 100%;
    width: 100%;
    max-height: none;
    overflow: visible;
    margin: 0;
    padding: 8px 0 0;
    background: transparent;
    border-top: 1px solid var(--border-color);
    box-shadow: none;
  }

  .site-header-search {
    position: static;
    order: 4;
    display: none;
    flex: 1 0 100%;
    width: 100%;
    max-width: none;
    margin: 4px 0 0;
    background: var(--bg-secondary);
  }

  .mobile-menu-open .main-nav {
    display: block;
  }

  .mobile-menu-open .site-header-search {
    display: flex;
  }

  .main-nav ul {
    border-top: 0;
    padding-top: 0;
  }

  .sub-nav-bar {
    position: static;
    display: none;
    max-height: none;
    overflow: visible;
    padding: 0 16px 16px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    box-shadow: none;
  }

  .mobile-menu-open .sub-nav-bar {
    display: block;
  }

  .sub-nav-container {
    justify-content: stretch;
  }

  #header-nav-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    min-width: 100%;
    gap: 8px;
  }

  #header-nav-2 li {
    display: block;
  }

  #header-nav-2 li a {
    display: block;
    text-align: center;
    white-space: nowrap;
  }

  .back-to-top-btn {
    right: 14px;
    bottom: 14px;
    width: 42px;
    height: 42px;
  }

  .table-scroll-wrapper > .table-scroll-cue {
    position: absolute;
    top: 10px;
    right: 8px;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    color: var(--gold-dark);
    background: var(--card-bg);
    border: 1px solid var(--gold-light);
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
    pointer-events: none;
  }

  .table-scroll-wrapper > .table-scroll-cue svg {
    width: 17px;
    height: 17px;
    animation: table-scroll-cue-nudge 1.6s ease-in-out infinite;
  }
}

@keyframes table-scroll-cue-nudge {
  0%, 100% {
    transform: translateX(-2px);
  }

  50% {
    transform: translateX(2px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .table-scroll-cue svg {
    animation: none;
  }
}

@media (max-width: 480px) {
  .section-title-wrapper h2,
  .section-header h1,
  .section-header h2,
  .brand-detail-info h1,
  .brand-detail-info h2 {
    font-size: 22px;
    line-height: 1.22;
  }

  #market-grid .luxury-table,
  .brand-detail-view .luxury-table {
    min-width: 540px;
  }

  .brand-detail-view .luxury-table th,
  .brand-detail-view .luxury-table td,
  #market-grid .luxury-table th,
  #market-grid .luxury-table td {
    padding: 11px 10px;
  }
}
