:root {
  --primary: #533afd;
  --primary-deep: #4434d4;
  --primary-soft: #665efd;
  --navy: #1c1e54;
  --navy-2: #111439;
  --ink: #0d253d;
  --ink-2: #273951;
  --muted: #64748d;
  --muted-2: #8a99aa;
  --canvas: #ffffff;
  --soft: #f6f9fc;
  --line: #e3e8ee;
  --success: #0d9f6e;
  --success-soft: #e9f9f3;
  --warning: #b7791f;
  --warning-soft: #fff7e6;
  --danger: #d83a52;
  --danger-soft: #fff0f3;
  --shadow-sm: 0 1px 3px rgba(0, 55, 112, 0.08);
  --shadow-lg: 0 24px 70px rgba(22, 38, 85, 0.16), 0 5px 18px rgba(0, 55, 112, 0.08);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --sidebar-width: 272px;
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: var(--soft);
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  font-feature-settings: "ss01";
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.5px;
}

.brand-mark {
  position: relative;
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  width: 25px;
  height: 25px;
  padding: 5px;
  border-radius: 8px;
  background: var(--primary);
  box-shadow: 0 7px 18px rgba(83, 58, 253, 0.3);
}

.brand-mark span { display: block; width: 3px; border-radius: 3px; background: #fff; transform: rotate(28deg); }
.brand-mark span:nth-child(1) { height: 6px; opacity: .72; }
.brand-mark span:nth-child(2) { height: 11px; opacity: .88; }
.brand-mark span:nth-child(3) { height: 16px; }
.brand-on-dark { color: #fff; }
.brand-on-light { color: var(--ink); }

.eyebrow {
  display: block;
  color: var(--primary);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  transition: background .18s ease, transform .18s ease, color .18s ease;
}

.icon-button:hover { background: rgba(100, 116, 139, .12); }
.icon-button:active { transform: scale(.96); }
.icon-button svg, [data-icon] svg { width: 18px; height: 18px; stroke-width: 1.9; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 42px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
}

.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button:disabled { opacity: .55; cursor: wait; transform: none; }
.button-primary { color: #fff; background: var(--primary); box-shadow: 0 10px 22px rgba(83, 58, 253, .25); }
.button-primary:hover { background: var(--primary-deep); box-shadow: 0 13px 28px rgba(83, 58, 253, .3); }
.button-secondary { color: var(--ink-2); background: #fff; border-color: var(--line); box-shadow: var(--shadow-sm); }
.button-secondary:hover { border-color: #c8d1dc; }
.button-danger { color: var(--danger); background: var(--danger-soft); }
.button-small { min-height: 34px; padding: 7px 13px; font-size: 12px; }
.button-wide { width: 100%; min-height: 48px; }

.login-view {
  position: relative;
  display: grid;
  grid-template-columns: minmax(430px, 1.1fr) minmax(420px, .9fr);
  min-height: 100vh;
  overflow: hidden;
  background: #fff;
}

.mesh { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.mesh::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(13, 37, 61, .1) .5px, transparent .5px);
  background-size: 11px 11px;
  mask-image: linear-gradient(to bottom, #000, transparent 85%);
  opacity: .28;
}

.mesh-blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .72; }
.mesh-blob-one { width: 58%; height: 50%; left: -12%; top: -14%; background: #ffd0a5; }
.mesh-blob-two { width: 54%; height: 62%; left: 19%; top: -13%; background: #8a72ff; }
.mesh-blob-three { width: 52%; height: 50%; right: -15%; top: 12%; background: #f989c6; }

.login-story {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 48px clamp(40px, 6vw, 96px);
  background: linear-gradient(150deg, rgba(255,255,255,.4), rgba(246,249,252,.72));
}

.story-copy { max-width: 680px; margin: auto 0; padding: 80px 0 48px; }
.story-copy h1 {
  margin: 18px 0 24px;
  color: var(--ink);
  font-size: clamp(43px, 4.8vw, 72px);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -2.4px;
}
.story-copy p { max-width: 580px; margin: 0; color: var(--ink-2); font-size: 17px; font-weight: 400; line-height: 1.75; }

.story-proof {
  display: flex;
  align-items: center;
  gap: 18px;
  width: fit-content;
  max-width: 100%;
  padding: 15px 18px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 16px;
  background: rgba(255,255,255,.56);
  box-shadow: 0 12px 36px rgba(54, 57, 111, .09);
  backdrop-filter: blur(18px);
}
.story-proof strong { display: block; margin-bottom: 4px; font-size: 14px; }
.story-proof p { margin: 0; color: var(--muted); font-size: 12px; }
.proof-stack { display: flex; padding-left: 8px; }
.proof-stack span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-left: -8px;
  border: 2px solid rgba(255,255,255,.95);
  border-radius: 50%;
  color: #fff;
  background: var(--navy);
  font-size: 11px;
  font-weight: 700;
}
.proof-stack span:nth-child(2) { background: var(--primary); }
.proof-stack span:nth-child(3) { background: #e15d93; }
.proof-stack span:nth-child(4) { color: var(--ink); background: #fff; }

.login-panel-wrap {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 40px clamp(32px, 6vw, 92px);
  background: rgba(255,255,255,.92);
  box-shadow: -22px 0 60px rgba(28, 30, 84, .08);
}

.login-panel { width: min(100%, 430px); }
.mobile-brand { display: none; margin-bottom: 54px; }
.login-heading { margin-bottom: 34px; }
.login-heading h2 { margin: 22px 0 8px; font-size: 38px; font-weight: 350; letter-spacing: -1px; }
.login-heading > p { margin: 0; color: var(--muted); font-size: 15px; }
.status-dot { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: .25px; }
.status-dot i { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(13,159,110,.1); }

.login-form { display: grid; gap: 20px; }
.field { display: grid; gap: 8px; }
.field > span:first-child { color: var(--ink-2); font-size: 12px; font-weight: 650; }
.field input, .field textarea, .field select {
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid #cbd6e2;
  border-radius: var(--radius-sm);
  outline: none;
  color: var(--ink);
  background: #fff;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.field textarea { resize: vertical; min-height: 92px; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(83,58,253,.12); }
.field input::placeholder, .field textarea::placeholder { color: #a4b0bd; }
.input-shell { position: relative; display: block; }
.input-shell input { padding-left: 43px; padding-right: 44px; }
.input-icon { position: absolute; z-index: 1; left: 14px; top: 50%; display: grid; place-items: center; color: var(--muted); transform: translateY(-50%); }
.input-action { position: absolute; z-index: 1; right: 4px; top: 50%; width: 36px; height: 36px; color: var(--muted); transform: translateY(-50%); }
.input-action:active { transform: translateY(-50%) scale(.96); }
.suffix-input { position: relative; display: block; }
.suffix-input input { padding-right: 42px; }
.suffix-input i { position: absolute; right: 14px; top: 50%; color: var(--muted); font-style: normal; transform: translateY(-50%); }

.form-message { padding: 10px 12px; border-radius: 9px; color: var(--danger); background: var(--danger-soft); font-size: 12px; line-height: 1.5; }
.form-message.success { color: var(--success); background: var(--success-soft); }
.login-footer { display: flex; gap: 9px; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.55; }
.login-footer svg { flex: 0 0 auto; width: 16px; height: 16px; color: var(--success); }

.app-view { min-height: 100vh; }
.sidebar {
  position: fixed;
  z-index: 40;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  padding: 26px 18px 18px;
  color: rgba(255,255,255,.72);
  background:
    radial-gradient(circle at 20% -5%, rgba(102,94,253,.5), transparent 34%),
    linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
  box-shadow: 14px 0 40px rgba(20,24,65,.12);
}
.sidebar::after { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: radial-gradient(rgba(255,255,255,.12) .45px, transparent .45px); background-size: 10px 10px; opacity: .15; }
.sidebar > * { position: relative; z-index: 1; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 0 9px; }
.sidebar-close { display: none; color: #fff; }
.workspace-badge { display: flex; align-items: center; gap: 11px; margin: 34px 4px 24px; padding: 13px; border: 1px solid rgba(255,255,255,.1); border-radius: 13px; background: rgba(255,255,255,.055); }
.workspace-icon { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 10px; color: #fff; background: linear-gradient(135deg, var(--primary-soft), #e15d93); }
.workspace-badge small { display: block; margin-bottom: 3px; color: rgba(255,255,255,.42); font-size: 8px; font-weight: 700; letter-spacing: 1.4px; }
.workspace-badge strong { color: #fff; font-size: 12px; font-weight: 600; }

.sidebar-nav { display: grid; gap: 7px; }
.nav-label { margin: 13px 12px 6px; color: rgba(255,255,255,.35); font-size: 9px; font-weight: 700; letter-spacing: 1.25px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  border: 0;
  border-radius: 11px;
  color: rgba(255,255,255,.64);
  background: transparent;
  font-size: 13px;
  font-weight: 550;
  text-align: left;
  cursor: pointer;
  transition: color .16s ease, background .16s ease, transform .16s ease;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,.07); transform: translateX(2px); }
.nav-item.active { color: #fff; background: linear-gradient(90deg, rgba(102,94,253,.38), rgba(102,94,253,.13)); box-shadow: inset 3px 0 0 #8d84ff; }
.nav-item svg { width: 18px; height: 18px; }
.nav-item .nav-badge { margin-left: auto; padding: 3px 7px; border-radius: 999px; color: #dcd9ff; background: rgba(102,94,253,.22); font-size: 9px; font-variant-numeric: tabular-nums; }

.sidebar-foot { margin-top: auto; }
.connection-mini { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; padding: 10px 12px; border-radius: 10px; color: rgba(255,255,255,.55); background: rgba(255,255,255,.045); font-size: 10px; }
.connection-mini i { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(13,159,110,.12); }
.connection-mini.warning i { background: #f6ad55; box-shadow: 0 0 0 4px rgba(246,173,85,.12); }
.sidebar-user { display: grid; grid-template-columns: 38px 1fr 38px; align-items: center; gap: 10px; padding: 14px 8px 2px; border-top: 1px solid rgba(255,255,255,.09); }
.sidebar-user strong { display: block; overflow: hidden; color: #fff; font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user small { display: block; margin-top: 3px; color: rgba(255,255,255,.4); font-size: 9px; }
.sidebar-user .icon-button { color: rgba(255,255,255,.55); }

.avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: #fff; background: linear-gradient(135deg, var(--primary-soft), #d94b95); font-size: 13px; font-weight: 750; box-shadow: 0 8px 16px rgba(83,58,253,.18); }
.avatar-button { border: 3px solid #fff; cursor: default; }

.app-main { min-height: 100vh; margin-left: var(--sidebar-width); }
.topbar {
  position: sticky;
  z-index: 25;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 82px;
  padding: 14px clamp(22px, 3vw, 42px);
  border-bottom: 1px solid rgba(227,232,238,.82);
  background: rgba(246,249,252,.86);
  backdrop-filter: blur(18px);
}
.topbar-title > span { color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: 1.4px; }
.topbar-title h1 { margin: 5px 0 0; font-size: 23px; font-weight: 430; letter-spacing: -.45px; }
.topbar-actions { display: flex; align-items: center; gap: 13px; }
.mobile-menu { display: none; }
.sync-badge { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: rgba(255,255,255,.8); font-size: 10px; }
.sync-badge i { width: 6px; height: 6px; border-radius: 50%; background: var(--success); }
.sync-badge.warning i { background: #f6ad55; }

.page-content { width: min(100%, 1500px); margin: 0 auto; padding: 31px clamp(22px, 3vw, 42px) 54px; }
.page-hero { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; overflow: hidden; }
.page-hero h2 { margin: 7px 0 8px; font-size: clamp(28px, 3vw, 39px); font-weight: 330; letter-spacing: -1.2px; }
.page-hero p { margin: 0; color: var(--muted); line-height: 1.6; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.metric-card {
  position: relative;
  min-height: 154px;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.metric-card::after { content: ""; position: absolute; width: 105px; height: 105px; right: -52px; bottom: -58px; border-radius: 50%; background: rgba(83,58,253,.07); }
.metric-card.highlight { color: #fff; border-color: transparent; background: linear-gradient(145deg, var(--navy), #313582); box-shadow: 0 16px 35px rgba(28,30,84,.18); }
.metric-card.highlight::before { content: ""; position: absolute; width: 180px; height: 180px; right: -64px; top: -88px; border-radius: 50%; background: radial-gradient(circle, rgba(246,107,238,.32), transparent 67%); }
.metric-card.highlight::after { background: rgba(255,255,255,.07); }
.metric-top { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; }
.metric-label { color: var(--muted); font-size: 11px; font-weight: 650; }
.highlight .metric-label { color: rgba(255,255,255,.62); }
.metric-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; color: var(--primary); background: #f1efff; }
.highlight .metric-icon { color: #fff; background: rgba(255,255,255,.11); }
.metric-value { position: relative; z-index: 1; margin: 20px 0 7px; font-size: clamp(25px, 2.4vw, 34px); font-weight: 430; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.metric-note { position: relative; z-index: 1; display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; }
.highlight .metric-note { color: rgba(255,255,255,.58); }
.metric-note.positive { color: var(--success); }

.content-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(290px, .75fr); gap: 20px; }
.content-grid.equal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 22px 16px; }
.card-head h3 { margin: 0; font-size: 16px; font-weight: 580; letter-spacing: -.2px; }
.card-head p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.card-body { padding: 0 22px 22px; }
.card-divider { height: 1px; margin: 0 22px 18px; background: var(--line); }

.invite-card { position: relative; overflow: hidden; color: #fff; border-color: transparent; background: linear-gradient(150deg, #24275f, #1c1e54); }
.invite-card::before { content: ""; position: absolute; inset: -60% -40% auto 10%; height: 250px; background: radial-gradient(circle, rgba(139,121,255,.46), transparent 62%); }
.invite-card > * { position: relative; z-index: 1; }
.invite-card .card-head p { color: rgba(255,255,255,.55); }
.invite-card .card-head h3 { color: #fff; }
.invite-code { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; padding: 12px 14px; border: 1px solid rgba(255,255,255,.12); border-radius: 11px; background: rgba(255,255,255,.075); }
.invite-code code { overflow: hidden; color: #fff; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.invite-code button { flex: 0 0 auto; color: #fff; background: rgba(255,255,255,.12); }
.rate-display { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-top: 22px; }
.rate-display strong { font-size: 36px; font-weight: 360; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.rate-display span { color: rgba(255,255,255,.48); font-size: 10px; }

.redemption-card { overflow: hidden; }
.redemption-card.standalone { margin-top: 0 !important; }
.redemption-head-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.redemption-code-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.redemption-code-item { display: grid; grid-template-columns: 30px minmax(0, 1fr) 34px; align-items: center; gap: 10px; min-width: 0; padding: 12px; border: 1px solid #e2e7ee; border-radius: 12px; background: linear-gradient(145deg, #fbfcff, #f7f5ff); }
.redemption-code-number { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: var(--primary-deep); background: #eae6ff; font-size: 9px; font-weight: 750; }
.redemption-code-item code { overflow: hidden; color: var(--ink); font-size: 11px; font-weight: 620; letter-spacing: .35px; text-overflow: ellipsis; white-space: nowrap; }
.redemption-code-item .icon-button { width: 32px; height: 32px; color: var(--primary); background: #fff; border: 1px solid #ddd8ff; }
.redemption-footnote { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 14px; color: var(--muted); font-size: 10px; }
.redemption-footnote span { display: inline-flex; align-items: center; gap: 6px; }

.bar-chart { display: grid; gap: 14px; padding-top: 5px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 150px) 1fr auto; align-items: center; gap: 12px; }
.bar-person { min-width: 0; }
.bar-person strong { display: block; overflow: hidden; font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.bar-person small { color: var(--muted); font-size: 9px; }
.bar-track { height: 8px; overflow: hidden; border-radius: 999px; background: #edf1f6; }
.bar-fill { height: 100%; min-width: 4px; border-radius: inherit; background: linear-gradient(90deg, var(--primary), #9b8cff); transform-origin: left; animation: grow .55s ease both; }
.bar-value { min-width: 70px; text-align: right; font-size: 10px; font-weight: 650; font-variant-numeric: tabular-nums; }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 11px; font-variant-numeric: tabular-nums; }
.data-table th { padding: 11px 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); background: #fbfcfe; font-size: 9px; font-weight: 750; letter-spacing: .65px; text-align: left; white-space: nowrap; }
.data-table td { padding: 14px; border-bottom: 1px solid #edf1f5; color: var(--ink-2); white-space: nowrap; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background .14s ease; }
.data-table tbody tr:hover { background: #fbfcff; }
.data-table .numeric { text-align: right; }
.person-cell { display: flex; align-items: center; gap: 10px; min-width: 170px; }
.person-avatar { display: grid; flex: 0 0 auto; place-items: center; width: 31px; height: 31px; border-radius: 9px; color: var(--primary-deep); background: #eeeaff; font-size: 10px; font-weight: 750; }
.person-cell strong { display: block; color: var(--ink); font-size: 11px; }
.person-cell small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 999px; color: var(--success); background: var(--success-soft); font-size: 9px; font-weight: 650; }
.status-pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-pill.disabled { color: var(--muted); background: #eef1f5; }
.status-pill.pending { color: var(--warning); background: var(--warning-soft); }
.commission-text { color: var(--primary-deep); font-weight: 750; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.search-box { position: relative; width: min(100%, 360px); }
.search-box input { width: 100%; height: 41px; padding: 9px 12px 9px 39px; border: 1px solid var(--line); border-radius: 999px; outline: none; background: #fff; }
.search-box input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(83,58,253,.1); }
.search-box span { position: absolute; left: 13px; top: 50%; display: grid; color: var(--muted); transform: translateY(-50%); }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 16px 20px; }
.pagination span { color: var(--muted); font-size: 10px; }

.empty-state { display: grid; place-items: center; min-height: 240px; padding: 35px; text-align: center; }
.empty-icon { display: grid; place-items: center; width: 58px; height: 58px; margin-bottom: 16px; border-radius: 18px; color: var(--primary); background: #efedff; }
.empty-state h3 { margin: 0 0 8px; font-size: 16px; }
.empty-state p { max-width: 370px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }

.connection-card { display: grid; grid-template-columns: 1fr auto; gap: 18px; padding: 22px; }
.connection-card h3 { margin: 0 0 7px; font-size: 17px; }
.connection-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.connection-status { display: flex; align-items: center; gap: 9px; height: fit-content; padding: 8px 11px; border-radius: 999px; color: var(--success); background: var(--success-soft); font-size: 10px; font-weight: 650; }
.connection-status i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.connection-status.warning { color: var(--warning); background: var(--warning-soft); }
.detail-list { display: grid; margin: 0; }
.detail-row { display: grid; grid-template-columns: 170px 1fr; gap: 14px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.detail-row:last-child { border-bottom: 0; }
.detail-row dt { color: var(--muted); font-size: 11px; }
.detail-row dd { margin: 0; color: var(--ink-2); font-size: 11px; font-weight: 600; word-break: break-all; }
.code-block { display: block; padding: 14px 16px; overflow-x: auto; border-radius: 11px; color: #d9ddff; background: var(--navy-2); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; line-height: 1.7; white-space: pre-wrap; }

.modal { width: min(92vw, 640px); padding: 0; border: 0; border-radius: 20px; background: transparent; box-shadow: var(--shadow-lg); }
.modal::backdrop { background: rgba(17,20,57,.48); backdrop-filter: blur(5px); }
.modal-card { overflow: hidden; border-radius: 20px; background: #fff; }
.modal-card-compact { max-width: 520px; margin: auto; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 25px 26px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 7px 0 0; font-size: 23px; font-weight: 400; letter-spacing: -.5px; }
.modal-body { padding: 23px 26px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 18px 26px 23px; border-top: 1px solid var(--line); background: #fbfcfe; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field-span-2 { grid-column: span 2; }
.check-card { position: relative; display: grid; grid-template-columns: 22px 1fr; align-items: start; gap: 11px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; cursor: pointer; }
.check-card input { position: absolute; opacity: 0; }
.check-mark { display: grid; place-items: center; width: 21px; height: 21px; border: 1px solid #b8c4d1; border-radius: 6px; color: transparent; background: #fff; }
.check-card input:checked + .check-mark { color: #fff; border-color: var(--primary); background: var(--primary); }
.check-card strong { display: block; font-size: 12px; }
.check-card small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.assignment-hint { padding: 12px 14px; border: 1px solid #dcd7ff; border-radius: 11px; color: var(--primary-deep); background: #f5f3ff; font-size: 11px; line-height: 1.6; }
.table-actions { display: flex; align-items: center; gap: 7px; }
.settle-summary { margin-bottom: 20px; padding: 18px; border-radius: 14px; background: linear-gradient(145deg, #f1efff, #faf9ff); }
.settle-summary small { color: var(--muted); font-size: 10px; }
.settle-summary strong { display: block; margin: 8px 0 4px; color: var(--primary-deep); font-size: 31px; font-weight: 450; font-variant-numeric: tabular-nums; }
.settle-summary p { margin: 0; color: var(--muted); font-size: 10px; }

.toast-root { position: fixed; z-index: 100; top: 20px; right: 20px; display: grid; gap: 10px; width: min(370px, calc(100vw - 32px)); }
.toast { display: grid; grid-template-columns: 31px 1fr auto; align-items: center; gap: 10px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.96); box-shadow: var(--shadow-lg); animation: toast-in .24s ease both; backdrop-filter: blur(14px); }
.toast-icon { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 9px; color: var(--success); background: var(--success-soft); }
.toast.error .toast-icon { color: var(--danger); background: var(--danger-soft); }
.toast strong { display: block; font-size: 11px; }
.toast p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.toast button { width: 28px; height: 28px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }

.skeleton { position: relative; overflow: hidden; color: transparent !important; background: #edf1f6 !important; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent); animation: shimmer 1.25s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }

.sidebar-backdrop { display: none; }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-grid { grid-template-columns: 1fr; }
  .content-grid.equal { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .login-view { grid-template-columns: 1fr; background: #fff; }
  .login-story { display: none; }
  .login-panel-wrap { min-height: 100vh; box-shadow: none; }
  .mobile-brand { display: inline-flex; }
  .sidebar { transform: translateX(-105%); transition: transform .24s ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: grid; }
  .sidebar-backdrop { position: fixed; z-index: 35; inset: 0; border: 0; background: rgba(17,20,57,.4); backdrop-filter: blur(3px); }
  .sidebar-backdrop.show { display: block; }
  .app-main { margin-left: 0; }
  .mobile-menu { display: grid; }
  .topbar { justify-content: flex-start; gap: 12px; }
  .topbar-actions { margin-left: auto; }
}

@media (max-width: 640px) {
  .login-panel-wrap { padding: 30px 22px; }
  .mobile-brand { margin-bottom: 38px; }
  .login-heading h2 { font-size: 32px; }
  .topbar { min-height: 72px; padding: 11px 16px; }
  .topbar-title > span { display: none; }
  .topbar-title h1 { margin: 0; font-size: 18px; }
  .sync-badge { display: none; }
  .page-content { padding: 23px 15px 42px; }
  .page-hero { align-items: flex-start; flex-direction: column; }
  .page-hero h2 { font-size: 29px; }
  .hero-actions { width: 100%; }
  .hero-actions .button { flex: 1; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 135px; }
  .metric-value { font-size: 30px; }
  .card-head { padding: 18px 17px 14px; }
  .card-body { padding: 0 17px 18px; }
  .card-divider { margin-inline: 17px; }
  .redemption-head-actions { align-items: stretch; width: 100%; }
  .redemption-head-actions .button { flex: 1; }
  .redemption-code-grid { grid-template-columns: 1fr; }
  .redemption-code-item code { font-size: 10px; }
  .bar-row { grid-template-columns: 90px 1fr; }
  .bar-value { display: none; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search-box { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .field-span-2 { grid-column: auto; }
  .modal-head, .modal-body, .modal-foot { padding-left: 18px; padding-right: 18px; }
  .modal-foot .button { flex: 1; }
  .detail-row { grid-template-columns: 1fr; gap: 5px; }
  .connection-card { grid-template-columns: 1fr; }
  .toast-root { top: 12px; right: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
