:root {
  --ink: #0f1720;
  --muted: #647280;
  --line: #dbe3e8;
  --paper: #f4f7f8;
  --panel: #fff;
  --navy: #102637;
  --green: #0a8f72;
  --green-soft: #e7f6f1;
  --blue: #2e6fa7;
  --blue-soft: #e8f1f8;
  --gold: #b8892f;
  --gold-soft: #f7efe0;
  --orange: #c36b19;
  --orange-soft: #fff2e3;
  --red: #b94040;
  --red-soft: #fbeaea;
  --shadow: 0 18px 50px rgba(18, 40, 55, 0.12);
  --font: "Aptos", "PingFang SC", "Microsoft YaHei", sans-serif;
  --num: "DIN Alternate", "IBM Plex Mono", monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
}

button,
input,
select {
  font: inherit;
}

.language-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.language-switch select {
  width: auto;
  min-width: 150px;
  min-height: 38px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}

.language-inline {
  display: inline-flex;
  align-items: center;
}

.auth-language-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}

.web-language-switch {
  min-height: 44px;
  padding: 8px 10px 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbfb;
}

.web-language-switch select {
  min-width: 168px;
  min-height: 34px;
  border-radius: 10px;
  background-color: #fff;
}

.side-language-switch {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.side-language-switch select {
  width: 100%;
  min-width: 0;
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.16);
  color: #edf4f7;
}

.side-language-switch option,
.admin-session-language option {
  color: var(--ink);
  background: #fff;
}

.admin-login-language-row {
  padding: 18px 28px 0;
}

.admin-session-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-session-language {
  width: auto;
  min-width: 260px;
}

.admin-session-language select {
  min-width: 150px;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: .68;
}

.form-error {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(185, 64, 64, .28);
  border-radius: 8px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
}

.form-error[hidden] {
  display: none;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  background: var(--navy);
  color: #edf4f7;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}

.brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  background: white;
  border-radius: 8px;
  padding: 4px;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  margin-top: 3px;
  color: #a9bbc8;
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav button {
  position: relative;
  height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  color: #d8e5eb;
  background: transparent;
  text-align: left;
}

.nav button.active,
.nav button:hover {
  background: rgba(255,255,255,.1);
  color: white;
}

.side-card {
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 8px;
  background: rgba(255,255,255,.05);
}

.side-card span,
.side-card small {
  color: #a9bbc8;
}

.side-card strong {
  display: block;
  margin-top: 8px;
}

.user-side-session strong {
  line-height: 1.35;
  word-break: break-word;
}

.user-side-session small {
  display: block;
  margin-top: 6px;
  min-height: 16px;
  word-break: break-word;
}

.side-logout {
  width: 100%;
  height: 34px;
  margin-top: 12px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 8px;
  color: #edf4f7;
  background: rgba(255,255,255,.08);
}

.side-logout:hover {
  background: rgba(255,255,255,.14);
}

body.admin-entry #userLoginPanel,
body.admin-entry #userSessionPanel,
body.admin-entry .topbar .actions,
body.admin-entry .side-card {
  display: none !important;
}

body.user-logged-out:not(.admin-entry) {
  min-height: 100vh;
  background:
    linear-gradient(115deg, rgba(16,38,55,.92), rgba(16,38,55,.58) 48%, rgba(10,143,114,.62)),
    url("/assets/公司展示/液冷系统与工程师运维现场.png") center / cover fixed;
}

body.user-logged-out:not(.admin-entry) .app {
  display: block;
  min-height: 100vh;
}

body.user-logged-out:not(.admin-entry) .sidebar,
body.user-logged-out:not(.admin-entry) .topbar,
body.user-logged-out:not(.admin-entry) #userSessionPanel {
  display: none !important;
}

body.user-logged-out:not(.admin-entry) .main {
  min-height: 100vh;
  padding: 32px;
  display: grid;
  place-items: center;
}

body.user-logged-out:not(.admin-entry) .view {
  display: none !important;
}

body.admin-entry {
  background:
    radial-gradient(circle at 82% 12%, rgba(10,143,114,.14), transparent 28%),
    linear-gradient(135deg, #eef4f5 0%, #f7faf9 48%, #e9f1f3 100%);
}

body.admin-entry .main {
  min-height: 100vh;
  padding: 0;
}

body.admin-entry .topbar {
  padding: 38px 48px 18px;
  background: transparent;
  border-bottom: 0;
}

body.admin-entry #adminView {
  overflow-anchor: none;
  width: min(100%, 1480px);
  padding: 0 48px 48px;
}

body.admin-entry #adminLoginPanel {
  max-width: 760px;
  margin-top: 8px !important;
  overflow: hidden;
  border: 1px solid rgba(219,227,232,.9);
  border-radius: 18px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 28px 70px rgba(18,40,55,.14);
}

body.admin-entry #adminLoginPanel .panel-head {
  padding: 26px 28px 22px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(16,38,55,.98), rgba(10,143,114,.88)),
    url("/assets/公司展示/高密度GPU服务器机房.png") center / cover;
  border-bottom: 0;
}

body.admin-entry #adminLoginPanel .panel-head h3 {
  margin-bottom: 8px;
  font-size: 24px;
}

body.admin-entry #adminLoginPanel .panel-head p {
  color: rgba(255,255,255,.82);
}

.admin-login-form {
  padding: 24px 28px 28px;
  display: grid;
  gap: 16px;
}

.admin-login-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-login-form input {
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
  background: #f9fbfc;
  color: var(--ink);
  font-weight: 700;
}

.admin-login-form input:focus {
  outline: 2px solid rgba(10,143,114,.18);
  border-color: rgba(10,143,114,.54);
  background: #fff;
}

.admin-login-form .btn {
  height: 48px;
  border-radius: 12px;
}

.main {
  min-width: 0;
  padding: 22px;
}

.topbar {
  min-height: 64px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  font-size: 26px;
}

.topbar p,
.panel-head p {
  margin-bottom: 0;
  color: var(--muted);
}

.actions,
.hero-actions,
.inline-form {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.btn {
  position: relative;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  background: white;
  color: var(--ink);
  font-weight: 700;
}

.btn.primary {
  background: var(--green);
  border-color: var(--green);
  color: white;
}

.btn.has-unread::after,
.nav button.has-unread::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--red);
  box-shadow: 0 0 0 2px #fff;
}

.nav button.has-unread::after {
  box-shadow: 0 0 0 2px var(--navy);
}

.btn.danger {
  background: #b42318;
  border-color: #b42318;
  color: white;
}

.btn.light {
  background: rgba(255,255,255,.9);
}

.btn.small {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.hero {
  min-height: 340px;
  padding: 28px;
  border-radius: 8px;
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    linear-gradient(90deg, rgba(12,28,40,.93), rgba(12,28,40,.72) 48%, rgba(12,28,40,.18)),
    url("/assets/公司展示/高密度GPU服务器机房.png") center / cover;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.eyebrow {
  display: inline-block;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.22);
  color: #c8e9e0;
  background: rgba(255,255,255,.08);
  font-size: 12px;
}

.hero h2 {
  max-width: 720px;
  margin: 18px 0 10px;
  font-size: 40px;
  line-height: 1.08;
}

.hero p {
  max-width: 680px;
  color: #d1dde4;
  line-height: 1.7;
}

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

.hero-stats div {
  border-left: 1px solid rgba(255,255,255,.2);
  padding-left: 12px;
}

.hero-stats strong {
  display: block;
  font-family: var(--num);
  font-size: 22px;
}

.hero-stats span {
  color: #b6c6d0;
  font-size: 12px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.cards.tight {
  grid-template-columns: repeat(3, minmax(0,1fr));
  margin: 18px 0;
}

.card,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(16,38,55,.06);
}

.card {
  padding: 16px;
}

.card span,
label,
.panel-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.card strong {
  display: block;
  margin-top: 8px;
  font-family: var(--num);
  font-size: 25px;
}

.card small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
}

.balance {
  background:
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,255,255,.9)),
    url("/assets/公司展示/液冷系统与工程师运维现场.png") center / cover;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.two {
  grid-template-columns: minmax(0,1fr) minmax(360px,.72fr);
}

.panel-head {
  min-height: 62px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-head h3 {
  margin: 0;
  font-size: 16px;
}

.auth-panel {
  margin-bottom: 16px;
}

.auth-form {
  padding-top: 0;
}

.user-auth-panel {
  width: min(100%, 1040px);
}

.user-auth-layout {
  min-height: 620px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 22px;
  overflow: hidden;
  background: rgba(255,255,255,.95);
  box-shadow: 0 30px 90px rgba(0,0,0,.22);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
}

.user-auth-copy {
  padding: 44px;
  color: #fff;
  background:
    linear-gradient(145deg, rgba(16,38,55,.98), rgba(10,143,114,.76)),
    url("/assets/公司展示/高密度GPU服务器机房.png") center / cover;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.auth-logo-line {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-logo-line img {
  width: 48px;
  height: 48px;
  padding: 5px;
  border-radius: 12px;
  background: #fff;
}

.auth-logo-line strong,
.auth-logo-line span {
  display: block;
}

.auth-logo-line span {
  margin-top: 3px;
  color: rgba(255,255,255,.72);
  font-size: 13px;
}

.user-auth-copy h2 {
  margin: auto 0 14px;
  max-width: 520px;
  font-size: 48px;
  line-height: 1.05;
}

.user-auth-copy p {
  max-width: 560px;
  margin: 0;
  color: rgba(255,255,255,.78);
  font-size: 16px;
  line-height: 1.7;
}

.user-auth-card {
  padding: 34px;
  display: grid;
  align-content: center;
}

.user-auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 22px;
  padding: 5px;
  border-radius: 14px;
  background: #edf3f4;
}

.user-auth-tabs button {
  height: 42px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.user-auth-tabs button.active {
  background: #fff;
  color: var(--green);
  box-shadow: 0 8px 22px rgba(18,40,55,.08);
}

.user-auth-form {
  display: none;
  gap: 14px;
}

.user-auth-form.active {
  display: grid;
}

.user-auth-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.user-auth-form input,
.user-auth-form select {
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
  background: #f9fbfc;
  color: var(--ink);
  font-weight: 700;
}

.user-auth-form input:focus,
.user-auth-form select:focus {
  outline: 2px solid rgba(10,143,114,.18);
  border-color: rgba(10,143,114,.52);
  background: #fff;
}

.user-auth-form .btn {
  height: 48px;
  margin-top: 4px;
  border-radius: 12px;
}

.session-summary {
  margin: 0 18px 18px;
}

.admin-session-panel {
  overflow: hidden;
}

.admin-session-panel .panel-head {
  align-items: center;
}

.admin-session-panel .panel-head p:empty {
  display: none;
}

.admin-session-grid {
  padding: 18px;
  display: grid;
  grid-template-columns: 1fr 1.4fr .8fr;
  gap: 12px;
}

.admin-session-grid article {
  min-height: 86px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #fff, #f8fbfb);
}

.admin-session-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-session-grid strong {
  display: block;
  margin-top: 10px;
  color: var(--ink);
  font-size: 16px;
  overflow-wrap: anywhere;
}

.admin-permission-tags {
  padding: 0 18px 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-permission-tags span {
  padding: 8px 10px;
  border-radius: 999px;
  background: var(--green-soft);
  color: #247061;
  font-size: 12px;
  font-weight: 900;
}

.admin-workbench-tabs {
  position: sticky;
  top: 0;
  z-index: 12;
  margin: 0 0 16px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px rgba(18,40,55,.08);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 6px;
}

.admin-workbench-tabs button {
  height: 42px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.admin-workbench-tabs button.active {
  background: var(--navy);
  color: #fff;
}

.admin-review-grid {
  grid-template-columns: 1fr;
}

body.admin-entry [data-admin-panel][hidden] {
  display: none !important;
}

.admin-live-notice {
  position: sticky;
  top: 64px;
  z-index: 11;
  margin: -4px 0 14px;
  padding: 10px 14px;
  border: 1px solid rgba(12, 145, 116, .25);
  border-radius: 10px;
  background: #effaf6;
  color: #176653;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(18,40,55,.06);
}

.admin-live-notice[hidden] {
  display: none !important;
}

.admin-task-board {
  overflow: hidden;
}

.admin-task-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(176px, 1fr));
  gap: 10px;
  padding: 0 18px 18px;
}

.admin-task-card {
  min-height: 108px;
  text-align: left;
  border: 1px solid var(--line);
  border-left: 4px solid transparent;
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  display: grid;
  gap: 7px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(18,40,55,.04);
}

.admin-task-card:hover {
  border-color: rgba(12, 145, 116, .32);
  transform: translateY(-1px);
}

.admin-task-card[data-priority="high"] {
  border-left-color: var(--orange);
}

.admin-task-card[data-priority="normal"] {
  border-left-color: var(--green);
}

.admin-task-empty {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fbfcfc;
  color: var(--muted);
  font-weight: 900;
  text-align: center;
}

.admin-task-latest {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 8px 20px rgba(18,40,55,.04);
}

.admin-task-latest-head {
  min-height: 44px;
  padding: 10px 14px;
  background: #f8fafb;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-task-latest-head strong {
  color: var(--ink);
  font-size: 14px;
}

.admin-task-latest-head span {
  border-radius: 999px;
  padding: 4px 10px;
  background: var(--green-soft);
  color: #247061;
  font-size: 12px;
  font-weight: 900;
}

.admin-task-latest-list {
  display: grid;
}

.admin-task-latest-list .unified-result-card:last-child {
  border-bottom: 0;
}

.admin-task-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.admin-task-card strong {
  color: var(--navy);
  font-size: 26px;
  line-height: 1;
}

.admin-task-card small {
  color: var(--muted);
  font-weight: 700;
  line-height: 1.45;
}

.list {
  padding: 16px;
  display: grid;
  gap: 12px;
}

.holding,
.risk-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.risk-center-panel {
  grid-column: 1 / -1;
  overflow: hidden;
}

.risk-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 0 18px 14px;
}

.risk-summary article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  background: #fbfcfc;
}

.risk-summary span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.risk-summary strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 22px;
}

.risk-filter {
  padding-top: 0;
}

.risk-note {
  display: block;
  max-width: 340px;
  color: var(--muted);
  line-height: 1.45;
}

.admin-analytics-panel {
  overflow: hidden;
}

.analytics-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 0 18px 14px;
}

.analytics-kpis article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfc;
}

.analytics-kpis span,
.chart-head span,
.chart-legend span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.analytics-kpis strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 22px;
}

.ops-automation-panel {
  overflow: hidden;
}

.ops-automation-grid {
  padding: 0 18px 14px;
}

.ops-maintenance-disclosure {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  overflow: hidden;
}

.ops-maintenance-disclosure summary {
  padding: 14px 16px;
  cursor: pointer;
  display: grid;
  gap: 4px;
}

.ops-maintenance-disclosure summary strong {
  color: var(--ink);
  font-size: 15px;
}

.ops-maintenance-disclosure summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.ops-automation-grid-inner {
  border-top: 1px solid var(--line);
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.ops-automation-grid-inner article,
.ops-rule-snapshot article {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfc;
}

.ops-automation-grid-inner article {
  display: grid;
  gap: 8px;
  align-content: start;
  background: #fff;
}

.ops-automation-grid-inner span,
.ops-rule-snapshot span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.ops-automation-grid-inner strong,
.ops-rule-snapshot strong {
  display: block;
  margin: 5px 0 8px;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.1;
}

.ops-automation-grid-inner p {
  margin: 0;
  min-height: 48px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.ops-rule-snapshot {
  padding: 0 18px 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.ops-rule-snapshot strong {
  margin-bottom: 0;
  font-size: 18px;
}

.ops-job-meta {
  display: grid;
  gap: 5px;
  min-height: 62px;
}

.ops-job-meta small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.ops-run-list {
  border-top: 1px solid var(--line);
  background: #fff;
}

.ops-run-list .table-wrap {
  max-height: 310px;
}

.operations-config-panel {
  border-color: #b7d8ce;
}

.ops-override-form {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f8fafb;
}

.analytics-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 14px;
  padding: 0 18px 18px;
}

.chart-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.chart-card.wide {
  grid-row: span 2;
}

.chart-head {
  min-height: 56px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.chart-head h4 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
}

.chart-box {
  min-height: 230px;
  padding: 14px;
}

.chart-svg {
  width: 100%;
  height: 230px;
  display: block;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
  margin-right: 5px;
}

.stack-chart {
  display: grid;
  gap: 12px;
}

.stack-row {
  display: grid;
  gap: 7px;
}

.stack-row label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.stack-track {
  height: 12px;
  border-radius: 999px;
  background: #edf2f4;
  overflow: hidden;
}

.stack-fill {
  height: 100%;
  min-width: 3px;
  border-radius: inherit;
}

.donut-wrap {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  min-height: 170px;
}

.donut {
  width: 132px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(var(--green) 0 80%, var(--blue) 80% 90%, var(--gold) 90% 100%);
  position: relative;
}

.donut::after {
  content: "";
  position: absolute;
  inset: 24px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--line);
}

.donut-total {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.holding {
  display: grid;
  grid-template-columns: 76px minmax(0,1fr);
  gap: 14px;
}

.mark {
  min-height: 66px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--navy), var(--green));
  color: white;
  font-family: var(--num);
  font-size: 21px;
  font-weight: 900;
}

.holding h4 {
  margin: 0 0 6px;
}

.holding p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.settlement-reference-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 10px;
  color: #516574;
  font-size: 12px;
}

.settlement-reference-line span {
  min-height: 28px;
  padding: 6px 10px;
  border: 1px solid #dce8e5;
  border-radius: 999px;
  background: #f6fbf9;
  white-space: nowrap;
}

.settlement-reference-line b {
  color: var(--green);
  font-family: var(--num);
}

.progress {
  height: 8px;
  background: #e8edf0;
  border-radius: 999px;
  overflow: hidden;
}

.progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.table-wrap {
  overflow: auto;
}

.pager {
  min-height: 56px;
  padding: 10px 18px;
  border-top: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  font-weight: 800;
}

.pager > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pager .btn {
  min-width: 74px;
  justify-content: center;
}

[data-pagination-for][hidden] {
  display: none;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
  font-size: 13px;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  background: #f8fafb;
  color: var(--muted);
  font-size: 12px;
}

.num,
td:nth-child(2),
td:nth-child(4),
td:nth-child(6) {
  font-family: var(--num);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
}

.badge.ok {
  color: var(--green);
  background: var(--green-soft);
}

.badge.warn {
  color: var(--orange);
  background: var(--orange-soft);
}

.badge.risk {
  color: var(--red);
  background: var(--red-soft);
}

.badge.info {
  color: var(--blue);
  background: var(--blue-soft);
}

.wallet-box {
  display: grid;
  grid-template-columns: 160px minmax(0,1fr);
  gap: 18px;
  padding: 18px;
  align-items: center;
}

.qr {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.qr img {
  width: 100%;
  height: 100%;
  display: block;
}

.qr span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.address {
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
}

.address span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--num);
}

.notice {
  padding: 11px;
  border-radius: 8px;
  background: var(--orange-soft);
  color: #875014;
  line-height: 1.55;
  font-size: 13px;
}

.form {
  padding: 18px;
  display: grid;
  gap: 13px;
}

.form.horizontal {
  grid-template-columns: 220px 220px minmax(280px,1fr) auto;
  align-items: end;
}

label {
  display: grid;
  gap: 7px;
}

input,
select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: white;
  color: var(--ink);
}

input[type="file"] {
  padding-top: 9px;
}

.file-picker {
  position: relative;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 10px;
  background: white;
}

.file-picker input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  overflow: hidden;
  cursor: pointer;
  z-index: 3;
}

.file-picker-button {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafb;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  font-weight: 900;
  font-size: 12px;
}

.file-picker-name {
  min-width: 0;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

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

.check-field {
  min-height: 42px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
  color: var(--ink);
  font-size: 13px;
}

.check-field input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.file-field {
  min-width: 180px;
}

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

.upload-box {
  min-height: 118px;
  padding: 14px;
  border: 1px dashed #b9c7cf;
  border-radius: 8px;
  background: #f8fafb;
  display: grid;
  align-content: center;
  gap: 9px;
}

.upload-box input {
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
}

.upload-box span {
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-stack {
  padding: 18px;
  display: grid;
  gap: 20px;
}

.document-stack h4 {
  margin: 0 0 10px;
}

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

.document-card {
  min-height: 68px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafb;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.document-card strong,
.document-card span {
  display: block;
}

.document-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-card span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.empty-state {
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #f8fafb;
  color: var(--muted);
  font-size: 13px;
}

.security-overview {
  margin-bottom: 16px;
}

.security-grid {
  margin-bottom: 16px;
}

.security-forms {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.security-form {
  background: white;
}

.security-form h4 {
  margin: 0;
}

.security-list {
  padding: 16px;
  display: grid;
  gap: 10px;
}

.security-item {
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafb;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.security-item.log {
  grid-template-columns: 1fr;
}

.security-item strong,
.security-item span,
.security-item small {
  display: block;
}

.security-item strong {
  color: var(--ink);
}

.security-item span {
  margin-top: 5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.security-item small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}

.support-user-grid {
  align-items: start;
}

.support-overview {
  margin-bottom: 16px;
}

.support-user-form textarea,
.support-user-reply textarea {
  resize: vertical;
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  font: inherit;
}

.support-user-list {
  padding: 14px;
  display: grid;
  gap: 10px;
}

.support-ticket-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafb;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  cursor: pointer;
}

.support-ticket-card.active {
  border-color: var(--green);
  background: var(--green-soft);
}

.support-ticket-card strong,
.support-ticket-card span {
  display: block;
}

.support-ticket-card span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.support-user-detail {
  padding: 14px;
}

.support-detail-head.user {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 12px;
}

.support-user-reply {
  border-top: 1px solid var(--line);
}

.message-overview {
  margin-bottom: 16px;
}

.message-list {
  padding: 14px;
  display: grid;
  gap: 10px;
}

.message-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  cursor: pointer;
}

.message-card.unread {
  border-color: rgba(10,143,114,.34);
  background: var(--green-soft);
}

.message-card strong,
.message-card span {
  display: block;
}

.message-card span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.message-card p {
  margin: 8px 0 0;
  color: var(--ink);
  line-height: 1.5;
}

.admin-doc-panel .chain-summary {
  padding-top: 16px;
}

.admin-order-panel .chain-summary {
  padding-top: 16px;
}

.admin-document-filter {
  padding-top: 0;
}

.admin-order-filter {
  padding-top: 0;
}

.unified-search-panel {
  overflow: hidden;
}

.unified-search-filter {
  padding-top: 0;
}

.unified-search-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  padding: 0 18px 14px;
}

.unified-search-summary article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfc;
}

.unified-search-summary span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.unified-search-summary strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
  color: var(--ink);
}

.admin-split-list {
  border-top: 1px solid var(--line);
  background: #fff;
}

.admin-split-list + .admin-split-list {
  margin-top: 12px;
}

.admin-list-title {
  min-height: 42px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  background: #f8fafb;
  border-bottom: 1px solid var(--line);
}

.admin-list-title strong {
  font-size: 14px;
}

.admin-list-title span {
  border-radius: 999px;
  padding: 4px 10px;
  background: var(--green-soft);
  color: #247061;
  font-size: 12px;
  font-weight: 900;
}

.unified-result-list {
  display: grid;
  gap: 0;
}

.unified-result-card {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 13px 18px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  cursor: pointer;
}

.unified-result-card:hover {
  background: #f8fafb;
}

.focus-pulse {
  outline: 2px solid rgba(10,143,114,.34);
  outline-offset: 3px;
  transition: outline-color .2s ease;
}

.unified-result-card > span {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.unified-result-card strong,
.unified-result-card small {
  display: block;
}

.unified-result-card strong {
  font-size: 14px;
}

.unified-result-card small {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.45;
}

.customer-workspace {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  border-top: 1px solid var(--line);
}

.admin-user-tools {
  border-top: 1px solid var(--line);
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  background: #f8fafb;
}

.admin-account-tools {
  border-top: 1px solid var(--line);
  padding: 16px;
  display: grid;
  gap: 14px;
  background: #f8fafb;
}

#databasePanel {
  overflow: hidden;
}

#databasePanel > .panel-head {
  background:
    linear-gradient(135deg, rgba(255,255,255,.98), rgba(241,248,246,.96)),
    radial-gradient(circle at 92% 10%, rgba(10,143,114,.14), transparent 28%);
}

#databasePanel > .panel-head h3 {
  font-size: 18px;
}

#databasePanel #createDatabaseBackup {
  min-width: 112px;
}

.admin-user-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.admin-user-form-head {
  min-height: 46px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, #ffffff 0%, #eef7f3 100%);
}

.admin-user-form-head h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 950;
}

.admin-user-fields {
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.admin-user-fields label {
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.admin-user-fields .btn {
  height: 42px;
  justify-content: center;
}

.privilege-fields {
  grid-template-columns: minmax(220px, 1fr) 110px 130px 150px minmax(210px, 1fr) 128px;
}

.status-fields {
  grid-template-columns: minmax(240px, 1fr) 140px minmax(220px, 1fr) 128px;
}

.password-reset-fields {
  grid-template-columns: minmax(240px, 1fr) minmax(180px, .5fr) minmax(220px, 1fr) 128px;
}

.balance-adjust-fields {
  grid-template-columns: minmax(240px, 1fr) 140px 140px minmax(220px, 1fr) 128px;
}

.admin-account-create-fields {
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1fr) minmax(180px, .7fr) 180px 140px;
}

.admin-role-preview {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.admin-role-preview article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  display: grid;
  gap: 6px;
}

.admin-role-preview b {
  font-size: 13px;
}

.admin-role-preview span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.admin-row-actions {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 260px;
}

.admin-row-actions small {
  grid-column: 1 / -1;
  color: var(--muted);
  line-height: 1.45;
  white-space: normal;
}

.admin-inline-reason {
  min-width: 220px;
}

.customer-sidebar {
  padding: 16px;
  border-right: 1px solid var(--line);
  background: #f8fafb;
  display: grid;
  align-content: start;
  gap: 12px;
}

.customer-sidebar label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.customer-sidebar input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: #fff;
}

.customer-sidebar .btn {
  justify-content: center;
}

.customer-list {
  display: grid;
  gap: 8px;
  max-height: 560px;
  overflow: auto;
}

.customer-sidebar [data-pagination-for] .pager {
  padding: 10px 0 0;
  border-top: 0;
  background: transparent;
  display: grid;
  gap: 8px;
}

.customer-sidebar [data-pagination-for] .pager > div {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.customer-list-item {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 8px 10px;
  align-items: center;
}

.customer-list-item span {
  grid-row: span 2;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 12px;
}

.customer-list-item b,
.customer-list-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-list-item b {
  font-size: 13px;
}

.customer-list-item small {
  color: var(--muted);
  font-size: 12px;
}

.customer-list-item.active {
  border-color: var(--green);
  background: var(--green-soft);
}

.customer-detail {
  min-width: 0;
  padding: 16px;
  display: grid;
  gap: 14px;
}

.customer-hero {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) minmax(220px, auto);
  gap: 14px;
  align-items: center;
}

.customer-avatar {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
}

.customer-hero h3 {
  margin: 0 0 5px;
  font-size: 20px;
}

.customer-hero p {
  margin: 0;
  color: var(--muted);
}

.customer-hero-meta {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.customer-hero-meta b {
  color: var(--ink);
  font-family: var(--num);
}

.customer-sections > section {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.profile-feed {
  padding: 12px;
  display: grid;
  gap: 8px;
}

.profile-feed article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #f8fafb;
  display: grid;
  gap: 4px;
}

.profile-feed b {
  font-size: 13px;
}

.profile-feed span,
.empty-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.audit-filter-form {
  border-bottom: 1px solid var(--line);
}

.support-ticket-filter {
  padding-top: 0;
}

.support-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr);
  gap: 14px;
  padding: 0 16px 16px;
  align-items: start;
}

.support-workspace > section,
.support-create-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.support-detail {
  display: grid;
  gap: 0;
}

.support-detail-head {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.support-detail-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.support-detail-head h3 {
  margin: 6px 0;
  font-size: 20px;
}

.support-detail-head p {
  margin: 0;
  color: var(--muted);
}

.support-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.support-meta {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #f8fafb;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.support-meta b {
  color: var(--ink);
  font-family: var(--num);
}

.support-timeline {
  padding: 14px;
  display: grid;
  gap: 10px;
  max-height: 390px;
  overflow: auto;
}

.support-timeline article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #f8fafb;
}

.support-timeline article.admin {
  border-color: #b7d8ce;
  background: var(--green-soft);
}

.support-timeline article.system {
  border-color: #d6c08f;
  background: var(--gold-soft);
}

.support-timeline b {
  font-size: 13px;
}

.support-timeline p {
  margin: 6px 0;
  color: var(--ink);
  line-height: 1.5;
}

.support-timeline span {
  color: var(--muted);
  font-size: 12px;
}

.support-edit-form,
.support-reply-form,
.support-create-form {
  padding: 14px;
  display: grid;
  gap: 12px;
}

.support-edit-form {
  border-bottom: 1px solid var(--line);
  background: #fffaf0;
}

.support-edit-form strong {
  font-size: 14px;
}

.support-edit-form label,
.support-reply-form label,
.support-create-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.support-edit-form textarea,
.support-reply-form textarea,
.support-create-form textarea {
  resize: vertical;
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  font: inherit;
}

.support-edit-form input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  font: inherit;
}

.support-create-form {
  margin: 0 16px 16px;
  padding: 0;
}

.support-create-form > label,
.support-create-form > button {
  margin: 0 14px;
}

.support-create-form > button {
  margin-bottom: 14px;
  justify-self: start;
}

.selected-row {
  background: var(--green-soft);
}

.admin-document-grid {
  padding: 0 18px 18px;
  align-items: start;
}

.admin-document-grid > section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.compact-head {
  min-height: 54px;
  padding: 12px 14px;
}

.compact-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.doc-actions {
  display: flex;
  gap: 6px;
}

.holding-actions {
  margin-top: 10px;
}

.contract-template {
  width: min(680px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.contract-template > span {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.contract-template h2 {
  margin: 10px 0;
  font-size: 28px;
}

.contract-template p {
  color: var(--muted);
  line-height: 1.65;
}

.contract-template dl {
  margin: 18px 0 0;
  display: grid;
  gap: 12px;
}

.contract-template dt {
  font-weight: 900;
}

.contract-template dd {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.summary {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.summary b {
  color: var(--ink);
  font-family: var(--num);
}

.summary.wide {
  grid-template-columns: repeat(3, minmax(0,1fr));
}

.config-form {
  padding: 18px;
  display: grid;
  gap: 16px;
}

.config-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  gap: 12px;
}

fieldset {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f8fafb;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

fieldset legend {
  padding: 0 6px;
  color: var(--navy);
  font-weight: 700;
}

fieldset label:first-of-type:last-child,
fieldset label:nth-last-child(1):nth-child(2) {
  grid-column: auto;
}

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

.config-tables section {
  display: grid;
  gap: 10px;
}

.config-tables h4 {
  margin: 0;
}

.compact {
  max-width: 220px;
}

.config-actions {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.config-input {
  min-width: 110px;
}

.chain-layout {
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(360px, .9fr) minmax(420px, 1.1fr);
  gap: 16px;
}

.chain-map {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.chain-step {
  min-height: 68px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: white;
  padding: 12px;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 12px;
  align-items: center;
}

.chain-step.ready {
  border-left-color: var(--green);
}

.chain-step.planned {
  border-left-color: var(--gold);
}

.chain-step > span {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--blue-soft);
  color: var(--blue);
  font-family: var(--num);
  font-weight: 700;
}

.chain-step strong,
.chain-step small {
  display: block;
}

.chain-step small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}

.chain-config {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-content: start;
}

.chain-config .summary,
.chain-config button {
  grid-column: 1 / -1;
}

.manual-wallet-layout .wide-field {
  grid-column: 1 / -1;
}

.chain-summary,
.treasury-grid {
  padding: 0 18px 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 12px;
}

.treasury-grid {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.chain-summary article,
.treasury-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafb;
}

.chain-summary span,
.chain-summary strong,
.treasury-grid span,
.treasury-grid strong {
  display: block;
}

.chain-summary span,
.treasury-grid span {
  color: var(--muted);
  font-size: 12px;
}

.chain-summary strong,
.treasury-grid strong,
.mono {
  font-family: var(--num);
}

.chain-summary strong,
.treasury-grid strong {
  margin-top: 4px;
  font-size: 22px;
}

#databaseSummary {
  padding-top: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.system-status-card {
  position: relative;
  min-height: 116px;
  overflow: hidden;
  padding: 16px 16px 14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,251,250,.96));
}

.system-status-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--green), rgba(43,116,166,.86));
}

.system-status-card small {
  display: block;
  margin-top: 10px;
  max-width: 28ch;
  line-height: 1.45;
}

#databaseConsistency {
  margin: 0 18px 18px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.system-check-card {
  min-height: 112px;
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.96), rgba(245,249,250,.96));
}

.system-check-card.is-ok {
  background:
    linear-gradient(135deg, rgba(240,250,246,.98), rgba(255,255,255,.98));
}

.system-check-card.needs-review {
  background:
    linear-gradient(135deg, rgba(255,248,235,.98), rgba(255,255,255,.98));
}

.system-check-kicker {
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
}

.system-check-card h3 {
  margin: 6px 0;
  font-size: 20px;
}

.system-check-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.system-health-badge {
  min-width: 74px;
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  text-align: center;
  font-size: 13px;
  font-weight: 900;
}

.system-check-card.needs-review .system-health-badge {
  background: var(--orange-soft);
  color: var(--orange);
}

.system-risk-grid {
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.system-risk-grid article {
  min-height: 78px;
  padding: 14px 18px;
  border-right: 1px solid var(--line);
  background: #fbfcfc;
}

.system-risk-grid article:last-child {
  border-right: 0;
}

.system-risk-grid span,
.system-risk-grid strong {
  display: block;
}

.system-risk-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.system-risk-grid strong {
  margin-top: 6px;
  font-family: var(--num);
  font-size: 24px;
}

.system-issue-table {
  border-top: 1px solid var(--line);
}

small {
  color: var(--muted);
}

#productsView {
  min-height: calc(100vh - 40px);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(170px,1fr));
  gap: 12px;
}

.product {
  position: relative;
  min-height: 345px;
  padding: 16px;
  overflow: hidden;
  border-top: 4px solid var(--green);
  background-color: #fff;
  background-image:
    linear-gradient(180deg, rgba(255,255,255,.96) 0%, rgba(255,255,255,.88) 42%, rgba(255,255,255,.54) 100%),
    var(--product-bg);
  background-size: cover;
  background-position: var(--product-web-position, center);
}

.product {
  --product-bg: url("/assets/product-bg-web-unified-313x345.png");
  --product-web-position: center;
}

.product > * {
  position: relative;
  z-index: 1;
}

.product h3 {
  margin: 12px 0 4px;
  font-size: 25px;
}

.product p {
  color: var(--muted);
  min-height: 38px;
  font-size: 13px;
}

.target {
  margin: 14px 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.target strong {
  display: block;
  font-family: var(--num);
  font-size: 25px;
}

.order-panel,
.team-panel {
  margin-top: 16px;
}

.team-panel {
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.9), white),
    url("/assets/公司展示/机房园区外景.png") center / cover;
}

.team-panel h2 {
  margin: 8px 0;
  font-size: 42px;
}

.level-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin: 20px 0;
}

.level-row b {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: white;
  color: var(--muted);
}

.level-row b.active {
  background: var(--gold-soft);
  color: var(--gold);
  border-color: rgba(184,137,47,.4);
}

.invite {
  max-width: 620px;
}

.risk-item strong,
.risk-item span {
  display: block;
}

.risk-item span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  pointer-events: none;
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--navy);
  color: white;
  box-shadow: var(--shadow);
  transition: .2s ease;
  z-index: 10;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  padding: 28px;
  background: rgba(15, 23, 32, .56);
}

.modal.show {
  display: grid;
  place-items: center;
}

.modal-card {
  width: min(920px, 100%);
  max-height: min(760px, 92vh);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.document-preview {
  min-height: 360px;
  padding: 18px;
  background: #eef3f5;
  overflow: auto;
  display: grid;
  place-items: center;
}

.document-preview img {
  max-width: 100%;
  max-height: 650px;
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(16,38,55,.16);
}

.document-preview iframe {
  width: 100%;
  height: 650px;
  border: 0;
  border-radius: 8px;
  background: white;
}

.confirm-card {
  width: min(620px, 100%);
  grid-template-rows: auto auto;
}

.capacity-action-card {
  width: min(680px, 100%);
  grid-template-rows: auto auto;
}

.withdrawal-edit-card {
  width: min(760px, 100%);
  grid-template-rows: auto minmax(0, 1fr);
}

.withdrawal-edit-body {
  padding: 18px;
  display: grid;
  gap: 14px;
  overflow: auto;
}

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

.withdrawal-edit-body label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.withdrawal-edit-body input,
.withdrawal-edit-body select,
.withdrawal-edit-body textarea {
  width: 100%;
  min-width: 0;
}

.withdrawal-edit-body textarea {
  min-height: 88px;
  resize: vertical;
}

.input-with-unit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  overflow: hidden;
}

.input-with-unit input {
  border: 0;
  border-radius: 0;
}

.input-with-unit b {
  padding: 0 14px;
  color: var(--ink);
}

#adminWithdrawalEditSummary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.capacity-action-body {
  padding: 18px;
  display: grid;
  gap: 16px;
  overflow: auto;
}

@media (max-width: 720px) {
  .withdrawal-edit-grid,
  #adminWithdrawalEditSummary {
    grid-template-columns: 1fr;
  }
}

.capacity-action-body .form {
  display: grid;
  gap: 12px;
}

.capacity-action-body textarea {
  min-height: 96px;
  resize: vertical;
}

.confirm-body {
  padding: 18px;
  display: grid;
  gap: 18px;
}

.confirm-summary {
  display: grid;
  gap: 10px;
}

.confirm-summary article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 10px;
  background: #f8fafb;
}

.confirm-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.confirm-summary strong {
  min-width: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@media (max-width: 1280px) {
  .grid.two {
    grid-template-columns: 1fr;
  }

  .config-grid {
    grid-template-columns: repeat(2, minmax(190px, 1fr));
  }

  .ops-automation-grid,
  .ops-rule-snapshot {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .config-tables {
    grid-template-columns: 1fr;
  }

  .chain-layout {
    grid-template-columns: 1fr;
  }

  .security-forms {
    grid-template-columns: 1fr;
  }

  .product-grid {
    grid-template-columns: repeat(3, minmax(170px,1fr));
  }

  .form.horizontal {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 880px) {
  body.user-logged-out:not(.admin-entry) .main {
    padding: 16px;
  }

  .user-auth-layout {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .user-auth-copy {
    min-height: 280px;
    padding: 28px;
  }

  .user-auth-copy h2 {
    margin-top: 42px;
    font-size: 34px;
  }

  .user-auth-card {
    padding: 24px;
  }

  .app {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .main {
    padding: 16px;
  }

  .topbar,
  .actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero h2 {
    font-size: 31px;
  }

  .hero-stats,
  .cards,
  .cards.tight,
  .product-grid,
  .config-grid,
  .config-actions,
  .chain-config,
	  .chain-summary,
	  .treasury-grid,
	  #databaseSummary,
	  .system-risk-grid,
	  .risk-summary,
  .analytics-kpis,
  .analytics-grid,
  .ops-automation-grid,
  .ops-rule-snapshot,
  .donut-wrap,
  .admin-user-tools,
  .admin-account-tools,
  .admin-user-fields,
  .privilege-fields,
  .status-fields,
  .password-reset-fields,
  .balance-adjust-fields,
  .admin-account-create-fields,
  .admin-role-preview,
  .customer-workspace,
  .customer-hero,
  .unified-search-summary,
  .unified-result-card,
  .support-workspace,
  .support-detail-head,
  .support-meta {
    grid-template-columns: 1fr;
  }

  .support-actions {
    justify-content: flex-start;
  }

  .customer-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .customer-list {
    max-height: 340px;
  }

  .wallet-box {
    grid-template-columns: 1fr;
  }

  .qr {
    max-width: 220px;
  }

  .summary.wide,
  .level-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-row,
  .upload-grid,
  .document-card,
  .security-item {
    grid-template-columns: 1fr;
  }

  .modal {
    padding: 14px;
  }

  .document-preview {
    min-height: 280px;
  }

  .document-preview iframe {
    height: 520px;
  }
}

.inline-auth-code {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.inline-auth-code .btn {
  min-height: 40px;
  white-space: nowrap;
}

.form-hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.profile-account-summary {
  margin-bottom: 14px;
}

.production-lock-note {
  display: grid;
  gap: 4px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid rgba(184, 137, 47, .32);
  border-radius: 12px;
  background: #fff8ea;
  color: #5f4a1f;
}

.production-lock-note strong {
  color: #2f2410;
}

.production-lock-note span,
.muted-text {
  color: var(--muted);
  font-size: 13px;
}

.withdraw-balance-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
  color: var(--muted);
  font-size: 13px;
}

.withdraw-balance-line b {
  color: var(--ink);
}

.kyc-review-panel {
  grid-column: 1 / -1;
}

.kyc-review-panel .table-wrap table {
  min-width: 980px;
}

.kyc-review-panel .document-preview-btn {
  margin: 2px 4px 2px 0;
}

/* ── 阿拉伯语 RTL 布局适配 ─────────────────────────────── */
html.i18n-rtl body {
  direction: rtl;
  text-align: right;
}

html.i18n-rtl .sidebar {
  border-right: none;
  border-left: 1px solid var(--border, #e5e7eb);
}

html.i18n-rtl .topbar,
html.i18n-rtl .admin-topbar-right {
  flex-direction: row-reverse;
}

html.i18n-rtl .main {
  /* 侧边栏在右侧时 main 的 margin 方向翻转 */
  margin-left: 0;
  margin-right: 220px;
}

html.i18n-rtl input,
html.i18n-rtl textarea,
html.i18n-rtl select {
  direction: rtl;
  text-align: right;
}

html.i18n-rtl input[type="email"],
html.i18n-rtl input[type="number"],
html.i18n-rtl input[inputmode="numeric"],
html.i18n-rtl input[type="password"] {
  direction: ltr;
  text-align: left;
}

html.i18n-rtl .table-wrap table {
  direction: rtl;
}

html.i18n-rtl .table-wrap th,
html.i18n-rtl .table-wrap td {
  text-align: right;
}

html.i18n-rtl .form-row label,
html.i18n-rtl .field-label {
  text-align: right;
}

html.i18n-rtl .card,
html.i18n-rtl .panel,
html.i18n-rtl .view-header {
  text-align: right;
}

html.i18n-rtl .actions,
html.i18n-rtl .btn-row,
html.i18n-rtl .form-actions {
  flex-direction: row-reverse;
}

html.i18n-rtl .badge,
html.i18n-rtl .tag {
  direction: ltr; /* badge 保持 LTR 避免数字倒排 */
}
/* ──────────────────────────────────────────────────────── */
