:root {
  color-scheme: light;
  --ink: #152e38;
  --muted: #566e76;
  --green: #18675f;
  --dark: #102a38;
  --line: #dce8e7;
  --paper: #fff;
  --surface: #f1f6f4;
  --radius: 20px;
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--ink);
  background: var(--surface);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 300px; }
a { color: var(--green); text-underline-offset: 3px; }
p { line-height: 1.65; }
h1 { font-size: clamp(30px, 3.4vw, 47px); font-weight: 720; margin: 0 0 10px; letter-spacing: -.045em; }
h2 { font-size: 18px; margin: 0; }
h3 { font-size: 15px; margin: 18px 0 8px; }
.muted, .intro { color: var(--muted); font-size: 14px; }
.intro { margin: 0 0 24px; }
.top {
  min-height: 70px;
  padding: 12px clamp(18px, 4vw, 58px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: #fbfaf6;
  border-bottom: 1px solid #dcded6;
}
.brand { display: inline-flex; gap: 12px; align-items: center; color: var(--ink); text-decoration: none; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 16px; letter-spacing: -.02em; }
.brand small { color: var(--muted); font-size: 11px; margin-top: 4px; }
.brand-mark { display: block; width: 47px; height: auto; flex: 0 0 47px; }
.identity { display: flex; align-items: center; justify-content: end; gap: 12px; color: var(--muted); font-size: 13px; }

@property --scene-time {
  syntax: "<number>";
  inherits: true;
  initial-value: 24;
}
@property --sky-top { syntax: "<color>"; inherits: true; initial-value: #76a6c5; }
@property --sky-middle { syntax: "<color>"; inherits: true; initial-value: #b0d2e3; }
@property --sky-horizon { syntax: "<color>"; inherits: true; initial-value: #e1eddf; }
@property --cloud-light { syntax: "<color>"; inherits: true; initial-value: #fffdfb; }
@property --distant-cloud-light { syntax: "<color>"; inherits: true; initial-value: #f8fcff; }
@property --daylight { syntax: "<number>"; inherits: true; initial-value: 1; }
@property --warmth { syntax: "<number>"; inherits: true; initial-value: 0; }
@property --nightfall { syntax: "<number>"; inherits: true; initial-value: 0; }
@property --shadow-angle { syntax: "<angle>"; inherits: true; initial-value: -88deg; }
@property --shadow-length { syntax: "<number>"; inherits: true; initial-value: .42; }
@property --shadow-opacity { syntax: "<number>"; inherits: true; initial-value: .18; }
.auth {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 405px);
  align-items: center;
  gap: clamp(24px, 5vw, 84px);
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(24px, 6vw, 100px);
  overflow: hidden;
  color: #fff8e8;
  background: #193d51;
}
.cover-scene, .cover-stars, .river-plate, .river-motion, .river-reflections, .river-reflection {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.cover-scene {
  z-index: -2;
  overflow: hidden;
  container-type: size;
  --scene-time: 24;
  --solar-angle: calc(var(--scene-time) * 3.6deg);
  --direction: cos(var(--solar-angle));
  --cycle: 108s;
  --offset: -2s;
  background: linear-gradient(171deg, var(--sky-top) 2%, var(--sky-middle) 44%, var(--sky-horizon) 67%);
  animation: solar-cycle var(--cycle) linear var(--offset) infinite,
    sky-cycle var(--cycle) cubic-bezier(.333333, 0, .666667, 1) var(--offset) infinite;
}
@keyframes solar-cycle {
  from { --scene-time: 0; }
  to { --scene-time: 100; }
}
/* These keyframes match the river-plate peaks and use the same smoothstep easing. */
@keyframes sky-cycle {
  0%, 100% {
    --sky-top:#6a87a5; --sky-middle:#b8acb7; --sky-horizon:#f6cbaa;
    --cloud-light:#ffe2cc; --distant-cloud-light:#ffe8df; --daylight:.55; --warmth:.64; --nightfall:0;
    --shadow-angle:-157deg; --shadow-length:1.34; --shadow-opacity:.17;
  }
  10% {
    --sky-top:#86adca; --sky-middle:#c3dce5; --sky-horizon:#f4eee0;
    --cloud-light:#fff1df; --distant-cloud-light:#fdf8f1; --daylight:.93; --warmth:.2; --nightfall:0;
    --shadow-angle:-128deg; --shadow-length:.77; --shadow-opacity:.22;
  }
  24% {
    --sky-top:#76a6c5; --sky-middle:#b0d2e3; --sky-horizon:#e1eddf;
    --cloud-light:#fffdfb; --distant-cloud-light:#f8fcff; --daylight:1; --warmth:0; --nightfall:0;
    --shadow-angle:-88deg; --shadow-length:.42; --shadow-opacity:.20;
  }
  42% {
    --sky-top:#7e9fb6; --sky-middle:#c0bac2; --sky-horizon:#f1d7b2;
    --cloud-light:#ffe6ca; --distant-cloud-light:#fceae3; --daylight:.82; --warmth:.38; --nightfall:0;
    --shadow-angle:-45deg; --shadow-length:.82; --shadow-opacity:.24;
  }
  51% {
    --sky-top:#525776; --sky-middle:#b7828c; --sky-horizon:#f3a872;
    --cloud-light:#ffc3a0; --distant-cloud-light:#ffcbbb; --daylight:.45; --warmth:.94; --nightfall:0;
    --shadow-angle:-16deg; --shadow-length:1.50; --shadow-opacity:.24;
  }
  59% {
    --sky-top:#263a5e; --sky-middle:#626c8c; --sky-horizon:#a289a0;
    --cloud-light:#c3c8ee; --distant-cloud-light:#d0c5df; --daylight:.22; --warmth:.22; --nightfall:.32;
    --shadow-angle:-9deg; --shadow-length:1.60; --shadow-opacity:0;
  }
  70%, 94% {
    --sky-top:#0d1b30; --sky-middle:#263953; --sky-horizon:#4c5a73;
    --cloud-light:#819cc0; --distant-cloud-light:#92a7c4; --daylight:0; --warmth:0; --nightfall:1;
    --shadow-angle:-157deg; --shadow-length:1.34; --shadow-opacity:0;
  }
}
.cover-light-filters { position: absolute; pointer-events: none; }
.cloud-light-color { flood-color: var(--cloud-light); }
.distant-cloud-light-color { flood-color: var(--distant-cloud-light); }
.cover-stars {
  opacity: var(--nightfall);
  mask-image: linear-gradient(to bottom, #000 3%, #000 14%, #0008 30%, transparent 44%);
}
.cover-stars i {
  position: absolute;
  width: var(--star-size);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #f5ecdc;
  animation: star-twinkle var(--star-speed) ease-in-out var(--star-delay) infinite;
}
.cover-stars .star-bright { box-shadow: 0 0 6px 1px #d3e5ffc0; }
@keyframes star-twinkle {
  0%, 100% { opacity:.42; transform:scale(.85); }
  44% { opacity:.95; transform:scale(1.16); }
  71% { opacity:.55; transform:scale(.95); }
}
.cover-cloud {
  position: absolute;
  left: 0;
  width: var(--cloud-width);
  aspect-ratio: 3;
  background: url("wuhan-drifting-clouds.png") center / contain no-repeat;
  filter: contrast(var(--cloud-contrast, 1))
    brightness(calc(.54 + (.46 + var(--cloud-lift, 0)) * var(--daylight)))
    saturate(.76) var(--cloud-light-filter, url("#cloud-light"));
  animation-name: cloud-drift;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  animation-duration: var(--cloud-time);
  animation-delay: var(--cloud-delay);
}
.cloud-companion { animation-delay: calc(var(--cloud-delay) - .5 * var(--cloud-time)); }
.cover-cloud-near {
  --cloud-width: min(82cqw, clamp(300px, 53cqw, 1220px));
  top: 1%;
  opacity: calc(.32 + .45 * var(--daylight) + .10 * var(--warmth));
  --cloud-time: 121s;
  --cloud-delay: -72s;
}
.cover-cloud-far {
  --cloud-light-filter: url("#distant-cloud-light");
  --cloud-width: clamp(132px, 25cqw, 575px);
  top: 22%;
  opacity: calc(.20 + .34 * var(--daylight) + .06 * var(--warmth));
  --cloud-time: 154s;
  --cloud-delay: -59s;
}
.cover-cloud-banks {
  background-image: url("wuhan-cloud-banks.png");
  --cloud-contrast: .48;
  --cloud-lift: .18;
}
.cloud-layered {
  background-image: url("wuhan-cloud-layered.png");
  --cloud-contrast: .43;
  --cloud-lift: .24;
}
.cloud-low-bank {
  background-image: url("wuhan-cloud-low-bank.png");
  --cloud-contrast: .72;
  --cloud-lift: .22;
}
.cover-cloud-west {
  --cloud-width: clamp(205px, 38cqw, 850px);
  top: 11%;
  opacity: calc(.31 + .45 * var(--daylight) + .09 * var(--warmth));
  --cloud-time: 142s;
  --cloud-delay: -51s;
}
.cover-cloud-high {
  --cloud-width: min(88cqw, clamp(320px, 65cqw, 1400px));
  top: clamp(-140px, -8.8cqw, -34px);
  opacity: calc(.28 + .43 * var(--daylight));
  --cloud-time: 114s;
  --cloud-delay: -80s;
}
.cover-cloud-low {
  --cloud-light-filter: url("#distant-cloud-light");
  --cloud-width: clamp(95px, 17cqw, 380px);
  top: 29%;
  opacity: calc(.15 + .30 * var(--daylight));
  --cloud-time: 178s;
  --cloud-delay: -87s;
}
@keyframes cloud-drift {
  from { transform: translateX(calc(-1 * var(--cloud-width))); }
  to { transform: translateX(100cqw); }
}
.cover-cloud-top {
  --cloud-contrast: .88;
  --cloud-lift: .08;
  opacity: calc(.23 + .34 * var(--daylight) + .07 * var(--warmth));
  animation-name: top-cloud-drift;
}
.cloud-photo-bloom {
  background-image: url("wuhan-cloud-bloom.png");
  --cloud-time: 390s;
  --cloud-delay: -73s;
  --first-altitude: clamp(-156px, -9.5cqw, -28px);
  --second-altitude: clamp(-72px, -4.8cqw, -14px);
  --third-altitude: clamp(-208px, -12.8cqw, -38px);
}
.cloud-photo-stacks {
  background-image: url("wuhan-cloud-stacks.png");
  --cloud-time: 429s;
  --cloud-delay: -15s;
  --first-altitude: clamp(-74px, -5cqw, -16px);
  --second-altitude: clamp(-211px, -12.5cqw, -40px);
  --third-altitude: clamp(-123px, -8cqw, -24px);
}
/* Each pass keeps its width and height above the horizon until it leaves the viewport. */
@keyframes top-cloud-drift {
  0%, 33.333% { width: min(82cqw, 1590px); top: var(--first-altitude); }
  33.334%, 66.666% { width: min(73cqw, 1490px); top: var(--second-altitude); }
  66.667%, 100% { width: min(91cqw, 1710px); top: var(--third-altitude); }
  0%, 33.334%, 66.667% { transform: translateX(-100%); }
  33.333%, 66.666%, 100% { transform: translateX(100cqw); }
}
.sky-stream {
  position: absolute;
  left: 0;
  width: 100%;
  height: calc(var(--tile) / 3);
  pointer-events: none;
  filter: contrast(var(--stream-contrast, 1))
    brightness(calc(.42 + (.56 + var(--stream-lift, 0)) * var(--daylight)))
    saturate(.66) url("#distant-cloud-light");
}
.sky-stream::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(100% + var(--tile));
  background: var(--cloud-image) 0 center / var(--tile) auto repeat-x;
  animation: sky-stream-drift var(--drift-time) linear var(--drift-delay) infinite;
}
.sky-stream-mid {
  --tile: clamp(270px, 39cqw, 660px);
  --cloud-image: url("wuhan-cloud-veil.png");
  --stream-contrast: .84;
  --stream-lift: .10;
  --drift-time: 137s;
  --drift-delay: -43s;
  top: 24%;
  opacity: calc(.13 + .30 * var(--daylight) + .09 * var(--warmth));
}
.sky-stream-horizon {
  --tile: clamp(175px, 24cqw, 425px);
  --cloud-image: url("wuhan-cloud-horizon.png");
  --drift-time: 174s;
  --drift-delay: -117s;
  top: 37%;
  opacity: calc(.11 + .28 * var(--daylight) + .08 * var(--warmth));
}
@keyframes sky-stream-drift {
  from { transform: translateX(calc(-1 * var(--tile))); }
  to { transform: translateX(0); }
}
.river-stage {
  position: absolute;
  isolation: isolate;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: max(100cqw, 177.6833cqh);
  aspect-ratio: 1672 / 941;
}
.river-plate {
  /* Adjacent plates share a fade interval, so their eased weights add to one. */
  --rising: clamp(0, calc((var(--scene-time) - var(--start)) / (var(--peak) - var(--start))), 1);
  --falling: clamp(0, calc((var(--end) - var(--scene-time)) / (var(--end) - var(--hold, var(--peak)))), 1);
  --weight: min(var(--rising), var(--falling));
  width: 100%;
  height: 100%;
  mix-blend-mode: plus-lighter;
  opacity: calc(var(--weight) * var(--weight) * (3 - 2 * var(--weight)));
}
.river-dawn {
  --start: -1;
  --peak: 0;
  --end: 10;
  --return: clamp(0, calc((var(--scene-time) - 94) / 6), 1);
  --weight: max(min(var(--rising), var(--falling)), var(--return));
  filter: brightness(1.17) saturate(.91);
}
.river-morning { --start: 0; --peak: 10; --end: 24; }
.river-noon { --start: 10; --peak: 24; --end: 42; }
.river-afternoon { --start: 24; --peak: 42; --end: 51; }
.river-dusk { --start: 42; --peak: 51; --end: 59; }
.river-bluehour { --start: 51; --peak: 59; --end: 70; }
.river-night { --start: 59; --peak: 70; --hold: 94; --end: 100; }
.river-motion { display: none; width: 100%; height: 100%; }
.river-stage[data-renderer="webgl"] .river-motion { display: block; }
.river-stage[data-renderer="webgl"] .river-plate { visibility: hidden; }
.river-reflections {
  mix-blend-mode: screen;
  clip-path: polygon(0 76%, 10% 76%, 10% 73%, 46% 73%, 49% 71%, 84% 71%, 84% 73%,
    80% 76%, 74% 79%, 69% 82%, 63% 86%, 57% 89%, 50% 95%, 46% 100%, 0 100%);
}
.river-reflection {
  background:
    repeating-linear-gradient(176deg, transparent 0 4px, transparent 5px, color-mix(in oklab, var(--glint-color) 34%, transparent) 7px, transparent 10px),
    radial-gradient(ellipse at var(--glint-x) 82%, var(--glint-color), transparent 50%);
  mask-image: radial-gradient(ellipse var(--glint-width) 23% at var(--glint-x) 82%, #000c 0%, #0005 46%, transparent 100%);
}
.sunlight {
  --glint-x: calc(50% - 9cqw - 33cqw * var(--direction));
  --glint-width: calc(4% + 3% * var(--daylight));
  --glint-color: color-mix(in oklab, var(--cloud-light) 52%, transparent);
  opacity: calc(.39 * max(var(--warmth), var(--daylight) * .72));
}
.moonlight {
  --glint-x: calc(50% + 10cqw + 30cqw * var(--direction));
  --glint-width: 4.2%;
  --glint-color: color-mix(in oklab, var(--distant-cloud-light) 49%, transparent);
  opacity: calc(.25 * var(--nightfall));
}
.river-promenade-light {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  --lamp-light: clamp(0, calc(var(--nightfall) * 1.25), 1);
}
.tree-shadows { fill: #2a3d52; opacity: var(--shadow-opacity); }
.tree-shadow {
  transform: rotate(var(--shadow-angle)) scaleX(var(--shadow-length));
  filter: url("#tree-penumbra");
}
.lamp-lens { fill: color-mix(in oklab, #a39a85, #fff9dc calc(var(--lamp-light) * 100%)); }
.lamp-halo { opacity: var(--lamp-light); }
.lamp-pool { opacity: calc(var(--lamp-light) * var(--lamp-pool-strength, .88)); }
.ground-light-offscreen { --lamp-pool-strength: .4; }
.reed-bank {
  position: absolute;
  inset: 0;
  pointer-events: none;
  filter: brightness(calc(.49 + .47 * var(--daylight) + .12 * var(--warmth)))
    saturate(calc(.79 + .11 * var(--daylight)));
}
.reed {
  position: absolute;
  width: var(--reed-width);
  height: auto;
  margin-left: calc(-.5 * var(--reed-width));
  transform-origin: 50% 99%;
  animation: reed-gust 7.2s ease-in-out var(--reed-delay) infinite;
}
.reed-front { --reed-width: 7.1%; --reed-delay: -.6s; --rest: -3deg; left: 52.6%; bottom: .2%; }
.reed-middle { --reed-width: 6.3%; --reed-delay: -.94s; --rest: 3deg; left: 60.4%; bottom: 5.2%; }
.reed-back { --reed-width: 5.3%; --reed-delay: -1.18s; --rest: -2deg; left: 67.6%; bottom: 10.2%; }
.reed-far { --reed-width: 3.9%; --reed-delay: -1.38s; --rest: 4deg; left: 74.8%; bottom: 15.4%; }
@keyframes reed-gust {
  0%, 100% { transform: rotate(var(--rest)); }
  20% { transform: rotate(calc(var(--rest) + 5deg)) skewX(-.8deg); }
  43% { transform: rotate(calc(var(--rest) + 12deg)) skewX(-2.8deg); }
  62% { transform: rotate(calc(var(--rest) + 4deg)) skewX(-.6deg); }
  79% { transform: rotate(calc(var(--rest) + 7deg)) skewX(-1.5deg); }
}
.auth::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(ellipse at 8% 16%, #0c29427d, #142f4720 35%, #0a1d3200 60%),
    linear-gradient(0deg, #0a1d322c, transparent 16%);
}
.cover-copy {
  align-self: start;
  min-width: 0;
  padding-top: clamp(20px, 8vh, 104px);
  text-shadow: 0 2px 17px #102438bf;
}
.cover-company { display: flex; align-items: center; gap: .45em; margin: 0 0 19px; color: #fff9ee; font-size: clamp(19px, 2.1vw, 34px); font-weight: 650; letter-spacing: .045em; }
.cover-mark { display: block; width: clamp(35px, 1.65em, 60px); height: auto; flex: none; filter: drop-shadow(0 2px 4px #10243870); }
.cover-copy h1 { font-size: clamp(28px, 3.75vw, 58px); line-height: 1.18; letter-spacing: -.035em; margin: 0 0 20px; }
.cover-scope { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; color: #fff2da; font-size: 13px; }
.cover-scope span { width: 4px; height: 4px; border-radius: 50%; background: #f2ca94; }
.auth[data-motion="paused"] .cover-scene,
.auth[data-motion="paused"] .cover-cloud,
.auth[data-motion="paused"] .sky-stream::before,
.auth[data-motion="paused"] .cover-stars i,
.auth[data-motion="paused"] .reed { animation-play-state: paused; }
.auth:not([data-scene="ready"]) .cover-scene { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .auth:not([data-motion="playing"]) .cover-scene { animation: none; }
}

.auth-content {
  color: var(--ink);
  background: #fbfcf5f7;
  padding: clamp(24px, 3.6vw, 51px);
  border: 1px solid #f9fff8c4;
  border-radius: 22px;
  min-width: 0;
  box-shadow: 0 20px 65px #0923384a;
}
.auth-panel { width: min(100%, 380px); }
.auth-panel h2 { font-size: clamp(25px, 3vw, 36px); letter-spacing: -.04em; }
.auth-panel .intro { margin-top: 9px; margin-bottom: 28px; }
.auth-panel form { gap: 17px; }
.auth-panel input, .auth-panel .primary { min-height: 46px; }
.auth-panel button.primary { background: #1d596d; border-color: #1d596d; }
.auth-panel [data-logout] { margin-top: 14px; }
.auth-panel form label, .account-form label { display: grid; gap: 7px; font-size: 13px; font-weight: 620; }
.form-error { color: #a2372a; margin: 0; font-size: 14px; }
.form-error:empty { display: none; }

.layout {
  --ink: #24383a;
  --muted: #56686a;
  --green: #275e58;
  --line: #dfe4dd;
  --paper: #fffefa;
  --radius: 10px;
  color: var(--ink);
  display: grid;
  grid-template-columns: clamp(160px, 14vw, 218px) minmax(0, 1fr);
  min-height: calc(100vh - 70px);
  background:
    radial-gradient(ellipse at 100% 0%, #e0ebe7, transparent 60%),
    repeating-linear-gradient(0deg, #1b383004 0 1px, transparent 1px 5px),
    #f4f2ea;
}
.sidebar { padding: 31px 14px; border-right: 1px solid var(--line); background: #faF9f1b3; }
.sidebar nav { display: grid; gap: 4px; }
.sidebar nav a { padding: 10px 13px; border-inline-start: 2px solid transparent; color: var(--muted); text-decoration: none; border-radius: 4px; font-size: 14px; white-space: nowrap; }
.sidebar nav a:hover { background: #e9eeea; color: var(--green); }
.sidebar nav a[aria-current] { border-color: #4b8176; background: #e4ece5; color: #244d46; font-weight: 700; }
.main { width: 100%; max-width: 1520px; margin-inline: auto; padding: clamp(20px, 3vw, 45px); min-width: 0; }
.page-heading, .section-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px 16px; }
.page-heading { margin-bottom: 22px; }
.page-heading h1 { font-size: clamp(25px, 2.75vw, 39px); letter-spacing: -.025em; margin-bottom: 5px; }
.page-heading .intro { margin: 0; }
.section-head { margin-bottom: 13px; }
.section-head h2 { font-size: 16px; letter-spacing: .01em; }
.section-head a { font-size: 13px; white-space: nowrap; }
.section-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.action-button, .row-button {
  padding: 6px 10px;
  min-height: 30px;
  border: 1px solid #c9d8ce;
  border-radius: 5px;
  background: #f2f6ef;
  color: #28584e;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.25;
  white-space: nowrap;
}
.row-button, td .action-button { padding: 4px 8px; min-height: 26px; background: transparent; }
.record-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 8px; }
.record-meta p { margin: 0; }
.overview-hero {
  margin-bottom: 18px;
  padding: clamp(22px, 3vw, 34px) clamp(24px, 4vw, 48px);
  border-radius: var(--radius);
  background:
    linear-gradient(95deg, #203b42 8%, #203b42 28%, #294b52de 49%, #1c354961 100%),
    url("wuhan-riverfront-noon.png") right 58% / min(100%, 880px) auto no-repeat,
    #46646d;
  color: #fbfaf3;
}
.overview-hero .page-heading { margin: 0; }
.overview-hero .intro { color: #e2ebe5; }
.overview-charts {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 16px;
  --chart-invoice: #356a83;
  --chart-receipt: #258572;
  --chart-expense: #b3793f;
  --chart-active: #258572;
  --chart-archive: #b3793f;
  --chart-complete: #356a83;
  --chart-other: #788583;
}
.overview-charts .panel { margin-bottom: 0; min-width: 0; }
.overview-chart .section-head { align-items: start; }
.chart-note { color: var(--muted); font-size: 12px; margin: 4px 0 0; }
.chart-swatch { display: inline-block; width: 9px; height: 9px; border-radius: 2px; background: var(--series-color); flex: none; }
.chart-invoice { --series-color: var(--chart-invoice); }
.chart-receipt { --series-color: var(--chart-receipt); }
.chart-expense { --series-color: var(--chart-expense); }
.chart-active { --series-color: var(--chart-active); }
.chart-archive { --series-color: var(--chart-archive); }
.chart-complete { --series-color: var(--chart-complete); }
.chart-other { --series-color: var(--chart-other); }
.cash-legend { display: flex; gap: 8px 16px; flex-wrap: wrap; margin: 0 0 14px; color: var(--muted); font-size: 12px; }
.cash-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cash-plot {
  --plot-height: 138px;
  --month-label-height: 32px;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 9px;
  padding-top: 5px;
}
.cash-axis { display: flex; flex-direction: column; justify-content: space-between; align-items: end; height: calc(var(--plot-height) + 12px); margin-top: -6px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.cash-plot-empty .cash-axis { justify-content: end; }
.cash-groups { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); position: relative; isolation: isolate; }
.cash-groups::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 0 var(--month-label-height);
  border-bottom: 1px solid #a7b9b2;
  background: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 25%);
}
.cash-month {
  display: grid;
  grid-template-rows: var(--plot-height) var(--month-label-height);
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  min-width: 0;
  overflow: visible;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.cash-month:hover { background: #e5efe78c; }
.cash-month[aria-pressed="true"] { background: #e8f1ee94; color: var(--green); }
.cash-month[aria-pressed="true"] .cash-month-name { font-weight: 700; }
.cash-bars { display: flex; align-items: end; justify-content: center; gap: clamp(2px,.45vw,5px); height: 100%; }
.cash-bar { width: min(19%, 16px); background: var(--series-color); border-radius: 3px 3px 0 0; }
.cash-month-label { display: flex; flex-direction: column; align-items: center; justify-content: start; padding-top: 4px; line-height: 1.08; }
.cash-month-label small { font-size: 10px; padding-top: 2px; color: var(--muted); }
.cash-empty-note { position: absolute; inset: 31% 0 auto; margin: 0; text-align: center; color: var(--muted); font-size: 13px; pointer-events: none; }
.cash-selection { display: flex; align-items: baseline; gap: 6px 16px; flex-wrap: wrap; margin-top: 9px; border-top: 1px solid var(--line); padding-top: 10px; font-size: 12px; color: var(--muted); }
.cash-selection :is(strong,b) { color: var(--ink); font-variant-numeric: tabular-nums; }
.cash-selection b { margin-left: 5px; overflow-wrap: anywhere; }
.status-chart { display: flex; flex-direction: column; }
.status-summary { display: flex; flex: 1; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px 22px; padding-block: 12px; }
.status-ring {
  --ring-0: 0%;
  --ring-1: 0%;
  --ring-2: 0%;
  display: grid;
  place-items: center;
  width: clamp(112px,12vw,156px);
  aspect-ratio: 1;
  flex: none;
  border-radius: 50%;
  background: conic-gradient(var(--chart-active) 0 var(--ring-0), var(--chart-archive) var(--ring-0) var(--ring-1),
    var(--chart-complete) var(--ring-1) var(--ring-2), var(--chart-other) var(--ring-2) 100%);
}
.status-ring[data-ring-stops=""] { background: #dfe7e1; }
.status-ring > div { display: grid; place-content: center; width: 76%; aspect-ratio: 1; border-radius: 50%; text-align: center; background: var(--paper); }
.status-ring strong { font-size: clamp(22px,2.25vw,34px); line-height: 1.05; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.status-ring span { margin-top: 6px; color: var(--muted); font-size: 12px; }
.status-legend { flex: 0 1 160px; margin: 0; padding: 0; list-style: none; font-size: 13px; }
.status-legend li { display: grid; grid-template-columns: 9px 1fr min-content minmax(34px,max-content); align-items: center; gap: 7px; padding: 8px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; white-space: nowrap; }
.status-legend li:last-child { border-bottom: 0; }
.status-legend small { color: var(--muted); text-align: right; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.overview-grid > .panel { margin-bottom: 0; }
.overview-grid + .panel { margin-top: 16px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.metric, .panel { border: 1px solid var(--line); background: var(--paper); border-radius: var(--radius); }
.metric { padding: 15px 17px; background: linear-gradient(150deg, #fffefa 37%, #f2f6ee); border-top: 2px solid #9eb9ad; }
.metric span { display: block; font-size: 13px; color: var(--muted); }
.metric strong { display: block; margin-top: 8px; font-size: clamp(17px, 2vw, 28px); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; letter-spacing: -.035em; }
.panel { padding: 16px 18px; margin-bottom: 14px; box-shadow: 0 2px 4px #16353308; }
.entry { padding: 12px 0; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.entry p { margin: 4px 0 0; }
.tag { display: inline-block; color: #31594d; background: #edf2e8; padding: 4px 7px; border-radius: 4px; font-size: 12px; white-space: nowrap; }
.tag.attention { color: #754813; background: #fff1da; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 5px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
th, td { padding: 10px; border-bottom: 1px solid var(--line); text-align: center; vertical-align: middle; }
th { color: #465e5a; background: #ecf0e9; font-size: 12px; white-space: nowrap; }
td { overflow-wrap: anywhere; }
tbody tr:nth-child(even) { background: #f8f8f2; }
tbody tr:hover { background: #eef4ec; }
th.amount, td.amount { white-space: nowrap; }
tr:last-child > td { border-bottom: 0; }
.income-detail-button { min-inline-size: 44px; }
tbody > tr.income-detail { background: #f1f5ef; }
.income-detail > td { padding: 13px 16px 16px; }
.income-detail-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(255px,100%),1fr)); gap: 14px 18px; text-align: start; }
.income-detail-grid section { min-width: 0; }
.income-detail-grid h3 { margin: 0 0 7px; }
.income-detail-grid p { margin: 0; }
.income-detail-grid .table-wrap { background: var(--paper); }
.empty-state { margin: 0; background: #f7f7f0; border: 1px dashed #d8ded4; border-radius: 5px; padding: 14px; color: var(--muted); font-size: 13px; }
.project-table td:first-child { min-width: 164px; }
td .section-actions { justify-content: center; }
.contract-file-links { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 5px 12px; }
.contract-file-link { max-width: 100%; overflow-wrap: anywhere; }
.contract-file-download { flex: 0 0 auto; color: var(--muted); }
.document-preview { padding: clamp(12px,4vw,48px); }
.document-preview-sheet { max-width: 920px; margin: 0 auto; padding: clamp(18px,4vw,44px); }
.document-preview-sheet header { display: flex; align-items: start; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.document-preview-sheet h1 { flex: 1 1 460px; font-size: clamp(18px,2.5vw,25px); letter-spacing: normal; margin: 0; overflow-wrap: anywhere; }
.document-preview-sheet .action-button { text-decoration: none; }
.document-preview-text { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 17px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.85; }
.gantt-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 10px; font-size: 13px; }
.gantt-legend i { display: inline-block; width: 7px; height: 7px; margin: 0 7px 1px 2px; background: #aa642c; transform: rotate(45deg); }
.gantt-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 7px; }
.gantt { min-width: 700px; }
.gantt-axis, .gantt-row { display: grid; grid-template-columns: 238px minmax(0,1fr); align-items: stretch; }
.gantt-axis { background: #edf2ed; font-size: 13px; padding: 10px 17px; color: var(--muted); }
.gantt-ticks { position: relative; min-height: 18px; font-variant-numeric: tabular-nums; }
.gantt-ticks time { position: absolute; white-space: nowrap; transform: translateX(-50%); }
.gantt-ticks time:first-child { transform: none; }
.gantt-ticks time:last-child { transform: translateX(-100%); }
.gantt-rows { list-style: none; margin: 0; padding: 0; }
.gantt-row { padding: 0 17px; border-top: 1px solid var(--line); }
.gantt-row:nth-child(even) { background: #f8f9f3; }
.gantt-project { padding: 9px 12px 9px 0; overflow-wrap: anywhere; font-size: 13px; }
.gantt-project .row-button { font-size: inherit; }
.gantt-dates { display: grid; gap: 2px; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
.gantt-track { position: relative; min-height: 52px; border-inline: 1px solid var(--line); background: repeating-linear-gradient(to right, transparent 0 calc(25% - 1px), var(--line) calc(25% - 1px) 25%); }
.gantt-bar { position: absolute; top: 50%; transform: translateY(-50%); height: 13px; min-width: 3px; border-radius: 4px; background: #769086; }
.gantt-active { background: #387869; }
.gantt-archive { background: #ab773c; }
.gantt-done { background: #587684; }
.gantt-today { position: absolute; top: 0; bottom: 0; border-left: 1px dashed #58646a; }
.gantt-milestone { position: absolute; top: 50%; width: 8px; height: 8px; background: #aa642c; outline: 1px solid var(--paper); transform: translate(-50%,-50%) rotate(45deg); }
.gantt-late, .gantt-legend i.gantt-late { background: #b4443d; }
.deadline-late { color: #a0322d; font-weight: 650; }
#project-detail { scroll-margin-top: 74px; }
.project-detail-heading { display: flex; justify-content: space-between; align-items: start; flex-wrap: wrap; gap: 10px 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.project-detail-heading > div:first-child { display: flex; flex: 1 1 250px; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
.project-detail-heading h2 { overflow-wrap: anywhere; }
.project-detail-nav { display: inline-flex; gap: 3px; flex-wrap: wrap; padding: 3px; margin: 12px 0 15px; background: #edf2ec; border: 1px solid var(--line); border-radius: 7px; }
.project-detail-nav button { padding: 6px 10px; border-color: transparent; border-radius: 4px; background: transparent; font-size: 13px; }
.project-detail-nav button[aria-pressed="true"] { background: var(--paper); border-color: #b9cec4; color: #234e44; font-weight: 650; }
.project-detail-label { margin: 12px 0 15px; }
.project-flow { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0,1fr); gap: 12px; list-style: none; margin: 0; padding: 4px 0 0; font-size: 14px; line-height: 1.45; }
.flow-step { --flow-accent: #b3c3ba; --flow-background: #f7f8f3; --flow-border: var(--line); position: relative; display: flex; border-top: 2px solid var(--flow-accent); padding-top: 13px; }
.flow-step::before { content: ''; position: absolute; top: -6px; left: 11px; width: 10px; height: 10px; border-radius: 50%; background: var(--flow-accent); box-shadow: 0 0 0 3px var(--paper); }
.flow-card { display: flex; flex: 1; flex-direction: column; gap: 8px; min-width: 0; padding: 11px 12px; background: var(--flow-background); border: 1px solid var(--flow-border); border-radius: 7px; overflow-wrap: anywhere; }
.flow-heading { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 6px; align-items: baseline; }
.flow-heading strong { font-weight: 700; }
.flow-content { display: grid; gap: 4px; }
.flow-date { color: var(--muted); font-variant-numeric: tabular-nums; }
.flow-state { padding: 1px 6px; border-radius: 4px; font-weight: 650; background: #cfe6e9; color: #21545d; }
.flow-done { --flow-accent: #709786; --flow-background: #f1f6f0; }
.flow-current { --flow-accent: #397881; --flow-background: #e6f2f3; --flow-border: #8cbbc0; }
.flow-late { --flow-accent: #b4443d; --flow-background: #fff0ed; --flow-border: #dfa59e; }
.flow-late .flow-date, .flow-late .flow-heading strong { color: #9b332f; }
.flow-late .flow-state { background: #f5d6d2; color: #8d2d28; }
.flow-planned::before { background: var(--paper); border: 2px solid #7e9a8e; }
.flow-step:not(:last-child)::after { content: '›'; position: absolute; right: -10px; top: -12px; color: #638475; }
.delete-record-name { overflow-wrap: anywhere; }
button.danger-button { background: #9c4035; border-color: #9c4035; color: white; font-weight: 600; }
.contract-list { display: grid; gap: 10px; }
.contract-list:empty { display: none; }
.contract-name-editor { padding: 12px 14px; border: 1px solid var(--line); border-radius: 7px; background: #f6f8f2; }
.contract-source, .contract-filename { overflow-wrap: anywhere; }
.contract-recognition, .contract-filename { font-size: 12px; margin: 6px 0; }
.contract-filename { margin: 10px 0 0; }
.contract-filename output { color: var(--ink); font-weight: 600; }

form { display: grid; gap: 12px; margin-top: 14px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fields label { display: grid; gap: 6px; font-size: 13px; }
form[data-account="create"] .fields { align-items: start; }
.field-hint { color: var(--muted); font-size: 12px; }
.account-role-preview { padding: 12px 14px; border: 1px solid #d7e2da; border-radius: 6px; background: #f0f5ef; }
.account-role-head { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.account-role-head .tag { color: #2c5a4c; background: #e0ece3; font-size: 11px; }
.account-role-preview p { margin: 6px 0 9px; color: var(--muted); font-size: 13px; }
.account-role-sections { display: flex; flex-wrap: wrap; gap: 5px; padding: 0; margin: 0; list-style: none; }
.account-role-sections li { padding: 3px 7px; border: 1px solid #d7e2da; border-radius: 4px; color: #304f47; background: #fffefa; font-size: 12px; }
.wide { grid-column: 1/-1; }
button, select, input, textarea { font: inherit; border: 1px solid #cddcda; background: white; color: inherit; border-radius: 9px; padding: 8px 11px; min-width: 0; }
textarea { resize: vertical; }
button { cursor: pointer; }
button.primary { color: white; background: var(--green); border-color: var(--green); font-weight: 600; }
button:hover:not(:disabled) { filter: brightness(.94); }
button:disabled { opacity: .55; cursor: wait; }
:focus-visible { outline: 3px solid #268f82; outline-offset: 2px; }
.account-form { margin: 0; }
details.panel { padding-block: 11px; }
details.panel > summary { cursor: pointer; font-weight: 650; line-height: 1.5; }
details.panel[open] > summary { margin-bottom: 12px; }
.entry-dialog { width: min(600px, calc(100% - 26px)); max-height: calc(100dvh - 32px); padding: clamp(17px, 3vw, 26px); border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--paper); box-shadow: 0 15px 55px #10292638; }
.entry-dialog::backdrop { background: #142b36a0; }
.dialog-heading { display: flex; justify-content: space-between; align-items: start; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.dialog-heading h2 { overflow-wrap: anywhere; }
.dialog-foot { display: flex; justify-content: end; flex-wrap: wrap; gap: 9px; padding-top: 7px; }
.review-opt-in { border-top: 1px solid var(--line); padding: 12px 0 0; }
.review-opt-in input { vertical-align: middle; margin-right: 5px; }
#issued-credential dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; }
#issued-credential dd { margin: 0; overflow-wrap: anywhere; }
#issued-credential code { font-size: 16px; }
#notice:not(:empty) { position: fixed; bottom: 18px; right: 18px; max-width: calc(100% - 36px); padding: 12px 16px; background: var(--dark); color: #fff; border-radius: 10px; box-shadow: 0 4px 20px #18342f30; }

@media (max-width: 960px) {
  .project-flow { grid-auto-flow: row; grid-template-columns: 1fr; gap: 8px; }
  .flow-step { border: 0; border-left: 2px solid var(--flow-accent); padding: 0 0 0 14px; }
  .flow-step::before { top: 14px; left: -6px; }
  .flow-step:not(:last-child)::after { content: none; }
  .layout { grid-template-columns: 160px minmax(0, 1fr); }
  .overview-grid { grid-template-columns: 1fr; }
  .overview-charts { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth { padding-inline: clamp(18px, 5vw, 48px); }
}
@media (max-width: 720px) {
  .layout { display: block; }
  .sidebar { padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar nav { display: flex; overflow: auto; }
  .sidebar nav a { padding: 8px 10px; }
  .auth { grid-template-columns: minmax(0, 1fr); align-content: start; gap: 24px; padding: 26px 20px 32px; }
  .cover-copy { padding-top: 0; }
  .cover-company { margin-bottom: 11px; font-size: clamp(16px, 4.4vw, 25px); }
  .cover-copy h1 { font-size: clamp(25px, 6.2vw, 40px); margin-bottom: 13px; }
  .auth-content { width: min(100%, 405px); justify-self: end; padding: 23px; }
}
@media (max-width: 460px) {
  .top { min-height: 67px; gap: 8px; padding: 10px 13px; }
  .brand { gap: 8px; }
  .brand strong { font-size: 14px; }
  .brand small { font-size: 9px; }
  .identity span { display: none; }
  .brand-mark { width: 37px; flex-basis: 37px; }
  .fields { grid-template-columns: 1fr; }
  .panel { padding: 14px; }
  .entry { align-items: flex-start; }

}
