/* 员工档案中的管理层／普通员工分区。 */

.management-directory {
  margin-top: 20px;
  padding: 18px;
  border: 1px solid rgba(90, 44, 245, 0.13);
  border-radius: 8px;
  background: linear-gradient(135deg, #f3f0ff 0%, #faf9ff 100%);
}

.directory-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.directory-index {
  display: block;
  margin-bottom: 5px;
  color: #6945ed;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.08em;
}

.directory-section-heading h3 {
  margin: 0;
  color: #1f1940;
  font-size: 18px;
  line-height: 1.25;
}

.directory-section-heading p {
  margin: 0;
  color: #77708f;
  font-size: 11px;
}

.directory-heading-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.employee-directory-actions {
  display: grid;
  min-width: 310px;
  align-items: stretch;
}

.employee-add-button {
  width: 100%;
  min-height: 40px;
}

.employee-template-download {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px dashed #8ba9df;
  background: #f5f8ff;
  color: #2257b7;
  font-weight: 700;
}

.employee-template-download:hover {
  border-color: #3169cf;
  background: #eaf1ff;
  color: #17499f;
}

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

.management-card {
  position: relative;
  display: grid;
  grid-template-columns: 48px 78px minmax(0, 1fr) auto;
  min-height: 128px;
  align-items: center;
  gap: 14px;
  padding: 16px;
  overflow: hidden;
  border: 1px solid rgba(90, 44, 245, 0.12);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(52, 40, 116, 0.08);
}

.management-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: #5a2cf5;
}

.management-admin {
  grid-column: 1 / -1;
  border-color: rgba(70, 35, 190, 0.2);
  background: linear-gradient(135deg, #ede8ff 0%, #fff 56%);
  box-shadow: 0 12px 30px rgba(64, 39, 154, 0.12);
}

.management-admin::before {
  width: 6px;
  background: linear-gradient(180deg, #3920a5 0%, #7344ff 100%);
}

.management-secondary::before {
  background: #3c79dc;
}

.management-order {
  display: grid;
  align-content: center;
  align-self: stretch;
  padding-right: 10px;
  border-right: 1px solid #ebe8f8;
}

.management-order span {
  color: #5a2cf5;
  font-size: 23px;
  font-weight: 800;
  line-height: 1;
}

.management-secondary .management-order span {
  color: #3c79dc;
}

.management-admin .management-order span {
  color: #4321bf;
}

.management-order small {
  margin-top: 7px;
  color: #9b96b0;
  font-size: 8px;
  line-height: 1.35;
}

.management-photo {
  display: flex;
  width: 78px;
  height: 78px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 24%;
  background: #ece9fb;
  box-shadow: 0 0 0 4px #fff, 0 0 0 5px rgba(90, 44, 245, 0.14);
}

.management-photo.photo-placeholder .avatar-placeholder-icon {
  color: #8e7ee6;
}

.management-copy {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.management-role-tag {
  width: max-content;
  padding: 4px 7px;
  color: #5a2cf5;
  border-radius: 4px;
  background: #eeeaff;
  font-size: 9px;
  font-weight: 750;
}

.management-secondary .management-role-tag {
  color: #2d67c5;
  background: #eaf2ff;
}

.management-admin .management-role-tag {
  color: #fff;
  background: #4f27d5;
}

.management-copy strong {
  overflow: hidden;
  color: #171331;
  font-size: 21px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.management-copy small {
  color: #77708f;
  font-size: 10px;
}

.management-capabilities {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 12px;
  margin: 6px 0 0;
  padding-top: 8px;
  border-top: 1px solid #ece9f7;
}

.management-capabilities > div {
  min-width: 0;
}

.management-capabilities dt,
.employee-capability-grid dt,
.intern-capabilities dt {
  color: #938ca8;
  font-size: 8px;
  line-height: 1.35;
}

.management-capabilities dd,
.employee-capability-grid dd,
.intern-capabilities dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  color: #2e2941;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.45;
}

.management-edit-button {
  align-self: end;
  min-height: 32px;
  padding: 0 10px;
  color: #5a2cf5;
  border: 1px solid rgba(90, 44, 245, 0.15);
  border-radius: 5px;
  background: #f3f0ff;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.management-edit-button:hover {
  color: #fff;
  background: #5a2cf5;
}

.management-admin-lock {
  align-self: end;
  padding: 7px 9px;
  color: #77708f;
  border: 1px solid #dfdbea;
  border-radius: 5px;
  background: #f3f1f8;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.intern-directory {
  margin-top: 20px;
  padding: 18px;
  border: 1px solid rgba(221, 145, 37, 0.2);
  border-radius: 8px;
  background: linear-gradient(135deg, #fff8e9 0%, #fffdf8 100%);
}

.intern-heading .directory-index {
  color: #ad6c13;
}

.intern-heading strong {
  padding: 6px 10px;
  color: #9a5f0e;
  border-radius: 4px;
  background: #fff0cd;
  font-size: 11px;
}

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

.intern-card {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 13px 15px;
  padding: 14px;
  border: 1px solid rgba(207, 136, 35, 0.18);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 9px 22px rgba(114, 78, 28, 0.07);
}

.intern-card.is-eligible {
  border-color: rgba(38, 151, 102, 0.28);
  box-shadow: 0 9px 24px rgba(32, 128, 86, 0.1);
}

.intern-card-topline {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f0e8d9;
  color: #9a6a29;
  font-size: 9px;
  font-weight: 700;
}

.intern-card-topline b {
  color: #8d5b17;
}

.intern-card.is-eligible .intern-card-topline b {
  color: #23825c;
}

.intern-card-photo {
  display: flex;
  width: 72px;
  height: 72px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 24%;
  background: #fff0cf;
  box-shadow: 0 0 0 4px #fff, 0 0 0 5px rgba(205, 132, 29, 0.17);
}

.intern-card-photo.photo-placeholder .avatar-placeholder-icon {
  color: #c08430;
}

.intern-person-copy {
  display: grid;
  min-width: 0;
  align-content: center;
  gap: 4px;
}

.intern-role-tag {
  width: max-content;
  padding: 4px 7px;
  color: #9a600f;
  border-radius: 4px;
  background: #fff0cf;
  font-size: 9px;
  font-weight: 750;
}

.intern-person-copy strong {
  overflow: hidden;
  color: #241a0c;
  font-size: 19px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.intern-person-copy small {
  color: #86745c;
  font-size: 10px;
}

.intern-dates {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.intern-dates > div {
  padding: 9px 10px;
  border-radius: 5px;
  background: #fff9ec;
}

.intern-dates dt {
  color: #9c896f;
  font-size: 8px;
}

.intern-dates dd {
  margin: 4px 0 0;
  color: #6f4812;
  font-size: 10px;
  font-weight: 700;
}

.intern-capabilities {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.intern-capabilities > div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #f1e7d4;
  border-radius: 5px;
  background: #fffcf5;
}

.intern-capabilities .intern-capability-wide {
  grid-column: 1 / -1;
}

.intern-card-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 2px;
}

.intern-promote-button {
  min-height: 34px;
  margin-left: auto;
  color: #fff;
  background: #2b9369;
  box-shadow: none;
}

.intern-promote-button:hover:not(:disabled) {
  background: #237b58;
}

.intern-promote-button:disabled {
  color: #a38c6d;
  background: #f0e9dd;
  cursor: not-allowed;
  opacity: 1;
}

.intern-empty {
  grid-column: 1 / -1;
  padding: 18px;
  color: #8e7b61;
  border: 1px dashed rgba(185, 123, 36, 0.28);
  border-radius: 6px;
  text-align: center;
}

.intern-empty span {
  color: #76501b;
  font-weight: 700;
}

.intern-empty p {
  margin: 5px 0 0;
  font-size: 10px;
}

.ordinary-directory {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #e5e2f2;
}

.ordinary-heading strong {
  padding: 6px 10px;
  color: #5a2cf5;
  border-radius: 4px;
  background: #eeeaff;
  font-size: 11px;
}

.ordinary-directory .employee-card {
  grid-template-rows: auto 92px auto;
  min-height: 264px;
  align-content: start;
}

.employee-card-copy {
  min-width: 0;
}

.employee-card-role {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 7px;
  line-height: 1.5;
}

.employee-card-role span {
  color: #8e899b;
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.employee-capability-grid {
  grid-column: 1 / -1;
  grid-row: 3;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid #ddd8cc;
}

.employee-capability-grid > div {
  min-width: 0;
  padding: 9px 10px;
  border-left: 3px solid #175ca8;
  background: #f1eee6;
}

.employee-capability-grid .employee-capability-wide {
  grid-column: 1 / -1;
}

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

.employee-profile-fields > .field {
  min-width: 0;
  margin: 0;
}

.employee-profile-fields .employee-profile-wide {
  grid-column: 1 / -1;
}

#employee-role[readonly] {
  color: #68627d;
  background: #e9e7f2;
  cursor: not-allowed;
}

#setting-administrator[readonly] {
  color: #68627d;
  background: #e9e7f2;
  cursor: not-allowed;
}

.employee-employment-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 15px;
}

.employee-employment-fields > .field {
  margin: 0;
}

#employee-kind:disabled {
  color: #5e5874;
  background: #e9e7f2;
  opacity: 1;
}

#employee-kind:not(:disabled) {
  border-color: #72a0ed;
  background: #f4f8ff;
  color: #153b7d;
  font-weight: 700;
}

#employee-kind-help {
  color: #6f7891;
  line-height: 1.5;
}

.intern-period-preview {
  grid-column: 1 / -1;
  display: grid;
  gap: 4px;
  padding: 11px 13px;
  border-left: 3px solid #d79534;
  border-radius: 5px;
  background: #fff7e5;
}

.intern-period-preview span {
  color: #9d7b4e;
  font-size: 9px;
}

.intern-period-preview strong {
  color: #86530c;
  font-size: 14px;
}

.intern-period-preview small {
  color: #8e7b61;
  font-size: 9px;
  line-height: 1.5;
}

@media (max-width: 1180px) {
  .management-card {
    grid-template-columns: 42px 68px minmax(0, 1fr);
  }

  .management-photo {
    width: 68px;
    height: 68px;
  }

  .management-edit-button {
    grid-column: 2 / -1;
    justify-self: start;
  }

  .management-admin-lock {
    grid-column: 2 / -1;
    justify-self: start;
  }

  .management-capabilities {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .management-grid,
  .intern-grid {
    grid-template-columns: 1fr;
  }

  .directory-section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }
}

@media (max-width: 520px) {
  .management-directory {
    padding: 13px;
  }

  .management-card {
    grid-template-columns: 34px 58px minmax(0, 1fr);
    gap: 10px;
    padding: 13px;
  }

  .management-photo {
    width: 58px;
    height: 58px;
  }

  .management-copy strong {
    font-size: 18px;
  }

  .directory-heading-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .directory-heading-actions .button {
    flex: 1;
  }

  .employee-directory-actions {
    min-width: 0;
  }

  .intern-directory {
    padding: 13px;
  }

  .intern-dates,
  .intern-capabilities,
  .employee-employment-fields,
  .employee-profile-fields,
  .employee-capability-grid {
    grid-template-columns: 1fr;
  }

  .employee-profile-fields .employee-profile-wide,
  .employee-capability-grid .employee-capability-wide,
  .intern-capabilities .intern-capability-wide {
    grid-column: 1;
  }
}

@media print {
  .management-edit-button {
    display: none !important;
  }
}
