:root {
  --font-sans: "General Sans", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --color-background: #d8dde6;
  --color-foreground: oklch(0.22 0.04 255);
  --color-card: #e8ecf2;
  --color-primary: oklch(0.48 0.16 255);
  --color-primary-foreground: #f8fafc;
  --color-secondary: #cfd6e2;
  --color-secondary-foreground: oklch(0.28 0.05 255);
  --color-muted: #c8d0dc;
  --color-muted-foreground: oklch(0.42 0.03 255);
  --color-destructive: oklch(0.55 0.22 25);
  --color-border: #b4becd;
  --color-input: #b4becd;
  --color-ring: oklch(0.48 0.16 255);
  --color-navy: oklch(0.24 0.05 255);
  --color-navy-foreground: #eef1f6;
  --shadow-soft: 0 1px 2px oklch(0.2 0.05 255 / 0.04), 0 8px 24px -12px oklch(0.2 0.05 255 / 0.12);
  --shadow-lift: 0 2px 4px oklch(0.2 0.05 255 / 0.04), 0 16px 40px -16px oklch(0.2 0.05 255 / 0.18);
  --dock-shadow: 0 8px 32px -8px oklch(0.2 0.05 255 / 0.22), 0 0 0 1px oklch(0.2 0.05 255 / 0.03);
  --mobile-dock: 5.75rem;
  color-scheme: light;
}

html.dark {
  color-scheme: dark;
  --color-background: #0a0b0f;
  --color-foreground: #f2f3f5;
  --color-card: #12151c;
  --color-primary: #2563eb;
  --color-primary-foreground: #ffffff;
  --color-secondary: #1a1f2a;
  --color-secondary-foreground: #e8eaef;
  --color-muted: #1a1f2a;
  --color-muted-foreground: #9aa1ae;
  --color-destructive: oklch(0.62 0.2 25);
  --color-border: rgba(255, 255, 255, 0.1);
  --color-input: rgba(255, 255, 255, 0.1);
  --color-ring: #3b82f6;
  --color-navy: #f2f3f5;
  --color-navy-foreground: #0a0b0f;
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.35), 0 12px 32px -12px rgba(0, 0, 0, 0.55);
  --shadow-lift: 0 4px 12px rgba(0, 0, 0, 0.4), 0 20px 48px -16px rgba(30, 58, 138, 0.25);
  --dock-shadow: 0 8px 32px -8px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100dvh; background: var(--color-background); }
body {
  color: var(--color-foreground);
  font-family: var(--font-sans);
  letter-spacing: -0.011em;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: oklch(0.52 0.17 255 / 0.18); }

.splash {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 280ms ease;
}
.splash.is-done { opacity: 0; pointer-events: none; }
.splash__veil {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--color-background) 16%, transparent);
  backdrop-filter: blur(10px) saturate(1.15);
  -webkit-backdrop-filter: blur(10px) saturate(1.15);
}
.splash__shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--color-background) 6%, transparent),
    transparent 42%,
    color-mix(in srgb, var(--color-background) 10%, transparent)
  );
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .splash__veil { background: color-mix(in srgb, var(--color-background) 88%, transparent); }
}

.dtfs-loader {
  --w: 156px;
  --dtfs-ink: var(--color-navy);
  --dtfs-blue-a: #1d4ed8;
  --dtfs-blue-b: #1e40af;
  --dtfs-sheen: rgba(255, 255, 255, 0.72);
  --dtfs-dot-glow: color-mix(in srgb, var(--color-primary) 50%, transparent);
  position: relative;
  z-index: 1;
  width: var(--w);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--w) * 0.1);
  animation: dtfs-enter 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.dtfs-loader--splash { --w: 148px; }
@media (max-width: 640px) {
  .dtfs-loader { --w: 120px; }
  .dtfs-loader--splash { --w: 108px; }
}
.dtfs-loader[data-theme="light"] {
  --dtfs-ink: #15171c;
  --dtfs-blue-a: #1d4ed8;
  --dtfs-blue-b: #1e40af;
  --dtfs-sheen: rgba(255, 255, 255, 0.75);
  --dtfs-dot-glow: rgba(37, 99, 235, 0.5);
}
.dtfs-loader[data-theme="dark"],
html.dark .dtfs-loader:not([data-theme="light"]) {
  --dtfs-ink: #f2f3f5;
  --dtfs-blue-a: #3b82f6;
  --dtfs-blue-b: #2563eb;
  --dtfs-sheen: rgba(255, 255, 255, 0.4);
  --dtfs-dot-glow: rgba(59, 130, 246, 0.55);
}
@keyframes dtfs-enter {
  from { opacity: 0; transform: scale(0.92) translateY(6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.dtfs-loader__mark { width: 100%; height: auto; display: block; overflow: visible; }
.dtfs-loader__text {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 64px;
  fill: #fff;
  text-anchor: middle;
  letter-spacing: -0.02em;
}
.dtfs-loader__sheen {
  mix-blend-mode: screen;
  transform-box: view-box;
  transform-origin: 0 50%;
  animation: dtfs-sheen 2.8s cubic-bezier(0.37, 0, 0.63, 1) infinite;
}
@keyframes dtfs-sheen {
  0% { transform: translateX(-120px) skewX(-24deg); }
  100% { transform: translateX(560px) skewX(-24deg); }
}
.dtfs-loader__dot, .dtfs-loader__dot-glow {
  transform-box: fill-box;
  transform-origin: center;
}
.dtfs-loader__dot { fill: var(--dtfs-blue-a); animation: dtfs-dot 1.8s ease-in-out infinite; }
.dtfs-loader__dot-glow { fill: var(--dtfs-dot-glow); animation: dtfs-dot-glow 1.8s ease-in-out infinite; }
@keyframes dtfs-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.18); opacity: 0.75; }
}
@keyframes dtfs-dot-glow {
  0%, 100% { transform: scale(1); opacity: 0.55; }
  50% { transform: scale(1.9); opacity: 0; }
}
.dtfs-loader__wordmark {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: calc(var(--w) * 0.068);
  letter-spacing: 0.42em;
  color: var(--dtfs-ink);
  min-height: 1.2em;
  white-space: nowrap;
}
.dtfs-loader__cursor { margin-left: 0.15em; animation: dtfs-blink 1s step-end infinite; }
@keyframes dtfs-blink { 50%, 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .dtfs-loader, .dtfs-loader__sheen, .dtfs-loader__dot, .dtfs-loader__dot-glow, .dtfs-loader__cursor { animation: none; }
  .dtfs-loader__sheen { opacity: 0; }
  .sk, .is-entering { animation: none; }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.sk {
  display: block;
  border-radius: 0.5rem;
  background: linear-gradient(90deg, #c5ceda 25%, #e8eef5 50%, #c5ceda 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
}
html.dark .sk {
  background: linear-gradient(90deg, #151922 25%, #1c2230 50%, #151922 75%);
  background-size: 200% 100%;
}
.sk-logo { width: 7.5rem; height: 2.25rem; }
.sk-logo-sm { width: 4.5rem; height: 1.5rem; }
.sk-nav { height: 2.35rem; }
.sk-avatar { width: 2rem; height: 2rem; border-radius: 0.5rem; flex-shrink: 0; }
.sk-line { height: 0.7rem; width: 68%; }
.sk-short { width: 40%; }
.sk-value { height: 1.55rem; width: 46%; margin-top: 0.85rem; }
.sk-btn { height: 2.5rem; width: 100%; margin-top: 0.75rem; }
.sk-title { height: 0.85rem; width: 6.5rem; }
.sk-icon { width: 2.25rem; height: 2.25rem; margin-left: auto; border-radius: 0.5rem; }
.sk-chart { height: 100%; min-height: 12rem; }
.sk-field { height: 2.5rem; width: 100%; }
.sk-row { height: 2.35rem; width: 100%; }
.sk-hero { width: 14rem; max-width: 80%; height: 1.15rem; }
.sk-rows { display: grid; gap: 0.65rem; }
.sk-dock { flex: 1; height: 2.5rem; }
.boot-auth .hero .sk { background: rgba(255, 255, 255, 0.22); }
html[data-boot="desk"] .boot-auth,
html[data-boot="auth"] .boot-desk { display: none; }
.stack.boot-table,
.stack.boot-form { display: none; }
html[data-panel="people"] .stack.boot-home,
html[data-panel="trades"] .stack.boot-home,
html[data-panel="link"] .stack.boot-home,
html[data-panel="settings"] .stack.boot-home { display: none; }
html[data-panel="people"] .stack.boot-table,
html[data-panel="trades"] .stack.boot-table,
html[data-panel="link"] .stack.boot-form,
html[data-panel="settings"] .stack.boot-form { display: grid; }
html.boot-collapsed .boot-desk .sidebar { width: 72px; }
html.boot-collapsed .boot-desk .side-label,
html.boot-collapsed .boot-desk .user-meta { display: none; }
html.boot-collapsed .boot-desk .side-nav { align-items: center; }
html.boot-collapsed .boot-desk .sk-nav,
html.boot-collapsed .boot-desk .sk-btn { width: 2.5rem; }
.is-entering { animation: rise 420ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  height: 2.5rem;
  padding: 0 1rem;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  background: transparent;
  font-size: 0.875rem;
  font-weight: 600;
  transition: background 200ms, box-shadow 200ms, border-color 200ms, transform 200ms;
}
.btn:active { transform: scale(0.98); }
.btn:disabled, .btn[data-loading="true"] { opacity: 0.55; pointer-events: none; cursor: wait; }
.btn:focus-visible { outline: 2px solid var(--color-ring); outline-offset: 2px; }
.btn-primary {
  background: var(--color-primary);
  color: var(--color-primary-foreground);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--color-primary) 25%, transparent);
}
.btn-primary:hover { filter: brightness(0.94); }
.btn-outline {
  border-color: var(--color-border);
  background: var(--color-card);
  color: var(--color-navy);
  box-shadow: var(--shadow-soft);
}
.btn-outline:hover { background: color-mix(in srgb, var(--color-muted) 60%, transparent); }
.btn-ghost { color: var(--color-navy); }
.btn-ghost:hover { background: var(--color-muted); }
.btn-block { width: 100%; }
.btn-icon { width: 2.25rem; height: 2.25rem; padding: 0; }
.spin { width: 1rem; height: 1rem; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.field { display: block; margin: 0.85rem 0 0.35rem; font-size: 0.8125rem; font-weight: 600; color: var(--color-navy); }
.input {
  width: 100%;
  height: 2.75rem;
  border-radius: 0.5rem;
  border: 1px solid var(--color-input);
  background: var(--color-card);
  color: var(--color-foreground);
  box-shadow: var(--shadow-soft);
  padding: 0 0.875rem;
  font-size: 0.875rem;
}
.input:focus { outline: none; border-color: color-mix(in srgb, var(--color-primary) 50%, var(--color-input)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-ring) 30%, transparent); }
.input[readonly] { background: color-mix(in srgb, var(--color-muted) 45%, var(--color-card)); color: var(--color-muted-foreground); }
.input-code { text-transform: uppercase; letter-spacing: 0.04em; }
@media (min-width: 768px) { .input { height: 2.5rem; } }

.card {
  background: var(--color-card);
  border: 1px solid color-mix(in srgb, var(--color-border) 70%, transparent);
  border-radius: 0.75rem;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.card-bar { height: 0.25rem; background: var(--color-primary); }
.card-pad { padding: 1.1rem 1rem 1.25rem; }
@media (min-width: 640px) { .card-pad { padding: 1.25rem 1.5rem 1.5rem; } }
.card h2, .section-title {
  margin: 0;
  font-size: clamp(1.375rem, 1.2rem + 0.7vw, 1.75rem);
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--color-foreground);
}
.muted { margin: 0.4rem 0 0; color: var(--color-muted-foreground); font-size: 0.8125rem; line-height: 1.5; }
.error { min-height: 1.2em; margin: 0.75rem 0 0; color: var(--color-destructive); font-size: 0.8125rem; }
.hint { margin: 0.35rem 0 0; color: var(--color-muted-foreground); font-size: 0.75rem; line-height: 1.4; }
.notice {
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.5rem;
  background: color-mix(in srgb, var(--color-primary) 8%, var(--color-card));
  color: var(--color-navy);
  font-size: 0.8125rem;
}
.auth-or {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.95rem 0 0.75rem;
  color: var(--color-muted-foreground);
  font-size: 0.75rem;
}
.auth-or::before, .auth-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--color-border);
}
.google-host { min-height: 2.5rem; display: flex; justify-content: center; }
.google-host > div { width: 100%; }

.segment {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: 0.75rem;
  background: color-mix(in srgb, var(--color-muted) 80%, transparent);
}
.segment button {
  border: 0;
  background: transparent;
  color: var(--color-muted-foreground);
  border-radius: 0.5rem;
  height: 2.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
}
.segment button[aria-pressed="true"] {
  background: var(--color-card);
  color: var(--color-navy);
  box-shadow: var(--shadow-soft);
}

.auth {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--color-background);
}
.hero {
  position: relative;
  height: min(38vh, 280px);
  overflow: hidden;
  color: white;
}
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero__wash {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(10, 30, 70, 0.9), rgba(10, 11, 15, 0.88), #0a0b0f);
}
.hero__fade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--color-background), transparent 55%);
  opacity: 0.92;
}
.hero__content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1rem;
}
.hero h1 { margin: 0 0 1.5rem; font-size: 1.25rem; line-height: 1.25; font-weight: 700; }
.hero p { margin: 0.4rem 0 0; color: rgba(255,255,255,0.8); font-size: 0.75rem; line-height: 1.45; }
.brand { display: inline-flex; align-items: center; background: transparent; }
.brand img { height: 2.5rem; width: auto; }
.hero-tools { display: flex; align-items: center; justify-content: space-between; }
.hero .btn-ghost { color: white; }
.hero .btn-ghost:hover { background: rgba(255,255,255,0.1); color: white; }
.auth-form {
  position: relative;
  flex: 1;
  margin-top: -1.25rem;
  border-radius: 1rem 1rem 0 0;
  background: var(--color-background);
  padding: 1.25rem 1rem 2rem;
}
.auth-form .card { max-width: 28rem; margin: 0 auto; }
.legal {
  margin: 1.5rem 0 0;
  text-align: center;
  font-size: 10px;
  color: var(--color-muted-foreground);
}
.legal a { color: inherit; }

.desk { min-height: 100dvh; display: flex; background: var(--color-background); }
.sidebar {
  display: none;
  width: 260px;
  min-width: 0;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100dvh;
  flex-shrink: 0;
  border-right: 1px solid color-mix(in srgb, var(--color-border) 80%, transparent);
  background: var(--color-card);
  transition: width 200ms ease;
  overflow: hidden;
}
.desk.is-collapsed .sidebar { width: 72px; }
.sidebar__brand {
  min-height: 4.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-bottom: 1px solid color-mix(in srgb, var(--color-border) 70%, transparent);
  padding: 0.5rem 2.25rem;
}
.sidebar__brand .brand { max-width: calc(100% - 2.75rem); }
.sidebar__brand img { height: 2.75rem; max-width: 100%; object-fit: contain; }
.desk.is-collapsed .sidebar__brand { padding: 0.5rem; }
.desk.is-collapsed .sidebar__brand .brand { max-width: 100%; }
.desk.is-collapsed .sidebar__brand img { height: 2rem; }
.side-collapse, .side-expand, .expand-header { display: none; }
.side-label {
  margin: 1rem 1.25rem 0.5rem;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--color-muted-foreground) 80%, transparent);
}
.side-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 0.75rem; flex: 1; min-height: 0; overflow: auto; }
.desk.is-collapsed .side-label { display: none; }
.desk.is-collapsed .nav-label { display: none; }
.desk.is-collapsed .side-nav { align-items: center; padding: 0 0.5rem; }
.side-nav button, .nav-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--color-navy);
  border-radius: 0.5rem;
  padding: 0.65rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: left;
  transition: background 180ms ease, color 180ms ease, width 200ms ease, height 200ms ease;
}
.side-nav button[aria-current="page"] {
  background: var(--color-primary);
  color: var(--color-primary-foreground);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--color-primary) 25%, transparent);
}
.side-nav button:not([aria-current="page"]):hover { background: var(--color-muted); }
.desk.is-collapsed .side-nav button {
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
}
.sidebar__foot { margin-top: auto; padding: 0.75rem; border-top: 1px solid color-mix(in srgb, var(--color-border) 70%, transparent); }
.desk.is-collapsed .sidebar__foot { padding: 0.75rem 0.5rem; }
.user-chip {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  border-radius: 0.5rem;
  padding: 0.75rem;
  background: color-mix(in srgb, var(--color-muted) 40%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-border) 50%, transparent);
  margin-bottom: 0.5rem;
}
.user-chip strong { display: block; font-size: 0.875rem; color: var(--color-navy); }
.user-chip .user-meta span { display: block; margin-top: 0.2rem; font-size: 0.6875rem; color: var(--color-muted-foreground); overflow: hidden; text-overflow: ellipsis; }
.avatar {
  display: none;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  background: color-mix(in srgb, var(--color-primary) 12%, transparent);
  color: var(--color-primary);
  font-size: 0.6875rem;
  font-weight: 700;
}
.desk.is-collapsed .avatar { display: inline-flex; }
.desk.is-collapsed .user-meta { display: none; }
.desk.is-collapsed .user-chip { justify-content: center; padding: 0.45rem; }
.desk.is-collapsed .sidebar__foot .btn { width: 2.5rem; height: 2.5rem; padding: 0; margin-inline: auto; }
.desk.is-collapsed .signout-label { position: absolute; width: 1px; height: 1px; overflow: hidden; }

.main { flex: 1; min-width: 0; padding: 0.75rem 1rem calc(var(--mobile-dock) + 0.5rem); }
.header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  padding: 0.45rem 0.55rem 0.45rem 0.7rem;
  border: 1px solid color-mix(in srgb, var(--color-border) 60%, transparent);
  border-radius: 0.75rem;
  background: color-mix(in srgb, var(--color-card) 92%, transparent);
  backdrop-filter: blur(24px);
  box-shadow: var(--dock-shadow);
}
.header img { height: 2rem; }
.header h1 {
  margin: 0;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.header-tools { display: flex; align-items: center; gap: 0.25rem; }
.stats { display: grid; gap: 0.75rem; }
.stat {
  background: var(--color-card);
  border: 1px solid color-mix(in srgb, var(--color-border) 60%, transparent);
  border-radius: 0.75rem;
  padding: 0.9rem;
  min-height: 6.2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.stat header { display: flex; justify-content: space-between; gap: 0.5rem; align-items: flex-start; }
.stat p { margin: 0; font-size: 0.75rem; color: var(--color-muted-foreground); }
.stat b {
  display: block;
  margin-top: 0.75rem;
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--color-navy);
  line-height: 1;
}
.stat i {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--color-muted) 70%, transparent);
  color: var(--color-muted-foreground);
}
.stat.primary { border-color: color-mix(in srgb, var(--color-primary) 22%, var(--color-border)); background: linear-gradient(to bottom right, color-mix(in srgb, var(--color-primary) 6%, var(--color-card)), var(--color-card)); }
.stat.primary i { background: var(--color-primary); color: var(--color-primary-foreground); }
.stack { display: grid; gap: 0.75rem; align-content: start; }
.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.9rem 1rem 0.75rem;
  border-bottom: 1px solid color-mix(in srgb, var(--color-border) 70%, transparent);
  background: color-mix(in srgb, var(--color-muted) 22%, transparent);
}
.chart-card h2 { font-size: 1rem; letter-spacing: -0.02em; }
.chart-head p { margin: 0.2rem 0 0; font-size: 0.75rem; }
.chart-total { text-align: right; font-variant-numeric: tabular-nums; }
.chart-total b { display: block; color: var(--color-navy); font-size: 1.05rem; font-weight: 600; letter-spacing: -0.02em; }
.chart-total span { font-size: 0.6875rem; color: var(--color-muted-foreground); }
.chart-card { overflow: visible; }
.chart-plot { position: relative; height: 14rem; container-type: inline-size; }
.chart-plot svg { display: block; width: 100%; height: 100%; }
.chart-grid { stroke: color-mix(in srgb, var(--color-border) 85%, transparent); stroke-dasharray: 3 3; }
.chart-base { stroke: color-mix(in srgb, var(--color-border) 90%, transparent); }
.chart-area { fill: color-mix(in srgb, var(--color-primary) 14%, transparent); opacity: 0; transition: opacity 700ms ease; }
.chart-area.is-drawn { opacity: 1; }
.chart-line {
  fill: none;
  stroke: var(--color-primary);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.chart-dot { fill: var(--color-primary); }
.chart-active { fill: var(--color-card); stroke: var(--color-primary); stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart-guide { stroke: var(--color-primary); stroke-opacity: 0.35; }
.chart-label { fill: var(--color-muted-foreground); font-size: 11px; font-family: var(--font-sans); }
.chart-tip {
  position: absolute;
  z-index: 2;
  transform: translate(-50%, -100%);
  min-width: 6.5rem;
  padding: 0.35rem 0.55rem;
  border-radius: 0.5rem;
  border: 1px solid color-mix(in srgb, var(--color-border) 80%, transparent);
  background: var(--color-card);
  box-shadow: var(--shadow-soft);
  pointer-events: none;
  font-size: 0.75rem;
}
.chart-tip[hidden] { display: none; }
.chart-tip span { display: block; color: var(--color-muted-foreground); }
.chart-tip b { color: var(--color-navy); font-variant-numeric: tabular-nums; }
@container (max-width: 520px) {
  .chart-label-minor { display: none; }
}
@media (min-width: 640px) {
  .chart-head { padding: 1rem 1.25rem 0.85rem; }
  .chart-plot { height: 16.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  .chart-line, .chart-area { transition: none !important; }
}
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
th, td { text-align: left; padding: 0.7rem 0.45rem; border-bottom: 1px solid color-mix(in srgb, var(--color-border) 70%, transparent); }
th { color: var(--color-muted-foreground); font-weight: 500; font-size: 0.6875rem; letter-spacing: 0.04em; text-transform: uppercase; }
td { color: var(--color-navy); font-variant-numeric: tabular-nums; }
.link-row { display: flex; gap: 0.5rem; margin-top: 0.9rem; }
.link-row .input { font-family: var(--font-mono); font-size: 0.75rem; }
.field-grid { display: grid; gap: 0.15rem 0.75rem; }
.field-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; margin-top: 0.35rem; }
.amount-row { display: flex; gap: 0.5rem; margin-top: 0.9rem; align-items: center; }
.amount-row .input { max-width: 12rem; font-variant-numeric: tabular-nums; }
.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.12rem 0.45rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: capitalize;
  background: color-mix(in srgb, var(--color-primary) 12%, transparent);
  color: var(--color-primary);
}
.pill.cancelled {
  background: color-mix(in srgb, var(--color-muted) 80%, transparent);
  color: var(--color-muted-foreground);
}
.row-action { height: 2rem; padding: 0 0.7rem; font-size: 0.75rem; }
@media (min-width: 640px) {
  .field-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 639px) {
  .amount-row { flex-direction: column; align-items: stretch; }
  .amount-row .input { max-width: none; }
}

.dock {
  display: flex;
  position: fixed;
  left: 0.75rem;
  right: 0.75rem;
  bottom: max(0.5rem, env(safe-area-inset-bottom));
  z-index: 50;
  gap: 0.15rem;
  padding: 0.35rem;
  border-radius: 0.75rem;
  border: 1px solid color-mix(in srgb, var(--color-border) 60%, transparent);
  background: color-mix(in srgb, var(--color-card) 92%, transparent);
  backdrop-filter: blur(24px);
  box-shadow: var(--dock-shadow);
}
.dock button {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--color-muted-foreground);
  border-radius: 0.5rem;
  min-height: 3.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  font-size: 0.625rem;
  font-weight: 600;
  white-space: nowrap;
  padding: 0 0.1rem;
}
.dock button[aria-current="page"] {
  background: var(--color-primary);
  color: var(--color-primary-foreground);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--color-primary) 25%, transparent);
}

@media (min-width: 768px) {
  .sidebar { display: flex; }
  .side-collapse {
    display: inline-flex;
    position: absolute;
    right: 0.45rem;
    top: 50%;
    z-index: 2;
    transform: translateY(-50%);
  }
  .side-collapse:active { transform: translateY(-50%) scale(0.98); }
  .desk.is-collapsed .side-collapse { display: none; }
  .desk.is-collapsed .side-expand,
  .desk.is-collapsed .expand-header { display: inline-flex; }
  .side-expand { align-self: center; margin: 0.25rem auto 0.35rem; flex-shrink: 0; }
  .dock, .header .brand { display: none; }
  .main { padding: 1.25rem 1.5rem 2rem; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .auth { display: grid; grid-template-columns: 1fr 1fr; }
  .hero { height: auto; min-height: 100dvh; }
  .hero__content { padding: 2.5rem; }
  .hero h1 { font-size: 2.25rem; max-width: 28rem; margin-bottom: 0; }
  .hero p { font-size: 1rem; max-width: 28rem; }
  .hero .brand img { height: 4rem; }
  .auth-form {
    margin: 0;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2.5rem;
  }
  .legal { display: none; }
  .desk-only { display: flex; }
}
@media (max-width: 767px) {
  .desk-only { display: none; }
  .link-row { flex-direction: column; }
}
