@import url("ops-dashboard.css");

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body.portal-site {
  background: #f0f2f5;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.portal-site .ops-layout {
  height: 100vh;
  overflow: hidden;
  display: flex;
}

.portal-site .ops-main {
  flex: 1;
  min-width: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #f0f2f5;
}

.portal-site .ops-content {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 16px 24px 24px;
  gap: 0;
}

.portal-view {
  display: none;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  gap: 12px;
}

.portal-view.active {
  display: flex;
}

#listViewsHost {
  flex: 1;
  min-height: 0;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.ops-content:has(#listViewsHost .portal-view.active) #listViewsHost {
  display: flex;
}

.ops-content:has(#listViewsHost .portal-view.active) #view-home {
  display: none !important;
}
.market-list-view {
  gap: 12px;
}

.market-list-view .ops-filter-bar {
  flex-shrink: 0;
  margin-bottom: 0;
}

.market-list-view .market-table-panel {
  flex: 1;
  min-height: 0;
}
.market-table-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.market-table-fill { flex: 1; min-height: 0; overflow: hidden; }
.market-pagination { flex-shrink: 0; padding: 10px 16px; display: flex; justify-content: flex-end; align-items: center; gap: 8px; font-size: 13px; color: #8c8c8c; border-top: 1px solid #f0f0f0; background: #fff; }
.market-pagination button { min-width: 28px; height: 28px; border: 1px solid #d9d9d9; background: #fff; border-radius: 4px; cursor: pointer; }
.market-pagination button:disabled { opacity: 0.45; }
.ops-sys-nav,
.chain-sys-nav,
.mk-sys-nav,
.cm-sys-nav,
#sysNav,
.sys {
  display: none !important;
}
.portal-home-stats { flex-shrink: 0; margin-bottom: 8px !important; gap: 8px !important; }
.portal-home-dashboard { flex: 1; min-height: 0; gap: 12px !important; }
.portal-home-table-panel { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.portal-home-right { width: 340px; flex-shrink: 0; gap: 8px !important; }
.portal-home-right .ops-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.portal-chart-sm { flex: 1; min-height: 0; height: auto !important; }
.market-compact-filter { flex-shrink: 0; margin-bottom: 8px !important; padding: 10px 12px !important; }
.backend-toast { position: fixed; top: 72px; left: 50%; transform: translateX(-50%) translateY(-16px); padding: 10px 20px; background: rgba(0,0,0,0.78); color: #fff; border-radius: 6px; font-size: 14px; z-index: 9999; opacity: 0; pointer-events: none; transition: opacity 0.25s, transform 0.25s; }
.backend-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Chain/portal topbar and quick-entry polish */
.ops-topbar {
  display: grid !important;
  grid-template-columns: minmax(220px, 280px) minmax(260px, 1fr) max-content !important;
  align-items: center;
  column-gap: 16px;
}

.ops-topbar-title {
  min-width: 0;
  overflow: hidden;
}

.ops-topbar-title h1,
.ops-topbar-title p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-search {
  min-width: 0;
  width: 100%;
  max-width: none;
  justify-self: stretch;
  z-index: 1;
}

.ops-search input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
}

.ops-topbar-actions {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: max-content;
  justify-self: end;
  white-space: nowrap;
}

#quickGrid.ops-quick-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 12px !important;
  margin-bottom: 12px !important;
}

#quickGrid .ops-quick-card {
  min-height: 84px;
  padding: 16px 18px;
  align-items: center;
  gap: 14px;
  color: #17233c;
  text-decoration: none !important;
  border: 1px solid rgba(24, 144, 255, 0.16);
  background: linear-gradient(135deg, #ffffff 0%, #f7fbff 100%);
  box-shadow: 0 8px 22px rgba(15, 35, 70, 0.05);
  overflow: hidden;
}

#quickGrid .ops-quick-card:hover {
  transform: translateY(-1px);
  border-color: rgba(24, 144, 255, 0.45);
  box-shadow: 0 12px 26px rgba(24, 144, 255, 0.14);
}

#quickGrid .ops-quick-card .qc-icon {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  font-size: 16px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

#quickGrid .ops-quick-card > div:last-child {
  min-width: 0;
  flex: 1;
}

#quickGrid .ops-quick-card .qc-title {
  color: #0b1f44;
  font-size: 15px;
  font-weight: 700;
}

#quickGrid .ops-quick-card .qc-desc {
  margin-top: 5px;
  color: #667085;
  font-size: 12px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#quickGrid .ops-quick-card .qc-go {
  display: inline-flex;
  align-items: center;
  margin-top: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(24, 144, 255, 0.1);
  color: #1677ff;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

@media (max-width: 1180px) {
  .ops-topbar {
    grid-template-columns: minmax(180px, 240px) minmax(220px, 1fr) max-content !important;
    column-gap: 12px;
  }

  #quickGrid.ops-quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 820px) {
  .ops-topbar {
    grid-template-columns: 1fr !important;
    row-gap: 10px;
  }

  .ops-topbar-actions {
    justify-self: stretch;
  }

  .ops-topbar-actions .ops-btn {
    flex: 1;
    justify-content: center;
  }

  #quickGrid.ops-quick-grid {
    grid-template-columns: 1fr !important;
  }
}
