:root {
  --bg: #edf1ee;
  --shell: #f8faf7;
  --panel: #ffffff;
  --panel-2: #f1f5f2;
  --ink: #18272c;
  --muted: #607176;
  --line: #d8e1dc;
  --line-strong: #b9c8c1;
  --primary: #236c60;
  --primary-ink: #ffffff;
  --primary-soft: #dff0eb;
  --amber: #a65a21;
  --amber-soft: #fff0df;
  --red: #a3423b;
  --red-soft: #fae7e4;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  background: var(--bg);
  font-family: "IBM Plex Sans", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button,
input,
select,
textarea {
  font: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 20px 14px 16px;
  background: var(--shell);
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px 3px 10px 3px;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: var(--primary-ink);
  font-weight: 600;
  letter-spacing: -0.04em;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-weight: 600;
}

.brand small {
  color: var(--muted);
  font-size: 10px;
}

.sidebar nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
}

.sidebar nav::-webkit-scrollbar {
  display: none;
}

.nav-section {
  display: grid;
}

.nav-section + .nav-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.nav-label {
  display: block;
  margin: 0;
  padding: 0 10px 8px 12px;
  color: #71817b;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.055em;
}

.nav-item {
  display: block;
  min-height: 36px;
  color: #52645e;
  font-size: 14px;
  padding: 8px 10px 8px 22px;
  border-radius: 8px;
  margin-bottom: 2px;
}

.nav-count {
  float: right;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  display: inline-grid;
  place-items: center;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 9px;
  font-weight: 600;
}

.nav-item:hover {
  color: var(--ink);
  background: var(--panel-2);
  text-decoration: none;
}

.nav-item.active {
  color: var(--primary);
  background: var(--primary-soft);
  box-shadow: inset 3px 0 0 var(--primary);
  font-weight: 500;
}

.side-foot {
  margin-top: auto;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 14px 6px 0;
  border-top: 1px solid var(--line);
}

.side-foot strong,
.side-foot small {
  display: block;
}

.side-foot strong {
  font-size: 12px;
}

.side-foot small {
  color: var(--muted);
  font-size: 10px;
}

.side-foot-actions {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.side-foot-actions form {
  margin: 0;
}

.side-foot-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
}

.side-foot-link:hover {
  color: var(--primary);
  text-decoration: none;
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: var(--panel-2);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
  flex: none;
}

.avatar.large {
  width: 44px;
  height: 44px;
  background: var(--primary-soft);
  color: var(--primary);
  border: 0;
  font-size: 16px;
}

.workspace {
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 64px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 250, 247, 0.94);
  backdrop-filter: blur(10px);
}

.topbar strong,
.crumb {
  display: block;
}

.topbar strong {
  margin-top: 2px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-logout {
  display: none;
}

.crumb {
  color: var(--muted);
  font-size: 11px;
}

.environment {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  padding: 5px 10px;
  color: var(--muted);
  font-size: 11px;
}

.environment::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  margin-right: 7px;
}

.environment.configured {
  border-color: #b8d9cf;
  background: var(--primary-soft);
  color: var(--primary);
}

.environment.unconfigured {
  border-color: #e5c39d;
  background: var(--amber-soft);
  color: var(--amber);
}

.content {
  max-width: 1440px;
  padding: 22px 28px 28px;
}

.page-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.page-head h1 {
  font-size: 25px;
  line-height: 1.2;
  margin: 0;
  letter-spacing: -0.02em;
}

.page-head p {
  color: var(--muted);
  font-size: 12px;
  margin: 5px 0 0;
}

.detail-head {
  align-items: center;
}

.identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.head-actions form {
  margin: 0;
}

.primary-button,
.secondary-button,
.danger-button,
.link-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  height: 36px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: var(--panel);
  color: var(--ink);
  text-decoration: none;
}

.primary-button {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-ink);
  font-weight: 500;
}

.primary-button:disabled,
.primary-button.is-submitting {
  cursor: progress;
  opacity: 0.7;
}

.secondary-button.is-disabled {
  cursor: not-allowed;
  opacity: 0.5;
  pointer-events: none;
}

.member-create-submit {
  min-width: 148px;
}

.member-create-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  display: none;
  flex: 0 0 auto;
  animation: member-create-spin 0.75s linear infinite;
}

.member-create-submit.is-submitting .member-create-spinner,
.member-create-progress:not([hidden]) .member-create-spinner {
  display: inline-block;
}

.member-create-progress {
  align-items: flex-start;
  gap: 11px;
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid #b8d7d1;
  border-radius: 8px;
  background: #f2f8f6;
  color: var(--primary);
  line-height: 1.65;
}

.member-create-progress:not([hidden]) {
  display: flex;
}

.member-create-progress .member-create-spinner {
  margin-top: 4px;
}

.member-create-progress strong {
  display: block;
  font-size: 12px;
}

@keyframes member-create-spin {
  to {
    transform: rotate(360deg);
  }
}

.danger-button {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
  font-weight: 500;
}

.danger-button:hover {
  background: #88332e;
}

.secondary-button:hover,
.link-button:hover {
  background: var(--panel-2);
  text-decoration: none;
}

.link-button {
  border: 0;
  height: auto;
  padding: 0;
  background: transparent;
  color: var(--primary);
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  margin-bottom: 18px;
  background: rgba(255, 255, 255, 0.7);
}

.metric-row > div {
  min-width: 0;
  padding: 14px 16px;
  border-right: 1px solid var(--line);
}

.metric-row > div:last-child {
  border-right: 0;
}

.metric-row span,
.metric-row small,
.metric-row strong {
  display: block;
}

.metric-row span {
  color: var(--muted);
  font-size: 11px;
}

.metric-row strong {
  font-size: 24px;
  line-height: 1.3;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.metric-row small {
  color: var(--muted);
  font-size: 10px;
}

.metric-row .metric-warning.normal {
  background: rgba(223, 240, 235, 0.5);
}

.metric-row .metric-warning.normal strong {
  color: var(--primary);
}

.metric-row .metric-warning.warning {
  background: var(--amber-soft);
}

.metric-row .metric-warning.warning strong {
  color: var(--amber);
}

.metric-row .metric-warning.critical,
.metric-row .metric-warning.exhausted {
  background: var(--red-soft);
}

.metric-row .metric-warning.critical strong,
.metric-row .metric-warning.exhausted strong {
  color: var(--red);
}

.metric-row .metric-warning.exhausted {
  box-shadow: inset 0 3px 0 var(--red);
}

.dashboard-grid,
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
}

.split-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.detail-main {
  min-width: 0;
  display: grid;
  gap: 18px;
}

.panel {
  border: 1px solid var(--line);
  background: var(--panel);
  min-width: 0;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  font-size: 14px;
  margin: 0;
}

.panel-head span,
.panel-head a {
  color: var(--muted);
  font-size: 11px;
}

.panel-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-head-actions .secondary-button {
  height: 28px;
  padding: 0 9px;
  color: var(--primary);
}

.rail {
  padding-bottom: 4px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  min-width: 660px;
}

th,
td {
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  background: var(--panel-2);
  font-size: 10px;
  font-weight: 500;
}

tr:last-child td {
  border-bottom: 0;
}

td strong,
td small {
  display: block;
}

td small {
  color: var(--muted);
  font-size: 10px;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  background: var(--panel-2);
  border-radius: 5px;
  padding: 3px 6px;
  overflow-wrap: anywhere;
}

.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.tag.active,
.tag.key_created,
.tag.quota_synced,
.tag.remote_user_created {
  background: var(--primary-soft);
  color: var(--primary);
}

.tag.provisioning {
  background: var(--amber-soft);
  color: var(--amber);
}

.tag.disabled {
  background: #e9eeeb;
  color: #65736e;
}

.tag.failed {
  background: var(--red-soft);
  color: var(--red);
}

.tag.pending,
.tag.warning,
.tag.running {
  background: var(--amber-soft);
  color: var(--amber);
}

.tag.critical {
  background: var(--red-soft);
  color: var(--red);
}

.tag.succeeded {
  background: var(--primary-soft);
  color: var(--primary);
}

.notice-row,
.ledger-row-item {
  padding: 10px 14px;
  border-bottom: 1px dashed var(--line);
}

.notice-row:last-child,
.ledger-row-item:last-child {
  border-bottom: 0;
}

.notice-row strong,
.notice-row span,
.ledger-row-item strong,
.ledger-row-item span {
  display: block;
}

.notice-row strong,
.ledger-row-item strong {
  font-size: 11px;
  font-weight: 500;
}

.notice-row span,
.ledger-row-item span {
  color: var(--muted);
  font-size: 10px;
}

.rail-meta {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  padding: 13px 14px;
  border-top: 1px solid var(--line);
  font-size: 11px;
}

.rail-meta span {
  color: var(--muted);
}

.remote-danger {
  display: grid;
  gap: 5px;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: #fbf7f5;
}

.remote-danger strong {
  color: var(--red);
  font-size: 11px;
  font-weight: 550;
}

.remote-danger span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.remote-danger .remote-danger-button {
  height: 34px;
  border-radius: 4px;
  font-size: 11px;
  text-decoration: none;
}

.remote-danger-actions {
  display: grid;
  gap: 7px;
  margin-top: 5px;
}

.remote-danger-actions .remote-reopen-button,
.remote-danger-actions .remote-danger-button {
  width: 100%;
  height: 34px;
  border-radius: 4px;
  font-size: 11px;
  text-decoration: none;
}

.remote-danger-actions .remote-reopen-button {
  color: var(--primary);
}

.remote-danger .remote-danger-button:hover {
  color: #fff;
  text-decoration: none;
}

.remote-delete-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
  max-width: 920px;
}

.remote-delete-card {
  border: 1px solid var(--line-strong);
  border-top: 4px solid var(--red);
  background: var(--panel);
}

.remote-reopen-card {
  border-top-color: var(--primary);
}

.remote-reopen-heading {
  display: grid;
  gap: 5px;
  padding: 20px 22px;
  background: var(--primary-soft);
}

.remote-reopen-heading strong {
  color: var(--primary);
  font-size: 15px;
  font-weight: 550;
}

.remote-reopen-heading span {
  max-width: 660px;
  color: #3e6159;
  font-size: 11px;
  line-height: 1.7;
}

.remote-delete-warning {
  display: grid;
  gap: 5px;
  padding: 20px 22px;
  background: var(--red-soft);
}

.remote-delete-warning strong {
  color: var(--red);
  font-size: 15px;
  font-weight: 550;
}

.remote-delete-warning span {
  max-width: 660px;
  color: #71423d;
  font-size: 11px;
  line-height: 1.7;
}

.remote-delete-meta {
  margin: 0;
  padding: 8px 22px;
}

.remote-delete-meta > div {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.remote-delete-meta > div:last-child {
  border-bottom: 0;
}

.remote-delete-meta dt {
  color: var(--muted);
  font-size: 11px;
}

.remote-delete-meta dd {
  margin: 0;
  font-size: 11px;
  text-align: right;
  overflow-wrap: anywhere;
}

.remote-delete-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 22px;
  border-top: 1px solid var(--line);
  background: #fbfcfa;
}

.remote-delete-impact {
  border-top: 3px solid var(--ink);
  background: var(--shell);
}

.remote-delete-impact section {
  padding: 17px 18px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.remote-delete-impact h2 {
  margin: 0 0 10px;
  font-size: 12px;
}

.remote-delete-impact ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.remote-delete-impact li {
  position: relative;
  padding-left: 12px;
  color: var(--muted);
  font-size: 10px;
}

.remote-delete-impact li::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 0;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--primary);
}

.remote-delete-impact > p {
  margin: 0;
  padding: 14px 18px 17px;
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.delete-confirmation-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 16px;
  border-top: 1px solid var(--line);
  background: var(--red-soft);
  color: var(--red);
  font-size: 11px;
  line-height: 1.6;
}

.delete-confirmation-check input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin: 1px 0 0;
  accent-color: var(--red);
}

.empty {
  color: var(--muted);
  text-align: center;
  padding: 28px 14px;
}

.empty.compact {
  padding: 16px 14px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  padding: 10px 2px;
  color: var(--muted);
  font-size: 10px;
}

.pagination-links {
  display: flex;
  align-items: center;
  gap: 5px;
}

.pagination-links a,
.pagination-links .current,
.pagination-links .disabled,
.pagination-links .ellipsis {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--panel);
}

.pagination-links a:hover {
  border-color: var(--primary);
  text-decoration: none;
}

.pagination-links .current {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--primary-ink);
}

.pagination-links .disabled {
  opacity: 0.4;
}

.pagination-links .ellipsis {
  border-color: transparent;
  background: transparent;
}

.search-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.search-row input {
  width: min(420px, 100%);
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 11px;
  background: var(--panel);
}

.member-search-row {
  align-items: center;
}

.member-search-row input {
  flex: 0 1 320px;
  width: min(320px, 100%);
}

.member-search-row select {
  flex: 0 0 138px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--panel);
  color: var(--ink);
}

.member-row-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.member-row-actions form {
  margin: 0;
}

.member-row-actions .link-button {
  font-size: 11px;
}

.member-row-actions .danger-link {
  color: var(--red);
}

.row-action-button {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  border: 1px solid var(--primary);
  border-radius: 6px;
  padding: 0 10px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 11px;
  font-weight: 550;
  cursor: pointer;
}

.row-action-button:hover {
  background: var(--primary);
  color: var(--primary-ink);
}

.member-row-actions button:disabled {
  cursor: progress;
  opacity: 0.55;
}

.member-list-table {
  min-width: 920px;
  table-layout: fixed;
}

.member-list-table th:nth-child(1) {
  width: 168px;
}

.member-list-table th:nth-child(2) {
  width: 230px;
}

.member-list-table th:nth-child(3) {
  width: 92px;
}

.member-list-table th:nth-child(4),
.member-list-table th:nth-child(5) {
  width: 88px;
}

.member-list-table th:nth-child(6) {
  width: 72px;
}

.member-list-table th:nth-child(7) {
  width: 190px;
}

.department-cell strong,
.department-cell small {
  overflow: hidden;
  text-overflow: ellipsis;
}

.department-cell strong {
  white-space: nowrap;
}

.department-cell small {
  display: -webkit-box;
  overflow: hidden;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.45;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.filter-row input,
.filter-row select {
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 11px;
  background: var(--panel);
}

.filter-row input {
  width: min(360px, 100%);
}

.segmented {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
}

.segmented a {
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 11px;
}

.segmented a:hover {
  text-decoration: none;
  color: var(--ink);
}

.segmented a.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 500;
}

.quick-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 18px;
  border: 1px solid var(--line);
  background: var(--line);
}

.quick-links a {
  min-height: 82px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
}

.quick-links a:hover {
  background: var(--panel);
  text-decoration: none;
}

.quick-links strong,
.quick-links span {
  display: block;
}

.quick-links strong {
  font-size: 13px;
}

.quick-links span {
  color: var(--muted);
  font-size: 10px;
  margin-top: 4px;
}

.section-gap {
  margin-top: 18px;
}

.section-gap-sm {
  margin-bottom: 14px;
}

.compact-metrics {
  grid-template-columns: repeat(2, minmax(0, 240px));
}

.usage-chart {
  min-height: 238px;
  padding: 22px 18px 13px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9px, 1fr));
  align-items: end;
  gap: 5px;
  overflow-x: auto;
}

.usage-chart-day {
  min-width: 9px;
  height: 190px;
  display: grid;
  grid-template-rows: 17px minmax(0, 1fr) 18px;
  align-items: end;
  justify-items: stretch;
}

.usage-chart-bar {
  width: 100%;
  min-height: 2px;
  height: var(--bar-height);
  align-self: end;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, #4f9a89, var(--primary));
}

.usage-chart-value,
.usage-chart-label {
  color: var(--muted);
  font-size: 8px;
  text-align: center;
  white-space: nowrap;
}

.usage-chart-value {
  opacity: 0;
}

.usage-chart-day:hover .usage-chart-value {
  opacity: 1;
}

.negative,
.error-text {
  color: var(--red);
}

.error-text {
  max-width: 260px;
  overflow-wrap: anywhere;
}

.status-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 20px;
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--primary);
  background: var(--panel);
}

.status-banner.pending {
  border-left-color: var(--amber);
  background: var(--amber-soft);
}

.status-banner.ready {
  background: linear-gradient(90deg, var(--primary-soft), var(--panel) 64%);
}

.status-kicker,
.status-banner strong,
.status-banner p {
  display: block;
}

.status-kicker {
  color: var(--muted);
  font-size: 10px;
}

.status-banner strong {
  margin-top: 3px;
  font-size: 18px;
  font-weight: 500;
}

.status-banner p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.config-list {
  margin: 0;
  padding: 3px 16px;
}

.config-list > div {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.config-list > div:last-child {
  border-bottom: 0;
}

.config-list dt {
  color: var(--muted);
  font-size: 11px;
}

.config-list dd {
  margin: 0;
  font-size: 11px;
  text-align: right;
  overflow-wrap: anywhere;
}

.config-list dd small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.checklist {
  margin: 0;
  padding: 8px 18px 14px 44px;
}

.checklist li {
  padding: 8px 0 9px 4px;
  border-bottom: 1px solid var(--line);
  color: var(--amber);
}

.checklist li:last-child {
  border-bottom: 0;
}

.checklist li.done {
  color: var(--primary);
}

.checklist span,
.checklist small {
  display: block;
}

.checklist span {
  font-size: 12px;
  font-weight: 500;
}

.checklist small {
  color: var(--muted);
  font-size: 10px;
  margin-top: 2px;
}

.form-panel {
  max-width: 940px;
}

.compact-panel {
  max-width: 560px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
  padding: 20px;
}

.field {
  display: grid;
  gap: 6px;
}

.field.wide {
  grid-column: 1 / -1;
}

.field label,
.stack-form label {
  color: var(--muted);
  font-size: 11px;
}

.field input,
.field select,
.stack-form input,
.stack-form textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--shell);
  color: var(--ink);
  padding: 8px 10px;
}

.field-error {
  color: var(--red);
  font-size: 11px;
}

.organization-picker {
  position: relative;
}

.organization-trigger {
  position: relative;
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 38px 8px 11px;
  display: flex;
  align-items: center;
  background: var(--shell);
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}

.organization-trigger > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.organization-trigger.has-selection {
  color: var(--ink);
}

.organization-trigger:hover,
.organization-picker.is-open .organization-trigger {
  border-color: var(--primary);
}

.organization-chevron {
  position: absolute;
  top: 50%;
  right: 14px;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.organization-picker.is-open .organization-chevron {
  transform: translateY(-25%) rotate(225deg);
}

.organization-popover {
  position: absolute;
  z-index: 30;
  top: calc(100% + 7px);
  right: 0;
  left: 0;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  box-shadow: 0 14px 36px rgba(24, 39, 44, 0.14);
}

.organization-popover[hidden] {
  display: none;
}

.organization-search-wrap {
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

.field .organization-search {
  min-height: 36px;
  background: var(--panel);
}

.organization-help {
  margin: 7px 2px 0;
  color: var(--muted);
  font-size: 10px;
}

.organization-tree {
  max-height: 390px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.organization-tree-row {
  --organization-indent: calc(var(--organization-depth) * 18px);
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr);
  align-items: stretch;
  padding-left: var(--organization-indent);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.organization-tree-row:hover {
  background: var(--panel-2);
}

.organization-tree-row.is-selected {
  background: var(--panel);
}

.organization-tree-toggle,
.organization-tree-spacer {
  width: 25px;
  min-height: 39px;
}

.organization-tree-toggle {
  position: relative;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.organization-tree-toggle:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.organization-tree-toggle::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 8px;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-65%) rotate(-45deg);
}

.organization-tree-toggle.is-expanded::before {
  transform: translateY(-30%) rotate(45deg);
}

.organization-tree-choice {
  min-width: 0;
  min-height: 39px;
  border: 0;
  padding: 8px 12px 8px 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.organization-tree-choice:hover {
  background: var(--panel-2);
}

.organization-tree-row.is-selected .organization-tree-choice {
  background: var(--primary-soft);
}

.organization-tree-choice > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.organization-tree-check {
  width: 8px;
  height: 13px;
  flex: none;
  border-right: 2px solid var(--primary);
  border-bottom: 2px solid var(--primary);
  transform: rotate(45deg) translateY(-2px);
}

.organization-empty {
  margin: 0;
  padding: 22px 14px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.form-note {
  margin: 0 20px 18px;
  padding: 11px 12px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 11px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 15px 20px;
  border-top: 1px solid var(--line);
}

.stack-form {
  display: grid;
  gap: 9px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--primary);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.password-reset-layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
  max-width: 1020px;
}

.password-account-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 28px 26px;
  color: #eef8f4;
  background:
    radial-gradient(circle at 88% 10%, rgba(255, 255, 255, 0.13), transparent 32%),
    linear-gradient(150deg, #143b36, #20594f);
}

.password-account-card::after {
  content: "";
  position: absolute;
  right: -58px;
  bottom: -76px;
  width: 190px;
  height: 190px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}

.password-account-avatar {
  width: 58px;
  height: 58px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 18px 5px 18px 5px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.1);
  font-size: 24px;
  font-weight: 600;
}

.password-account-copy span,
.password-account-copy p,
.password-account-copy h2 {
  margin: 0;
}

.password-account-copy span {
  color: rgba(238, 248, 244, 0.64);
  font-size: 10px;
}

.password-account-copy h2 {
  margin-top: 5px;
  font-size: 24px;
  font-weight: 550;
}

.password-account-copy p {
  margin-top: 7px;
  color: rgba(238, 248, 244, 0.72);
  font-size: 11px;
  line-height: 1.65;
}

.password-account-meta {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 18px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
}

.password-account-meta div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.password-account-meta dt {
  color: rgba(238, 248, 244, 0.62);
  font-size: 10px;
}

.password-account-meta dd {
  margin: 0;
  font-size: 12px;
}

.password-account-meta .tag {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.password-security-note {
  position: relative;
  z-index: 1;
  margin-top: auto;
}

.password-security-note strong {
  display: block;
  margin-bottom: 5px;
  font-size: 11px;
}

.password-security-note p {
  margin: 0;
  color: rgba(238, 248, 244, 0.68);
  font-size: 10px;
  line-height: 1.7;
}

.password-reset-card {
  padding: 30px;
}

.password-reset-head {
  display: flex;
  gap: 15px;
  align-items: flex-start;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.password-reset-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 14px;
  font-weight: 650;
}

.password-reset-head h2,
.password-reset-head p {
  margin: 0;
}

.password-reset-head h2 {
  font-size: 18px;
}

.password-reset-head p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.password-reset-form {
  display: grid;
  gap: 20px;
  padding-top: 24px;
}

.password-field {
  display: grid;
  gap: 7px;
}

.password-field label {
  color: var(--muted);
  font-size: 11px;
}

.password-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.password-field-head .link-button {
  font-size: 10px;
}

.password-field small {
  color: var(--muted);
  font-size: 10px;
}

.password-field small.matches {
  color: var(--primary);
}

.password-field small.mismatch {
  color: var(--red);
}

.password-field small.generated-password {
  color: var(--amber);
}

.password-input-wrap {
  position: relative;
}

.password-input-wrap input {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0 65px 0 13px;
  background: var(--shell);
  color: var(--ink);
}

.password-reveal {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--primary);
  padding: 7px;
  font-size: 10px;
  cursor: pointer;
}

.password-reset-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.password-save-button {
  min-width: 140px;
}

.activation-layout {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  max-width: 1080px;
}

.activation-profile {
  border: 1px solid var(--line);
  background: var(--panel);
}

.activation-profile-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 22px;
  border-top: 4px solid var(--primary);
}

.activation-profile-head h2,
.activation-profile-head p {
  margin: 0;
}

.activation-profile-head h2 {
  margin-top: 8px;
  font-size: 22px;
}

.activation-profile-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.activation-meta {
  margin: 0;
  padding: 0 22px;
}

.activation-meta div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}

.activation-meta dt {
  color: var(--muted);
  font-size: 10px;
}

.activation-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 11px;
}

.activation-identity-note {
  margin: 18px 22px 22px;
  padding: 13px 14px;
  background: var(--primary-soft);
}

.activation-identity-note strong,
.activation-identity-note p {
  display: block;
  margin: 0;
}

.activation-identity-note strong {
  color: var(--primary);
  font-size: 11px;
}

.activation-identity-note p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.activation-form-card {
  overflow: hidden;
}

.activation-form-head {
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.activation-form-head h2,
.activation-form-head p {
  margin: 0;
}

.activation-form-head h2 {
  font-size: 16px;
}

.activation-form-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

.activation-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: 22px;
}

.activation-field {
  display: grid;
  gap: 7px;
}

.activation-field label {
  color: var(--ink);
  font-size: 11px;
  font-weight: 550;
}

.activation-field small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.activation-field > input,
.activation-field > select,
.activation-field .password-input-wrap input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--shell);
  color: var(--ink);
}

.activation-password-field {
  grid-column: 1 / -1;
}

.activation-field-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.activation-field-head > div {
  display: grid;
  gap: 4px;
}

.activation-field-head .link-button {
  flex: 0 0 auto;
  font-size: 11px;
}

.activation-password-hint {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 10px;
}

.activation-password-hint strong {
  color: var(--amber);
  font-weight: 500;
}

.activation-neutral-password {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  font-size: 10px;
}

.activation-neutral-password strong {
  color: var(--ink);
  font-weight: 500;
}

.money-input {
  position: relative;
}

.money-input > span {
  position: absolute;
  top: 50%;
  left: 12px;
  z-index: 1;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 11px;
}

.money-input input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0 12px 0 29px;
  background: var(--shell);
}

.activation-actions {
  margin-top: 2px;
}

.credential-delivery {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px 18px;
  align-items: center;
  margin-bottom: 16px;
  padding: 18px 20px;
  border: 1px solid #b8d7d1;
  border-left: 4px solid var(--primary);
  background: #f2f8f6;
}

.credential-delivery > div {
  display: grid;
  gap: 3px;
}

.credential-delivery > div strong {
  color: var(--primary);
  font-size: 13px;
}

.credential-delivery > div span {
  color: var(--muted);
  font-size: 10px;
}

.credential-delivery code {
  grid-column: 1 / 2;
  white-space: pre-wrap;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.8;
}

.credential-delivery button {
  grid-row: 1 / 3;
  grid-column: 2;
}

@media (max-width: 640px) {
  .activation-fields {
    grid-template-columns: 1fr;
  }

  .activation-password-field,
  .activation-neutral-password {
    grid-column: 1;
  }

  .activation-password-hint,
  .activation-neutral-password {
    align-items: flex-start;
    flex-direction: column;
  }

  .credential-delivery {
    grid-template-columns: 1fr;
  }

  .credential-delivery code,
  .credential-delivery button {
    grid-row: auto;
    grid-column: 1;
  }

  .credential-delivery button {
    justify-self: start;
  }
}

.recharge-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 18px;
  align-items: start;
  max-width: 1080px;
}

.recharge-slip {
  border: 1px solid var(--line-strong);
  border-top: 4px solid var(--primary);
  background: var(--panel);
}

.recharge-slip-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 24px 18px;
  border-bottom: 1px solid var(--line);
}

.recharge-slip-head strong,
.recharge-slip-head small,
.recharge-kicker {
  display: block;
}

.recharge-slip-head strong {
  margin-top: 4px;
  font-size: 18px;
  font-weight: 550;
  letter-spacing: -0.02em;
}

.recharge-slip-head small,
.recharge-kicker {
  color: var(--muted);
  font-size: 10px;
}

.recharge-form {
  padding: 24px;
}

.recharge-field {
  display: grid;
  gap: 7px;
}

.recharge-field > label {
  color: var(--muted);
  font-size: 11px;
}

.recharge-money-input {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border-bottom: 2px solid var(--ink);
  padding: 2px 0 8px;
}

.recharge-money-input > span {
  align-self: start;
  margin-top: 13px;
  color: var(--primary);
  font-size: 23px;
  font-weight: 550;
}

.recharge-money-input input {
  width: 100%;
  min-width: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  font-family: "IBM Plex Sans", "Noto Sans SC", sans-serif;
  font-size: clamp(38px, 5vw, 54px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}

.recharge-money-input input:focus {
  outline: 0;
}

.recharge-money-input:focus-within {
  border-bottom-color: var(--primary);
  box-shadow: 0 2px 0 var(--primary);
}

.recharge-help {
  color: var(--muted);
  font-size: 10px;
}

.recharge-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.recharge-presets button {
  min-width: 68px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.recharge-presets button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.recharge-presets button.is-selected {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 500;
}

.recharge-balance-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1.15fr);
  gap: 10px;
  align-items: center;
  margin: 28px 0 24px;
  padding: 17px 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f7f9f7;
}

.recharge-balance-flow div {
  min-width: 0;
}

.recharge-balance-flow span,
.recharge-balance-flow strong {
  display: block;
}

.recharge-balance-flow div > span {
  color: var(--muted);
  font-size: 9px;
}

.recharge-balance-flow strong {
  margin-top: 3px;
  font-size: 16px;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.recharge-flow-mark {
  color: var(--line-strong);
  font-size: 16px;
}

.recharge-flow-equals {
  color: var(--primary);
}

.recharge-result strong {
  color: var(--primary);
  font-size: 20px;
}

.recharge-note-field {
  margin-bottom: 22px;
}

.recharge-note-field textarea {
  width: 100%;
  min-height: 84px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px 11px;
  background: var(--shell);
  color: var(--ink);
}

.recharge-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 0 -24px -24px;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  background: #fbfcfa;
}

.recharge-submit {
  min-width: 130px;
  border-radius: 4px;
}

.recharge-submit:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.recharge-context {
  border-top: 3px solid var(--ink);
  background: var(--shell);
}

.recharge-context > section {
  padding: 18px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.recharge-context h2 {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 550;
}

.recharge-meta {
  display: grid;
  gap: 8px;
  margin: 0;
}

.recharge-meta > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 10px;
}

.recharge-meta dt {
  color: var(--muted);
}

.recharge-meta dd {
  margin: 0;
  text-align: right;
  overflow-wrap: anywhere;
}

.recharge-process ol {
  display: grid;
  gap: 13px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: recharge-step;
}

.recharge-process li {
  position: relative;
  display: grid;
  gap: 2px;
  padding-left: 27px;
  counter-increment: recharge-step;
}

.recharge-process li::before {
  content: counter(recharge-step);
  position: absolute;
  top: 0;
  left: 0;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  color: var(--primary);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.recharge-process strong,
.recharge-process span {
  display: block;
}

.recharge-process strong {
  font-size: 11px;
  font-weight: 500;
}

.recharge-process span {
  color: var(--muted);
  font-size: 10px;
}

.recharge-callout {
  display: grid;
  gap: 3px;
  margin: 14px 0;
  padding: 12px 14px;
  border-left: 3px solid var(--amber);
  background: var(--amber-soft);
  color: var(--amber);
}

.recharge-callout strong,
.recharge-callout span {
  display: block;
}

.recharge-callout strong {
  font-size: 11px;
}

.recharge-callout span {
  font-size: 10px;
}

.recharge-footnote {
  margin: 0;
  padding: 14px 18px 17px;
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.one-time-key {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  margin-bottom: 18px;
  border: 1px solid var(--primary);
  background: var(--primary-soft);
  padding: 15px;
}

.one-time-key > div {
  grid-column: 1 / -1;
}

.one-time-key strong,
.one-time-key span {
  display: block;
}

.one-time-key span {
  color: var(--muted);
  font-size: 11px;
}

.one-time-key code {
  background: var(--panel);
}

.secret-visible {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
  text-align: left;
}

.message {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 12px;
}

.message.success {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.message.warning {
  border-color: var(--amber);
  background: var(--amber-soft);
  color: var(--amber);
}

.message.error {
  border-color: var(--red);
  background: var(--red-soft);
  color: var(--red);
}

.message-stack {
  padding: 14px 28px 0;
}

.login-page {
  min-height: 100vh;
  background: #123b32;
}

.login-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.14fr) minmax(440px, 0.86fr);
}

.login-context {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: clamp(32px, 5vw, 68px);
  color: #f5faf7;
  background:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px) 0 0 / 100% 64px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px) 0 0 / 64px 100%,
    #123b32;
}

.login-context::after {
  content: "";
  position: absolute;
  right: clamp(28px, 7vw, 110px);
  bottom: clamp(80px, 12vh, 140px);
  width: min(31vw, 390px);
  aspect-ratio: 1;
  border: 1px solid rgba(219, 240, 233, 0.13);
  border-radius: 50%;
  box-shadow:
    0 0 0 44px rgba(219, 240, 233, 0.035),
    0 0 0 88px rgba(219, 240, 233, 0.02);
  pointer-events: none;
}

.login-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-brand .brand-mark {
  width: 44px;
  height: 44px;
  background: #f5faf7;
  color: #123b32;
}

.login-brand strong,
.login-brand small {
  display: block;
}

.login-brand strong {
  font-size: 15px;
  font-weight: 550;
}

.login-brand small {
  color: rgba(239, 249, 245, 0.6);
  font-size: 10px;
}

.login-manifesto {
  position: relative;
  z-index: 1;
  max-width: 690px;
  margin-top: clamp(78px, 14vh, 150px);
}

.login-context-label {
  margin: 0 0 16px;
  color: #9ed1c2;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.login-manifesto h1 {
  margin: 0;
  max-width: 720px;
  font-size: clamp(42px, 5vw, 72px);
  font-weight: 500;
  line-height: 1.09;
  letter-spacing: -0.055em;
}

.login-manifesto > p:last-child {
  max-width: 510px;
  margin: 24px 0 0;
  color: rgba(239, 249, 245, 0.66);
  font-size: 14px;
  line-height: 1.75;
}

.login-route {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto minmax(24px, 1fr) auto minmax(24px, 1fr) auto;
  align-items: center;
  gap: 12px;
  max-width: 620px;
  margin-top: clamp(44px, 8vh, 82px);
}

.route-node {
  border: 1px solid rgba(219, 240, 233, 0.24);
  padding: 7px 10px;
  color: rgba(239, 249, 245, 0.72);
  font-size: 10px;
  white-space: nowrap;
}

.route-node-core {
  border-color: #8fcbb9;
  background: rgba(223, 240, 235, 0.1);
  color: #e9f8f2;
}

.route-line {
  height: 1px;
  background: rgba(219, 240, 233, 0.26);
}

.login-capabilities {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  max-width: 720px;
  margin: auto 0 0;
  padding: 22px 0 0;
  border-top: 1px solid rgba(219, 240, 233, 0.2);
  list-style: none;
}

.login-capabilities li {
  padding: 0 24px;
  border-left: 1px solid rgba(219, 240, 233, 0.18);
}

.login-capabilities li:first-child {
  padding-left: 0;
  border-left: 0;
}

.login-capabilities strong,
.login-capabilities span {
  display: block;
}

.login-capabilities strong {
  font-size: 11px;
  font-weight: 500;
}

.login-capabilities span {
  margin-top: 3px;
  color: rgba(239, 249, 245, 0.52);
  font-size: 10px;
}

.login-context-foot {
  position: relative;
  z-index: 1;
  margin: 22px 0 0;
  color: rgba(239, 249, 245, 0.42);
  font-size: 10px;
}

.login-access {
  display: grid;
  align-items: center;
  padding: clamp(28px, 6vw, 88px);
  background:
    linear-gradient(90deg, rgba(35, 108, 96, 0.045) 1px, transparent 1px) 0 0 / 72px 100%,
    #f5f7f4;
}

.login-access-inner {
  width: min(420px, 100%);
  margin: 0 auto;
}

.login-access-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: clamp(70px, 12vh, 130px);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.security-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.security-note i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

.login-form-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(30px, 3.2vw, 42px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.login-form-head p {
  margin: 9px 0 32px;
  color: var(--muted);
  font-size: 12px;
}

.login-error {
  display: grid;
  gap: 2px;
  margin-bottom: 18px;
  padding: 12px 14px;
  border-left: 3px solid var(--red);
  background: var(--red-soft);
  color: var(--red);
  font-size: 11px;
}

.login-error strong,
.login-error span {
  display: block;
}

.login-form {
  display: grid;
  gap: 18px;
}

.login-field {
  display: grid;
  gap: 7px;
}

.login-field label {
  color: var(--muted);
  font-size: 11px;
}

.login-field input {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  padding: 0 13px;
  background: var(--panel);
  color: var(--ink);
}

.login-field input::placeholder {
  color: #8b9a96;
}

.password-control {
  position: relative;
}

.password-control input {
  padding-right: 60px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--primary);
  padding: 6px;
  font-size: 11px;
  cursor: pointer;
}

.login-submit {
  width: 100%;
  height: 48px;
  margin-top: 4px;
  border: 1px solid var(--primary);
  border-radius: 3px;
  background: var(--primary);
  color: var(--primary-ink);
  cursor: pointer;
  font-weight: 500;
}

.login-submit:hover {
  background: #19594f;
}

.login-support {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

.login-support strong,
.login-support span {
  display: block;
}

.login-support strong {
  color: var(--ink);
  font-size: 11px;
  font-weight: 500;
}

.login-support span {
  margin-top: 3px;
}

@media (max-width: 960px) {
  .app-shell {
    grid-template-columns: 70px minmax(0, 1fr);
  }

  .brand span:last-child,
  .nav-item,
  .side-foot span {
    font-size: 0;
  }

  .nav-label {
    display: none;
  }

  .nav-section + .nav-section {
    margin-top: 8px;
    padding-top: 8px;
  }

  .brand {
    justify-content: center;
  }

  .nav-item {
    width: 38px;
    min-height: 34px;
    margin: 0 auto 4px;
    padding: 0;
    position: relative;
  }

  .nav-item::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: block;
    margin: 0 auto;
    background: currentColor;
  }

  .side-foot {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .side-foot-actions {
    display: flex;
    justify-content: center;
    gap: 4px;
  }

  .side-foot-link {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 0;
  }

  .side-foot-actions .admin-password-link::before {
    content: "改密";
    font-size: 9px;
  }

  .side-foot-actions button.side-foot-link::before {
    content: "退出";
    font-size: 9px;
  }

  .dashboard-grid,
  .detail-grid,
  .split-grid,
  .recharge-layout,
  .remote-delete-layout,
  .password-reset-layout,
  .activation-layout {
    grid-template-columns: 1fr;
  }

  .login-layout {
    grid-template-columns: 1fr;
  }

  .login-context {
    min-height: auto;
    padding: 30px 28px 26px;
  }

  .login-context::after,
  .login-route {
    display: none;
  }

  .login-manifesto {
    margin-top: 48px;
  }

  .login-manifesto h1 {
    max-width: 620px;
    font-size: clamp(36px, 8vw, 54px);
  }

  .login-capabilities {
    margin-top: 38px;
  }

  .login-access {
    min-height: 58vh;
    padding: 44px 28px;
  }

  .login-access-head {
    margin-bottom: 48px;
  }

  .member-search-row {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .member-search-row select {
    flex: 1 1 160px;
  }
}

@media (max-width: 640px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 8px 12px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand {
    border: 0;
    padding: 0;
  }

  .sidebar nav {
    display: flex;
    flex: none;
    align-items: center;
    gap: 4px;
    overflow: visible;
  }

  .nav-section {
    display: flex;
    gap: 4px;
  }

  .nav-section + .nav-section {
    margin: 0;
    padding: 0;
    border: 0;
  }

  .nav-item {
    width: 38px;
    height: 38px;
    margin: 0;
    padding: 0;
  }

  .side-foot {
    display: none;
  }

  .topbar,
  .message-stack {
    padding-left: 14px;
    padding-right: 14px;
  }

  .topbar {
    min-height: 58px;
  }

  .environment {
    display: none;
  }

  .topbar-logout {
    display: block;
  }

  .topbar-logout .link-button {
    min-width: 48px;
    height: 34px;
    padding: 0 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    font-size: 11px;
  }

  .content {
    padding: 16px 14px 24px;
  }

  .page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .metric-row,
  .form-grid {
    grid-template-columns: 1fr 1fr;
  }

  .quick-links {
    grid-template-columns: 1fr;
  }

  .status-banner {
    grid-template-columns: 1fr;
  }

  .usage-chart {
    padding-left: 12px;
    padding-right: 12px;
  }

  .config-list > div {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .config-list dd {
    text-align: left;
  }

  .metric-row > div:nth-child(2) {
    border-right: 0;
  }

  .metric-row > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .field.wide {
    grid-column: auto;
  }

  .one-time-key {
    grid-template-columns: 1fr;
  }

  .recharge-slip-head,
  .recharge-form,
  .recharge-actions {
    padding-left: 16px;
    padding-right: 16px;
  }

  .recharge-actions {
    margin-left: -16px;
    margin-right: -16px;
  }

  .recharge-balance-flow {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .recharge-balance-flow .recharge-flow-mark {
    display: none;
  }

  .recharge-result {
    margin-top: 3px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
  }

  .remote-delete-meta > div {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .remote-delete-meta dd {
    text-align: left;
  }

  .remote-delete-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .login-context {
    padding: 24px 18px;
  }

  .login-manifesto {
    margin-top: 36px;
  }

  .login-manifesto h1 {
    font-size: 34px;
    line-height: 1.16;
  }

  .login-manifesto > p:last-child {
    font-size: 12px;
  }

  .login-capabilities {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .login-capabilities li,
  .login-capabilities li:first-child {
    padding: 0 0 0 12px;
    border-left: 1px solid rgba(219, 240, 233, 0.22);
  }

  .login-context-foot {
    margin-top: 18px;
  }

  .login-access {
    min-height: 0;
    padding: 36px 18px 44px;
  }

  .login-access-head {
    margin-bottom: 36px;
  }

  table {
    min-width: 700px;
  }
}

.access-role-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px;
  align-items: start;
}

.access-help {
  position: sticky;
  top: 84px;
}

.access-help-body {
  display: grid;
  gap: 11px;
  padding: 14px 16px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.access-help-body p {
  margin: 0;
}

.role-settings-panel {
  margin-bottom: 16px;
}

.stack-form,
.panel-form {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.form-field {
  display: grid;
  gap: 6px;
}

.form-field label {
  color: var(--muted);
  font-size: 11px;
}

.form-field input:not([type="checkbox"]),
.form-field textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--panel);
  color: var(--ink);
}

.form-field textarea {
  min-height: 82px;
  resize: vertical;
}

.form-field small {
  color: var(--muted);
  font-size: 10px;
}

.field-error {
  color: var(--red);
  font-size: 10px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}

.access-option-grid,
.access-member-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
}

.access-option,
.access-member-option {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 0;
  padding: 12px 14px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.access-option:nth-child(2n),
.access-member-option:nth-child(2n) {
  border-right: 0;
}

.access-option:hover,
.access-member-option:hover {
  background: var(--panel-2);
}

.access-option.is-disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.access-option input,
.access-member-option input {
  margin-top: 3px;
  accent-color: var(--primary);
}

.access-option strong,
.access-option small,
.access-member-option strong,
.access-member-option small {
  display: block;
}

.access-option strong,
.access-member-option strong {
  font-size: 11px;
  font-weight: 550;
}

.access-option small,
.access-member-option small {
  color: var(--muted);
  font-size: 10px;
  overflow-wrap: anywhere;
}

.role-member-search {
  padding: 12px 14px 0;
}

.access-base-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 14px 16px;
}

.member-role-summary {
  padding-top: 14px;
  padding-bottom: 14px;
}

.tag.staged {
  background: var(--amber-soft);
  color: var(--amber);
}

.tag.published {
  background: var(--primary-soft);
  color: var(--primary);
}

.tag.deprecated,
.tag.disabled {
  background: #e9eeeb;
  color: #65736e;
}

.muted {
  color: var(--muted);
  font-size: 10px;
}

@media (max-width: 960px) {
  .access-role-layout {
    grid-template-columns: 1fr;
  }

  .access-help {
    position: static;
  }
}

@media (max-width: 640px) {
  .access-option-grid,
  .access-member-grid {
    grid-template-columns: 1fr;
  }

  .access-option,
  .access-member-option {
    border-right: 0;
  }
}

.catalog-sync-panel,
.catalog-preview-panel {
  margin-bottom: 18px;
}

.catalog-sync-panel .panel-head > div:first-child,
.catalog-preview-panel .panel-head > div:first-child {
  display: grid;
  gap: 3px;
}

.catalog-sync-panel .panel-head p,
.catalog-preview-panel .panel-head p {
  margin: 0;
}

.catalog-sync-stats,
.catalog-preview-counts {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.catalog-sync-stats span {
  padding-left: 10px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

.catalog-sync-stats span:first-child {
  border-left: 0;
}

.catalog-sync-stats strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
}

.catalog-upload-form {
  display: flex;
  align-items: end;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.catalog-file-field {
  display: grid;
  flex: 1;
  gap: 7px;
  min-width: 0;
}

.catalog-file-field > span {
  color: var(--muted);
  font-size: 10px;
}

.catalog-file-field input {
  width: 100%;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--shell);
  color: var(--ink);
}

.catalog-sync-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  padding: 11px 16px;
  color: var(--muted);
  font-size: 10px;
}

.catalog-conflicts {
  display: grid;
  gap: 4px;
  margin: 14px 16px 0;
  padding: 12px 14px;
  border-left: 3px solid var(--red);
  background: var(--red-soft);
  color: var(--red);
  font-size: 11px;
}

.catalog-conflicts strong,
.catalog-conflicts span {
  display: block;
}

.catalog-change {
  display: grid;
  gap: 1px;
  margin-bottom: 5px;
}

.catalog-change:last-child {
  margin-bottom: 0;
}

.catalog-change strong {
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
}

.catalog-change span {
  color: var(--ink);
  font-size: 10px;
  overflow-wrap: anywhere;
}

.catalog-retained {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

.catalog-preview-actions {
  margin: 0;
  padding: 13px 16px;
  border-top: 1px solid var(--line);
  background: var(--shell);
}

.catalog-preview-actions form {
  margin: 0;
}

@media (max-width: 760px) {
  .catalog-upload-form {
    align-items: stretch;
    flex-direction: column;
  }

  .catalog-sync-panel .panel-head,
  .catalog-preview-panel .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .catalog-sync-stats,
  .catalog-preview-counts {
    justify-content: flex-start;
  }
}
