/*
 * Phase 9D — Analysis ↔ Client Assignment UX.
 *
 * Presentation is strictly namespaced to Phase 9D.
 */

.phase9d-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin: 18px 0;
  padding: 16px 18px;
  border: 1px solid #dbe3e7;
  border-radius: 14px;
  background: #f8fafb;
}

.phase9d-toolbar-copy {
  display: grid;
  gap: 4px;
  min-width: 220px;
}

.phase9d-toolbar-copy strong {
  color: #18364a;
  font-size: 15px;
}

.phase9d-toolbar-copy span {
  color: #667984;
  font-size: 13px;
  line-height: 1.45;
}

.phase9d-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.phase9d-status {
  width: 100%;
  padding-top: 2px;
  color: #667984;
  font-size: 12px;
  line-height: 1.45;
}

.phase9d-status-ok {
  color: #2f684e;
}

.phase9d-status-error {
  color: #a43f3f;
}

.phase9d-button,
.phase9d-icon-button {
  appearance: none;
  border: 1px solid transparent;
  font: inherit;
  cursor: pointer;
  transition:
    border-color 120ms ease,
    background 120ms ease,
    box-shadow 120ms ease,
    opacity 120ms ease;
}

.phase9d-button {
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.phase9d-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.phase9d-button-primary {
  border-color: #18364a;
  background: #18364a;
  color: #ffffff;
}

.phase9d-button-primary:not(:disabled):hover {
  background: #244b62;
  border-color: #244b62;
}

.phase9d-button-secondary {
  border-color: #cbd7dd;
  background: #ffffff;
  color: #274657;
}

.phase9d-button-secondary:not(:disabled):hover {
  border-color: #91a8b4;
  background: #f7fafb;
}

.phase9d-button-danger {
  border-color: #e5c6c6;
  background: #fffafa;
  color: #9a3f3f;
}

.phase9d-button-danger:not(:disabled):hover {
  border-color: #cf9f9f;
  background: #fff3f3;
}

.phase9d-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
  width: 100%;
  padding-top: 10px;
  margin-top: 10px;
  border-top: 1px solid #edf1f3;
}

.phase9d-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(20, 35, 44, 0.46);
}

.phase9d-dialog {
  width: min(720px, 100%);
  max-height: min(720px, calc(100vh - 48px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #d8e1e5;
  border-radius: 18px;
  background: #ffffff;
  box-shadow:
    0 24px 70px rgba(16, 38, 52, 0.22);
}

.phase9d-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid #e7edef;
}

.phase9d-dialog-header h3 {
  margin: 0;
  color: #18364a;
  font-size: 19px;
}

.phase9d-dialog-header p {
  margin: 5px 0 0;
  color: #6c7e88;
  font-size: 13px;
  line-height: 1.45;
}

.phase9d-icon-button {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: transparent;
  color: #607580;
  font-size: 23px;
  line-height: 1;
}

.phase9d-icon-button:hover {
  background: #f1f5f6;
}

.phase9d-dialog-body {
  display: grid;
  gap: 10px;
  overflow-y: auto;
  padding: 16px 22px 22px;
}

.phase9d-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 15px;
  border: 1px solid #e0e7ea;
  border-radius: 12px;
  background: #ffffff;
}

.phase9d-option-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.phase9d-option-main strong {
  overflow: hidden;
  color: #213f51;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.phase9d-option-main span {
  color: #617782;
  font-size: 12px;
}

.phase9d-option-main small {
  color: #8a979e;
  font-size: 11px;
}

.phase9d-empty {
  padding: 28px 20px;
  border: 1px dashed #cad6dc;
  border-radius: 12px;
  background: #fafcfc;
  color: #6a7d87;
  text-align: center;
  font-size: 13px;
}


.phase9d-dialog-status {
  padding: 10px 12px;
  border: 1px solid #e5c6c6;
  border-radius: 10px;
  background: #fff5f5;
  color: #983f3f;
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 720px) {
  .phase9d-toolbar {
    align-items: stretch;
  }

  .phase9d-toolbar-actions {
    width: 100%;
  }

  .phase9d-toolbar-actions .phase9d-button {
    width: 100%;
  }

  .phase9d-overlay {
    padding: 12px;
  }

  .phase9d-dialog {
    max-height: calc(100vh - 24px);
  }

  .phase9d-option {
    align-items: stretch;
    flex-direction: column;
  }

  .phase9d-option .phase9d-button {
    width: 100%;
  }

  .phase9d-card-actions {
    justify-content: stretch;
  }

  .phase9d-card-actions .phase9d-button {
    flex: 1;
  }
}

/*
 * Phase 9D keyboard focus visibility.
 *
 * Browser QA confirmed focus moves correctly through modal actions,
 * but primary buttons did not expose a sufficiently visible focus state.
 */
.phase9d-button:focus-visible,
.phase9d-icon-button:focus-visible {
  outline: 3px solid #2d6cdf;
  outline-offset: 3px;
}
