/* finesse · register=product · shell=sidebar-dense · A=editorial-utility · B=760/430 · C=dense-ledger · D=feedback-only · E=sage-ledger · SOUL=5 SPECTACLE=2 DENSITY=8 */
:root {
  --page: #e9eee9;
  --bg: #fbfaf6;
  --panel-2: #f1f4ef;
  --panel-3: #e7ece6;
  --border: rgba(20, 40, 29, 0.1);
  --border-strong: rgba(20, 40, 29, 0.17);
  --ink-1: #17221c;
  --ink-2: #405047;
  --ink-3: #68776f;
  --accent: #2f6b4f;
  --accent-dark: #24543e;
  --accent-soft: rgba(47, 107, 79, 0.11);
  --accent-faint: rgba(47, 107, 79, 0.06);
  --accent-2: #c08a3e;
  --accent-2-soft: rgba(192, 138, 62, 0.14);
  --on-accent: #fbfaf6;
  --up: #26758b;
  --down: #b4473d;
  --down-soft: rgba(180, 71, 61, 0.1);
  --warn: #9f6b18;
  --warn-soft: rgba(192, 138, 62, 0.14);
  --info-soft: rgba(38, 117, 139, 0.1);
  --scrim: rgba(18, 31, 23, 0.58);
  --rail: #17231c;
  --rail-2: #213027;
  --rail-3: #2b3b32;
  --rail-ink: #a9b5ad;
  --rail-strong: #f4f5ee;
  --rail-border: rgba(245, 248, 240, 0.08);
  --shadow: 0 1px 3px rgba(22, 45, 31, 0.055);
  --shadow-md: 0 12px 28px -20px rgba(22, 45, 31, 0.25);
  --shadow-lg: 0 38px 90px -44px rgba(15, 34, 23, 0.38);
  --glow: rgba(47, 107, 79, 0.28);
  --r-lg: 24px;
  --r: 18px;
  --r-sm: 12px;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-num: "SFMono-Regular", "Roboto Mono", "DIN Alternate", monospace;
  --rail-w: 238px;
  --top-h: 68px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow-x: clip;
}

body {
  min-height: 100dvh;
  background:
    radial-gradient(900px 460px at 92% -120px, var(--accent-soft), transparent 70%),
    var(--page);
  color: var(--ink-1);
  font: 14px/1.52 var(--font);
  -webkit-font-smoothing: antialiased;
}

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

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

button {
  cursor: pointer;
}

a {
  color: inherit;
}

::selection {
  color: var(--ink-1);
  background: var(--accent-2-soft);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.num {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.025em;
}

.app {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  min-height: 100dvh;
}

.rail {
  position: sticky;
  top: 0;
  height: 100dvh;
  padding: 24px 16px 18px;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, var(--rail-2), transparent 150px),
    var(--rail);
  color: var(--rail-ink);
  z-index: 30;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 0 8px 22px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 13px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.06em;
  box-shadow: 0 8px 22px -10px var(--glow);
}

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

.brand-copy b {
  display: block;
  color: var(--rail-strong);
  font-size: 15px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.brand-copy span {
  display: block;
  margin-top: 2px;
  color: var(--rail-ink);
  font-size: 11px;
  opacity: 0.76;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 0;
}

.nav-group {
  margin-top: 20px;
}

.nav-group:first-child {
  margin-top: 0;
}

.nav-label {
  padding: 0 11px 8px;
  color: var(--rail-ink);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  opacity: 0.55;
}

.nav a {
  position: relative;
  min-height: 41px;
  padding: 9px 11px;
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--rail-ink);
  text-decoration: none;
  border-radius: 11px;
  transition: background 150ms ease, color 150ms ease, transform 150ms ease;
}

.nav a:hover {
  color: var(--rail-strong);
  background: var(--rail-3);
}

.nav a.on {
  color: var(--rail-strong);
  background: var(--rail-3);
  font-weight: 650;
}

.nav a.on::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 3px;
  background: var(--accent-2);
}

.nav svg {
  width: 18px;
  height: 18px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
}

.nav .count {
  margin-left: auto;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--rail-2);
  color: var(--rail-ink);
  font: 650 10px/1 var(--font-num);
}

.nav a.on .count {
  background: var(--accent);
  color: var(--on-accent);
}

.rail-foot {
  margin-top: auto;
  padding: 16px 8px 0;
  border-top: 1px solid var(--rail-border);
}

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

.operator-avatar {
  width: 32px;
  height: 32px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--rail-3);
  color: var(--rail-strong);
  font-size: 12px;
  font-weight: 700;
}

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

.operator-copy b {
  display: block;
  color: var(--rail-strong);
  font-size: 12px;
}

.operator-copy span {
  display: block;
  margin-top: 1px;
  color: var(--rail-ink);
  font-size: 10px;
  opacity: 0.7;
}

.logout {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--rail-ink);
}

.logout:hover {
  background: var(--rail-3);
  color: var(--rail-strong);
}

.logout svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
}

.workspace {
  min-width: 0;
}

.topbar {
  height: var(--top-h);
  padding: 0 26px;
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--page);
  border-bottom: 1px solid var(--border);
}

.crumb {
  min-width: 130px;
  color: var(--ink-3);
  font-size: 12px;
  white-space: nowrap;
}

.crumb b {
  color: var(--ink-1);
  font-weight: 650;
}

.top-search {
  width: min(460px, 42vw);
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  box-shadow: var(--shadow);
}

.top-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.top-search svg {
  width: 16px;
  height: 16px;
  flex: none;
  stroke: var(--ink-3);
  fill: none;
  stroke-width: 1.8;
}

.top-search input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink-1);
  font-size: 12px;
}

.top-search input::placeholder {
  color: var(--ink-3);
}

.top-date {
  color: var(--ink-3);
  font-size: 11.5px;
  white-space: nowrap;
}

.main {
  width: min(1480px, 100%);
  min-width: 0;
  padding: 24px 26px 44px;
}

.page {
  animation: page-in 220ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

.hook {
  margin-bottom: 20px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

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

.hook h1 {
  margin: 0;
  color: var(--ink-1);
  font-size: clamp(24px, 2.25vw, 34px);
  font-weight: 760;
  line-height: 1.18;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.hook p {
  max-width: 760px;
  margin: 8px 0 0;
  color: var(--ink-3);
  font-size: 12.5px;
  line-height: 1.6;
  text-wrap: pretty;
}

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

.btn {
  min-height: 38px;
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--bg);
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 650;
  box-shadow: var(--shadow);
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease,
    transform 150ms ease;
}

.btn:hover {
  border-color: var(--border-strong);
  color: var(--ink-1);
}

.btn:active {
  transform: translateY(1px);
}

.btn.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 10px 22px -15px var(--glow);
}

.btn.primary:hover {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
}

.btn.danger {
  border-color: var(--down-soft);
  background: var(--down-soft);
  color: var(--down);
  box-shadow: none;
}

.btn.ghost {
  background: transparent;
  box-shadow: none;
}

.btn.sm {
  min-height: 30px;
  padding: 5px 9px;
  border-radius: 8px;
  font-size: 11px;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

.btn svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.72fr);
  gap: 16px;
  align-items: start;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.card {
  min-width: 0;
  padding: 19px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--bg);
  box-shadow: var(--shadow);
}

.card.inset {
  background: var(--panel-2);
  box-shadow: none;
}

.card.flush {
  padding: 0;
  overflow: hidden;
}

.card-head {
  min-height: 30px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  margin: 0;
  color: var(--ink-1);
  font-size: 14px;
  font-weight: 720;
  line-height: 1.3;
}

.card-sub {
  margin-top: 3px;
  color: var(--ink-3);
  font-size: 11px;
}

.text-link {
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
  font-size: 11.5px;
  font-weight: 650;
}

.text-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.summary-hero {
  position: relative;
  overflow: hidden;
  min-height: 248px;
  padding: 25px;
  border-radius: var(--r-lg);
  background:
    radial-gradient(300px 170px at 100% 0, var(--rail-3), transparent 78%),
    var(--rail);
  color: var(--rail-strong);
  box-shadow: var(--shadow-lg);
}

.summary-hero::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  right: -125px;
  bottom: -145px;
  border: 1px solid var(--rail-border);
  border-radius: 50%;
  box-shadow:
    0 0 0 36px transparent,
    0 0 0 37px var(--rail-border),
    0 0 0 72px transparent,
    0 0 0 73px var(--rail-border);
}

.summary-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--rail-ink);
  font-size: 11px;
  font-weight: 650;
}

.summary-label i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 4px var(--accent-2-soft);
}

.summary-value {
  margin-top: 22px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--rail-strong);
  font: 760 44px/1 var(--font-num);
  letter-spacing: -0.045em;
}

.summary-value small {
  font: 550 12px/1.2 var(--font);
  color: var(--rail-ink);
  letter-spacing: 0;
}

.summary-note {
  max-width: 420px;
  margin-top: 9px;
  color: var(--rail-ink);
  font-size: 11.5px;
  line-height: 1.55;
}

.summary-split {
  position: relative;
  z-index: 1;
  margin-top: 26px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.summary-cell {
  padding-top: 11px;
  border-top: 1px solid var(--rail-border);
}

.summary-cell span {
  display: block;
  color: var(--rail-ink);
  font-size: 10px;
}

.summary-cell b {
  display: block;
  margin-top: 4px;
  color: var(--rail-strong);
  font: 650 16px/1.2 var(--font-num);
}

.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.kpi {
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--bg);
  box-shadow: var(--shadow);
}

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink-3);
  font-size: 10.5px;
}

.kpi-icon {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--ink-2);
}

.kpi-icon svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
}

.kpi-value {
  margin-top: 13px;
  color: var(--ink-1);
  font: 730 25px/1 var(--font-num);
  letter-spacing: -0.035em;
}

.kpi-value small {
  margin-left: 3px;
  color: var(--ink-3);
  font: 500 10px/1 var(--font);
}

.kpi-note {
  margin-top: 7px;
  color: var(--ink-3);
  font-size: 10.5px;
  line-height: 1.45;
}

.kpi.alert {
  border-color: var(--down-soft);
}

.kpi.alert .kpi-icon {
  background: var(--down-soft);
  color: var(--down);
}

.kpi.warn .kpi-icon {
  background: var(--warn-soft);
  color: var(--warn);
}

.todo-list {
  display: flex;
  flex-direction: column;
}

.todo {
  min-width: 0;
  padding: 14px 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.todo:first-child {
  padding-top: 2px;
}

.todo:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.todo-index {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font: 700 11px/1 var(--font-num);
}

.todo.urgent .todo-index {
  background: var(--down-soft);
  color: var(--down);
}

.todo.warn .todo-index {
  background: var(--warn-soft);
  color: var(--warn);
}

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

.todo-copy b {
  display: block;
  color: var(--ink-1);
  font-size: 12.5px;
  line-height: 1.4;
}

.todo-copy span {
  display: block;
  margin-top: 3px;
  color: var(--ink-3);
  font-size: 10.5px;
  line-height: 1.45;
}

.empty {
  padding: 33px 20px;
  text-align: center;
  color: var(--ink-3);
}

.empty-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 11px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--panel-2);
  color: var(--accent);
}

.empty-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
}

.empty b {
  display: block;
  color: var(--ink-2);
  font-size: 12.5px;
}

.empty p {
  max-width: 420px;
  margin: 6px auto 0;
  font-size: 11px;
  line-height: 1.6;
}

.empty .btn {
  margin-top: 14px;
}

.cash-chart {
  min-height: 164px;
}

.cash-chart svg {
  width: 100%;
  height: 142px;
  display: block;
  overflow: visible;
}

.chart-grid {
  stroke: var(--border);
  stroke-width: 1;
}

.chart-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-area {
  fill: var(--accent-soft);
  stroke: none;
}

.chart-line.buyout {
  stroke: var(--accent-2);
}

.chart-dot {
  fill: var(--bg);
  stroke: var(--accent);
  stroke-width: 2;
}

.chart-label {
  fill: var(--ink-3);
  font: 9px var(--font);
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 7px;
  color: var(--ink-3);
  font-size: 10px;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.chart-legend i {
  width: 8px;
  height: 8px;
  border-radius: 3px;
  background: var(--accent);
}

.chart-legend span:last-child i {
  background: var(--accent-2);
}

.risk-list {
  display: grid;
  gap: 8px;
}

.risk-row {
  padding: 11px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 10px;
  background: var(--panel-2);
}

.risk-row span {
  color: var(--ink-2);
  font-size: 11.5px;
}

.risk-row b {
  color: var(--ink-1);
  font: 680 15px/1 var(--font-num);
}

.toolbar {
  margin-bottom: 14px;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--bg);
  box-shadow: var(--shadow);
}

.search-mini {
  min-width: 230px;
  flex: 1;
  min-height: 36px;
  padding: 0 11px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel-2);
}

.search-mini svg {
  width: 15px;
  height: 15px;
  stroke: var(--ink-3);
  fill: none;
  stroke-width: 1.8;
}

.search-mini input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink-1);
  font-size: 12px;
}

.segmented {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border-radius: 9px;
  background: var(--panel-2);
  border: 1px solid var(--border);
}

.segmented a,
.segmented button {
  min-height: 30px;
  padding: 5px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-3);
  text-decoration: none;
  white-space: nowrap;
  font-size: 10.5px;
}

.segmented a.on,
.segmented button.on {
  background: var(--bg);
  color: var(--ink-1);
  font-weight: 650;
  box-shadow: var(--shadow);
}

.select-mini {
  min-height: 36px;
  padding: 0 30px 0 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  outline: 0;
  background: var(--panel-2);
  color: var(--ink-2);
  font-size: 11px;
}

.month-picker {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  outline: 0;
  background: var(--panel-2);
  color: var(--ink-1);
  font: 600 11.5px var(--font);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

.table th {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--ink-3);
  text-align: left;
  white-space: nowrap;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

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

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

.table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--ink-2);
  vertical-align: middle;
  font-size: 11.5px;
}

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

.table tbody tr {
  transition: background 120ms ease;
}

.table tbody tr:hover {
  background: var(--accent-faint);
}

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

.table .nowrap {
  white-space: nowrap;
}

.cell-main {
  color: var(--ink-1);
  font-weight: 650;
  line-height: 1.4;
}

.cell-sub {
  margin-top: 2px;
  color: var(--ink-3);
  font-size: 9.5px;
  line-height: 1.4;
}

.item-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 190px;
}

.item-thumb {
  width: 42px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel-2);
  color: var(--ink-3);
  font: 700 9px/1 var(--font-num);
}

.item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.item-cell-copy {
  min-width: 0;
}

.account-name {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 190px;
}

.account-name > span:last-child {
  min-width: 0;
}

.account-avatar {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 750;
}

.role-list {
  display: grid;
  gap: 2px;
}

.role-row {
  padding: 11px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--border);
}

.role-row:last-child {
  border-bottom: 0;
}

.role-row div {
  min-width: 0;
}

.role-row b {
  display: block;
  color: var(--ink-1);
  font-size: 12px;
}

.role-row span:not(.tag) {
  display: block;
  margin-top: 3px;
  color: var(--ink-3);
  font-size: 10px;
  line-height: 1.45;
}

.money {
  color: var(--ink-1);
  font-family: var(--font-num);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.money.pos {
  color: var(--up);
}

.money.neg {
  color: var(--down);
}

.tag {
  min-height: 21px;
  padding: 3px 7px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 7px;
  background: var(--panel-2);
  color: var(--ink-3);
  white-space: nowrap;
  font-size: 9.5px;
  font-weight: 600;
}

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

.tag.ok {
  background: var(--accent-soft);
  color: var(--accent);
}

.tag.warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.tag.bad {
  background: var(--down-soft);
  color: var(--down);
}

.tag.info {
  background: var(--info-soft);
  color: var(--up);
}

.tag.plain::before {
  display: none;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.metric-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) repeat(3, minmax(140px, 0.6fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--bg);
  box-shadow: var(--shadow);
}

.metric-card.featured {
  border-color: transparent;
  background: var(--rail);
  color: var(--rail-strong);
}

.metric-label {
  color: var(--ink-3);
  font-size: 10.5px;
}

.metric-card.featured .metric-label {
  color: var(--rail-ink);
}

.metric-value {
  margin-top: 12px;
  color: var(--ink-1);
  font: 740 28px/1 var(--font-num);
  letter-spacing: -0.04em;
}

.metric-card.featured .metric-value {
  color: var(--rail-strong);
  font-size: 36px;
}

.metric-detail {
  margin-top: 9px;
  color: var(--ink-3);
  font-size: 10.5px;
  line-height: 1.5;
}

.metric-card.featured .metric-detail {
  color: var(--rail-ink);
}

.split-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 16px;
  align-items: start;
}

.finance-breakdown {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.breakdown-row {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
}

.breakdown-row:last-child {
  border-bottom: 0;
}

.breakdown-row span {
  color: var(--ink-3);
  font-size: 11px;
}

.breakdown-row b {
  color: var(--ink-1);
  font: 650 12px/1.2 var(--font-num);
}

.notice {
  padding: 12px 13px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-radius: 11px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 10.5px;
  line-height: 1.55;
}

.notice svg {
  width: 15px;
  height: 15px;
  flex: none;
  margin-top: 1px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
}

.skeleton {
  min-height: 150px;
  border-radius: var(--r);
  background: linear-gradient(
    90deg,
    var(--panel-2) 20%,
    var(--bg) 40%,
    var(--panel-2) 60%
  );
  background-size: 220% 100%;
  animation: skeleton 1.2s ease infinite;
}

@keyframes skeleton {
  to {
    background-position: -120% 0;
  }
}

.error-state {
  max-width: 500px;
  margin: 80px auto;
  padding: 28px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--bg);
  box-shadow: var(--shadow-md);
}

.error-state h2 {
  margin: 0;
  font-size: 16px;
}

.error-state p {
  margin: 8px 0 18px;
  color: var(--ink-3);
  font-size: 11.5px;
}

.gate {
  position: fixed;
  inset: 0;
  padding: 22px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(700px 500px at 72% 18%, var(--accent-soft), transparent 65%),
    var(--page);
  z-index: 100;
}

.gate[hidden] {
  display: none;
}

.gate-panel {
  width: min(390px, 100%);
  padding: 27px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--bg);
  box-shadow: var(--shadow-lg);
}

.gate-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 25px;
}

.gate-brand .brand-mark {
  width: 42px;
  height: 42px;
}

.gate h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: -0.03em;
}

.gate p {
  margin: 6px 0 0;
  color: var(--ink-3);
  font-size: 11px;
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 650;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: 0;
  background: var(--panel-2);
  color: var(--ink-1);
  font-size: 12px;
}

.field textarea {
  min-height: 82px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field-help {
  margin-top: 5px;
  color: var(--ink-3);
  font-size: 10px;
  line-height: 1.5;
}

.field-help.error {
  color: var(--down);
}

.scan-field {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.scan-field input {
  min-width: 0;
  flex: 1;
  font-family: var(--font-num);
  font-size: 13px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.scan-field .btn {
  min-height: 40px;
}

.scan-result {
  padding: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-2);
}

.scan-result[hidden] {
  display: none;
}

.scan-result > div:first-child {
  min-width: 0;
}

.scan-result span:first-child {
  display: block;
  color: var(--ink-3);
  font-size: 9.5px;
}

.scan-result b {
  display: block;
  margin-top: 3px;
  color: var(--ink-1);
  font-size: 12.5px;
}

.scan-result small {
  display: block;
  margin-top: 3px;
  color: var(--ink-3);
  font: 9.5px/1.45 var(--font-num);
}

.scan-result-state {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 5px;
  flex: none;
}

.scan-result-state strong {
  font: 700 15px/1 var(--font-num);
}

/* finesse · component: image-upload · register=product
 * states: default · hover · focus-visible · active · disabled · loading · error · success
 * tokens: inherited from the B计划经营台 product palette */
.image-uploader {
  display: grid;
  gap: 8px;
}

.image-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.image-drop {
  position: relative;
  min-height: 148px;
  padding: 13px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px dashed var(--border-strong);
  outline: 2px solid transparent;
  outline-offset: 2px;
  border-radius: 13px;
  background: var(--panel-2);
  color: var(--ink-3);
  cursor: pointer;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    color 150ms ease;
}

.image-drop:active,
.image-drop.is-active {
  background: var(--panel-3);
}

.image-drop:focus-visible,
.image-drop.is-focus {
  outline-color: var(--accent);
}

.image-drop.is-error {
  border-color: var(--down);
  background: var(--down-soft);
  color: var(--down);
}

.image-drop.is-loading {
  cursor: wait;
}

.image-drop[aria-disabled="true"],
.image-drop.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.image-drop.is-success {
  border-style: solid;
  border-color: var(--accent);
}

.image-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-drop-copy {
  position: relative;
  z-index: 1;
  max-width: 260px;
  text-align: center;
}

.image-drop-copy svg {
  width: 24px;
  height: 24px;
  margin-bottom: 8px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
}

.image-drop-copy b {
  display: block;
  color: var(--ink-1);
  font-size: 11.5px;
}

.image-drop-copy span {
  display: block;
  margin-top: 4px;
  color: var(--ink-3);
  font-size: 9.5px;
  line-height: 1.5;
}

.image-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  background: var(--scrim);
  color: var(--on-accent);
  font-size: 11px;
  font-weight: 650;
}

.image-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.image-actions small {
  color: var(--ink-3);
  font-size: 9.5px;
}

.image-actions.has-image small {
  display: none;
}

.image-actions-edit {
  display: none;
  align-items: center;
  gap: 6px;
}

.image-drop.has-image + .image-actions .image-actions-edit {
  display: inline-flex;
}

.image-actions.has-image {
  justify-content: flex-end;
}

.permission-head {
  margin: 19px 0 9px;
  padding-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--border);
}

.permission-head b {
  display: block;
  font-size: 12px;
}

.permission-head span:not(.tag) {
  display: block;
  margin-top: 3px;
  color: var(--ink-3);
  font-size: 10px;
}

.permission-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.permission-group {
  min-width: 0;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--panel-2);
}

.permission-group legend {
  padding: 0 4px;
  color: var(--ink-3);
  font-size: 9.5px;
  font-weight: 700;
}

.permission-option {
  min-height: 34px;
  padding: 5px 4px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--ink-2);
  cursor: pointer;
}

.permission-option input {
  width: 15px;
  height: 15px;
  margin: 2px 0 0;
  accent-color: var(--accent);
}

.permission-option b {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.35;
}

.permission-option small {
  display: block;
  margin-top: 1px;
  color: var(--ink-3);
  font: 8.5px/1.35 var(--font-num);
}

.permission-option input:disabled + span {
  opacity: 0.56;
}

@media (hover: hover) and (pointer: fine) {
  .image-drop:hover,
  .image-drop.is-hover {
    border-color: var(--accent);
    background: var(--accent-faint);
    color: var(--accent);
  }
}

.gate-error {
  min-height: 18px;
  margin-top: 9px;
  color: var(--down);
  font-size: 10.5px;
}

.gate .btn {
  width: 100%;
  min-height: 42px;
}

.overlay {
  position: fixed;
  inset: 0;
  padding: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--scrim);
  z-index: 80;
}

.drawer {
  width: min(480px, 100%);
  max-height: min(760px, calc(100dvh - 44px));
  overflow-y: auto;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--bg);
  box-shadow: var(--shadow-lg);
}

.drawer.wide {
  width: min(620px, 100%);
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.drawer-head h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
  letter-spacing: -0.025em;
}

.drawer-head p {
  margin: 5px 0 0;
  color: var(--ink-3);
  font-size: 10.5px;
}

.icon-btn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: none;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel-2);
  color: var(--ink-2);
}

.icon-btn svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

.drawer-actions {
  margin-top: 20px;
  padding-top: 16px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--border);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 10px 15px;
  border: 1px solid var(--rail-border);
  border-radius: 999px;
  background: var(--rail);
  color: var(--rail-strong);
  box-shadow: var(--shadow-lg);
  transform: translate(-50%, 18px);
  opacity: 0;
  pointer-events: none;
  text-align: center;
  font-size: 11.5px;
  z-index: 120;
  transition: opacity 150ms ease, transform 150ms ease;
}

.toast.on {
  opacity: 1;
  transform: translate(-50%, 0);
}

.mobile-menu {
  display: none;
}

.muted {
  color: var(--ink-3);
}

@media (max-width: 1180px) {
  .overview-grid {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  :root {
    --top-h: 58px;
    --rail-w: 76px;
  }

  .rail {
    align-items: center;
    padding: 18px 10px 14px;
  }

  .brand {
    padding: 0 0 18px;
  }

  .brand-copy,
  .nav-label,
  .nav a span:not(.count),
  .operator-copy {
    display: none;
  }

  .nav {
    width: 100%;
  }

  .nav-group {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--rail-border);
  }

  .nav-group:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }

  .nav a {
    justify-content: center;
    padding: 9px;
  }

  .nav a.on::before {
    left: -10px;
  }

  .nav .count {
    position: absolute;
    right: 2px;
    top: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 8px;
  }

  .rail-foot {
    padding: 14px 0 0;
  }

  .operator {
    justify-content: center;
  }

  .logout {
    display: none;
  }

  .password-action {
    display: grid;
  }

  .topbar {
    padding: 0 16px;
    gap: 10px;
  }

  .crumb {
    min-width: auto;
  }

  .top-search {
    width: min(420px, 55vw);
  }

  .top-date {
    display: none;
  }

  .main {
    padding: 18px 16px 34px;
  }

  .split-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  :root {
    --rail-w: 0px;
  }

  .app {
    display: block;
  }

  .rail {
    position: fixed;
    inset: 0 auto 0 0;
    width: 228px;
    align-items: stretch;
    padding: 22px 14px 16px;
    transform: translateX(-105%);
    transition: transform 180ms cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-lg);
  }

  .rail.open {
    transform: translateX(0);
  }

  .rail .brand {
    padding: 0 8px 20px;
  }

  .rail .brand-copy,
  .rail .nav-label,
  .rail .nav a span:not(.count),
  .rail .operator-copy {
    display: block;
  }

  .rail .nav a {
    justify-content: flex-start;
    padding: 9px 11px;
  }

  .rail .nav a.on::before {
    left: 0;
  }

  .rail .nav .count {
    position: static;
    min-width: 22px;
    height: 20px;
    margin-left: auto;
    padding: 0 6px;
    font-size: 10px;
  }

  .rail .logout {
    display: grid;
  }

  .mobile-menu {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    flex: none;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--bg);
    color: var(--ink-2);
  }

  .mobile-menu svg {
    width: 17px;
    height: 17px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
  }

  .topbar {
    padding: 0 12px;
  }

  .top-search {
    width: auto;
    flex: 1;
    margin-left: 0;
  }

  .crumb {
    display: none;
  }

  .main {
    padding: 16px 12px 30px;
  }

  .hook {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .hook-actions {
    width: 100%;
  }

  .hook-actions .btn {
    flex: 1;
  }

  .kpis,
  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }

  .summary-hero {
    min-height: 228px;
    padding: 21px;
  }

  .summary-value {
    font-size: 36px;
  }

  .summary-split {
    gap: 7px;
  }

  .summary-cell b {
    font-size: 13px;
  }

  .card {
    padding: 15px;
  }

  .toolbar {
    align-items: stretch;
  }

  .search-mini {
    flex-basis: 100%;
  }

  .segmented {
    max-width: 100%;
    overflow-x: auto;
  }

  .todo {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .todo .btn {
    grid-column: 2;
    justify-self: start;
  }

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

  .form-grid .full {
    grid-column: auto;
  }

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

  .scan-field {
    flex-direction: column;
  }
}

@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;
  }
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
