:root {
  --sidebar-bg: #1a1d29;
  --sidebar-text: #c0c4cc;
  --sidebar-active-bg: #409eff22;
  --sidebar-active: #409eff;
  --header-bg: #fff;
  --header-border: #e4e7ed;
  --page-bg: #f0f2f5;
  --card-bg: #fff;
  --text: #303133;
  --text-secondary: #909399;
  --danger: #f56c6c;
  --success: #67c23a;
  --primary: #409eff;
  --radius: 4px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--page-bg);
}

/* Login */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1d29 0%, #2c3e50 100%);
}

.login-card {
  width: 400px;
  padding: 36px 40px 28px;
  background: var(--card-bg);
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 600;
  text-align: center;
}

.login-card .sub {
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 28px;
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-secondary);
  font-size: 13px;
}

.field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #dcdfe6;
  border-radius: var(--radius);
  font-size: 14px;
}

.field input:focus {
  outline: none;
  border-color: var(--primary);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 14px;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
}

.btn:hover {
  filter: brightness(1.05);
}

.btn-block {
  width: 100%;
}

.btn-ghost {
  background: #fff;
  border-color: #dcdfe6;
  color: var(--text);
}

.btn-ghost:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.btn-danger {
  background: var(--danger);
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

.login-error {
  color: var(--danger);
  font-size: 13px;
  margin-bottom: 12px;
  min-height: 18px;
}

/* Console layout */
.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 18px 16px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  line-height: 1.4;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-item {
  padding: 12px 20px;
  cursor: pointer;
  font-size: 14px;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
}

.nav-item.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active);
  border-left-color: var(--sidebar-active);
}

.nav-group-title {
  padding: 14px 20px 6px;
  font-size: 12px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: 52px;
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.breadcrumb {
  color: var(--text-secondary);
  font-size: 13px;
}

.breadcrumb strong {
  color: var(--text);
  font-weight: 500;
}

.userbar {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-secondary);
}

.content {
  padding: 16px 20px 24px;
  flex: 1;
}

.card {
  background: var(--card-bg);
  border-radius: 6px;
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #ebeef5;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
}

.row .field {
  margin: 0;
  min-width: 180px;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.muted {
  color: var(--text-secondary);
  font-size: 12px;
}

.table-wrap {
  overflow-x: auto;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table.data th,
table.data td {
  border: 1px solid #ebeef5;
  padding: 8px 10px;
  text-align: left;
  white-space: nowrap;
}

table.data th {
  background: #fafafa;
  font-weight: 500;
  color: var(--text-secondary);
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
}

.badge-online {
  color: var(--success);
  background: #f0f9eb;
}

.badge-offline {
  color: var(--danger);
  background: #fef0f0;
}

.note-input {
  width: 140px;
  padding: 4px 8px;
  border: 1px solid #dcdfe6;
  border-radius: var(--radius);
}

.hidden {
  display: none !important;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  width: 420px;
  max-width: 94vw;
  background: #fff;
  border-radius: 8px;
  padding: 20px 22px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

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

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

.hint {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 8px;
}

/* Orders */
.order-filter-panel {
  background: linear-gradient(180deg, #f0f4fa 0%, #e8eef6 100%);
  border: 1px solid #c5cdd9;
  border-radius: 8px;
  padding: 14px 16px 12px;
  margin-bottom: 16px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px 16px;
  align-items: end;
}

.order-filter-panel select {
  width: 100%;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid #dcdfe6;
  border-radius: var(--radius);
  font-size: 14px;
  background: #fff;
  color: var(--text);
}

.order-filter-panel select:focus {
  outline: none;
  border-color: var(--primary);
}

.filter-grid .filter-search {
  grid-column: span 2;
  min-width: 240px;
}

@media (max-width: 900px) {
  .filter-grid .filter-search {
    grid-column: span 1;
  }
}

.filter-actions {
  margin-top: 12px;
  margin-bottom: 0;
}

.order-pagination {
  margin-bottom: 14px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid #c5cdd9;
  border-radius: 8px;
}

.order-pagination .pagination-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.order-pagination .pagination-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.order-pagination select {
  min-width: 88px;
  min-height: 32px;
  padding: 4px 8px;
  border: 1px solid #dcdfe6;
  border-radius: var(--radius);
  font-size: 14px;
  background: #fff;
}

.order-pagination .pagination-info {
  flex: 1;
  min-width: 200px;
}

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

.order-card {
  border: 1px solid #9aa8bc;
  border-radius: 10px;
  padding: 16px 18px;
  background: linear-gradient(165deg, #dce6f2 0%, #cfd9e8 45%, #c5d0e3 100%);
  box-shadow: 0 4px 14px rgba(26, 29, 41, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.order-head-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  margin-bottom: 8px;
}

.order-row-no {
  display: inline-block;
  margin-bottom: 0;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #3d5a80 0%, #2c4560 100%);
  letter-spacing: 0.04em;
}

.order-copy-btn {
  flex-shrink: 0;
}

.order-head {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
  line-height: 1.65;
  color: #1a2332;
}

.order-head .amount-line {
  font-weight: 600;
  color: #243447;
  margin-top: 6px;
  font-size: 13px;
}

.order-head .order-receiver-address {
  margin-top: 4px;
  font-weight: 500;
  white-space: pre-wrap;
  word-break: break-word;
}

.sub-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 8px;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 6px;
  overflow: hidden;
}

.sub-table th,
.sub-table td {
  border: 1px solid #aeb9ca;
  padding: 7px 9px;
  text-align: left;
}

.sub-table th {
  background: linear-gradient(180deg, #5a6d85 0%, #4a5c72 100%);
  color: #f0f4fa;
  font-weight: 600;
  font-size: 12px;
}

.sub-table td {
  color: #2c3544;
}

.sub-title {
  font-size: 13px;
  font-weight: 700;
  margin: 14px 0 6px;
  color: #3d4d63;
  letter-spacing: 0.02em;
}
