/* ============================================
   Concept 1B — Greyscale Wireframe Overrides
   Loaded AFTER shared/styles.css
   ============================================ */

/* --- Override Color Tokens to Greyscale (DS cool greys) --- */
:root {
  /* Green scale → DS grey */
  --at-green-900: #142533;
  --at-green-800: #223240;
  --at-green-700: #384957;
  --at-green-600: #52606b;
  --at-green-500: #77828b;
  --at-green-400: #9ea9b3;
  --at-green-300: #cdd4da;
  --at-green-200: #e1e6eb;
  --at-green-100: #eff3f6;
  --at-green-50: #f6f9fb;

  /* Blue scale → DS grey */
  --at-blue-900: #142533;
  --at-blue-800: #223240;
  --at-blue-700: #384957;
  --at-blue-600: #52606b;
  --at-blue-500: #77828b;
  --at-blue-400: #9ea9b3;
  --at-blue-300: #cdd4da;
  --at-blue-200: #e1e6eb;
  --at-blue-100: #eff3f6;
  --at-blue-50: #f6f9fb;

  /* Pink scale → DS grey */
  --at-pink-900: #142533;
  --at-pink-800: #223240;
  --at-pink-700: #384957;
  --at-pink-600: #52606b;
  --at-pink-500: #77828b;
  --at-pink-400: #9ea9b3;
  --at-pink-300: #cdd4da;
  --at-pink-200: #e1e6eb;
  --at-pink-100: #eff3f6;
  --at-pink-50: #f6f9fb;

  /* Yellow scale → DS grey */
  --at-yellow-900: #384957;
  --at-yellow-800: #52606b;
  --at-yellow-700: #52606b;
  --at-yellow-600: #77828b;
  --at-yellow-500: #77828b;
  --at-yellow-400: #9ea9b3;
  --at-yellow-300: #cdd4da;
  --at-yellow-200: #e1e6eb;
  --at-yellow-100: #eff3f6;
  --at-yellow-50: #f6f9fb;

  /* Semantic overrides */
  --at-green: #9ea9b3;
  --at-green-dark: #384957;
  --at-teal: #52606b;
  --zillow-blue: #9ea9b3;
  --zillow-blue-light: #f6f9fb;
  --sidebar-active: #f6f9fb;
  --pink: #9ea9b3;
  --dark-card: #223240;
  --dark-card-text: #eff3f6;

  /* Accent colors */
  --amber: #9ea9b3;
  --amber-bg: #f6f9fb;
  --amber-border: #cdd4da;
  --red: #52606b;
  --indigo: #52606b;
  --purple: #77828b;

  /* Chart colors → DS grey gradient */
  --chart-100: #223240;
  --chart-200: #52606b;
  --chart-300: #9ea9b3;
  --chart-400: #384957;
  --chart-500: #77828b;
  --chart-600: #9ea9b3;
  --chart-110: #cdd4da;
  --chart-210: #cdd4da;
  --chart-310: #cdd4da;
  --chart-410: #cdd4da;
  --chart-510: #e1e6eb;
  --chart-610: #eff3f6;

  /* Analogous → DS grey gradient */
  --chart-analogous-000: #e1e6eb;
  --chart-analogous-030: #9ea9b3;
  --chart-analogous-050: #77828b;
  --chart-analogous-070: #52606b;
  --chart-analogous-090: #384957;

  /* Funnel → DS grey gradient (dark to light) */
  --funnel-1: #223240;
  --funnel-2: #52606b;
  --funnel-3: #77828b;
  --funnel-4: #9ea9b3;
  --funnel-5: #cdd4da;

  /* Shadows — muted for wireframe */
  --shadow-1: 0px 1px 2px rgba(0, 0, 0, 0.08);
}


/* --- Wireframe Card Styling --- */
.kpi-card,
.engagement-section,
.speed-to-click,
.phone-callout,
.mini-funnel,
.roi-locked,
.pivot-table-wrap,
.lead-quality-card,
.venn-banner,
.insight-card {
  border: none !important;
  box-shadow: none !important;
}

/* KPI value colors → all dark grey */
.kpi-card-value.blue,
.kpi-card-value.green,
.kpi-card-value.teal {
  color: #142533 !important;
}

/* Tab active state → grey */
.tab-item.active {
  color: #142533 !important;
  border-bottom-color: #142533 !important;
}

/* Sidebar avatar → grey */
.sidebar-avatar {
  background: linear-gradient(135deg, #52606b, #77828b) !important;
}

/* Sidebar active item → grey */
.sidebar-item.active {
  background: #f6f9fb !important;
  color: #223240 !important;
}

/* Engagement bar fills → grey */
.engagement-bar-fill.zillow {
  background: #52606b !important;
}

.engagement-bar-fill.maronda {
  background: #9ea9b3 !important;
}

.engagement-legend-dot.zillow {
  background: #52606b !important;
}

.engagement-legend-dot.maronda {
  background: #9ea9b3 !important;
}

/* Speed bucket fill → grey */
.speed-bucket-fill {
  background: #77828b !important;
}

/* Section badge → grey */
.section-badge {
  background: #eff3f6 !important;
  color: #52606b !important;
}

/* Phase badge → grey */
.phase-badge {
  background: #eff3f6 !important;
  color: #52606b !important;
}

/* Portal banner → grey */
.portal-banner {
  background: #142533 !important;
}

.portal-banner-logo {
  color: #fff !important;
}

.portal-banner-status .dot {
  background: #9ea9b3 !important;
}

/* Funnel bar fills have inline styles using CSS vars — handled by var overrides above */

/* ROI overlay badge → grey */
.roi-overlay-badge {
  background: #52606b !important;
}


/* ============================================
   NEW COMPONENT STYLES (Concept 1B specific)
   ============================================ */

/* --- Venn Banner --- */
.venn-banner {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}

.venn-banner-title {
  font-size: 16px;
  font-weight: 700;
  color: #142533;
  margin-bottom: 4px;
}

.venn-banner-sub {
  font-size: 12px;
  color: #77828b;
  margin-bottom: 16px;
}

.venn-banner-content {
  display: flex;
  align-items: center;
  gap: 32px;
}

.venn-svg-wrap {
  flex-shrink: 0;
}

.venn-stats {
  display: flex;
  gap: 32px;
}

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

.venn-stat-value {
  font-family: 'DM Mono', monospace;
  font-size: 20px;
  font-weight: 600;
  color: #142533;
}

.venn-stat-label {
  font-size: 12px;
  color: #77828b;
  margin-top: 2px;
}

/* --- Toggle Bar --- */
.toggle-bar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 0;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.toggle-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toggle-group-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #77828b;
  margin-right: 4px;
}

.toggle-pill {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid #cdd4da;
  background: #fff;
  color: #52606b;
  cursor: pointer;
  transition: all 0.15s ease;
}

.toggle-pill:hover {
  border-color: #9ea9b3;
}

.toggle-pill.active {
  background: #223240;
  color: #fff;
  border-color: #223240;
}

/* --- KPI Cards V2 --- */
.kpi-row-v2 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

.kpi-cards-dynamic {
  display: contents;
}

.kpi-card-v2 {
  background: #fff;
  border: none;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.kpi-card-v2-content {
  flex: 1;
  min-width: 0;
}

.kpi-card-v2-gauge {
  flex-shrink: 0;
}

.kpi-card-dark {
  background: #142533;
  border: none;
}

.kpi-card-dark .kpi-card-v2-label {
  color: rgba(255, 255, 255, 0.6);
}

.kpi-card-dark .kpi-card-v2-value {
  color: #fff;
}

.kpi-card-dark .kpi-card-v2-sub {
  color: rgba(255, 255, 255, 0.45);
}

.kpi-card-v2-label {
  font-size: 12px;
  font-weight: 500;
  color: #77828b;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 8px;
}

.kpi-card-v2-value {
  font-family: 'DM Mono', monospace;
  font-size: 28px;
  font-weight: 600;
  color: #142533;
  line-height: 1;
}

.kpi-card-v2-sub {
  font-size: 12px;
  color: #9ea9b3;
  margin-top: 6px;
}

/* --- Hero Time-Series Chart --- */
.hero-chart {
  background: #fff;
  border: none;
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-sizing: border-box;
}

#hero-chart-svg {
  flex: 1;
  min-height: 0;
  overflow: visible;
}

#hero-chart-svg svg rect[data-value] {
  transition: opacity 0.15s ease;
}

#hero-chart-svg svg rect[data-value]:hover {
  opacity: 0.8;
}

.hero-view-toggle {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

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

.hero-chart-title-wrap {
  display: flex;
  align-items: baseline;
  position: relative;
}

.hero-chart-title {
  font-size: 16px;
  font-weight: 700;
  color: #142533;
}

.hero-chart-separator {
  font-size: 14px;
  font-weight: 400;
  color: #77828b;
  margin: 0 6px;
}

.hero-chart-dropdown {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 16px;
  font-weight: 700;
  color: #142533;
  cursor: pointer;
  border-bottom: 1px dashed #9ea9b3;
  padding-bottom: 1px;
}

.hero-chart-dropdown:hover {
  color: #142533;
}

.hero-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 6px;
  background: #fff;
  border: 1px solid #cdd4da;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 10;
  min-width: 140px;
  overflow: hidden;
}

.hero-dropdown-item {
  padding: 8px 14px;
  font-size: 13px;
  color: #384957;
  cursor: pointer;
  transition: background 0.1s ease;
}

.hero-dropdown-item:hover {
  background: #f6f9fb;
  color: #142533;
}

.hero-chart-legend {
  display: flex;
  gap: 16px;
  align-items: center;
}

.hero-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #52606b;
}

.hero-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* --- Lead Quality Card --- */
/* --- Hero Row (chart + lead quality side-by-side) --- */
.hero-row {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.hero-row-chart {
  flex: 2;
  min-width: 0;
}

.hero-row-quality {
  flex: 1;
  min-width: 0;
}

/* --- Lead Quality Card (vertical layout) --- */
.lead-quality-card {
  background: #fff;
  border: none;
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  box-sizing: border-box;
}

.lead-quality-title {
  font-size: 16px;
  font-weight: 700;
  color: #142533;
  margin-bottom: 8px;
  align-self: flex-start;
}

.lead-quality-desc {
  font-size: 13px;
  color: #77828b;
  line-height: 1.5;
  margin-bottom: 20px;
  align-self: flex-start;
}

.lead-quality-gauge {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.lead-quality-insight {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #142533 0%, #1c3044 50%, #142533 100%);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 12px;
  color: #fff;
  line-height: 1.5;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 16px;
}

.lead-quality-insight svg {
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.7);
}

.lead-quality-link {
  font-size: 13px;
  font-weight: 600;
  color: #142533;
  text-decoration: none;
  cursor: pointer;
}

/* Dark variant */
.lead-quality-card-dark {
  background: #142533;
}

.lead-quality-card-dark .lead-quality-title {
  color: #fff;
}

.lead-quality-card-dark .lead-quality-desc {
  color: rgba(255, 255, 255, 0.6);
}

.lead-quality-card-dark .lead-quality-insight {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.6);
}

.lead-quality-card-dark .lead-quality-link {
  color: #fff;
}

/* --- Pivot Table --- */
.pivot-table-wrap {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
}

.pivot-filters {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.pivot-filter {
  font-size: 12px;
  padding: 6px 12px;
  border: 1px solid #cdd4da;
  border-radius: 6px;
  background: #fff;
  color: #52606b;
  cursor: pointer;
}

.pivot-filter:focus {
  outline: 1px solid #77828b;
}

.pivot-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.pivot-table th {
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #77828b;
  padding: 8px 12px;
  border-bottom: 2px solid #e1e6eb;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.pivot-table th:hover {
  color: #142533;
}

.pivot-table th .sort-arrow {
  margin-left: 4px;
  font-size: 10px;
}

.pivot-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #eff3f6;
  color: #223240;
}

.pivot-table tr:nth-child(even) {
  background: #f6f9fb;
}

.pivot-table td.mono {
  font-family: 'DM Mono', monospace;
}

.pivot-table td.null-value {
  color: #cdd4da;
  font-style: italic;
}

/* --- Section divider --- */
.section-divider {
  height: 1px;
  background: #e1e6eb;
  margin: 24px 0;
}

/* ============================================
   NO-SIDEBAR LAYOUT
   ============================================ */

.app-layout-nosidebar {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: #f6f9fb;
}

/* --- Sticky Header Wrapper --- */
.sticky-header {
  position: sticky;
  top: 0;
  z-index: 100;
}

/* --- Branding Bar --- */
.branding-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 12px 16px;
  background: #45cc79;
}

.branding-bar-logo {
  display: flex;
  align-items: center;
}

.branding-logo-img {
  height: 24px;
  width: auto;
}

.branding-bar-title {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  line-height: 24px;
  white-space: nowrap;
}

/* --- Navigation Header --- */
.nav-header {
  background: #fff;
  padding: 16px 16px 0;
  border-bottom: 1px solid #E1E6EB;
}

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

.header-selectors {
  display: flex;
  align-items: center;
  gap: 24px;
}

.builder-selector,
.community-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px;
  height: 24px;
  cursor: pointer;
}

.builder-name,
.community-name {
  font-size: 20px;
  font-weight: 600;
  color: #142533;
  line-height: 28px;
  white-space: nowrap;
}

.selector-chevron {
  flex-shrink: 0;
  cursor: pointer;
}

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

.filter-toggle-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: #fff;
  border: 1px solid #E1E6EB;
  border-radius: 4px;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s ease;
}

.filter-toggle-btn:hover {
  background: #f6f9fb;
}

.filter-toggle-btn.active {
  background: #eff3f6;
  border-color: #E1E6EB;
}

.filter-toggle-btn.has-active-filters::after {
  content: '';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  background: #EF4444;
  border-radius: 50%;
  border: 2px solid #fff;
}

.tab-bar-v2 {
  display: flex;
  gap: 24px;
  padding-bottom: 0;
}

.tab-v2 {
  font-size: 16px;
  font-weight: 400;
  color: #384957;
  padding-bottom: 8px;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.tab-v2:hover {
  color: #142533;
}

.tab-v2.active {
  font-weight: 500;
  color: #142533;
  border-bottom-color: #142533;
}

/* --- View Controls (collapsible filter bar) --- */
.view-controls {
  display: flex;
  align-items: flex-end;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.25s ease, opacity 0.2s ease, padding 0.25s ease;
}

.view-controls.filters-visible {
  max-height: 80px;
  opacity: 1;
  padding: 12px 16px;
}

.view-filters {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.filter-toggle {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-label {
  font-size: 10px;
  font-weight: 600;
  color: #77828b;
  letter-spacing: 0.3px;
}

.toggle-btn-group {
  display: flex;
  gap: 4px;
  background: #E1E6EB;
  padding: 2px;
  border-radius: 6px;
  height: 28px;
  align-items: stretch;
}

.toggle-btn {
  font-size: 12px;
  font-weight: 400;
  color: #384957;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  transition: all 0.15s ease;
  line-height: 16px;
}

.toggle-btn:hover {
  color: #142533;
}

.toggle-btn.active {
  background: #fff;
  font-weight: 500;
  color: #142533;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.date-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px 4px 8px;
  background: #fff;
  border: 1px solid #E1E6EB;
  border-radius: 4px;
  height: 32px;
  cursor: pointer;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 500;
  color: #384957;
}

.date-btn:hover {
  border-color: #cdd4da;
}

/* --- Content Area (no sidebar) --- */
.content-area-v2 {
  padding: 40px 20px 20px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* --- Journey KPI Cards --- */
.journey-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

/* --- Utility --- */
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
