@font-face {
  font-family: "Inter";
  src: url("./assets/login/inter-latin-variable.woff2?v=20260729-immersive-login") format("woff2");
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
}

@font-face {
  font-family: "basis33";
  src: url("./assets/login/basis33.woff2?v=20260729-immersive-login") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --bg: #f4f7ff;
  --surface: #ffffff;
  --surface-glass: rgba(255, 255, 255, 0.88);
  --surface-soft: #eef4ff;
  --text: #0f172a;
  --muted: #64748b;
  --border: rgba(148, 163, 184, 0.25);
  --primary: #2563eb;
  --primary-soft: #dbeafe;
  --accent: #f97316;
  --success: #10b981;
  --danger: #e11d48;
  --warning: #f97316;
  --teal: #0f766e;
  --rose: #e11d48;
  --cyan: #0284c7;
  --purple: #7c3aed;
  --shadow: 0 16px 40px rgba(15, 23, 42, 0.06);
  --shadow-hover: 0 18px 46px rgba(37, 99, 235, 0.14);
  --state-bg: #f8fbff;
  --state-border: #bfdbfe;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
}

body {
  position: relative;
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at 13% 6%, rgba(56, 189, 248, 0.2), transparent 26%),
    radial-gradient(circle at 82% 0%, rgba(124, 58, 237, 0.16), transparent 30%),
    linear-gradient(180deg, #f8fbff 0%, #eef4ff 52%, #f7f9fe 100%);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", Arial, sans-serif;
  line-height: 1.5;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(37, 99, 235, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.05) 1px, transparent 1px),
    radial-gradient(circle, rgba(124, 58, 237, 0.08) 1px, transparent 1px);
  background-size: 44px 44px, 44px 44px, 28px 28px;
  background-position: 0 0, 0 0, 10px 12px;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.85) 42%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.85) 42%, transparent 100%);
}

.skip-link {
  position: fixed;
  left: 12px;
  top: 8px;
  z-index: 100;
  transform: translateY(calc(-100% - 16px));
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  padding: 10px 14px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

button,
select,
input {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(30, 64, 175, 0.28);
  outline-offset: 2px;
}

@keyframes enter-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes soft-pulse {
  0% {
    box-shadow: var(--shadow);
  }

  45% {
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.08), var(--shadow);
  }

  100% {
    box-shadow: var(--shadow);
  }
}

@keyframes draw-line {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes fade-line {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(0.55);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fill-track {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes highlight-row {
  0% {
    background: #fef3c7;
  }

  100% {
    background: transparent;
  }
}

@keyframes tooltip-in {
  from {
    opacity: 0;
    transform: translateY(4px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.enter {
  animation: enter-up 260ms ease-out both;
}

.app-shell {
  width: min(100%, 1920px);
  margin: 0 auto;
  padding: clamp(18px, 2vw, 28px);
}

.topbar {
  display: grid;
  grid-template-columns: minmax(240px, 310px) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(239, 246, 255, 0.74)),
    radial-gradient(circle at 8% 0%, rgba(56, 189, 248, 0.14), transparent 34%);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.title-block {
  position: relative;
  display: grid;
  gap: 4px;
  min-width: 0;
}

.title-block h1 {
  margin: 0;
  width: max-content;
  max-width: 100%;
  background: linear-gradient(90deg, #0f172a 0%, #2563eb 52%, #7c3aed 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: clamp(28px, 2.4vw, 36px);
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: 0;
}

.eyebrow,
.section-kicker {
  margin: 0 0 4px;
  color: #d97706;
  font-size: 12px;
  font-weight: 700;
}

.title-status {
  width: max-content;
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(16, 185, 129, 0.18);
  border-radius: 999px;
  background: rgba(236, 253, 245, 0.86);
  color: #047857;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.title-status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12), 0 0 14px rgba(16, 185, 129, 0.34);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
  justify-content: flex-end;
  min-width: 0;
}

.field,
.dialog-field {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.field select,
.field input,
.dialog-field select,
.dialog-field input {
  min-height: 46px;
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  padding: 0 12px;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.field select:focus,
.field input:focus,
.dialog-field select:focus,
.dialog-field input:focus {
  border-color: rgba(37, 99, 235, 0.72);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12), 0 0 22px rgba(56, 189, 248, 0.14);
}

.filter-field {
  flex: 0 1 124px;
  width: auto;
  min-width: 0;
}

.provider-field {
  flex-basis: 154px;
  width: auto;
  min-width: 0;
}

.segmented {
  display: flex;
  min-height: 46px;
  padding: 3px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.segment {
  min-height: 38px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  padding: 0 10px;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.segment.active {
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  color: #fff;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.22);
}

.button,
.text-button {
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid transparent;
  padding: 0 11px;
  font-weight: 800;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.button:active,
.text-button:active,
.segment:active {
  transform: translateY(1px);
}

.button.primary {
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  color: #fff;
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.24);
}

.button.secondary {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(148, 163, 184, 0.32);
  color: var(--text);
}

.button.is-loading {
  position: relative;
  color: transparent;
}

.button.is-loading::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  margin-top: -9px;
  border: 2px solid rgba(30, 64, 175, 0.25);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.text-button {
  background: linear-gradient(135deg, #dbeafe 0%, #ede9fe 100%);
  color: var(--primary);
  border-color: transparent;
}

#logoutBtn:hover {
  border-color: rgba(225, 29, 72, 0.26);
  background: #fff1f2;
  color: #be123c;
}

.dashboard {
  display: grid;
  gap: 18px;
}

.dashboard.soft-refresh .source-strip,
.dashboard.soft-refresh .panel,
.dashboard.soft-refresh .kpi-card {
  animation-name: soft-pulse;
  animation-duration: 520ms;
  animation-timing-function: ease-out;
}

.source-strip {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid rgba(147, 197, 253, 0.4);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(239, 246, 255, 0.9), rgba(255, 255, 255, 0.86)),
    radial-gradient(circle at 0 0, rgba(59, 130, 246, 0.12), transparent 34%);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  transition: transform 220ms var(--ease-out), border-color 220ms ease, box-shadow 220ms ease, background 220ms ease;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.ai-recommendation-card {
  display: grid;
  gap: 18px;
  padding: 20px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(239, 246, 255, 0.9)),
    radial-gradient(circle at 100% 0, rgba(124, 58, 237, 0.1), transparent 34%);
  box-shadow: var(--shadow);
  transition: transform 220ms var(--ease-out), border-color 220ms ease, box-shadow 220ms ease, background 220ms ease;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.ai-recommendation-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.ai-recommendation-head > div:first-child {
  min-width: 0;
}

.ai-recommendation-head h2 {
  margin: 4px 0;
  font-size: 20px;
  line-height: 1.3;
}

.ai-recommendation-head p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.ai-recommendation-context {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.ai-recommendation-status {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  color: #475569;
  font-size: 13px;
}

.ai-recommendation-status > span {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  border-radius: 999px;
  padding: 5px 10px;
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.ai-budget-bars {
  display: grid;
  gap: 12px;
}

.ai-budget-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(120px, 2fr) 52px;
  gap: 12px;
  align-items: center;
}

.ai-budget-meta {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.ai-budget-meta strong,
.ai-budget-meta span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.ai-budget-meta span {
  color: #64748b;
  font-size: 13px;
}

.ai-budget-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.22);
}

.ai-budget-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #7c3aed);
  transform-origin: left center;
  animation: fill-track 520ms ease-out both;
}

.ai-budget-share {
  color: #1d4ed8;
  text-align: right;
}

.ai-provider-list {
  display: grid;
  gap: 12px;
}

.ai-provider-item {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(37, 99, 235, 0.12);
  background: rgba(255, 255, 255, 0.72);
}

.ai-provider-rank {
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
  font-weight: 800;
}

.ai-provider-main {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.ai-provider-title {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.ai-provider-stance {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.12);
  color: #0f766e;
  font-size: 12px;
  font-weight: 700;
}

.ai-provider-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: #475569;
  font-size: 13px;
}

.ai-recommendation-body {
  display: grid;
  gap: 12px;
}

.ai-recommendation-body ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
}

.ai-risk-note,
.ai-recommendation-loading,
.ai-recommendation-error {
  margin: 0;
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(15, 23, 42, 0.06);
  color: #334155;
}

.ai-recommendation-error {
  display: grid;
  gap: 6px;
}

.ai-recommendation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ai-recommendation-refresh {
  min-height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

.source-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.source-main > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.source-main strong {
  font-size: 14px;
}

.source-main span {
  color: var(--muted);
  font-size: 12px;
}

.source-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: block;
  border-radius: 14px;
  object-fit: contain;
  filter: drop-shadow(0 12px 20px rgba(37, 99, 235, 0.2));
}

.source-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

.source-stats span {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  padding: 0 12px;
}

.source-stats em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.source-stats strong {
  color: #1d4ed8;
  font-family: "Fira Code", Consolas, monospace;
  font-size: 13px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(160px, 1fr));
  gap: 14px;
}

.kpi-card,
.panel,
.metric-tile {
  position: relative;
  background: var(--surface-glass);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  transition: transform 220ms var(--ease-out), border-color 220ms ease, box-shadow 220ms ease, background 220ms ease;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.kpi-card {
  min-height: 142px;
  padding: 16px;
  display: grid;
  align-content: space-between;
  gap: 10px;
  overflow: hidden;
}

.kpi-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--kpi-accent, var(--primary)), rgba(255, 255, 255, 0));
  opacity: 0.84;
  transform: scaleX(1);
  transform-origin: left center;
  transition: opacity 220ms ease, transform 220ms var(--ease-out);
}

.kpi-card::after {
  content: "";
  position: absolute;
  right: -44px;
  top: -44px;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--kpi-accent, #2563eb) 22%, transparent), transparent 68%);
  opacity: 0.8;
  pointer-events: none;
}

.kpi-blue {
  --kpi-accent: #2563eb;
}

.kpi-amber {
  --kpi-accent: #f97316;
}

.kpi-green {
  --kpi-accent: #10b981;
}

.kpi-purple {
  --kpi-accent: #7c3aed;
}

.kpi-cyan {
  --kpi-accent: #0891b2;
}

.kpi-card.is-featured {
  border-color: rgba(16, 185, 129, 0.32);
  box-shadow: 0 16px 42px rgba(16, 185, 129, 0.12), var(--shadow);
}

.skeleton {
  position: relative;
  overflow: hidden;
  background: linear-gradient(90deg, #eef2f7 0%, #f8fafc 48%, #eef2f7 100%);
  background-size: 220% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
}

@keyframes shimmer {
  0% {
    background-position: 120% 0;
  }

  100% {
    background-position: -120% 0;
  }
}

.kpi-label,
.card-meta,
.table-sub,
.sync-time,
.chart-summary {
  color: var(--muted);
  font-size: 12px;
}

.kpi-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.kpi-main {
  display: grid;
  gap: 4px;
}

.kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 12px 22px color-mix(in srgb, var(--kpi-accent, #2563eb) 20%, transparent));
}

.kpi-value {
  font-family: "Fira Code", Consolas, monospace;
  font-size: clamp(23px, 1.8vw, 31px);
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: 0;
  color: var(--kpi-accent, var(--text));
}

.kpi-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.delta {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border: 1px solid color-mix(in srgb, var(--kpi-accent, #2563eb) 24%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--kpi-accent, #2563eb) 10%, white);
  color: var(--kpi-accent, var(--success));
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
}

.delta.down {
  color: var(--danger);
}

.layout-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.95fr) minmax(560px, 1.65fr) minmax(320px, 1fr);
  gap: 18px;
  align-items: stretch;
}

.bottom-grid {
  display: grid;
  grid-template-columns: minmax(640px, 2fr) minmax(300px, 0.74fr) minmax(320px, 0.86fr);
  gap: 18px;
}

.panel {
  min-width: 0;
  overflow: hidden;
  padding: 18px;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.3), transparent);
  pointer-events: none;
}

.panel-head {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel h2 {
  margin: 0;
  color: #0f172a;
  font-size: 19px;
  line-height: 1.3;
  letter-spacing: 0;
}

.channel-list,
.finance-stack,
.payment-list,
.bar-list {
  display: grid;
  gap: 10px;
}

.channel-item {
  position: relative;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: stretch;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(248, 250, 252, 0.72)),
    radial-gradient(circle at 0 0, color-mix(in srgb, var(--platform-color, #2563eb) 13%, transparent), transparent 44%);
  padding: 13px;
  transition: background 180ms ease, transform 180ms var(--ease-out), box-shadow 180ms ease;
}

.channel-mark {
  width: 6px;
  min-height: 100%;
  border-radius: 999px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--platform-color, #2563eb) 82%, #fff), var(--platform-color, #2563eb));
  box-shadow: 0 0 16px color-mix(in srgb, var(--platform-color, #2563eb) 28%, transparent);
  transition: transform 180ms var(--ease-out), filter 180ms ease;
}

.channel-main {
  min-width: 0;
  display: grid;
  gap: 9px;
}

.channel-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.channel-name {
  margin: 0;
  color: #0f172a;
  font-weight: 900;
}

.channel-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.channel-metrics span {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--muted);
  padding: 4px 8px;
  font-size: 12px;
}

.channel-metrics strong {
  color: #0f172a;
  font-weight: 800;
}

.channel-progress,
.risk-meter,
.bar-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.82);
}

.channel-progress span,
.risk-meter span,
.bar-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--platform-color, var(--primary));
  transform-origin: left center;
  animation: fill-track 520ms ease-out both;
}

.channel-side {
  display: grid;
  justify-items: end;
  align-content: center;
  gap: 6px;
}

.platform-avatar {
  width: 28px;
  height: 28px;
  display: inline-block;
  flex: 0 0 auto;
  border-radius: 10px;
  object-fit: contain;
  filter: drop-shadow(0 8px 14px color-mix(in srgb, var(--platform-color, #2563eb) 18%, transparent));
}

.platform-douyin {
  --platform-color: #2563eb;
}

.platform-xiaohongshu {
  --platform-color: #e11d48;
}

.platform-video {
  --platform-color: #0f766e;
}

.money {
  font-family: "Fira Code", Consolas, monospace;
  font-weight: 700;
  white-space: nowrap;
}

.roi-pill {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  font-family: "Fira Code", Consolas, monospace;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.roi-high {
  background: #dcfce7;
  color: #047857;
}

.roi-mid {
  background: #dbeafe;
  color: #1d4ed8;
}

.roi-low {
  background: #ffedd5;
  color: #c2410c;
}

.status-pill {
  position: relative;
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  transition: transform 180ms var(--ease-out), box-shadow 180ms ease, filter 180ms ease;
}

.has-tip::after {
  content: attr(data-tip);
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 8;
  width: max-content;
  max-width: min(260px, calc(100vw - 40px));
  padding: 8px 10px;
  border-radius: var(--radius);
  background: #111827;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px) scale(0.98);
  transform-origin: right bottom;
  transition: opacity 160ms ease, transform 160ms var(--ease-out);
  box-shadow: var(--shadow-hover);
}

.has-tip::before {
  content: "";
  position: absolute;
  right: 14px;
  bottom: calc(100% + 3px);
  z-index: 9;
  border: 5px solid transparent;
  border-top-color: #111827;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.status-success {
  background: #dcfce7;
  color: #166534;
}

.status-info {
  background: #dbeafe;
  color: #1d4ed8;
}

.status-warning {
  background: #fef3c7;
  color: #92400e;
}

.status-muted {
  background: #eef2f7;
  color: #475467;
}

.status-danger {
  background: #ffedd5;
  color: #9a3412;
}

.chart-box {
  position: relative;
  width: 100%;
  aspect-ratio: 2.1 / 1;
  min-height: 260px;
}

.chart-box svg {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-point {
  cursor: pointer;
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 180ms var(--ease-out), filter 180ms ease, stroke-width 180ms ease;
}

.chart-point:focus,
.chart-point.is-active {
  outline: none;
  stroke: #111827;
  stroke-width: 3;
  transform: scale(1.55);
  filter: drop-shadow(0 3px 5px rgba(17, 24, 39, 0.24));
}

.chart-guide {
  opacity: 0;
  stroke: #94a3b8;
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.chart-guide.is-visible {
  opacity: 1;
}

.chart-tooltip {
  position: absolute;
  z-index: 5;
  display: none;
  min-width: 132px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.94);
  color: #fff;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.6;
  pointer-events: none;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.26);
  transform: translateY(4px);
  transition: opacity 160ms ease, transform 160ms var(--ease-out);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.chart-tooltip.show {
  display: block;
  animation: tooltip-in 160ms var(--ease-out) both;
}

.trend-panel {
  overflow: hidden;
  border-color: rgba(147, 197, 253, 0.42);
  background:
    radial-gradient(circle at 18% 0%, rgba(59, 130, 246, 0.16), transparent 30%),
    radial-gradient(circle at 88% 10%, rgba(124, 58, 237, 0.1), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 251, 255, 0.9) 100%);
  box-shadow: 0 18px 46px rgba(37, 99, 235, 0.08), var(--shadow);
}

.trend-panel-head {
  align-items: flex-start;
  margin-bottom: 12px;
}

.trend-panel-subtitle {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.trend-meta {
  flex: 0 0 auto;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1e40af;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
}

.trend-summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(108px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.trend-summary-card {
  position: relative;
  min-height: 70px;
  display: grid;
  align-content: center;
  gap: 3px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  padding: 11px;
  transition: transform 180ms var(--ease-out), box-shadow 180ms ease;
}

.trend-summary-card::after {
  content: "";
  position: absolute;
  right: -20px;
  top: -24px;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.44);
}

.trend-summary-card span {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.trend-summary-card strong {
  color: #0f172a;
  font-family: "Fira Code", Consolas, monospace;
  font-size: 18px;
  line-height: 1.2;
  position: relative;
  z-index: 1;
}

.trend-summary-card em {
  color: #64748b;
  font-size: 11px;
  font-style: normal;
}

.trend-summary-blue {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
}

.trend-summary-amber {
  background: linear-gradient(135deg, #fff7ed, #ffedd5);
}

.trend-summary-green {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
}

.trend-summary-purple {
  background: linear-gradient(135deg, #f5f3ff, #ede9fe);
}

.trend-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.trend-legend-item {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: #334155;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.04);
  transition: transform 160ms var(--ease-out), box-shadow 160ms ease, opacity 160ms ease;
}

.trend-legend-item span,
.trend-tooltip-row i {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: var(--metric-color);
}

.trend-legend-item.is-muted {
  opacity: 0.45;
}

.trend-chart-box {
  min-height: 250px;
  aspect-ratio: 2.55 / 1;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(239, 246, 255, 0.34)),
    repeating-linear-gradient(90deg, transparent 0 42px, rgba(37, 99, 235, 0.025) 42px 43px);
  padding: 4px;
}

.trend-grid-line,
.trend-axis-line {
  stroke: #dbe7f5;
  stroke-width: 1;
}

.trend-axis-label,
.trend-x-label {
  fill: #64748b;
  font-size: 11px;
}

.trend-bar {
  opacity: 0.92;
  transition: opacity 160ms ease, filter 160ms ease, transform 160ms var(--ease-out);
}

.trend-date-zone {
  cursor: crosshair;
}

.trend-date-zone.is-active {
  fill: rgba(37, 99, 235, 0.06);
}

.trend-roi-line {
  filter: drop-shadow(0 4px 8px rgba(109, 40, 217, 0.18));
}

.trend-roi-area {
  pointer-events: none;
}

.trend-average-line {
  stroke: rgba(124, 58, 237, 0.42);
  stroke-width: 1.4;
  stroke-dasharray: 5 5;
}

.trend-average-label {
  fill: #6d28d9;
  font-size: 11px;
  font-weight: 800;
}

.trend-roi-point {
  transition: r 160ms ease, filter 160ms ease;
}

.trend-bar.is-active,
.trend-roi-point.is-active {
  filter: saturate(1.2) drop-shadow(0 6px 10px rgba(15, 23, 42, 0.14));
}

.trend-roi-point.is-active {
  r: 7px;
}

.trend-insight {
  margin: 10px 0 0;
  border: 1px solid rgba(147, 197, 253, 0.28);
  border-radius: 12px;
  background: rgba(239, 246, 255, 0.58);
  padding: 10px 12px;
  color: #334155;
  font-weight: 700;
}

.trend-chart-box .chart-tooltip {
  min-width: 220px;
  border-color: rgba(15, 23, 42, 0.12);
  border-radius: 8px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.22);
}

.trend-tooltip-title {
  margin-bottom: 8px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
}

.trend-tooltip-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  align-items: center;
  padding: 5px 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
}

.trend-tooltip-row span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.trend-tooltip-row strong {
  color: #ffffff;
  font-family: "Fira Code", Consolas, monospace;
}

.trend-tooltip-row em {
  grid-column: 1 / -1;
  color: #a7f3d0;
  font-size: 11px;
  font-style: normal;
}

.trend-line.draw-line {
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  animation: draw-line 780ms ease-out forwards;
}

.trend-line.dashed {
  opacity: 0;
  animation: fade-line 520ms ease-out 120ms forwards;
}

.pop-in {
  animation: pop-in 220ms ease-out both;
}

.legend {
  display: flex;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  align-items: center;
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
}

.legend-dot.spend {
  background: var(--primary);
}

.legend-dot.deal {
  background: var(--accent);
}

.metric-tile {
  box-shadow: none;
  padding: 13px;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-top: 0;
}

.finance-tile {
  display: grid;
  gap: 9px;
  border-color: rgba(148, 163, 184, 0.22);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.74)),
    radial-gradient(circle at 0 0, color-mix(in srgb, var(--platform-color, #2563eb) 12%, transparent), transparent 42%);
}

.finance-platform {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #0f172a;
  font-weight: 900;
}

.finance-amount-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.finance-amount-row strong {
  color: var(--platform-color, #2563eb);
  font-family: "Fira Code", Consolas, monospace;
  font-size: 14px;
}

.top-badge {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, #eff6ff, #ede9fe);
  color: #1d4ed8;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 900;
  margin-right: 6px;
}

.risk-meter {
  margin-top: 10px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 12px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.86);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  background: linear-gradient(180deg, #f8fbff, #eef4ff);
  position: sticky;
  top: 0;
  z-index: 2;
}

tbody tr:nth-child(even) {
  background: rgba(248, 250, 252, 0.58);
}

td {
  font-size: 14px;
}

.table-platform {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.table-platform .platform-avatar {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  font-size: 12px;
}

.sort-button {
  min-height: 36px;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: inherit;
  font-weight: inherit;
}

.sort-button:hover {
  color: var(--primary);
}

.pagination-strip {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 12px;
  color: #475467;
  font-size: 13px;
}

.pagination-button {
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(255, 255, 255, 0.78);
  color: #0f172a;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms var(--ease-out), box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
}

.pagination-button:disabled {
  cursor: not-allowed;
  color: #98a2b3;
  background: #f8fafc;
}

.pagination-meta,
.pagination-total {
  white-space: nowrap;
}

.empty-state {
  min-height: 90px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(148, 163, 184, 0.36);
  border-radius: 14px;
  background: rgba(248, 251, 255, 0.78);
  color: var(--muted);
  padding: 16px;
  text-align: center;
}

.empty-state.wide {
  grid-column: 1 / -1;
}

.bar-item {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.68);
  padding: 12px;
}

.bar-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}

.payment-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px 10px;
  align-items: center;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.68);
  padding: 12px;
}

.payment-item.highlight {
  animation: highlight-row 1400ms ease-out both;
}

.payment-note {
  color: var(--muted);
  font-size: 12px;
}

.payment-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.payment-rank {
  width: 38px;
  min-height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--platform-color, #2563eb) 12%, white);
  color: var(--platform-color, #2563eb);
  font-size: 12px;
  font-weight: 900;
}

.payment-dialog {
  width: min(460px, calc(100vw - 32px));
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  box-shadow: 0 24px 70px rgba(16, 24, 40, 0.24);
}

.receipt-dialog {
  width: min(780px, calc(100vw - 32px));
}

.payment-dialog[open] {
  animation: enter-up 180ms ease-out both;
}

.payment-dialog::backdrop {
  background: rgba(15, 23, 42, 0.48);
}

.dialog-body {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.receipt-workspace {
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) minmax(260px, 1.15fr);
  gap: 12px;
}

.receipt-upload {
  position: relative;
  min-height: 184px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 1px dashed var(--state-border);
  border-radius: var(--radius);
  background: #f8fbff;
  color: var(--text);
  padding: 18px;
  text-align: center;
  cursor: pointer;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms var(--ease-out);
}

.receipt-upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.receipt-upload span:not(.upload-icon) {
  color: var(--muted);
  font-size: 12px;
}

.upload-icon {
  position: relative;
  width: 38px;
  height: 38px;
  border: 2px solid var(--primary);
  border-radius: 50%;
}

.upload-icon::before,
.upload-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  background: var(--primary);
  transform: translateX(-50%);
}

.upload-icon::before {
  top: 10px;
  width: 2px;
  height: 16px;
}

.upload-icon::after {
  top: 10px;
  width: 12px;
  height: 12px;
  border-left: 2px solid var(--primary);
  border-top: 2px solid var(--primary);
  background: transparent;
  transform: translateX(-50%) rotate(45deg);
}

.receipt-preview {
  min-height: 184px;
  max-height: 240px;
  display: grid;
  align-content: start;
  gap: 8px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fafbfc;
  color: var(--muted);
  padding: 10px;
}

.receipt-preview > span:only-child {
  align-self: center;
  justify-self: center;
}

.receipt-file-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  padding: 10px 12px;
  text-align: left;
  overflow-wrap: anywhere;
}

.receipt-file-thumb,
.receipt-file-icon {
  width: 60px;
  height: 60px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.receipt-file-thumb {
  display: block;
  object-fit: contain;
}

.receipt-file-icon {
  position: relative;
  display: block;
  background: #f8fafc;
}

.receipt-file-icon::before {
  content: "";
  position: absolute;
  left: 17px;
  top: 12px;
  width: 24px;
  height: 32px;
  border: 2px solid var(--muted);
  border-radius: 3px;
  background: #fff;
}

.receipt-file-icon::after {
  content: "";
  position: absolute;
  left: 34px;
  top: 12px;
  border: 7px solid transparent;
  border-top-color: #f8fafc;
  border-right-color: #f8fafc;
  box-shadow: -1px 1px 0 var(--muted);
}

.receipt-file-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.receipt-file-main strong,
.receipt-file-main span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.receipt-file-remove {
  position: relative;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  flex: 0 0 auto;
}

.receipt-file-remove::before,
.receipt-file-remove::after {
  content: "";
  position: absolute;
  left: 9px;
  top: 15px;
  width: 12px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.receipt-file-remove::before {
  transform: rotate(45deg);
}

.receipt-file-remove::after {
  transform: rotate(-45deg);
}

.receipt-extract {
  display: grid;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fafbfc;
  padding: 12px;
  min-height: 180px;
}

.receipt-extract > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.batch-summary {
  display: flex;
  min-height: 30px;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  overflow-wrap: anywhere;
}

.batch-list {
  display: grid;
  gap: 8px;
  max-height: 320px;
  overflow: auto;
}

.batch-item {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 10px;
  align-items: start;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  padding: 10px;
}

.batch-item-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.batch-item-main strong,
.batch-item-main span,
.batch-item-message,
.batch-item-note,
.batch-fields dd {
  min-width: 0;
  overflow-wrap: anywhere;
}

.batch-item-main span,
.batch-item-note {
  color: var(--muted);
  font-size: 12px;
}

.batch-status {
  min-width: 88px;
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.batch-status.is-success {
  background: #dcfce7;
  color: #166534;
}

.batch-status.is-warning {
  background: #fef3c7;
  color: #92400e;
}

.batch-status.is-danger {
  background: #fee2e2;
  color: #991b1b;
}

.batch-status.is-active {
  background: #dbeafe;
  color: #1d4ed8;
}

.batch-status.is-muted {
  background: #eef2f7;
  color: #475467;
}

.batch-fields {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
}

.batch-fields div {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fafbfc;
  padding: 7px;
}

.batch-fields dt {
  color: var(--muted);
  font-size: 11px;
}

.batch-fields dd {
  margin: 2px 0 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.batch-item-message {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.batch-item-note {
  grid-column: 1 / -1;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.icon-close {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  position: relative;
}

.icon-close::before,
.icon-close::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 2px;
  background: var(--muted);
  left: 13px;
  top: 20px;
}

.icon-close::before {
  transform: rotate(45deg);
}

.icon-close::after {
  transform: rotate(-45deg);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  min-height: 44px;
  max-width: min(360px, calc(100vw - 40px));
  display: none;
  align-items: center;
  border-radius: var(--radius);
  background: #111827;
  color: #fff;
  padding: 10px 14px;
  box-shadow: var(--shadow);
}

.toast.show {
  display: flex;
}

@media (hover: hover) and (pointer: fine) {
  .field select:hover,
  .field input:hover,
  .dialog-field select:hover,
  .dialog-field input:hover {
    border-color: rgba(37, 99, 235, 0.36);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
  }

  .segment:hover {
    background: #edf4ff;
    color: var(--primary);
    transform: translateY(-1px);
  }

  .segment.active:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #6d28d9 100%);
    color: #fff;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.26);
  }

  .button.primary:hover,
  .button.primary:focus-visible {
    background: linear-gradient(135deg, #1d4ed8 0%, #6d28d9 100%);
    box-shadow: 0 16px 30px rgba(37, 99, 235, 0.28);
    transform: translateY(-1px);
  }

  .button.secondary:hover,
  .text-button:hover,
  .icon-close:hover,
  .receipt-file-remove:hover,
  .receipt-file-remove:focus-visible {
    border-color: var(--state-border);
    background: var(--state-bg);
    color: var(--primary);
    box-shadow: 0 8px 18px rgba(24, 32, 51, 0.08);
    transform: translateY(-1px);
  }

  .receipt-upload:hover,
  .receipt-upload:focus-within {
    border-color: var(--primary);
    box-shadow: 0 10px 22px rgba(30, 64, 175, 0.12);
    transform: translateY(-1px);
  }

  .source-strip:hover,
  .panel:hover,
  .kpi-card:hover,
  .metric-tile:hover {
    border-color: var(--state-border);
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
  }

  .kpi-card:hover::before {
    opacity: 1;
    transform: scaleX(1);
  }

  .kpi-card:hover .kpi-value,
  .metric-tile:hover .money {
    color: var(--kpi-accent, var(--primary));
  }

  .channel-item:hover {
    background:
      linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(239, 246, 255, 0.82)),
      radial-gradient(circle at 0 0, color-mix(in srgb, var(--platform-color, #2563eb) 18%, transparent), transparent 46%);
    box-shadow: 0 14px 30px color-mix(in srgb, var(--platform-color, #2563eb) 12%, transparent);
    transform: translateY(-2px);
  }

  .channel-item:hover .channel-mark {
    filter: saturate(1.16) brightness(1.05);
    transform: scaleY(1.12);
  }

  .status-pill:hover,
  .roi-pill:hover,
  .status-pill:focus-visible {
    filter: saturate(1.06);
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(24, 32, 51, 0.12);
  }

  .trend-summary-card:hover,
  .trend-legend-item:hover,
  .trend-legend-item:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.1);
  }

  .has-tip:hover::after,
  .has-tip:hover::before,
  .has-tip:focus-visible::after,
  .has-tip:focus-visible::before {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  tbody tr {
    transition: background 160ms ease, box-shadow 160ms ease;
  }

  tbody tr:hover {
    background: #f0f7ff;
    box-shadow: inset 3px 0 0 rgba(30, 64, 175, 0.22);
  }

  tbody tr:hover .money {
    color: var(--primary);
  }

  .sort-button:hover {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
  }

  .risk-meter,
  .bar-track {
    transition: background 180ms ease, box-shadow 180ms ease, transform 180ms var(--ease-out);
  }

  .risk-meter span,
  .bar-track span {
    transition: filter 180ms ease, transform 180ms var(--ease-out);
  }

  .metric-tile:hover .risk-meter,
  .bar-item:hover .bar-track,
  .bar-item:focus-visible .bar-track {
    background: #e2eaf5;
    box-shadow: inset 0 0 0 1px rgba(30, 64, 175, 0.08);
    transform: scaleY(1.18);
  }

  .metric-tile:hover .risk-meter span,
  .bar-item:hover .bar-track span,
  .bar-item:focus-visible .bar-track span {
    filter: saturate(1.18) brightness(1.05);
    transform: scaleX(1) scaleY(1.28);
  }

  .bar-item {
    transition: background 180ms ease, box-shadow 180ms ease, transform 180ms var(--ease-out);
  }

  .bar-item:hover,
  .bar-item:focus-visible {
    background: rgba(248, 251, 255, 0.9);
    box-shadow: 0 12px 24px color-mix(in srgb, var(--platform-color, #2563eb) 12%, transparent);
    transform: translateY(-1px);
  }

  .bar-item:hover .money,
  .bar-item:focus-visible .money {
    color: var(--primary);
  }

  .payment-item {
    transition: background 180ms ease, box-shadow 180ms ease, transform 180ms var(--ease-out);
  }

  .payment-item:hover {
    background: rgba(248, 251, 255, 0.92);
    box-shadow: 0 12px 24px color-mix(in srgb, var(--platform-color, #2563eb) 11%, transparent);
    transform: translateY(-1px);
  }

  .pagination-button:not(:disabled):hover {
    border-color: rgba(37, 99, 235, 0.38);
    background: #eff6ff;
    color: #1d4ed8;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.1);
    transform: translateY(-1px);
  }
}

@media (max-width: 1280px) {
  .topbar,
  .layout-grid,
  .bottom-grid {
    grid-template-columns: 1fr;
  }

  .toolbar {
    justify-content: flex-start;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

  .trend-summary-grid {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }

  .ai-budget-row {
    grid-template-columns: minmax(140px, 1fr) minmax(100px, 2fr) 52px;
  }
}

@media (max-width: 1040px) {
  .topbar {
    align-items: start;
  }

  .toolbar {
    width: 100%;
  }

  .source-strip {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .source-stats {
    width: 100%;
    margin-left: 0;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 12px;
  }

  .title-block h1 {
    font-size: 24px;
  }

  .topbar {
    border-radius: 16px;
    padding: 14px;
  }

  .toolbar,
  .segmented,
  .source-strip,
  .ai-recommendation-card {
    width: 100%;
  }

  .source-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .ai-recommendation-head {
    display: grid;
  }

  .ai-recommendation-status {
    align-items: flex-start;
  }

  .ai-budget-row {
    grid-template-columns: 1fr;
  }

  .ai-budget-share {
    text-align: left;
  }

  .ai-provider-item {
    grid-template-columns: 1fr;
  }

  .ai-provider-rank {
    width: fit-content;
    padding: 4px 10px;
  }

  .field,
  .field select,
  .field input,
  .button {
    width: 100%;
  }

  .segmented {
    overflow-x: auto;
  }

  .segment {
    flex: 0 0 auto;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .source-stats span {
    flex: 1 1 160px;
  }

  .channel-item {
    grid-template-columns: 6px minmax(0, 1fr);
  }

  .channel-side {
    grid-column: 2;
    justify-items: start;
  }

  .panel {
    padding: 14px;
  }

  .chart-box {
    min-height: 220px;
    aspect-ratio: 1.25 / 1;
  }

  .trend-panel-head {
    flex-direction: column;
  }

  .trend-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .trend-chart-box {
    min-height: 230px;
    aspect-ratio: 1.35 / 1;
  }

  .payment-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .payment-item > .money,
  .payment-item > .roi-pill {
    grid-column: 2;
    justify-self: start;
  }

  .receipt-workspace {
    grid-template-columns: 1fr;
  }

  .receipt-upload,
  .receipt-preview {
    min-height: 160px;
  }

  .batch-item,
  .batch-fields {
    grid-template-columns: 1fr;
  }

  .batch-status {
    justify-self: start;
    white-space: normal;
  }

  .dialog-actions {
    flex-wrap: wrap;
  }

  .dialog-actions .button {
    flex: 1 1 180px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    scroll-behavior: auto !important;
    animation: none !important;
  }

  .auth-video {
    display: none;
  }

  .trend-line.draw-line {
    stroke-dashoffset: 0;
  }

  .trend-line.dashed {
    opacity: 1;
  }
}

.button.is-disabled {
  cursor: wait;
  opacity: 0.72;
}

/* Immersive login composition */
.font-pixel {
  font-family: "basis33", "Inter", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", monospace;
  font-weight: 400;
}

.auth-screen {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  height: 100vh;
  display: block;
  overflow: hidden;
  padding: 0;
  background: #000 url("./assets/login/login-poster.png?v=20260729-immersive-login") center / cover no-repeat;
  color: #fff;
  font-family: "Inter", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", Arial, sans-serif;
}

.auth-video {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.04) contrast(1.02);
  pointer-events: none;
  user-select: none;
}

.auth-vignette {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: -1;
  width: min(980px, 92vw);
  height: min(560px, 70vh);
  background: radial-gradient(ellipse at 18% 92%, rgba(0, 0, 0, 0.78) 0, rgba(0, 0, 0, 0.42) 34%, transparent 72%);
  pointer-events: none;
}

.auth-layout {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: clamp(22px, 3vw, 48px) clamp(22px, 4vw, 72px) clamp(16px, 2vw, 28px);
}

.auth-navbar {
  min-height: 52px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
}

.auth-wordmark {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-project-mark {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
}

.auth-project-mark rect {
  fill: rgba(255, 255, 255, 0.08);
  stroke: rgba(255, 255, 255, 0.74);
  stroke-width: 1;
}

.auth-project-mark path,
.auth-project-mark circle {
  fill: none;
  stroke: #fff;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.auth-project-mark circle {
  fill: #fff;
  stroke: none;
}

.auth-wordmark > div,
.auth-access {
  display: grid;
  gap: 2px;
}

.auth-wordmark strong,
.auth-access strong {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.auth-wordmark span,
.auth-access span {
  color: rgba(255, 255, 255, 0.56);
  font-size: 11px;
  letter-spacing: 0.14em;
}

.auth-access {
  justify-items: end;
  text-align: right;
}

.auth-meta-grid {
  margin-top: clamp(24px, 4vh, 50px);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(18px, 3vw, 54px);
}

.auth-meta-item {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 5px;
}

.auth-meta-item > span {
  color: rgba(255, 255, 255, 0.48);
  font-size: 13px;
  letter-spacing: 0.15em;
}

.auth-meta-item strong {
  color: #fff;
  font-size: clamp(16px, 1.25vw, 21px);
  font-weight: 500;
  letter-spacing: 0.04em;
}

.auth-meta-item p {
  margin: 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  line-height: 1.5;
}

.auth-spacer {
  flex: 1 1 auto;
  min-height: 24px;
}

.auth-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr);
  align-items: end;
  gap: clamp(30px, 5vw, 88px);
}

.auth-hero {
  position: relative;
  max-width: 960px;
  padding: 24px 0 16px;
}

.auth-hero::before {
  content: "";
  position: absolute;
  left: -8vw;
  bottom: -8vh;
  z-index: -1;
  width: min(800px, 75vw);
  height: min(420px, 44vh);
  background: radial-gradient(ellipse at 30% 70%, rgba(0, 0, 0, 0.72), transparent 68%);
  pointer-events: none;
}

.auth-hero-kicker {
  margin: 0 0 12px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
}

.auth-hero-kicker span {
  color: #fff;
  font-size: 15px;
}

.auth-hero h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(48px, 5.45vw, 92px);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.94;
  text-wrap: balance;
  text-shadow: 0 4px 32px rgba(0, 0, 0, 0.48);
}

.auth-hero h1 span {
  display: block;
  margin-top: 0.08em;
  font-size: 0.82em;
  letter-spacing: 0.01em;
}

.auth-form {
  width: min(430px, 100%);
  min-height: 0;
  justify-self: end;
  display: grid;
  align-content: end;
  gap: 14px;
  overflow: hidden;
  padding: clamp(24px, 2.4vw, 38px);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 2px;
  background: rgba(5, 7, 11, 0.54);
  color: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  animation: none;
}

.auth-eyebrow {
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
}

.auth-form-head {
  display: grid;
  gap: 4px;
  margin-bottom: 5px;
}

.auth-form-head h2 {
  color: #fff;
  font-size: clamp(25px, 2vw, 32px);
  font-weight: 500;
}

.auth-form-head p:last-child {
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
}

.auth-field {
  display: grid;
  gap: 6px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
}

.auth-field input {
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 1px;
  background: rgba(0, 0, 0, 0.32);
  color: #fff;
  box-shadow: none;
}

.auth-field input::placeholder {
  color: rgba(255, 255, 255, 0.38);
}

.auth-field:focus-within span {
  color: #fff;
}

.auth-field input:focus,
.auth-screen .auth-field input:hover {
  border-color: rgba(255, 255, 255, 0.72);
  background: rgba(0, 0, 0, 0.52);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12);
}

.auth-error {
  min-height: 18px;
  color: #fecdd3;
  font-size: 11px;
}

.auth-screen .button.primary.auth-submit,
.auth-screen .button.primary.auth-submit:hover,
.auth-screen .button.primary.auth-submit:focus-visible {
  min-height: 48px;
  border: 1px solid #fff;
  border-radius: 1px;
  background: #fff;
  color: #050505;
  box-shadow: none;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.auth-screen .button.primary.auth-submit:hover,
.auth-screen .button.primary.auth-submit:focus-visible {
  background: rgba(255, 255, 255, 0.86);
  transform: translateY(-1px);
}

.auth-footer {
  min-height: 22px;
  margin-top: clamp(12px, 2vh, 22px);
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  color: rgba(255, 255, 255, 0.46);
  font-size: 10px;
  letter-spacing: 0.05em;
}

.auth-footer p {
  margin: 0;
}

.auth-font-credit {
  position: static;
  color: inherit;
  font-size: inherit;
}

@media (min-width: 1024px) {
  .auth-video {
    transform: scale(1.2);
  }
}

@media (max-height: 760px) and (min-width: 761px) {
  .auth-layout {
    padding-top: 20px;
    padding-bottom: 14px;
  }

  .auth-meta-grid {
    margin-top: 18px;
  }

  .auth-meta-item p {
    display: none;
  }

  .auth-spacer {
    min-height: 14px;
  }

  .auth-hero h1 {
    font-size: clamp(42px, 5vw, 68px);
  }

  .auth-form {
    gap: 10px;
    padding: 22px 28px;
  }

  .auth-footer {
    margin-top: 10px;
  }
}

@media (max-width: 1024px), (max-height: 760px) {
  .auth-screen {
    height: auto;
    min-height: 100svh;
    overflow-x: hidden;
    overflow-y: auto;
    scroll-padding-bottom: 30vh;
  }

  .auth-layout {
    height: auto;
    min-height: 100svh;
  }
}

@media (max-width: 760px) {
  .auth-layout {
    padding: 18px 18px 12px;
  }

  .auth-navbar {
    min-height: 44px;
    gap: 18px;
  }

  .auth-project-mark {
    width: 32px;
    height: 32px;
  }

  .auth-wordmark strong,
  .auth-access strong {
    font-size: 12px;
  }

  .auth-wordmark span,
  .auth-access span {
    font-size: 9px;
  }

  .auth-meta-grid {
    margin-top: 28px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 24px;
  }

  .auth-meta-item p {
    display: none;
  }

  .auth-meta-item strong {
    font-size: 15px;
  }

  .auth-spacer {
    min-height: 42px;
  }

  .auth-bottom {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .auth-hero {
    padding: 0;
  }

  .auth-hero::before {
    left: -30vw;
    width: 120vw;
  }

  .auth-hero-kicker {
    margin-bottom: 8px;
  }

  .auth-hero h1 {
    font-size: clamp(40px, 12vw, 58px);
    line-height: 0.96;
  }

  .auth-form {
    width: 100%;
    justify-self: stretch;
    gap: 13px;
    padding: 22px;
  }

  .auth-field input {
    min-height: 48px;
  }

  .auth-screen .button.primary.auth-submit {
    min-height: 48px;
  }

  .auth-footer {
    margin-top: 18px;
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

@media (max-width: 420px) and (max-height: 760px) {
  .auth-meta-grid {
    display: none;
  }

  .auth-spacer {
    min-height: 32px;
  }

  .auth-hero h1 {
    font-size: clamp(36px, 11vw, 46px);
  }

  .auth-form {
    padding: 20px;
  }
}
