/* Lot Scout v0.7.1 — Tracked Lots + site-context layers */

/* ---------- Map / Tracked Lots top-level navigation ---------- */
.topbar {
  grid-template-columns: 250px auto minmax(260px, 680px) 1fr;
}

.view-switch {
  display: inline-flex;
  align-self: center;
  justify-self: start;
  padding: 3px;
  border: 1px solid #2d3b48;
  border-radius: 5px;
  background: #0c131a;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}

.view-switch button {
  min-height: 34px;
  padding: 7px 13px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: #7f8d9c;
  font-size: 11px;
  font-weight: 760;
  letter-spacing: .02em;
  white-space: nowrap;
}

.view-switch button:hover { color: #d9e5ee; background: #131e27; }
.view-switch button.active {
  background: #1b2b36;
  color: var(--accent);
  box-shadow: 0 0 0 1px rgba(78,217,244,.18);
}

.layer-group-label {
  padding: 11px 9px 4px;
  color: #536779;
  font-size: 8px;
  font-weight: 820;
  letter-spacing: .17em;
  text-transform: uppercase;
}

/* ---------- New map layer legend ---------- */
.legend .flood-100 { background: #00bfe8; border-color: #00d7ff; }
.legend .flood-500 { background: #6775ff; border-color: #9aa5ff; }
.legend .contour-swatch {
  border-color: #b6c6d3;
  box-shadow: 0 2px 0 #758b9d, 0 -2px 0 rgba(255,255,255,.15);
}

/* ---------- Tracked Lots report ---------- */
.tracked-view {
  height: calc(100dvh - 72px);
  overflow: auto;
  background:
    radial-gradient(circle at 18% 0%, rgba(78,217,244,.055), transparent 32%),
    #080d12;
  color: var(--text);
}

.tracked-shell {
  width: min(1720px, 100%);
  margin: 0 auto;
  padding: 28px 30px 50px;
}

.tracked-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid #253340;
}
.tracked-heading h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(28px, 3vw, 42px);
  line-height: .98;
  letter-spacing: -.045em;
}
.tracked-heading p {
  max-width: 720px;
  margin: 10px 0 0;
  color: #758596;
  font-size: 12px;
  line-height: 1.55;
}
.tracked-heading-actions { display: flex; gap: 8px; }
.tracked-heading-actions button {
  min-height: 38px;
  border-radius: 4px;
  padding: 8px 14px;
  font-weight: 760;
}
.tracked-heading-actions #exportTrackedBtn {
  border: 1px solid rgba(78,217,244,.42);
  background: #14313b;
  color: #9deeff;
}
.tracked-heading-actions #refreshTrackedBtn {
  border: 1px solid #344555;
  background: #111920;
  color: #adbac6;
}

.tracked-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: 1px;
  margin: 18px 0;
  overflow: hidden;
  border: 1px solid #273642;
  border-radius: 6px;
  background: #273642;
}
.tracked-summary > div {
  display: grid;
  gap: 3px;
  min-height: 72px;
  align-content: center;
  padding: 11px 16px;
  background: #101820;
}
.tracked-summary strong {
  color: #f6fbff;
  font-size: 22px;
  letter-spacing: -.03em;
}
.tracked-summary span {
  color: #667789;
  font-size: 9px;
  font-weight: 780;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.tracked-controls {
  display: grid;
  grid-template-columns: minmax(250px, 1.6fr) repeat(3, minmax(150px, .7fr));
  gap: 10px;
  margin-bottom: 14px;
}
.tracked-controls label { display: grid; gap: 5px; }
.tracked-controls label > span {
  color: #647587;
  font-size: 8px;
  font-weight: 820;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.tracked-controls input,
.tracked-controls select {
  min-height: 39px;
  border: 1px solid #2b3a47;
  border-radius: 4px;
  background: #0e161e;
  color: #dce7ef;
  padding: 8px 10px;
  font-size: 12px;
}
.tracked-controls input:focus,
.tracked-controls select:focus {
  outline: none;
  border-color: rgba(78,217,244,.7);
  box-shadow: 0 0 0 2px rgba(78,217,244,.09);
}

.tracked-message {
  padding: 30px 20px;
  border: 1px dashed #30404e;
  border-radius: 5px;
  color: #748597;
  background: rgba(15,23,31,.72);
  text-align: center;
  font-size: 12px;
}

.tracked-table-wrap {
  overflow: auto;
  border: 1px solid #2a3946;
  border-radius: 6px;
  background: #0d141b;
  box-shadow: 0 18px 46px rgba(0,0,0,.20);
}
.tracked-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  font-size: 11px;
}
.tracked-table thead {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #121c24;
}
.tracked-table th {
  height: 40px;
  padding: 8px 10px;
  border-bottom: 1px solid #344552;
  color: #6e8091;
  font-size: 8px;
  font-weight: 830;
  letter-spacing: .12em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.tracked-table td {
  padding: 10px;
  border-bottom: 1px solid #1e2a34;
  color: #b9c5cf;
  vertical-align: middle;
  line-height: 1.35;
}
.tracked-table tbody tr:last-child td { border-bottom: 0; }
.tracked-row { cursor: pointer; transition: background .10s ease, box-shadow .10s ease; }
.tracked-row:hover { background: #12212a; box-shadow: inset 3px 0 0 var(--accent); }
.tracked-row:focus { outline: 1px solid rgba(78,217,244,.55); outline-offset: -1px; }

.tracked-address-link {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  color: #f0f7fc;
  font-size: 12px;
  font-weight: 790;
  text-align: left;
  white-space: nowrap;
}
.tracked-row:hover .tracked-address-link { color: #8deaff; }
.tracked-code {
  display: inline-block;
  color: #b4c7d6;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 10px;
}
.tracked-owner {
  display: block;
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tracked-muted { color: #526170; }
.tracked-collection-cell { display: flex; flex-wrap: wrap; gap: 4px; max-width: 240px; }
.tracked-collection-chip {
  display: inline-flex;
  padding: 3px 6px;
  border: 1px solid #344b5b;
  border-radius: 3px;
  background: #12202a;
  color: #9db3c2;
  font-size: 9px;
  line-height: 1.2;
  white-space: nowrap;
}
.tracked-status-pill {
  --status-color: #8795a6;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border: 1px solid color-mix(in srgb, var(--status-color) 45%, #24313d);
  border-radius: 3px;
  background: color-mix(in srgb, var(--status-color) 12%, #101820);
  color: color-mix(in srgb, var(--status-color) 72%, white);
  font-size: 9px;
  font-weight: 790;
  white-space: nowrap;
}
.tracked-status-pill::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--status-color);
  box-shadow: 0 0 7px color-mix(in srgb, var(--status-color) 70%, transparent);
}

@media (max-width: 1180px) {
  .topbar { grid-template-columns: 210px auto minmax(220px, 1fr) auto; }
  .tracked-shell { padding-inline: 18px; }
  .tracked-controls { grid-template-columns: 1fr 1fr 1fr; }
  .tracked-search { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  :root { --mobile-topbar: 146px; }
  .topbar {
    height: var(--mobile-topbar);
    min-height: var(--mobile-topbar);
    grid-template-columns: minmax(0,1fr) auto;
    grid-template-rows: 44px 38px 44px;
    gap: 5px 8px;
  }
  .brand { grid-column: 1; grid-row: 1; }
  .top-actions { grid-column: 2; grid-row: 1; }
  .view-switch {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: stretch;
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 2px;
  }
  .view-switch button { min-height: 32px; padding: 5px 10px; }
  .search { grid-column: 1 / -1; grid-row: 3; height: 40px; }

  .tracked-view {
    height: calc(100dvh - var(--mobile-topbar));
    -webkit-overflow-scrolling: touch;
  }
  .tracked-shell { padding: 18px 10px 34px; }
  .tracked-heading { align-items: flex-start; gap: 14px; }
  .tracked-heading h1 { font-size: 30px; }
  .tracked-heading p { font-size: 11px; }
  .tracked-heading-actions { flex-direction: column; }
  .tracked-heading-actions button { min-height: 34px; padding: 6px 9px; font-size: 10px; }
  .tracked-summary {
    grid-template-columns: repeat(5, minmax(74px, 1fr));
    overflow-x: auto;
  }
  .tracked-summary > div { min-width: 74px; padding: 9px 10px; }
  .tracked-summary strong { font-size: 18px; }
  .tracked-summary span { font-size: 7px; }
  .tracked-controls { grid-template-columns: 1fr 1fr; }
  .tracked-search { grid-column: 1 / -1; }

  .tracked-table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
  .tracked-table,
  .tracked-table tbody { display: block; width: 100%; }
  .tracked-table thead { display: none; }
  .tracked-table tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    margin-bottom: 9px;
    overflow: hidden;
    border: 1px solid #293946;
    border-radius: 5px;
    background: #0e171e;
  }
  .tracked-table td {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 9px 10px;
    border-bottom: 1px solid #1f2d37;
  }
  .tracked-table td::before {
    content: attr(data-label);
    color: #56697a;
    font-size: 7px;
    font-weight: 830;
    letter-spacing: .12em;
    text-transform: uppercase;
  }
  .tracked-table td:first-child {
    grid-column: 1 / -1;
    padding: 12px 10px;
    background: #121f28;
  }
  .tracked-table td:first-child::before { display: none; }
  .tracked-table td:nth-child(3),
  .tracked-table td:nth-child(8) { grid-column: 1 / -1; }
  .tracked-address-link { font-size: 15px; }
  .tracked-owner { max-width: none; white-space: normal; }
  .tracked-collection-cell { max-width: none; }
}

@media (max-width: 420px) {
  .tracked-heading { display: grid; }
  .tracked-heading-actions { flex-direction: row; }
  .tracked-controls { grid-template-columns: 1fr; }
  .tracked-search { grid-column: auto; }
}
