@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;700&family=Space+Grotesk:wght@400;500;600;700&family=Sora:wght@500;600;700&display=swap');

:root {
  --bg: #f4f1e8;
  --bg-soft: #fcfaf4;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-solid: #ffffff;
  --panel-2: #f3f7f5;
  --border: #d5d0c4;
  --border-strong: #b9b29f;
  --text: #1f2937;
  --title: #101827;
  --muted: #5f6b7a;

  --primary: #0f766e;
  --primary-2: #0b5a54;
  --accent: #c4621d;
  --accent-soft: #fff1e5;

  --success: #1f8a4d;
  --warn: #a56416;
  --danger: #c23f3f;

  --shadow: 0 14px 34px rgba(22, 35, 43, 0.08);
  --shadow-soft: 0 6px 18px rgba(22, 35, 43, 0.06);
  --radius-lg: 18px;
  --radius-md: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: 'Space Grotesk', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 540px at -10% -8%, rgba(31, 138, 77, 0.17) 0%, rgba(31, 138, 77, 0) 62%),
    radial-gradient(760px 460px at 105% -15%, rgba(196, 98, 29, 0.2) 0%, rgba(196, 98, 29, 0) 65%),
    linear-gradient(180deg, #faf7ef 0%, #f3f0e7 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

.page {
  max-width: 1640px;
  margin: 18px auto 34px;
  padding: 10px 18px 20px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(8px);
  animation: card-enter 0.45s ease forwards;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(140deg, rgba(15, 118, 110, 0.06), rgba(196, 98, 29, 0.03));
}

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

.card:nth-of-type(2) {
  animation-delay: 0.05s;
}

.card:nth-of-type(3) {
  animation-delay: 0.1s;
}

.card:nth-of-type(4) {
  animation-delay: 0.15s;
}

.card:nth-of-type(5) {
  animation-delay: 0.2s;
}

.card:nth-of-type(6) {
  animation-delay: 0.25s;
}

.card:nth-of-type(7) {
  animation-delay: 0.3s;
}

.hero-card {
  border-color: var(--border-strong);
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.98), rgba(246, 248, 244, 0.92));
}

.hero-card h2 {
  font-size: 22px;
}

.metric-card {
  margin: 0;
  flex: 1;
  min-width: 180px;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, #f5fbf8);
  border-color: #c9ded7;
}

.metric-card h2 {
  margin-bottom: 6px;
  font-size: 13px;
  color: #406055;
}

.metric-value {
  font-size: 24px;
  font-weight: 700;
  color: #0f3c39;
  font-family: 'Sora', 'Noto Sans SC', sans-serif;
}

.metric-value.success {
  color: var(--success);
}

.metric-value.danger {
  color: var(--danger);
}

.metric-value.muted-value {
  color: #7a8594;
}

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

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

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.head-actions .muted {
  min-width: 240px;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.toolbar label {
  min-width: 180px;
}

.table-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: 13px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.6);
  scrollbar-gutter: stable both-edges;
}

.table-wrap::-webkit-scrollbar {
  height: 10px;
}

.table-wrap::-webkit-scrollbar-track {
  background: #ece8dc;
  border-radius: 999px;
}

.table-wrap::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #4f8b84, #2d6e68);
  border-radius: 999px;
  border: 2px solid #ece8dc;
}

.table-wrap::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #2f7f77, #21615b);
}

.nav {
  position: sticky;
  top: 8px;
  z-index: 20;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(8px);
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  background: transparent;
  border: 0;
  color: var(--title);
  font-weight: 700;
  flex: 0 0 auto;
}

.nav-brand img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  box-shadow: 0 6px 14px rgba(12, 90, 84, 0.18);
}

.nav-brand span {
  font-family: 'Sora', 'Noto Sans SC', sans-serif;
  font-size: 18px;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  flex: 1 1 0;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-links a {
  padding: 10px 18px;
  border-radius: 10px;
  color: #3f4f5e;
  background: #f2ede2;
  border: 1px solid transparent;
  transition: transform 0.16s ease, background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.nav-links a:hover {
  transform: translateY(-1px);
  background: #e8f4ef;
  border-color: #80b5a6;
  color: #104d48;
}

.nav-links a.active {
  color: #fff;
  font-weight: 700;
  background: linear-gradient(180deg, var(--primary), var(--primary-2));
  border-color: #0b5a54;
  box-shadow: 0 6px 16px rgba(12, 90, 84, 0.28);
}

.trader-config-table select,
.trader-config-table input {
  width: 100%;
}

.trader-number-input {
  min-width: 120px;
}

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

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.live-api-grid .status-chip {
  display: block;
  min-height: 44px;
  line-height: 1.35;
}

.interface-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.health-overview {
  position: relative;
  margin-bottom: 14px;
  padding: 18px 18px 16px;
  border-radius: 20px;
  border: 1px solid rgba(185, 178, 159, 0.8);
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.95), rgba(247, 243, 235, 0) 42%),
    linear-gradient(135deg, rgba(249, 245, 237, 0.98), rgba(244, 239, 229, 0.94));
  box-shadow: 0 16px 34px rgba(22, 35, 43, 0.08);
  overflow: hidden;
}

.health-overview::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: linear-gradient(180deg, #c9c3b5, #b8b09f);
}

.health-overview-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.health-overview-label {
  font-size: 12px;
  color: #6a7480;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
  font-weight: 700;
}

.health-overview-headline {
  font-size: 24px;
  line-height: 1.2;
  color: var(--title);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.health-overview-summary {
  margin-top: 12px;
  color: #4f5f70;
  font-size: 14px;
  line-height: 1.6;
}

.health-overview-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 82px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(95, 107, 122, 0.18);
  background: rgba(95, 107, 122, 0.1);
  color: #4f5f70;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.health-overview.success {
  border-color: rgba(31, 138, 77, 0.32);
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.95), rgba(232, 247, 237, 0) 45%),
    linear-gradient(135deg, rgba(244, 253, 247, 0.98), rgba(229, 245, 236, 0.95));
}

.health-overview.success::before {
  background: linear-gradient(180deg, #1f8a4d, #49aa70);
}

.health-overview.success .health-overview-badge {
  color: #166534;
  background: rgba(223, 247, 233, 0.95);
  border-color: rgba(31, 138, 77, 0.24);
}

.health-overview.success .health-overview-summary {
  color: #21513b;
}

.health-overview.warn {
  border-color: rgba(165, 100, 22, 0.32);
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.95), rgba(255, 240, 214, 0) 45%),
    linear-gradient(135deg, rgba(255, 250, 241, 0.98), rgba(255, 243, 222, 0.95));
}

.health-overview.warn::before {
  background: linear-gradient(180deg, #c27a21, #e4a34d);
}

.health-overview.warn .health-overview-badge {
  color: #8a4b05;
  background: rgba(254, 239, 213, 0.95);
  border-color: rgba(165, 100, 22, 0.24);
}

.health-overview.warn .health-overview-summary {
  color: #7b4f14;
}

.health-overview.danger {
  border-color: rgba(194, 63, 63, 0.32);
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.95), rgba(253, 233, 233, 0) 45%),
    linear-gradient(135deg, rgba(255, 248, 248, 0.98), rgba(253, 233, 233, 0.95));
}

.health-overview.danger::before {
  background: linear-gradient(180deg, #c23f3f, #df6767);
}

.health-overview.danger .health-overview-badge {
  color: #9c2f2f;
  background: rgba(253, 230, 230, 0.95);
  border-color: rgba(194, 63, 63, 0.24);
}

.health-overview.danger .health-overview-summary {
  color: #8f3434;
}

.health-detail-grid {
  margin-top: 2px;
}

.interface-status-card {
  position: relative;
  padding: 14px 14px 13px;
  border-radius: 16px;
  border: 1px solid rgba(185, 178, 159, 0.7);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 243, 235, 0.92));
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.interface-status-card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, #c9c3b5, #b8b09f);
}

.interface-status-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(22, 35, 43, 0.08);
}

.interface-status-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.interface-status-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--title);
  letter-spacing: 0.01em;
}

.interface-status-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(95, 107, 122, 0.1);
  border: 1px solid rgba(95, 107, 122, 0.18);
  color: #4f5f70;
  font-size: 11px;
  font-weight: 700;
}

.interface-status-detail {
  min-height: 36px;
  color: #4f5f70;
  font-size: 12px;
  line-height: 1.5;
  word-break: break-word;
}

.interface-status-card.success {
  border-color: rgba(31, 138, 77, 0.32);
  background:
    linear-gradient(180deg, rgba(248, 255, 250, 0.98), rgba(234, 247, 239, 0.95));
}

.interface-status-card.success::before {
  background: linear-gradient(180deg, #1f8a4d, #49aa70);
}

.interface-status-card.success .interface-status-badge {
  color: #166534;
  background: rgba(223, 247, 233, 0.95);
  border-color: rgba(31, 138, 77, 0.24);
}

.interface-status-card.success .interface-status-detail {
  color: #21513b;
}

.interface-status-card.warn {
  border-color: rgba(165, 100, 22, 0.32);
  background:
    linear-gradient(180deg, rgba(255, 250, 241, 0.98), rgba(255, 243, 222, 0.95));
}

.interface-status-card.warn::before {
  background: linear-gradient(180deg, #c27a21, #e4a34d);
}

.interface-status-card.warn .interface-status-badge {
  color: #8a4b05;
  background: rgba(254, 239, 213, 0.95);
  border-color: rgba(165, 100, 22, 0.24);
}

.interface-status-card.warn .interface-status-detail {
  color: #7b4f14;
}

.interface-status-card.danger {
  border-color: rgba(194, 63, 63, 0.32);
  background:
    linear-gradient(180deg, rgba(255, 248, 248, 0.98), rgba(253, 233, 233, 0.95));
}

.interface-status-card.danger::before {
  background: linear-gradient(180deg, #c23f3f, #df6767);
}

.interface-status-card.danger .interface-status-badge {
  color: #9c2f2f;
  background: rgba(253, 230, 230, 0.95);
  border-color: rgba(194, 63, 63, 0.24);
}

.interface-status-card.danger .interface-status-detail {
  color: #8f3434;
}

.interface-status-footer {
  margin-top: 12px;
}

.interface-status-footer .muted {
  margin-top: 0;
  padding: 0 4px;
  font-size: 12px;
}

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

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

label.field-disabled {
  opacity: 0.62;
}

input,
select,
textarea,
button {
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.12s ease, background-color 0.16s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #3a8f87;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.16);
  background: #fff;
}

input[readonly] {
  opacity: 0.9;
  background: #f5f2ea;
}

input:disabled,
select:disabled,
textarea:disabled {
  color: #8a93a0;
  background: #ebe6d9;
  border-color: #d7cfbf;
  cursor: not-allowed;
  box-shadow: none;
}

textarea {
  resize: vertical;
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  vertical-align: middle;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid #0b5a54;
  color: #fff;
  background: linear-gradient(180deg, var(--primary), var(--primary-2));
  font-weight: 600;
  height: 38px;
  line-height: 1;
  padding: 0 14px;
  font-family: 'Space Grotesk', 'Noto Sans SC', sans-serif;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.2);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

button.secondary {
  border-color: #2f5a77;
  background: linear-gradient(180deg, #3f6f90, #2c536e);
}

button.danger {
  border-color: #9f3030;
  background: linear-gradient(180deg, #d55555, #b93f3f);
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid #0b5a54;
  color: #fff;
  background: linear-gradient(180deg, var(--primary), var(--primary-2));
  font-weight: 600;
  font-family: 'Space Grotesk', 'Noto Sans SC', sans-serif;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.12s ease, background-color 0.16s ease;
}

.button-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.2);
}

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

.actions .muted {
  flex: 1 1 100%;
  margin-top: 5px;
  min-height: 18px;
  line-height: 18px;
}

.actions .muted.error {
  color: #b43838;
}

.actions.compact {
  gap: 8px;
}

.actions.compact .muted {
  margin-top: 0;
}

.notifications-actions {
  display: block;
  margin-top: 14px;
}

.notifications-actions .button-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  margin-bottom: 12px;
}

.notifications-actions .button-row button {
  min-width: 156px;
}

.notifications-actions .muted {
  display: block;
  margin-top: 0;
  min-height: 18px;
  line-height: 18px;
}

.actions.controls-row {
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 12px;
}

.actions.controls-row label {
  margin: 0;
  min-width: 140px;
}

.actions.controls-row select,
.actions.controls-row button {
  height: 38px;
}

.actions.controls-row button {
  min-width: 120px;
  text-align: center;
}

.actions.controls-row button.active {
  background: var(--accent);
  color: #fff;
  border-color: rgba(12, 108, 109, 0.45);
}

.actions.controls-row .muted {
  flex: 1 1 auto;
  margin-top: 0;
  min-width: 240px;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card > .table-wrap {
  margin-top: 10px;
}

.history-range-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 240px));
  gap: 12px;
  align-items: end;
}

.history-range-panel label {
  margin: 0;
}

.history-range-panel input[type="date"]:disabled {
  opacity: 0.68;
  cursor: not-allowed;
}

.actions.controls-equal > button {
  min-width: 148px;
  text-align: center;
}

.config-actions {
  align-items: center;
  gap: 10px;
}

.config-actions .muted {
  flex: 1 1 auto;
  margin-top: 0;
  min-width: 240px;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.config-page .actions {
  margin-top: 14px;
}

.config-page .stack > .actions {
  margin-top: 16px;
}

.config-page .exchange-actions {
  margin-bottom: 16px;
}

.symbol-override-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.5fr) minmax(110px, 0.8fr) minmax(120px, 1fr) minmax(120px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.symbol-override-row.is-disabled {
  opacity: 0.72;
}

.symbol-override-row.is-disabled label {
  color: #6f7a88;
}

.symbol-override-row.is-disabled input:disabled {
  background: #f3efe6;
  color: #7d7a70;
  cursor: not-allowed;
}

.symbol-override-row button {
  min-width: 96px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #f7f4ec;
  color: #4f5f70;
  font-size: 12px;
  font-weight: 600;
}

.status-chip.success {
  color: #166534;
  border-color: rgba(31, 138, 77, 0.45);
  background: rgba(223, 247, 233, 0.9);
}

.status-chip.warn {
  color: #8a4b05;
  border-color: rgba(165, 100, 22, 0.45);
  background: rgba(254, 239, 213, 0.95);
}

.status-chip.danger {
  color: #9c2f2f;
  border-color: rgba(194, 63, 63, 0.45);
  background: rgba(253, 230, 230, 0.95);
}

.dc-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.dc-kpi,
.dc-quality-item {
  min-height: 104px;
  padding: 14px;
  border: 1px solid rgba(185, 178, 159, 0.72);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 243, 235, 0.92));
  box-shadow: var(--shadow-soft);
}

.dc-kpi span,
.dc-quality-item span {
  display: block;
  margin-bottom: 8px;
  color: #607080;
  font-size: 12px;
  font-weight: 700;
}

.dc-kpi strong,
.dc-quality-item strong {
  display: block;
  color: #143d39;
  font-family: 'Sora', 'Noto Sans SC', sans-serif;
  font-size: 24px;
  line-height: 1.2;
  word-break: break-word;
}

.dc-kpi small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.dc-trader-grid .interface-status-card {
  min-height: 132px;
}

.dc-quality-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.dc-quality-item {
  min-height: 86px;
}

.dc-quality-item strong {
  font-size: 22px;
}

.dc-warning-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.dc-channel-table th:nth-child(1),
.dc-channel-table td:nth-child(1) { min-width: 180px; }
.dc-channel-table th:nth-child(2),
.dc-channel-table td:nth-child(2) { min-width: 100px; }
.dc-channel-table th:nth-child(3),
.dc-channel-table td:nth-child(3) { min-width: 96px; }
.dc-channel-table th:nth-child(4),
.dc-channel-table td:nth-child(4),
.dc-channel-table th:nth-child(5),
.dc-channel-table td:nth-child(5),
.dc-channel-table th:nth-child(6),
.dc-channel-table td:nth-child(6),
.dc-channel-table th:nth-child(7),
.dc-channel-table td:nth-child(7) {
  min-width: 90px;
  text-align: right;
}
.dc-channel-table th:nth-child(8),
.dc-channel-table td:nth-child(8) { min-width: 150px; }
.dc-channel-table th:nth-child(9),
.dc-channel-table td:nth-child(9) {
  min-width: 180px;
  white-space: normal;
}

.dc-order-table th:nth-child(1),
.dc-order-table td:nth-child(1) { min-width: 150px; }
.dc-order-table th:nth-child(2),
.dc-order-table td:nth-child(2) { min-width: 96px; }
.dc-order-table th:nth-child(3),
.dc-order-table td:nth-child(3) { min-width: 140px; }
.dc-order-table th:nth-child(4),
.dc-order-table td:nth-child(4),
.dc-order-table th:nth-child(6),
.dc-order-table td:nth-child(6),
.dc-order-table th:nth-child(9),
.dc-order-table td:nth-child(9) { min-width: 90px; }
.dc-order-table th:nth-child(5),
.dc-order-table td:nth-child(5) { min-width: 100px; }
.dc-order-table th:nth-child(7),
.dc-order-table td:nth-child(7),
.dc-order-table th:nth-child(8),
.dc-order-table td:nth-child(8) {
  min-width: 100px;
  text-align: right;
}
.dc-order-table th:nth-child(10),
.dc-order-table td:nth-child(10) { min-width: 150px; }
.dc-order-table th:nth-child(11),
.dc-order-table td:nth-child(11) {
  min-width: 180px;
  white-space: normal;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  min-width: 980px;
}

.logs-table th {
  background: #edf5f1;
}

.logs-table td {
  vertical-align: middle;
}

.panel-table td:nth-child(8) {
  font-weight: 600;
  color: #1f3f56;
}

.order-table td:nth-child(7) {
  font-weight: 600;
}

.panel-table tbody tr:nth-child(odd) td,
.order-table tbody tr:nth-child(odd) td {
  background: rgba(252, 249, 242, 0.88);
}

.panel-table th:nth-child(1),
.panel-table td:nth-child(1) { min-width: 150px; }
.panel-table th:nth-child(2),
.panel-table td:nth-child(2) { min-width: 150px; }
.panel-table th:nth-child(3),
.panel-table td:nth-child(3) { min-width: 90px; }
.panel-table th:nth-child(4),
.panel-table td:nth-child(4) { min-width: 150px; }
.panel-table th:nth-child(5),
.panel-table td:nth-child(5) { min-width: 90px; }
.panel-table th:nth-child(6),
.panel-table td:nth-child(6) { min-width: 70px; }
.panel-table th:nth-child(7),
.panel-table td:nth-child(7) { min-width: 70px; }
.panel-table th:nth-child(8),
.panel-table td:nth-child(8) { min-width: 140px; }
.panel-table th:nth-child(9),
.panel-table td:nth-child(9),
.panel-table th:nth-child(10),
.panel-table td:nth-child(10) { min-width: 90px; text-align: right; }
.panel-table th:nth-child(11),
.panel-table td:nth-child(11),
.panel-table th:nth-child(12),
.panel-table td:nth-child(12) { min-width: 90px; text-align: right; }
.panel-table th:nth-child(13),
.panel-table td:nth-child(13) { min-width: 80px; }

.panel-table .kind-cell,
.panel-table .panel-status {
  text-align: left;
}

.order-table th:nth-child(1),
.order-table td:nth-child(1) { min-width: 200px; }
.order-table th:nth-child(2),
.order-table td:nth-child(2) { min-width: 90px; }
.order-table th:nth-child(3),
.order-table td:nth-child(3) { min-width: 90px; }
.order-table th:nth-child(4),
.order-table td:nth-child(4),
.order-table th:nth-child(5),
.order-table td:nth-child(5),
.order-table th:nth-child(6),
.order-table td:nth-child(6) { min-width: 70px; text-align: right; }
.order-table th:nth-child(7),
.order-table td:nth-child(7) { min-width: 160px; }
.order-table th:nth-child(8),
.order-table td:nth-child(8) { min-width: 150px; }

.panel-table col {
  width: auto;
}

.panel-table col.col-updated { width: 160px; }
.panel-table col.col-created { width: 160px; }
.panel-table col.col-trader { width: 90px; }
.panel-table col.col-orderid { width: 160px; }
.panel-table col.col-symbol { width: 90px; }
.panel-table col.col-side { width: 70px; }
.panel-table col.col-kind { width: 70px; }
.panel-table col.col-status { width: 150px; }
.panel-table col.col-filled { width: 90px; }
.panel-table col.col-remaining { width: 90px; }
.panel-table col.col-tp { width: 90px; }
.panel-table col.col-sl { width: 90px; }
.panel-table col.col-source { width: 80px; }

.order-table col.col-orderkey { width: 220px; }
.order-table col.col-trader { width: 90px; }
.order-table col.col-symbol { width: 90px; }
.order-table col.col-open { width: 70px; }
.order-table col.col-close { width: 70px; }
.order-table col.col-fail { width: 70px; }
.order-table col.col-status { width: 170px; }
.order-table col.col-last { width: 160px; }

.panel-table .panel-status .status-pill,
.order-table .order-status .status-pill {
  font-weight: 600;
  color: #23465d;
  background: #edf6f9;
  border: 1px solid rgba(47, 90, 119, 0.34);
  border-radius: 999px;
  padding: 4px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.order-table .order-status .status-pill {
  color: #1e3a4f;
}

.order-table .status-ok .status-pill {
  border-color: rgba(31, 138, 77, 0.45);
  color: #17653a;
  background: rgba(223, 247, 233, 0.95);
}

.order-table .status-warn .status-pill {
  border-color: rgba(165, 100, 22, 0.5);
  color: #8a4b05;
  background: rgba(254, 239, 213, 0.95);
}

.order-table .status-danger .status-pill {
  border-color: rgba(194, 63, 63, 0.5);
  color: #9d3030;
  background: rgba(253, 230, 230, 0.95);
}

.mirror-table th.err-col {
  min-width: 280px;
}

.mirror-table td.mirror-error {
  white-space: normal;
  min-width: 280px;
  max-width: 520px;
  line-height: 1.35;
}

.panel-table .kind-pill {
  font-weight: 700;
  text-transform: none;
  background: #eef4f2;
  border: 1px solid rgba(61, 96, 83, 0.35);
  border-radius: 10px;
  padding: 3px 8px;
  display: inline-flex;
  justify-content: center;
  min-width: 48px;
}

.panel-table .kind-holding {
  color: #1d6e3f;
  border-color: rgba(31, 138, 77, 0.45);
  background: rgba(223, 247, 233, 0.95);
}

.panel-table .kind-pending {
  color: #205177;
  border-color: rgba(47, 90, 119, 0.5);
  background: rgba(226, 242, 252, 0.95);
}

.order-table td.status-ok {
  color: #1d6e3f;
}

.order-table td.status-warn {
  color: #8a4b05;
}

.order-table td.status-danger {
  color: #9d3030;
}

.panel-table td.kind-holding {
  color: #1d6e3f;
  font-weight: 600;
}

.panel-table td.kind-pending {
  color: #205177;
  font-weight: 600;
}

th {
  position: sticky;
  top: 0;
  background: #edf5f1;
  color: #243649;
  z-index: 1;
}

th,
td {
  border-bottom: 1px solid #ddd7ca;
  padding: 8px 7px;
  text-align: left;
  white-space: nowrap;
}

tr:hover td {
  background: rgba(239, 248, 244, 0.9);
}

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

h2 {
  margin: 0 0 12px;
  font-size: 19px;
  letter-spacing: 0.01em;
  color: var(--title);
  font-family: 'Sora', 'Noto Sans SC', sans-serif;
}

h3 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0.01em;
  color: #243649;
  font-family: 'Sora', 'Noto Sans SC', sans-serif;
}

.card > h2 + .row,
.card > h2 + .actions {
  margin-top: 10px;
}

.card > .row + .table-wrap,
.card > .actions + .table-wrap,
.card > p.muted + .table-wrap {
  margin-top: 10px;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
}

@keyframes card-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  .grid-3 {
    grid-template-columns: 1fr;
  }

  .symbol-override-row {
    grid-template-columns: 1fr;
  }

  .symbol-override-row button {
    min-width: 100%;
  }

  .status-grid {
    grid-template-columns: 1fr;
  }

  .page {
    padding: 8px;
  }

  .card {
    padding: 12px;
    border-radius: 14px;
  }

  .toolbar label {
    min-width: 140px;
  }

  .nav {
    top: 6px;
  }

  .nav-brand {
    width: 100%;
  }

  .nav-brand span {
    font-size: 16px;
  }

  .nav-links {
    width: 100%;
  }

  .nav-links a {
    flex: 1 1 calc(50% - 8px);
    text-align: center;
  }

  .head-actions .muted,
  .actions.controls-row .muted,
  .config-actions .muted {
    min-width: 100%;
    text-align: left;
  }

  .actions.controls-row {
    align-items: stretch;
  }

  .notifications-actions .button-row {
    width: 100%;
    gap: 12px;
  }

  .notifications-actions .button-row button {
    min-width: 100%;
  }

  .actions.controls-row label,
  .actions.controls-row button {
    min-width: 100%;
  }

  .history-range-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  table {
    min-width: 860px;
  }

  h2 {
    font-size: 17px;
  }

  .hero-card h2 {
    font-size: 20px;
  }
}
