:root {
  --bg: #f5f7fa;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --line: #dde3ec;
  --line-2: #c6cfdb;
  --text: #142033;
  --muted: #667085;
  --primary: #1769aa;
  --primary-2: #0f4f86;
  --success: #15803d;
  --warning: #b45309;
  --danger: #b42318;
  --info: #0369a1;
  --shadow: 0 14px 34px rgba(20, 32, 51, 0.1);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1180px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  background: linear-gradient(135deg, #eaf1f7 0%, #f8fafc 54%, #eef7f4 100%);
}

.login-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 72px 9vw;
}

.login-copy h1 {
  margin: 0 0 18px;
  font-size: 44px;
  line-height: 1.15;
}

.login-copy p {
  width: 620px;
  max-width: 100%;
  margin: 0;
  color: #415065;
  font-size: 18px;
  line-height: 1.8;
}

.login-card {
  align-self: center;
  margin-right: 72px;
  padding: 34px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.login-card h2 {
  margin: 0 0 6px;
  font-size: 24px;
}

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

.sidebar {
  background: #172033;
  color: #d9e2ef;
  display: flex;
  flex-direction: column;
}

.brand {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand strong {
  display: block;
  color: #fff;
  font-size: 19px;
}

.brand span {
  display: block;
  margin-top: 5px;
  color: #9aa8bd;
  font-size: 12px;
}

.nav {
  overflow: auto;
  padding: 12px;
}

.nav-title {
  padding: 12px 10px 7px;
  color: #8fa0b7;
  font-size: 12px;
}

.nav button {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 6px;
  padding: 9px 10px;
  background: transparent;
  color: inherit;
  text-align: left;
}

.nav button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.nav button.active {
  background: #edf4fb;
  color: #122033;
  font-weight: 700;
}

.icon {
  width: 20px;
  text-align: center;
  font-size: 13px;
}

.main {
  min-width: 0;
}

.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.topbar h1 {
  margin: 0;
  font-size: 20px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.content {
  padding: 22px 24px 34px;
}

.role {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  padding: 6px 10px;
  color: #344054;
  font-size: 13px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.field label {
  color: #344054;
  font-size: 13px;
  font-weight: 650;
}

.field input,
.field select,
.field textarea,
.search {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 9px 11px;
  outline: none;
}

.field textarea {
  min-height: 92px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.search:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 105, 170, 0.12);
}

.btn {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px;
  background: var(--panel-2);
  color: #263445;
  font-weight: 650;
}

.btn:hover {
  border-color: var(--line-2);
  background: #e9eef5;
}

.btn.primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.btn.primary:hover {
  background: var(--primary-2);
}

.btn.danger {
  background: #fff1f0;
  color: var(--danger);
  border-color: #f3b8b4;
}

.btn.ghost {
  background: transparent;
}

.btn.small {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 12px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search {
  width: 280px;
}

.filter-field {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.filter-field input,
.filter-field select {
  width: 132px;
  min-height: 38px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 8px 9px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(20, 32, 51, 0.04);
}

.metric {
  min-height: 112px;
  padding: 16px;
}

.metric-label {
  color: var(--muted);
  font-size: 13px;
}

.metric-value {
  margin-top: 12px;
  font-size: 28px;
  font-weight: 800;
}

.metric-foot {
  margin-top: 10px;
  color: #8a96a8;
  font-size: 12px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 16px;
}

.panel + .panel {
  margin-top: 16px;
}

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

.panel-title {
  font-size: 16px;
  font-weight: 800;
}

.panel-body {
  padding: 16px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

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

th {
  background: #f8fafc;
  color: #526172;
  font-size: 12px;
  font-weight: 800;
}

td {
  color: #263445;
  font-size: 13px;
}

tr:hover td {
  background: #fbfcfe;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
  background: #f8fafc;
  color: #475467;
  font-size: 12px;
  font-weight: 650;
}

.tag.success {
  background: #ecfdf3;
  border-color: #abefc6;
  color: var(--success);
}

.tag.warning {
  background: #fffaeb;
  border-color: #fedf89;
  color: var(--warning);
}

.tag.danger {
  background: #fef3f2;
  border-color: #fecdca;
  color: var(--danger);
}

.tag.info {
  background: #eff8ff;
  border-color: #b2ddff;
  color: var(--info);
}

.amount-positive {
  color: var(--success);
  font-weight: 800;
}

.amount-negative {
  color: var(--danger);
  font-weight: 800;
}

.rating {
  color: #b45309;
  font-weight: 800;
}

.avatar {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  object-fit: cover;
  background: #eef2f6;
  color: var(--muted);
  font-size: 12px;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.hint {
  color: #8a96a8;
  font-size: 12px;
}

.notice {
  margin-bottom: 16px;
  padding: 10px 12px;
  background: #fff8e7;
  border: 1px solid #f3d18b;
  border-radius: 6px;
  color: #6d4600;
  font-size: 13px;
  line-height: 1.6;
}

.actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.list-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.bar-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) 90px;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  font-size: 13px;
}

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

.bar span {
  display: block;
  height: 100%;
  background: var(--primary);
}

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.42);
}

.modal {
  width: 560px;
  max-width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

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

.modal-title {
  font-size: 17px;
  font-weight: 800;
}

.modal-body {
  padding: 18px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.detail-grid div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  padding: 9px 10px;
}

.detail-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.detail-grid strong {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  color: var(--text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 18px 18px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 30;
  min-width: 260px;
  max-width: 420px;
  padding: 12px 14px;
  border-radius: 6px;
  background: #172033;
  color: #fff;
  box-shadow: var(--shadow);
}

.empty {
  padding: 34px;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 960px) {
  body {
    min-width: 0;
  }

  .login,
  .shell,
  .metrics,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .login-copy {
    padding: 42px 26px 0;
  }

  .login-copy h1 {
    font-size: 32px;
  }

  .login-card {
    margin: 24px;
  }

  .nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
  }

  .nav-title {
    display: none;
  }

  .nav button {
    width: auto;
    flex: 0 0 auto;
  }
}
