/* ══════════════════════════════════════════════
   ADA v2.0 — 515 Rentals & Sales
   Adam Metzker · Des Moines, Iowa
   Built by RJ Business Solutions | March 2026
   rickjeffersonsolutions.com
══════════════════════════════════════════════ */

:root {
  /* 515 Brand Colors */
  --515-dark:    #0d1117;
  --515-navy:    #0f2040;
  --515-blue:    #1a3a6b;
  --515-accent:  #e67e22;
  --515-gold:    #f39c12;
  --515-green:   #27ae60;
  --515-red:     #e74c3c;

  --blue-900: #0a1628;
  --blue-800: #0d1f3c;
  --blue-700: #1a3a6b;
  --blue-600: #1e4da8;
  --blue-500: #2563eb;
  --blue-400: #3b82f6;
  --blue-300: #93c5fd;
  --blue-100: #dbeafe;
  --blue-50:  #eff6ff;

  --gold-500: #d97706;
  --gold-400: #f59e0b;
  --gold-300: #fcd34d;
  --gold-100: #fef3c7;

  --green-600: #059669;
  --green-500: #10b981;
  --green-100: #d1fae5;

  --red-600: #dc2626;
  --red-500: #ef4444;
  --red-100: #fee2e2;

  --gray-900: #111827;
  --gray-800: #1f2937;
  --gray-700: #374151;
  --gray-600: #4b5563;
  --gray-500: #6b7280;
  --gray-400: #9ca3af;
  --gray-300: #d1d5db;
  --gray-200: #e5e7eb;
  --gray-100: #f3f4f6;
  --gray-50:  #f9fafb;
  --white:    #ffffff;

  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;

  --shadow-sm:  0 1px 3px rgba(0,0,0,.08);
  --shadow-md:  0 4px 12px rgba(0,0,0,.12);
  --shadow-lg:  0 8px 24px rgba(0,0,0,.16);
  --shadow-xl:  0 16px 48px rgba(0,0,0,.2);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  --header-height: 64px;
  --sidebar-width: 240px;
}

/* ── Reset & Base ───────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  background: #0d1117;
  color: var(--gray-100);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

a { color: var(--blue-300); text-decoration: none; }
a:hover { color: var(--515-gold); }
button { cursor: pointer; font-family: var(--font-main); }
input, select, textarea { font-family: var(--font-main); }

/* ── Header ─────────────────────────────── */
.ada-header {
  height: var(--header-height);
  background: linear-gradient(135deg, #0d1117 0%, #0f2040 100%);
  border-bottom: 2px solid var(--515-accent);
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  box-shadow: var(--shadow-lg);
}

.header-inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
  flex-shrink: 0;
}

.rj-logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--515-accent);
}

.brand-text {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-515 {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--515-accent);
  letter-spacing: -1px;
  font-family: var(--font-display);
}

.brand-names {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 1rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.brand-sub {
  font-size: 0.65rem;
  color: var(--gray-400);
  white-space: nowrap;
}

/* Nav */
.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: center;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--gray-400);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all .2s;
}

.nav-btn:hover {
  color: var(--white);
  background: rgba(255,255,255,.08);
}

.nav-btn.active {
  background: var(--515-accent);
  color: var(--white);
  border-color: transparent;
  font-weight: 700;
  box-shadow: 0 0 16px rgba(230,126,34,.4);
}

/* Status */
.header-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

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

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

.status-text {
  font-size: 0.78rem;
  color: var(--gray-400);
  font-weight: 500;
  white-space: nowrap;
}

/* ── Main ───────────────────────────────── */
.ada-main {
  flex: 1;
  margin-top: var(--header-height);
  overflow: hidden;
}

.view {
  height: calc(100vh - var(--header-height));
  overflow: hidden;
}

/* ── CHAT VIEW ──────────────────────────── */
.chat-layout {
  display: flex;
  height: 100%;
}

/* Sidebar */
.chat-sidebar {
  width: var(--sidebar-width);
  background: #0f1923;
  border-right: 1px solid rgba(255,255,255,.06);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.sidebar-header h3 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gray-300);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-header small {
  font-size: 0.7rem;
  color: var(--gray-500);
  display: block;
  margin-top: 4px;
}

.playbook-list { padding: 8px; }

.playbook-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--gray-400);
  text-align: left;
  transition: all .2s;
  margin-bottom: 4px;
}

.playbook-btn:hover {
  background: rgba(255,255,255,.05);
  color: var(--gray-100);
}

.playbook-btn.active {
  background: rgba(230,126,34,.15);
  border-color: rgba(230,126,34,.4);
  color: var(--white);
}

.pb-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.playbook-btn.active .pb-icon {
  background: var(--515-accent);
  color: var(--white);
}

.pb-info strong {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
}

.pb-info small {
  font-size: 0.72rem;
  opacity: .7;
}

/* Sidebar stats */
.sidebar-stats {
  display: flex;
  padding: 12px 16px;
  gap: 8px;
  border-top: 1px solid rgba(255,255,255,.06);
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.sstat {
  flex: 1;
  text-align: center;
}

.sstat-num {
  display: block;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--515-accent);
}

.sstat-label {
  display: block;
  font-size: 0.62rem;
  color: var(--gray-500);
  text-transform: uppercase;
}

/* Adam quote */
.sidebar-adam {
  padding: 16px;
  margin-top: auto;
}

.adam-quote {
  font-size: 0.72rem;
  color: var(--gray-500);
  font-style: italic;
  line-height: 1.5;
  border-left: 2px solid var(--515-accent);
  padding-left: 10px;
}

.adam-credit {
  font-size: 0.65rem;
  color: var(--gray-600);
  margin-top: 6px;
}

/* Chat Main */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #0d1117;
}

/* Escalation */
.escalate-box {
  margin: 12px 16px 0;
  background: linear-gradient(135deg, rgba(231,76,60,.15), rgba(231,76,60,.08));
  border: 1.5px solid var(--515-red);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  animation: pulse-border 2s infinite;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

@keyframes pulse-border {
  0%, 100% { border-color: var(--515-red); }
  50% { border-color: rgba(231,76,60,.4); }
}

.escalate-inner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
}

.escalate-icon {
  font-size: 1.2rem;
  color: var(--515-red);
  flex-shrink: 0;
}

.escalate-text strong {
  display: block;
  color: var(--515-red);
  font-size: 0.85rem;
  font-weight: 700;
}

.escalate-text p {
  font-size: 0.8rem;
  color: var(--gray-300);
  margin-top: 2px;
}

.escalate-dismiss {
  background: none;
  border: none;
  color: var(--gray-500);
  font-size: 1.2rem;
  padding: 0 4px;
  line-height: 1;
}

/* Chat Window */
.chat-window {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.chat-window::-webkit-scrollbar { width: 6px; }
.chat-window::-webkit-scrollbar-track { background: transparent; }
.chat-window::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 3px; }

/* Messages */
.message {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 88%;
  animation: msgIn .3s ease;
}

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

.message.user {
  flex-direction: row-reverse;
  margin-left: auto;
}

.avatar {
  width: 32px;
  height: 32px;
  background: var(--515-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: var(--white);
  flex-shrink: 0;
}

.bubble {
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  font-size: 0.88rem;
  line-height: 1.65;
  max-width: 100%;
  word-break: break-word;
}

.message.ada .bubble {
  background: #1a2332;
  color: var(--gray-100);
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(255,255,255,.06);
}

.message.user .bubble {
  background: var(--515-accent);
  color: var(--white);
  border-bottom-right-radius: 4px;
}

.bubble strong { color: var(--515-gold); }
.bubble code {
  background: rgba(255,255,255,.1);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.82rem;
  font-family: monospace;
}
.bubble .msg-hr {
  border: none;
  border-top: 1px solid rgba(255,255,255,.1);
  margin: 8px 0;
}
.bubble .msg-bullet {
  display: block;
  padding: 1px 0 1px 4px;
  color: var(--gray-200);
}
.bubble .msg-numbered {
  display: block;
  padding: 2px 0 2px 4px;
  color: var(--gray-200);
}
.bubble .msg-section-head {
  display: block;
  font-weight: 600;
  color: var(--515-gold);
  margin: 6px 0 2px;
  font-size: 0.88rem;
}

/* Typing indicator */
.typing-indicator {
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.typing-indicator span {
  width: 7px;
  height: 7px;
  background: var(--gray-500);
  border-radius: 50%;
  animation: typing-bounce 1.2s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: .2s; }
.typing-indicator span:nth-child(3) { animation-delay: .4s; }

@keyframes typing-bounce {
  0%, 100% { transform: translateY(0); opacity: .5; }
  50% { transform: translateY(-5px); opacity: 1; }
}

/* Input area */
.chat-input-area {
  padding: 12px 16px;
  background: #0f1923;
  border-top: 1px solid rgba(255,255,255,.06);
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

#chat-input {
  flex: 1;
  background: #1a2332;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--gray-100);
  font-size: 0.9rem;
  resize: none;
  max-height: 150px;
  min-height: 42px;
  transition: border-color .2s;
  line-height: 1.5;
}

#chat-input:focus {
  outline: none;
  border-color: var(--515-accent);
}

#chat-input::placeholder { color: var(--gray-600); }

.send-btn {
  width: 42px;
  height: 42px;
  background: var(--515-accent);
  border: none;
  border-radius: var(--radius-md);
  color: var(--white);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all .2s;
  box-shadow: 0 0 12px rgba(230,126,34,.3);
}

.send-btn:hover {
  background: var(--515-gold);
  transform: scale(1.05);
}

/* Quick Actions */
.quick-actions {
  padding: 8px 16px 12px;
  background: #0f1923;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.quick-actions button {
  padding: 5px 12px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px;
  color: var(--gray-400);
  font-size: 0.75rem;
  transition: all .2s;
}

.quick-actions button:hover {
  background: rgba(230,126,34,.15);
  border-color: var(--515-accent);
  color: var(--gray-100);
}

/* ── UNDERWRITE VIEW ────────────────────── */
#view-underwrite {
  overflow-y: auto;
  padding: 0;
  background: #0d1117;
}

.underwrite-tabs {
  display: flex;
  gap: 0;
  background: #0f1923;
  border-bottom: 2px solid var(--515-accent);
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.utab {
  padding: 14px 20px;
  background: transparent;
  border: none;
  color: var(--gray-500);
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all .2s;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}

.utab:hover { color: var(--gray-200); }
.utab.active {
  color: var(--515-accent);
  border-bottom-color: var(--515-accent);
}

#calc-content { padding: 0; }

/* Calc Wrapper */
.calc-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

.calc-header {
  margin-bottom: 24px;
}

.calc-header h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 10px;
}

.calc-header h2 i { color: var(--515-accent); }

.calc-sub {
  font-size: 0.82rem;
  color: var(--gray-500);
  margin-top: 4px;
}

/* Calc Grid */
.calc-grid {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 24px;
  align-items: start;
}

/* Input Sections */
.input-section {
  background: #0f1923;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 14px;
}

.input-section h3 {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.input-section h3 i { color: var(--515-accent); }

.input-group {
  margin-bottom: 12px;
}

.input-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gray-400);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-group small {
  display: block;
  font-size: 0.7rem;
  color: var(--gray-600);
  margin-top: 4px;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

input[type="number"],
input[type="text"],
input[type="date"],
select,
textarea {
  width: 100%;
  background: #1a2332;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--gray-100);
  font-size: 0.88rem;
  transition: border-color .2s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--515-accent);
}

select option { background: #1a2332; }

/* Calc Button */
.calc-btn {
  width: 100%;
  padding: 13px;
  background: var(--515-accent);
  border: none;
  border-radius: var(--radius-md);
  color: var(--white);
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all .2s;
  margin-top: 6px;
  box-shadow: 0 0 16px rgba(230,126,34,.3);
}

.calc-btn:hover {
  background: var(--515-gold);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(230,126,34,.4);
}

/* Results */
.calc-results {
  background: #0f1923;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: var(--radius-lg);
  min-height: 500px;
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
}

.results-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 400px;
  color: var(--gray-700);
  text-align: center;
  gap: 12px;
}

.results-placeholder p { font-size: 0.88rem; line-height: 1.6; }
.placeholder-sub { font-size: 0.75rem; color: var(--gray-600); }

.results-content { padding: 20px; }

/* Verdict */
.verdict-box {
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 20px;
  text-align: center;
}

.verdict-green { background: rgba(39,174,96,.15); border: 1.5px solid var(--515-green); }
.verdict-yellow { background: rgba(243,156,18,.1); border: 1.5px solid var(--515-gold); }
.verdict-red { background: rgba(231,76,60,.12); border: 1.5px solid var(--515-red); }

.verdict-text {
  font-size: 1rem;
  font-weight: 800;
  color: var(--white);
}

.verdict-sub {
  font-size: 0.78rem;
  color: var(--gray-400);
  margin-top: 4px;
}

/* Results Grid */
.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}

.results-col {
  background: #13202f;
  border-radius: var(--radius-md);
  padding: 14px;
}

.results-col h4 {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,.04);
  font-size: 0.82rem;
}

.result-row span:first-child { color: var(--gray-400); }
.result-row span:last-child { font-weight: 600; color: var(--gray-100); }

.result-key span:first-child { color: var(--gray-200); font-weight: 600; }
.result-key span:last-child { font-size: 0.9rem; font-weight: 800; }

.result-good span:last-child { color: var(--515-green) !important; }
.result-bad span:last-child { color: var(--515-red) !important; }
.result-neutral span:last-child { color: var(--515-gold) !important; }

/* Benchmark Box */
.benchmark-box, .buy-box-check, .market-insight-box,
.flip-box, .brrrr-box, .seller-pitch-box {
  background: #13202f;
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 14px;
}

.benchmark-box h4, .buy-box-check h4, .market-insight-box h4,
.flip-box h4, .brrrr-box h4, .seller-pitch-box h4 {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gray-300);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.benchmark-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.bench-item {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  text-align: center;
}

.bench-good { background: rgba(39,174,96,.12); border: 1px solid rgba(39,174,96,.3); }
.bench-bad { background: rgba(231,76,60,.1); border: 1px solid rgba(231,76,60,.3); }
.bench-warn { background: rgba(243,156,18,.1); border: 1px solid rgba(243,156,18,.3); }

.bench-label { display: block; font-size: 0.68rem; color: var(--gray-500); text-transform: uppercase; }
.bench-deal { display: block; font-size: 1rem; font-weight: 800; color: var(--white); margin: 2px 0; }
.bench-mkt { display: block; font-size: 0.7rem; color: var(--gray-500); }

/* Buy box checks */
.check-item {
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,.05);
  font-size: 0.82rem;
}
.check-pass { color: var(--515-green); }
.check-fail { color: var(--515-red); }
.check-warn { color: var(--515-gold); }

.market-insight-box p { font-size: 0.82rem; color: var(--gray-400); margin-bottom: 6px; line-height: 1.6; }
.market-insight-box strong { color: var(--gray-200); }

/* BRRRR / Flip boxes */
.flip-grid, .brrrr-grid { display: flex; flex-direction: column; gap: 4px; }

/* Seller pitch */
.pitch-text {
  font-size: 0.84rem;
  color: var(--gray-300);
  line-height: 1.7;
  font-style: italic;
  border-left: 3px solid var(--515-accent);
  padding-left: 12px;
}

.calc-disclaimer {
  font-size: 0.68rem;
  color: var(--gray-600);
  margin-top: 12px;
  font-style: italic;
  line-height: 1.5;
}

/* ── EMAIL VIEW ─────────────────────────── */
#view-email { overflow-y: auto; background: #0d1117; }

.email-wrapper { max-width: 1200px; margin: 0 auto; padding: 24px; }

.email-header { margin-bottom: 20px; }
.email-header h2 { font-size: 1.4rem; font-weight: 800; color: var(--white); display: flex; align-items: center; gap: 10px; }
.email-header h2 i { color: var(--515-accent); }
.email-sub { font-size: 0.82rem; color: var(--gray-500); margin-top: 4px; }

.email-layout { display: grid; grid-template-columns: 420px 1fr; gap: 24px; margin-bottom: 24px; }

.email-mode-toggle { display: flex; gap: 8px; margin-bottom: 16px; }
.mode-btn {
  flex: 1;
  padding: 10px;
  background: #0f1923;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-md);
  color: var(--gray-500);
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: all .2s;
}
.mode-btn.active {
  background: var(--515-accent);
  border-color: transparent;
  color: var(--white);
}
.mode-btn:hover:not(.active) { color: var(--gray-200); border-color: rgba(255,255,255,.2); }

.email-output {
  background: #0f1923;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: var(--radius-lg);
  min-height: 400px;
  overflow-y: auto;
}

.email-composed { padding: 20px; }

.email-type-badge {
  display: inline-block;
  padding: 3px 10px;
  background: rgba(230,126,34,.15);
  border: 1px solid rgba(230,126,34,.3);
  border-radius: 12px;
  font-size: 0.72rem;
  color: var(--515-accent);
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.email-field { margin-bottom: 16px; }
.email-field label { display: block; font-size: 0.72rem; font-weight: 700; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }

.email-subject-text {
  background: #1a2332;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gray-100);
  border-left: 3px solid var(--515-accent);
}

.email-body-text {
  background: #1a2332;
  border-radius: var(--radius-md);
  padding: 14px;
  font-size: 0.84rem;
  color: var(--gray-300);
  line-height: 1.8;
  white-space: pre-wrap;
  border: 1px solid rgba(255,255,255,.06);
}

.email-actions { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.email-action-btn {
  padding: 9px 16px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: all .2s;
  border: none;
}
.email-action-btn.primary { background: var(--515-accent); color: var(--white); }
.email-action-btn.primary:hover { background: var(--515-gold); }
.email-action-btn.secondary { background: rgba(255,255,255,.07); color: var(--gray-300); border: 1px solid rgba(255,255,255,.1); }
.email-action-btn.secondary:hover { background: rgba(255,255,255,.12); }

.email-tips { background: rgba(39,174,96,.06); border: 1px solid rgba(39,174,96,.2); border-radius: var(--radius-md); padding: 14px; }
.email-tips h4 { font-size: 0.8rem; font-weight: 700; color: var(--515-green); margin-bottom: 8px; }
.email-tips li { font-size: 0.78rem; color: var(--gray-400); margin-bottom: 4px; margin-left: 16px; line-height: 1.5; }

/* Template library */
.template-library { background: #0f1923; border: 1px solid rgba(255,255,255,.07); border-radius: var(--radius-lg); padding: 20px; }
.template-library h3 { font-size: 0.85rem; font-weight: 700; color: var(--gray-300); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 14px; }
.template-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.template-card { background: #13202f; border-radius: var(--radius-md); padding: 12px; display: flex; align-items: center; gap: 10px; border-left: 3px solid #333; transition: all .2s; }
.template-card:hover { background: #1a2332; }
.tc-icon { font-size: 1.1rem; flex-shrink: 0; }
.tc-info strong { display: block; font-size: 0.8rem; color: var(--gray-200); }
.tc-info small { font-size: 0.7rem; color: var(--gray-500); }

/* ── PIPELINE VIEW ──────────────────────── */
#view-pipeline { overflow-y: auto; background: #0d1117; }

.pipeline-wrapper { max-width: 1600px; margin: 0 auto; padding: 24px; }

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

.pipeline-header h2 { font-size: 1.4rem; font-weight: 800; color: var(--white); display: flex; align-items: center; gap: 10px; }
.pipeline-header h2 i { color: var(--515-accent); }
.pipeline-sub { font-size: 0.82rem; color: var(--gray-500); margin-top: 4px; }

.add-lead-btn {
  padding: 10px 18px;
  background: var(--515-accent);
  border: none;
  border-radius: var(--radius-md);
  color: var(--white);
  font-size: 0.88rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: all .2s;
  box-shadow: 0 0 14px rgba(230,126,34,.3);
}
.add-lead-btn:hover { background: var(--515-gold); transform: translateY(-1px); }

/* Stage summary */
.stage-summary { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.stage-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: #0f1923;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 20px;
  cursor: pointer;
  transition: all .2s;
}
.stage-pill:hover { background: #1a2332; }
.stage-pill-label { font-size: 0.78rem; font-weight: 600; color: var(--gray-400); }
.stage-pill-count { font-size: 0.78rem; font-weight: 800; background: rgba(255,255,255,.08); padding: 2px 7px; border-radius: 10px; color: var(--gray-200); }

/* Pipeline controls */
.pipeline-controls { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.pipeline-controls input, .pipeline-controls select {
  background: #0f1923;
  border: 1px solid rgba(255,255,255,.1);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  color: var(--gray-200);
  font-size: 0.84rem;
}
.pipeline-controls input { flex: 1; min-width: 200px; }

/* Pipeline stats */
.pipeline-stats { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.stat-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 18px;
  background: #0f1923;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: var(--radius-md);
  min-width: 80px;
}
.sp-num { font-size: 1.2rem; font-weight: 800; color: var(--515-accent); }
.sp-label { font-size: 0.68rem; color: var(--gray-500); text-transform: uppercase; }
.stat-pill.active .sp-num { color: var(--515-green); }
.stat-pill.motel .sp-num { color: var(--515-gold); }
.stat-pill.seller-fin .sp-num { color: #2ecc71; }

/* Lead cards */
.lead-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.lead-card {
  background: #0f1923;
  border-radius: var(--radius-lg);
  padding: 16px;
  border: 1px solid rgba(255,255,255,.06);
  transition: all .2s;
  position: relative;
}
.lead-card:hover { background: #13202f; border-color: rgba(255,255,255,.1); }

.lc-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.lc-type { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--gray-400); font-weight: 600; }
.stage-badge { padding: 3px 8px; border-radius: 10px; font-size: 0.68rem; font-weight: 700; color: var(--white); }
.lc-address { font-size: 0.88rem; font-weight: 700; color: var(--gray-100); margin-bottom: 2px; }
.lc-city { font-size: 0.75rem; color: var(--gray-500); margin-bottom: 8px; }
.lc-owner { font-size: 0.75rem; color: var(--gray-500); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.lc-numbers { display: flex; gap: 12px; margin-bottom: 10px; }
.lc-num { text-align: center; }
.lc-num-label { display: block; font-size: 0.62rem; color: var(--gray-600); text-transform: uppercase; }
.lc-num-val { display: block; font-size: 0.88rem; font-weight: 700; color: var(--515-accent); }
.lc-flags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.distress-tag { padding: 2px 7px; background: rgba(231,76,60,.12); border: 1px solid rgba(231,76,60,.25); border-radius: 8px; font-size: 0.68rem; color: #ff9d8a; }
.lc-notes { font-size: 0.75rem; color: var(--gray-500); margin-bottom: 10px; font-style: italic; line-height: 1.4; }
.lc-footer { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.lc-followup { font-size: 0.72rem; color: var(--gray-600); }
.lc-followup.overdue { color: var(--515-red); font-weight: 700; }
.lc-followup.today { color: var(--515-gold); font-weight: 700; }
.lc-updated { font-size: 0.68rem; color: var(--gray-700); }
.lc-actions { display: flex; gap: 6px; }
.lc-btn { padding: 6px 10px; background: rgba(255,255,255,.06); border: none; border-radius: var(--radius-sm); color: var(--gray-400); font-size: 0.8rem; transition: all .2s; }
.lc-btn:hover { background: rgba(255,255,255,.12); color: var(--gray-100); }
.lc-btn.danger:hover { background: rgba(231,76,60,.2); color: var(--515-red); }

/* Empty/Loading states */
.empty-state, .loading-state, .error-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px;
  color: var(--gray-600);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-box {
  background: #0f1923;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
}

.modal-header {
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 { font-size: 1rem; font-weight: 700; color: var(--white); }
.modal-close { background: none; border: none; color: var(--gray-500); font-size: 1.3rem; padding: 0 4px; }
.modal-close:hover { color: var(--white); }

.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-grid { display: flex; flex-direction: column; gap: 0; }

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,.07);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.btn-primary {
  padding: 10px 20px;
  background: var(--515-accent);
  border: none;
  border-radius: var(--radius-md);
  color: var(--white);
  font-size: 0.88rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: all .2s;
}
.btn-primary:hover { background: var(--515-gold); }

.btn-secondary {
  padding: 10px 20px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-md);
  color: var(--gray-300);
  font-size: 0.88rem;
  font-weight: 600;
  transition: all .2s;
}
.btn-secondary:hover { background: rgba(255,255,255,.12); }

/* Distress flag checkboxes */
.flag-checkboxes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.flag-check { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--gray-400); cursor: pointer; }
.flag-check input { width: auto; accent-color: var(--515-accent); }

/* ── MARKET VIEW ────────────────────────── */
#view-market { overflow-y: auto; background: #0d1117; }

.market-wrapper { max-width: 1400px; margin: 0 auto; padding: 24px; }

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

.market-header h2 { font-size: 1.4rem; font-weight: 800; color: var(--white); display: flex; align-items: center; gap: 10px; }
.market-header h2 i { color: var(--515-accent); }
.market-sub { font-size: 0.82rem; color: var(--gray-500); margin-top: 4px; }

.market-badge {
  padding: 8px 16px;
  background: rgba(39,174,96,.1);
  border: 1px solid rgba(39,174,96,.3);
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--515-green);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Market sections */
.market-section {
  background: #0f1923;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: var(--radius-xl);
  padding: 24px;
  margin-bottom: 24px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 8px;
}

.section-title h3 {
  font-size: 1rem;
  font-weight: 800;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title h3 i { color: var(--515-accent); }

.data-source {
  font-size: 0.72rem;
  color: var(--gray-600);
  font-style: italic;
}

/* Market table */
.market-table-wrapper { overflow-x: auto; }
.market-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.market-table th {
  padding: 8px 12px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  white-space: nowrap;
}
.market-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,.05);
  color: var(--gray-300);
  vertical-align: top;
}
.market-table tr:hover td { background: rgba(255,255,255,.02); }
.mkt-name strong { display: block; color: var(--gray-100); }
.mkt-name small { font-size: 0.72rem; color: var(--gray-600); }
.note-col { max-width: 200px; font-size: 0.75rem; color: var(--gray-500); font-style: italic; }
.sba-col { max-width: 120px; font-size: 0.75rem; }

.pos-change { color: var(--515-green); font-weight: 700; }
.neutral-change { color: var(--515-gold); font-weight: 700; }
.good-cap { color: var(--515-green); font-weight: 700; }
.neutral-cap { color: var(--515-gold); font-weight: 700; }

.signal-badge {
  padding: 3px 9px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--white);
  white-space: nowrap;
}
.signal-buy { background: var(--515-green); }
.signal-selective { background: var(--515-gold); }
.signal-watch { background: var(--515-red); }

/* Buy box cards */
.buybox-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.bb-card {
  background: #13202f;
  border-radius: var(--radius-md);
  padding: 16px;
  border-top: 3px solid rgba(230,126,34,.3);
}
.bb-card.priority-primary { border-top-color: var(--515-accent); }
.bb-card.priority-high { border-top-color: var(--515-gold); }
.bb-card.priority-medium { border-top-color: var(--515-green); }
.bb-card.priority-selective { border-top-color: var(--gray-600); }

.bb-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.bb-header i { font-size: 1.2rem; color: var(--515-accent); }
.bb-header strong { display: block; font-size: 0.9rem; color: var(--gray-100); }
.bb-priority { display: inline-block; font-size: 0.65rem; font-weight: 700; color: var(--515-accent); background: rgba(230,126,34,.1); padding: 1px 6px; border-radius: 8px; margin-top: 2px; }
.bb-desc { font-size: 0.75rem; color: var(--gray-500); margin-bottom: 10px; line-height: 1.5; }
.bb-criteria { list-style: none; padding: 0; }
.bb-criteria li { font-size: 0.75rem; color: var(--gray-400); padding: 3px 0; padding-left: 14px; position: relative; line-height: 1.4; }
.bb-criteria li::before { content: '•'; position: absolute; left: 0; color: var(--515-accent); }
.more-criteria { color: var(--gray-600); font-style: italic; }

/* 3-rule grid */
.three-rule-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.rule-card { background: #13202f; border-radius: var(--radius-md); padding: 18px; }
.rule-number { font-size: 2rem; font-weight: 900; color: var(--515-accent); line-height: 1; margin-bottom: 8px; }
.rule-card h4 { font-size: 0.95rem; font-weight: 700; color: var(--gray-100); margin-bottom: 8px; }
.rule-card p { font-size: 0.8rem; color: var(--gray-400); line-height: 1.6; margin-bottom: 10px; }
.rule-examples { display: flex; flex-direction: column; gap: 8px; }
.rule-ex { font-size: 0.75rem; }
.rule-ex strong { display: block; margin-bottom: 4px; color: var(--gray-300); }
.rule-ex.strong strong { color: var(--515-green); }
.rule-ex.weak strong { color: var(--515-red); }
.rule-ex span { display: block; color: var(--gray-500); padding-left: 8px; line-height: 1.4; }
.rule-nd-lesson { border: 1px solid rgba(231,76,60,.3); background: rgba(231,76,60,.05); }
.rule-nd-lesson .rule-number { color: var(--515-red); }
.rule-nd-lesson p { color: var(--gray-400); margin-bottom: 8px; }

/* Tax grid */
.tax-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.tax-formula-box { background: #13202f; border-radius: var(--radius-md); padding: 16px; }
.tax-formula-box h4 { font-size: 0.82rem; font-weight: 700; color: var(--gray-300); margin-bottom: 10px; }
.tax-formula-box code { display: block; background: rgba(255,255,255,.06); padding: 8px 12px; border-radius: var(--radius-sm); font-size: 0.82rem; color: var(--515-gold); margin-bottom: 14px; }
.tax-example { font-size: 0.78rem; color: var(--gray-400); line-height: 1.7; }
.tax-example strong { color: var(--gray-200); display: block; margin-bottom: 4px; }
.tax-warning { color: var(--515-red); font-weight: 600; margin-top: 8px; }

/* OZ grid */
.oz-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.oz-benefits { background: #13202f; border-radius: var(--radius-md); padding: 16px; }
.oz-benefits h4 { font-size: 0.82rem; font-weight: 700; color: var(--gray-300); margin-bottom: 10px; }
.oz-benefit { font-size: 0.8rem; color: var(--gray-400); padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,.04); line-height: 1.4; }
.oz-motel-note { margin-top: 12px; font-size: 0.78rem; color: var(--515-accent); font-style: italic; line-height: 1.5; background: rgba(230,126,34,.08); padding: 8px; border-radius: var(--radius-sm); }
.oz-markets h4 { font-size: 0.82rem; font-weight: 700; color: var(--gray-300); margin-bottom: 10px; }

/* Data sources */
.data-sources-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.ds-tier h4 { font-size: 0.8rem; font-weight: 700; color: var(--gray-400); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; }
.ds-card { background: #13202f; border-radius: var(--radius-md); padding: 12px; margin-bottom: 10px; }
.ds-name { font-size: 0.85rem; font-weight: 700; color: var(--gray-100); margin-bottom: 3px; }
.ds-cost { font-size: 0.72rem; color: var(--515-accent); font-weight: 600; margin-bottom: 3px; }
.ds-key { font-size: 0.72rem; color: var(--515-green); margin-bottom: 4px; }
.ds-desc { font-size: 0.75rem; color: var(--gray-500); line-height: 1.4; margin-bottom: 6px; }
.ds-link { font-size: 0.72rem; color: var(--blue-300); display: flex; align-items: center; gap: 4px; }
.ds-link:hover { color: var(--515-gold); }

/* Adam story */
.adam-story-section { border-color: rgba(230,126,34,.2); }
.story-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.story-card { background: #13202f; border-radius: var(--radius-md); padding: 18px; text-align: center; }
.story-icon { font-size: 2rem; margin-bottom: 8px; }
.story-card h4 { font-size: 0.88rem; font-weight: 700; color: var(--gray-100); margin-bottom: 8px; }
.story-card p { font-size: 0.78rem; color: var(--gray-400); line-height: 1.6; }

/* ── FOOTER ─────────────────────────────── */
.ada-footer {
  background: #080d14;
  border-top: 1px solid rgba(255,255,255,.05);
  padding: 12px 20px;
}

.footer-inner {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-brand, .footer-builder {
  font-size: 0.73rem;
  color: var(--gray-700);
}

.footer-brand strong { color: var(--515-accent); }
.footer-dot { margin: 0 6px; color: var(--gray-800); }
.footer-brand a, .footer-builder a { color: var(--gray-600); }
.footer-brand a:hover, .footer-builder a:hover { color: var(--515-accent); }

/* ── RESPONSIVE ─────────────────────────── */
@media (max-width: 1024px) {
  .calc-grid { grid-template-columns: 1fr; }
  .calc-results { position: static; max-height: none; }
  .email-layout { grid-template-columns: 1fr; }
  .results-grid { grid-template-columns: 1fr; }
  .tax-grid, .oz-grid { grid-template-columns: 1fr; }
  .data-sources-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  :root { --sidebar-width: 0px; }
  .chat-sidebar { display: none; }
  .brand-sub { display: none; }
  .header-nav .nav-btn span { display: none; }
  .nav-btn { padding: 8px 10px; }
  .data-sources-grid { grid-template-columns: 1fr; }
  .market-header { flex-direction: column; }
  .pipeline-header { flex-direction: column; gap: 10px; }
}
