/* ==========================================================================
   homes.w4hr.buzz - Houston House Hack & ADU Investment Engine
   Institutional PropTech / FinTech Styling (Centered Portal & Detail Drawer)
   ========================================================================== */

:root {
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-tertiary: #1f2937;
  --bg-card: rgba(17, 24, 39, 0.92);
  --bg-card-hover: rgba(31, 41, 55, 0.98);
  --border-color: #374151;
  --border-focus: #10b981;
  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  --emerald-500: #10b981;
  --emerald-400: #34d399;
  --emerald-600: #059669;
  --emerald-900: #064e3b;
  --emerald-glow: rgba(16, 185, 129, 0.25);

  --indigo-500: #6366f1;
  --indigo-400: #818cf8;
  --indigo-600: #4f46e5;
  --indigo-glow: rgba(99, 102, 241, 0.25);

  --amber-500: #f59e0b;
  --amber-glow: rgba(245, 158, 11, 0.25);

  --rose-500: #f43f5e;
  --cyan-500: #06b6d4;

  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 20px var(--emerald-glow);
}

/* Light Theme Variables */
body.light-theme {
  --bg-primary: #f3f4f6;
  --bg-secondary: #ffffff;
  --bg-tertiary: #e5e7eb;
  --bg-card: rgba(255, 255, 255, 0.95);
  --bg-card-hover: #ffffff;
  --border-color: #d1d5db;
  --border-focus: #059669;
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;
  --shadow-glow: 0 0 16px rgba(16, 185, 129, 0.18);
}

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

html, body {
  height: 100%;
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  overflow: hidden;
}

/* App Container */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: relative;
  overflow: hidden;
}

/* Top Institutional Header */
.top-navbar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 0.65rem 1.5rem;
  z-index: 100;
  backdrop-filter: blur(12px);
  flex-shrink: 0;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  text-decoration: none;
}

.brand-badge .domain {
  background: linear-gradient(135deg, #10b981 0%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-tag {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald-400);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* View Mode Switcher Pills */
.view-mode-pill {
  display: inline-flex;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  padding: 2px;
  border-radius: 9999px;
}

.view-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.view-btn.active {
  background: var(--emerald-500);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.4);
}

/* Filter Chips */
.filter-chip {
  font-size: 0.78rem;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.filter-chip:hover, .filter-chip.active {
  background: rgba(16, 185, 129, 0.18);
  color: var(--emerald-400);
  border-color: var(--emerald-500);
}

/* ==========================================================================
   CENTER STAGE (Holds either Map View, Grid View, or Split View)
   ========================================================================== */
.center-stage-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  background: var(--bg-primary);
}

/* Map View Pane (Centered Full Map) */
.map-view-pane {
  flex: 1;
  height: 100%;
  width: 100%;
  position: relative;
  display: block;
}

#houstonMap {
  width: 100%;
  height: 100%;
  background: #0f172a;
  z-index: 10;
}

/* Floating Bottom Houses Carousel in Map View */
.map-floating-carousel {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  width: calc(100% - 2.5rem);
  max-width: 1100px;
  background: rgba(17, 24, 39, 0.88);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 0.75rem 1rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.carousel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-secondary);
  padding: 0 0.25rem;
}

.carousel-cards-scroll {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  scrollbar-width: thin;
}

.carousel-cards-scroll::-webkit-scrollbar {
  height: 4px;
}
.carousel-cards-scroll::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.mini-house-card {
  min-width: 250px;
  max-width: 250px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.mini-house-card:hover, .mini-house-card.selected {
  border-color: var(--emerald-500);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.mini-house-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.mini-house-price {
  font-weight: 800;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--text-primary);
}

.mini-house-addr {
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-house-sub {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.mini-house-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.25rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.72rem;
}

/* Grid View Pane (Centered Cards Grid) */
.grid-view-pane {
  flex: 1;
  height: 100%;
  overflow-y: auto;
  padding: 1.75rem 2rem;
  display: none;
}

.grid-view-header {
  max-width: 1300px;
  margin: 0 auto 1.5rem auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.centered-house-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  max-width: 1300px;
  margin: 0 auto;
}

/* Full Listing Card in Grid */
.listing-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  display: flex;
  flex-direction: column;
}

.listing-card:hover {
  transform: translateY(-4px);
  border-color: var(--emerald-500);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5), var(--shadow-glow);
}

.listing-card.selected {
  border-color: var(--emerald-500);
  box-shadow: 0 0 0 2px var(--emerald-500), var(--shadow-glow);
}

.card-image-wrap {
  position: relative;
  height: 180px;
  background: #1e293b;
  overflow: hidden;
}

.card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.listing-card:hover .card-image-wrap img {
  transform: scale(1.05);
}

.card-grade-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-md);
  z-index: 5;
}

.grade-A {
  background: rgba(16, 185, 129, 0.92);
  color: #ffffff;
}

.grade-B {
  background: rgba(59, 130, 246, 0.92);
  color: #ffffff;
}

.grade-C {
  background: rgba(245, 158, 11, 0.92);
  color: #ffffff;
}

.card-adu-tag {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(17, 24, 39, 0.88);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.4);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  backdrop-filter: blur(8px);
  z-index: 5;
}

.card-body {
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-price-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.35rem;
}

.card-price {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.card-net-housing {
  font-size: 0.85rem;
  color: var(--emerald-400);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.card-address {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-submarket {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 0.85rem;
}

.card-specs-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.spec-item {
  display: flex;
  flex-direction: column;
}

.spec-val {
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.spec-lbl {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.card-cta-row {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--emerald-400);
  font-weight: 600;
}

/* ==========================================================================
   DEEP-DIVE PROPERTY DRAWER (Opens when house is clicked for more details)
   ========================================================================== */
.detail-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 720px;
  max-width: 100%;
  background: var(--bg-primary);
  border-left: 1px solid var(--border-color);
  box-shadow: -15px 0 35px rgba(0, 0, 0, 0.6);
  z-index: 50;
  display: flex;
  flex-direction: column;
  transform: translateX(105%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.detail-drawer.open {
  transform: translateX(0);
}

/* Drawer Sticky Header */
.drawer-header {
  padding: 1rem 1.5rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.drawer-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-back-center {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
}

.btn-back-center:hover {
  background: var(--border-color);
  color: var(--emerald-400);
}

.drawer-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease;
}

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

/* Drawer Scrollable Content */
.drawer-content {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 2rem;
}

/* Report Hero Bar */
.report-hero-bar {
  padding: 1.25rem 1.75rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.report-hero-title h1 {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.report-hero-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* Report Tab Navigation */
.report-tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0 1.5rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
  position: sticky;
  top: 0;
  z-index: 20;
}

.report-tab-btn {
  padding: 0.85rem 1.15rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}

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

.report-tab-btn.active {
  color: var(--emerald-400);
  border-bottom-color: var(--emerald-500);
}

.tab-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

.report-tab-btn.active .tab-badge {
  background: rgba(16, 185, 129, 0.2);
  color: var(--emerald-400);
}

/* Tab Panes */
.tab-content-area {
  padding: 1.5rem 1.75rem;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.2s ease-in-out;
}

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

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* KPI Banner & Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.kpi-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.kpi-card:hover {
  border-color: rgba(16, 185, 129, 0.4);
}

.kpi-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--emerald-500);
}

.kpi-card.indigo::after { background: var(--indigo-500); }
.kpi-card.amber::after { background: var(--amber-500); }
.kpi-card.cyan::after { background: var(--cyan-500); }

.kpi-label {
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kpi-value {
  font-size: 1.65rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-primary);
  line-height: 1.1;
}

.kpi-subtext {
  font-size: 0.75rem;
  color: var(--emerald-400);
  margin-top: 0.35rem;
  font-weight: 500;
}

.kpi-subtext.muted {
  color: var(--text-muted);
}

/* Spotlight Comparison Box */
.spotlight-box {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(30, 58, 138, 0.15) 100%);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-xl);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.75rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

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

.spotlight-metric .num {
  font-size: 1.75rem;
  font-weight: 800;
  font-family: var(--font-mono);
}

.spotlight-metric .lbl {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.2rem;
}

.spotlight-operator {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* Pro Forma Grid */
.proforma-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

@media (max-width: 900px) {
  .proforma-grid {
    grid-template-columns: 1fr;
  }
}

.panel-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.panel-section-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.65rem;
}

/* Sliders & Inputs */
.input-group {
  margin-bottom: 1.15rem;
}

.input-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

.input-val-badge {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--emerald-400);
  background: rgba(16, 185, 129, 0.12);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 9999px;
  background: var(--bg-tertiary);
  outline: none;
  cursor: pointer;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--emerald-500);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
  border: 2px solid #ffffff;
}

.btn-toggle-group {
  display: flex;
  background: var(--bg-tertiary);
  padding: 0.2rem;
  border-radius: var(--radius-md);
  gap: 0.2rem;
}

.btn-toggle {
  flex: 1;
  padding: 0.4rem 0.65rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.btn-toggle.active {
  background: var(--bg-secondary);
  color: var(--emerald-400);
  box-shadow: var(--shadow-sm);
}

/* Financial Tables */
.fin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.fin-table tr {
  border-bottom: 1px solid rgba(55, 65, 81, 0.5);
}

.fin-table td {
  padding: 0.55rem 0;
}

.fin-table td:last-child {
  text-align: right;
  font-family: var(--font-mono);
  font-weight: 600;
}

.fin-table tr.total-row {
  border-top: 2px solid var(--border-color);
  border-bottom: none;
  font-weight: 700;
  font-size: 0.92rem;
}

.fin-table tr.total-row td {
  padding-top: 0.75rem;
  color: var(--emerald-400);
}

/* Strategic Advisor Cards */
.advisor-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.advisor-verdict-banner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.15rem;
  border-radius: var(--radius-md);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  margin-bottom: 1.25rem;
}

.verdict-stamp {
  font-size: 2rem;
  font-weight: 900;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-md);
  letter-spacing: -0.05em;
  font-family: var(--font-mono);
  box-shadow: var(--shadow-md);
}

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(55, 65, 81, 0.5);
  font-size: 0.85rem;
}

.checklist-icon {
  flex-shrink: 0;
  margin-top: 0.15rem;
}

/* Quality of Life Progress Bars */
.qol-bar-wrap {
  margin-bottom: 0.85rem;
}

.qol-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  margin-bottom: 0.3rem;
  font-weight: 600;
}

.qol-bar-track {
  height: 7px;
  background: var(--bg-tertiary);
  border-radius: 9999px;
  overflow: hidden;
}

.qol-bar-fill {
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, #10b981 0%, #06b6d4 100%);
  transition: width 0.4s ease;
}

/* Timeline */
.timeline-container {
  position: relative;
  padding-left: 2rem;
}

.timeline-container::before {
  content: '';
  position: absolute;
  top: 0.5rem;
  left: 0.65rem;
  bottom: 0.5rem;
  width: 2px;
  background: var(--border-color);
}

.timeline-step {
  position: relative;
  margin-bottom: 1.5rem;
}

.timeline-dot {
  position: absolute;
  left: -2rem;
  top: 0.2rem;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: var(--emerald-500);
  border: 3px solid var(--bg-secondary);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

/* Incentive Cards */
.incentive-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  transition: all 0.2s ease;
  cursor: pointer;
}

.incentive-card:hover {
  border-color: var(--emerald-500);
  background: var(--bg-card-hover);
}

.incentive-card.active {
  border-color: var(--emerald-500);
  background: rgba(16, 185, 129, 0.08);
}

.incentive-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--emerald-500);
  margin-top: 0.15rem;
  cursor: pointer;
}

.incentive-content {
  flex: 1;
}

.incentive-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.incentive-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.incentive-val {
  font-family: var(--font-mono);
  font-weight: 800;
  color: var(--emerald-400);
  font-size: 0.9rem;
}

.incentive-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
}

.modal-backdrop.active {
  display: flex;
}

.modal-dialog {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 650px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  padding: 1.75rem;
}

/* Custom Marker Styling */
.custom-leaflet-marker {
  background: none;
  border: none;
}

.leaflet-popup-content-wrapper {
  background: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5) !important;
}

.leaflet-popup-tip {
  background: var(--bg-secondary) !important;
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.5);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: var(--border-color);
}

/* Print Styling */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    overflow: visible !important;
  }
  .top-navbar, .center-stage-container, .btn-primary, .btn-secondary, .modal-backdrop, .no-print, .drawer-header {
    display: none !important;
  }
  .detail-drawer {
    position: static !important;
    width: 100% !important;
    transform: none !important;
    box-shadow: none !important;
    border: none !important;
    overflow: visible !important;
  }
  .tab-pane {
    display: block !important;
    page-break-after: always;
  }
}
