:root {
  --ink: #17231f;
  --ink-soft: #58645f;
  --ink-faint: #88918d;
  --paper: #f4f4ef;
  --surface: #fffefb;
  --surface-strong: #ffffff;
  --line: #e3e4dc;
  --line-strong: #d5d8ce;
  --forest: #10261f;
  --forest-2: #18372d;
  --emerald: #13795f;
  --emerald-bright: #1c9876;
  --mint: #e8f4ef;
  --gold: #c9a56b;
  --gold-soft: #f6eddc;
  --danger: #bd4b42;
  --danger-soft: #fbebe8;
  --warning: #9c6d21;
  --shadow-sm: 0 1px 2px rgba(16, 38, 31, 0.05), 0 4px 16px rgba(16, 38, 31, 0.04);
  --shadow-md: 0 18px 50px rgba(16, 38, 31, 0.11), 0 4px 14px rgba(16, 38, 31, 0.05);
  --shadow-lg: 0 30px 90px rgba(9, 28, 21, 0.18);
  --radius-sm: 10px;
  --radius-md: 15px;
  --radius-lg: 22px;
  --font-ui: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "Segoe UI", sans-serif;
  --font-num: "SFMono-Regular", "Cascadia Code", "Roboto Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    linear-gradient(rgba(16, 38, 31, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 38, 31, 0.025) 1px, transparent 1px),
    var(--paper);
  background-size: 48px 48px;
  font-family: var(--font-ui);
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

[hidden] {
  display: none !important;
}

::selection {
  color: var(--forest);
  background: #d9e9e1;
}

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(2px);
}

.ambient-a {
  top: -22vw;
  right: -13vw;
  width: 54vw;
  height: 54vw;
  background: radial-gradient(circle, rgba(201, 165, 107, 0.16), transparent 68%);
}

.ambient-b {
  bottom: -22vw;
  left: -18vw;
  width: 58vw;
  height: 58vw;
  background: radial-gradient(circle, rgba(19, 121, 95, 0.12), transparent 68%);
}

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

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  color: var(--gold);
  border: 1px solid rgba(201, 165, 107, 0.42);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.07);
  place-items: center;
}

.brand-mark svg {
  width: 29px;
  height: 29px;
  stroke-width: 1.55;
}

.brand strong {
  display: block;
  color: #f7f3e8;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.brand small {
  display: block;
  margin-top: 3px;
  color: rgba(247, 243, 232, 0.5);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.eyebrow {
  margin: 0;
  color: var(--emerald);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.19em;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(470px, 1.08fr) minmax(440px, 0.92fr);
}

.login-story {
  position: relative;
  display: flex;
  min-height: 100vh;
  overflow: hidden;
  padding: 46px clamp(42px, 6vw, 96px);
  color: #f7f3e8;
  background:
    radial-gradient(circle at 85% 18%, rgba(201, 165, 107, 0.19), transparent 33%),
    radial-gradient(circle at 12% 78%, rgba(28, 152, 118, 0.16), transparent 35%),
    var(--forest);
  flex-direction: column;
  justify-content: space-between;
}

.login-story::before {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  content: "";
  mask-image: linear-gradient(to bottom right, black, transparent 76%);
  pointer-events: none;
}

.login-story::after {
  position: absolute;
  right: -180px;
  bottom: -255px;
  width: 560px;
  height: 560px;
  border: 1px solid rgba(201, 165, 107, 0.14);
  border-radius: 50%;
  box-shadow:
    0 0 0 52px rgba(201, 165, 107, 0.035),
    0 0 0 112px rgba(201, 165, 107, 0.02);
  content: "";
  pointer-events: none;
}

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

.story-copy {
  max-width: 610px;
  padding: 11vh 0 7vh;
}

.story-copy .eyebrow {
  color: var(--gold);
}

.story-copy h1 {
  margin: 20px 0 24px;
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  font-size: clamp(48px, 5.6vw, 83px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.055em;
}

.story-description {
  max-width: 520px;
  margin: 0;
  color: rgba(247, 243, 232, 0.62);
  font-size: 15px;
  line-height: 1.9;
}

.story-metrics {
  display: flex;
  width: min(100%, 490px);
  margin-top: auto;
  padding: 24px 0 30px;
  border-top: 1px solid rgba(247, 243, 232, 0.11);
  gap: 0;
}

.story-metrics > div {
  display: flex;
  min-width: 0;
  padding-right: 34px;
  flex: 1;
  flex-direction: column;
}

.story-metrics > div + div {
  padding-left: 34px;
  border-left: 1px solid rgba(247, 243, 232, 0.1);
}

.metric-number {
  color: #fffdf7;
  font-family: var(--font-num);
  font-size: 27px;
  line-height: 1;
}

.metric-label {
  margin-top: 8px;
  color: rgba(247, 243, 232, 0.48);
  font-size: 11px;
  letter-spacing: 0.07em;
}

.story-footnote {
  margin: 0;
  color: rgba(247, 243, 232, 0.32);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.login-panel {
  display: grid;
  min-height: 100vh;
  min-width: 0;
  overflow: hidden;
  padding: 42px clamp(36px, 6vw, 92px);
  background: rgba(249, 248, 243, 0.82);
  place-items: center;
  backdrop-filter: blur(12px);
}

.login-card {
  width: 100%;
  min-width: 0;
  max-width: 410px;
}

.mobile-brand {
  display: none;
  align-items: center;
  gap: 11px;
  margin-bottom: 40px;
}

.mobile-brand .brand-mark {
  width: 39px;
  height: 39px;
  color: var(--gold);
  border-color: rgba(16, 38, 31, 0.08);
  background: var(--forest);
}

.mobile-brand .brand-mark svg {
  width: 26px;
}

.login-card h2 {
  margin: 11px 0 10px;
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.035em;
}

.login-intro {
  margin: 0 0 34px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.7;
}

.field {
  display: block;
  margin-bottom: 20px;
}

.field > span:first-child {
  display: block;
  margin-bottom: 9px;
  color: #35423d;
  font-size: 12px;
  font-weight: 650;
}

.input-shell {
  position: relative;
  display: flex;
  height: 50px;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.82);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.input-shell:focus-within {
  border-color: rgba(19, 121, 95, 0.65);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(19, 121, 95, 0.09);
}

.input-shell > svg {
  width: 18px;
  height: 18px;
  margin-left: 16px;
  color: #8a948f;
  flex: 0 0 auto;
}

.input-shell input {
  width: 100%;
  height: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 0 15px;
  color: var(--ink);
  background: transparent;
  font-size: 13px;
}

.input-shell input::placeholder {
  color: #a5ada9;
}

.icon-button {
  display: grid;
  border: 0;
  outline: 0;
  padding: 0;
  color: var(--ink-soft);
  background: transparent;
  cursor: pointer;
  place-items: center;
}

.icon-button svg {
  width: 19px;
  height: 19px;
}

.password-toggle {
  width: 45px;
  height: 100%;
  flex: 0 0 auto;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  padding: 0 17px;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease, border-color 140ms ease;
  gap: 8px;
}

.primary-button {
  border: 1px solid var(--forest);
  color: #fff;
  background: var(--forest);
  box-shadow: 0 6px 18px rgba(16, 38, 31, 0.16);
}

.primary-button:hover {
  background: var(--forest-2);
  box-shadow: 0 9px 24px rgba(16, 38, 31, 0.21);
  transform: translateY(-1px);
}

.primary-button:active,
.secondary-button:active {
  transform: translateY(0);
}

.primary-button:disabled,
.secondary-button:disabled {
  opacity: 0.52;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.primary-button svg,
.secondary-button svg {
  width: 16px;
  height: 16px;
}

.secondary-button {
  border: 1px solid var(--line-strong);
  color: #3e4b46;
  background: var(--surface);
}

.secondary-button:hover {
  border-color: #bfc7c2;
  background: #fff;
}

.login-button {
  width: 100%;
  height: 51px;
  margin-top: 4px;
  justify-content: space-between;
  padding: 0 19px;
}

.login-button.loading span::after {
  display: inline-block;
  width: 5px;
  content: "…";
}

.form-error {
  margin: -6px 0 15px;
  padding: 10px 12px;
  border: 1px solid #f0cec9;
  border-radius: 9px;
  color: #9b3c34;
  background: var(--danger-soft);
  font-size: 11px;
  line-height: 1.55;
}

.login-sites {
  display: flex;
  min-height: 43px;
  align-items: center;
  margin-top: 23px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 10px;
  gap: 8px;
}

.site-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a9b2ad;
  box-shadow: 0 0 0 3px rgba(169, 178, 173, 0.12);
}

.login-sites.ready .site-dot {
  background: var(--emerald-bright);
  box-shadow: 0 0 0 3px rgba(28, 152, 118, 0.13);
}

.login-sites.error .site-dot {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(189, 75, 66, 0.12);
}

.security-note {
  display: flex;
  margin-top: 24px;
  color: #7c8782;
  gap: 10px;
}

.security-note svg {
  width: 17px;
  height: 17px;
  margin-top: 1px;
  color: var(--emerald);
  flex: 0 0 auto;
}

.security-note p {
  margin: 0;
  font-size: 10px;
  line-height: 1.7;
}

.dashboard {
  display: flex;
  min-height: 100vh;
  background: #f2f3ee;
}

.sidebar {
  position: fixed;
  z-index: 20;
  inset: 0 auto 0 0;
  display: flex;
  width: 232px;
  padding: 30px 20px 24px;
  color: rgba(247, 243, 232, 0.78);
  background:
    radial-gradient(circle at 50% 100%, rgba(19, 121, 95, 0.22), transparent 34%),
    var(--forest);
  flex-direction: column;
}

.sidebar-brand {
  padding: 0 8px;
}

.sidebar-brand .brand-mark {
  width: 39px;
  height: 39px;
}

.sidebar-brand .brand-mark svg {
  width: 26px;
}

.side-nav {
  margin-top: 48px;
}

.nav-item {
  display: flex;
  width: 100%;
  height: 44px;
  align-items: center;
  border: 0;
  border-radius: 10px;
  padding: 0 12px;
  color: rgba(247, 243, 232, 0.58);
  background: transparent;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  gap: 11px;
}

.nav-item svg {
  width: 18px;
  height: 18px;
}

.nav-item.active {
  color: #fffdf8;
  background: rgba(255, 255, 255, 0.085);
  box-shadow: inset 2px 0 var(--gold);
}

.sidebar-status {
  display: flex;
  align-items: center;
  margin-top: auto;
  padding: 16px 12px;
  border: 1px solid rgba(247, 243, 232, 0.09);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  gap: 10px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5fd4ad;
  box-shadow: 0 0 0 4px rgba(95, 212, 173, 0.1);
  animation: pulse 2.2s infinite;
  flex: 0 0 auto;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(95, 212, 173, 0.08); }
  50% { box-shadow: 0 0 0 6px rgba(95, 212, 173, 0.02); }
}

.sidebar-status strong,
.sidebar-status small {
  display: block;
}

.sidebar-status strong {
  color: rgba(247, 243, 232, 0.82);
  font-size: 10px;
  font-weight: 600;
}

.sidebar-status small {
  margin-top: 4px;
  color: rgba(247, 243, 232, 0.36);
  font-family: var(--font-num);
  font-size: 9px;
}

.logout-button {
  display: flex;
  height: 42px;
  align-items: center;
  margin-top: 10px;
  border: 0;
  border-radius: 10px;
  padding: 0 12px;
  color: rgba(247, 243, 232, 0.38);
  background: transparent;
  font-size: 11px;
  cursor: pointer;
  gap: 11px;
  transition: color 150ms ease, background 150ms ease;
}

.logout-button:hover {
  color: rgba(247, 243, 232, 0.8);
  background: rgba(255, 255, 255, 0.05);
}

.logout-button svg {
  width: 18px;
  height: 18px;
}

.workspace {
  width: calc(100% - 232px);
  min-width: 0;
  margin-left: 232px;
}

.topbar {
  display: flex;
  min-height: 103px;
  align-items: center;
  justify-content: space-between;
  padding: 21px clamp(28px, 4.2vw, 64px);
  border-bottom: 1px solid var(--line);
  background: rgba(249, 249, 245, 0.86);
  backdrop-filter: blur(14px);
}

.breadcrumb {
  margin: 0 0 7px;
  color: var(--ink-faint);
  font-size: 9px;
  letter-spacing: 0.07em;
}

.topbar h1 {
  margin: 0;
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.025em;
}

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

.operator-avatar {
  display: grid;
  width: 37px;
  height: 37px;
  border: 1px solid #d8ded7;
  border-radius: 11px;
  color: #486259;
  background: linear-gradient(145deg, #edf3ee, #fff);
  font-size: 12px;
  font-weight: 700;
  place-items: center;
}

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

.operator small {
  margin-bottom: 3px;
  color: var(--ink-faint);
  font-size: 9px;
}

.operator strong {
  font-size: 11px;
  font-weight: 650;
}

.content {
  width: min(100%, 1440px);
  margin: 0 auto;
  padding: 35px clamp(24px, 4.2vw, 64px) 44px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 17px;
}

.section-heading h2 {
  margin: 7px 0 0;
  font-size: 15px;
  font-weight: 650;
}

.connection-summary {
  margin: 0;
  color: var(--ink-faint);
  font-size: 10px;
}

.site-tabs {
  display: grid;
  max-width: 800px;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
}

.site-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 86px;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 17px 18px;
  color: var(--ink);
  background: rgba(255, 254, 251, 0.76);
  text-align: left;
  cursor: pointer;
  gap: 13px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease, transform 160ms ease;
}

.site-card::after {
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  background: transparent;
  content: "";
}

.site-card:hover:not(:disabled) {
  border-color: #c7cec7;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.site-card.active {
  border-color: rgba(19, 121, 95, 0.45);
  background: #fff;
  box-shadow: 0 10px 30px rgba(16, 38, 31, 0.07);
}

.site-card.active::after {
  background: var(--emerald);
}

.site-card:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.site-emblem {
  display: grid;
  width: 43px;
  height: 43px;
  border-radius: 12px;
  color: #f8f4ea;
  background: var(--forest);
  font-family: "Songti SC", "STSong", serif;
  font-size: 16px;
  flex: 0 0 auto;
  place-items: center;
}

.site-card:nth-child(2) .site-emblem {
  color: #4f3f27;
  background: var(--gold-soft);
}

.site-card-copy {
  min-width: 0;
  flex: 1;
}

.site-card-copy strong,
.site-card-copy small {
  display: block;
}

.site-card-copy strong {
  font-size: 13px;
  font-weight: 650;
}

.site-card-copy small {
  overflow: hidden;
  margin-top: 5px;
  color: var(--ink-faint);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-health {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border-radius: 20px;
  color: var(--emerald);
  background: var(--mint);
  font-size: 8px;
  font-weight: 700;
  gap: 5px;
}

.site-health::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.site-health.offline {
  color: var(--danger);
  background: var(--danger-soft);
}

.ledger-card {
  margin-top: 27px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.ledger-head {
  display: flex;
  min-height: 100px;
  align-items: center;
  justify-content: space-between;
  padding: 22px 26px;
  border-bottom: 1px solid #ecece5;
  gap: 28px;
}

.ledger-site {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 14px;
}

.ledger-site .site-emblem {
  width: 47px;
  height: 47px;
  font-size: 17px;
}

.ledger-title-line {
  display: flex;
  align-items: center;
  gap: 9px;
}

.ledger-title-line h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
}

.currency-chip {
  padding: 4px 7px;
  border: 1px solid #e2e4dc;
  border-radius: 5px;
  color: #727c78;
  background: #f7f7f3;
  font-family: var(--font-num);
  font-size: 8px;
  font-weight: 650;
  letter-spacing: 0.05em;
}

.site-link {
  display: inline-flex;
  align-items: center;
  margin-top: 6px;
  color: #8a938f;
  font-family: var(--font-num);
  font-size: 9px;
  gap: 5px;
}

.site-link:hover {
  color: var(--emerald);
}

.site-link svg {
  width: 11px;
  height: 11px;
}

.ledger-summary {
  display: flex;
  align-items: center;
  gap: 24px;
}

.ledger-summary > div {
  min-width: 82px;
}

.ledger-summary small,
.ledger-summary strong {
  display: block;
}

.ledger-summary small {
  margin-bottom: 6px;
  color: var(--ink-faint);
  font-size: 9px;
}

.ledger-summary strong {
  font-family: var(--font-num);
  font-size: 14px;
  font-weight: 600;
}

.summary-divider {
  width: 1px;
  height: 31px;
  background: var(--line);
}

.live-label {
  display: flex !important;
  align-items: center;
  color: var(--emerald);
  font-family: var(--font-ui) !important;
  font-size: 10px !important;
  gap: 6px;
}

.live-label span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2aaf85;
}

.toolbar {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 26px;
  border-bottom: 1px solid #ecece5;
  gap: 18px;
}

.search-box {
  position: relative;
  display: flex;
  width: min(100%, 390px);
  height: 39px;
  align-items: center;
  border: 1px solid #e0e2db;
  border-radius: 9px;
  background: #f8f8f4;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.search-box:focus-within {
  border-color: rgba(19, 121, 95, 0.45);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(19, 121, 95, 0.07);
}

.search-box svg {
  width: 16px;
  height: 16px;
  margin-left: 12px;
  color: #8e9793;
  flex: 0 0 auto;
}

.search-box input {
  width: 100%;
  height: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 0 10px;
  color: var(--ink);
  background: transparent;
  font-size: 11px;
}

.search-box input::placeholder {
  color: #9fa7a3;
}

.search-box kbd {
  margin-right: 9px;
  border: 1px solid #dfe1db;
  border-radius: 5px;
  padding: 3px 5px;
  color: #939b97;
  background: #fff;
  font-family: var(--font-ui);
  font-size: 8px;
  white-space: nowrap;
}

.toolbar-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.toolbar .secondary-button {
  height: 37px;
  padding: 0 12px;
  font-size: 10px;
}

.table-wrap {
  position: relative;
  min-height: 360px;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

th {
  height: 42px;
  padding: 0 18px;
  border-bottom: 1px solid #ecece5;
  color: #909995;
  background: #fafaf7;
  font-size: 9px;
  font-weight: 650;
  text-align: left;
  letter-spacing: 0.04em;
}

th:first-child,
td:first-child {
  padding-left: 26px;
}

th:last-child,
td:last-child {
  padding-right: 26px;
}

td {
  height: 67px;
  padding: 10px 18px;
  border-bottom: 1px solid #eeeeea;
  font-size: 11px;
  vertical-align: middle;
}

tbody tr {
  transition: background 130ms ease;
}

tbody tr:hover {
  background: #fbfbf7;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.align-right {
  text-align: right;
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  border: 1px solid #e1e3dd;
  border-radius: 9px;
  color: #547065;
  background: #f3f6f3;
  font-size: 11px;
  font-weight: 700;
  flex: 0 0 auto;
  place-items: center;
}

.user-copy {
  min-width: 130px;
}

.user-copy strong,
.user-copy span {
  display: block;
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-copy strong {
  color: #28352f;
  font-size: 11px;
  font-weight: 650;
}

.user-copy span {
  margin-top: 4px;
  color: #9aa19e;
  font-size: 8px;
}

.user-id {
  color: #a0a7a4;
  font-family: var(--font-num);
  font-size: 8px;
}

.group-chip {
  display: inline-flex;
  padding: 5px 8px;
  border: 1px solid #e4e6df;
  border-radius: 6px;
  color: #65706b;
  background: #fafaf7;
  font-size: 8px;
}

.balance-value,
.used-value {
  font-family: var(--font-num);
  font-size: 11px;
}

.balance-value {
  color: #1f4d3e;
  font-weight: 650;
}

.used-value {
  color: #747e79;
}

.balance-zero {
  color: #9ca39f;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  font-size: 9px;
  gap: 6px;
}

.status-chip::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #36a981;
  box-shadow: 0 0 0 3px rgba(54, 169, 129, 0.1);
  content: "";
}

.status-chip.disabled {
  color: #9f6b65;
}

.status-chip.disabled::before {
  background: #c4776e;
  box-shadow: none;
}

.adjust-button {
  display: inline-flex;
  height: 31px;
  align-items: center;
  border: 1px solid #dce1da;
  border-radius: 8px;
  padding: 0 11px;
  color: #38554b;
  background: #fff;
  font-size: 9px;
  font-weight: 600;
  cursor: pointer;
  gap: 5px;
  transition: border-color 130ms ease, background 130ms ease, color 130ms ease;
}

.adjust-button:hover {
  border-color: rgba(19, 121, 95, 0.42);
  color: var(--emerald);
  background: var(--mint);
}

.adjust-button svg {
  width: 13px;
  height: 13px;
}

.table-state {
  display: flex;
  min-height: 320px;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--ink-faint);
  flex-direction: column;
  text-align: center;
}

.table-state p {
  margin: 10px 0 0;
  font-size: 10px;
}

.table-state h3 {
  margin: 13px 0 0;
  color: #53605a;
  font-size: 13px;
  font-weight: 600;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid #dfe4df;
  border-top-color: var(--emerald);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-icon {
  display: grid;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  color: #8c9791;
  background: #f2f4f0;
  place-items: center;
}

.empty-icon svg {
  width: 20px;
  height: 20px;
}

.error-state .empty-icon {
  color: var(--danger);
  background: var(--danger-soft);
}

.error-state .secondary-button {
  margin-top: 18px;
}

.ledger-foot {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 26px;
  border-top: 1px solid #e9eae3;
  background: #fcfcf9;
}

.ledger-foot p {
  margin: 0;
  color: #969e9a;
  font-size: 9px;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 9px;
}

.pagination span {
  min-width: 46px;
  color: #737d78;
  font-size: 9px;
  text-align: center;
}

.page-button {
  display: grid;
  width: 29px;
  height: 29px;
  border: 1px solid #dde0d9;
  border-radius: 7px;
  color: #63706a;
  background: #fff;
  cursor: pointer;
  place-items: center;
}

.page-button:hover:not(:disabled) {
  border-color: #bfc8c2;
  color: var(--emerald);
}

.page-button:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.page-button svg {
  width: 14px;
  height: 14px;
}

.page-note {
  display: flex;
  align-items: center;
  margin: 17px 0 0;
  color: #8d9692;
  font-size: 9px;
  gap: 7px;
}

.page-note svg {
  width: 14px;
  height: 14px;
  color: var(--emerald);
}

.modal-layer {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  padding: 22px;
  place-items: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(8, 24, 18, 0.5);
  cursor: pointer;
  backdrop-filter: blur(5px);
}

.modal {
  position: relative;
  z-index: 1;
  width: min(100%, 490px);
  max-height: min(92vh, 760px);
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 22px;
  padding: 25px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: modal-in 180ms ease-out;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.modal-head h2 {
  margin: 7px 0 0;
  font-family: "Songti SC", "STSong", serif;
  font-size: 23px;
  font-weight: 600;
}

.modal-close {
  width: 33px;
  height: 33px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fafaf7;
}

.target-user {
  display: flex;
  align-items: center;
  margin-top: 23px;
  border: 1px solid #e7e8e1;
  border-radius: 13px;
  padding: 14px;
  background: #f9f9f5;
  gap: 11px;
}

.target-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  color: #fff;
  background: var(--forest);
  font-size: 12px;
  font-weight: 700;
  flex: 0 0 auto;
  place-items: center;
}

.target-user > div:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.target-user strong,
.target-user p {
  display: block;
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.target-user strong {
  font-size: 11px;
}

.target-user p {
  margin-top: 4px;
  color: var(--ink-faint);
  font-size: 8px;
}

.target-balance {
  text-align: right;
}

.target-balance small {
  display: block;
  margin-bottom: 4px;
  color: var(--ink-faint);
  font-size: 8px;
}

.target-balance strong {
  color: #245443;
  font-family: var(--font-num);
  font-size: 11px;
}

.mode-fieldset {
  margin: 21px 0 17px;
  border: 0;
  padding: 0;
}

.mode-fieldset legend {
  margin-bottom: 8px;
  color: #35423d;
  font-size: 11px;
  font-weight: 650;
}

.mode-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mode-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mode-option span {
  display: flex;
  height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid #e1e3dc;
  border-radius: 9px;
  color: #67716d;
  background: #fbfbf8;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  gap: 6px;
  transition: all 140ms ease;
}

.mode-option span svg {
  width: 14px;
  height: 14px;
}

.mode-option input:checked + span {
  border-color: rgba(19, 121, 95, 0.5);
  color: var(--emerald);
  background: var(--mint);
}

.subtract-option input:checked + span {
  border-color: rgba(189, 75, 66, 0.4);
  color: var(--danger);
  background: var(--danger-soft);
}

.amount-field {
  margin-bottom: 10px;
}

.amount-field > span:first-child {
  display: flex;
  justify-content: space-between;
}

.amount-field small {
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 500;
}

.amount-input-shell {
  display: flex;
  height: 55px;
  align-items: center;
  border: 1px solid #d8dcd5;
  border-radius: 11px;
  padding: 0 15px;
  background: #fff;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.amount-input-shell:focus-within {
  border-color: rgba(19, 121, 95, 0.55);
  box-shadow: 0 0 0 3px rgba(19, 121, 95, 0.08);
}

.amount-input-shell > span {
  color: #77837e;
  font-family: var(--font-num);
  font-size: 16px;
}

.amount-input-shell input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 0 10px;
  color: var(--ink);
  background: transparent;
  font-family: var(--font-num);
  font-size: 21px;
}

.quick-amounts {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 17px;
  gap: 7px;
}

.quick-amount {
  height: 28px;
  border: 1px solid #e2e4dd;
  border-radius: 7px;
  padding: 0 10px;
  color: #737d78;
  background: #fbfbf8;
  font-family: var(--font-num);
  font-size: 8px;
  cursor: pointer;
}

.quick-amount:hover {
  border-color: #c9d0cb;
  color: var(--emerald);
  background: #fff;
}

.adjust-preview {
  display: grid;
  align-items: center;
  margin: 4px 0 18px;
  border: 1px dashed #dfe2db;
  border-radius: 11px;
  padding: 13px 15px;
  background: #fafaf7;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
}

.adjust-preview div:last-child {
  text-align: right;
}

.adjust-preview span,
.adjust-preview strong {
  display: block;
}

.adjust-preview span {
  margin-bottom: 5px;
  color: var(--ink-faint);
  font-size: 8px;
}

.adjust-preview strong {
  font-family: var(--font-num);
  font-size: 11px;
}

.adjust-preview div:last-child strong {
  color: var(--emerald);
}

.adjust-preview > svg {
  width: 17px;
  height: 17px;
  color: #a3aba7;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
  gap: 8px;
}

.modal-actions .primary-button,
.modal-actions .secondary-button {
  min-width: 104px;
}

.toast-region {
  position: fixed;
  z-index: 200;
  top: 24px;
  right: 24px;
  display: flex;
  width: min(360px, calc(100vw - 32px));
  flex-direction: column;
  gap: 9px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 11px;
  padding: 12px 14px;
  color: #fff;
  background: rgba(16, 38, 31, 0.96);
  box-shadow: var(--shadow-md);
  font-size: 10px;
  line-height: 1.55;
  animation: toast-in 180ms ease-out;
  gap: 9px;
  pointer-events: auto;
  backdrop-filter: blur(10px);
}

.toast svg {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  color: #7bd8b6;
  flex: 0 0 auto;
}

.toast.error {
  background: rgba(100, 35, 31, 0.96);
}

.toast.error svg {
  color: #f2b4ac;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-7px); }
  to { opacity: 1; transform: translateY(0); }
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 1120px) {
  .login-shell {
    grid-template-columns: minmax(420px, 0.95fr) minmax(420px, 1.05fr);
  }

  .story-copy h1 {
    font-size: 57px;
  }

  .sidebar {
    width: 204px;
  }

  .workspace {
    width: calc(100% - 204px);
    margin-left: 204px;
  }

  .ledger-summary > div {
    min-width: 70px;
  }
}

@media (max-width: 900px) {
  .login-shell {
    display: block;
  }

  .login-story {
    display: none;
  }

  .login-panel {
    padding: 34px 24px;
  }

  .mobile-brand {
    display: flex;
  }

  .sidebar {
    position: static;
    width: 100%;
    height: 72px;
    padding: 13px 20px;
    flex-direction: row;
    align-items: center;
  }

  .sidebar-brand .brand-mark {
    width: 36px;
    height: 36px;
  }

  .side-nav,
  .sidebar-status {
    display: none;
  }

  .logout-button {
    margin: 0 0 0 auto;
  }

  .logout-button span {
    display: none;
  }

  .dashboard {
    display: block;
  }

  .workspace {
    width: 100%;
    margin-left: 0;
  }

  .topbar {
    min-height: 88px;
  }

  .content {
    padding-top: 26px;
  }
}

@media (max-width: 680px) {
  .login-panel {
    padding: 25px 19px;
    align-items: start;
  }

  .login-card {
    margin-top: 4vh;
  }

  .mobile-brand {
    margin-bottom: 34px;
  }

  .login-card h2 {
    font-size: 31px;
  }

  .topbar {
    padding: 17px 19px;
  }

  .topbar h1 {
    font-size: 22px;
  }

  .breadcrumb {
    display: none;
  }

  .operator small {
    display: none;
  }

  .operator-avatar {
    width: 34px;
    height: 34px;
  }

  .content {
    padding: 22px 13px 34px;
  }

  .section-heading {
    align-items: flex-start;
    margin: 0 5px 14px;
    flex-direction: column;
    gap: 8px;
  }

  .site-tabs {
    display: flex;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .site-tabs::-webkit-scrollbar {
    display: none;
  }

  .site-card {
    min-width: 240px;
  }

  .ledger-card {
    margin-top: 18px;
    border-radius: 17px;
  }

  .ledger-head {
    min-height: auto;
    align-items: flex-start;
    padding: 18px;
    flex-direction: column;
    gap: 15px;
  }

  .ledger-summary {
    width: 100%;
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px solid #ecece5;
  }

  .ledger-summary > div {
    min-width: 0;
  }

  .toolbar {
    align-items: stretch;
    padding: 12px 15px;
    flex-direction: column;
    gap: 10px;
  }

  .search-box {
    width: 100%;
  }

  .toolbar-actions {
    justify-content: flex-end;
  }

  .toolbar .secondary-button {
    height: 33px;
  }

  .table-wrap {
    min-height: 330px;
    overflow-x: hidden;
  }

  table {
    table-layout: fixed;
    white-space: normal;
  }

  th:nth-child(2),
  td:nth-child(2),
  th:nth-child(4),
  td:nth-child(4),
  th:nth-child(5),
  td:nth-child(5) {
    display: none;
  }

  th:nth-child(1) {
    width: 57%;
  }

  th:nth-child(3) {
    width: 25%;
  }

  th:nth-child(6) {
    width: 18%;
  }

  .user-cell {
    gap: 8px;
  }

  .user-avatar {
    width: 31px;
    height: 31px;
    border-radius: 8px;
  }

  .user-copy {
    min-width: 0;
  }

  .user-copy strong,
  .user-copy span {
    max-width: 145px;
  }

  .user-id {
    display: none;
  }

  .adjust-button {
    width: 32px;
    height: 31px;
    justify-content: center;
    padding: 0;
    font-size: 0;
  }

  .adjust-button svg {
    width: 14px;
    height: 14px;
  }

  th,
  td {
    padding-right: 13px;
    padding-left: 13px;
  }

  th:first-child,
  td:first-child {
    padding-left: 18px;
  }

  th:last-child,
  td:last-child {
    padding-right: 18px;
  }

  .ledger-foot {
    padding: 11px 17px;
  }

  .page-note {
    align-items: flex-start;
    padding: 0 5px;
    line-height: 1.6;
  }

  .modal-layer {
    align-items: end;
    padding: 0;
  }

  .modal {
    width: 100%;
    max-height: 92vh;
    border-radius: 21px 21px 0 0;
    padding: 22px 18px max(22px, env(safe-area-inset-bottom));
  }

  .target-user {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .target-balance {
    width: 100%;
    margin-left: 49px;
    text-align: left;
  }

  .modal-actions .primary-button,
  .modal-actions .secondary-button {
    flex: 1;
  }

  .toast-region {
    top: 12px;
    right: 16px;
  }
}

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