/*
 * Andrea Finance Dashboard
 * Phase 9F — Search + Project Unit Finder
 *
 * Transitional adapter styling only.
 * Kept isolated so the new canonical shell can replace it cleanly.
 */

.phase9f-client-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin: 0 0 14px;
}

.phase9f-client-search input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #ccd6d1;
  border-radius: 10px;
  background: #fff;
  color: #263b4a;
  padding: 10px 12px;
  font: inherit;
}

.phase9f-client-search span {
  color: #6d7b83;
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
}

.phase9f-unit-finder {
  margin: 12px 0 18px;
  border: 1px solid #dfe5e1;
  border-radius: 14px;
  background: #fafbf9;
  padding: 16px;
}

.phase9f-finder-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.phase9f-finder-heading h4 {
  margin: 0;
  color: #18364b;
  font-size: 1rem;
}

.phase9f-finder-heading p {
  margin: 4px 0 0;
  color: #718088;
  font-size: .78rem;
  line-height: 1.45;
}

.phase9f-clear {
  border: 1px solid #ccd6d1;
  border-radius: 9px;
  background: #fff;
  color: #38515f;
  padding: 8px 10px;
  font: inherit;
  font-size: .78rem;
  font-weight: 750;
  cursor: pointer;
  white-space: nowrap;
}

.phase9f-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 240px);
  gap: 12px;
  margin-top: 14px;
  align-items: end;
}

.phase9f-search-row > input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #cbd5d1;
  border-radius: 10px;
  background: #fff;
  color: #263b4a;
  padding: 10px 12px;
  font: inherit;
}

.phase9f-sort {
  display: grid;
  gap: 5px;
  color: #445965;
  font-size: .75rem;
  font-weight: 750;
}

.phase9f-sort select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #cbd5d1;
  border-radius: 9px;
  background: #fff;
  color: #263b4a;
  padding: 9px 10px;
  font: inherit;
}

.phase9f-filters {
  display: grid;
  grid-template-columns:
    repeat(5, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.phase9f-filters label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: #445965;
  font-size: .72rem;
  font-weight: 750;
}

.phase9f-filters input,
.phase9f-filters select {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid #cbd5d1;
  border-radius: 9px;
  background: #fff;
  color: #263b4a;
  padding: 8px 9px;
  font: inherit;
}

.phase9f-finder-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
}

.phase9f-results-count {
  color: #536872;
  font-size: .76rem;
  font-weight: 800;
}

.phase9f-finder-error {
  color: #944b43;
  font-size: .74rem;
  font-weight: 700;
  text-align: right;
}

.phase9f-empty {
  margin: 12px 0 0;
  border: 1px dashed #d3dbd7;
  border-radius: 10px;
  padding: 12px;
  color: #718088;
  font-size: .8rem;
  text-align: center;
}

.phase9f-unit-record-list {
  display: grid;
}

/*
 * PHASE 9F HIDDEN VISIBILITY AUTHORITY
 *
 * Legacy rows have explicit display:flex rules.
 * The HTML hidden attribute alone can therefore be visually overridden.
 *
 * Keep this override scoped only to rows filtered by Phase 9F.
 */
.phase9f-unit-record-list > article.record[hidden],
#phase9b-clients-host .phase9b-client-row[hidden] {
  display: none !important;
}

.phase9f-client-search input:focus-visible,
.phase9f-unit-finder input:focus-visible,
.phase9f-unit-finder select:focus-visible,
.phase9f-unit-finder button:focus-visible {
  outline: 3px solid rgba(22, 50, 77, .14);
  outline-offset: 2px;
}

@media (max-width: 980px) {
  .phase9f-filters {
    grid-template-columns:
      repeat(3, minmax(120px, 1fr));
  }
}

@media (max-width: 720px) {
  .phase9f-client-search,
  .phase9f-search-row {
    grid-template-columns: 1fr;
  }

  .phase9f-client-search span {
    white-space: normal;
  }

  .phase9f-filters {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

  .phase9f-finder-heading,
  .phase9f-finder-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .phase9f-finder-error {
    text-align: left;
  }
}

@media (max-width: 480px) {
  .phase9f-filters {
    grid-template-columns: 1fr;
  }
}
