.admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 9px;
  color: #9c4a31;
  background: #fae6de;
  font-size: 12px;
  font-weight: 700;
}

.trash-toolbar {
  display: flex;
  min-height: 52px;
  margin-bottom: 14px;
  padding: 8px 12px;
  align-items: center;
  gap: 16px;
  color: #546467;
  background: rgba(255, 255, 255, .88);
  border: 1px solid rgba(27, 177, 200, .14);
  border-radius: 10px;
}

.trash-toolbar > span { flex: 1; }
.trash-toolbar .check-label { margin: 0; color: #1a2426; }
.danger-outline { color: #b42318 !important; border-color: rgba(180, 35, 24, .24) !important; }
.danger-outline:hover { background: rgba(180, 35, 24, .07) !important; }
.trash-table-card table { min-width: 850px; }
.trash-table-card th,
.trash-table-card td { vertical-align: middle; }
.trash-check-col { width: 48px; }
.trash-table-card input[type="checkbox"] { width: 17px; height: 17px; accent-color: #1bb1c8; }
.trash-item-summary strong,
.trash-item-summary small { display: block; }
.trash-item-summary small { margin-top: 4px; color: #88999c; }
.trash-preview-modal { max-width: 720px; }
.trash-preview-content { max-height: 58vh; padding: 22px 24px; overflow: auto; }
.trash-preview-content pre {
  margin: 0;
  padding: 16px;
  overflow: auto;
  color: #1a2426;
  background: #f7fcfd;
  border: 1px solid rgba(27, 177, 200, .14);
  border-radius: 10px;
  font: 12px/1.7 Consolas, "Microsoft YaHei", monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

.studio-api-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid rgba(27, 177, 200, .16);
  border-radius: 14px;
  background: rgba(255, 255, 255, .82);
  box-shadow: 0 2px 12px rgba(27, 177, 200, .06);
  backdrop-filter: saturate(105%) blur(20px);
}

.studio-api-toolbar label {
  display: grid;
  gap: 6px;
  justify-items: center;
  color: #546467;
  font-size: 12px;
}

.studio-api-toolbar input {
  min-width: 180px;
  height: 44px;
  padding: 0 12px;
  color: #1a2426;
  border: 1px solid rgba(27, 177, 200, .2);
  border-radius: 10px;
  background: #fff;
  font: inherit;
}

.studio-date-separator {
  display: grid;
  height: 44px;
  padding: 0;
  place-items: center;
  color: #546467;
  font-size: 14px;
}

.studio-api-state {
  margin-left: auto;
  display: flex;
  height: 44px;
  padding: 0;
  align-items: center;
  color: #546467;
  font-size: 14px;
}

.studio-api-state.is-success { color: #13845f; }
.studio-api-state.is-error { color: #c64141; }
.studio-api-state.is-loading { color: #127f91; }
.studio-fee-pending { color: #9a6a18; font-weight: 700; }
.studio-field-missing { color: #88999c; font-weight: 600; }
.studio-status-label { color: #127f91; font-weight: 700; white-space: nowrap; }

.studio-cost-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.asset-license-ledger { overflow-x: hidden; }
.asset-license-ledger table { width: 100%; min-width: 0; table-layout: fixed; }
.asset-license-ledger th,
.asset-license-ledger td { min-width: 0; padding-right: 10px; padding-left: 10px; text-align: left; vertical-align: middle; }
.asset-license-ledger th:nth-child(1) { width: 10%; }
.asset-license-ledger th:nth-child(2) { width: 10%; }
.asset-license-ledger th:nth-child(3) { width: 16%; }
.asset-license-ledger th:nth-child(4) { width: 9%; }
.asset-license-ledger th:nth-child(5) { width: 12%; }
.asset-license-ledger th:nth-child(6) { width: 15%; }
.asset-license-ledger th:nth-child(7) { width: 11%; }
.asset-license-ledger th:nth-child(8) { width: 13%; }
.asset-license-ledger th:nth-child(9),
.asset-license-ledger td:nth-child(9) { width: 44px; padding-right: 8px; padding-left: 4px; text-align: center; }
.asset-license-ledger .attachment-cell { min-width: 0; }
#assetLicenseTotal { font-size: 18px; line-height: 1.35; white-space: normal; }

.external-payment-section {
  margin-top: 28px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.external-payment-section .section-head { margin-bottom: 16px; }
.external-payment-section .section-head h2 { font-size: 18px; }
.external-payment-summary { margin-bottom: 18px; }
.external-payment-ledger table { min-width: 1180px; }
.external-payment-ledger th:nth-child(1) { width: 18%; }
.external-payment-ledger th:nth-child(2) { width: 12%; }
.external-payment-ledger th:nth-child(3) { width: 10%; }
.external-payment-ledger th:nth-child(4),
.external-payment-ledger th:nth-child(5) { width: 14%; }
.external-payment-ledger th:first-child,
.external-payment-ledger td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #fff;
  box-shadow: 1px 0 0 var(--line);
}
.external-payment-ledger th:first-child { z-index: 2; }
.external-payment-ledger .attachment-links { max-width: 190px; }
.external-payment-no-attachment { color: var(--muted); font-size: 12px; }

.external-payment-modal { width: min(760px, 100%); }
.external-payment-attachment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.external-payment-attachment-field {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  background: #f8fbfb;
}
.external-payment-attachment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.external-payment-attachment-head > span { color: var(--ink); font-weight: 700; }
.external-payment-attachment-head .text-btn { height: 28px; padding: 0 6px; }
.external-payment-attachment-field .attachment-cell { min-width: 0; }
.external-payment-attachment-field .attachment-links { margin-bottom: 8px; }

@media (max-width: 700px) {
  .external-payment-section .section-head { align-items: flex-start; gap: 12px; }
  .external-payment-attachment-grid { grid-template-columns: 1fr; }
}
.asset-license-row input,
.asset-license-row select {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  color: #1a2426;
  background: #fff;
  border: 1px solid rgba(27, 177, 200, .18);
  border-radius: 10px;
  outline: 0;
}
.asset-license-row .asset-license-delete { margin: 0 auto; }
.asset-license-row input:focus,
.asset-license-row select:focus { border-color: #1bb1c8; box-shadow: 0 0 0 3px rgba(27, 177, 200, .1); }

.website-credential-section { margin: 0 0 26px; }
.website-credential-section .section-head { margin-bottom: 12px; }
.website-credential-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.website-credential-add,
.website-credential-card {
  min-height: 176px;
  padding: 18px;
  border: 1px solid rgba(27, 177, 200, .16);
  border-radius: 10px;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 2px 12px rgba(27, 177, 200, .06);
}
.website-credential-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #546467;
  border-style: dashed;
  cursor: pointer;
  font: inherit;
}
.website-credential-add:hover { color: #127f91; border-color: #1bb1c8; background: rgba(27, 177, 200, .06); }
.website-credential-add i { width: 24px; height: 24px; color: #1bb1c8; }
.website-credential-add strong { color: #1a2426; font-size: 16px; }
.website-credential-add span { font-size: 12px; }
.website-credential-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  min-width: 0;
  overflow: hidden;
  align-content: space-between;
  gap: 14px;
  cursor: pointer;
  transition: border-color 180ms, box-shadow 180ms, transform 180ms, background 180ms;
}
.website-credential-card:hover,
.website-credential-card:focus-visible {
  border-color: #1bb1c8;
  background: #fff;
  box-shadow: 0 8px 24px rgba(27, 177, 200, .14);
  transform: translateY(-2px);
  outline: 0;
}
.website-credential-head { display: flex; width: 100%; min-width: 0; max-width: 100%; align-items: flex-start; gap: 10px; }
.website-credential-icon { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; color: #127f91; background: #eaf8fa; border-radius: 10px; }
.website-credential-icon i { width: 19px; height: 19px; }
.website-credential-title { width: 0; min-width: 0; flex: 1; }
.website-credential-title strong,
.website-credential-title a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.website-credential-title strong { color: #1a2426; font-size: 16px; }
.website-credential-title a { margin-top: 4px; color: #127f91; font-size: 12px; text-decoration: none; }
.website-credential-title span { display: block; margin-top: 4px; color: #88999c; font-size: 12px; }
.website-credential-body { display: grid; grid-template-columns: minmax(0, 1fr); width: 100%; min-width: 0; max-width: 100%; gap: 8px; overflow: hidden; }
.website-credential-line { display: flex; width: 100%; min-width: 0; max-width: 100%; min-height: 34px; overflow: hidden; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; background: #f7fcfd; border-radius: 8px; }
.website-credential-line > span { width: 0; min-width: 0; flex: 1; overflow: hidden; color: #546467; font: 12px "DM Mono", Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.website-credential-line .icon-btn { width: 28px; height: 28px; flex: 0 0 28px; padding: 6px; border-radius: 7px; }
.website-credential-line .icon-btn i { width: 14px; height: 14px; }
.website-credential-foot { display: flex; width: 100%; min-width: 0; max-width: 100%; overflow: hidden; align-items: center; gap: 5px; padding-top: 10px; border-top: 1px solid rgba(27, 177, 200, .1); }
.website-credential-foot small { width: 0; min-width: 0; flex: 1; overflow: hidden; color: #88999c; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.website-credential-foot .icon-btn { width: 32px; height: 32px; flex: 0 0 32px; }
.website-credential-empty { min-height: 176px; display: grid; place-items: center; color: #88999c; border: 1px dashed rgba(27, 177, 200, .18); border-radius: 10px; }

.credential-modal { max-width: 660px; }
.credential-password-input { position: relative; margin-top: 7px; }
.credential-password-input input { margin-top: 0; padding-right: 44px; }
.credential-password-input .icon-btn { position: absolute; top: 3px; right: 3px; width: 36px; height: 36px; }

.website-credential-preview-modal { width: min(720px, 100%); }
.website-credential-preview-content { display: grid; gap: 18px; padding: 24px 28px 28px; }
.website-credential-preview-site { display: grid; grid-template-columns: 46px minmax(0, 1fr); align-items: center; gap: 14px; }
.website-credential-preview-icon { display: grid; width: 46px; height: 46px; place-items: center; color: #127f91; background: #eaf8fa; border-radius: 10px; }
.website-credential-preview-icon i { width: 22px; height: 22px; }
.website-credential-preview-site span,
.website-credential-preview-note > span,
.website-credential-preview-label { display: block; color: #88999c; font-size: 12px; font-weight: 700; }
.website-credential-preview-site a,
.website-credential-preview-site div > span:last-child { display: block; margin-top: 6px; color: #127f91; font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; text-decoration: none; }
.website-credential-preview-credentials { display: grid; gap: 10px; }
.website-credential-preview-row { display: grid; grid-template-columns: 90px minmax(0, 1fr) auto; min-height: 52px; align-items: center; gap: 12px; padding: 8px 10px 8px 16px; background: #f7fcfd; border: 1px solid rgba(27, 177, 200, .1); border-radius: 10px; }
.website-credential-preview-value { min-width: 0; overflow: hidden; color: #546467; font: 14px/1.6 "DM Mono", Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.website-credential-preview-value.is-visible { color: #1a2426; white-space: normal; overflow-wrap: anywhere; }
.website-credential-preview-actions { display: flex; gap: 4px; }
.website-credential-preview-actions .icon-btn { width: 36px; height: 36px; border-radius: 8px; }
.website-credential-preview-note { padding: 16px; background: #fff; border: 1px solid rgba(27, 177, 200, .14); border-radius: 10px; }
.website-credential-preview-note p { margin: 8px 0 0; color: #1a2426; font-size: 14px; line-height: 1.8; overflow-wrap: anywhere; white-space: pre-wrap; }

@media (max-width: 560px) {
  .website-credential-preview-content { padding: 20px; }
  .website-credential-preview-row { grid-template-columns: 1fr auto; }
  .website-credential-preview-label { grid-column: 1 / -1; }
}

.asset-type-picker { position: relative; }
.asset-type-picker summary {
  min-height: 38px;
  padding: 9px 30px 9px 10px;
  overflow: hidden;
  color: #1a2426;
  background: #fff;
  border: 1px solid rgba(27, 177, 200, .18);
  border-radius: 10px;
  cursor: pointer;
  list-style: none;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.asset-type-picker summary::-webkit-details-marker { display: none; }
.asset-type-picker summary::after { content: '⌄'; position: absolute; top: 8px; right: 11px; color: #546467; }
.asset-type-options {
  display: grid;
  width: 100%;
  min-width: 170px;
  margin-top: 5px;
  padding: 7px;
  background: #fff;
  border: 1px solid rgba(27, 177, 200, .2);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(27, 177, 200, .14);
}
.asset-type-options label { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 5px 7px; border-radius: 8px; cursor: pointer; }
.asset-type-options label:hover { background: #eaf8fa; }
.asset-type-options input { width: 16px; min-width: 16px; height: 16px; margin: 0; accent-color: #1bb1c8; }

.outsource-frame-wrap {
  position: relative;
  min-height: 680px;
  overflow: hidden;
  border: 1px solid rgba(27, 177, 200, .16);
  border-radius: 14px;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 2px 12px rgba(27, 177, 200, .07);
}

.outsource-frame-wrap iframe {
  display: block;
  width: 100%;
  height: min(78vh, 980px);
  min-height: 680px;
  border: 0;
  background: #fff;
}

.outsource-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #546467;
}

.outsource-loading i { color: #1bb1c8; }
.outsource-loading strong { color: #1a2426; font-size: 18px; }
.outsource-loading span { font-size: 14px; }

.access-denied-modal { max-width: 520px; }
.access-denied-modal > p { margin: 0; padding: 24px; color: #546467; font-size: 16px; line-height: 1.8; }

@media (max-width: 760px) {
  .studio-api-toolbar { align-items: stretch; flex-direction: column; }
  .studio-api-toolbar input { width: 100%; }
  .studio-date-separator { display: none; }
  .studio-api-state { margin-left: 0; padding: 2px 0 0; }
  .outsource-frame-wrap, .outsource-frame-wrap iframe { min-height: 620px; }
}

.admin-badge i {
  width: 13px;
  height: 13px;
}

.permission-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -5px 0 20px;
  padding: 13px 16px;
  color: #276d53;
  background: #e6f2ec;
  border: 1px solid #d1e7dc;
}

.permission-strip > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.permission-strip i {
  width: 18px;
  height: 18px;
}

.permission-strip strong,
.permission-strip small {
  display: block;
}

.permission-strip strong {
  font-size: 12px;
}

.permission-strip small {
  margin-top: 2px;
  color: #648376;
  font-size: 12px;
}

.permission-strip > span {
  font: 500 12px "DM Mono", monospace;
  letter-spacing: .1em;
}

.notice-fields select {
  display: block;
  width: 100%;
  height: 38px;
  margin-top: 7px;
  padding: 0 10px;
  color: #17191c;
  background: #fafafa;
  border: 1px solid #e0e2e2;
  outline: 0;
}

.notice-fields select:focus {
  border-color: #ee6c42;
}

.person-card.is-added {
  position: relative;
  border-left: 2px solid #ee6c42;
  cursor: pointer;
  transition: border-color 180ms, box-shadow 180ms, transform 180ms, background 180ms, opacity 180ms;
}

.person-card.is-added:hover,
.person-card.is-added:focus-visible {
  border-color: #1bb1c8;
  background: #fff;
  box-shadow: 0 8px 24px rgba(27, 177, 200, .14);
  transform: translateY(-2px);
  outline: 0;
}

.person-card .member-meta {
  overflow: hidden;
}

.person-card .member-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person-card .member-rate {
  color: #17191c;
  white-space: nowrap;
}

#accessBadge,
#accessBadge *,
.permission-strip,
.permission-strip strong,
.permission-strip small,
.permission-strip > span {
  color: #ffffff !important;
}

.people-grid {
  display: block;
}

.member-category-group + .member-category-group { margin-top: 24px; }
.member-category-head { display: flex; min-height: 44px; margin-bottom: 12px; padding: 0 14px; align-items: center; justify-content: space-between; background: rgba(255, 255, 255, .72); border-left: 3px solid #1bb1c8; border-bottom: 1px solid rgba(27, 177, 200, .12); }
.member-category-head h3 { margin: 0; color: #1a2426; font-size: 18px; }
.member-category-head span { color: #56828b; font-size: 12px; font-weight: 700; }
.member-category-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }

@media (max-width: 1100px) {
  .member-category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.person-card.is-added {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: center;
}

.person-card.is-disabled {
  opacity: .58;
}

.member-meta small {
  display: block;
  margin-top: 5px;
  color: #546467;
  font-size: 12px;
}

.member-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  padding-top: 7px;
  border-top: 1px solid var(--line);
}

.member-actions .icon-btn,
.settlement-edit,
.settlement-delete {
  width: 36px;
  height: 36px;
}

.danger-action:hover {
  color: #d13c36 !important;
  background: #fff0ef !important;
}

.intro-actions a.outline-btn {
  text-decoration: none;
}

.template-card.dashed[type="button"] {
  width: 100%;
  font: inherit;
  text-align: center;
  cursor: pointer;
}

.template-card.dashed[type="button"]:hover {
  border-color: var(--accent);
  background: rgba(27, 177, 200, .06);
}

.member-modal form {
  margin: 0;
}

.member-preview-modal { width: min(720px, 100%); }
.member-preview-content { display: grid; gap: 18px; padding: 24px 28px 28px; }
.member-preview-hero { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 14px; }
.member-preview-hero .person-avatar { width: 48px; height: 48px; }
.member-preview-hero strong { display: block; color: #1a2426; font-size: 18px; }
.member-preview-hero span { display: block; margin-top: 5px; color: #546467; font-size: 14px; }
.member-preview-status { padding: 6px 10px; color: #198754; background: #e8f5ed; border-radius: 10px; font-size: 12px; }
.member-preview-status.is-disabled { color: #7d858b; background: #eef0f1; }
.member-preview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.member-preview-field { min-width: 0; padding: 14px 16px; background: #f7fcfd; border: 1px solid rgba(27, 177, 200, .1); border-radius: 10px; }
.member-preview-field span,
.member-preview-note > span { display: block; color: #88999c; font-size: 12px; font-weight: 700; }
.member-preview-field strong { display: block; margin-top: 7px; color: #1a2426; font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.member-preview-note { padding: 16px; background: #fff; border: 1px solid rgba(27, 177, 200, .14); border-radius: 10px; }
.member-preview-note p { margin: 8px 0 0; color: #1a2426; font-size: 14px; line-height: 1.8; overflow-wrap: anywhere; white-space: pre-wrap; }

@media (max-width: 560px) {
  .member-preview-content { padding: 20px; }
  .member-preview-hero { grid-template-columns: 48px minmax(0, 1fr); }
  .member-preview-status { grid-column: 2; justify-self: start; }
  .member-preview-grid { grid-template-columns: 1fr; }
  .member-category-grid { grid-template-columns: 1fr; }
}

.mobile-nav {
  display: none;
}

@media (max-width: 700px) {
  body {
    padding-bottom: 66px;
  }

  .admin-badge {
    display: none;
  }

  .mobile-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 18;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    height: 62px;
    padding-bottom: env(safe-area-inset-bottom);
    background: #181a1e;
    border-top: 1px solid #33363b;
  }

  .mobile-nav button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #858b93;
    background: transparent;
    border: 0;
    font-size: 12px;
  }

  .mobile-nav button.active {
    color: #fff;
  }

  .mobile-nav button.active i {
    color: #ee6c42;
  }

  .mobile-nav i {
    width: 17px;
    height: 17px;
  }

  .permission-strip {
    align-items: flex-start;
    gap: 12px;
  }

  .permission-strip > span {
    display: none;
  }

  .member-modal .notice-fields {
    gap: 11px;
    padding: 18px;
  }

  .member-modal .modal-head {
    padding: 18px;
  }

  .member-modal .modal-foot {
    position: sticky;
    bottom: 0;
    padding: 13px 18px;
    background: #fff;
  }

  .people-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .person-card.is-added {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .person-card .member-rate {
    grid-column: 2;
  }
}
