/*
 * Phase 9B — Client Directory
 *
 * Boutique Wealth additive presentation.
 * Scoped entirely to phase9b-* classes.
 */

.phase9b-workspace-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 22px 0 18px;
  padding: 5px;
  width: fit-content;
  max-width: 100%;
  border: 1px solid #dde4e0;
  border-radius: 12px;
  background: #f6f7f4;
}

.phase9b-nav-button {
  appearance: none;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #526275;
  padding: 8px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.phase9b-nav-button:hover {
  color: #16324d;
  background: rgba(255, 255, 255, .7);
}

.phase9b-nav-button.active {
  background: #fff;
  color: #16324d;
  box-shadow: 0 1px 3px rgba(17, 35, 48, .10);
}

.phase9b-nav-button:focus-visible,
.phase9b-button:focus-visible,
.phase9b-more summary:focus-visible {
  outline: 3px solid rgba(22, 50, 77, .18);
  outline-offset: 2px;
}

.phase9b-clients {
  margin-top: 2px;
}

.phase9b-heading,
.phase9b-editor-heading,
.phase9b-toolbar,
.phase9b-client-row,
.phase9b-client-name-line,
.phase9b-client-meta,
.phase9b-client-actions,
.phase9b-form-actions {
  display: flex;
}

.phase9b-heading,
.phase9b-editor-heading {
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.phase9b-heading h2,
.phase9b-editor h3 {
  margin: 0;
  color: #16324d;
}

.phase9b-intro {
  max-width: 680px;
  margin: 7px 0 0;
  color: #66737f;
  line-height: 1.55;
}

.phase9b-eyebrow {
  margin: 0 0 5px;
  color: #7a897f;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.phase9b-toolbar {
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 20px 0 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e7ebe8;
}

.phase9b-archive-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #526275;
  font-size: 13px;
  cursor: pointer;
}

.phase9b-archive-toggle input {
  margin: 0;
}

.phase9b-count {
  color: #7b8790;
  font-size: 12px;
  font-weight: 700;
}

.phase9b-button {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 8px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.2;
  cursor: pointer;
}

.phase9b-button:disabled {
  opacity: .55;
  cursor: default;
}

.phase9b-button-primary {
  border-color: #16324d;
  background: #16324d;
  color: #fff;
}

.phase9b-button-primary:hover:not(:disabled) {
  filter: brightness(.96);
}

.phase9b-button-secondary,
.phase9b-button-quiet {
  border-color: #d9e0dc;
  background: #fff;
  color: #32495b;
}

.phase9b-button-secondary:hover:not(:disabled),
.phase9b-button-quiet:hover:not(:disabled) {
  background: #f7f8f6;
}

.phase9b-button-danger {
  border-color: #a54e47;
  background: #a54e47;
  color: #fff;
}

.phase9b-message {
  margin: 10px 0;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 13px;
}

.phase9b-message.success {
  background: #eef6f0;
  color: #326146;
}

.phase9b-message.error {
  background: #faf0ef;
  color: #93493f;
}

.phase9b-editor {
  margin: 14px 0 18px;
  padding: 18px;
  border: 1px solid #dfe5e1;
  border-radius: 14px;
  background: #fafaf8;
}

.phase9b-form {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.phase9b-field {
  display: grid;
  gap: 6px;
  color: #344b5c;
  font-size: 13px;
  font-weight: 700;
}

.phase9b-field-wide {
  grid-column: 1 / -1;
}

.phase9b-field small {
  color: #7c878e;
  font-size: 11px;
  font-weight: 500;
}

.phase9b-field input,
.phase9b-field select,
.phase9b-field textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #ccd6d1;
  border-radius: 9px;
  background: #fff;
  color: #263b4a;
  padding: 9px 10px;
  font: inherit;
  font-weight: 500;
}

.phase9b-field textarea {
  resize: vertical;
}

.phase9b-field input:focus,
.phase9b-field select:focus,
.phase9b-field textarea:focus {
  outline: 3px solid rgba(22, 50, 77, .12);
  border-color: #81959f;
}

.phase9b-form-actions {
  grid-column: 1 / -1;
  justify-content: flex-end;
}

.phase9b-client-list {
  display: grid;
  gap: 9px;
}

.phase9b-client-row {
  position: relative;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding: 15px 16px;
  border: 1px solid #e0e6e2;
  border-radius: 12px;
  background: #fff;
}

.phase9b-client-row.archived {
  background: #f7f7f4;
  opacity: .84;
}

.phase9b-client-main {
  min-width: 0;
  flex: 1 1 360px;
}

.phase9b-client-name-line {
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.phase9b-client-name-line strong {
  color: #1d3546;
  font-size: 15px;
}

.phase9b-client-meta {
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 6px;
  color: #6d7982;
  font-size: 12px;
}

.phase9b-empty-contact {
  color: #8a949a;
}

.phase9b-status,
.phase9b-archived-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .02em;
}

.phase9b-status-active {
  background: #eaf4ed;
  color: #346149;
}

.phase9b-status-on_hold {
  background: #f7f0df;
  color: #806632;
}

.phase9b-status-closed {
  background: #edf0f2;
  color: #586773;
}

.phase9b-archived-badge {
  background: #eeeae2;
  color: #776d5f;
}

.phase9b-client-actions {
  position: relative;
  align-items: center;
  gap: 7px;
}

.phase9b-more {
  position: relative;
}

.phase9b-more summary {
  display: grid;
  place-items: center;
  min-width: 35px;
  height: 34px;
  border: 1px solid #d9e0dc;
  border-radius: 9px;
  background: #fff;
  color: #526275;
  cursor: pointer;
  list-style: none;
}

.phase9b-more summary::-webkit-details-marker {
  display: none;
}

.phase9b-more[open] {
  z-index: 5;
}

.phase9b-menu-danger {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  width: max-content;
  border: 1px solid #ead4d1;
  border-radius: 9px;
  background: #fff;
  color: #93493f;
  padding: 9px 11px;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  box-shadow: 0 8px 24px rgba(28, 42, 49, .14);
  cursor: pointer;
}

.phase9b-delete-confirm {
  flex: 1 0 100%;
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid #e4c7c3;
  border-radius: 10px;
  background: #fbf3f2;
  color: #71443f;
  font-size: 12px;
}

.phase9b-delete-confirm > div {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  margin-top: 3px;
}

.phase9b-state,
.phase9b-empty {
  padding: 34px 20px;
  border: 1px dashed #d7dfda;
  border-radius: 12px;
  background: #fafaf8;
  text-align: center;
  color: #6b7880;
}

.phase9b-empty strong {
  color: #2d4656;
}

.phase9b-empty p {
  margin: 7px auto 0;
  max-width: 520px;
  line-height: 1.5;
}

.phase9b-clients[aria-busy="true"] {
  cursor: progress;
}

@media (max-width: 720px) {
  .phase9b-heading,
  .phase9b-editor-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .phase9b-form {
    grid-template-columns: 1fr;
  }

  .phase9b-field-wide,
  .phase9b-form-actions {
    grid-column: 1;
  }

  .phase9b-client-row {
    align-items: stretch;
  }

  .phase9b-client-actions {
    width: 100%;
  }
}
