:root {
  --ink: #090a0c;
  --muted: #686d75;
  --paper: #f7f8fa;
  --panel: #ffffff;
  --line: #e7e9ed;
  --blue: #725cff;
  --blue-dark: #5543d7;
  --orange: #ff2d6d;
  --mint: #d7faf5;
  --yellow: #fff0f5;
  --violet: #eeeaff;
  --cyan: #35d9d2;
  --shadow: 0 20px 60px rgba(20, 24, 30, .08);
  --display: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  --body: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "IBM Plex Mono", "Cascadia Mono", monospace;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--body); font-size: 14px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(11, 101, 255, .25); outline-offset: 3px; }
.hidden { display: none !important; }

.login-screen {
  min-height: 100vh;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #fff;
}
.login-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 78% 14%, rgba(53, 217, 210, .18), transparent 24%),
    radial-gradient(circle at 8% 82%, rgba(255, 45, 109, .11), transparent 22%),
    repeating-linear-gradient(90deg, rgba(20, 24, 30, .025) 0 1px, transparent 1px 72px);
}
.login-orbit { position: absolute; border: 2px solid rgba(53, 217, 210, .22); border-radius: 50%; transform: rotate(-22deg); }
.orbit-one { width: 80vw; height: 30vw; right: -18vw; top: 13vh; }
.orbit-two { width: 62vw; height: 24vw; left: -13vw; bottom: 8vh; border-color: rgba(255, 45, 109, .2); transform: rotate(24deg); }
.login-panel {
  width: min(530px, calc(100% - 44px));
  padding: clamp(34px, 6vw, 68px);
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, .9);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: 0 30px 80px rgba(20, 24, 30, .12);
  backdrop-filter: blur(18px);
}
.brand-lockup { display: flex; align-items: flex-start; gap: 16px; }
.brand-lockup.compact { gap: 11px; align-items: center; }
.brand-mark { width: 42px; height: 34px; position: relative; display: block; flex: none; }
.brand-mark span { position: absolute; display: block; width: 13px; height: 29px; border-radius: 12px 3px 12px 3px; transform: skewX(-27deg) rotate(20deg); }
.brand-mark span:nth-child(1) { left: 1px; top: 3px; background: var(--cyan); }
.brand-mark span:nth-child(2) { left: 13px; top: 0; background: var(--ink); }
.brand-mark span:nth-child(3) { left: 25px; top: 3px; background: var(--orange); }
.brand-wordmark { display: block; margin-bottom: 8px; font: 800 20px/1 var(--display); letter-spacing: -.06em; }
.brand-wordmark small { display: block; margin-top: 5px; font-size: 9px; letter-spacing: .08em; }
.eyebrow, .section-kicker { margin: 0; color: var(--muted); font: 500 10px/1.3 var(--mono); letter-spacing: .13em; text-transform: uppercase; }
.login-panel h1 { margin: 20px 0 0; font: 900 clamp(34px, 5vw, 52px)/1.02 var(--display); letter-spacing: -.08em; }
.login-panel h1 em, .hero-strip h3 em { color: var(--orange); font-style: normal; }
.login-copy { max-width: 340px; margin: 28px 0 32px; color: #5f6772; font-size: 15px; line-height: 1.65; }
.form-stack, .modal-card { display: grid; gap: 16px; }
label { display: grid; gap: 8px; color: var(--muted); font-size: 12px; }
label > span { display: flex; justify-content: space-between; }
label small { color: #a0a7b1; font: 11px var(--mono); }
input, select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, .8);
}
select { appearance: auto; }
input::placeholder { color: #b0b6be; }
.primary-button, .outline-button, .text-button, .logout-button, .icon-button { border: 0; background: transparent; }
.primary-button {
  min-height: 48px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: #fff;
  background: var(--ink);
  border-radius: 999px;
  font-weight: 600;
  transition: transform .2s ease, background .2s ease;
}
.primary-button:hover { background: var(--blue); transform: translateY(-2px); }
.primary-button.small { min-height: 38px; padding: 0 13px; font-size: 12px; }
.outline-button {
  min-height: 38px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
  border-radius: 999px;
  font-size: 12px;
  transition: border-color .2s ease, color .2s ease, transform .2s ease;
}
.outline-button:hover { color: var(--blue); border-color: var(--blue); transform: translateY(-1px); }
.outline-button.small { min-height: 36px; }
.text-button { color: var(--blue); font-size: 12px; }
.text-button:hover { text-decoration: underline; }
.form-error { min-height: 18px; margin: 0; color: #d43b2a; font-size: 12px; }
.login-foot { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 30px; color: #8a919a; font: 10px var(--mono); text-transform: uppercase; }
.login-side-note { position: absolute; right: 6vw; bottom: 8vh; width: 170px; color: #6e789a; z-index: 1; }
.login-side-note span { font: 10px var(--mono); letter-spacing: .14em; }
.login-side-note strong { display: block; margin: 10px 0 6px; color: var(--ink); font: 600 64px/.8 var(--display); letter-spacing: -.08em; }
.login-side-note p { margin: 0; line-height: 1.55; }

.workspace { min-height: 100vh; display: grid; grid-template-columns: 238px minmax(0, 1fr); }
.sidebar { min-height: 100vh; display: flex; flex-direction: column; padding: 28px 22px 22px; color: var(--ink); background: rgba(255, 255, 255, .92); border-right: 1px solid var(--line); }
.sidebar .eyebrow { color: var(--muted); }
.sidebar .brand-lockup strong { display: block; margin-top: 3px; font: 600 14px var(--display); }
.sidebar .brand-mark span:nth-child(3) { background: var(--orange); }
.sidebar-top { display: flex; justify-content: space-between; align-items: center; }
.icon-button { display: none; color: var(--ink); }
.main-nav { display: grid; gap: 6px; margin-top: 68px; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 13px; padding: 13px 12px; border: 0; color: var(--muted); background: transparent; text-align: left; border-radius: 13px; transition: background .2s ease, color .2s ease; }
.nav-item:hover, .nav-item.active { color: var(--blue); background: rgba(114, 92, 255, .1); }
.nav-item.active { box-shadow: inset 3px 0 0 var(--orange); }
.nav-symbol { width: 18px; color: var(--orange); font-size: 18px; text-align: center; }
.sidebar-bottom { margin-top: auto; display: grid; gap: 22px; }
.data-badge { display: flex; gap: 9px; align-items: center; color: #e8eaec; }
.data-badge strong, .data-badge small { display: block; }
.data-badge strong { font-size: 11px; font-weight: 500; }
.data-badge small { margin-top: 3px; color: #727a86; font-size: 10px; }
.status-dot { width: 7px; height: 7px; background: var(--mint); border-radius: 50%; box-shadow: 0 0 0 4px rgba(197, 242, 223, .09); }
.logout-button { display: flex; justify-content: space-between; padding: 12px 0 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; text-align: left; }
.logout-button:hover { color: var(--ink); }
.main-content { min-width: 0; padding: 34px clamp(24px, 4vw, 68px) 70px; }
.topbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; padding-bottom: 33px; border-bottom: 1px solid var(--line); }
.topbar h2 { margin: 9px 0 0; font: 600 34px/1 var(--display); letter-spacing: -.055em; }
.topbar-actions { display: flex; align-items: center; gap: 15px; }
.sync-time { color: var(--muted); font: 10px var(--mono); }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; color: #fff; background: var(--blue); border-radius: 50%; font: 500 12px var(--mono); }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 10; max-width: 320px; padding: 13px 16px; color: #fff; background: var(--ink); box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.hero-strip { display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; padding: 40px; border-radius: 24px; background: linear-gradient(120deg, rgba(53, 217, 210, .14), rgba(255, 255, 255, .9) 48%, rgba(255, 45, 109, .1)); }
.hero-strip h3 { margin: 12px 0 0; font: 600 clamp(34px, 5vw, 58px)/.98 var(--display); letter-spacing: -.07em; }
.hero-aside { width: min(260px, 30%); display: flex; align-items: flex-start; gap: 14px; color: var(--muted); line-height: 1.55; }
.hero-aside p { margin: 0; }
.hero-line { width: 34px; height: 1px; flex: none; margin-top: 9px; background: var(--orange); }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric-card { min-height: 160px; display: flex; flex-direction: column; justify-content: space-between; padding: 20px; position: relative; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 18px; }
.metric-card::after { content: ""; position: absolute; width: 90px; height: 90px; right: -34px; top: -34px; border: 1px solid rgba(19, 22, 27, .08); border-radius: 50%; }
.metric-card:nth-child(2) { background: var(--yellow); }
.metric-card:nth-child(3) { background: var(--mint); }
.metric-card:nth-child(4) { background: var(--violet); }
.metric-label { color: #5f6772; font: 500 10px var(--mono); letter-spacing: .09em; text-transform: uppercase; }
.metric-value { margin-top: 13px; font: 600 clamp(29px, 3vw, 43px)/1 var(--display); letter-spacing: -.07em; }
.metric-meta { color: #66707c; font-size: 11px; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .75fr); gap: 12px; margin-top: 12px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; }
.chart-panel, .status-panel, .channel-overview, .table-panel { padding: 23px; }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.panel-heading h3 { margin: 8px 0 0; font: 600 20px/1 var(--display); letter-spacing: -.04em; }
.panel-note { color: var(--muted); font-size: 11px; }
.activity-chart { min-height: 192px; display: grid; grid-template-columns: repeat(14, 1fr); gap: 9px; align-items: end; padding-top: 33px; }
.chart-column { min-width: 0; display: grid; grid-template-rows: 1fr auto; gap: 10px; height: 154px; }
.chart-bar-track { display: flex; align-items: flex-end; height: 100%; background: #f1f3f5; }
.chart-bar { width: 100%; min-height: 4px; background: linear-gradient(180deg, var(--blue), #7ba8ff); transition: height .35s ease; }
.chart-column:nth-child(4n) .chart-bar { background: linear-gradient(180deg, var(--orange), #ffb191); }
.chart-label { overflow: hidden; color: var(--muted); font: 9px var(--mono); text-align: center; white-space: nowrap; }
.status-list { display: grid; gap: 15px; margin-top: 28px; }
.status-row { display: grid; grid-template-columns: 75px 1fr auto; gap: 10px; align-items: center; }
.status-name { color: #5c6570; font: 11px var(--mono); text-transform: uppercase; }
.status-track { height: 8px; background: #f0f2f4; }
.status-fill { height: 100%; background: var(--blue); }
.status-row:nth-child(2) .status-fill { background: var(--orange); }
.status-row:nth-child(3) .status-fill { background: #a48fff; }
.status-row:nth-child(4) .status-fill { background: #aeb7c2; }
.status-amount { font: 11px var(--mono); }
.channel-overview { margin-top: 12px; }
.channel-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 23px; }
.channel-card { padding: 20px; border: 1px solid var(--line); background: #fcfcfb; }
.channel-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.channel-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.channel-glyph { width: 30px; height: 30px; display: grid; place-items: center; color: #fff; border-radius: 50%; font: 600 12px var(--display); }
.channel-glyph.channel-tiktok_affiliate { background: var(--orange); }
.channel-glyph.channel-partnerstack { background: var(--blue); }
.channel-state { color: #4e826a; font: 10px var(--mono); text-transform: uppercase; }
.channel-state.warning { color: #b46d21; }
.channel-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 25px; }
.channel-stats strong, .channel-stats small { display: block; }
.channel-stats strong { font: 600 20px var(--display); letter-spacing: -.06em; }
.channel-stats small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.section-intro { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; padding: 48px 0 26px; }
.section-intro h3 { margin: 9px 0 0; font: 600 37px/1 var(--display); letter-spacing: -.06em; }
.button-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.channel-connection-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.connection-card { padding: 22px; border-radius: 18px; background: linear-gradient(135deg, var(--ink), #252a31); color: #fff; }
.connection-card.partnerstack { background: linear-gradient(135deg, var(--blue), #8d7dff); }
.connection-head { display: flex; justify-content: space-between; align-items: flex-start; }
.connection-head h4 { margin: 0; font: 600 21px var(--display); letter-spacing: -.04em; }
.connection-card p { max-width: 310px; margin: 25px 0; color: rgba(255,255,255,.68); line-height: 1.55; }
.connection-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.connection-actions .outline-button { color: #fff; border-color: rgba(255,255,255,.3); background: transparent; }
.connection-actions .outline-button:hover { border-color: #fff; }
.connection-network { color: rgba(255,255,255,.58); }
.credential-state { color: #bdeed7; font: 10px var(--mono); text-transform: uppercase; }
.credential-state.warning { color: #ffe7a9; }
.table-panel { overflow: hidden; }
.table-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 20px; }
.filter-tabs { display: flex; gap: 6px; }
.filter-tab { padding: 8px 10px; border: 0; border-bottom: 1px solid transparent; color: var(--muted); background: transparent; font-size: 12px; }
.filter-tab.active { color: var(--ink); border-color: var(--blue); }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 680px; }
th { padding: 12px 12px 13px; color: var(--muted); font: 10px var(--mono); font-weight: 500; letter-spacing: .06em; text-align: left; text-transform: uppercase; border-bottom: 1px solid var(--line); }
td { padding: 17px 12px; border-bottom: 1px solid #eff1f3; color: #4d5661; font-size: 12px; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td strong { display: block; color: var(--ink); font-weight: 600; }
td small { display: block; margin-top: 4px; color: var(--muted); font: 10px var(--mono); }
.channel-pill, .state-pill, .attribution-pill { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 999px; color: #4d5661; background: #eef1f4; font: 10px var(--mono); }
.state-pill.approved, .state-pill.paid { color: #347055; background: #def4e9; }
.state-pill.pending { color: #99701d; background: #fff1c8; }
.state-pill.declined { color: #a5483e; background: #ffe2dc; }
.attribution-pill.attributed { color: #235aa7; background: #dfebff; }
.attribution-pill.unattributed { color: #986a1b; background: #fff1c8; }
.payout-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.payout-summary .metric-card { min-height: 120px; }
.modal { width: min(500px, calc(100% - 30px)); padding: 0; border: 0; background: transparent; }
.modal::backdrop { background: rgba(19, 22, 27, .45); backdrop-filter: blur(5px); }
.modal-card { position: relative; padding: 30px; border-radius: 20px; background: #fff; box-shadow: var(--shadow); }
.modal-card h3 { margin: 7px 0 0; font: 600 28px var(--display); letter-spacing: -.055em; }
.modal-card > p { margin: 0 0 10px; color: var(--muted); line-height: 1.5; }
.modal-close { position: absolute; top: 14px; right: 16px; border: 0; color: var(--muted); background: transparent; font-size: 25px; }
.two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

@media (max-width: 1000px) {
  .workspace { grid-template-columns: 204px minmax(0, 1fr); }
  .main-content { padding-right: 28px; padding-left: 28px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-aside { width: 34%; }
}
@media (max-width: 760px) {
  .login-side-note { display: none; }
  .workspace { display: block; }
  .sidebar { min-height: auto; padding: 17px 18px; }
  .sidebar-top { min-height: 34px; }
  .icon-button { display: block; font-size: 20px; }
  .main-nav { display: none; margin-top: 18px; }
  .main-nav.open { display: grid; }
  .sidebar-bottom { display: none; }
  .main-content { padding: 22px 17px 48px; }
  .topbar { align-items: flex-start; padding-bottom: 22px; }
  .topbar h2 { font-size: 27px; }
  .topbar-actions { gap: 8px; }
  .sync-time { display: none; }
  .hero-strip { display: block; padding: 33px 0 25px; }
  .hero-strip h3 { font-size: 42px; }
  .hero-aside { width: auto; max-width: 330px; margin-top: 25px; }
  .overview-grid, .channel-connection-grid { grid-template-columns: 1fr; }
  .channel-cards { grid-template-columns: 1fr; }
  .section-intro { align-items: flex-start; padding-top: 32px; }
  .section-intro h3 { font-size: 30px; }
  .section-intro .primary-button { margin-top: 8px; }
  .table-panel, .chart-panel, .status-panel, .channel-overview { padding: 17px; }
  .payout-summary { grid-template-columns: 1fr; }
  .payout-summary .metric-card { min-height: 100px; }
  .channel-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

.chart-bar.size-1 { height: 10%; }
.chart-bar.size-2 { height: 20%; }
.chart-bar.size-3 { height: 30%; }
.chart-bar.size-4 { height: 40%; }
.chart-bar.size-5 { height: 50%; }
.chart-bar.size-6 { height: 60%; }
.chart-bar.size-7 { height: 70%; }
.chart-bar.size-8 { height: 80%; }
.chart-bar.size-9 { height: 90%; }
.chart-bar.size-10 { height: 100%; }
.status-fill.size-1 { width: 10%; }
.status-fill.size-2 { width: 20%; }
.status-fill.size-3 { width: 30%; }
.status-fill.size-4 { width: 40%; }
.status-fill.size-5 { width: 50%; }
.status-fill.size-6 { width: 60%; }
.status-fill.size-7 { width: 70%; }
.status-fill.size-8 { width: 80%; }
.status-fill.size-9 { width: 90%; }
.status-fill.size-10 { width: 100%; }
