/* biome-ignore-all lint/style/noDescendingSpecificity: component scopes intentionally isolate the workspace cascade. */
.customer-workspace {
  --customer-accent: #c58b32;
  --customer-deep: #173a40;
  --customer-ink: #22373a;
  --customer-line: #d7d5cb;
  --customer-paper: #f7f4eb;
  background:
    linear-gradient(90deg, rgb(23 58 64 / 4%) 1px, transparent 1px) 0 0 / 34px
    34px,
    var(--customer-paper);
  border: 1px solid #c7d1ce;
  border-radius: 22px;
  box-shadow: 0 20px 55px rgb(23 58 64 / 10%);
  margin-top: 20px;
  overflow: hidden;
}

.customer-workspace-hero {
  align-items: center;
  background: var(--customer-deep);
  color: #fffdf8;
  display: grid;
  gap: 20px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 28px 30px;
  position: relative;
}

.customer-workspace-hero::after {
  border: 1px solid rgb(255 255 255 / 14%);
  content: "";
  inset: 10px;
  pointer-events: none;
  position: absolute;
}

.customer-monogram {
  align-items: center;
  border: 1px solid rgb(255 255 255 / 48%);
  color: #f0d69a;
  display: flex;
  font-family: var(--serif);
  font-size: 24px;
  height: 62px;
  justify-content: center;
  letter-spacing: 0.08em;
  width: 62px;
}

.customer-workspace-hero p,
.customer-role-block > header p,
.customer-section-title p,
.customer-unassigned > header p,
.customer-profile-editor header p {
  color: var(--customer-accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  margin: 0 0 5px;
}

.customer-workspace-hero h1 {
  font-family: var(--serif);
  font-size: clamp(25px, 3vw, 38px);
  font-weight: 600;
  margin: 0 0 5px;
}

.customer-workspace-hero > div > span {
  color: rgb(255 255 255 / 68%);
  font-size: 13px;
}

.customer-completeness {
  display: grid;
  gap: 4px;
  min-width: 150px;
  position: relative;
  text-align: right;
  z-index: 1;
}

.customer-completeness strong {
  color: #f0d69a;
  font-family: var(--serif);
  font-size: 34px;
  line-height: 1;
}

.customer-completeness strong small {
  font-family: var(--sans);
  font-size: 13px;
}

.customer-completeness span {
  color: rgb(255 255 255 / 72%);
  font-size: 12px;
}

.customer-completeness i,
.admin-completeness i {
  background: rgb(255 255 255 / 14%);
  display: block;
  height: 3px;
  margin-top: 5px;
  overflow: hidden;
}

.customer-completeness i b,
.admin-completeness i b {
  background: var(--customer-accent, #c58b32);
  display: block;
  height: 100%;
}

.customer-completeness.is-complete strong,
.customer-completeness.is-complete i b {
  color: #a9d8bd;
}

.customer-completeness.is-complete i b {
  background: #7ec49a;
}

.customer-workspace-nav {
  background: #fffdf8;
  border-bottom: 1px solid var(--customer-line);
  display: flex;
  gap: 2px;
  overflow-x: auto;
  padding: 0 24px;
}

.customer-workspace-nav button {
  background: transparent;
  border-bottom: 3px solid transparent;
  color: #5f6c6c;
  cursor: pointer;
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 700;
  padding: 17px 14px 14px;
}

.customer-workspace-nav button:hover,
.customer-workspace-nav button:focus-visible,
.customer-workspace-nav button.active {
  border-bottom-color: var(--customer-accent);
  color: var(--customer-deep);
  outline: none;
}

.customer-workspace-nav button b {
  background: #ad543e;
  border-radius: 999px;
  color: #fff;
  font-size: 10px;
  margin-left: 6px;
  padding: 2px 6px;
}

.customer-workspace-body {
  min-height: 380px;
  padding: 28px;
}

.customer-section-title,
.customer-role-block > header,
.customer-unassigned > header {
  align-items: end;
  border-bottom: 1px solid var(--customer-line);
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 15px;
}

.customer-section-title h2,
.customer-role-block > header h2,
.customer-unassigned > header h3 {
  color: var(--customer-deep);
  font-family: var(--serif);
  margin: 0;
}

.customer-section-title > span,
.customer-role-block > header div > span {
  color: #71807e;
  font-size: 12px;
}

.customer-basic-form,
.customer-role-block,
.customer-profile-editor,
.customer-candidate-card,
.customer-trade-summary article {
  background: #fffdf8;
  border: 1px solid var(--customer-line);
}

.customer-basic-form {
  padding: 24px;
}

.customer-basic-form > footer,
.customer-profile-editor > footer {
  border-top: 1px solid var(--customer-line);
  margin-top: 20px;
  padding-top: 18px;
}

.customer-profile-fields {
  display: grid;
  gap: 15px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.customer-profile-fields label,
.customer-candidate-actions label {
  display: grid;
  gap: 6px;
}

.customer-profile-fields label > span,
.customer-candidate-actions label > span {
  color: #506462;
  font-size: 12px;
  font-weight: 700;
}

.customer-profile-fields input,
.customer-profile-fields select,
.customer-profile-fields textarea,
.customer-candidate-actions input,
.customer-candidate-actions select {
  background: #fff;
  border: 1px solid #bfcac6;
  border-radius: 7px;
  min-width: 0;
  padding: 10px 11px;
  width: 100%;
}

.customer-profile-fields input:focus,
.customer-profile-fields select:focus,
.customer-profile-fields textarea:focus,
.customer-candidate-actions input:focus,
.customer-candidate-actions select:focus {
  border-color: #2d7277;
  box-shadow: 0 0 0 3px rgb(45 114 119 / 13%);
  outline: none;
}

.customer-profile-fields textarea {
  min-height: 88px;
  resize: vertical;
}

.customer-field-wide {
  grid-column: span 2;
}

.customer-profile-fields .customer-check,
.customer-candidate-actions .customer-check {
  align-items: center;
  align-self: end;
  display: flex;
  grid-template-columns: auto 1fr;
  min-height: 42px;
}

.customer-check input {
  accent-color: var(--customer-deep);
  width: auto;
}

.customer-role-block {
  margin-bottom: 22px;
  padding: 22px;
}

.customer-profile-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.customer-profile-card {
  background: #fff;
  border: 1px solid #cbd3cf;
  border-left: 4px solid #2f7467;
  padding: 18px;
}

.customer-profile-card.is-inactive {
  border-left-color: #a8aaa5;
  opacity: 0.72;
}

.customer-profile-card > header {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.customer-profile-card header span {
  color: #75817f;
  font-size: 11px;
  font-weight: 700;
}

.customer-profile-card h3 {
  color: var(--customer-deep);
  font-family: var(--serif);
  font-size: 18px;
  margin: 3px 0;
}

.customer-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: end;
}

.customer-badges b {
  background: #e9eeeb;
  color: #556563;
  font-size: 10px;
  padding: 4px 7px;
}

.customer-badges b.is-default {
  background: #f1dfb7;
  color: #815b1f;
}

.customer-profile-card address {
  color: #52615f;
  font-size: 13px;
  font-style: normal;
  line-height: 1.55;
  margin: 14px 0;
  min-height: 40px;
  white-space: pre-line;
}

.customer-profile-card dl {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}

.customer-profile-card dl div {
  border-top: 1px solid #edf0ed;
  padding-top: 8px;
}

.customer-profile-card dt {
  color: #87918f;
  font-size: 10px;
  text-transform: uppercase;
}

.customer-profile-card dd {
  color: #344744;
  font-size: 12px;
  margin: 2px 0 0;
}

.customer-profile-card footer {
  align-items: center;
  border-top: 1px solid #e1e5e1;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 15px;
  padding-top: 12px;
}

.customer-profile-card footer button {
  background: transparent;
  color: #24666c;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 0;
}

.customer-profile-card footer button + button::before {
  color: #b5bfbc;
  content: "·";
  margin-right: 7px;
}

.customer-profile-card footer small {
  color: #8b9592;
  margin-left: auto;
}

.customer-profile-editor {
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
  bottom: 0;
  box-shadow: 0 -20px 60px rgb(10 37 40 / 22%);
  left: max(14px, calc(50% - 500px));
  max-height: min(88vh, 920px);
  overflow: auto;
  padding: 22px;
  position: fixed;
  width: min(calc(100% - 28px), 1000px);
  z-index: 100;
}

.customer-profile-editor > header {
  align-items: center;
  border-bottom: 1px solid var(--customer-line);
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 13px;
}

.customer-profile-editor h3 {
  color: var(--customer-deep);
  font-family: var(--serif);
  font-size: 23px;
  margin: 0;
}

.customer-profile-editor > footer {
  display: flex;
  gap: 10px;
}

.customer-icon-button {
  background: #edf1ed;
  border-radius: 50%;
  color: #52615f;
  cursor: pointer;
  font-size: 24px;
  height: 38px;
  line-height: 1;
  width: 38px;
}

.customer-data-boundary {
  background: #eef3ef;
  border-left: 3px solid #2f7467;
  display: grid;
  gap: 3px;
  margin: 0 0 18px;
  padding: 12px 14px;
}

.customer-data-boundary b {
  color: var(--customer-deep);
  font-size: 12px;
}

.customer-data-boundary span {
  color: #647572;
  font-size: 12px;
  line-height: 1.5;
}

.customer-trade-summary {
  display: grid;
  gap: 13px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.customer-trade-summary article {
  display: grid;
  gap: 7px;
  min-height: 135px;
  padding: 18px;
}

.customer-trade-summary span,
.customer-trade-summary small {
  color: #75817f;
  font-size: 11px;
}

.customer-trade-summary strong {
  color: var(--customer-deep);
  font-family: var(--serif);
  font-size: 18px;
}

.customer-candidate-list {
  display: grid;
  gap: 16px;
}

.customer-candidate-card {
  padding: 20px;
}

.customer-candidate-card > header {
  align-items: start;
  display: flex;
  gap: 20px;
  justify-content: space-between;
}

.customer-candidate-card > header span {
  background: #e4ece7;
  color: #315f5b;
  font-size: 10px;
  font-weight: 800;
  padding: 4px 7px;
}

.customer-candidate-card h3 {
  color: var(--customer-deep);
  font-family: var(--serif);
  margin: 8px 0 4px;
}

.customer-candidate-card > header small {
  color: #7c8885;
}

.customer-candidate-card > header > strong {
  color: #a56e1f;
  font-family: var(--serif);
  font-size: 28px;
  text-align: right;
}

.customer-candidate-card > header > strong small {
  display: block;
  font-family: var(--sans);
  font-size: 10px;
}

.customer-candidate-table {
  overflow: auto;
}

.customer-candidate-table table {
  border-collapse: collapse;
  margin: 16px 0;
  min-width: 640px;
  width: 100%;
}

.customer-candidate-table th,
.customer-candidate-table td {
  border-bottom: 1px solid #e1e5e1;
  font-size: 12px;
  padding: 9px 10px;
  text-align: left;
}

.customer-candidate-table thead th {
  background: #edf1ed;
  color: #536562;
}

.customer-candidate-table tr.is-changed td:last-child {
  background: #fff3d9;
  color: #76511a;
  font-weight: 700;
}

.customer-candidate-card details {
  border-bottom: 1px solid #e1e5e1;
  color: #5d6b69;
  font-size: 12px;
  margin-bottom: 16px;
  padding-bottom: 13px;
}

.customer-candidate-card summary {
  cursor: pointer;
  font-weight: 700;
}

.customer-candidate-card details p {
  display: grid;
  gap: 2px;
  margin: 10px 0 0;
}

.customer-candidate-actions {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(220px, 1fr) minmax(190px, 0.7fr) auto;
}

.customer-candidate-actions > div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  grid-column: 1 / -1;
}

.customer-unassigned {
  border-top: 3px double #c5c7be;
  margin-top: 30px;
  padding-top: 24px;
}

.customer-unassigned > .customer-candidate-card + .customer-candidate-card {
  margin-top: 15px;
}

.customer-history article {
  display: grid;
  gap: 13px;
  grid-template-columns: 15px minmax(0, 1fr);
  min-height: 90px;
}

.customer-history article > i {
  border-left: 1px solid #bac7c2;
  margin-left: 5px;
  position: relative;
}

.customer-history article > i::before {
  background: var(--customer-accent);
  border: 3px solid var(--customer-paper);
  border-radius: 50%;
  content: "";
  height: 11px;
  left: -6px;
  position: absolute;
  top: 0;
  width: 11px;
}

.customer-history header {
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.customer-history b {
  color: var(--customer-deep);
}

.customer-history time,
.customer-history small {
  color: #7a8784;
  font-size: 11px;
}

.customer-history p {
  color: #52615f;
  margin: 7px 0;
}

.customer-section-empty,
.customer-workspace-loading {
  align-items: center;
  background: #fffdf8;
  border: 1px dashed #bdc7c3;
  display: flex;
  flex-direction: column;
  gap: 7px;
  justify-content: center;
  min-height: 170px;
  padding: 30px;
  text-align: center;
}

.customer-section-empty b {
  color: var(--customer-deep);
}

.customer-section-empty span,
.customer-workspace-loading p {
  color: #71807e;
  margin: 0;
}

.customer-workspace-loading span {
  animation: customer-pulse 900ms ease-in-out infinite alternate;
  background: var(--customer-accent);
  height: 3px;
  width: 80px;
}

.customer-conflict {
  align-items: center;
  background: #fff0dc;
  border-bottom: 1px solid #e3bf86;
  color: #704c1a;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  padding: 14px 28px;
}

.customer-conflict > div {
  display: grid;
  gap: 3px;
}

.customer-conflict span {
  font-size: 12px;
}

.admin-customer-directory {
  display: grid;
  gap: 0;
  min-width: 0;
  width: 100%;
}

.admin-customer-directory > *,
#customer-master-workspace,
.customer-workspace {
  max-width: 100%;
  min-width: 0;
  width: 100%;
}

.admin-customer-directory > .admin-panel {
  overflow: hidden;
}

.admin-customer-directory .admin-table-wrap {
  max-width: 100%;
  min-width: 0;
  width: 100%;
}

.admin-completeness {
  align-items: center;
  display: flex;
  gap: 7px;
  white-space: nowrap;
}

.admin-completeness i {
  background: #dce4e1;
  width: 42px;
}

.admin-pending-count {
  background: #a9503d;
  border-radius: 999px;
  color: #fff;
  display: inline-block;
  font-size: 11px;
  min-width: 22px;
  padding: 3px 7px;
  text-align: center;
}

@keyframes customer-pulse {
  to {
    opacity: 0.35;
    transform: scaleX(0.45);
  }
}

@media (max-width: 900px) {
  .customer-profile-grid,
  .customer-trade-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .customer-candidate-actions {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 620px) {
  .customer-workspace-hero {
    grid-template-columns: auto 1fr;
    padding: 24px 20px;
  }

  .customer-completeness {
    grid-column: 1 / -1;
    text-align: left;
  }

  .customer-workspace-body {
    padding: 16px;
  }

  .customer-profile-fields,
  .customer-profile-grid,
  .customer-trade-summary,
  .customer-candidate-actions {
    grid-template-columns: 1fr;
  }

  .customer-field-wide {
    grid-column: auto;
  }

  .customer-section-title,
  .customer-role-block > header {
    align-items: start;
    flex-direction: column;
    gap: 12px;
  }

  .customer-candidate-card > header {
    flex-direction: column;
  }

  .customer-candidate-card > header > strong {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  .customer-workspace-loading span {
    animation: none;
  }
}
