/* ─────────────────────────────────────────────────────────────────────────────
   RealtorSentry v2 — assets/css/app.css
   ───────────────────────────────────────────────────────────────────────────── */

:root {
  --rs-primary:    #0A2342;
  --rs-primary-dk: #061628;
  --rs-accent:     #028090;
  --rs-gold:       #D4A017;
  --rs-sidebar-w:  235px;
  --rs-topbar-h:   56px;
}

body { background: #F0F4F8; font-size: 14px; }

/* ── Layout ─────────────────────────────────────────────────────────────────── */
.rs-sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--rs-sidebar-w);
  background: var(--rs-primary);
  display: flex; flex-direction: column;
  z-index: 1040;
  transition: transform .25s ease;
}
.rs-main { margin-left: var(--rs-sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.rs-topbar {
  height: var(--rs-topbar-h);
  background: #fff;
  border-bottom: 1px solid #DEE2E6;
  padding: 0 1.5rem;
  position: sticky; top: 0; z-index: 100;
}
.rs-content { padding: 1.5rem; flex: 1; }

/* ── Sidebar ─────────────────────────────────────────────────────────────────── */
.rs-logo {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.rs-logo-text { color: #fff; font-size: 16px; font-weight: 700; letter-spacing: .5px; }

.rs-nav { flex: 1; overflow-y: auto; padding: .5rem 0; }
.rs-nav-item {
  display: flex; align-items: center; gap: .65rem;
  padding: .55rem 1.25rem;
  color: rgba(255,255,255,.75);
  text-decoration: none;
  font-size: 13px;
  transition: background .15s, color .15s;
  border-left: 3px solid transparent;
}
.rs-nav-item:hover  { background: rgba(255,255,255,.08); color: #fff; }
.rs-nav-item.active { background: rgba(255,255,255,.12); color: #fff; border-left-color: #028090; }
.rs-nav-item .bi    { font-size: 15px; opacity: .85; }

.rs-sidebar-footer {
  padding: .75rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,.1);
  display: flex; align-items: center; gap: .5rem;
  font-size: 12px;
}

/* ── Cards ──────────────────────────────────────────────────────────────────── */
.rs-card {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.rs-stat-card {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  display: flex; align-items: flex-start; gap: 1rem;
}
.rs-stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.rs-stat-value { font-size: 26px; font-weight: 700; line-height: 1; color: #1E293B; }
.rs-stat-label { font-size: 12px; color: #64748B; margin-top: 3px; }

/* ── Tables ──────────────────────────────────────────────────────────────────── */
.rs-table { width: 100%; font-size: 13.5px; }
.rs-table th { background: #F8FAFC; font-weight: 600; color: #475569; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; white-space: nowrap; }
.rs-table td { vertical-align: middle; }
.rs-table tbody tr:hover { background: #F8FAFC; }

/* ── Pipeline Kanban ─────────────────────────────────────────────────────────── */
.pipeline-board {
  display: flex;
  gap: .75rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  align-items: flex-start;
}
.pipeline-col {
  flex: 0 0 220px;
  background: #F1F5F9;
  border-radius: 10px;
  overflow: hidden;
}
.pipeline-col-header {
  padding: .65rem 1rem;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pch-new      { background: #DBEAFE; color: #1E40AF; }
.pch-contacted { background: #FEF3C7; color: #92400E; }
.pch-offer    { background: #FCE7F3; color: #9D174D; }
.pch-contract { background: #EDE9FE; color: #4C1D95; }
.pch-closed   { background: #D1FAE5; color: #065F46; }
.pch-dead     { background: #F1F5F9; color: #475569; }

.pipeline-col-body { padding: .5rem; min-height: 80px; }

.lead-card-mini {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 7px;
  padding: .7rem .8rem;
  margin-bottom: .5rem;
  cursor: pointer;
  transition: box-shadow .15s, transform .15s;
  text-decoration: none;
  display: block;
  color: inherit;
}
.lead-card-mini:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); transform: translateY(-1px); color: inherit; }
.lcm-name  { font-weight: 600; font-size: 13px; color: #1E293B; }
.lcm-addr  { font-size: 11px; color: #64748B; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lcm-score { font-size: 11px; margin-top: 4px; }
.lcm-age   { font-size: 10px; color: #94A3B8; margin-top: 2px; }

/* ── Lead detail page ────────────────────────────────────────────────────────── */
.activity-timeline .activity-item {
  display: flex; gap: 1rem; margin-bottom: 1rem;
}
.activity-icon {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; flex-shrink: 0;
}
.ai-call     { background: #DBEAFE; color: #1E40AF; }
.ai-sms      { background: #D1FAE5; color: #065F46; }
.ai-email    { background: #EDE9FE; color: #4C1D95; }
.ai-note     { background: #FEF3C7; color: #92400E; }
.ai-offer    { background: #FCE7F3; color: #9D174D; }
.ai-stage    { background: #F1F5F9; color: #475569; }
.ai-system   { background: #F1F5F9; color: #94A3B8; }

/* ── Ad builder ──────────────────────────────────────────────────────────────── */
.char-counter { font-size: 11px; color: #94A3B8; }
.char-counter.over { color: #DC2626; font-weight: 700; }
.keyword-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: #EFF6FF; color: #1D4ED8;
  padding: 3px 8px; border-radius: 4px;
  font-size: 12px; font-family: monospace;
  margin: 2px;
}
.keyword-chip.negative { background: #FEF2F2; color: #DC2626; }
.keyword-chip .remove { cursor: pointer; opacity: .6; }
.keyword-chip .remove:hover { opacity: 1; }

.ad-preview {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 1rem;
  font-family: Arial, sans-serif;
}
.ad-preview .ad-url { color: #006621; font-size: 13px; }
.ad-preview .ad-headline { color: #1A0DAB; font-size: 18px; font-weight: normal; text-decoration: underline; cursor: pointer; }
.ad-preview .ad-desc { color: #545454; font-size: 13px; }

/* ── Buttons ─────────────────────────────────────────────────────────────────── */
.btn-primary    { background: var(--rs-primary);    border-color: var(--rs-primary); }
.btn-primary:hover { background: var(--rs-primary-dk); border-color: var(--rs-primary-dk); }
.btn-accent     { background: var(--rs-accent); border-color: var(--rs-accent); color: #fff; }
.btn-accent:hover { background: #026e7a; border-color: #026e7a; color: #fff; }
.text-primary   { color: var(--rs-primary) !important; }

/* ── Utilities ───────────────────────────────────────────────────────────────── */
.fs-12 { font-size: 12px; }
.fs-11 { font-size: 11px; }
.cursor-pointer { cursor: pointer; }

/* ── Responsive ──────────────────────────────────────────────────────────────── */
@media (max-width: 991px) {
  .rs-sidebar { transform: translateX(-100%); }
  .rs-sidebar.open { transform: translateX(0); }
  .rs-main { margin-left: 0; }
}
