:root {
  --ink: #172f47;
  --blue: #185eaa;
  --line: #d7e1ea;
  --muted: #54677a;
  --paper: #f5f6f5;
  --shadow: none;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
body {background: var(--paper)}
main {background: var(--paper); padding: 22px clamp(14px, 2.6vw, 44px) 36px; min-height: calc(100vh - 102px)}
main > h1, .page-head, .card-head {background: white}
section, main > details, aside > details, .tab-card, main > h1, .record-head {border-radius: 10px}
.page-head {border-radius: 10px 10px 0 0}
button, .control, .button, input, select, textarea {border-color: #aebdcc; border-radius: 6px; min-height: 36px}
button:hover, .control:hover {border-color: #7e98b0}
.primary, .login button {background: var(--blue); color: white}
.primary:hover, .login button:hover {background: #134d8d; color: white}
:focus-visible {outline: 3px solid #1684ca; outline-offset: 2px}
small, .muted {color: var(--muted)}
.glyph {width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle}
.skip-link {position: absolute; top: 8px; left: 8px; z-index: 10; padding: 8px 12px; background: white; transform: translateY(-160%)}
.skip-link:focus {transform: none}

.global {height:64px; grid-template-columns:minmax(max-content,1fr) minmax(140px,420px) minmax(40px,1fr); background:white; border-bottom:1px solid var(--line); padding-inline:clamp(16px,2.6vw,44px); gap:16px}
.brand {display:inline-flex; align-items:center; gap:16px; width:auto; height:auto; background:none; color:var(--ink); border-radius:0; letter-spacing:normal; font-style:normal}
.company-logo {display:block; width:144px; height:auto}
.brand-title {border-left:1px solid var(--line); padding-left:16px; font-size:16px; font-weight:600; line-height:1.25}
.brand-title small {display:block; color:var(--muted); font-size:11px; font-weight:400}
.global-search {height:36px; background:#fff; border:1px solid #b8c4cb; border-radius:4px}
.global-search button {color: #536d83; padding-inline: 11px}
.global-search input {padding-left: 0}
.account-menu > summary {width: 35px; height: 35px; background: #dceafe; color: #183f69}
.app-nav {height: 44px; padding-inline: clamp(6px,1.8vw,30px); border: 0; border-bottom: 1px solid var(--line)}
.nav-tabs {margin-inline: 5px}
.more:not(:has(.popover a)) {visibility: hidden}
.nav-tabs > a, .module-tab, .more > summary {border-top: 0; border-bottom: 3px solid transparent}
.nav-tabs > a[aria-current], .module-tab:has([aria-current]), .more.active > summary {border-bottom-color: var(--blue); background: #edf4fb}
.nav-en {display: none}
.popover .nav-en {display: inline; color: var(--muted)}
.quick-menu, .popover {border-radius: 8px; box-shadow: 0 8px 28px rgb(19 40 60 / 16%)}
.obj-icon {width:32px; height:32px; border-radius:4px; color:#42596a; background:#edf1f2}
.obj-icon .glyph {width:18px; height:18px}
.workbench {max-width: 1720px; margin: auto}
.workbench-head {display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px}
.workbench-head h1 {font-size: clamp(24px,2.1vw,32px); font-weight:600; letter-spacing:0}
.workbench-head h1 small {font-size: 15px; font-weight: 450; letter-spacing: normal; margin-left: 4px}
.metrics {display:grid; grid-template-columns:repeat(auto-fit,minmax(132px,1fr)); gap:1px; background:var(--line); border:1px solid var(--line); border-radius:6px; margin-bottom:24px; overflow:hidden}
.metric {display:flex; align-items:center; gap:12px; color:var(--ink); padding:16px 20px; background:white}
.metric:hover {background:#f2f6f8; text-decoration:none}
.metric:focus-visible {outline-offset:-3px}
.metric div {min-width:0}
.metric span {font-size:13px; color:var(--muted)}
.metric b {display:block; margin-top:4px; line-height:1.15; font-size:28px; font-weight:600; font-variant-numeric:tabular-nums}
.metric > .glyph {width:16px; margin-left:auto; color:#536d83}
.workbench-body {display: grid; grid-template-columns: minmax(0,1fr) minmax(245px,24%); align-items: start; gap: 20px}
.workbench-body > div, .dash-columns > div {min-width: 0}
.group-title {font-size: 18px; margin: 0 0 12px}
.workspace {grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; margin: 0; align-items: stretch}
.workspace .list-card {display: flex; flex-direction: column; min-width: 0}
.card-head {padding: 12px 16px; gap: 12px}
.workspace .list-card {border-radius:6px}
.workspace .view-tools {margin-top:auto}
.card-head h2 small, .workbench-rail h2 small {font-size: 12px; font-weight: 450; color: var(--muted)}
.card-head h2 a {color: var(--ink)}
.card-new {font-size: 13px; white-space: nowrap}
.workspace .scroll-table {max-height: 245px}
.view-empty {margin: 0; padding: 11px 16px 20px; color: var(--muted); font-size: 13px}
.view-tools {position: relative; display: flex; justify-content: space-between; align-items: start; gap: 8px; padding: 3px 15px; border-top: 1px solid #e4eaf0; background: #fbfcfe; font-size: 13px}
.view-tools > a, .view-search summary {display: flex; align-items: center; gap: 5px; min-height: 34px; white-space: nowrap}
.view-tools .glyph {width: 14px; height: 14px}
.view-search {min-width: 0}
.view-search summary {color: var(--muted); list-style: none}
.view-search summary::-webkit-details-marker {display: none}
.view-search form {padding: 2px 0 7px; justify-content: start}
.workbench-rail {padding-top: 38px}
.workbench-rail section {padding: 14px 16px}
.workbench-rail h2 {display: flex; align-items: center; gap: 8px; font-size: 16px}
.workbench-rail .bar {min-height: 30px}
.workbench-rail .bar a, .rail-row {font-size: 13px}
.workbench-rail .bar .glyph {color: #46657f}
.rail-row {display: flex; align-items: baseline; justify-content: space-between; gap: 10px; border-top: 1px solid #e5ebf1; padding: 8px 0}
.rail-row span {overflow-wrap: anywhere}
.rail-row small {white-space: nowrap; font-variant-numeric: tabular-nums}
.workbench-rail .muted {line-height: 1.7}

th {background: #eef3f7; color: #445b70; border-color: var(--line); font-size: 12px}
td {border-color: #e3e9ef}
th, td {padding: 8px 16px}
th.number, td.number {text-align: right; font-variant-numeric: tabular-nums}
tbody tr:hover {background: #f1f7fc}
.list-tools {border-top: 1px solid var(--line)}
.record-head .page-head {padding: 16px 18px}
.highlights {padding: 12px 18px; border-top: 1px solid var(--line); background: #f9fbfd; border-radius: 0 0 10px 10px}
.highlights > div {overflow-wrap: anywhere}
.record-head h1 {font-size: 22px; overflow-wrap: anywhere}
.record-layout {grid-template-columns: minmax(0,2.5fr) minmax(235px,1fr); gap: 16px}
.record-tabs {border-color: var(--line)}
.field-group summary, .record-form details summary, #related > details > summary {background: #edf3f7; padding: 8px 10px; color: #2a4760}
.field {padding-block: 8px; border-color: var(--line)}
.completion-progress {margin-top: 14px}
.completion-progress label {display: flex; justify-content: space-between; color: var(--muted)}
.completion-progress progress {display: block; width: 100%; height: 6px; margin-top: 5px; appearance: none; border: 0; background: #e1e8ec; border-radius: 3px; color: #26745b}
.completion-progress progress::-webkit-progress-bar {background: #e1e8ec; border-radius: 3px}
.completion-progress progress::-webkit-progress-value {background: #26745b; border-radius: 3px}
.completion-progress progress::-moz-progress-bar {background: #26745b; border-radius: 3px}
.checks {display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px}
.check {margin: 0; border: 1px solid var(--line); border-left-width: 3px; border-radius: 5px}
.check b {font-size: 12px; padding: 1px 5px; border-radius: 4px}
.check[data-met="1"] b {color: #215c45; background: #e6f2eb}
.check[data-met="0"] b {color: #825313; background: #fff2d9}
.check small {clear: both; padding-top: 4px}
.form-scrim {margin: -22px calc(-1 * clamp(14px, 2.6vw, 44px)) -36px}
.record-form {border-radius: 12px}
.form-footer {background: #f5f8fb; border-color: var(--line); flex-wrap: wrap}
.modal-head, .form-body section {border-color: var(--line)}
.form-body {overscroll-behavior: contain}
@media (max-width: 1100px) {
  .workbench-body {grid-template-columns: minmax(0,1fr) 240px; gap: 14px}
  .workspace {grid-template-columns: minmax(0,1fr)}
}
@media (max-width: 860px) {
  .workbench-body, .record-layout {grid-template-columns: minmax(0,1fr)}
  .workspace, .workbench-rail {display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px}
  .workbench-rail {padding-top: 0}
}
@media (max-width: 600px) {
  main {padding: 14px 10px 24px}
  .global {grid-template-columns: auto minmax(0,1fr) auto; gap: 10px; padding-inline: 10px}
  .brand-title {display: none}
  .company-logo {width:100px}
  .workbench-head {flex-wrap: wrap; margin-bottom: 14px}
  .workbench-head h1 small {font-size: 13px}
  .head-actions {gap: 6px}
  .workbench-head .control {font-size: 13px; padding-inline: 9px}
  .metrics {grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1px; margin-bottom: 16px}
  .metric {gap:8px; padding:12px 16px}
  .metric:last-child:nth-child(odd) {grid-column:1 / -1}
  .metric b {font-size: 22px}
  .workspace, .workbench-rail, .checks {grid-template-columns: minmax(0,1fr)}
  .workbench-rail {gap: 0}
  .view-tools > a, .view-search summary, .card-new, .rail-row {min-height: 40px; align-content: center}
  .list-tools form, .page-head > div, .page-head select {min-width: 0; max-width: 100%}
  .list-tools form {flex: 1 1 100%}
  .form-scrim {margin: -14px -10px -24px}
  .record-overlay .form-body {max-height: calc(90dvh - 145px)}
}
@media (hover: none) {
  .cell-edit summary {opacity: 1; padding-inline: 6px}
}

.followup-grid, .ledger-totals {display:grid; grid-template-columns:repeat(auto-fit,minmax(135px,1fr)); gap:12px; margin-block:12px}
.followup-grid > div, .ledger-totals > div {min-width:0; display:grid; align-content:start; gap:4px; padding:10px; border-radius:6px; background:#f3f7fa; overflow-wrap:anywhere}
.ledger-totals b {font-variant-numeric:tabular-nums}
.followup-row {display:flex; align-items:baseline; flex-wrap:wrap; gap:10px; padding-block:7px; border-top:1px solid var(--line)}
.followup-row a {display:inline-block; margin-right:12px; overflow-wrap:anywhere}
.check-targets {clear:both; display:flex; flex-wrap:wrap; gap:5px 14px; font-size:13px}
.saved-list {display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin-block:8px 16px}
.saved-list a {display:inline-block; padding:5px 10px; border:1px solid var(--line); background:white; border-radius:6px}
.queue-bar {display:flex; gap:20px; margin-bottom:12px; border-bottom:1px solid var(--line)}
.queue-bar a {padding:8px 0; margin-bottom:-1px; border-bottom:2px solid transparent; color:var(--muted)}
.queue-bar a[aria-current=page] {border-color:var(--blue); color:var(--ink); font-weight:600}
.queue-bar a:hover {color:var(--blue); text-decoration:none}
.saved-list {margin:0; padding:6px 15px 10px}
.saved-list input {max-width:155px}
.list-tools form {flex-wrap:wrap}
.list-tools .mine {display:flex; align-items:center; gap:4px; white-space:nowrap}
.list-tools .mine input {margin:0}

.chart-grid {display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; gap:16px}
.chart-grid .chart-panel {margin:0; padding:20px; border-radius:6px}
.chart-heading, .chart-legend > div {display:flex; align-items:center; gap:12px}
.chart-heading {justify-content:space-between; border-bottom:1px solid var(--line); padding-bottom:12px}
.chart-heading h2 {margin:0; font-size:17px}
.chart-heading a, .chart-currencies {font-size:13px}
.chart-panel .chart-total {display:flex; align-items:baseline; flex-wrap:wrap; gap:8px; color:var(--muted); margin:16px 0}
.chart-total b, .ring b {font-size:26px; color:var(--ink); font-weight:600; font-variant-numeric:tabular-nums}
.chart-donut {display:grid; grid-template-columns:minmax(96px,32%) minmax(0,1fr); gap:24px; align-items:center; padding-top:16px}
.ring {position:relative; max-width:160px}
.ring svg {display:block; width:100%}
.ring circle {fill:none; stroke-width:11; stroke:var(--series,#e5ebef)}
.ring > div {position:absolute; inset:0; display:flex; flex-direction:column; justify-content:center; align-items:center}
.series-0 {--series:#174879}.series-1 {--series:#28778a}.series-2 {--series:#557caa}.series-3 {--series:#827044}.series-4 {--series:#83929d}.series-5 {--series:#665d83}
.chart-legend > div {padding:5px 0;font-size:13px}
.chart-legend i {width:10px; height:10px; background:var(--series); border-radius:2px}
.chart-legend b {margin-left:auto; white-space:nowrap}
.chart-bars {display:grid; gap:10px}
.chart-bar {display:grid; grid-template-columns:minmax(7em,1fr) minmax(44px,3fr) minmax(2em,auto); gap:12px; align-items:center; font-size:13px}
.chart-bar svg {width:100%; height:12px}
.chart-bar b, .chart-legend b {text-align:right; font-weight:550; font-variant-numeric:tabular-nums}
.bar-track {fill:#edf1f4}.credit {fill:#306d98}.deduction {fill:#97652d}.zero-line {stroke:#647887; vector-effect:non-scaling-stroke}
.chart-currencies {display:flex; gap:8px; flex-wrap:wrap; margin-top:12px}
.chart-currencies a {padding:4px 10px; border:1px solid var(--line); border-radius:4px}
.chart-currencies [aria-current] {background:#eaf2f8; border-color:#7b9ab4;color:var(--ink)}
.cash-bars .chart-bar {grid-template-columns:3em minmax(40px,1fr) minmax(8em,auto)}
#chart-Payment__c {grid-column:1 / -1}
.cash-summary {display:grid; grid-template-columns:minmax(180px,1fr) minmax(0,2fr); gap:24px; align-items:center; margin-top:12px}
.chart-empty {color:var(--muted); padding-block:12px}
@media (max-width:800px) {
  .chart-grid {grid-template-columns:1fr}
  .chart-grid .chart-panel {padding:16px}
  .chart-donut {gap:12px}
  .cash-summary {grid-template-columns:1fr; gap:4px}
}
