:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --panel: #ffffff;
  --panel-soft: #f0f3f7;
  --text: #1d2430;
  --muted: #667085;
  --line: #dfe4ea;
  --accent: #2663eb;
  --accent-2: #00a879;
  --warning: #f59e0b;
  --danger: #e5484d;
  --shadow: 0 18px 45px rgba(30, 41, 59, 0.08);
}

body.dark {
  color-scheme: dark;
  --bg: #12151b;
  --panel: #1b2029;
  --panel-soft: #242b36;
  --text: #edf2f7;
  --muted: #aab3c2;
  --line: #333b49;
  --accent: #6aa7ff;
  --accent-2: #47d6a2;
  --warning: #ffb84d;
  --danger: #ff6b74;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1100px;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Hiragino Sans", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 6px;
  padding: 9px 12px;
  cursor: pointer;
}

button:hover {
  border-color: var(--accent);
}

.shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: var(--panel);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark-shell {
  width: 72px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background:
    linear-gradient(var(--panel), var(--panel)) padding-box,
    linear-gradient(135deg, rgba(0, 160, 255, 0.4), rgba(255, 0, 120, 0.34)) border-box;
  border: 1px solid transparent;
  box-shadow:
    0 10px 28px rgba(37, 99, 235, 0.12),
    0 0 26px rgba(255, 0, 120, 0.08);
}

.brand-mark {
  width: 58px;
  height: 48px;
  display: block;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.brand strong,
.brand small {
  display: block;
}

.brand small,
.eyebrow,
.side-title {
  color: var(--muted);
  font-size: 12px;
}

.nav-search input,
.filters input,
.filters select,
.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 6px;
  padding: 10px 12px;
  outline: none;
}

.nav-list {
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-right: 4px;
}

.nav-item {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.nav-item.active {
  background: var(--panel-soft);
  border-color: var(--line);
  color: var(--text);
}

.badge {
  min-width: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(38, 99, 235, 0.14);
  color: var(--accent);
  text-align: center;
  font-size: 12px;
}

.side-panel {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  display: grid;
  gap: 7px;
}

.side-panel button {
  text-align: left;
  background: var(--panel-soft);
}

.workspace {
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.2;
}

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

.icon-button {
  width: 40px;
  height: 40px;
  padding: 0;
  display: grid;
  place-items: center;
}

.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  font-size: 28px;
  margin-top: 8px;
}

.metric small {
  color: var(--accent-2);
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

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

.tab {
  background: var(--panel);
}

.tab.active {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

.filters {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 150px 150px;
  gap: 10px;
  min-width: 620px;
}

.content {
  display: grid;
  gap: 16px;
}

.board {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 16px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.panel-header {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

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

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 12px;
  background: var(--panel-soft);
}

td {
  font-size: 14px;
}

.name-cell {
  white-space: normal;
  min-width: 220px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 12px;
  background: var(--panel-soft);
}

.tag.green {
  background: rgba(0, 168, 121, 0.15);
  color: var(--accent-2);
}

.tag.blue {
  background: rgba(38, 99, 235, 0.14);
  color: var(--accent);
}

.tag.orange {
  background: rgba(245, 158, 11, 0.16);
  color: var(--warning);
}

.tag.red {
  background: rgba(229, 72, 77, 0.14);
  color: var(--danger);
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 14px;
}

.feature-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  display: grid;
  gap: 10px;
  min-height: 142px;
  box-shadow: var(--shadow);
}

.feature-card h3 {
  margin: 0;
  font-size: 17px;
}

.feature-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.animation-studio {
  display: grid;
  grid-template-columns: minmax(520px, 1.2fr) minmax(360px, 0.8fr);
  gap: 16px;
}

.animation-composer {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.composer-header {
  border-bottom: 1px solid var(--line);
}

.composer-body {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px;
}

.composer-body label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.composer-body input,
.composer-body select,
.composer-body textarea,
.prompt-box textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 6px;
  padding: 10px 12px;
  outline: none;
}

.composer-body .wide {
  grid-column: 1 / -1;
}

.composer-actions {
  padding: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.animation-preview {
  display: grid;
  grid-template-rows: auto auto 1fr;
}

.preview-screen {
  aspect-ratio: 9 / 16;
  margin: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(160deg, rgba(38, 99, 235, 0.18), transparent 38%),
    linear-gradient(22deg, rgba(0, 168, 121, 0.18), transparent 42%),
    var(--panel-soft);
  display: grid;
  place-items: center;
  text-align: center;
  overflow: hidden;
}

.preview-screen video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-screen div {
  display: grid;
  gap: 8px;
  padding: 18px;
}

.preview-screen span,
.preview-meta span,
.animation-job small {
  color: var(--muted);
  font-size: 12px;
}

.preview-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--line);
}

.preview-meta div {
  background: var(--panel);
  padding: 12px;
}

.preview-meta strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
}

.prompt-box {
  display: grid;
  align-content: start;
}

.prompt-box .panel-header {
  border-bottom: 0;
  padding-bottom: 8px;
}

.prompt-box textarea {
  margin: 0 16px 16px;
  width: calc(100% - 32px);
  resize: vertical;
  line-height: 1.5;
}

.animation-list {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.animation-job {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: start;
}

.animation-job h3 {
  margin: 8px 0 6px;
}

.animation-job p {
  margin-bottom: 8px;
  color: var(--muted);
  line-height: 1.5;
}

.animation-job .error-text {
  color: var(--danger);
  background: rgba(229, 72, 77, 0.1);
  border: 1px solid rgba(229, 72, 77, 0.18);
  border-radius: 6px;
  padding: 9px 10px;
}

.job-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.button-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--text);
  text-decoration: none;
}

.empty-state {
  padding: 18px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.business-card-studio {
  display: grid;
  grid-template-columns: minmax(420px, 0.82fr) minmax(620px, 1.18fr);
  gap: 16px;
}

.business-card-form,
.business-card-preview-panel {
  align-self: start;
}

.card-form-grid {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 12px;
}

.card-form-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.card-form-grid input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 6px;
  padding: 10px 12px;
  outline: none;
}

.card-form-grid .wide {
  grid-column: 1 / -1;
}

.business-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px;
  border-top: 1px solid var(--line);
}

.business-card-preview {
  padding: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: flex-start;
}

.metamars-card {
  position: relative;
  width: 91mm;
  height: 55mm;
  overflow: hidden;
  border: 1px solid #cfd5de;
  border-radius: 4px;
  background: #fff;
  color: #1f2937;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.1);
  font-family:
    Arial, "Hiragino Kaku Gothic ProN", "Yu Gothic", "Microsoft YaHei", sans-serif;
}

.card-front::before {
  content: "";
  position: absolute;
  left: -16mm;
  bottom: -24mm;
  width: 54mm;
  height: 54mm;
  border-radius: 50%;
  background: #074398;
  box-shadow: 4.4mm -1.7mm 0 #f12891;
  transform: rotate(14deg);
}

.card-front::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.2), rgba(226, 232, 240, 0.74)),
    radial-gradient(circle at 16% 16%, rgba(148, 163, 184, 0.16) 0 2px, transparent 3px),
    repeating-linear-gradient(145deg, transparent 0 25px, rgba(148, 163, 184, 0.06) 26px 28px);
  clip-path: polygon(8% 0, 100% 0, 100% 100%, 42% 100%, 20% 83%, 0 40%, 0 0);
}

.card-watermark {
  position: absolute;
  inset: 0;
  opacity: 0.28;
  background-image: url("./assets/metamars-business-card-template.png");
  background-size: 109mm auto;
  background-position: 0 0;
  mix-blend-mode: multiply;
}

.brand-lockup,
.person-block,
.card-back > * {
  position: relative;
  z-index: 2;
}

.brand-lockup {
  position: absolute;
  left: 11.8mm;
  top: 17.4mm;
  width: 24.5mm;
  display: grid;
  justify-items: center;
  gap: 0.4mm;
}

.metamars-aa-symbol {
  width: 18mm;
  height: 11mm;
  display: block;
  background-image: url("./assets/metamars-logo-sheet.jpg");
  background-repeat: no-repeat;
  background-size: 74mm auto;
  background-position: -7.1mm -8.2mm;
}

.brand-lockup strong,
.brand-lockup b,
.card-back h2 {
  background: linear-gradient(90deg, #0576d9, #2440d7 48%, #ef1684);
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
}

.brand-lockup strong {
  font-size: 3.3mm;
  line-height: 1;
  letter-spacing: 0;
}

.brand-lockup b {
  font-size: 2.8mm;
}

.person-block {
  position: absolute;
  left: 40.5mm;
  top: 8.8mm;
  width: 46.2mm;
}

.person-block span {
  display: block;
  font-size: 2.65mm;
  margin-bottom: 2.6mm;
}

.person-block h3 {
  margin: 0 0 1mm;
  font-size: 6.1mm;
  font-weight: 500;
  letter-spacing: 0.24em;
}

.person-block h4 {
  margin: 0 0 3mm;
  font-size: 4.55mm;
  font-weight: 500;
}

.accent-line {
  height: 0.45mm;
  width: 100%;
  margin-bottom: 2.8mm;
  background: linear-gradient(90deg, #074398, #ec1686);
}

.person-block h2 {
  margin: 0 0 1.4mm;
  font-size: 5mm;
  font-weight: 500;
  color: #173fc2;
}

.person-block p {
  margin: 0 0 1.6mm;
  font-size: 2.3mm;
  line-height: 1.28;
}

.card-back {
  display: grid;
  justify-items: center;
  align-content: start;
  text-align: center;
  gap: 0;
  padding-top: 9.8mm;
}

.aa-watermark {
  position: absolute;
  top: -12mm;
  width: 50mm;
  height: 72mm;
  background-image: url("./assets/metamars-logo-sheet.jpg");
  background-repeat: no-repeat;
  background-size: 104mm auto;
  background-position: -10mm -11mm;
  opacity: 0.08;
  filter: saturate(0.9);
}

.aa-left {
  left: 4mm;
}

.aa-right {
  right: 0;
  transform: scaleX(-1);
}

.back-symbol {
  width: 18mm;
  height: 11mm;
  margin-bottom: 3mm;
}

.card-back h2 {
  margin: 0;
  font-size: 5mm;
  font-weight: 500;
  margin-bottom: 4mm;
}

.business-title {
  display: grid;
  grid-template-columns: 18mm auto 18mm;
  align-items: center;
  gap: 2.2mm;
  color: #4615aa;
  font-size: 2.85mm;
  margin-bottom: 8mm;
}

.business-title span {
  height: 0.45mm;
  background: linear-gradient(90deg, #6b1bb4, #ec1686);
}

.card-back h3 {
  margin: 0;
  font-size: 4.15mm;
  color: #111827;
}

.business-card-list {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.business-card-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
}

.business-card-row.active {
  border-color: var(--accent);
  background: rgba(38, 99, 235, 0.08);
}

.business-card-row strong,
.business-card-row small {
  display: block;
}

.business-card-row small {
  color: var(--muted);
  margin-top: 4px;
}

.template-card {
  width: 95.1mm;
  height: 60.4mm;
  border: 0;
  border-radius: 0;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.1);
}

.template-front {
  background-image: url("./assets/metamars-card-front-base.png");
}

.template-back {
  background-image: url("./assets/metamars-card-back-base.png");
}

.template-mask {
  position: absolute;
  z-index: 1;
  pointer-events: none;
}

.front-person-mask {
  left: 42.8mm;
  top: 8.2mm;
  width: 26mm;
  height: 22mm;
  background: rgba(255, 255, 255, 0.86);
}

.front-company-mask {
  left: 43mm;
  top: 33mm;
  width: 45mm;
  height: 8.2mm;
  background: rgba(255, 255, 255, 0.88);
}

.front-contact-mask {
  left: 43mm;
  top: 40.2mm;
  width: 48mm;
  height: 16.6mm;
  background: rgba(255, 255, 255, 0.9);
}

.template-person-block {
  left: 44.2mm;
  top: 9.8mm;
  width: 26mm;
  z-index: 2;
}

.template-person-block span {
  font-size: 2.7mm;
  margin-bottom: 2.8mm;
}

.template-person-block h3 {
  font-size: 6.2mm;
  margin-bottom: 1mm;
}

.template-person-block h4 {
  font-size: 4.7mm;
  margin-bottom: 0;
}

.template-company-block {
  position: absolute;
  z-index: 2;
  left: 44.4mm;
  top: 30.8mm;
  width: 47mm;
}

.template-company-block .accent-line {
  height: 0.45mm;
  width: 47.5mm;
  margin-bottom: 3.2mm;
}

.template-company-block h2 {
  margin: 0 0 1.4mm;
  font-size: 5.1mm;
  font-weight: 500;
  color: #173fc2;
}

.template-company-block p {
  margin: 0 0 1.7mm;
  color: #222;
  font-size: 2.25mm;
  line-height: 1.25;
}

.back-business-mask {
  left: 11.5mm;
  top: 42.5mm;
  width: 76mm;
  height: 7.5mm;
  background: rgba(255, 255, 255, 0.72);
}

.template-business-text {
  position: absolute;
  z-index: 2;
  left: 9mm;
  top: 43.5mm;
  width: 78mm;
  margin: 0;
  color: #000;
  text-align: center;
  font-size: 4.15mm;
  line-height: 1.2;
}

@media print {
  @page {
    size: A4 landscape;
    margin: 12mm;
  }

  body {
    min-width: 0;
    background: #fff;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .sidebar,
  .topbar,
  .metrics,
  .toolbar,
  .business-card-form,
  .business-card-list,
  .business-card-preview-panel > .panel-header,
  .panel:not(.business-card-preview-panel) {
    display: none !important;
  }

  .shell,
  .workspace,
  .content,
  .business-card-studio,
  .business-card-preview-panel,
  .business-card-preview {
    display: block;
    padding: 0;
    margin: 0;
    border: 0;
    box-shadow: none;
    background: #fff;
  }

  .business-card-preview {
    display: grid;
    grid-template-columns: 95.1mm 95.1mm;
    justify-content: center;
    align-items: start;
    gap: 10mm;
    width: 100%;
  }

  .metamars-card {
    width: 95.1mm;
    height: 60.4mm;
    margin: 0;
    border: 0.25mm solid #444;
    border-radius: 0;
    box-shadow: none;
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

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

.home-hero {
  position: relative;
  overflow: hidden;
  padding: 26px;
  display: flex;
  align-items: center;
  gap: 26px;
  background:
    radial-gradient(circle at 11% 50%, rgba(0, 168, 255, 0.13), transparent 24%),
    radial-gradient(circle at 27% 40%, rgba(255, 0, 128, 0.1), transparent 20%),
    var(--panel);
}

.home-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.55), transparent 36%),
    repeating-linear-gradient(135deg, transparent 0 26px, rgba(38, 99, 235, 0.035) 27px 28px);
}

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

.home-logo-orb {
  width: 176px;
  height: 138px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(244, 247, 252, 0.72)) padding-box,
    linear-gradient(135deg, rgba(0, 197, 255, 0.52), rgba(255, 0, 128, 0.44)) border-box;
  border: 1px solid transparent;
  box-shadow:
    0 24px 55px rgba(30, 41, 59, 0.1),
    0 0 40px rgba(0, 197, 255, 0.12),
    0 0 42px rgba(255, 0, 128, 0.1);
}

.home-logo-orb img {
  width: 146px;
  height: 116px;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.home-hero h2 {
  font-size: 30px;
  margin: 4px 0 8px;
}

.home-hero p:last-child {
  color: var(--muted);
  line-height: 1.6;
  max-width: 720px;
}

.login-page {
  min-width: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 18%, rgba(0, 242, 234, 0.18), transparent 28%),
    radial-gradient(circle at 88% 22%, rgba(255, 0, 80, 0.2), transparent 30%),
    radial-gradient(circle at 50% 100%, rgba(38, 99, 235, 0.16), transparent 34%),
    #090b12;
  color: #f8fafc;
}

.login-shell {
  width: min(560px, calc(100vw - 32px));
  position: relative;
  z-index: 2;
}

.login-card {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
  border: 1px solid rgba(226, 232, 240, 0.88);
  border-radius: 18px;
  padding: 42px;
  box-shadow:
    0 34px 100px rgba(0, 0, 0, 0.34),
    0 0 70px rgba(0, 242, 234, 0.1),
    0 0 68px rgba(255, 0, 80, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 0%, rgba(0, 242, 234, 0.14), transparent 32%),
    radial-gradient(circle at 100% 18%, rgba(255, 0, 80, 0.12), transparent 30%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.02), transparent 42%);
  opacity: 1;
}

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

.login-logo-wrap {
  width: 100%;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  position: relative;
}

.login-logo {
  width: 210px;
  height: 168px;
  object-fit: contain;
  display: block;
  mix-blend-mode: multiply;
  filter:
    drop-shadow(0 14px 24px rgba(15, 23, 42, 0.08))
    drop-shadow(0 0 18px rgba(0, 242, 234, 0.1))
    drop-shadow(0 0 20px rgba(255, 0, 80, 0.08));
  animation: logoFloat 5.2s ease-in-out infinite;
}

.login-logo-shell {
  width: 230px;
  height: 174px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.logo-glow {
  position: absolute;
  width: 260px;
  height: 130px;
  border-radius: 40%;
  background:
    radial-gradient(circle, rgba(0, 242, 234, 0.08), transparent 58%),
    radial-gradient(circle at 70% 45%, rgba(255, 0, 80, 0.08), transparent 60%);
  filter: blur(18px);
  animation: glowShift 4.8s ease-in-out infinite alternate;
}

.login-card .eyebrow {
  text-align: center;
  color: #64748b;
  font-size: 14px;
  letter-spacing: 0;
}

.login-card h1 {
  font-size: 42px;
  line-height: 1.08;
  margin: 8px 0;
  text-align: center;
  color: #111827;
  text-shadow:
    1.5px 0 rgba(0, 242, 234, 0.24),
    -1.5px 0 rgba(255, 0, 80, 0.2);
}

.login-copy,
.login-message {
  color: #64748b;
  text-align: center;
}

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 30px;
}

.login-form label {
  display: grid;
  gap: 8px;
  color: #475569;
  font-size: 14px;
  font-weight: 700;
}

.login-form input {
  width: 100%;
  border: 1px solid #d8dee8;
  background: #f8fafc;
  color: #111827;
  border-radius: 10px;
  padding: 14px 15px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.login-form input:focus {
  border-color: rgba(0, 184, 212, 0.72);
  background: #ffffff;
  box-shadow:
    0 0 0 4px rgba(0, 184, 212, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.login-form .primary {
  min-height: 52px;
  border: 0;
  border-radius: 10px;
  font-weight: 800;
  font-size: 17px;
  background:
    linear-gradient(90deg, #00f2ea, #2663eb 48%, #ff0050);
  box-shadow:
    0 14px 36px rgba(38, 99, 235, 0.32),
    0 0 22px rgba(0, 242, 234, 0.18);
}

.tiktok-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.tiktok-bg::before {
  content: "";
  position: absolute;
  inset: -20%;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 46px 46px;
  transform: perspective(900px) rotateX(64deg) translateY(8%);
  transform-origin: bottom;
  animation: gridDrift 14s linear infinite;
}

.pulse-ring {
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  border: 1px solid rgba(0, 242, 234, 0.28);
  box-shadow:
    0 0 35px rgba(0, 242, 234, 0.16),
    inset 0 0 35px rgba(255, 0, 80, 0.1);
  animation: ringPulse 7s ease-in-out infinite;
}

.ring-a {
  left: -130px;
  top: 12%;
}

.ring-b {
  right: -160px;
  top: 4%;
  animation-delay: -2.2s;
  border-color: rgba(255, 0, 80, 0.3);
}

.ring-c {
  left: 50%;
  bottom: -260px;
  animation-delay: -4s;
}

.neon-note {
  position: absolute;
  color: rgba(248, 250, 252, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  padding: 8px 14px;
  backdrop-filter: blur(10px);
  text-shadow:
    2px 0 rgba(0, 242, 234, 0.8),
    -2px 0 rgba(255, 0, 80, 0.7);
  animation: floatToken 6.4s ease-in-out infinite;
}

.note-a {
  left: 16%;
  top: 20%;
  font-size: 28px;
}

.note-b {
  right: 18%;
  top: 28%;
  animation-delay: -2s;
}

.note-c {
  left: 18%;
  bottom: 20%;
  animation-delay: -3.6s;
}

.scan-line {
  position: absolute;
  width: 180px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #00f2ea, #ff0050, transparent);
  filter: blur(0.2px);
  opacity: 0.65;
  animation: scanMove 5.8s linear infinite;
}

.line-a {
  top: 18%;
  left: -220px;
}

.line-b {
  top: 54%;
  left: -260px;
  animation-delay: -2.1s;
}

.line-c {
  top: 80%;
  left: -200px;
  animation-delay: -4s;
}

@keyframes logoFloat {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-8px) scale(1.025);
  }
}

@keyframes glowShift {
  from {
    transform: translateX(-10px) scale(0.96);
    opacity: 0.75;
  }
  to {
    transform: translateX(10px) scale(1.08);
    opacity: 1;
  }
}

@keyframes gridDrift {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 46px 46px;
  }
}

@keyframes ringPulse {
  0%,
  100% {
    transform: scale(0.82);
    opacity: 0.28;
  }
  50% {
    transform: scale(1.08);
    opacity: 0.58;
  }
}

@keyframes floatToken {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(-2deg);
  }
  50% {
    transform: translate3d(12px, -18px, 0) rotate(3deg);
  }
}

@keyframes scanMove {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(calc(100vw + 420px));
  }
}

.quick-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: var(--panel-soft);
}

.quick-item strong {
  display: block;
  margin-bottom: 6px;
}

.quick-item small {
  color: var(--muted);
  line-height: 1.5;
}

.integration-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(420px, 1.1fr);
  gap: 16px;
  padding: 16px;
}

.integration-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 16px;
  display: grid;
  gap: 13px;
  align-content: start;
}

.integration-card h3 {
  margin: 0;
}

.integration-check,
.connection-meta div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.integration-check strong {
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
}

.integration-check .ok {
  color: var(--accent-2);
  background: rgba(0, 168, 121, 0.14);
}

.integration-check .missing {
  color: var(--warning);
  background: rgba(245, 158, 11, 0.14);
}

.callback-box {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.callback-box code {
  display: block;
  white-space: normal;
  word-break: break-all;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  padding: 10px;
}

.connection-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  padding: 14px;
}

.connection-state.connected {
  border-color: rgba(0, 168, 121, 0.3);
  background: rgba(0, 168, 121, 0.1);
  color: var(--accent-2);
}

.connection-meta {
  display: grid;
  gap: 10px;
  margin: 0;
}

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

.connection-meta dd {
  margin: 0;
  text-align: right;
  word-break: break-all;
}

.integration-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.integration-actions button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.integration-note {
  color: var(--muted);
  line-height: 1.55;
  font-size: 14px;
}

.timeline {
  padding: 16px;
  display: grid;
  gap: 12px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
  color: var(--muted);
}

.timeline-item strong {
  color: var(--text);
}

dialog {
  width: min(760px, calc(100vw - 48px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  padding: 0;
  box-shadow: var(--shadow);
}

.wide-modal {
  width: min(980px, calc(100vw - 48px));
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.52);
}

.modal header,
.modal footer {
  padding: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.modal footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  justify-content: flex-end;
}

.form-grid {
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.form-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.form-grid .wide {
  grid-column: 1 / -1;
}

.live-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 14px;
}

.live-summary-strip article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.live-summary-strip span,
.live-summary-strip small {
  display: block;
  color: var(--muted);
}

.live-summary-strip strong {
  display: block;
  margin: 6px 0 4px;
  font-size: 26px;
}

.live-command-center {
  display: grid;
  grid-template-columns: minmax(250px, 0.72fr) minmax(560px, 1.56fr) minmax(260px, 0.8fr);
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(0, 242, 234, 0.18);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 4%, rgba(255, 0, 80, 0.16), transparent 28%),
    radial-gradient(circle at 75% 42%, rgba(0, 242, 234, 0.14), transparent 26%),
    linear-gradient(180deg, #161a20, #0c0f14);
  color: #eef4ff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.25);
}

.live-side-stack,
.live-main-stage {
  display: grid;
  gap: 14px;
  align-content: start;
}

.live-widget,
.live-products-board,
.live-stage-hero {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.live-widget {
  padding: 14px;
}

.widget-head,
.stage-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.widget-head h3,
.stage-head h2 {
  margin: 0;
}

.widget-head h3 {
  font-size: 16px;
}

.widget-head small,
.stage-head small,
.widget-note,
.review-block p,
.ranking-row small {
  color: rgba(226, 232, 240, 0.68);
}

.widget-head select,
.widget-head input {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #eef4ff;
  padding: 7px 9px;
  outline: 0;
}

.trend-chart {
  display: block;
  width: 100%;
  height: 150px;
  margin: 12px 0 8px;
  overflow: visible;
}

.trend-grid {
  fill: none;
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 0.8;
}

.trend-line {
  fill: none;
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 7px rgba(0, 242, 234, 0.45));
}

.trend-line.gmv {
  stroke: #00f2ea;
}

.trend-line.exposure {
  stroke: #6c7cff;
  opacity: 0.72;
}

.legend-row,
.mini-metrics,
.fan-split {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: rgba(226, 232, 240, 0.78);
  font-size: 12px;
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 999px;
  vertical-align: middle;
}

.dot.cyan {
  background: #00f2ea;
}

.dot.blue {
  background: #6c7cff;
}

.source-table,
.profile-bars,
.ai-review-widget {
  display: grid;
  gap: 11px;
  margin-top: 12px;
}

.source-row {
  position: relative;
  display: grid;
  grid-template-columns: 76px 48px 1fr;
  gap: 8px;
  align-items: center;
  padding-bottom: 9px;
  font-size: 13px;
}

.source-row b,
.stack-bar span,
.stack-bar b,
.profile-bars b {
  display: block;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #00f2ea, #ff0050);
}

.source-row b {
  position: absolute;
  left: 0;
  bottom: 0;
}

.source-row small {
  color: rgba(226, 232, 240, 0.62);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stack-bar {
  display: flex;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  margin: 18px 0 10px;
}

.stack-bar b {
  background: #6c7cff;
}

.widget-note {
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.55;
}

.live-stage-hero {
  position: relative;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(255, 0, 80, 0.72), rgba(45, 74, 255, 0.32) 45%, rgba(0, 242, 234, 0.32)),
    #20242c;
}

.live-stage-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 0 48%, rgba(255, 255, 255, 0.08) 49% 51%, transparent 52%),
    radial-gradient(circle at 70% 30%, rgba(255, 255, 255, 0.15), transparent 24%);
  opacity: 0.65;
}

.live-stage-hero > * {
  position: relative;
  z-index: 1;
}

.stage-actions {
  display: flex;
  gap: 8px;
}

.stage-actions button {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.18);
  color: #fff;
}

.hero-gmv {
  text-align: center;
  padding: 16px 0 18px;
}

.hero-gmv span,
.hero-gmv small {
  display: block;
  color: rgba(255, 255, 255, 0.78);
}

.hero-gmv strong {
  display: block;
  font-size: clamp(54px, 7vw, 92px);
  line-height: 1;
  margin: 8px 0;
  letter-spacing: 0;
  text-shadow:
    3px 0 rgba(0, 242, 234, 0.35),
    -3px 0 rgba(255, 0, 80, 0.32);
}

.official-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 12px;
}

.official-kpi {
  padding: 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.16);
}

.official-kpi span,
.official-kpi small {
  display: block;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

.official-kpi strong {
  display: block;
  margin: 4px 0;
  font-size: 21px;
}

.official-kpi small.up {
  color: #31f3b3;
}

.official-kpi small.down {
  color: #ff8aa8;
}

.live-products-board {
  padding: 14px;
}

.ranking-table {
  display: grid;
  margin-top: 12px;
  min-width: 0;
}

.ranking-head,
.ranking-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.5fr) repeat(5, minmax(78px, 0.7fr));
  gap: 10px;
  align-items: center;
  padding: 10px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ranking-head {
  color: rgba(226, 232, 240, 0.66);
  font-size: 12px;
}

.ranking-row span:first-child {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 8px;
  align-items: center;
}

.ranking-row b {
  grid-row: span 2;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 12px;
}

.ranking-row strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ranking-row small {
  grid-column: 2;
  font-size: 11px;
}

.replay-screen {
  aspect-ratio: 9 / 13;
  margin: 12px 0;
  border-radius: 8px;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 8px;
  background:
    radial-gradient(circle at 18% 18%, rgba(0, 242, 234, 0.2), transparent 30%),
    radial-gradient(circle at 80% 24%, rgba(255, 0, 80, 0.25), transparent 34%),
    linear-gradient(160deg, #262b35, #101319);
}

.replay-screen span {
  justify-self: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: #ff0050;
  font-size: 11px;
}

.replay-screen strong {
  font-size: 24px;
}

.profile-bars div {
  display: grid;
  grid-template-columns: 62px 1fr 42px;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}

.profile-bars b {
  height: 6px;
}

.review-block {
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.review-block strong {
  display: block;
  margin-bottom: 5px;
}

.review-block p {
  font-size: 13px;
  line-height: 1.55;
}

.report-list {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.report-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
  display: grid;
  gap: 14px;
}

.report-card header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.report-card h3 {
  margin: 8px 0 4px;
  font-size: 18px;
}

.report-card small,
.panel-header small {
  color: var(--muted);
}

.report-actions {
  display: flex;
  gap: 8px;
}

.report-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 10px;
}

.report-stats div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel-soft);
}

.report-stats span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}

.report-stats strong {
  font-size: 18px;
}

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

.report-body section {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.report-body h4 {
  margin: 0 0 6px;
  font-size: 14px;
}

.report-body p {
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}

.text-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 900px) {
  body {
    min-width: 0;
  }

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

  .sidebar {
    position: static;
    height: auto;
  }

  .nav-list {
    max-height: 280px;
  }

  .workspace {
    padding: 16px;
  }

  .metrics,
  .cards,
  .board,
  .quick-grid,
  .report-stats,
  .report-body {
    grid-template-columns: 1fr;
  }

  .toolbar,
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

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

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