/* Shared desktop shell, forms and tables. Brand colours follow the Stitch boards. */
:root {
  --side: 216px;
  --ink: #19283d;
  --muted: #5a6879;
  --line: #dce2e9;
  --surface: #f4f6f9;
  --blue: #edf2f8;
  --head: #eff3f8;
  --gold: #805e24;
  --nav: #19283d;
  font-family: Inter, "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
}
button, input, select, textarea, .btn { border-radius: 5px }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible { outline: 2px solid #356996; outline-offset: 2px }
.identity { padding: 0 17px; height: 68px; gap: 10px; flex-shrink: 0 }
.identity .logo, .loginbox .logo { background: var(--nav); color: #fff; border-bottom: 3px solid #aa884d; border-radius: 5px; font: 700 14px Georgia, serif }
.identity b { font-size: 15px; line-height: 1.6 }
.identity small { line-height: 1.6; font-family: inherit; font-size: 11px; letter-spacing: .03em }
.navbody { padding: 9px 11px 16px }
.navgroup { font-weight: 600; line-height: 1.6; font-family: inherit; font-size: 11px; color: #667487; margin: 17px 9px 6px; letter-spacing: .04em }
.navitem { padding: 9px 10px; gap: 10px; margin-bottom: 2px; border-radius: 5px; border-left-width: 3px; color: #3d4d62; font-size: 14px }
.navitem.active { background: #e9eff6; border-color: #a47e3c; color: #172940 }
.navitem.active .icon { color: var(--ink) }
.foot { display: flex; gap: 3px; flex-direction: column; padding: 12px 20px; background: #fff; color: var(--muted); font-size: 11px }
.foot span:first-child { font-size: 12px; color: var(--ink) }
.dot { width: 6px; height: 6px }
.topbar { height: 55px; padding: 0 25px; gap: 14px }
.topbar .scope { background: transparent; border: 0; padding: 0; color: #34485f }
.topbar .period { padding-left: 14px; border-left: 1px solid var(--line); font-size: 13px }
.topbar .iconbtn { text-decoration: none; color: var(--ink) }
.account-trigger { display: inline-flex; align-items: center; gap: 8px; background: transparent; border: 0; padding: 3px 6px; font-size: 13px; text-align: left; line-height: 1.4 }
.account-trigger small { display: block; font-size: 11px }
.profile-chevron { width: 7px; height: 7px; border: solid #68798c; border-width: 0 1.5px 1.5px 0; transform: translateY(-2px) rotate(45deg); margin: 0 4px }
.avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: #674b1a; background: #f2eadb; font-weight: 600 }
.account-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px }
.main { padding: 19px 24px 36px }
.subnav { border-bottom: 1px solid var(--line); margin: -5px 0 19px; gap: 4px 14px; background: transparent }
.subnav a { border: 0; border-radius: 0; border-bottom: 2px solid transparent; background: transparent; padding: 8px 2px; color: var(--muted); line-height: 1.4 }
.subnav a.active { background: transparent; color: var(--ink); border-color: var(--gold); font-weight: 600 }
.pagehead { margin: 0 0 16px; padding-bottom: 0; border: 0 }
h1, .fin h1 { font: 650 25px/1.4 Inter,"Microsoft YaHei UI","Microsoft YaHei",sans-serif; letter-spacing: -.035em }
h2, .fin h2 { font-size: 16px }
.panel, .fin .panel, .card { border-radius: 6px; box-shadow: none }
.ph, .section-head { background: #fff }
.ph h2:before { width: 3px; height: 13px; background: #a47e3c }
.scroller, .fin .scroll, .biz-scroll { scrollbar-width: thin; scrollbar-color: #aebbc9 transparent; overscroll-behavior-x: contain }
th { background: var(--head); color: #43546a; font-weight: 600; white-space: nowrap }
tbody tr:hover td { background-color: #f7f9fc }
.detailgrid { grid-template-columns: minmax(85px,125px) minmax(0,1fr) }
.detailgrid dd { min-width: 0 }
.role-scope { margin: 0 0 14px; padding: 8px 12px; font-size: 13px; background: #f8fafd }
.role-scope .field, .role-scope .between { flex-direction: row; align-items: center; justify-content: flex-start; gap: 12px }
.role-scope select { width: auto; max-width: 80% }
.daily-links { display:flex; align-items:center; gap:14px; flex-wrap:wrap; border-bottom:1px solid var(--line); margin:0 0 16px; padding:0 0 9px; }
.daily-links > span { font-size:12px; color:var(--muted) }
.daily-links button { color:#31587d; font-size:13px; }
#root[inert][aria-busy="true"] { opacity:.65; cursor:progress }
.fin .fh { align-items: center; margin-bottom: 16px }
.fin .fh .hint { font-size: 13px }
.fin .metric strong { font-size: 22px }
.fin table { font-variant-numeric: tabular-nums }
.fin td, .fin th { font-size: 13px; padding: 10px; line-height: 1.55 }
.fin th { background: #f0f3f7; font-size: 12px }
.fin td.num, .fin th.num { text-align: right }
.fin td.ops-cell, .fin th.ops-cell { position: sticky; right: 0; background: #fff; border-left: 1px solid #e5e9ef }
.fin th.ops-cell { background: #f0f3f7 }
.fin td button { max-width: 270px; white-space: normal; overflow-wrap: anywhere; font-size: 12px }
.fin td:not(.ops-cell) button { background: transparent; border: 0; padding-inline: 0; color: #31587d; text-align: left }
.fin-project { display: block; max-width: 240px; white-space: normal; font-size: 11px }
.settlement-filters { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 15px; flex-wrap: wrap }
.settlement-filters label { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted) }
.settlement-filters input { padding: 6px 8px; max-width: 200px }
.settlement-filters .tabs .active { color: #fff; background: var(--nav) }
.fin .tag[data-state="department"], .fin .tag[data-state="approval"], .fin .tag[data-state="accounting"] { background: #fcf1d9; color: #755018 }
.fin .tag[data-state="approved"], .fin .tag[data-state="paid"] { background: #e6f2ea; color: #235b45 }
.fin .tag[data-state="returned"] { background: #f9e9e7; color: #943a31 }
.fin .footer-note { background: #fafbfd; font-size: 12px }
.org-filter { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding-bottom: 12px; font-size: 12px; color: var(--muted) }
.org-filter input { min-width: 6em; max-width: 100%; padding: 6px 9px; border: 1px solid var(--line) }
dialog[open] { max-height: min(90dvh,840px); border-radius: 8px }
#modal[open] { display: flex; flex-direction: column; overflow: hidden; padding: 0 }
#modal > .ph { flex-shrink: 0 }
#modal > form { min-height: 0; padding: 0; overflow: auto }
#modal .formgrid { padding: 16px 20px; gap: 13px }
#modal > form > .error { padding-inline: 20px }
#modal .actions { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--line); padding: 12px 18px; margin: 0 }
#modal > .pb { overflow: auto }
dialog.fin-dialog { padding: 0 }
.fin-dialog form { display: flex; flex-direction: column; max-height: min(89dvh,835px); padding: 0 }
.fin-dialog header, .fin-dialog footer { flex-shrink: 0 }
.fin-dialog .body { flex: 1; min-height: 0; overflow: auto; max-height: none }
.field:has([required]) > input:user-invalid, .field:has([required]) > select:user-invalid,
dialog :is(input,textarea):user-invalid { border-color: #a83f39 }
.error:not(:empty), .err:not(:empty) { padding-block: 8px }
.nav-scrim { display: none }
@media(max-width:900px) { :root { --side: 188px } .main { padding: 16px } }
@media(max-width:720px) {
  .aside { visibility: hidden }
  .aside.open { visibility: visible; box-shadow: none }
  .nav-scrim:not([hidden]) { display: block; position: fixed; inset: 0; width: 100%; height: 100%; background: #17283e60; border: 0; border-radius: 0; z-index: 8 }
  .topbar { height: 54px; padding: 0 9px; gap: 8px }
  .main { padding: 14px 12px 24px }
  .subnav { flex-wrap: nowrap; overflow-x: auto; margin-bottom: 14px }
  .subnav a { flex-shrink: 0; padding: 10px 2px }
  .settlement-filters { align-items: flex-start; flex-direction: column }
  .fin .fh { align-items: flex-start }
  .fin .fh .month { width: auto }
  #modal .formgrid { padding: 12px }
  #modal .actions { padding: 10px 12px max(10px,env(safe-area-inset-bottom)) }
  #modal .actions button, .fin-dialog footer button, .navitem, .topbar .iconbtn { min-height: 42px }
}
@media print { .nav-scrim { display: none!important } }
