:root {
  /* KHX / KrakenHX Institutional Color System */
  --sunken-gold:        #C19F68;  /* Primary Accent: CTAs, primary borders, active states, price alerts */
  --kraken-bronze:      #A38361;  /* Primary Brand Midtone: Nav, interactive elements, icons, category links */
  --aged-patina:        #78644F;  /* Interface Divider: Gridlines, timestamps, subtle dividers, borders */
  --dark-abyss-patina:  #483C2F;  /* Surface Container: Feature panels, card plaques, modal bodies */
  --abyssal-charcoal:   #2E2E2E;  /* Base Background: Overall layout structure, dark foundation */
  --slate-blue:         #2B3E50;  /* Functional Data Accent: Sparklines, charts, sync indicators */
  --clean-ivory:        #FFFFFF;  /* Readable Text: Primary copy, values, card numbers */

  /* Legacy Compatibility Aliases */
  --color-earth-brown:  var(--dark-abyss-patina);
  --color-moss-green:   var(--aged-patina);
  --color-sage:         var(--sunken-gold);
  --color-greige:       #e2dacd;
  --color-charcoal:     var(--abyssal-charcoal);

  /* Semantic Theme Mappings */
  --bg-main:            var(--abyssal-charcoal);
  --bg-surface:         rgba(72, 60, 47, 0.92);
  --bg-surface-hover:   rgba(120, 100, 79, 0.45);
  --bg-card:            #383025;
  --bg-card-inner:      #28221a;
  --border-color:       rgba(120, 100, 79, 0.45);
  --border-focus:       var(--sunken-gold);

  --text-primary:       var(--clean-ivory);
  --text-secondary:     #e2dacd;
  --text-muted:         #a69886;

  --accent-primary:     var(--sunken-gold);
  --accent-bronze:      var(--kraken-bronze);
  --accent-slate:       var(--slate-blue);
  --accent-warm:        #d99a5b;
  --accent-red:         #e05d4d;
  --accent-green:       #68b87d;

  --shadow-sm:          0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-md:          0 12px 36px rgba(0, 0, 0, 0.65);
  --shadow-glow:        0 0 24px rgba(193, 159, 104, 0.32);

  --radius-sm:          8px;
  --radius-md:          12px;
  --radius-lg:          16px;
  --radius-xl:          22px;
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-main);
  background-image:
    radial-gradient(at 15% 10%, rgba(193, 159, 104, 0.08) 0px, transparent 40%),
    radial-gradient(at 85% 90%, rgba(43, 62, 80, 0.16) 0px, transparent 45%),
    radial-gradient(at 50% 30%, rgba(72, 60, 47, 0.35) 0px, transparent 65%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.app-layout {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  cursor: pointer;
}

.brand-logo-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.7));
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.brand:hover .brand-logo-img {
  transform: scale(1.08) rotate(-2deg);
}

.brand-text h1 {
  font-size: 1.7rem;
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--sunken-gold);
  text-shadow: 0 2px 14px rgba(193, 159, 104, 0.35);
}

.brand-text .subtext {
  font-size: 0.78rem;
  color: var(--kraken-bronze);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: 'Plus Jakarta Sans', sans-serif;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
  background: linear-gradient(135deg, var(--sunken-gold), var(--kraken-bronze));
  color: #1a1612;
  font-weight: 700;
  border: 1px solid rgba(193, 159, 104, 0.45);
  box-shadow: 0 4px 14px rgba(193, 159, 104, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #d6b882, #b89773);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(193, 159, 104, 0.5);
  color: #100d0a;
}

.btn-secondary {
  background: var(--dark-abyss-patina);
  color: var(--clean-ivory);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: var(--bg-surface-hover);
  color: #FFFFFF;
  border-color: var(--sunken-gold);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: rgba(43, 62, 80, 0.5);            /* Slate Blue container */
  border: 1px solid rgba(43, 62, 80, 0.85);
  font-size: 0.82rem;
  font-weight: 600;
  color: #a8c8e6;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--sunken-gold);
  box-shadow: 0 0 10px var(--sunken-gold);
  animation: pulse 2s infinite;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-sage);
  box-shadow: 0 0 8px var(--color-sage);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(0.95);
    opacity: 0.7;
  }

  50% {
    transform: scale(1.2);
    opacity: 1;
  }

  100% {
    transform: scale(0.95);
    opacity: 0.7;
  }
}

/* KPI Cards Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(12px);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, border-color 0.2s;
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: var(--color-sage);
}

.kpi-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.kpi-icon-wrap.blue {
  background: rgba(107, 112, 92, 0.25);
  border: 1px solid rgba(166, 176, 147, 0.4);
}

.kpi-icon-wrap.green {
  background: rgba(166, 176, 147, 0.22);
  border: 1px solid rgba(166, 176, 147, 0.45);
}

.kpi-icon-wrap.amber {
  background: rgba(92, 75, 58, 0.35);
  border: 1px solid rgba(92, 75, 58, 0.5);
}

.kpi-icon-wrap.purple {
  background: rgba(207, 207, 196, 0.18);
  border: 1px solid rgba(207, 207, 196, 0.35);
}

.kpi-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kpi-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-sage);
  margin-bottom: 2px;
  line-height: 1.2;
}

.kpi-value {
  font-size: 1.5rem;
  color: #FFFFFF;
  font-weight: 700;
  line-height: 1.2;
}

.kpi-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Category Tabs Nav */
.tabs-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  padding: 8px 6px 14px 6px;
  margin-bottom: 24px;
  scrollbar-width: thin;
  scrollbar-color: var(--color-moss-green) transparent;
}

.tab-btn {
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.22), transparent 65%), var(--cat-color, #5B7362);
  color: #FFFFFF;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.2s ease,
              border-color 0.2s ease,
              opacity 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  opacity: 0.82;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.tab-btn .tab-icon {
  font-size: 1.35rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tab-btn:hover {
  opacity: 1;
  transform: translateY(-3px) scale(1.12);
  border-color: rgba(255, 255, 255, 0.8);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45), 0 0 14px var(--cat-color);
  z-index: 5;
}

.tab-btn:hover .tab-icon {
  transform: scale(1.1);
}

.tab-btn.active {
  opacity: 1;
  border: 2.5px solid #FFFFFF;
  transform: translateY(-2px) scale(1.08);
  box-shadow: 0 0 18px var(--cat-color), 0 4px 14px rgba(0, 0, 0, 0.5);
  z-index: 4;
}

.tab-btn.active .tab-icon {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* Floating Category Tab Tooltip */
.cat-floating-tooltip {
  position: fixed;
  z-index: 99999;
  pointer-events: none;
  background: #181916;
  color: #F7F7F2;
  border: 1.5px solid var(--tooltip-border, #A6B093);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 14px var(--tooltip-glow, rgba(166, 176, 147, 0.3));
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, calc(-100% - 10px)) scale(0.92);
  transition: opacity 0.16s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.16s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0.16s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cat-floating-tooltip.visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, calc(-100% - 14px)) scale(1);
}

.cat-floating-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px 6px 0 6px;
  border-style: solid;
  border-color: var(--tooltip-border, #181916) transparent transparent transparent;
}

/* Tab Views */
.tab-view {
  display: none;
}

.tab-view.active {
  display: block;
}

/* Glass Card */
.glass-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(12px);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.glass-card h4 {
  font-size: 1.1rem;
  margin-bottom: 16px;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(207, 207, 196, 0.1);
  padding-bottom: 8px;
}

.home-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 20px;
}

.analytics-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.canvas-wrap {
  position: relative;
  height: 280px;
  width: 100%;
}

/* Data Tables */
.table-scroll {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
}

.data-table th {
  padding: 12px 14px;
  color: var(--color-sage);
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  background: rgba(44, 44, 40, 0.8);
  white-space: nowrap;
  letter-spacing: 0.03em;
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(207, 207, 196, 0.08);
  color: var(--text-primary);
}

.data-table tr:hover td {
  background: rgba(107, 112, 92, 0.12);
}

.price-pill {
  display: inline-block;
  font-weight: 700;
  color: var(--color-sage);
  background: rgba(166, 176, 147, 0.18);
  border: 1px solid rgba(166, 176, 147, 0.35);
  padding: 3px 10px;
  border-radius: var(--radius-sm);
}

.date-pill {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.cat-chip {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(92, 75, 58, 0.35);
  color: var(--color-greige);
  border: 1px solid rgba(92, 75, 58, 0.5);
}

/* Filter Bar */
.filter-bar {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
  padding: 16px 20px;
  margin-bottom: 24px;
}

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

.filter-group label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-sage);
}

.filter-group input,
.filter-group select {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
  min-width: 180px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.filter-group input:focus,
.filter-group select:focus {
  border-color: var(--color-sage);
  box-shadow: 0 0 0 2px rgba(166, 176, 147, 0.25);
}

.filter-group.search {
  flex: 1;
  min-width: 240px;
}

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

.btn-toggle {
  background: transparent;
  border: none;
  color: var(--color-greige);
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-toggle.active {
  background: var(--color-moss-green);
  color: #FFFFFF;
}

/* Visual Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.card-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  position: relative;
  cursor: pointer;
  min-width: 0;
}

.card-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-sage);
}

.card-img-container,
.card-image-wrap {
  width: 100%;
  max-width: 100%;
  height: 320px;
  background: #181816;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(207, 207, 196, 0.08);
  box-sizing: border-box;
}

.card-img-container img,
.card-thumb,
.card-image-wrap img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: transform 0.3s ease;
  display: block;
}

.card-item:hover .card-img-container img,
.card-item:hover .card-thumb,
.card-item:hover .card-image-wrap img {
  transform: scale(1.04);
}

.card-thumb-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
  background: #181816;
}

.card-slab-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(30, 30, 27, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(207, 207, 196, 0.25);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  z-index: 2;
}

.card-details {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
  background: var(--bg-surface);
}

.card-title,
.card-subject {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #FFFFFF;
  line-height: 1.25;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta {
  font-size: 0.8rem;
  color: var(--color-greige);
}

.card-footer,
.card-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(207, 207, 196, 0.1);
}

.card-price,
.card-price-tag {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--color-sage);
  font-family: 'Outfit', sans-serif;
}

.card-date,
.card-date-tag {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Pagination Bar */
.pagination-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
}

.page-indicator {
  font-size: 0.88rem;
  color: var(--color-greige);
  font-weight: 600;
}

/* Category Header KPIs */
.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.cat-kpis {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.cat-kpi {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.cat-kpi .kpi-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--color-greige);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0;
  line-height: 1;
}

.cat-kpi .kpi-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: #FFFFFF;
  line-height: 1;
}

.cat-kpi-chip {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--color-greige);
}

.cat-kpi-chip strong {
  color: var(--color-sage);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--color-charcoal);
  color: var(--text-primary);
  padding: 14px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-sage);
  box-shadow: var(--shadow-md);
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: all 0.3s ease;
  z-index: 9999;
}

.toast.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.toast.success {
  border-color: var(--color-sage);
  background: rgba(54, 54, 50, 0.95);
  box-shadow: 0 4px 20px rgba(107, 112, 92, 0.4);
}

.toast.error {
  border-color: var(--accent-red);
  background: rgba(60, 35, 35, 0.95);
}

/* Loading State */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  gap: 16px;
  color: var(--color-greige);
}

.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(207, 207, 196, 0.2);
  border-top-color: var(--color-sage);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Responsive */
@media (max-width: 900px) {

  .home-grid,
  .analytics-row {
    grid-template-columns: 1fr;
  }

  .app-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
}

.card-slab-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(26, 32, 44, 0.88);
  backdrop-filter: blur(6px);
  color: #8FD14F;
  border: 1px solid rgba(143, 209, 79, 0.4);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  z-index: 2;
}

.slab-pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(143, 209, 79, 0.12);
  color: #8FD14F;
  border: 1px solid rgba(143, 209, 79, 0.3);
}

/* Badge Pill */
.badge-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 0.72rem;
  font-weight: 800;
  border-radius: 10px;
  background: rgba(207, 207, 196, 0.16);
  color: var(--color-greige);
  border: 1px solid rgba(207, 207, 196, 0.2);
  margin-left: 6px;
}

.badge-pill.has-dups {
  background: rgba(217, 93, 80, 0.2);
  color: #FFFFFF;
  border-color: rgba(217, 93, 80, 0.6);
  box-shadow: 0 0 10px rgba(217, 93, 80, 0.4);
}

/* Card Pointer Cursor */
.card-item {
  cursor: pointer;
}

#categoryCardsTable tbody tr,
#topCardsTable tbody tr {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

#categoryCardsTable tbody tr:hover,
#topCardsTable tbody tr:hover {
  background-color: rgba(166, 176, 147, 0.08);
}

/* Modals Overlay & Base Dialog */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 15, 13, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-dialog {
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  animation: modalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(10px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: linear-gradient(135deg, rgba(92, 75, 58, 0.4), rgba(54, 54, 50, 0.4));
  border-bottom: 1px solid var(--border-color);
}

.modal-header-info h3 {
  font-size: 1.3rem;
  color: #FFFFFF;
  margin-bottom: 2px;
}

.modal-subtext {
  font-size: 0.82rem;
  color: var(--color-sage);
}

.modal-close-btn {
  background: rgba(207, 207, 196, 0.1);
  border: 1px solid rgba(207, 207, 196, 0.2);
  color: var(--color-greige);
  font-size: 1.4rem;
  line-height: 1;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-close-btn:hover {
  background: rgba(217, 93, 80, 0.25);
  color: #FFFFFF;
  border-color: rgba(217, 93, 80, 0.5);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

/* Card Detail Modal Specifics */
.card-detail-body {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px;
  overflow-y: auto;
}

/* Top Section: Picture on Left, Card Details on Right */
.modal-card-top-section {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  align-items: stretch;
}

@media (max-width: 820px) {
  .modal-card-top-section {
    grid-template-columns: 1fr;
  }
}

.modal-image-wrap {
  position: relative;
  width: 100%;
  height: 380px;
  background: var(--bg-card-inner);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.modal-image-wrap img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.modal-key-specs {
  background: var(--bg-card-inner);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
}

.spec-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  padding: 8px 0;
  border-bottom: 1px solid rgba(207, 207, 196, 0.08);
  gap: 12px;
}

.spec-row:last-child {
  border-bottom: none;
}

.spec-label {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.82rem;
  white-space: nowrap;
}

.spec-val {
  color: #FFFFFF;
  font-weight: 600;
  text-align: right;
  word-break: break-word;
}

/* Bottom Section: Sparkline & Valuation Audit Log */
.modal-card-bottom-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sparkline-section {
  background: var(--bg-card-inner);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 22px;
}

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

.sparkline-header h4 {
  font-size: 0.95rem;
  color: var(--color-greige);
  margin: 0;
}

.sparkline-container {
  width: 100%;
  height: 160px;
  position: relative;
  overflow: hidden;
}

.sparkline-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.sparkline-point {
  transition: r 0.2s, fill 0.2s;
  cursor: pointer;
}

.sparkline-point:hover {
  r: 6;
  fill: #FFFFFF;
}

.history-table-section {
  background: var(--bg-card-inner);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 22px;
}

.history-table-section h4 {
  font-size: 0.95rem;
  color: var(--color-greige);
  margin-top: 0;
  margin-bottom: 12px;
}

.modal-history-scroll {
  max-height: 240px;
  overflow-y: auto;
}

.btn-icon-revert {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(107, 112, 92, 0.2);
  border: 1px solid rgba(166, 176, 147, 0.35);
  color: #CFCFC4;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  vertical-align: middle;
}

.btn-icon-revert:hover:not(:disabled) {
  background: rgba(166, 176, 147, 0.35);
  border-color: #A6B093;
  color: #FFFFFF;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.btn-icon-revert:active:not(:disabled) {
  transform: translateY(0);
}

.btn-icon-revert:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.revert-cell-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Duplicate Review Center Modal */
.dup-modal-dialog {
  max-width: 960px;
}

.dup-compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

@media (max-width: 768px) {
  .dup-compare-grid {
    grid-template-columns: 1fr;
  }
}

.dup-card-panel {
  background: var(--bg-card-inner);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
}

.dup-card-panel:hover {
  transform: translateY(-2px);
}

.dup-card-panel.is-keeper {
  border-color: #A6B093;
  box-shadow: 0 0 20px rgba(166, 176, 147, 0.25);
  background: rgba(166, 176, 147, 0.06);
}

.dup-card-panel.is-duplicate {
  border-color: rgba(217, 93, 80, 0.5);
  box-shadow: 0 0 14px rgba(217, 93, 80, 0.15);
  background: rgba(217, 93, 80, 0.04);
}

.dup-role-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 6px;
  align-self: flex-start;
}

.dup-role-badge.keeper {
  background: rgba(166, 176, 147, 0.22);
  color: var(--color-sage);
  border: 1px solid var(--color-sage);
}

.dup-role-badge.duplicate {
  background: rgba(217, 93, 80, 0.2);
  color: var(--accent-red);
  border: 1px solid var(--accent-red);
}

.btn-select-card {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-select-card.active {
  background: #A6B093;
  color: #1E1E1B;
  box-shadow: 0 2px 10px rgba(166, 176, 147, 0.35);
  pointer-events: none;
}

.btn-select-card.inactive {
  background: rgba(207, 207, 196, 0.08);
  color: #CFCFC4;
  border: 1px dashed rgba(207, 207, 196, 0.3);
}

.btn-select-card.inactive:hover {
  background: rgba(166, 176, 147, 0.18);
  color: #FFFFFF;
  border-color: #A6B093;
}

.dup-card-image {
  width: 100%;
  height: 260px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: #1e1e1b;
}

.dup-actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.dup-btn-group {
  display: flex;
  gap: 12px;
}

.btn-keep {
  background: linear-gradient(135deg, #5C4B3A, #6B705C);
  color: #FFFFFF;
  border: 1px solid rgba(207, 207, 196, 0.25);
  padding: 10px 20px;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-keep:hover {
  background: linear-gradient(135deg, #4A3C2E, #585C4B);
  transform: translateY(-1px);
}

.btn-delete-dup {
  background: linear-gradient(135deg, #D95D50, #A83B30);
  color: #FFFFFF;
  border: 1px solid rgba(217, 93, 80, 0.5);
  padding: 10px 20px;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-delete-dup:hover {
  background: linear-gradient(135deg, #BD473C, #8C2C22);
  transform: translateY(-1px);
}

.dup-nav-buttons {
  display: flex;
  gap: 8px;
}

/* ============================================================
   Pricing History View Styles
   ============================================================ */
.history-card-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  transition: opacity 0.15s ease;
}

.history-card-cell:hover .history-card-title {
  color: #A6B093;
  text-decoration: underline;
}

.history-card-thumb {
  width: 42px;
  height: 58px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid rgba(207, 207, 196, 0.16);
  flex-shrink: 0;
  background: #1e1e1b;
}

.history-card-thumb-placeholder {
  width: 42px;
  height: 58px;
  border-radius: 4px;
  background: rgba(44, 44, 40, 0.6);
  border: 1px dashed rgba(207, 207, 196, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: #8E9284;
  flex-shrink: 0;
}

.history-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.history-card-title {
  color: #FFFFFF;
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-card-sub {
  color: var(--text-muted);
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.price-shift-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.price-shift-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
}

.price-old {
  color: #8E9284;
  text-decoration: line-through;
  font-size: 0.8rem;
}

.price-arrow {
  color: #8E9284;
  font-size: 0.75rem;
}

.price-new {
  font-weight: 700;
  color: #FFFFFF;
}

.price-diff-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  align-self: flex-start;
}

.price-diff-pill.gain {
  background: rgba(166, 176, 147, 0.18);
  color: #A6B093;
  border: 1px solid rgba(166, 176, 147, 0.35);
}

.price-diff-pill.loss {
  background: rgba(217, 93, 80, 0.15);
  color: #D95D50;
  border: 1px solid rgba(217, 93, 80, 0.35);
}

.price-diff-pill.neutral {
  background: rgba(207, 207, 196, 0.08);
  color: #CFCFC4;
  border: 1px solid rgba(207, 207, 196, 0.15);
}

.price-diff-pill.volatile {
  background: rgba(224, 122, 95, 0.25);
  color: #E07A5F;
  border: 1px solid #E07A5F;
  font-weight: 800;
}

.search-query-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(26, 26, 23, 0.6);
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid rgba(207, 207, 196, 0.12);
  max-width: 320px;
}

.search-query-text {
  font-family: monospace;
  font-size: 0.78rem;
  color: #CFCFC4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.btn-query-action {
  background: transparent;
  border: none;
  color: #8E9284;
  cursor: pointer;
  padding: 2px 4px;
  font-size: 0.8rem;
  border-radius: 4px;
  transition: all 0.15s;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-query-action:hover {
  color: #FFFFFF;
  background: rgba(207, 207, 196, 0.15);
}

.source-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(92, 75, 58, 0.3);
  color: #CFCFC4;
  border: 1px solid rgba(92, 75, 58, 0.5);
}

.status-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 3px;
}

.status-tag.active {
  background: rgba(166, 176, 147, 0.15);
  color: #A6B093;
}

.status-tag.volatile {
  background: rgba(217, 93, 80, 0.2);
  color: #D95D50;
  border: 1px solid #D95D50;
}

.status-tag.reverted {
  background: rgba(142, 146, 132, 0.2);
  color: #8E9284;
}

.comps-pill {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(107, 112, 92, 0.25);
  color: #A6B093;
  border: 1px solid rgba(107, 112, 92, 0.4);
}

/* ============================================================
   Official Top Navigation Menu & Header Extensions
   ============================================================ */
.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(46, 46, 46, 0.85);           /* Abyssal Charcoal ground */
  padding: 5px 8px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(14px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  font-size: 0.92rem;
  font-weight: 600;
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.nav-item:hover {
  color: var(--clean-ivory);
  background: rgba(163, 131, 97, 0.12);        /* Kraken Bronze glow */
  border-color: rgba(163, 131, 97, 0.3);
}

.nav-item.active {
  color: var(--clean-ivory);
  background: linear-gradient(135deg, var(--dark-abyss-patina), #5c4d3b);
  border-color: var(--sunken-gold);
  box-shadow: 0 4px 14px rgba(193, 159, 104, 0.25);
}

.nav-item .nav-icon {
  font-size: 1rem;
}

.nav-item .badge-pill {
  margin-left: 2px;
  padding: 1px 6px;
  font-size: 0.72rem;
}

/* Pie Chart Wrapper */
.pie-canvas-wrap {
  position: relative;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   Raw vs Graded Two-Row Structured Display
   ============================================================ */
.raw-graded-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.raw-graded-rows {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 14px;
}

.breakdown-row {
  background: rgba(44, 44, 40, 0.45);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.2s ease;
}

.breakdown-row:hover {
  border-color: var(--color-sage);
}

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

.breakdown-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.breakdown-icon {
  font-size: 1.4rem;
}

.breakdown-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: #FFFFFF;
}

.breakdown-val {
  font-size: 1.3rem;
  font-weight: 800;
  color: #A6B093;
}

.breakdown-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.breakdown-track {
  height: 7px;
  background: rgba(30, 30, 27, 0.8);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(207, 207, 196, 0.1);
}

.breakdown-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.breakdown-fill.raw {
  background: linear-gradient(90deg, #6B705C, #A6B093);
}

.breakdown-fill.graded {
  background: linear-gradient(90deg, #5C4B3A, #D97736);
}

/* ============================================================
   Category Net Worth & Heat Map Styles
   ============================================================ */
.section-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.net-worth-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 24px;
  align-items: center;
  margin-top: 14px;
}

.rose-chart-box {
  background: rgba(26, 26, 23, 0.45);
  border: 1px solid rgba(207, 207, 196, 0.08);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.rose-chart-header {
  width: 100%;
  margin-bottom: 8px;
  text-align: left;
}

.rose-chart-title {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: #FFFFFF;
}

.rose-chart-sub {
  display: block;
  font-size: 0.75rem;
  color: #8E9284;
}

.rose-canvas-wrap {
  position: relative;
  width: 100%;
  height: 350px;
  max-width: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.net-worth-table-scroll {
  max-height: 440px;
  overflow-y: auto;
}

@media (max-width: 1024px) {
  .net-worth-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .rose-canvas-wrap {
    height: 320px;
    max-width: 100%;
  }
}

.heat-map-strip {
  display: flex;
  height: 14px;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 18px;
  border: 1px solid rgba(207, 207, 196, 0.15);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
  background: #1e1e1b;
}

.heat-map-seg {
  height: 100%;
  transition: opacity 0.2s, transform 0.2s;
  cursor: pointer;
}

.heat-map-seg:hover {
  opacity: 0.85;
  filter: brightness(1.2);
}

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

.heat-bar-track {
  flex: 1;
  height: 6px;
  background: rgba(30, 30, 27, 0.7);
  border-radius: 3px;
  overflow: hidden;
  max-width: 100px;
}

.heat-bar-fill {
  height: 100%;
  border-radius: 3px;
}

.cat-tab-chip {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 7px;
  vertical-align: middle;
}

/* ============================================================
   History Sub-Navigation & Sub-Views
   ============================================================ */
.subtabs-bar {
  margin-bottom: 22px;
}

.subtabs-nav {
  display: inline-flex;
  gap: 6px;
  background: rgba(30, 30, 27, 0.6);
  padding: 4px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.subtab-btn {
  background: transparent;
  color: var(--color-greige);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 8px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: 'Plus Jakarta Sans', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
}

.subtab-btn:hover {
  color: #FFFFFF;
  background: rgba(207, 207, 196, 0.08);
}

.subtab-btn.active {
  background: linear-gradient(135deg, var(--color-moss-green), var(--color-earth-brown));
  border-color: var(--color-sage);
  color: #FFFFFF;
}

/* ============================================================
   Duplicates Full Page View Styles
   ============================================================ */
.dup-page-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 10px;
}

.dup-pair-card {
  background: rgba(36, 36, 33, 0.75);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease;
}

.dup-pair-card:hover {
  border-color: rgba(166, 176, 147, 0.35);
}

.dup-pair-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(207, 207, 196, 0.1);
}

.dup-pair-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dup-pair-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ============================================================
   KHX Multi-Tenant Auth & User Vault Profile Styles
   ============================================================ */
.demo-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: linear-gradient(135deg, rgba(72, 60, 47, 0.88), rgba(43, 62, 80, 0.6));
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--sunken-gold);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  margin-bottom: 24px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  animation: fadeIn 0.3s ease;
}

.demo-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.demo-badge {
  font-family: 'Outfit', sans-serif;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  background: rgba(193, 159, 104, 0.2);
  color: var(--sunken-gold);
  border: 1px solid rgba(193, 159, 104, 0.4);
  border-radius: 20px;
  white-space: nowrap;
}

.demo-text {
  font-size: 0.9rem;
  color: var(--clean-ivory);
}

.btn-gold {
  background: linear-gradient(135deg, var(--sunken-gold), var(--kraken-bronze));
  color: #1a1612 !important;
  font-weight: 700;
  border: none;
  box-shadow: 0 4px 14px rgba(193, 159, 104, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-gold:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(193, 159, 104, 0.45);
}

.user-vault-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-container {
  display: flex;
  align-items: center;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(72, 60, 47, 0.6);
  border: 1px solid var(--border-color);
  padding: 4px 12px 4px 6px;
  border-radius: 30px;
  backdrop-filter: blur(8px);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--sunken-gold);
}

.user-avatar-initials {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--kraken-bronze), var(--dark-abyss-patina));
  color: var(--clean-ivory);
  font-weight: 700;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--sunken-gold);
}

.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.user-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--clean-ivory);
  max-width: 110px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge-tier {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--sunken-gold);
  text-transform: uppercase;
}

.btn-signout {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 6px;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  margin-left: 4px;
  text-decoration: none;
}

.btn-signout:hover {
  color: var(--accent-red);
  background: rgba(224, 93, 77, 0.12);
}

/* First-Run Onboarding Guide for New Vaults */
.onboarding-guide {
  background: linear-gradient(135deg, rgba(72, 60, 47, 0.85), rgba(46, 46, 46, 0.95));
  border: 1.5px solid var(--sunken-gold);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 28px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
}

.onboarding-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.onboarding-icon {
  font-size: 2.2rem;
  line-height: 1;
}

.onboarding-header h3 {
  font-size: 1.35rem;
  color: var(--clean-ivory);
  margin-bottom: 4px;
}

.onboarding-header p {
  color: var(--kraken-bronze);
  font-size: 0.9rem;
}

.onboarding-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.step-box {
  background: rgba(46, 46, 46, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  transition: all 0.2s ease;
}

.step-box:hover {
  border-color: var(--sunken-gold);
  transform: translateY(-2px);
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sunken-gold), var(--kraken-bronze));
  color: #1a1612;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.step-content strong {
  display: block;
  font-size: 0.92rem;
  color: var(--clean-ivory);
  margin-bottom: 4px;
}

.step-content p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.step-content a.link-gold {
  color: var(--sunken-gold);
  text-decoration: underline;
  font-size: 0.82rem;
  font-weight: 600;
}

/* User Profile & Account Settings Modal */
.profile-modal-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.profile-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.profile-avatar-lg {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid var(--sunken-gold);
  object-fit: cover;
}

.profile-avatar-initials-lg {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid var(--sunken-gold);
  background: linear-gradient(135deg, var(--kraken-bronze), var(--dark-abyss-patina));
  color: var(--clean-ivory);
  font-weight: 800;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-details h4 {
  font-size: 1.15rem;
  color: var(--clean-ivory);
  margin-bottom: 2px;
}

.profile-details .profile-email {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.profile-resources-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.resource-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: rgba(46, 46, 46, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.resource-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--clean-ivory);
}

.resource-link {
  color: var(--sunken-gold);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}

.resource-link:hover {
  text-decoration: underline;
}

.profile-actions-bar {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}