:root {
  --bg: #eef3f7;
  --panel: #ffffff;
  --panel-soft: #f8fbfd;
  --ink: #17212b;
  --muted: #697888;
  --subtle: #9aa9b5;
  --line: #dce6ee;
  --blue: #246bfe;
  --blue-700: #164ec3;
  --green: #16a064;
  --amber: #d88715;
  --red: #d84848;
  --shadow: 0 18px 48px rgba(38, 57, 77, .10);
  --radius: 18px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 8%, rgba(36, 107, 254, .10), transparent 28%),
    radial-gradient(circle at 84% 0%, rgba(22, 160, 100, .09), transparent 30%),
    linear-gradient(180deg, #f7fbfd 0%, var(--bg) 100%);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button {
  height: 38px;
  border: 0;
  border-radius: 12px;
  padding: 0 15px;
  background: var(--blue);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}
button:hover { background: var(--blue-700); }
input, select, textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  outline: none;
  padding: 0 11px;
}
input:focus, select:focus, textarea:focus {
  border-color: rgba(36, 107, 254, .72);
  box-shadow: 0 0 0 4px rgba(36, 107, 254, .10);
}
.hidden { display: none !important; }

/* Simple login, intentionally quiet. */
.simple-login-page {
  display: grid;
  place-items: center;
  padding: 24px;
}
.simple-login-shell {
  width: min(390px, 100%);
  display: grid;
  gap: 18px;
}
.simple-brand {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
}
.simple-logo {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: #17212b;
  color: #fff;
  font-weight: 900;
}
.simple-brand strong { font-size: 22px; }
.simple-brand span, .simple-card-title p { margin: 0; color: var(--muted); font-size: 13px; }
.simple-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 26px;
}
.simple-card-title { text-align: center; margin-bottom: 20px; }
.simple-card-title h1 { margin: 0 0 8px; font-size: 22px; }
.simple-form { display: grid; gap: 14px; }
.simple-form label, .stack-form label, .form-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.simple-form button { width: 100%; }
.simple-form .login-remember {
  min-height: 30px;
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  color: var(--ink);
  cursor: pointer;
}
.simple-form .login-remember input {
  width: 16px;
  min-height: 16px;
  accent-color: var(--blue);
}
.simple-form .login-remember span {
  color: var(--muted);
  font-size: 13px;
}
.simple-register-box { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.text-toggle {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--blue);
}
.auth-links {
  display: flex;
  justify-content: space-between;
  margin-top: 18px;
  color: var(--muted);
  font-size: 13px;
}

/* Admin app. */
.admin-page {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
}
.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px;
  background: rgba(255,255,255,.78);
  border-right: 1px solid var(--line);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
}
.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: #17212b;
  color: #fff;
}
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.14);
  font-weight: 900;
}
.brand-block strong { display: block; font-size: 17px; }
.brand-block span { display: block; margin-top: 3px; color: rgba(255,255,255,.65); font-size: 12px; }
.side-nav { display: grid; align-content: start; gap: 7px; }
.side-nav a, .side-footer {
  min-height: 40px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  padding: 0 13px;
  color: var(--muted);
  font-weight: 800;
}
.side-nav a:hover, .side-nav a.active, .side-footer:hover {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 8px 22px rgba(38, 57, 77, .07);
}
.admin-content {
  min-width: 0;
  padding: 24px;
  display: grid;
  gap: 18px;
}
.page-header {
  min-height: 76px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.overline {
  margin: 0 0 7px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .16em;
}
.page-header h1 {
  margin: 0;
  font-size: 34px;
  letter-spacing: -0.04em;
  line-height: 1.05;
}
.page-header span, .card-head p {
  color: var(--muted);
  font-size: 13px;
}
.header-actions, .inline-actions, .row-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.secondary-button, .row-actions button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}
.secondary-button:hover, .row-actions button:hover {
  background: #f7fbff;
  color: var(--blue);
}
.danger-button, .text-danger {
  border: 1px solid #ffd9d9;
  background: #fff4f4;
  color: var(--red);
}
.danger-button:hover, .text-danger:hover { background: #ffecec; color: #b92f2f; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
.metric-card {
  min-height: 126px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 18px;
  display: grid;
  align-content: space-between;
  position: relative;
  overflow: hidden;
}
.metric-card::after {
  content: "";
  position: absolute;
  right: -28px;
  top: -32px;
  width: 112px;
  height: 112px;
  border-radius: 30px;
  background: rgba(36, 107, 254, .10);
  transform: rotate(17deg);
}
.metric-card.alert::after { background: rgba(216, 72, 72, .12); }
.metric-card span, .metric-card small { color: var(--muted); font-weight: 800; }
.metric-card strong { font-size: 38px; line-height: 1; letter-spacing: -0.05em; }

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(330px, .65fr);
  gap: 18px;
  align-items: start;
}
.messages-layout { grid-template-columns: minmax(0, 1fr) 380px; }
.bottom-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.panel-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.92);
  box-shadow: var(--shadow);
  padding: 18px;
}
.panel-card.wide { min-width: 0; }
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.card-head h2 { margin: 0 0 5px; font-size: 20px; letter-spacing: -0.03em; }
.card-head p { margin: 0; line-height: 1.55; }
.compact-head { align-items: center; }
.form-grid {
  display: grid;
  gap: 10px;
}
.user-form {
  grid-template-columns: 1fr 1fr 1fr 110px 1fr 104px;
  align-items: end;
}
.stack-form { display: grid; gap: 12px; }
.scope-box {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-soft);
}
.scope-box label {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--ink);
  font-weight: 700;
  font-size: 13px;
}
.scope-box input, th input, td input[type="checkbox"] {
  width: 16px;
  min-height: 16px;
  accent-color: var(--blue);
}
.inline-message, .table-footer, .empty-text {
  min-height: 18px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.filter-row {
  display: grid;
  grid-template-columns: 190px minmax(260px, 1fr) 140px 92px;
  gap: 10px;
  margin-bottom: 12px;
}
.filter-row.message-filter { grid-template-columns: 190px 170px 92px; }
.filter-row.single { grid-template-columns: minmax(260px, 1fr); }
.data-table {
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: auto;
  background: #fff;
}
.compact-table { max-height: 330px; }
.account-table { max-height: 510px; }
.workbench-account-table {
  height: 560px;
  max-height: 560px;
}
.message-table { max-height: 680px; }
.admin-pagination {
  min-height: 58px;
  border-top: 1px solid var(--line);
  padding: 10px 2px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
}
.admin-pagination-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.admin-pagination-actions strong {
  min-width: 72px;
  color: var(--ink);
  text-align: center;
}
.admin-pagination-actions button {
  min-width: 82px;
  min-height: 36px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}
.admin-pagination-actions button:disabled {
  cursor: not-allowed;
  opacity: .45;
}
.admin-page-size {
  min-width: 126px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 8px;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  background: #f8fbfd;
  white-space: nowrap;
}
.admin-page-size span { white-space: nowrap; }
.admin-page-size select {
  min-width: 64px;
  min-height: 28px;
  border: 0;
  padding: 0;
  background: transparent;
}
table {
  width: 100%;
  min-width: 880px;
  border-collapse: collapse;
}
th, td {
  padding: 12px 11px;
  border-bottom: 1px solid #edf2f6;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}
th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fbfd;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
td strong { display: block; margin-bottom: 4px; }
td small { display: block; color: var(--subtle); line-height: 1.5; }
code {
  display: inline-flex;
  padding: 4px 7px;
  border-radius: 8px;
  background: #edf5ff;
  color: var(--blue-700);
  font-family: Consolas, "Cascadia Mono", monospace;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  background: #eef3f6;
  color: var(--muted);
}
.status-pill.ok { background: #e9f9f1; color: var(--green); }
.status-pill.warn { background: #fff6e6; color: var(--amber); }
.status-pill.muted { background: #eef3f6; color: var(--muted); }
.empty-cell { color: var(--subtle); text-align: center; }
.owner-list, .mini-list {
  display: grid;
  gap: 9px;
  max-height: 380px;
  overflow: auto;
  padding-right: 3px;
}
.owner-list { margin-top: 13px; max-height: 210px; }
.owner-card, .mini-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-soft);
  padding: 11px;
}
.owner-card strong, .mini-item strong { display: block; margin-bottom: 4px; }
.owner-card span, .owner-card p, .mini-item span, .mini-item p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
.mini-list.tall { max-height: 560px; }
.mini-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}
.mini-item.rich { align-items: start; }
.mini-item em {
  color: var(--subtle);
  font-style: normal;
  font-size: 12px;
  white-space: nowrap;
}
.mini-item em.ok { color: var(--green); }
.mini-item em.warn { color: var(--amber); }
.text-link { color: var(--blue); font-weight: 900; font-size: 13px; }
.activity-editor { display: grid; gap: 10px; }
.activity-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 1.4fr) 96px;
  gap: 10px;
}

@media (max-width: 1200px) {
  .admin-page { grid-template-columns: 1fr; }
  .admin-sidebar {
    position: static;
    height: auto;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto;
    align-items: center;
  }
  .side-nav { display: flex; overflow: auto; }
  .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .workspace-grid, .messages-layout, .bottom-grid { grid-template-columns: 1fr; }
  .user-form { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .admin-content { padding: 16px; }
  .page-header, .card-head { display: grid; }
  .metric-grid, .filter-row, .filter-row.message-filter, .user-form, .activity-row { grid-template-columns: 1fr; }
  .admin-sidebar { padding: 12px; }
}


/* 2026-07-04 management navigation rework */
.link-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
input[disabled] {
  background: #f3f7fa;
  color: var(--muted);
}
.metric-card.small { min-height: 112px; }
.workbench-bottom { grid-template-columns: .85fr 1.15fr 1fr; }
.client-board {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.client-directory {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 12px;
}
.client-list {
  display: grid;
  gap: 9px;
  max-height: calc(100vh - 250px);
  overflow: auto;
  padding-right: 3px;
}
.client-card {
  height: auto;
  min-height: 82px;
  display: grid;
  justify-items: start;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  padding: 12px;
}
.client-card:hover, .client-card.active {
  border-color: rgba(36, 107, 254, .35);
  background: #f4f8ff;
  color: var(--ink);
  box-shadow: 0 12px 30px rgba(36, 107, 254, .12);
}
.client-card strong { font-size: 15px; }
.client-card span, .client-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.client-detail {
  display: grid;
  gap: 18px;
  min-width: 0;
}
.selected-client-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  background:
    linear-gradient(135deg, rgba(36, 107, 254, .12), rgba(22, 160, 100, .08)),
    rgba(255,255,255,.94);
}
.selected-client-card h2 {
  margin: 0 0 5px;
  font-size: 28px;
  letter-spacing: -0.04em;
}
.selected-client-card span { color: var(--muted); font-size: 13px; }
.client-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.client-bottom { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 360px; }
.compact-search {
  width: min(360px, 100%);
}
.owner-data-table { max-height: 360px; }
.vault-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.vault-card {
  min-height: 520px;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
}
.vault-form {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
}
.vault-search { margin: 12px 0; }
.vault-scroll {
  max-height: 310px;
  min-height: 0;
}
.activity-panel {
  min-height: calc(100vh - 140px);
}

@media (max-width: 1200px) {
  .client-board, .vault-layout { grid-template-columns: 1fr; }
  .client-directory { position: static; }
  .client-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .client-bottom, .workbench-bottom { grid-template-columns: 1fr; }
  .vault-form { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .selected-client-card { display: grid; }
  .client-metrics, .vault-form { grid-template-columns: 1fr; }
}


/* 2026-07-04 vault/activity correction */
.vault-single {
  grid-template-columns: minmax(0, 1fr);
}
.vault-single .vault-card {
  min-height: 520px;
  max-width: 1180px;
}
.client-bottom.slim {
  grid-template-columns: minmax(0, 1fr) 380px;
}
@media (max-width: 1200px) {
  .client-bottom.slim { grid-template-columns: 1fr; }
}

/* 2026-07-04 force admin sidebar */
@media (max-width: 1200px) {
  .admin-page {
    display: grid;
    grid-template-columns: 224px minmax(0, 1fr);
  }
  .admin-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    grid-template-columns: none;
    grid-template-rows: auto 1fr auto;
    align-items: stretch;
  }
  .side-nav {
    display: grid;
    overflow: visible;
  }
}
@media (max-width: 720px) {
  .admin-page {
    grid-template-columns: 196px minmax(680px, 1fr);
  }
  .admin-sidebar {
    padding: 12px;
  }
  body.admin-page {
    overflow-x: auto;
  }
  .admin-pagination {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* 2026-07-04 vault fit redesign */
.vault-admin-content {
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 100vh;
}
.vault-page-header {
  min-height: 70px;
}
.vault-fit-shell {
  min-height: calc(100vh - 132px);
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}
.vault-create-card,
.vault-list-card {
  min-height: 0;
}
.vault-create-card {
  display: grid;
  grid-template-rows: auto auto auto minmax(24px, 1fr);
  gap: 16px;
  padding: 20px;
  overflow: hidden;
}
.vault-create-top {
  min-height: 128px;
  border-radius: 22px;
  padding: 18px;
  color: #fff;
  background:
    radial-gradient(circle at 12% 18%, rgba(255,255,255,.28), transparent 28%),
    linear-gradient(135deg, #17212b 0%, #25394c 100%);
}
.vault-create-top h2 {
  margin: 18px 0 8px;
  font-size: 24px;
  letter-spacing: -0.04em;
}
.vault-create-top p,
.vault-note p {
  margin: 0;
  color: rgba(255,255,255,.72);
  line-height: 1.6;
  font-size: 13px;
}
.vault-chip {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.16);
  font-size: 12px;
  font-weight: 900;
}
.vault-create-form {
  display: grid;
  gap: 11px;
}
.vault-create-form label {
  display: grid;
  gap: 6px;
}
.vault-create-form label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.vault-create-form button {
  width: 100%;
  min-height: 44px;
  margin-top: 2px;
}
.vault-note {
  align-self: end;
  border: 1px solid #dce7f2;
  border-radius: 18px;
  padding: 14px;
  background: #f7fbff;
}
.vault-note strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
}
.vault-note p {
  color: var(--muted);
}
.vault-list-card {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px;
  padding: 20px;
  overflow: hidden;
}
.vault-list-head {
  min-height: 82px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.vault-list-head h2 {
  margin: 0 0 6px;
  font-size: 26px;
  letter-spacing: -0.04em;
}
.vault-list-head span {
  color: var(--muted);
  font-size: 13px;
}
.vault-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(74px, 1fr));
  gap: 8px;
  min-width: 260px;
}
.vault-stats span {
  display: grid;
  gap: 2px;
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid #e4edf5;
  border-radius: 16px;
  background: #f8fbfd;
  color: var(--muted);
  font-weight: 900;
}
.vault-stats strong {
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}
.vault-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 86px;
  gap: 10px;
}
.vault-table-scroll {
  height: 100%;
  max-height: none;
  min-height: 0;
  overflow: auto;
}
.vault-table {
  min-width: 760px;
}
.vault-table th,
.vault-table td {
  padding: 13px 12px;
}
.vault-table th:nth-child(1) { width: 20%; }
.vault-table th:nth-child(2) { width: 16%; }
.vault-table th:nth-child(3) { width: 18%; }
.vault-table th:nth-child(4) { width: 12%; }
.vault-table th:nth-child(6) { width: 190px; }
.vault-actions {
  display: flex;
  gap: 7px;
  flex-wrap: nowrap;
}
.vault-actions button {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 12px;
}
@media (max-width: 1180px) {
  .vault-fit-shell {
    grid-template-columns: 300px minmax(0, 1fr);
  }
  .vault-stats {
    min-width: 220px;
    grid-template-columns: repeat(3, minmax(64px, 1fr));
  }
}
@media (max-width: 900px) {
  .vault-fit-shell {
    grid-template-columns: minmax(280px, .38fr) minmax(560px, 1fr);
  }
  .vault-list-head {
    display: grid;
  }
}

/* 2026-07-04 admin card polish */
.admin-sidebar {
  background:
    linear-gradient(180deg, rgba(255,255,255,.88) 0%, rgba(246,250,253,.82) 100%);
  backdrop-filter: blur(18px);
}
.brand-block {
  position: relative;
  overflow: hidden;
  align-items: flex-start;
  min-height: 92px;
  padding: 16px;
  border: 1px solid rgba(190, 207, 220, .72);
  background:
    radial-gradient(circle at 90% 12%, rgba(36,107,254,.16), transparent 30%),
    radial-gradient(circle at 12% 88%, rgba(22,160,100,.13), transparent 32%),
    linear-gradient(135deg, rgba(255,255,255,.98) 0%, rgba(245,250,255,.96) 58%, rgba(239,248,244,.96) 100%);
  color: var(--ink);
  box-shadow: 0 16px 34px rgba(40, 61, 81, .08);
}
.brand-block::before {
  content: "";
  position: absolute;
  right: -42px;
  bottom: -58px;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background:
    linear-gradient(135deg, rgba(36,107,254,.14), rgba(22,160,100,.10));
}
.brand-block::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 12px;
  height: 1px;
  background: linear-gradient(90deg, rgba(36,107,254,.30), transparent);
}
.brand-block > * {
  position: relative;
  z-index: 1;
}
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 15px;
  background:
    linear-gradient(135deg, #246bfe 0%, #16a064 100%);
  color: #fff;
  box-shadow: 0 12px 24px rgba(36, 107, 254, .22);
}
.brand-block strong {
  color: var(--ink);
  font-size: 18px;
  letter-spacing: -0.03em;
}
.brand-block span {
  display: inline-flex;
  width: fit-content;
  margin-top: 7px;
  padding: 4px 8px;
  border: 1px solid rgba(211, 224, 235, .86);
  border-radius: 999px;
  background: rgba(255,255,255,.74);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.vault-create-top {
  position: relative;
  overflow: hidden;
  min-height: 142px;
  border: 1px solid rgba(216, 229, 238, .92);
  color: var(--ink);
  background:
    radial-gradient(circle at 88% 18%, rgba(36,107,254,.18), transparent 28%),
    radial-gradient(circle at 16% 92%, rgba(22,160,100,.14), transparent 34%),
    linear-gradient(135deg, #fffefa 0%, #f4faff 58%, #eefaf4 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.86), 0 14px 32px rgba(40, 61, 81, .07);
}
.vault-create-top::before {
  content: "";
  position: absolute;
  right: -34px;
  top: -42px;
  width: 124px;
  height: 124px;
  border-radius: 32px;
  transform: rotate(18deg);
  background: linear-gradient(135deg, rgba(36,107,254,.12), rgba(22,160,100,.08));
}
.vault-create-top::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 14px;
  height: 1px;
  background: linear-gradient(90deg, rgba(36,107,254,.28), rgba(22,160,100,.18), transparent);
}
.vault-create-top > * {
  position: relative;
  z-index: 1;
}
.vault-create-top h2 {
  color: var(--ink);
}
.vault-create-top p {
  color: var(--muted);
}
.vault-chip {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(36,107,254,.20);
  background: rgba(255,255,255,.82);
  color: var(--blue-700);
  box-shadow: 0 8px 18px rgba(36, 107, 254, .08);
}
.vault-create-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,.96) 0%, rgba(248,252,255,.94) 100%);
}

/* 2026-07-04 admin profile and self password change */
.admin-profile-grid {
  display: grid;
  grid-template-columns: minmax(320px, .42fr) minmax(430px, .58fr);
  gap: 18px;
  align-items: start;
}
.profile-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.94);
  box-shadow: var(--shadow);
  padding: 20px;
}
.profile-identity-card {
  min-height: 330px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 88% 12%, rgba(36,107,254,.16), transparent 32%),
    radial-gradient(circle at 12% 92%, rgba(22,160,100,.13), transparent 34%),
    linear-gradient(135deg, rgba(255,255,255,.98), rgba(244,250,255,.94));
}
.profile-kicker {
  margin: 0 0 12px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .14em;
}
.profile-identity-card h1 {
  margin: 0 0 24px;
  font-size: 34px;
  letter-spacing: -0.04em;
}
.profile-meta {
  display: grid;
  gap: 6px;
  margin: 14px 0;
}
.profile-meta span,
.profile-note,
.profile-card-head p {
  color: var(--muted);
  font-size: 13px;
}
.profile-meta strong {
  font-size: 18px;
}
.profile-note {
  margin: 22px 0 0;
  line-height: 1.7;
}
.profile-card-head {
  margin-bottom: 18px;
}
.profile-card-head h2 {
  margin: 0 0 6px;
  font-size: 22px;
}
.profile-card-head p {
  margin: 0;
  line-height: 1.6;
}
.password-panel {
  max-width: 580px;
}
.password-form {
  display: grid;
  gap: 12px;
}
.password-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.password-message {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
.password-message.error {
  color: var(--red);
}
.password-message.success {
  color: var(--green);
}
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
button:disabled {
  cursor: not-allowed;
  opacity: .62;
}
@media (max-width: 980px) {
  .admin-profile-grid {
    grid-template-columns: 1fr;
  }
  .password-panel {
    max-width: none;
  }
}

/* 2026-07-29 machine management */
.machine-page .admin-content {
  padding-bottom: 36px;
}
.machine-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
.machine-metrics article {
  min-height: 116px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(38, 57, 77, .07);
}
.machine-metrics span,
.machine-metrics small {
  color: var(--muted);
  font-size: 13px;
}
.machine-metrics strong {
  font-size: 32px;
  line-height: 1;
}
.machine-metrics .pending {
  border-color: rgba(216, 135, 21, .28);
  background: linear-gradient(135deg, #fff 0%, #fff9ef 100%);
}
.machine-metrics .unassigned {
  border-color: rgba(216, 72, 72, .20);
  background: linear-gradient(135deg, #fff 0%, #fff7f7 100%);
}
.machine-create-strip {
  min-height: 82px;
  display: grid;
  grid-template-columns: minmax(240px, .8fr) minmax(190px, .5fr) minmax(260px, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 15px 18px;
  border: 1px solid rgba(36, 107, 254, .18);
  border-radius: 16px;
  background: linear-gradient(135deg, #fff 0%, #f5f9ff 62%, #f2fbf6 100%);
}
.machine-create-strip strong,
.machine-create-strip span {
  display: block;
}
.machine-create-strip strong {
  margin-bottom: 5px;
  font-size: 17px;
}
.machine-create-strip span {
  color: var(--muted);
  font-size: 12px;
}
.machine-workspace {
  min-width: 0;
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.machine-list-panel,
.machine-account-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.96);
  box-shadow: var(--shadow);
}
.machine-list-panel {
  padding: 16px;
}
.machine-account-panel {
  overflow: hidden;
}
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 2px 14px;
}
.machine-account-title {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}
.section-title h2,
.section-title p {
  margin: 0;
}
.section-title h2 {
  font-size: 19px;
}
.section-title p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}
.compact-button {
  min-height: 32px;
  height: 32px;
  padding: 0 11px;
}
.machine-list {
  display: grid;
  gap: 10px;
}
.machine-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.machine-item:hover,
.machine-item.active {
  border-color: rgba(36, 107, 254, .42);
  box-shadow: 0 10px 24px rgba(36, 107, 254, .09);
  transform: translateY(-1px);
}
.machine-item.active {
  background: linear-gradient(135deg, #fff 0%, #f4f8ff 100%);
}
.machine-item.disabled {
  opacity: .7;
}
.machine-item-head,
.machine-item-head > div,
.machine-card-footer,
.machine-card-footer > div {
  display: flex;
  align-items: center;
}
.machine-item-head,
.machine-card-footer {
  justify-content: space-between;
  gap: 10px;
}
.machine-item-head > div {
  gap: 7px;
}
.machine-item p {
  min-height: 18px;
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: 12px;
}
.signal {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #a8b4bf;
  box-shadow: 0 0 0 4px rgba(168,180,191,.14);
}
.signal.online {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(22,160,100,.14);
}
.machine-count-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  padding: 10px;
  border-radius: 10px;
  background: var(--panel-soft);
}
.machine-count-grid span {
  color: var(--muted);
  text-align: center;
  font-size: 10px;
}
.machine-count-grid b {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 16px;
}
.machine-card-footer {
  margin-top: 11px;
}
.machine-card-footer small {
  max-width: 145px;
  overflow: hidden;
  color: var(--subtle);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.machine-card-footer > div {
  gap: 5px;
}
.mini-action {
  height: 28px;
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 10px;
}
.machine-filter-grid {
  display: grid;
  grid-template-columns: 170px 150px 170px minmax(210px, 1fr) auto;
  gap: 8px;
  padding: 14px 18px 10px;
}
.machine-filter-grid button {
  min-width: 64px;
  padding-right: 12px;
  padding-left: 12px;
  white-space: nowrap;
}
.machine-batch-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px 14px;
  border-bottom: 1px solid var(--line);
}
.machine-batch-bar > span {
  min-width: 112px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.machine-batch-bar select {
  width: 170px;
}
.machine-batch-bar button,
.machine-card-footer button {
  padding-right: 10px;
  padding-left: 10px;
  white-space: nowrap;
}
.machine-account-table {
  max-height: 625px;
  overflow: auto;
  border: 0;
  border-radius: 0;
}
.machine-account-table table {
  min-width: 1180px;
}
.machine-account-table th {
  position: sticky;
  top: 0;
  z-index: 2;
}
.machine-dialog {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(20, 30, 40, .44);
  backdrop-filter: blur(5px);
}
.machine-dialog-card {
  width: min(500px, 100%);
  padding: 28px;
  border: 1px solid rgba(255,255,255,.65);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(15, 28, 40, .24);
  text-align: center;
}
.token-success-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--blue), var(--green));
  color: #fff;
  font-weight: 900;
}
.machine-dialog-card h2 {
  margin: 0 0 10px;
}
.machine-dialog-card p {
  color: var(--muted);
  line-height: 1.6;
}
.machine-dialog-card code {
  display: block;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
  color: var(--blue-700);
  font-weight: 800;
}
.machine-dialog-card .dialog-note {
  font-size: 12px;
}
@media (max-width: 1320px) {
  .machine-workspace {
    grid-template-columns: 280px minmax(0, 1fr);
  }
  .machine-filter-grid {
    grid-template-columns: 140px 130px 140px minmax(160px, 1fr) auto;
  }
  .machine-card-footer {
    display: grid;
    justify-items: start;
  }
  .machine-card-footer small {
    max-width: 100%;
  }
}
@media (max-width: 1040px) {
  .machine-metrics {
    grid-template-columns: repeat(3, 1fr);
  }
  .machine-workspace {
    grid-template-columns: 1fr;
  }
  .machine-list {
    grid-template-columns: repeat(2, minmax(260px, 1fr));
  }
  .machine-create-strip {
    grid-template-columns: minmax(220px, 1fr) 190px minmax(220px, 1fr);
  }
  .machine-create-strip button {
    grid-column: 3;
  }
}
