:root {
  --bg: #edf3f9;
  --ink: #172033;
  --muted: #6b7a90;
  --panel: #ffffff;
  --panel-soft: #f7fbff;
  --line: #d9e4ef;
  --line-strong: #b9c9da;
  --brand: #1d4ed8;
  --brand-soft: #eaf1ff;
  --good: #059669;
  --warn: #d97706;
  --bad: #dc2626;
  --cyan: #0891b2;
  --purple: #7c3aed;
  --rose: #e11d48;
  --shadow: 0 18px 45px rgba(35, 52, 74, 0.12);
  --shadow-soft: 0 10px 26px rgba(35, 52, 74, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(29, 78, 216, 0.16), transparent 34rem),
    linear-gradient(180deg, #f7fbff 0%, var(--bg) 44%, #e9f0f7 100%);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1720px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 18px 0 22px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  min-height: 92px;
  padding: 18px 22px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(20, 34, 55, 0.98), rgba(33, 57, 87, 0.98)),
    radial-gradient(circle at 15% 20%, rgba(56, 189, 248, 0.34), transparent 28rem);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow);
}

.eyebrow,
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  color: #7dd3fc;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.topbar h1,
.hero-copy h2,
.panel-head h2 {
  margin: 0;
}

.topbar h1 {
  font-size: 26px;
  letter-spacing: -0.02em;
}

.topbar p {
  margin: 6px 0 0;
  color: #cbd5e1;
  font-size: 13px;
}

.top-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 9px;
  flex-wrap: wrap;
}

.classic-version-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid rgba(203, 213, 225, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #dbeafe;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  padding: 0 12px;
  text-decoration: none;
}

.classic-version-link:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.compact-field {
  display: grid;
  gap: 5px;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 700;
}

.compact-field input {
  width: 220px;
  height: 34px;
  padding: 0 10px;
  color: #e5edf7;
  background: rgba(15, 23, 42, 0.42);
  border: 1px solid rgba(203, 213, 225, 0.25);
  outline: none;
}

.token-field input {
  width: 130px;
}

.hidden-connection {
  display: none;
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(780px, 1fr) 420px;
  gap: 16px;
  align-items: stretch;
  margin-top: 16px;
}

.left-pane,
.right-pane {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.right-pane {
  align-self: start;
  position: sticky;
  top: 14px;
  max-height: calc(100vh - 28px);
  overflow: auto;
  padding-right: 2px;
}

.hero-panel,
.side-panel,
.records-panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(217, 228, 239, 0.88);
  box-shadow: var(--shadow-soft);
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(420px, 1.15fr);
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
}

.hero-copy {
  display: flex;
  gap: 13px;
  align-items: center;
}

.hero-copy h2 {
  font-size: 17px;
}

.hero-copy p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.live-dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.48);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 13px rgba(5, 150, 105, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(5, 150, 105, 0);
  }
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.metric-card,
.dept-card,
.rail-btn,
.record-item {
  background: #fff;
  border: 1px solid var(--line);
}

.metric-card {
  min-height: 58px;
  padding: 8px 10px;
  border-left: 4px solid var(--brand);
}

.metric-card.ok {
  border-left-color: var(--good);
}

.metric-card.warn {
  border-left-color: var(--warn);
}

.metric-card.bad {
  border-left-color: var(--bad);
}

.metric-card span,
.metric-card em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.metric-card strong {
  display: block;
  margin: 2px 0 1px;
  font-size: 16px;
}

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

.dept-card {
  position: relative;
  overflow: hidden;
  min-height: 86px;
  padding: 10px 11px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.dept-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 5px;
  height: 100%;
  background: var(--dept-color, var(--brand));
}

.dept-card:hover,
.dept-card.active {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--dept-color, var(--brand)) 44%, white);
  box-shadow: 0 18px 34px rgba(35, 52, 74, 0.14);
}

.dept-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}

.dept-title h3 {
  margin: 0;
  font-size: 14px;
}

.dept-title span,
.dept-meta {
  color: var(--muted);
  font-size: 12px;
}

.dept-counts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 9px;
}

.dept-counts div {
  padding: 5px 6px;
  background: var(--panel-soft);
  border: 1px solid #e6eef7;
}

.dept-counts b {
  display: block;
  font-size: 15px;
}

.dept-counts span {
  color: var(--muted);
  font-size: 11px;
}

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

.dept-rail {
  display: grid;
  gap: 8px;
  align-self: start;
}

.rail-btn {
  width: 100%;
  min-height: 54px;
  padding: 10px 11px;
  text-align: left;
  font-weight: 900;
  color: var(--ink);
  border-left: 4px solid var(--dept-color, var(--brand));
}

.rail-btn span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.rail-btn.active {
  background: var(--brand-soft);
  border-color: var(--dept-color, var(--brand));
}

.records-panel,
.side-panel {
  padding: 14px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.panel-head.compact h2 {
  font-size: 18px;
}

.record-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.record-tabs button,
.primary-btn,
.ghost-btn {
  height: 36px;
  padding: 0 13px;
  font-weight: 900;
  border: 1px solid transparent;
}

.record-tabs button {
  color: var(--muted);
  background: #eef4fb;
}

.record-tabs button.active {
  color: #fff;
  background: var(--brand);
}

.primary-btn {
  color: #fff;
  background: linear-gradient(135deg, #1d4ed8, #0891b2);
  box-shadow: 0 8px 18px rgba(29, 78, 216, 0.2);
}

.primary-btn.soft {
  background: linear-gradient(135deg, #0f766e, #059669);
}

.ghost-btn {
  color: var(--ink);
  background: #fff;
  border-color: var(--line-strong);
}

.ghost-btn.small {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.primary-link,
.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 13px;
  color: #fff;
  text-decoration: none;
  font-weight: 900;
}

.primary-link {
  background: linear-gradient(135deg, #1d4ed8, #0891b2);
}

.ghost-link {
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
}

.ghost-link.small {
  height: 30px;
  font-size: 12px;
}

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

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 150px 90px auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.filters input,
.filters select {
  height: 36px;
  padding: 0 10px;
  background: #fff;
  border: 1px solid var(--line);
  outline: none;
}

.check-line {
  display: flex;
  gap: 7px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.record-summary {
  margin-bottom: 10px;
  padding: 9px 11px;
  color: var(--muted);
  background: var(--panel-soft);
  border: 1px solid #e6eef7;
  font-size: 13px;
}

.record-list {
  display: grid;
  gap: 9px;
  align-content: start;
  height: 520px;
  overflow: auto;
}

.record-item {
  padding: 12px;
  transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.record-item:hover {
  border-color: #9fb6cf;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(35, 52, 74, 0.08);
}

.record-item h3 {
  margin: 0 0 7px;
  font-size: 15px;
  line-height: 1.45;
}

.record-item h3 a {
  color: var(--ink);
  text-decoration: none;
}

.record-item h3 a:hover {
  color: var(--brand);
}

.record-meta,
.record-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

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

.record-tags {
  margin-top: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  color: #1f3b58;
  background: #eef6ff;
  border: 1px solid #d6e9ff;
  font-size: 11px;
  font-weight: 800;
}

.tag.hit {
  color: #7c2d12;
  background: #fff7ed;
  border-color: #fed7aa;
}

.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
  padding: 10px;
  background: var(--panel-soft);
  border: 1px solid #e6eef7;
}

.pager button {
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: #fff;
  font-weight: 800;
}

.pager button.active {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.pager button:disabled {
  color: #a8b3c2;
  cursor: not-allowed;
  background: #f2f6fa;
}

.pager-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.pager-numbers button {
  min-width: 34px;
  padding: 0 8px;
}

.fx-controls {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.fx-controls.one-line {
  grid-template-columns: 1fr;
}

.fx-controls input,
.fx-controls select {
  width: 100%;
  height: 34px;
  padding: 0 9px;
  border: 1px solid var(--line);
  background: #fff;
  outline: none;
}

.fx-combo {
  position: relative;
  grid-column: 1 / -1;
}

.fx-combo input {
  padding-right: 34px;
}

.fx-clear {
  display: none;
  position: absolute;
  top: 4px;
  right: 5px;
  width: 26px;
  height: 26px;
  padding: 0;
  color: #7a8795;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
}

.fx-clear.visible {
  display: grid;
  place-items: center;
}

.fx-clear:hover {
  color: var(--bad);
  background: #fff1f2;
  border-color: #fecdd3;
}

.fx-suggestions {
  display: none;
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line-strong);
  box-shadow: 0 18px 34px rgba(35, 52, 74, 0.18);
}

.fx-suggestions.open {
  display: block;
}

.fx-suggestion {
  display: grid;
  grid-template-columns: 24px minmax(72px, 1fr) 52px;
  gap: 10px;
  align-items: center;
  width: 100%;
  height: 38px;
  padding: 0 11px;
  color: var(--ink);
  background: #fff;
  border: 0;
  text-align: left;
}

.fx-suggestion:hover {
  background: var(--panel-soft);
}

.fx-suggestion span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fx-suggestion strong {
  text-align: right;
}

.fx-flag-img {
  width: 24px;
  height: 18px;
  border: 1px solid #d7dde6;
  object-fit: cover;
  background: #fff;
}

.side-summary {
  margin-bottom: 10px;
  padding: 9px 10px;
  color: var(--muted);
  background: var(--panel-soft);
  border: 1px solid #e6eef7;
  font-size: 12px;
}

.fx-list,
.holiday-list {
  display: grid;
  gap: 8px;
  max-height: 330px;
  overflow: auto;
}

.fx-row,
.holiday-row {
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
}

.fx-row-head,
.holiday-row-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 6px;
  font-weight: 900;
}

.fx-row-head strong {
  color: var(--brand);
  font-size: 16px;
}

.fx-currency-cell {
  display: inline-grid;
  grid-template-columns: 24px minmax(40px, auto) auto;
  gap: 7px;
  align-items: center;
}

.fx-currency-cell em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.fx-row-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.fx-row-grid span,
.holiday-row p {
  overflow-wrap: anywhere;
}

.holiday-row p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.fx-page {
  max-width: 1480px;
}

.fx-query-panel,
.fx-table-panel {
  margin-top: 16px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.93);
  border: 1px solid rgba(217, 228, 239, 0.88);
  box-shadow: var(--shadow-soft);
}

.fx-query-panel {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(520px, 1.2fr);
  gap: 18px;
  align-items: end;
}

.fx-query-panel h2 {
  margin: 0 0 8px;
}

.fx-query-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.fx-query-controls {
  display: grid;
  grid-template-columns: 100px 150px minmax(180px, 1fr) 92px;
  gap: 8px;
}

.fx-query-controls input,
.fx-query-controls select {
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: #fff;
  outline: none;
}

.fx-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
}

.fx-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  background: #fff;
}

.fx-table th,
.fx-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #e6eef7;
  text-align: left;
  font-size: 13px;
  vertical-align: top;
}

.fx-table th {
  color: #1f3b58;
  background: #f0f6fc;
  font-weight: 900;
}

.fx-table td span {
  color: var(--muted);
  font-size: 12px;
}

.fx-table tr:hover td {
  background: #f9fcff;
}

.event-log {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
}

.event {
  padding: 9px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  font-size: 12px;
}

.event.ok {
  border-left-color: var(--good);
}

.event.warn {
  border-left-color: var(--warn);
}

.event.bad {
  border-left-color: var(--bad);
}

.event time {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
}

.empty-state {
  display: grid;
  min-height: 100%;
  place-items: center;
  color: var(--muted);
  background: #fff;
  border: 1px dashed var(--line-strong);
}

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

  .right-pane {
    position: static;
    max-height: none;
  }
}

@media (max-width: 980px) {
  .topbar,
  .hero-panel,
  .workbench {
    grid-template-columns: 1fr;
  }

  .dept-grid,
  .hero-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

/* Ultimate visual polish: rounded glass monitoring console */
:root {
  --bg: #eaf2fb;
  --ink: #132033;
  --muted: #64748b;
  --panel: rgba(255, 255, 255, 0.86);
  --panel-soft: rgba(241, 247, 255, 0.86);
  --line: rgba(148, 163, 184, 0.26);
  --line-strong: rgba(100, 116, 139, 0.34);
  --brand: #2563eb;
  --brand-soft: rgba(37, 99, 235, 0.1);
  --cyan: #06b6d4;
  --good: #10b981;
  --warn: #f59e0b;
  --bad: #ef4444;
  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow: 0 24px 70px rgba(15, 23, 42, 0.15);
  --shadow-soft: 0 14px 38px rgba(15, 23, 42, 0.09);
  --glow-blue: 0 0 0 1px rgba(125, 211, 252, 0.16), 0 20px 50px rgba(37, 99, 235, 0.14);
}

body {
  background:
    radial-gradient(circle at 8% 0%, rgba(37, 99, 235, 0.18), transparent 30rem),
    radial-gradient(circle at 90% 8%, rgba(6, 182, 212, 0.18), transparent 28rem),
    linear-gradient(135deg, #f8fbff 0%, #ecf5ff 42%, #e9f1fb 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: -1;
}

body::before {
  inset: 0;
  background-image:
    linear-gradient(rgba(37, 99, 235, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.055) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.68), transparent 72%);
}

body::after {
  width: 36rem;
  height: 36rem;
  right: -15rem;
  top: 8rem;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.19), transparent 64%);
  filter: blur(2px);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(226, 232, 240, 0.52);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.55), rgba(6, 182, 212, 0.55));
  border: 2px solid rgba(241, 245, 249, 0.78);
  border-radius: 999px;
}

.app-shell {
  padding-top: 22px;
}

.topbar {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  background:
    radial-gradient(circle at 18% 24%, rgba(56, 189, 248, 0.28), transparent 26rem),
    linear-gradient(135deg, rgba(9, 22, 44, 0.98), rgba(20, 49, 90, 0.98) 54%, rgba(13, 80, 106, 0.96));
  border: 1px solid rgba(186, 230, 253, 0.22);
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.22);
}

.topbar::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, transparent 0 34%, rgba(255, 255, 255, 0.14) 45%, transparent 56%),
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: auto, 100% 18px;
  opacity: 0.62;
}

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

.eyebrow,
.section-kicker {
  color: #38bdf8;
  text-shadow: 0 0 18px rgba(56, 189, 248, 0.28);
}

.compact-field input,
.filters input,
.filters select,
.fx-controls input,
.fx-controls select,
.fx-query-controls input,
.fx-query-controls select {
  border-radius: 14px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.compact-field input {
  background: rgba(15, 23, 42, 0.36);
  border-color: rgba(186, 230, 253, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.compact-field input:focus,
.filters input:focus,
.filters select:focus,
.fx-controls input:focus,
.fx-controls select:focus {
  border-color: rgba(14, 165, 233, 0.68);
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.14);
}

.hero-panel,
.side-panel,
.records-panel,
.metric-card,
.dept-card,
.rail-btn,
.record-item,
.fx-row,
.holiday-row,
.record-summary,
.side-summary,
.pager {
  border-radius: var(--radius-lg);
}

.hero-panel,
.side-panel,
.records-panel {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(247, 251, 255, 0.78)),
    rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.24);
  box-shadow: var(--glow-blue);
  backdrop-filter: blur(18px);
}

.hero-panel::after,
.side-panel::after,
.records-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(125, 211, 252, 0.18), transparent 28%, rgba(37, 99, 235, 0.08));
  opacity: 0.56;
}

.hero-panel > *,
.side-panel > *,
.records-panel > * {
  position: relative;
  z-index: 1;
}

.live-dot {
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.52), 0 0 18px rgba(34, 197, 94, 0.76);
}

.metric-card,
.dept-card,
.rail-btn,
.record-item,
.fx-row,
.holiday-row {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.24);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
}

.metric-card {
  border-left: 0;
  border-top: 3px solid var(--brand);
}

.metric-card.ok {
  border-top-color: var(--good);
}

.metric-card.warn {
  border-top-color: var(--warn);
}

.metric-card.bad {
  border-top-color: var(--bad);
}

.dept-card {
  border-radius: 22px;
}

.dept-card::before {
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--dept-color, var(--brand)), rgba(56, 189, 248, 0.18));
}

.dept-card:hover,
.dept-card.active,
.record-item:hover,
.fx-row:hover,
.holiday-row:hover {
  transform: translateY(-2px);
  border-color: rgba(14, 165, 233, 0.46);
  box-shadow: 0 20px 42px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(14, 165, 233, 0.12);
}

.dept-counts div {
  border-radius: 14px;
  background: rgba(241, 247, 255, 0.78);
  border-color: rgba(191, 219, 254, 0.56);
}

.rail-btn {
  border-left: 0;
  border-top: 3px solid var(--dept-color, var(--brand));
}

.rail-btn.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(6, 182, 212, 0.08));
  box-shadow: 0 16px 32px rgba(37, 99, 235, 0.12);
}

.record-tabs button,
.primary-btn,
.ghost-btn,
.primary-link,
.ghost-link,
.pager button,
.fx-clear,
.fx-suggestion {
  border-radius: 999px;
}

.record-tabs button {
  background: rgba(226, 232, 240, 0.72);
}

.record-tabs button.active,
.primary-btn,
.primary-link {
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.22);
}

.ghost-btn,
.ghost-link,
.pager button {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(148, 163, 184, 0.34);
}

.tag,
.fx-currency-cell,
.holiday-row-head span {
  border-radius: 999px;
}

.tag {
  background: rgba(219, 234, 254, 0.78);
  border-color: rgba(147, 197, 253, 0.48);
}

.tag.hit {
  background: rgba(255, 247, 237, 0.9);
}

.fx-suggestions {
  border-radius: 18px;
  overflow: auto;
  background: #fff;
  backdrop-filter: none;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.24);
}

.fx-flag-img {
  border-radius: 6px;
}

.currency-drawer {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: none;
  justify-content: flex-end;
  background: rgba(15, 23, 42, 0.22);
  backdrop-filter: blur(4px);
}

.currency-drawer.open {
  display: flex;
}

.currency-drawer-card {
  width: min(360px, calc(100vw - 28px));
  height: calc(100vh - 32px);
  margin: 16px;
  padding: 16px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 24px;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
}

.currency-drawer-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.currency-drawer-head h2 {
  margin: 0;
  font-size: 18px;
}

.currency-drawer-list {
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 138px);
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.currency-drawer-option {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 56px;
  gap: 10px;
  align-items: center;
  width: 100%;
  height: 42px;
  padding: 0 12px;
  color: var(--ink);
  background: #f8fbff;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 14px;
  text-align: left;
}

.currency-drawer-option:hover {
  background: #eef6ff;
  border-color: rgba(37, 99, 235, 0.28);
}

.currency-drawer-option span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.currency-drawer-option strong {
  text-align: right;
}

/* Keep the home-page exchange currency dropdown independent from the sticky side scroll. */
.right-pane,
.fx-panel,
.fx-combo {
  overflow: visible;
}

.fx-panel {
  z-index: 20;
}

.fx-combo {
  z-index: 40;
}

.fx-suggestions {
  z-index: 999;
  max-height: 360px;
  overscroll-behavior: contain;
  border: 1px solid rgba(71, 85, 105, 0.22);
}

.fx-suggestion {
  background: #fff;
}

.fx-suggestion:hover {
  background: #eef6ff;
}
