/* ─── Listings overview (2026-09-26 usability pass) ────────────────────────────
   Scoped to #tab-listings. Uses the shared theme tokens from styles.css, so light
   and dark mode follow the app. The global header and sidebar are not touched. */

#tab-listings .ls-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
#tab-listings .ls-muted { color: var(--text-2); }

/* ── Heading ─────────────────────────────────────────────────────────────── */
#tab-listings .ls-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  margin-bottom: 18px;
}
#tab-listings .ls-title { font-size: 34px; line-height: 1.1; margin: 0; }
#tab-listings .ls-subtitle { margin: 6px 0 0; font-size: 15px; color: var(--text-2); }
#tab-listings .ls-add-btn {
  flex: none; display: inline-flex; align-items: center; gap: 8px;
  background: var(--gold); color: #1C1B18; border: none; border-radius: 8px;
  padding: 11px 20px; font-size: 15px; font-weight: 600; cursor: pointer;
  box-shadow: var(--shadow-sm); transition: background var(--t);
}
#tab-listings .ls-add-btn span { font-size: 19px; line-height: 1; font-weight: 500; }
#tab-listings .ls-add-btn:hover { background: var(--gold-light); }

/* Shared focus ring for every control on this screen */
#tab-listings :is(button, a, select, input):focus-visible {
  outline: 2px solid var(--gold); outline-offset: 2px;
}

/* ── Toolbar: Mine/Team · search · agent · view ─────────────────────────── */
#tab-listings .ls-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 14px;
}
#tab-listings .ls-slot[hidden] { display: none; }
#tab-listings .ls-scope-select { font-weight: 600; min-width: 170px; }
#tab-listings .ls-seg {
  display: inline-flex; padding: 4px; gap: 4px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border);
}
#tab-listings .ls-seg-btn {
  min-width: 96px; padding: 8px 18px; border: none; border-radius: 7px;
  background: transparent; color: var(--text); font-size: 14px; font-weight: 500; cursor: pointer;
}
#tab-listings .ls-seg-btn:hover { background: var(--card); }
#tab-listings .ls-seg-btn.active { background: var(--gold); color: #1C1B18; font-weight: 600; box-shadow: var(--shadow-sm); }

#tab-listings .ls-search {
  position: relative; flex: 1 1 280px; min-width: 200px; max-width: 520px; color: var(--text-2);
}
#tab-listings .ls-search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); pointer-events: none; }
#tab-listings .ls-search-input {
  width: 100%; box-sizing: border-box; height: 42px; padding: 0 14px 0 38px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg-input);
  color: var(--text); font-size: 14px;
}
#tab-listings .ls-search-input::placeholder { color: var(--text-2); }

#tab-listings .ls-select {
  height: 42px; padding: 0 34px 0 14px; border: 1px solid var(--border); border-radius: 8px;
  background-color: var(--bg-input); color: var(--text); font-size: 14px; font-weight: 500; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 17px) 52%, calc(100% - 12px) 52%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}

/* ── Status filters ──────────────────────────────────────────────────────── */
#tab-listings .ls-status-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px 16px; margin-bottom: 18px;
}
#tab-listings .ls-chips { display: flex; flex-wrap: wrap; gap: 8px; }
#tab-listings .ls-chip-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--card);
  color: var(--text); font-size: 13.5px; font-weight: 500; cursor: pointer;
}
#tab-listings .ls-chip-btn:hover { border-color: var(--gold); }
#tab-listings .ls-chip-btn.active {
  background: var(--gold-dim); border-color: var(--gold); color: var(--text); font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--gold);
}
#tab-listings .ls-count {
  min-width: 20px; padding: 1px 6px; border-radius: 999px; box-sizing: border-box;
  background: var(--surface); color: var(--text-2); font-size: 12px; font-weight: 600; text-align: center;
}
#tab-listings .ls-chip-btn.active .ls-count { background: var(--gold); color: #1C1B18; }
#tab-listings .ls-select.ls-more { height: 36px; border-radius: 999px; font-size: 13.5px; background-color: var(--card); }
#tab-listings .ls-select.ls-more.active { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); background-color: var(--gold-dim); font-weight: 600; }
#tab-listings .ls-hint { margin: 0; font-size: 13px; color: var(--text-2); }

/* ── Cards ───────────────────────────────────────────────────────────────── */
#tab-listings .ls-view-cards .ls-cards-grid {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; padding: 0;
}
#tab-listings .ls-card {
  background: var(--card); border-radius: 14px; overflow: visible; box-shadow: var(--shadow-sm);
}
#tab-listings .ls-card:hover { transform: none; box-shadow: var(--shadow); }
#tab-listings .ls-card-hero { height: 190px; border-radius: 14px 14px 0 0; }
#tab-listings .ls-card-hero-placeholder { background: var(--surface); }

#tab-listings .ls-pill {
  position: absolute; top: 12px; left: 12px; padding: 5px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none;
  background: #FFFFFF; color: #1C1B18; box-shadow: 0 1px 6px rgba(0, 0, 0, .22);
}
#tab-listings .ls-pill-active      { background: #E4F4E9; color: #1D6B40; }
#tab-listings .ls-pill-coming-soon { background: #E3EEFB; color: #1F5596; }
#tab-listings .ls-pill-pending     { background: #FCEBD9; color: #8A4A12; }
#tab-listings .ls-pill-sold        { background: #EDE5F8; color: #5B3A8C; }
#tab-listings .ls-pill-expired     { background: #FBE3E0; color: #9A2F24; }
#tab-listings .ls-pill-withdrawn,
#tab-listings .ls-pill-none        { background: #EEECEA; color: #45443F; }
#tab-listings .ls-pill-archived    { left: auto; right: 12px; background: #1C1B18; color: #F8F7F4; }

#tab-listings .ls-card-body { padding: 16px 18px 12px; gap: 4px; }
#tab-listings .ls-card-address { margin: 0; font-size: 18px; font-weight: 600; line-height: 1.25; color: var(--text); }
#tab-listings .ls-card-locality { font-size: 14px; color: var(--text-2); }
#tab-listings .ls-card-price { margin-top: 8px; font-size: 22px; font-weight: 700; color: var(--text); letter-spacing: -.01em; }
#tab-listings .ls-card-price.ls-muted { font-size: 15px; font-weight: 500; color: var(--text-2); }
#tab-listings .ls-card-details { font-size: 14px; color: var(--text-2); }
#tab-listings .ls-card-dom { font-size: 13.5px; color: var(--text-2); }
#tab-listings .ls-card-mls { font-size: 12px; color: var(--text-2); margin: 2px 0 0; }
#tab-listings .ls-card-chips { margin-top: 8px; gap: 6px; }
#tab-listings .ls-chip { font-size: 12px; padding: 3px 9px; border-radius: 999px; }
#tab-listings .ls-card-deadline { font-size: 12px; padding: 3px 9px; border-radius: 999px; }
#tab-listings .ls-card-next { font-size: 13px; margin-top: 6px; }
#tab-listings .ls-card-mkt-pct { min-width: 0; font-size: 11.5px; color: var(--text-2); white-space: nowrap; }

#tab-listings .ls-card-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 0 18px; padding: 12px 0 14px; border-top: 1px solid var(--border);
}
#tab-listings .ls-card-agent { display: flex; align-items: center; gap: 9px; min-width: 0; font-size: 14px; color: var(--text); }
#tab-listings .ls-agent-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#tab-listings .ls-avatar {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%; background: var(--gold-dim); color: var(--text);
  font-size: 12px; font-weight: 600; border: 1px solid var(--border);
}
#tab-listings .ls-card-actions { display: flex; align-items: center; gap: 8px; flex: none; }
#tab-listings .ls-open-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px;
  border: 1.5px solid var(--gold); border-radius: 8px; color: var(--text);
  font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; background: var(--card);
}
#tab-listings .ls-open-btn:hover { background: var(--gold-dim); }

#tab-listings .ls-menu-wrap { position: relative; }
#tab-listings .ls-more-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 38px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--card); color: var(--text); cursor: pointer;
}
#tab-listings .ls-more-btn svg { fill: currentColor; }
#tab-listings .ls-more-btn:hover, #tab-listings .ls-more-btn[aria-expanded="true"] { border-color: var(--gold); }
#tab-listings .ls-menu {
  position: absolute; right: 0; bottom: calc(100% + 8px); z-index: 30; min-width: 190px; padding: 6px;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow);
}
#tab-listings .ls-menu[hidden] { display: none; }
#tab-listings .ls-menu [role="menuitem"] {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: none; border-radius: 6px;
  background: transparent; color: var(--text); font-size: 14px; text-align: left; cursor: pointer;
}
#tab-listings .ls-menu [role="menuitem"]:hover,
#tab-listings .ls-menu [role="menuitem"]:focus { background: var(--bg-hover); outline: none; }
#tab-listings .ls-menu [role="menuitem"]:focus-visible { box-shadow: inset 0 0 0 2px var(--gold); }
#tab-listings .ls-menu-ico { width: 16px; text-align: center; color: var(--text-2); }

/* Table / pipeline: keyboard-reachable address links keep the row's look */
#tab-listings .ls-row-link { color: inherit; text-decoration: none; }
#tab-listings .ls-row-link:hover { text-decoration: underline; }
#tab-listings .ls-view-table .ls-table-wrap { padding: 0; }
#tab-listings .ls-view-pipeline .ls-pipeline { padding-left: 0; padding-right: 0; }

/* Empty state */
#tab-listings .ls-empty-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
#tab-listings .ls-link-btn { background: none; border: none; color: var(--text); text-decoration: underline; font-size: 13.5px; cursor: pointer; }

/* ── Phone ───────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  #tab-listings .ls-head { flex-direction: column; align-items: stretch; gap: 12px; }
  #tab-listings .ls-title { font-size: 28px; }
  #tab-listings .ls-add-btn { justify-content: center; }
  #tab-listings .ls-toolbar { gap: 10px; }
  #tab-listings #ls-scope-slot { flex: 1 1 100%; }
  #tab-listings .ls-scope-select { width: 100%; }
  #tab-listings .ls-search { flex: 1 1 0; min-width: 0; max-width: none; }
  #tab-listings #ls-view-slot { flex: none; }
  #tab-listings #ls-agent-slot { flex: 1 1 100%; order: 5; }
  #tab-listings #ls-agent-slot .ls-select { width: 100%; }
  /* Status chips scroll sideways inside their own strip (never the page) */
  #tab-listings .ls-status-row { display: block; margin-bottom: 14px; }
  #tab-listings .ls-chips {
    flex-wrap: nowrap; overflow-x: auto; margin: 0 -14px; padding: 2px 14px 6px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  #tab-listings .ls-chips::-webkit-scrollbar { display: none; }
  #tab-listings .ls-chips > * { flex: none; }
  #tab-listings .ls-hint { margin-top: 6px; font-size: 12.5px; }
  #tab-listings .ls-view-cards .ls-cards-grid { grid-template-columns: 1fr; gap: 16px; }
  #tab-listings .ls-card-hero { height: 180px; }
  #tab-listings .ls-card-footer { flex-wrap: wrap; }
  #tab-listings .ls-card-actions { margin-left: auto; }
}
