:root {
  --ink: #26322b;
  --muted: #65736a;
  --green: #218a44;
  --green2: #176f38;
  --deep: #17392d;
  --pale: #eff8f1;
  --line: #e3eae4;
  --danger: #b42318;
  --bg: #f5f8f5;
}

.brand-mark {
  overflow: hidden;
  border: 0;
  border-radius: 50%;
  background: transparent;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.3);
}

.form-admin-shell {
  width: min(1120px, calc(100% - 28px));
  margin: 28px auto 48px;
}

.form-admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 4px 24px;
}

.form-admin-header .brand {
  min-width: 0;
  margin: 0;
}

.brand-copy {
  min-width: 0;
}

.company-name-zh {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
}

.company-name-en {
  overflow-wrap: anywhere;
  font-family: "Times New Roman", serif;
  font-size: 12.5px;
  line-height: 1.3;
}

.form-admin-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-admin-actions .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: #fff;
  text-decoration: none;
}

.form-admin-actions .button:hover {
  border-color: #a8cdb0;
  color: var(--green);
  background: var(--pale);
}

.form-admin-actions > a.button.ghost {
  color: var(--muted);
}

.form-card-actions,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
}

.form-card-actions {
  flex: 0 0 auto;
}

.form-card-actions .secondary-button,
.form-card-actions .danger-button,
.dialog-actions .secondary-button {
  min-height: 36px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: #fff;
  cursor: pointer;
}

.form-card-actions .danger-button {
  border-color: #efc8c5;
  color: var(--danger);
}

.form-card-actions .secondary-button:hover,
.dialog-actions .secondary-button:hover {
  border-color: #a8cdb0;
  color: var(--green);
  background: var(--pale);
}

.form-card-actions .aml-action-button {
  border-color: #b9d9c0;
  color: var(--green2);
  background: #f5fbf6;
}

.form-card-actions .assessment-primary-action {
  border-color: var(--green2);
  color: #fff;
  background: var(--green2);
  box-shadow: 0 3px 8px rgb(23 111 56 / 16%);
  font-weight: 800;
}

.form-card-actions .assessment-primary-action:hover {
  border-color: #0f5d2d;
  color: #fff;
  background: #0f5d2d;
  transform: translateY(-1px);
}

.form-card-actions .assessment-pending-action {
  border-color: #38658f;
  background: #38658f;
  box-shadow: 0 3px 8px rgb(56 101 143 / 18%);
}

.form-card-actions .assessment-pending-action:hover {
  border-color: #294e70;
  background: #294e70;
}

.form-card-actions .danger-button:hover {
  background: #fff0ee;
}

.form-admin-shell input:focus {
  outline: 3px solid rgba(33, 138, 68, 0.14);
  border-color: var(--green);
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 54px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 7px;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  padding: 8px;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  transform: translateY(-50%);
}

.password-toggle:hover {
  color: var(--green);
  background: var(--pale);
}

.password-toggle:focus-visible {
  outline: 3px solid rgba(33, 138, 68, 0.2);
  outline-offset: 1px;
}

.password-toggle svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.password-toggle .eye-slash {
  opacity: 0;
}

.password-toggle[aria-pressed="true"] .eye-slash {
  opacity: 1;
}

.form-admin-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  overflow: hidden;
  margin-bottom: 18px;
  padding: clamp(24px, 5vw, 42px);
  border-radius: 22px;
  color: #fff;
  background: linear-gradient(128deg, var(--deep), var(--green));
  box-shadow: 0 18px 48px rgba(23, 57, 45, 0.14);
}

.form-admin-hero::after {
  position: absolute;
  right: -55px;
  bottom: -90px;
  width: 250px;
  height: 250px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  box-shadow: 0 0 0 24px rgba(255, 255, 255, 0.05), 0 0 0 48px rgba(255, 255, 255, 0.03);
  content: "";
}

.form-admin-hero .eyebrow {
  color: #c6edcd;
}

.form-admin-hero h1 {
  position: relative;
  z-index: 1;
  margin: 0 0 8px;
  font-size: clamp(28px, 5vw, 42px);
}

.form-admin-hero p:last-child {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
}

.form-admin-hero-mark {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  flex: 0 0 112px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 30px;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.12);
  font-family: "Times New Roman", serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.12em;
  transform: rotate(6deg);
}

.form-admin-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.form-admin-stats article {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 10px 28px rgba(24, 54, 47, 0.05);
}

.form-admin-stats span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.form-admin-stats strong {
  color: var(--green);
  font-size: 27px;
}

.form-admin-panel {
  padding: clamp(20px, 4vw, 30px);
}

.form-admin-toolbar {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.form-admin-toolbar--forms {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) minmax(260px, 320px);
  align-items: end;
}

.form-admin-toolbar--forms .compact-filter,
.form-admin-toolbar--forms .compact-search {
  margin: 0;
}

.form-admin-toolbar-title {
  min-width: 0;
}

.form-admin-toolbar h2 {
  margin: 0 0 4px;
  font-size: 24px;
}

.form-admin-toolbar .eyebrow {
  margin-bottom: 2px;
}

.form-search {
  display: block;
  margin-bottom: 18px;
}

.form-search span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.form-search input {
  max-width: 520px;
}

.form-list {
  display: grid;
  gap: 10px;
}

.form-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfdfc;
}

.form-card h3 {
  margin: 0 0 3px;
  color: var(--ink);
  font-size: 17px;
}

.form-card .english-name {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 13px;
}

.form-card .business-nature {
  margin: 0 0 7px;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}

.form-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.form-card-status {
  display: inline-flex;
  margin-top: 9px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #875b14;
  background: #fff3d4;
  font-size: 11px;
  font-weight: 800;
}

.form-card-statuses {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.form-card-status.decision-accepted {
  color: #176f38;
  background: #eaf6ed;
}

.form-card-status.decision-rejected {
  color: #9a3f37;
  background: #fff0ee;
}

.form-card-status.decision-pending-decision {
  color: #715f2d;
  background: #fff7df;
}

.form-card-status.done {
  color: var(--green);
  background: var(--pale);
}

.empty-form-list {
  margin: 0;
  padding: 42px 20px;
  border: 1px dashed var(--line);
  border-radius: 13px;
  color: var(--muted);
  text-align: center;
}

.form-dialog {
  width: min(960px, calc(100% - 28px));
  max-height: calc(100% - 28px);
  padding: 0;
  overflow: hidden;
}

.form-dialog .dialog-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
}

.form-dialog .dialog-head h2 {
  margin: 0;
  overflow: hidden;
  font-size: 21px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form-dialog-body {
  display: grid;
  gap: 16px;
  max-height: calc(100vh - 104px);
  padding: 20px;
  overflow: auto;
}

.form-detail-section {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}

.form-detail-section h3 {
  margin: 0;
  padding: 12px 14px;
  color: var(--green);
  background: var(--pale);
  font-size: 16px;
}

.form-detail-section table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.form-detail-section th,
.form-detail-section td {
  padding: 9px 12px;
  border-top: 1px solid var(--line);
  vertical-align: top;
  overflow-wrap: anywhere;
  text-align: left;
  font-size: 13px;
}

.form-detail-section th {
  width: 34%;
  color: var(--muted);
  font-weight: 700;
}

.form-detail-section ul {
  margin: 0;
  padding: 13px 28px 14px;
}

.form-detail-section li + li {
  margin-top: 8px;
}

.form-detail-section a {
  color: var(--green);
  overflow-wrap: anywhere;
}

@media (max-width: 680px) {
  .form-admin-shell {
    width: min(100% - 20px, 1120px);
    margin-top: 18px;
  }

  .form-admin-header,
  .form-admin-toolbar,
  .form-card {
    align-items: stretch;
    flex-direction: column;
  }

  .form-admin-header,
  .form-admin-toolbar {
    display: flex;
  }

  .company-name-en {
    font-size: 12px;
  }

  .form-admin-actions {
    justify-content: flex-end;
  }

  .form-admin-hero {
    align-items: start;
    flex-direction: column;
  }

  .form-admin-hero-mark {
    width: 82px;
    height: 58px;
    flex-basis: 58px;
    border-radius: 19px;
    font-size: 16px;
  }

  .form-admin-stats {
    gap: 8px;
  }

  .form-admin-stats article {
    display: block;
    padding: 13px;
  }

  .form-admin-stats strong {
    display: block;
    margin-top: 5px;
    font-size: 22px;
  }

  .form-card .secondary-button {
    width: 100%;
  }

  .form-dialog {
    width: calc(100% - 18px);
    max-height: calc(100% - 18px);
  }

  .form-dialog-body {
    padding: 12px;
  }

  .form-detail-section th,
  .form-detail-section td {
    padding: 8px;
    font-size: 12px;
  }
}

