:root {
  --bg: #f3f5f7;
  --panel: #ffffff;
  --line: #dfe3e8;
  --line-strong: #c9cfd6;
  --text: #17202a;
  --muted: #66717e;
  --accent: #087f5b;
  --accent-hover: #06694b;
  --danger: #b42318;
  --focus: rgba(8, 127, 91, 0.2);
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 14px;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.login-view {
  display: grid;
  min-height: 100vh;
  padding: 24px;
  place-items: center;
  background: #18212b;
}

.login-panel {
  width: min(400px, 100%);
  padding: 32px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: 0 18px 60px rgba(8, 14, 20, 0.3);
}

.login-panel .dialog-mark {
  margin-bottom: 28px;
}

.login-panel h1 {
  margin-bottom: 28px;
  font-size: 24px;
}

.login-form .password-label {
  margin-top: 18px;
}

.app-shell {
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 28px 24px;
  color: #f8fafc;
  background: #18212b;
  border-right: 1px solid #0d141b;
}

.brand-block {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.brand-mark,
.dialog-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 36px;
  height: 36px;
  color: #ffffff;
  background: var(--accent);
  border-radius: 6px;
  font-size: 17px;
  font-weight: 800;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.brand-copy strong {
  font-size: 15px;
}

.brand-copy span {
  color: #9eabb8;
  font-size: 12px;
}

.sidebar-nav {
  width: 100%;
  margin-top: 34px;
}

.nav-item {
  display: block;
  width: 100%;
  padding: 10px 12px;
  color: #aeb9c4;
  border-radius: 5px;
  font-size: 13px;
}

.nav-item.active {
  color: #ffffff;
  background: #25313d;
  box-shadow: inset 3px 0 0 var(--accent);
}

.sidebar-footer {
  margin-top: auto;
  color: #788693;
  font-size: 11px;
}

.main-content {
  width: min(1180px, 100%);
  padding: 30px 38px 48px;
}

.topbar,
.section-heading,
.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.topbar {
  min-height: 58px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 26px;
  line-height: 1.25;
}

.page-description {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

h2 {
  margin-bottom: 4px;
  font-size: 16px;
  line-height: 1.4;
}

.section-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.list-section {
  padding: 0 0 30px;
}

.list-section {
  padding-top: 26px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 650;
}

input {
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  outline: none;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus);
}

.primary-button,
.secondary-button,
.danger-button,
.text-button,
.icon-button {
  border: 0;
  border-radius: 5px;
}

.secondary-button,
.danger-button {
  min-height: 36px;
  padding: 0 14px;
  font-weight: 700;
}

.secondary-button {
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line-strong);
}

.secondary-button:hover {
  background: #f4f6f7;
}

.danger-button {
  color: #ffffff;
  background: var(--danger);
}

.danger-button:hover {
  background: #912018;
}

.secondary-button:disabled,
.danger-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.primary-button {
  min-height: 40px;
  padding: 0 18px;
  color: #ffffff;
  background: var(--accent);
  font-weight: 700;
}

.primary-button:hover {
  background: var(--accent-hover);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.text-button {
  padding: 8px 10px;
  color: var(--muted);
  background: transparent;
}

.text-button:hover {
  color: var(--text);
  background: #e8ebee;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--muted);
  background: transparent;
  font-size: 20px;
}

.icon-button:hover {
  color: var(--text);
  background: #e8ebee;
}

.icon-button.bordered {
  background: var(--panel);
  border: 1px solid var(--line-strong);
}

.form-message {
  min-height: 20px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.form-message.error {
  color: var(--danger);
}

.form-message.success {
  color: var(--accent);
}

.list-heading {
  margin-bottom: 16px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.stat-card {
  min-height: 104px;
  padding: 18px 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.stat-card span {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
}

.stat-card strong {
  font-size: 26px;
  line-height: 1;
}

.stat-card .stat-text {
  font-size: 17px;
}

.table-actions {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.search-field {
  margin: 0;
}

.search-field span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.search-field input {
  width: 240px;
  height: 36px;
}

.table-wrap {
  overflow-x: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 16px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--muted);
  background: #f8f9fa;
  font-size: 12px;
  font-weight: 700;
}

td {
  font-size: 13px;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: #fafbfb;
}

.address-cell {
  max-width: 360px;
  overflow: hidden;
  font-family: Consolas, "Courier New", monospace;
  text-overflow: ellipsis;
}

.wallet-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  color: #075e46;
  background: #e7f5ef;
  border: 1px solid #b8dfd0;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.view-button {
  padding: 5px 8px;
  color: var(--accent);
  background: transparent;
  border: 0;
  border-radius: 4px;
  font-weight: 700;
}

.view-button:hover {
  background: #e7f5ef;
}

.delete-button {
  padding: 5px 8px;
  color: var(--danger);
  background: transparent;
  border: 0;
  border-radius: 4px;
  font-weight: 700;
}

.delete-button:hover {
  background: #fff0ee;
}

.empty-state {
  padding: 54px 20px;
  color: var(--muted);
  text-align: center;
}

.dialog {
  width: min(420px, calc(100vw - 32px));
  padding: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: 0 18px 60px rgba(23, 32, 42, 0.22);
}

.dialog::backdrop {
  background: rgba(23, 32, 42, 0.5);
}

.dialog-body {
  padding: 28px;
}

.dialog-mark {
  margin-bottom: 22px;
}

.dialog-body h2 {
  margin-bottom: 22px;
  font-size: 20px;
}

.full-button {
  width: 100%;
  margin-top: 10px;
}

.detail-dialog {
  width: min(560px, calc(100vw - 32px));
}

.delete-dialog {
  width: min(440px, calc(100vw - 32px));
}

.danger-eyebrow {
  color: var(--danger);
}

.delete-copy {
  margin: -10px 0 16px;
  color: var(--muted);
}

.delete-address {
  padding: 12px;
  overflow-wrap: anywhere;
  color: var(--text);
  background: #f6f7f8;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
}

.detail-header h2 {
  margin-bottom: 0;
}

.detail-list {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 0;
  margin: 24px 0 0;
  border-top: 1px solid var(--line);
}

.detail-list dt,
.detail-list dd {
  margin: 0;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.detail-list dt {
  color: var(--muted);
}

.detail-list dd {
  overflow-wrap: anywhere;
  font-family: Consolas, "Courier New", monospace;
}

[hidden] {
  display: none !important;
}

@media (max-width: 760px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    flex-direction: row;
    align-items: center;
    padding: 14px 18px;
  }

  .brand-block {
    align-items: center;
  }

  .sidebar-nav,
  .sidebar-footer {
    display: none;
  }

  .main-content {
    padding: 24px 18px 36px;
  }

  .topbar {
    margin-bottom: 28px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-card:last-child {
    grid-column: 1 / -1;
  }

  .list-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .table-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .search-field {
    width: 100%;
  }

  .search-field input {
    width: 100%;
  }

  h1 {
    font-size: 23px;
  }

  .primary-button {
    width: 100%;
  }

  th,
  td {
    padding: 12px;
  }
}
