:root{
  --bg:#f0f2f5; --card:#ffffff; --text:#0f172a;
  --muted:#6b7280; --line:#e5e7eb; --accent:#111827;
  --shadow-sm: 0 1px 3px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
  --shadow-md: 0 4px 12px rgba(15,23,42,.08), 0 1px 3px rgba(15,23,42,.04);
  --shadow-hover: 0 8px 22px rgba(15,23,42,.1), 0 2px 6px rgba(15,23,42,.06);
  --radius-card: 14px;
}
*{box-sizing:border-box;}
body{margin:0;font-family:system-ui,Segoe UI,Roboto,Arial,sans-serif;color:var(--text);background:var(--bg);}

/* When a full-screen modal is open, prevent body from scrolling */
body.modal-open {
  overflow: hidden;
}

.muted{color:var(--muted);}
.hidden{display:none !important;}

.app-header{
  position:sticky;top:0;z-index:10;display:flex;align-items:center;justify-content:space-between;
  padding:10px 16px;background:#fff;border-bottom:1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.brand{display:flex;gap:10px;align-items:center;}
.logo-dot{
  width: 41px;
  height: 41px;
  border-radius: 6px;
  background-image: url("Images/bull-bear-header.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}
.brand-title{font-weight:700;}
.brand-sub{font-size:12px;}

/* === HEADER GEAR MENU (Spreadsheet / Manage Users / Logout) === */
.header-actions{
  display:flex;
  align-items:center;
}

/* wrapper for the gear + dropdown */
.user-menu{
  position:relative;
}

/* Small round gear button */
.header-menu-btn{
  width:34px;
  height:34px;
  border-radius:10px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0;
  border:1px solid var(--line);
  background:#f9fafb;
  transition: background 0.12s, box-shadow 0.12s;
}
.header-menu-btn:hover{
  background:#f0f2f5;
  box-shadow: var(--shadow-sm);
}

/* Recent Changes hamburger icon button */
.recent-btn {
  font-size: 18px;   /* make the ☰ nice and visible */
  line-height: 1;
}

/* Dropdown panel */
.user-menu-menu{
  position:absolute;
  right:0;
  top:42px;
  min-width:180px;
  background:#ffffff;
  border:1px solid var(--line);
  border-radius:12px;
  box-shadow: var(--shadow-md);
  padding:6px 0;
  z-index:1000;
}

/* Individual menu items */
.menu-item-btn{
  width:100%;
  padding:8px 12px;
  border:none;
  background:transparent;
  text-align:left;
  font-size:14px;
  cursor:pointer;
}

.menu-item-btn:hover{
  background:#f3f4f6;
}

/* Visual separator for Logout */
.menu-logout{
  border-top:1px solid var(--line);
  margin-top:4px;
  padding-top:8px;
}

.app{padding:14px;max-width:1100px;margin:0 auto;}

.view{min-height:calc(100vh - 62px);}
.toolbar{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-bottom:12px;

  position: sticky;
  top: 62px;          /* header height */
  background: var(--bg);
  padding-top: 8px;
  z-index: 5;
}

/* ===== Filters ===== */
.filter-row{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:flex-end;
}

.filter-group{
  display:flex;
  flex-direction:column;
  gap:4px;
  min-width:160px;
}

.filter-label{
  font-size:12px;
  font-weight:700;
  color:var(--muted);
}

.filter-input{
  padding:8px 10px;
  font-size:13px;
}

.filter-clear{
  height:36px;
  padding:6px 12px;
  font-size:13px;
}

@media (max-width:600px){
  .filter-group{ min-width: 48%; }
  .filter-clear{ width:100%; }
}

.input{
  width:100%;padding:10px 12px;border:1px solid var(--line);
  border-radius:10px;background:#fff;outline:none;font-size:14px;
}
.textarea{resize:vertical;}

.tab-row{display:flex;gap:6px;flex-wrap:wrap;}
.tab{
  border:1px solid var(--line);background:#fff;padding:7px 14px;border-radius:999px;
  font-size:13px;font-weight:500;cursor:pointer;transition:background 0.12s, box-shadow 0.12s;
  box-shadow: var(--shadow-sm);
}
.tab:hover{ box-shadow: var(--shadow-md); }
.tab.active{background:#111827;color:#fff;border-color:#111827;box-shadow:none;}
/* Tabs left, filters right on same line */
.tabs-filters{
  display:flex;
  align-items:center;
  justify-content:flex-start;  /* ⬅ no more space-between */
  gap:10px;                    /* matches filter-row gap */
  flex-wrap:wrap;
}

/* keep tabs from stretching */
.tabs-filters .tab-row{
  flex: 0 0 auto;
  margin-right: auto;   /* ⬅ this pushes Sort/Counties/Filters to the right */
}

/* push filters to the right */
.tabs-filters .filter-row{
  /* margin-left:auto; ⬅ remove this so Sort sits right next to Counties */
  display:flex;
  align-items:flex-end;
  gap:10px;
  flex-wrap:wrap;
}

/* filter sizes */
.tabs-filters .sort-group{
  flex: 0 0 auto;     /* keep it from stretching */
  /* no auto margin – lets flex gap control spacing */
}

@media (max-width:900px){
  .tabs-filters{
    flex-direction:column;
    align-items:stretch;
  }
  .tabs-filters .filter-row{
    margin-left:0;
    justify-content:flex-start;
  }
  .tabs-filters .filter-group{
    min-width:48%;
  }
  .tabs-filters .filter-clear{
    width:100%;
  }
}

/* ===== TAB COLORS ===== */

/* default (not active) */
.tab-active{
  background:#eaf8e6;
  color:#1b6c1b;
  border-color:#8fcd8f;
}

/* ✅ Surplus tab — match Surplus pill exactly */
.tab-surplus {
  background: #e6f2ff;
  color: #1e6fd9;
  border-color: #9cc5ff;
}

/* Active state (when selected) */
.tab-surplus.active {
  background: #dbeafe;     /* slightly stronger, optional */
  color: #1e6fd9;
  border-color: #60a5fa;
  font-weight: 600;
}

/* Inactive tab = red like Below Target */
.tab-inactive{
  background:#ffe0e0;   /* same as badge.bad background */
  color:#8b0000;        /* same as badge.bad text */
  border-color:#ff9a9a; /* same as badge.bad border */
}
.tab-foreclosed{
  background:#efefef;
  color:#444;
  border-color:#bbb;
}

/* when active (a little stronger) */
.tab-active.active{
  background:#d8f5d0;
  color:#1b6c1b;
  border-color:#8fcd8f;
}
.tab-inactive.active{
  background:#ffd2d2;   /* slightly stronger red when active */
  color:#8b0000;
  border-color:#ff9a9a;
}
.tab-foreclosed.active{
  background:#e7e7e7;
  color:#444;
  border-color:#bbb;
}

.lead-list{display:grid;grid-template-columns:1fr;gap:10px;}
.lead-card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius-card);
  padding:14px 14px 12px 18px;
  display:flex;flex-direction:column;gap:6px;cursor:pointer;
  transition: box-shadow 0.12s, transform 0.1s;
  position: relative;
  border-left: 4px solid transparent;
  box-shadow: var(--shadow-sm);
}

/* Status-based left border accent */
.lead-card[data-status-bucket="active"]   { border-left-color: #4ade80; }
.lead-card[data-status-bucket="inactive"] { border-left-color: #f87171; }
.lead-card[data-status-bucket="surplus"]  { border-left-color: #60a5fa; }
.lead-card[data-status-bucket="monitor"]  { border-left-color: #d1d5db; }

/* ===== Enrichment tint backgrounds (very faint) ===== */
.lead-card.enrich-full{
  background: rgba(34, 197, 94, 0.06);
}
.lead-card.enrich-no-contacts{
  background: rgba(245, 158, 11, 0.07);
}
.lead-card.enrich-no-payoff{
  background: rgba(59, 130, 246, 0.06);
}

/* ========================================= Fix long owner names overflowing the card ========================================= */
.lead-card .name-line {
display: flex;
align-items: flex-start;  /* let name wrap above pill if needed */
gap: 8px;
}

.lead-card .lead-name {
flex: 1 1 auto;          /* take available space */
min-width: 0;            /* allow shrinking inside flex row */
white-space: normal;     /* allow wrapping */
overflow-wrap: break-word; /* wrap long words/names */
}  

/* ========================================= OUTSIDE CARD: Owner line + Foreclosure Type pill (right aligned) ========================================= */
.lead-card .owner-row{
display:flex;
align-items:flex-start;
justify-content:space-between;
gap:8px;
}

.lead-card .owner-text{
flex:1 1 auto;
min-width:0;                 /* lets owner wrap instead of pushing pill */
white-space:normal;
overflow-wrap:break-word;
}

.lead-card .fc-pill{
flex:0 0 auto;
margin-left:8px;
}

/* NEW: Door knock checkbox bottom-right */
.door-knock{
  position:absolute;
  right:12px;
  bottom:10px;
  display:flex;
  align-items:center;
  color:var(--muted);
}

.door-knock-label{
  font-size:12px;
  font-weight:500;
  color:var(--muted);
  display:flex;
  align-items:center;
  gap:6px;
  cursor:pointer;
  user-select:none;
  white-space:nowrap;
}

.door-knock-check{
  width:14px;
  height:14px;
  margin:0;
  cursor:pointer;
  position:relative;
  top:1px;
}

.lead-card:hover{transform:translateY(-2px);box-shadow: var(--shadow-hover);}
.lead-title{font-weight:700;font-size:14px;line-height:1.35;}
.lead-meta{font-size:13px;color:var(--muted);}
.lead-row{display:flex;justify-content:space-between;align-items:center;gap:8px;}

/* Keep more space between SP line and Payoff + put Rating pill on the right */
.sp-line{
  margin-bottom: 6px;  /* bigger gap stays here */

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* left side wrapper inside sp-line */
.sp-line .sp-left{
  min-width: 0;
}

/* Tighten Payoff -> Equity spacing */
.payoff-line{
  margin-bottom: 0;  /* smaller gap below payoff */
}

/* ✅ Tiny green check next to payoff value (outside lead card) */
.payoff-verified-icon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  margin-left:6px;
  font-size:12px;
  line-height:1;
  color:#16a34a;
}

/* Equity + Door knock on one line */
.equity-door-line{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-top: 0;      /* keeps it tight */
}

/* Left side equity group */
.equity-left{
  display:flex;
  align-items:center;
  gap:8px;
}

/* Door knock inline */
.inline-door{
  font-size:12px;
  color:var(--muted);
  white-space:nowrap;
}

.status-pill{
  font-size:12px;
  padding:3px 8px;
  border-radius:999px;
  border:1px solid var(--line);
  background:#f9fafb;
  white-space:nowrap;   /* keep "Upset Bidding" on one line */
  line-height:1.2;      /* keeps text nicely centered vertically */
}

/* Larger pill for lead cards */
.big-pill {
  font-size: 14px;
  padding: 5px 12px;
}

/* Smaller pill inside Lead header */
.inside-pill {
  font-size: 12px;      /* smaller than big-pill */
  padding: 3px 10px;    /* less padding */
  transform: translateY(1px); /* tiny visual balance tweak */
}

/* ===== STATUS PILL COLORS ===== */

/* Green — ACTIVE */
.pill-active {
  background: #d8f5d0;
  color: #1b6c1b;
  border-color: #8fcd8f;
}

/* Yellow — UPSET BIDDING */
.pill-upset {
  background: #fff4cc;
  color: #8d6a00;
  border-color: #e7c44a;
}

/* Red — BELOW TARGET / INACTIVE */
.pill-inactive {
  background: #ffe0e0;
  color: #8b0000;
  border-color: #ff9a9a;
}

/* Gray — FORECLOSED */
.pill-foreclosed {
  background: #e7e7e7;
  color: #444;
  border-color: #bbb;
}

/* Blue — SURPLUS (same as "In Contact" rating) */
.pill-surplus {
  background: #e0f2fe;   /* same as .rating-contact */
  border-color: #bae6fd;
  color: #0369a1;
}

/* Red — NO SURPLUS (same as Inactive) */
.pill-no-surplus {
  background: #ffe0e0;   /* same as .pill-inactive */
  border-color: #ff9a9a;
  color: #8b0000;
}

/* Orange — UNIDENTIFIED */
.pill-unidentified {
  background: #fff3e0;
  border-color: #fdba74;
  color: #b45309;
}

/* ========================== Foreclosure Type Pills (Mortgage / Tax / HOA) ========================== */
.fc-pill {
display: inline-block;
padding: 4px 10px;
border-radius: 999px;
font-size: 12px;
font-weight: 600;
line-height: 1;
white-space: nowrap;
}

.fc-mortgage {
background: #fff3e0;   /* light orange */
color: #b45309;
border: 1px solid #facc15;
}

.fc-tax {
background: #e6fffa;   /* teal */
color: #065f46;
border: 1px solid #5eead4;
}

.fc-hoa {
background: #eef2ff;   /* light navy */
color: #1e3a8a;
border: 1px solid #c7d2fe;
}

.badge{font-size:12px;padding:3px 8px;border-radius:999px;border:1px solid var(--line);background:#f9fafb;display:inline-block;}
.badge.good{background:#dcfce7;border-color:#bbf7d0;}
.badge.bad{
  background:#ffe0e0;
  border-color:#ff9a9a;
  color:#8b0000;
}
/* Low Equity (yellow — matches Upset Bidding pill) */
.badge.low {
  background: #fff4cc;
  border-color: #e7c44a;
  color: #8d6a00;
}

.btn{border:1px solid var(--line);background:#fff;padding:8px 12px;border-radius:10px;cursor:pointer;font-size:14px;transition:background 0.1s;}
.btn:hover{background:#f3f4f6;}
.btn.ghost{background:transparent;}
.btn.ghost:hover{background:#f3f4f6;}
.btn.primary{background:var(--accent);color:#fff;border-color:var(--accent);}
.btn.primary:hover{background:#1f2937;}
.btn.full{width:100%;margin-top:6px;}

/* ===== Lead Rating pills ===== */

.rating-pill {
  font-size: 11px;              /* a bit smaller than equity pill */
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  white-space: nowrap;
}

/* Dead Lead – dark gray / almost black */
.rating-dead {
  background: #111827;
  color: #f9fafb;
  border-color: #111827;
}

/* In Contact – light blue */
.rating-contact {
  background: #e0f2fe;
  border-color: #bae6fd;
  color: #0369a1;
}

/* No Contact – same yellow as Low Equity */
.rating-no {
  background: #fff4cc;
  border-color: #e7c44a;
  color: #8d6a00;
}

/* Appointment Set – same green as Good Equity */
.rating-appt {
  background: #dcfce7;
  border-color: #bbf7d0;
  color: #166534;
}

/* fallback for any unexpected rating text */
.rating-generic {
  background: #f3f4f6;
  color: #374151;
}

/* ------------------------------
   PIN LOGIN OVERLAY – CLEAN CARD
------------------------------ */

/* Dim + blur the background */
#pinOverlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

/* Generic overlay card (also safe for other modals that use .overlay-card) */
.overlay-card {
  width: 100%;
  max-width: 420px;
  padding: 24px 28px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15);
}

/* Heading */
#pinOverlay .overlay-card h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
}

/* Subtext (ADMIN / TEAM) */
#pinOverlay .overlay-card .muted {
  margin: 0;
  font-size: 14px;
}

/* PIN input */
#pinInput {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 18px;
  text-align: center;
  letter-spacing: 4px;
}

/* Header refresh spin feedback */
.is-spinning {
  animation: bbspin 0.9s linear infinite;
}
@keyframes bbspin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Center placeholder dots */
#pinInput::placeholder {
  text-align: center;
}

/* Login button */
#pinBtn {
  width: 100%;
  margin-top: 14px;
  border-radius: 10px;
  font-size: 15px;
}

/* Error message under button */
#pinError {
  margin-top: 8px;
  text-align: center;
}

/* Force PIN title + subtext to be centered */
#pinOverlay .overlay-card h1,
#pinOverlay .overlay-card .muted {
  text-align: center;
}

/* Clickable contact links (tel/mailto) */
.contact-link{
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.contact-link:active{ opacity: 0.7; }

.modal{
  position:fixed;inset:0;background:rgba(15,23,42,.45);display:flex;align-items:center;justify-content:center;
  padding:16px;z-index:50;
}
.modal-card{
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-radius: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  max-height: 80vh;
  overflow-y: auto;
}
.modal-card::-webkit-scrollbar {
  width: 8px;
}
.modal-card::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}
.modal-card::-webkit-scrollbar-track {
  background: transparent;
}

.modal-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px;}
.form{display:flex;flex-direction:column;gap:8px;}
.form label{
  font-size:13px;
  font-weight:600;
}

.error{color:#b91c1c;font-size:13px;margin-top:4px;}

.lead-page-header{display:flex;align-items:center;gap:8px;margin-bottom:8px;}
.spacer{flex:1;}
.lead-page{display:grid;grid-template-columns:1fr;gap:12px;}
.section{background:#fff;border:1px solid var(--line);border-radius:var(--radius-card);padding:14px;box-shadow:var(--shadow-sm);overflow:hidden;}
/* NEW: Lead box bottom row with Door Knock on right */
.lead-actions-row{
  margin-top:10px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

/* reuse same door-knock label look inside lead */
.lead-actions-row .door-knock-label{
  font-size:12px;
  color:var(--muted);
  display:flex;
  align-items:center;
  gap:6px;
  cursor:pointer;
  user-select:none;
}
.section h3{margin:0 0 8px 0;}
.kv{display:grid;grid-template-columns:120px 1fr;gap:6px 10px;font-size:14px;}

.owner-line{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
}

.owner-name{
  flex:1 1 auto;
  min-width:0;
}

/* Phone icon button that sits under the Edit button */
.call-btn{
  width:32px;
  height:32px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
}

/* Address row with Vacant checkbox aligned right */
.addr-with-vacant{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.addr-text{
  flex:1;
  min-width:0;
}

/* County row with No Trespassing aligned right, like Vacant/Renter */
.county-with-trespass{
  display:flex;
  align-items:center;
  gap:12px;
}

/* County value fills left side */
.county-with-trespass > *:first-child{
  flex:1 1 auto;
  min-width:0;
}

/* County dropdown group sections */
.county-dd-divider{
  border-top: 1px solid #e5e7eb;
  margin: 6px 0;
}

.county-dd-groups{
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 6px;
}

.county-dd-group-item{
  background: #f6f6f6;
  border-radius: 8px;
}

.county-dd-group{
  width: 100%;
  text-align: left;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 6px 8px;
  font-weight: 600;
  cursor: pointer;
}

.county-dd-group:active{
  transform: translateY(1px);
}

/* No Trespassing label pinned to the right */
.trespass-label{
  font-size:12px;
  color:var(--muted);
  display:flex;
  align-items:center;
  gap:6px;
  cursor:pointer;
  user-select:none;
  white-space:nowrap;
  margin-left:auto;          /* ⬅ same right column as Vacant/Renter */
}

/* Vacant checkbox styling (matches Door knock) */
.vacant-label{
  font-size:12px;
  color:var(--muted);
  display:flex;
  align-items:center;
  gap:6px;
  cursor:pointer;
  user-select:none;
  white-space:nowrap;
}

/* ARV row with Renter aligned under No Trespassing (right side) */
.arv-with-renter {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ARV value behaves like a normal value cell */
.arv-with-renter .arv-value {
  flex: 1 1 auto;
  min-width: 0;
}

/* Payoff row with Verified aligned on the right (inside lead view) */
.payoff-with-verified{
  display:flex;
  align-items:center;
  gap:8px;
}

/* Payoff value fills the left side like ARV value */
.payoff-with-verified .payoff-value{
  flex:1 1 auto;
  min-width:0;
}

/* Verified label – matches Vacant / No Trespassing / Renter look */
.payoff-verified-label{
  font-size:12px !important;      /* ✅ stop it inheriting 14px from .kv */
  color:var(--muted) !important;  /* ✅ stop it inheriting darker color */
  font-weight:500 !important;     /* ✅ stop .kv .v making it bold */
  display:flex;
  align-items:center;
  gap:6px;
  cursor:pointer;
  user-select:none;
  white-space:nowrap;
  margin-left:auto;
  line-height:1;
}

/* ✅ If your label text is wrapped in <strong>/<span>, force it to inherit */
.payoff-verified-label *{
  font-size:inherit !important;
  font-weight:inherit !important;
  color:inherit !important;
}

.payoff-verified-label input{
  width:14px;
  height:14px;
}

/* Renter label – matches Vacant / No Trespassing and stays on the right */
.renter-label{
  font-size:12px;
  color:var(--muted);
  display:flex;
  align-items:center;
  gap:6px;
  cursor:pointer;
  user-select:none;
  white-space:nowrap;
  margin-left:auto;          /* keep it anchored to the right of the row */
}

/* No Trespassing label matches Vacant look */
.trespass-label{
  font-size:12px;
  color:var(--muted);
  display:flex;
  align-items:center;
  gap:6px;
  cursor:pointer;
  user-select:none;
  white-space:nowrap;
}

.kv .k{ color: var(--muted); }
.kv .v{ font-weight: 600; }

/* ✅ Any checkbox labels that live inside a .kv value cell should NOT be bold/14px */
.kv .v label{
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.2;
}

/* ✅ If the label text is wrapped in spans/strong, force it to inherit */
.kv .v label *{
  font-size: inherit;
  color: inherit;
  font-weight: inherit;
}

/* inputs inside kv grid */
.kv-input{
  width:100%;
  padding:6px 8px;
  font-size:14px;
}
.kv input:disabled,
.kv select:disabled{
  background:#f3f4f6;
  color:#111827;
  border-color:var(--line);
}

.timeline{display:flex;flex-direction:column;gap:8px;}
.timeline-item{border:1px solid var(--line);border-radius:12px;padding:10px;background:#fafafa;min-width:0;}
.timeline-top{display:flex;justify-content:space-between;font-size:12px;color:var(--muted);margin-bottom:4px;}
.timeline-comment{white-space:pre-wrap;font-size:14px;overflow-wrap:break-word;word-break:break-word;}

.contact-card{border:1px solid var(--line);border-radius:12px;padding:10px;background:#fafafa;display:flex;flex-direction:column;gap:3px;font-size:14px;min-width:0;overflow-wrap:break-word;word-break:break-word;}

/* Floating Add Lead Button */
.fab{
  position:fixed;right:18px;bottom:18px;
  width:56px;height:56px;border-radius:50%;
  font-size:30px;line-height:0;
  display:flex;align-items:center;justify-content:center;
  border:none;cursor:pointer;background:#111827;color:#fff;
  box-shadow:0 10px 25px rgba(0,0,0,.18);
}

@media (min-width:900px){
  .lead-list{grid-template-columns:repeat(2,1fr);}
  .lead-page{grid-template-columns:1.2fr .8fr;}
}

/* content-visibility: skip rendering off-screen cards (big win for long lists) */
.lead-card {
  content-visibility: auto;
  contain-intrinsic-size: 0 130px; /* approximate card height */
}
@media (max-height: 700px){
  .modal-card{
    max-height: 72vh;
  }
}

/* slightly smaller inline badge */
.equity-badge {
  font-size: 11px;
  padding: 2px 6px;
}

/* ===== Equity checkbox dropdown (PASTE START) ===== */
.equity-dd{
  position:relative;
  min-width:145px;
}

.equity-dd-btn{
  width:100%;
  height:36px;
  padding:6px 10px;
  border:1px solid var(--line);
  background:#fff;
  border-radius:10px;
  font-size:13px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  cursor:pointer;
}

.equity-dd-caret{ font-size:12px; color:var(--muted); }

.equity-dd-menu{
  position:absolute;
  top:42px;
  left:0;
  width:100%;
  background:#fff;
  border:1px solid var(--line);
  border-radius:10px;
  box-shadow:0 8px 24px rgba(0,0,0,.08);
  padding:6px;
  display:flex;
  flex-direction:column;
  gap:4px;
  z-index:1000;

  max-height:260px;   /* ⬅ same idea as Counties dropdown */
  overflow:auto;      /* ⬅ adds the scroll wheel */
}

.filter-section-label {
  font-size: 11px;
  font-weight: 700;
  color: #6b7280; /* same muted color */
  margin: 4px 0 2px 4px;
}

.equity-divider {
  border-top: 1px solid #e5e7eb;
  margin: 6px 0;
}

.equity-dd-item{
  display:flex;
  align-items:center;
  gap:8px;
  padding:6px 8px;
  border-radius:8px;
  font-size:13px;
  cursor:pointer;
}
.equity-dd-item:hover{ background:#f3f4f6; }

.equity-dd-check{ width:14px; height:14px; }
/* ===== Equity checkbox dropdown (PASTE END) ===== */

/* ===== Counties checkbox dropdown (same as Filters) ===== */
.county-dd{
  position:relative;
  min-width:130px;       /* SAME min-width as Filters */
}

.county-dd-btn{
  width:100%;
  height:32px;            /* match Filters */
  padding:6px 10px;        /* match Filters */
  border:1px solid var(--line);
  background:#fff;
  border-radius:10px;      /* match Filters */
  font-size:13px;          /* match Filters text */
  display:flex;
  align-items:center;
  justify-content:space-between;
  cursor:pointer;
  line-height:1;           /* tighter like Filters */
}

.county-dd-caret{
  font-size:11px;        /* match Filters caret */
  color:var(--muted);
}

.county-dd-menu{
  position:absolute;
  top:42px;
  left:0;
  width:200px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:10px;
  box-shadow:0 8px 24px rgba(0,0,0,.08);
  padding:6px;
  display:flex;
  flex-direction:column;
  gap:4px;
  z-index:1000;
  max-height:260px;
  overflow:auto;
}

.county-dd-item{
  display:flex;
  align-items:center;
  gap:8px;
  padding:6px 8px;
  border-radius:8px;
  font-size:13px;
  cursor:pointer;
}
.county-dd-item:hover{ background:#f3f4f6; }

.county-dd-check{ width:14px; height:14px; }

/* ===== Timeline edit/delete icons ===== */
.act-actions{
  display:flex;
  gap:4px;
  margin-left:6px;
}

.icon-btn{
  border:1px solid var(--line);
  background:#fff;
  padding:2px 6px;
  border-radius:8px;
  font-size:12px;
  cursor:pointer;
  line-height:1;
}
.icon-btn:hover{ background:#f3f4f6; }
/* =========================================================
   Toolbar control sizing to match tab proportions
   (scoped to filter/sort row only)
   ========================================================= */

/* Make filter/sort inputs look like the tabs */
.filter-row .input,
.filter-row select.input,
.filter-row input[type="date"],
.filter-row .equity-dd-btn {
  height: 32px;              /* closer to tab height */
  padding: 6px 10px;         /* match tab feel */
  font-size: 13px;           /* tab text size */
  border-radius: 10px;       /* same as tabs */
}

/* Equity dropdown caret size match */
.filter-row .equity-dd-caret {
  font-size: 11px;
}

/* Clear button match tabs */
.filter-row .btn.filter-clear {
  height: 32px;
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 10px;
}

/* Optional: tighten the group min-width a touch so it feels like tabs */
.tabs-filters .filter-group {
  min-width: 130px;
}

/* =========================================================
   Match "Sort" control size to Filters + Tabs
   ========================================================= */

/* The wrapper */
.sort-group {
  display:flex;
  flex-direction:column;
  gap:4px;
  min-width:130px;         /* match Sale From/To */
}

/* The sort dropdown input itself */
.sort-group .sort-input {
  height:32px;             /* match filters/tabs */
  padding:6px 10px;
  font-size:13px;          /* match tab text */
  border-radius:10px;      /* match tabs */
  line-height:1.2;
}

/* Make Sort dropdown section labels look like filter section headers */
.sort-input optgroup {
  font-weight:600;
  color: var(--muted);
}

/* Sort label to match filter labels */
.sort-group label {
  font-size:12px;
  margin-left:2px;
}
.tab-row .tab {
  margin-top: 4px;      /* keeps your downward nudge */
  height: 32px;         /* match filters */
  padding: 6px 12px;
  display: flex;
  align-items: center;
  line-height: 1;
}
/* Lower the tab row so its bottom aligns with filters/sort */
.tab-row {
  margin-top: 5px;
  align-self: flex-end;
}

/* ===============================
   ALIGN VACANT + DOOR KNOCK CHECKBOXES
   =============================== */

/* Fix vertical alignment of Vacant checkbox */
.addr-with-vacant {
  align-items: flex-start;   /* instead of center */
}

/* Normalize checkbox visual alignment */
.vacant-label input,
.door-knock-label input,
.payoff-verified-label input {
  position: relative;
  top: 1px;   /* tweak between 0–2px if needed */
}

/* Loading skeleton for list */
.lead-list.loading{
  opacity:.6;
  pointer-events:none;
  filter: grayscale(.2);
}
.lead-list.loading::before{
  content:"Loading leads…";
  display:block;
  padding:10px;
  color:var(--muted);
  font-size:14px;
}

.lead-nav {
  display: flex;
  gap: 8px;
  align-items: center;
}

.nav-btn,
#allLeadsBtn {
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}

.nav-btn:hover,
#allLeadsBtn:hover {
  background: #e5e7eb;
}

.lead-nav button.disabled {
  opacity: 0.35;
  pointer-events: none;
}

.sp-link {
  color: #2563eb;       /* same blue you use inside lead */
  text-decoration: none;
}

.sp-link:hover {
  text-decoration: underline;
}

/* Address links (Zillow) – look like normal text but clickable */
.addr-link {
  color: inherit;
  text-decoration: none;
}
.addr-link:hover {
  text-decoration: underline;
}

/* Default (desktop / large screens): hide the mobile Clear */
.mobile-clear {
  display: none;
}

/* -------- MOBILE / TABLET LAYOUT -------- */
@media (max-width: 900px) {
  /* put search + Clear on one row */
  .search-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
  }

  .search-row #searchInput {
    flex: 1 1 auto;
    min-width: 0;
  }

  /* small Clear button next to search */
  .mobile-clear {
    display: inline-flex;
    flex: 0 0 90px;           /* ~half a filter box width */
    justify-content: center;
    font-size: 0.85rem;
    padding: 6px 0;
  }
}

/* === Full screen blocking modal overlay === */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;

  display: flex;
  justify-content: center;
  align-items: flex-start;   /* start at top, not middle */
  padding-top: 120px;        /* push below header */

  background: rgba(0, 0, 0, 0.45); /* blur / dim background */

  z-index: 9999;  /* always above UI */
}

/* Modal card centering inside the overlay */
.modal-overlay .modal-card,
.modal-overlay .overlay-card {
  margin: 0 auto !important;
  z-index: 10000;
}

/* Scrollable Manage Users panel inside overlay */
#userModal .user-modal-panel {
  width: 100%;
  max-width: 600px;
  max-height: min(90vh, 700px);  /* keeps it usable on small laptops */
  overflow-y: auto;              /* only the panel scrolls */
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.3);
  padding: 16px 20px 20px;
}

/* Inside Manage Users, let overlay-card just act as an inner container
   so PIN overlay's .overlay-card styling is not affected */
#userModal .overlay-card {
  max-width: none !important;          /* we control width via user-modal-panel */
  padding: 0;                          /* padding handled by .user-modal-panel */
  border: none;
  box-shadow: none;
}

.manage-users-modal{
  display:flex;
  align-items:flex-start;
  justify-content:center;
  padding-top:80px;
  z-index:200; /* above content, same layer as other modals */
}

.manage-users-card{
  max-width:640px;
  width:100%;
}

.perm-grid{
  display:flex;
  gap:24px;
  flex-wrap:wrap;
  font-size:14px;
}

.perm-item{
  display:flex;
  align-items:center;
  gap:6px;
  margin-bottom:4px;
}

.manage-users-footer{
  margin-top:16px;
  display:flex;
  align-items:center;
  gap:8px;
}

/* === Admin + Surplus alignment fix === */
.admin-block {
  margin-top: 16px;
}

.admin-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  line-height: 1.2;
}

.admin-line input[type="checkbox"] {
  margin: 0;              /* 🔑 removes browser default offset */
}

.admin-sub {
  margin-top: 6px;
  margin-left: 0;         /* 🔑 keep checkbox vertically aligned */
}

/* ⭐ Admin Header Color Mode */
body.admin-mode .app-header {
  background: #dcecff !important; /* light blue */
  border-bottom: 1px solid #b4d6ff;
}

body.admin-mode .btn.primary {
  background: #306bff;  /* optional: dark blue primary buttons */
  color: #fff;
}

body.admin-mode .app-header {
  transition: background 0.25s ease;
}

/* ⭐ Admin mode — make header buttons pop */
body.admin-mode .app-header .btn {
  background: #ffffff !important;     /* white button */
  color: var(--accent) !important;     /* keep existing dark text */
  border: 1px solid #c2d9f5;           /* subtle outline */
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

body.admin-mode .app-header .btn:hover {
  background: #f5faff !important;
  border-color: #9fc9ff;
}

/* 🔒 FINAL OVERRIDE – center PIN login contents */
#pinOverlay .overlay-card {
  max-width: 360px;
  /* override any earlier overlay-card layouts */
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  text-align: center !important;
  gap: 16px; /* spacing between title, subtext, input, button, error */
}

/* Make sure title + subtext are actually centered */
#pinOverlay .overlay-card h1,
#pinOverlay .overlay-card p,
#pinOverlay .overlay-card .muted {
  margin: 0;
  text-align: center !important;
}

/* Inputs and button stretch nicely under the centered text */
#pinOverlay .overlay-card input,
#pinOverlay .overlay-card button {
  width: 100%;
}

/* === MOBILE: Sort + Filters on the left, Counties on the right (single row) === */
@media (max-width: 768px) {

  /* override flex-wrap coming from .filter-row */
  .filter-row-main {
    display: flex;
    flex-wrap: nowrap;            /* ⬅ keep them on ONE line */
    align-items: flex-end;
    justify-content: flex-start;
    gap: 8px;                     /* nice, tight spacing like the tabs */
    width: 100%;
  }

  /* ORDER: Sort, Filters, then Counties */
  .sort-group {
    order: 1;
    flex: 0 0 auto;
  }

  .filters-icon-group {
    order: 2;
    flex: 0 0 auto;
  }

  .counties-group {
    order: 3;
    flex: 0 0 auto;               /* use its natural size */
    margin-left: auto;            /* push it to the right */
  }

  /* Labels */
  .sort-group .filter-label,
  .filters-icon-group .filter-label,
  .counties-group .filter-label {
    font-size: 11px;
    margin-bottom: 2px;
    text-align: center;
  }

  /* SORT icon */
  .sort-group .sort-input {
    width: 32px;
    height: 32px;
    padding: 0;
    margin: 0 auto;
    text-indent: -9999px;
    overflow: hidden;
  }

  /* FILTERS icon */
  .filters-icon-group .equity-dd-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .filters-icon-group #equityDdLabel {
    display: none;
  }

  .filters-icon-group .equity-dd-caret {
    font-size: 0;
  }
  .filters-icon-group .equity-dd-caret::before {
    content: "⛃";
    font-size: 18px;
  }

  /* Counties pill stays normal size, just positioned right */
  .counties-group .county-dd-btn {
    min-width: 130px;
  }

  #clearFiltersBtn {
    display: none;
  }
}

/* === FINAL MOBILE LAYOUT: Sort + Filters (left), Counties (right) === */
@media (max-width: 768px) {

  /* One row: Sort | Filters | Counties */
  .filter-row-main {
    display: grid !important;
    grid-template-columns: auto auto 1fr !important;
    align-items: flex-end;
    column-gap: 1px;              /* spacing between Sort and Filters */
    width: 100%;
  }

  /* Let the three groups shrink as needed */
  .filter-row-main > .sort-group,
  .filter-row-main > .filters-icon-group,
  .filter-row-main > .counties-group {
    min-width: 0 !important;
    margin: 0;
  }

  /* Counties floats to the right in its 3rd column */
  .filter-row-main > .counties-group {
    justify-self: end;            /* pushes Counties to right side */
  }

  /* --- LABELS --- */
  .filter-row-main .filter-label {
    font-size: 11px;
    margin-bottom: 2px;
    text-align: center;
  }

  /* --- SORT: icon-only button (stays at far left) --- */
  .sort-group .sort-input {
    width: 32px;
    height: 32px;
    padding: 0;
    margin: 0 auto;
    text-indent: -9999px;         /* hide text, keep the arrow glyph */
    overflow: hidden;
  }

  /* --- FILTERS: icon button just to the right of Sort --- */
  .filters-icon-group .equity-dd-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* hide "All" text inside Filters button */
  .filters-icon-group #equityDdLabel {
    display: none;
  }

  /* caret becomes filter icon */
  .filters-icon-group .equity-dd-caret {
    font-size: 0;
  }
  .filters-icon-group .equity-dd-caret::before {
    content: "⛃";
    font-size: 18px;
  }

  /* Keep Counties pill as-is, just positioned on the right.
     (existing .county-dd-btn sizing rules still apply) */

  /* Hide the bottom Clear button on mobile */
  #clearFiltersBtn {
    display: none;
  }
}

/* === FINAL MOBILE LAYOUT: Sort icon | Filters icon | Counties === */
@media (max-width: 768px) {

  /* 3 columns: Sort, Filters, Counties */
  .filter-row-main{
    display: grid !important;
    grid-template-columns: max-content max-content 1fr;
    column-gap: 8px;              /* adjust to make icons closer/further */
    align-items: flex-end;
    width: 100%;
  }

  /* Center Sort + Filters under their labels, keep them tight together */
  .filter-row-main .sort-group,
  .filter-row-main .filter-group:nth-of-type(1){  /* Filters group */
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  /* Counties stays on SAME ROW, pushed to the right */
  .filter-row-main .filter-group:last-of-type{
    justify-self: flex-end;
    min-width: 140px;    /* keeps the box a good size; tweak if needed */
  }
}

/* Mobile: Counties dropdown should align to the right edge */
@media (max-width: 768px) {
  .county-dd-menu{
    left: auto !important;
    right: 0;
  }
}

/* Center status tabs ONLY on mobile */
@media (max-width: 768px) {
  .tab-row {
      justify-content: center !important;
      width: 100%;
  }
}

/* Verified contact highlight */
.contact-verified {
  background-color: #e9fbe9 !important;  /* soft green tint */
  border: 1px solid #b7e3b7 !important;
}

.recent-changes-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.recent-change-row{
  width:100%;
  text-align:left;
  border:1px solid var(--line);   /* ✅ was --border */
  border-radius:12px;
  padding:10px 12px;
  background:#fff;
  cursor:pointer;
}

.recent-change-row:hover{
  box-shadow:0 6px 18px rgba(16,24,40,.06);  /* ✅ was var(--shadow) */
}

.recent-change-text {
  font-size: 14px;
  overflow-wrap: break-word;
  word-break: break-word;
}

.recent-change-meta {
  font-size: 12px;
  margin-top: 2px;
}
  
/* =========================================
   FINAL OVERRIDE — make Payoff Verified match other checkbox labels
   (must be at bottom of file)
   ========================================= */
.section .payoff-verified-label,
.section .vacant-label,
.section .trespass-label,
.section .renter-label,
.section .door-knock-label{
  font-size:12px !important;
  color:var(--muted) !important;
  font-weight:500 !important;
  line-height:1.2 !important;
}
.section .property-verified-label{
  font-size:12px !important;
  color:var(--muted) !important;
  font-weight:500 !important;
  line-height:1.2 !important;
}
.property-verified-row{
  display:flex;
  justify-content:center;
  gap:16px;
  flex-wrap:wrap;
  margin-top: 8px;
}
.property-verified-label{
  display:flex;
  align-items:center;
  gap:6px;
  cursor:pointer;
  user-select:none;
}

/* if Payoff Verified text is wrapped in span/strong, force inheritance */
.section .payoff-verified-label *{
  font-size:inherit !important;
  color:inherit !important;
  font-weight:inherit !important;
}
/* ===== NAV MENU (hamburger dropdown) ===== */
.nav-menu {
  position: relative;
}

.nav-menu-dropdown {
  position: absolute;
  right: 0;
  top: 42px;
  min-width: 180px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  padding: 6px 0;
  z-index: 1000;
}

/* ===== RATING PILLS: Under Contract + Closed + Completed ===== */
.rating-under-contract {
  background: #f3e8ff;
  border-color: #c4b5fd;
  color: #7c3aed;
}

.rating-closed-deal {
  background: #d1fae5;
  border-color: #6ee7b7;
  color: #065f46;
}

.rating-completed-deal {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #374151;
}

/* ===== DEALS PAGE ===== */
.deals-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
  position: sticky;
  top: 62px;
  background: var(--bg);
  padding-top: 8px;
  z-index: 5;
}

.deals-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.deals-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.deals-filter-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.deals-tab {
  /* inherits .tab styles */
}

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

@media (min-width: 900px) {
  .deals-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Deal Card */
.deal-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 14px 14px 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: box-shadow 0.12s, transform 0.1s;
  position: relative;
  border-left: 4px solid #7c3aed;
  box-shadow: var(--shadow-sm);
  content-visibility: auto;
  contain-intrinsic-size: 0 120px;
}

.deal-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.deal-card.deal-closed {
  border-left-color: #065f46;
}

.deal-card.deal-completed {
  border-left-color: #9ca3af;
  opacity: 0.7;
}

.deal-card .deal-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.deal-card .deal-card-address {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.35;
  flex: 1;
  min-width: 0;
}

.deal-card .deal-card-meta {
  font-size: 13px;
  color: var(--muted);
}

.deal-card .deal-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
}

/* Deal Type Pills */
.deal-type-pill {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid;
}

.deal-type-surplus {
  background: #e0f2fe;
  border-color: #bae6fd;
  color: #0369a1;
}

.deal-type-loan {
  background: #fff3e0;
  border-color: #fdba74;
  color: #b45309;
}

.deal-type-purchase {
  background: #dcfce7;
  border-color: #bbf7d0;
  color: #166534;
}

.deal-type-none {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #6b7280;
  font-style: italic;
}

/* ===== DEAL DETAIL PAGE ===== */
.deal-page {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 900px) {
  .deal-page {
    grid-template-columns: 1.2fr 0.8fr;
  }
}

/* Deal Type Selector (prominent) */
.deal-type-selector {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.deal-type-btn {
  flex: 1;
  min-width: 100px;
  padding: 12px 16px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}

.deal-type-btn:hover {
  border-color: #9ca3af;
  box-shadow: var(--shadow-sm);
}

.deal-type-btn.selected {
  border-color: #7c3aed;
  background: #f3e8ff;
  color: #7c3aed;
}

.deal-type-btn.selected-surplus {
  border-color: #0369a1;
  background: #e0f2fe;
  color: #0369a1;
}

.deal-type-btn.selected-loan {
  border-color: #b45309;
  background: #fff3e0;
  color: #b45309;
}

.deal-type-btn.selected-purchase {
  border-color: #166534;
  background: #dcfce7;
  color: #166534;
}

/* Deal Checklist */
.deal-checklist {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.deal-check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: #fafafa;
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: background 0.1s;
}

.deal-check-item.checked {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.deal-check-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  cursor: pointer;
  flex-shrink: 0;
}

.deal-check-label {
  font-size: 14px;
  font-weight: 500;
  flex: 1;
}

.deal-check-sub {
  margin-top: 6px;
}

.deal-check-sub input,
.deal-check-sub select {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  background: #fff;
}

.deal-check-sub label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 2px;
  display: block;
}

/* Deal Status Selector inside deal detail */
.deal-status-select {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  background: #fff;
}

/* ===== DEAL FILES BROWSER ===== */
.deal-files {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.deal-file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.1s;
}

.deal-file-item:hover {
  background: #f0f2f5;
}

.deal-file-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.deal-file-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deal-file-actions {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.deal-file-actions .btn {
  font-size: 12px;
  padding: 6px 10px;
}

/* Upload area */
.deal-upload-area {
  border: 2px dashed var(--line);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.deal-upload-area:hover {
  border-color: #9ca3af;
  background: #f9fafb;
}

/* Progress bar for checklist completion */
.deal-progress {
  height: 6px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}

.deal-progress-bar {
  height: 100%;
  background: #22c55e;
  border-radius: 999px;
  transition: width 0.3s ease;
}

/* ===== DEAL FILE BROWSER (enhanced) ===== */
.deal-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 0 8px;
  font-size: 12px;
  flex-wrap: wrap;
}

.deal-crumb-btn {
  background: none;
  border: none;
  color: #2563eb;
  cursor: pointer;
  font-size: 12px;
  padding: 2px 4px;
  border-radius: 4px;
}

.deal-crumb-btn:hover {
  background: #eff6ff;
  text-decoration: underline;
}

.deal-crumb-sep {
  color: var(--muted);
  font-size: 11px;
}

.deal-crumb-current {
  font-weight: 600;
  color: var(--text);
}

.deal-file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.1s;
}

.deal-file-item:hover {
  background: #f0f2f5;
}

.deal-file-item:hover .deal-file-btns {
  opacity: 1;
}

.deal-file-meta {
  font-size: 11px;
  white-space: nowrap;
  flex-shrink: 0;
}

.deal-file-btns {
  display: flex;
  gap: 2px;
  margin-left: auto;
  opacity: 0;
  transition: opacity 0.15s;
  flex-shrink: 0;
}

/* Always show on mobile (no hover) */
@media (max-width: 768px) {
  .deal-file-btns { opacity: 1; }
}

.deal-fbtn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  border-radius: 4px;
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
}

.deal-fbtn:hover {
  background: #e5e7eb;
}

.deal-fbtn-delete:hover {
  background: #fee2e2;
}


/* ═══════════════════════════════════════════════
   DEALS-ONLY STYLES (scoped — never touch leads)
   ═══════════════════════════════════════════════ */

/* Deal page overflow containment */
.deal-page {
  overflow: hidden;
  min-width: 0;
}
.deal-page > div {
  min-width: 0;
  overflow: hidden;
}
.deal-page .section {
  overflow: hidden;
  min-width: 0;
}

/* Deal detail header */
.deal-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.deal-detail-info {
  flex: 1;
  min-width: 0;
}
.deal-detail-addr {
  margin: 0;
  word-break: break-word;
  overflow-wrap: break-word;
}
.deal-detail-sub {
  font-size: 13px;
  word-break: break-word;
  overflow-wrap: break-word;
}
.deal-detail-rating {
  flex-shrink: 0;
}
.deal-detail-type-section {
  margin-bottom: 12px;
}
.deal-detail-type-label {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
}

/* Deal section headers (Contacts, Timeline inside deals) */
.deal-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 8px;
}
.deal-section-header h3 {
  margin: 0;
}
.deal-section-add {
  font-size: 12px;
  flex-shrink: 0;
}

/* Deal progress row */
.deal-progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.deal-progress-count {
  font-size: 12px;
  flex-shrink: 0;
}

/* Documents header */
.deal-docs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 8px;
  flex-wrap: wrap;
}
.deal-docs-header .deal-file-actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.deal-docs-header .deal-file-actions .btn {
  font-size: 12px;
  padding: 5px 10px;
}

/* Contact/timeline buttons ONLY inside deal page */
.deal-page .contact-card > div:first-child {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.deal-page .contact-card > div:first-child > div:last-child {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

/* ===== DEALS MOBILE ===== */
@media (max-width: 768px) {
  /* Deal header stacks vertically */
  .deal-detail-header {
    flex-direction: column;
    gap: 6px;
  }
  .deal-detail-rating {
    align-self: flex-start;
  }
  .deal-detail-addr {
    font-size: 18px;
  }

  /* Deal type buttons fit on one row */
  .deal-type-selector {
    gap: 6px;
  }
  .deal-type-btn {
    padding: 10px 6px;
    font-size: 12px;
    min-width: 0;
  }

  /* Document actions wrap */
  .deal-docs-header {
    flex-direction: column;
    align-items: stretch;
  }
  .deal-docs-header .deal-file-actions {
    justify-content: flex-end;
  }
  .deal-docs-header .deal-file-actions .btn {
    font-size: 11px;
    padding: 4px 8px;
  }

  /* File items tighter */
  .deal-file-item {
    padding: 6px 8px;
    font-size: 12px;
    gap: 6px;
  }
  .deal-file-name { font-size: 12px; }
  .deal-file-meta { font-size: 10px; }
  .deal-fbtn { font-size: 12px; padding: 4px 3px; }

  /* Deal checklist items */
  .deal-check-item { padding: 8px 10px; }
  .deal-check-label { font-size: 13px; }

  /* Breadcrumbs */
  .deal-breadcrumbs { font-size: 11px; }

  /* Contacts/timeline inside deals */
  .deal-page .contact-card .btn {
    font-size: 11px;
    padding: 4px 8px;
  }
}
