  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  :root {
    --orange:  #E8600A; --orange-l: #F0883A; --orange-pale: #FFF3E8;
    --cream:   #FBF5EC; --cream-2:  #F0E8D8; --cream-3: #E8DCC8;
    --brown:   #2B3A4A; --brown-m:  #4A5568; --brown-l: #718096;
    --white:   #FFFFFF; --red: #C44000; --green: #2A6B3A;
  }
  html, body { height: 100%; font-family: 'Inter', sans-serif; background: var(--cream); color: var(--brown); overflow-x: hidden; }

  /* ── TOPBAR ────────────────────────────────────────────────────────────── */
  .topbar {
    height: 52px; background: #1E293B; display: flex; align-items: center;
    justify-content: space-between; padding: 0 20px; flex-shrink: 0; position: sticky; top: 0; z-index: 200;
  }
  .topbar-logo { display: flex; align-items: center; gap: 8px; }
  .logo-mark {
    width: 26px; height: 26px; border-radius: 6px; background: var(--orange);
    display: flex; align-items: center; justify-content: center; font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 800; font-size: 13px; color: white;
  }
  .logo-name { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; font-size: 15px; color: rgba(251,245,236,0.9); letter-spacing: -0.01em; }
  .topbar-center {
    display: flex; gap: 4px; background: rgba(255,255,255,0.06); border-radius: 8px; padding: 3px;
  }
  .tab {
    padding: 5px 14px; border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer;
    color: rgba(251,245,236,0.5); transition: all 0.18s; border: none; background: none;
    font-family: 'Inter', sans-serif; letter-spacing: -0.01em;
  }
  .tab.active { background: var(--orange); color: white; }
  .tab:hover:not(.active) { color: rgba(251,245,236,0.85); }
  .demo-badge {
    background: rgba(232,96,10,0.2); border: 1px solid rgba(232,96,10,0.3);
    color: var(--orange-l); font-size: 11px; font-family: 'JetBrains Mono', monospace;
    padding: 3px 10px; border-radius: 999px; letter-spacing: 0.04em;
  }

  /* ── LAYOUT ────────────────────────────────────────────────────────────── */
  .app { display: flex; height: calc(100vh - 52px); }

  /* ── SIDEBAR ───────────────────────────────────────────────────────────── */
  .sidebar {
    width: 240px; flex-shrink: 0; background: #FAFAFA;
    border-right: 1px solid rgba(43,58,74,0.08);
    display: flex; flex-direction: column; padding: 16px 0; overflow-y: auto;
  }
  .sidebar-section { padding: 0 12px; margin-bottom: 24px; }
  .sidebar-label {
    font-family: 'JetBrains Mono', monospace; font-size: 9px; letter-spacing: 0.1em;
    text-transform: uppercase; color: var(--brown-l); padding: 0 4px; margin-bottom: 6px;
  }
  .sidebar-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px; border-radius: 7px; cursor: pointer;
    font-size: 13.5px; font-weight: 500; color: var(--brown-m);
    transition: all 0.15s; border: none; background: none; width: 100%; text-align: left;
  }
  .sidebar-item:hover { background: var(--cream); color: var(--brown); }
  .sidebar-item.active { background: var(--orange-pale); color: var(--orange); }
  .sidebar-item .icon { font-size: 15px; width: 20px; text-align: center; }
  .sidebar-count {
    margin-left: auto; font-size: 11px; background: var(--cream-2);
    padding: 1px 7px; border-radius: 999px; color: var(--brown-l);
  }
  .sidebar-item.active .sidebar-count { background: rgba(232,96,10,0.15); color: var(--orange); }

  /* ── MAIN CONTENT ──────────────────────────────────────────────────────── */
  .main { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }

  /* ── PANELS (views) ────────────────────────────────────────────────────── */
  .panel { display: none; flex: 1; }
  .panel.active { display: flex; flex-direction: column; }

  /* ── MARKETPLACE PANEL ─────────────────────────────────────────────────── */
  .marketplace-header {
    padding: 20px 24px 16px; border-bottom: 1px solid rgba(43,58,74,0.08);
    display: flex; align-items: center; gap: 12px; background: var(--white); flex-wrap: wrap;
  }
  .marketplace-header h2 { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; font-size: 20px; flex: 1; }
  .search-box {
    display: flex; align-items: center; gap: 8px;
    background: var(--cream); border: 1px solid rgba(43,58,74,0.1); border-radius: 8px;
    padding: 8px 12px; flex: 1; max-width: 300px;
  }
  .search-box input {
    border: none; background: none; font-size: 13.5px; font-family: 'Inter', sans-serif;
    color: var(--brown); outline: none; width: 100%;
  }
  .search-box input::placeholder { color: var(--brown-l); }
  .filter-row {
    display: flex; gap: 8px; padding: 12px 24px; border-bottom: 1px solid rgba(43,58,74,0.06); flex-wrap: wrap;
  }
  .filter-chip {
    padding: 5px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 500;
    border: 1.5px solid rgba(43,58,74,0.12); cursor: pointer; background: var(--white);
    color: var(--brown-m); transition: all 0.15s;
  }
  .filter-chip:hover { border-color: var(--orange); color: var(--orange); }
  .filter-chip.on { background: var(--orange); border-color: var(--orange); color: white; }

  .properties-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 20px 24px; align-content: start;
  }
  .prop-card {
    background: var(--white); border: 1px solid rgba(43,58,74,0.08); border-radius: 12px;
    overflow: hidden; cursor: pointer; transition: all 0.2s;
  }
  .prop-card:hover { border-color: var(--orange); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(43,58,74,0.08); }
  .prop-card.selected { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(232,96,10,0.15); }
  .prop-banner {
    height: 72px; display: flex; align-items: center; justify-content: center;
    font-size: 36px; font-weight: 800; letter-spacing: -0.02em; color: white;
  }
  .prop-body { padding: 14px 16px; }
  .prop-name { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 600; font-size: 14px; margin-bottom: 2px; letter-spacing: -0.01em; }
  .prop-league { font-size: 12px; color: var(--brown-l); margin-bottom: 10px; }
  .prop-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
  .prop-tag {
    font-size: 11px; padding: 3px 9px; border-radius: 999px;
    background: var(--cream); color: var(--brown-m); font-weight: 500;
  }
  .prop-meta { display: flex; justify-content: space-between; align-items: center; }
  .prop-audience { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--brown-l); }
  .prop-price { font-weight: 700; font-size: 14px; color: var(--orange); }
  .match-score {
    display: none; margin-top: 10px; padding: 8px 10px; border-radius: 7px;
    background: var(--orange-pale); border: 1px solid rgba(232,96,10,0.2);
    font-size: 12px; font-weight: 600; color: var(--orange);
    display: flex; align-items: center; gap: 6px;
  }
  .match-bar {
    flex: 1; height: 4px; background: rgba(232,96,10,0.15); border-radius: 2px; overflow: hidden;
  }
  .match-bar-fill { height: 100%; background: var(--orange); border-radius: 2px; transition: width 1s ease; }

  /* ── AI MATCH PANEL ────────────────────────────────────────────────────── */
  .match-panel { padding: 24px; display: flex; gap: 24px; flex: 1; min-height: 0; }
  .match-brief {
    width: 320px; flex-shrink: 0; display: flex; flex-direction: column; gap: 16px;
  }
  .match-results { flex: 1; overflow-y: auto; }

  .brief-card {
    background: var(--white); border: 1px solid rgba(43,58,74,0.08); border-radius: 12px; padding: 20px;
  }
  .brief-card h3 { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; font-size: 16px; margin-bottom: 16px; }
  .brief-field { margin-bottom: 14px; }
  .brief-label {
    font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.08em;
    text-transform: uppercase; color: var(--brown-l); margin-bottom: 5px;
  }
  .brief-input, .brief-select {
    width: 100%; border: 1.5px solid rgba(43,58,74,0.1); border-radius: 7px;
    padding: 9px 12px; font-size: 13.5px; font-family: 'Inter', sans-serif;
    color: var(--brown); background: var(--cream); outline: none; transition: border-color 0.2s;
  }
  .brief-input:focus, .brief-select:focus { border-color: var(--orange); }
  .brief-select option { background: white; }
  .range-display { text-align: right; font-size: 12px; color: var(--orange); font-weight: 600; margin-top: 4px; }
  input[type=range] { width: 100%; accent-color: var(--orange); }

  .match-btn {
    width: 100%; padding: 14px; border-radius: 9px; font-size: 15px; font-weight: 600;
    background: var(--orange); color: white; border: none; cursor: pointer;
    font-family: 'Inter', sans-serif; transition: all 0.2s;
  }
  .match-btn:hover { background: #c44f00; }
  .match-btn:disabled { background: var(--cream-3); color: var(--brown-l); cursor: not-allowed; }

  .results-header {
    display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap;
  }
  .results-header h3 { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 600; font-size: 16px; letter-spacing: -0.01em; }
  .results-meta { font-size: 13px; color: var(--brown-l); }

  .result-row {
    background: var(--white); border: 1px solid rgba(43,58,74,0.08); border-radius: 10px;
    padding: 16px; margin-bottom: 10px; display: flex; align-items: center; gap: 14px;
    cursor: pointer; transition: all 0.18s;
    opacity: 0; transform: translateX(12px);
    animation: slideIn 0.4s ease forwards;
  }
  .result-row:hover { border-color: var(--orange); }
  @keyframes slideIn { to { opacity: 1; transform: translateX(0); } }
  .result-rank {
    font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 24px;
    color: var(--cream-3); width: 32px; flex-shrink: 0; text-align: center;
  }
  .result-rank.top { color: var(--orange); }
  .result-icon { font-size: 28px; flex-shrink: 0; }
  .result-info { flex: 1; min-width: 0; }
  .result-name { font-weight: 600; font-size: 15px; }
  .result-detail { font-size: 12.5px; color: var(--brown-l); margin-top: 3px; }
  .result-tags { display: flex; gap: 5px; margin-top: 6px; flex-wrap: wrap; }
  .result-tag { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--cream); color: var(--brown-m); }
  .result-score-wrap { text-align: right; flex-shrink: 0; }
  .result-score-val {
    font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 22px;
    color: var(--orange);
  }
  .result-score-label { font-size: 11px; color: var(--brown-l); }
  .result-mini-bar { width: 80px; height: 5px; background: var(--cream-2); border-radius: 3px; margin-top: 5px; overflow: hidden; }
  .result-mini-bar-fill { height: 100%; background: var(--orange); border-radius: 3px; }
  .ai-explain {
    font-size: 12px; color: var(--brown-m); background: var(--cream); border-radius: 6px;
    padding: 8px 10px; margin-top: 8px; line-height: 1.5;
    border-left: 2px solid var(--orange);
  }

  .empty-state {
    text-align: center; padding: 60px 24px; color: var(--brown-l);
  }
  .empty-icon { font-size: 48px; margin-bottom: 16px; }
  .empty-state p { font-size: 15px; max-width: 320px; margin: 0 auto; line-height: 1.6; }

  /* ── DEAL ROOM PANEL ───────────────────────────────────────────────────── */
  .deals-panel { padding: 20px 24px; }
  .deals-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
  .deals-header h2 { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; font-size: 20px; }
  .btn-sm {
    padding: 8px 18px; border-radius: 7px; font-size: 13px; font-weight: 600;
    background: var(--orange); color: white; border: none; cursor: pointer;
    font-family: 'Inter', sans-serif; transition: all 0.2s;
  }
  .btn-sm:hover { background: #c44f00; }

  .pipeline {
    display: grid; grid-template-columns: repeat(4,1fr); gap: 12px;
  }
  .pipeline-col { background: var(--white); border-radius: 10px; border: 1px solid rgba(43,58,74,0.07); overflow: hidden; }
  .pipeline-col-header {
    padding: 12px 14px; border-bottom: 1px solid rgba(43,58,74,0.07);
    display: flex; align-items: center; gap: 8px;
  }
  .pipeline-col-title { font-weight: 600; font-size: 13px; }
  .pipeline-col-count {
    margin-left: auto; font-size: 11px; background: var(--cream); padding: 2px 8px;
    border-radius: 999px; color: var(--brown-l);
  }
  .pipeline-dot { width: 8px; height: 8px; border-radius: 50%; }
  .pipeline-cards { padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 120px; }
  .deal-card {
    background: var(--cream); border: 1px solid rgba(43,58,74,0.07); border-radius: 8px;
    padding: 12px; cursor: pointer; transition: all 0.18s;
  }
  .deal-card:hover { border-color: var(--orange); }
  .deal-card-name { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
  .deal-card-detail { font-size: 12px; color: var(--brown-l); }
  .deal-card-value { font-weight: 700; color: var(--orange); font-size: 13px; margin-top: 6px; }
  .deal-card-days { font-size: 11px; color: var(--brown-l); margin-top: 3px; }

  /* ── ANALYTICS PANEL ───────────────────────────────────────────────────── */
  .analytics-panel { padding: 24px; }
  .kpi-row { display: grid; grid-template-columns: repeat(auto-fit,minmax(160px,1fr)); gap: 14px; margin-bottom: 28px; }
  .kpi-card {
    background: var(--white); border: 1px solid rgba(43,58,74,0.08); border-radius: 10px; padding: 18px;
  }
  .kpi-label { font-size: 12px; color: var(--brown-l); margin-bottom: 6px; font-family: 'JetBrains Mono', monospace; }
  .kpi-val { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 28px; color: var(--brown); letter-spacing: -0.02em; }
  .kpi-delta { font-size: 12px; color: var(--green); margin-top: 4px; }
  .kpi-delta.neg { color: var(--red); }

  .charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .chart-card { background: var(--white); border: 1px solid rgba(43,58,74,0.08); border-radius: 10px; padding: 20px; }
  .chart-card h3 { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; font-size: 15px; margin-bottom: 16px; }
  .bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 120px; }
  .bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; }
  .bar {
    width: 100%; background: var(--orange); border-radius: 4px 4px 0 0;
    transition: height 0.6s ease; min-height: 4px;
  }
  .bar-label { font-size: 10px; color: var(--brown-l); }
  .bar-val { font-size: 10px; font-weight: 600; color: var(--brown-m); }

  .roi-list { display: flex; flex-direction: column; gap: 10px; }
  .roi-row { display: flex; align-items: center; gap: 10px; }
  .roi-name { font-size: 13px; color: var(--brown-m); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .roi-bar-wrap { flex: 2; background: var(--cream); border-radius: 3px; height: 8px; overflow: hidden; }
  .roi-bar { height: 100%; border-radius: 3px; background: var(--orange); }
  .roi-val { font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 500; color: var(--orange); width: 52px; text-align: right; }

  /* ── MODAL ─────────────────────────────────────────────────────────────── */
  .modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(43,58,74,0.55);
    z-index: 500; align-items: center; justify-content: center;
    backdrop-filter: blur(4px);
  }
  .modal-overlay.open { display: flex; }
  .modal {
    background: var(--white); border-radius: 16px; padding: 32px; max-width: 560px; width: 90%;
    box-shadow: 0 32px 80px rgba(43,58,74,0.2); animation: modalIn 0.25s ease;
  }
  @keyframes modalIn { from { opacity:0; transform:scale(0.95) translateY(12px); } }
  .modal-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
  .modal-header h3 { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; font-size: 22px; }
  .modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--brown-l); padding: 4px; }
  .modal-section { margin-bottom: 18px; }
  .modal-label { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--brown-l); margin-bottom: 6px; }
  .modal-value { font-size: 15px; color: var(--brown); }
  .stat-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
  .stat-box { background: var(--cream); border-radius: 8px; padding: 12px; text-align: center; }
  .stat-box .val { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; font-size: 20px; color: var(--orange); }
  .stat-box .lbl { font-size: 11px; color: var(--brown-l); margin-top: 3px; }
  .modal-cta { width: 100%; padding: 14px; background: var(--orange); color: white; border: none; cursor: pointer; border-radius: 9px; font-size: 15px; font-weight: 600; font-family: 'Inter', sans-serif; margin-top: 8px; transition: all 0.2s; }
  .modal-cta:hover { background: #c44f00; }

  @media (max-width: 900px) {
    .sidebar { display: none; }
    .pipeline { grid-template-columns: repeat(2,1fr); }
    .charts-grid { grid-template-columns: 1fr; }
    .match-panel { flex-direction: column; }
    .match-brief { width: 100%; }
  }
