:root {
  color-scheme: light;
  --paper: #f5f5ef;
  --surface: #fffef9;
  --text: #192f29;
  --muted: #5f7068;
  --line: #d7ddd1;
  --accent: #1b5c46;
  --dark: #173d36;
  --lime: #d9ef96;
  font: 16px/1.55 "Inter", "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
  color: var(--text);
  background: var(--paper);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a, button, input, select, summary { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible { outline: 3px solid #739d34; outline-offset: 3px; }
button, summary, select { cursor: pointer; }
button { border: 0; }
button:disabled { cursor: default; opacity: .45; }
h1,h2,h3,p,dl,dd { margin: 0; }
h1 { font-size: clamp(1.8rem, 3.7vw, 2.75rem); line-height: 1.22; letter-spacing: -.045em; overflow-wrap: anywhere; }
h2 { font-size: 1.12rem; letter-spacing: -.025em; }
h3 { font-size: 1rem; }
small, .muted, .hint, time { color: var(--muted); }
small, time { font-size: .8rem; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: fixed; z-index: 100; top: 5px; left: 5px; background: white; padding: 10px; }
.shell { min-height: 100vh; display: grid; grid-template-columns: clamp(210px, 18vw, 270px) minmax(0, 1fr); }
.navigation { background: var(--dark); color: #f5faea; padding: 34px 18px 16px; align-self: start; height: 100vh; height: 100dvh; position: sticky; top: 0; display: flex; flex-direction: column; z-index: 5; overflow-y: auto; }
.brand, .login-brand { display: flex; align-items: center; gap: 12px; font-weight: 750; font-size: 1.08rem; letter-spacing: .02em; }
.brand { color: inherit; text-decoration: none; padding: 0 9px; }
.brand-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--lime); flex: none; }
.brand-mark::before { content: ""; width: 21px; height: 21px; border: 4px solid var(--dark); border-radius: 50%; background: radial-gradient(circle, var(--dark) 0 28%, transparent 33%); }
.desktop-nav { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.nav-links { margin-top: 42px; display: grid; gap: 5px; }
.nav-links a { color: #d5e3d9; display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 8px; text-decoration: none; font-size: .93rem; }
.nav-links i { font-style: normal; font-size: 1.18rem; width: 22px; text-align: center; font-family: system-ui, sans-serif; line-height: 1; }
.nav-links a:hover, .quiet:hover { background: #285448; }
.nav-links a[aria-current] { background: #d9ef96; color: var(--dark); font-weight: 700; }
.nav-divider { border-top: 1px solid #365c50; margin: 15px 9px; }
.identity { margin-top: auto; border-top: 1px solid #365c50; display: flex; gap: 10px; align-items: center; padding: 20px 2px 0; }
.identity strong, .identity small, .user-name small { display: block; overflow-wrap: anywhere; }
.identity small { color: #b7cabc; }
.identity form { margin-left: auto; }
.quiet { background: transparent; color: #d5e3d9; padding: 7px; border-radius: 6px; white-space: nowrap; }
.avatar { display: grid; place-items: center; background: #dfe8d0; color: #305142; font-weight: 700; width: 36px; height: 36px; border-radius: 50%; flex: none; }
.mobile-nav { display: none; }
.workspace { padding: clamp(25px, 4.5vw, 65px); max-width: 1500px; width: 100%; margin-inline: auto; }
.page-head, .section-head, .actions, .inline { display: flex; align-items: center; gap: 12px; }
.page-head, .section-head { justify-content: space-between; }
.page-head { margin-bottom: 28px; }
.page-head > :first-child, .section-head > :first-child { min-width: 0; }
.page-head .btn { flex-shrink: 0; }
.dateline { color: var(--muted); font-size: .8rem; margin-bottom: 6px; letter-spacing: .045em; }
.btn, .button { display: inline-flex; justify-content: center; align-items: center; gap: 4px; border-radius: 8px; padding: 10px 17px; font-weight: 650; min-height: 44px; font-size: .9rem; line-height: 1.3; text-decoration: none; border: 1px solid transparent; background: #e4ecdf; color: var(--text); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #174d3d; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: #bac8b9; }
.btn-secondary:hover { background: #eff4e9; }
.btn-danger { color: #8e302b; background: #fff1e9; border-color: #ebc1b8; }
.text-link, .back { text-decoration: none; color: var(--accent); font-size: .86rem; font-weight: 650; }
.text-link { background: transparent; padding: 7px 0; }
.text-link:hover, .back:hover { text-decoration: underline; }
.back { display: inline-block; margin-bottom: 18px; }
.panel,.metric { border: 1px solid var(--line); background: var(--surface); border-radius: 15px; min-width: 0; }
.panel { padding: clamp(17px, 2.4vw, 30px); overflow-wrap: anywhere; }
.stack { display: grid; gap: 17px; align-content: start; min-width: 0; }
.stack > * { min-width: 0; }
.hint { font-size: .88rem; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 24px; }
.metric { padding: clamp(16px, 2vw, 26px); text-decoration: none; color: var(--text); }
.metric:hover { border-color: #98b39a; }
.metric small { display: flex; align-items: center; gap: 7px; font-size: .86rem; }
.metric strong { font-size: clamp(1.8rem, 3.3vw, 2.8rem); display: block; margin-top: 12px; letter-spacing: -.06em; line-height: 1; font-weight: 620; font-variant-numeric: tabular-nums; }
.metric[aria-current] { background: #e1ecc7; border-color: #c6d8ac; }
.metric[aria-current] small { color: #3e5b39; }
.dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; }
.amber { background: #b07a27; }.blue { background: #4d7e91; }.green { background: #528065; }
label, .field { display: grid; gap: 6px; font-size: .88rem; font-weight: 600; min-width: 0; }
input:not([type=checkbox]),select,textarea { border: 1px solid #bac8b9; border-radius: 7px; background: #fff; min-height: 44px; padding: 9px 11px; width: 100%; min-width: 0; font-weight: 400; font-size: 1rem; }
input::placeholder, textarea::placeholder { color: #667569; }
textarea { resize: vertical; }
.check { display: flex; gap: 8px; align-items: center; color: #73531a; font-size: .85rem; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.filter-bar { margin: 18px 0 8px; display: grid; align-items: end; grid-template-columns: minmax(150px,1fr) auto auto auto; gap: 8px; }
.order-card { color: inherit; display: grid; grid-template-columns: minmax(130px,1fr) 90px minmax(85px, .55fr) 15px; align-items: center; gap: 14px; padding: 17px 4px; border-bottom: 1px solid #e3e7dc; text-decoration: none; }
.order-card:hover { background: #f5f8ee; }
.order-card:last-child { border-bottom: none; }
.order-person,.order-amount { display: grid; gap: 3px; min-width: 0; overflow-wrap: anywhere; }
.order-person strong { font-size: 1.04rem; }.order-amount { text-align: end; }
.order-amount strong, .sum, .finance { font-variant-numeric: tabular-nums; }
.mono { font-family: "IBM Plex Mono", Consolas, monospace; font-size: .8rem; overflow-wrap: anywhere; }
.chevron { font-size: 1.5rem; color: #819084; text-align: right; }
.badge { display: inline-block; padding: 3px 9px; font-size: .76rem; border-radius: 6px; color: #4e5f51; background: #e9eee6; font-weight: 650; white-space: nowrap; }
.warm { background: #f6ead1; color: #785919; }.cool { background: #deedf1; color: #335d6b; }.positive { background: #dfebd8; color: #3a633f; }
.empty { min-height: 130px; display: grid; gap: 7px; align-content: center; justify-items: center; color: var(--muted); }
.pager { margin-top: 15px; display: flex; align-items: center; justify-content: center; gap: 14px; font-size: .88rem; }
.detail-grid { display: grid; align-items: start; grid-template-columns: minmax(0,1.5fr) minmax(240px,1fr); gap: 16px; }
.detail-jump { display: none; }.order-workspace section { scroll-margin-top: 12px; }
.facts div,.line-items > div,.sum { display: flex; justify-content: space-between; gap: 14px; align-items: baseline; }
.facts div { padding: 6px 0; }.facts dt,.line-header { color: var(--muted); font-size: .84rem; }.facts dt { flex: none; }.facts dd { text-align: right; }
.pre-line { white-space: pre-line; }
.line-items > div { display: grid; grid-template-columns: 1fr auto minmax(65px,.5fr); padding: 8px 0; border-bottom: 1px solid var(--line); }
.line-items span:last-child { text-align: right; }
.stage-actions { display: grid; gap: 10px; justify-items: start; }
.stage-actions .btn { justify-self: start; }
.sum { border-top: 1px solid var(--line); padding-top: 12px; font-weight: 650; }
.sum output { font-weight: 700; font-size: 1.18rem; }
.finance .sum { margin-top: 6px; padding-top: 14px; }
.finance .sum dd { font-size: 1.25rem; font-weight: 700; }
.disclosure summary,.mobile-nav summary { cursor: pointer; font-weight: 650; color: var(--accent); }
.disclosure summary { padding: 6px 0; }
.disclosure form { margin-top: 12px; }
.timeline { list-style: none; padding: 0; margin: 12px 0 0; }
.timeline li { border-left: 2px solid #dbe3d2; padding: 0 0 16px 15px; position: relative; font-size: .88rem; }
.timeline li::before { content: ""; position: absolute; width: 8px; height: 8px; top: 6px; left: -5px; border-radius: 50%; background: #789a73; }
.timeline li:last-child { padding-bottom: 0; }
.timeline p,.audit-event p { margin-top: 5px; white-space: pre-line; font-size: .88rem; color: var(--muted); }
.order-editor { max-width: 850px; }
.line-editor { display: grid; grid-template-columns: 1.5fr .8fr 1fr auto; gap: 12px; align-items: end; }
.line-editor .remove { margin-bottom: 6px; }
.form-end { display: flex; justify-content: flex-end; }
.narrow { max-width: 600px; }
.user-name { display: flex; align-items: center; gap: 10px; }.user-name small { display: block; }
.member,.audit-event { border-top: 1px solid var(--line); padding-top: 15px; }.member details { margin-top: 7px; }
.audit-list { display: grid; gap: 14px; }.audit-event time { white-space: nowrap; }.event-action { margin-left: 8px; font-size: .9rem; }
.audit-filters { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; align-items: end; }
.auth-workspace { min-height: 100vh; min-height: 100dvh; display: grid; align-content: center; justify-items: center; gap: 12px; padding: 22px; background: radial-gradient(ellipse at 15% 0%, #dce9bd, transparent 60%), var(--paper); }
.login-card { background: var(--surface); width: min(410px,100%); padding: clamp(25px,5vw,42px); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 15px 70px #23402b0c; }
.login-brand { color: var(--accent); margin-bottom: 30px; }
.login-card h1 { font-size: 1.75rem; margin-bottom: 24px; }.login-card form .btn { margin-top: 4px; }
.notices { display: grid; gap: 8px; }.notice { padding: 12px 16px; margin-bottom: 14px; border-radius: 8px; color: #284d32; background: #e0edd8; border: 1px solid #c6d9b9; overflow-wrap: anywhere; }
.notice.error,.notice.warning { background: #fff0df; color: #793d14; border-color: #ebcaa8; }.notice form { margin-top: 8px; }
.media-list { padding: 0; list-style: none; display: grid; gap: 8px; }.media-item { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; overflow-wrap: anywhere; padding-block: 8px; border-bottom: 1px solid var(--line); }
.media-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; background: #edf1ea; }
.upload-status { overflow-wrap: anywhere; font-size: .86rem; }.upload-status progress { max-width: 100%; accent-color: var(--accent); }
#upload-form { margin-block: 16px; }.media-list h3 { margin-top: 10px; }
@media(max-width: 1050px) {
  .shell { grid-template-columns: 204px minmax(0,1fr); }.workspace { padding: 28px 24px; }
  .detail-grid { grid-template-columns: minmax(0,1.2fr) minmax(220px,1fr); }.filter-bar { grid-template-columns: repeat(3,minmax(0,1fr)); }.filter-bar .search { grid-column: 1/-1; }
}
@media(max-width: 800px) {
  .shell { display: block; }.desktop-nav { display: none; }
  .navigation { height: auto; overflow: visible; position: relative; flex-direction: row; justify-content: space-between; align-items: center; padding: 12px 18px; }
  .brand { padding: 0; font-size: 1rem; }.brand-mark { width: 32px; height: 32px; }
  .mobile-nav { display: block; }.mobile-nav summary { display: block; color: white; font-size: .9rem; padding: 7px 12px; border: 1px solid #729082; border-radius: 7px; }.mobile-nav summary::-webkit-details-marker { display:none; }
  .menu-surface { position: absolute; right: 12px; top: calc(100% - 2px); padding: 12px; width: min(290px,calc(100vw - 24px)); background: var(--dark); border-radius: 10px; box-shadow: 0 10px 25px #18342b36; }.menu-surface .nav-links { margin-top: 0; }.menu-surface .identity { margin-top: 12px; }
  .detail-grid { grid-template-columns: 1fr; }.admin-grid > section:last-child { grid-row: 1; }
  .detail-jump { display: flex; gap: 8px; margin: -2px 0 15px; }.detail-jump a { padding: 8px 12px; color: var(--accent); border: 1px solid var(--line); border-radius: 7px; font-size: .88rem; text-decoration: none; }
}
@media(max-width: 560px) {
  .workspace { padding: 24px 14px 40px; }.page-head { margin-bottom: 18px; }.page-head .btn { padding: 9px 12px; }.panel { padding: 16px; border-radius: 12px; }
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-bottom: 16px; }.metric { padding: 14px 16px; border-radius: 11px; }.metric strong { margin-top: 8px; }
  .order-card { grid-template-columns: minmax(0,1fr) auto; gap: 5px 12px; position: relative; }.order-person { grid-column: 1; grid-row: 1/3; }.order-card > :nth-child(2),.order-amount { grid-column: 2; justify-self: end; }.order-amount { display: flex; align-items: center; gap: 5px; flex-direction: row-reverse; }.order-amount strong { font-size: .85rem; }.order-amount small { font-size: .74rem; }.chevron { display: none; }
  .audit-filters,.form-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }.audit-event .section-head { align-items: start; flex-direction: column; gap: 3px; }
  .line-editor { grid-template-columns: repeat(2,minmax(0,1fr)); border-top: 1px solid var(--line); padding-top: 12px; }.line-editor > label:first-child { grid-column: 1/-1; }.line-editor .remove { grid-column: 1/-1; justify-self: end; padding: 0; margin: 0; }
  .form-end .btn { width: 100%; }.filter-bar { grid-template-columns: minmax(0,1fr) minmax(0,1.25fr) auto; }.filter-bar .btn { padding-inline: 12px; }.filter-bar select { padding-left: 6px; }
  .section-head { gap: 8px; }.actions { gap: 10px; }.actions .text-link { font-size: .8rem; }
}
@media(max-width: 370px) {
  .form-grid,.audit-filters { grid-template-columns: minmax(0,1fr); }.filter-bar { grid-template-columns: repeat(2,minmax(0,1fr)); }.filter-bar .btn { grid-column: 1/-1; }.order-amount { display: grid; }
}
