/* 汇单 · D / Soft mint application. Design direction developed with unslop
 * by Damir Sokolovsky (@heydamir), CC BY 4.0 — https://heydamir.design/unslop
 * Final visual layer; existing permissions, data and mobile workflow stay intact. */
:root {
  --ui-nav:244px;
  --ui-bg:#f0f4f1; --ui-surface:#fff; --ui-raised:#f3f7f4; --ui-line:#e1e9e3;
  --ui-ink:#203a2c; --ui-secondary:#476051; --ui-muted:#66796c;
  --ui-accent:#226648; --ui-accent-hover:#184e36; --ui-accent-soft:#e5f6ec;
  --mint:#c3efd7; --mint-hover:#afe6c9; --mint-line:#b8dfc8;
  --green:var(--ui-accent); --accent:var(--ui-accent); --nav:#fff;
  --shadow:0 4px 16px rgb(24 53 36 / 5%);
  --glass-shadow:0 6px 24px rgb(24 53 36 / 8%);
  font-family:"Inter",-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;
}
body,.client-body,.system-loading { background:var(--ui-bg); color:var(--ui-ink); }
h1,h2,h3 { color:var(--ui-ink); }
h1 { font-size:30px; font-weight:600; line-height:1.25; }
.panel,.stat,.activity-card,.purchase-card,.client-order,.platform-body .panel {
  border:1px solid rgb(224 234 227 / 65%); border-radius:18px; background:#fff;
  box-shadow:0 2px 4px rgb(24 53 36 / 3%),0 8px 24px rgb(24 53 36 / 2%);
}
.sidebar {
  inset:12px auto 12px 12px; width:calc(var(--ui-nav) - 24px);
  color:var(--ui-secondary); background:#fff; border:1px solid rgb(224 234 227 / 60%);
  border-radius:22px; box-shadow:var(--shadow);
  -webkit-backdrop-filter:none; backdrop-filter:none;
}
.sidebar .brand { color:var(--ui-ink); padding:24px 20px 20px; }
.brand-mark,.sidebar .brand-mark { background:var(--mint); color:#1e6947; border-radius:10px; }
.sidebar .brand strong { font-size:24px; font-weight:600; }
.workspace-chip { border-color:var(--ui-line); color:var(--ui-secondary); background:#fbfdfb; margin:0 16px 12px; }
.workspace-chip i { background:#3e9a6a; }
.nav { padding:0 12px 16px; }
.nav-label { color:var(--ui-muted); padding:20px 12px 8px; }
.nav button { color:var(--ui-secondary); min-height:38px; padding:8px 12px; border-radius:10px; }
.nav button:hover { color:var(--ui-ink); background:#f2f7f3; }
.nav button.active { color:#164b32; background:var(--mint); box-shadow:none; font-weight:500; }
.sidebar-foot { color:var(--ui-muted); border-top-color:var(--ui-line); padding:14px 20px; }
.topbar { height:72px; padding:0 28px; background:transparent; border:0; box-shadow:none; -webkit-backdrop-filter:none; backdrop-filter:none; }
.breadcrumb { color:var(--ui-muted); }
.breadcrumb b { color:var(--ui-secondary); }
.avatar { color:#216347; background:#dff4e8; }
.page { max-width:1600px; padding:16px 28px 40px; }
.page-head { margin-bottom:24px; }
.page-head .actions { gap:12px; }
.dashboard-head h1 { font-size:32px; }
.dashboard-date { display:inline-flex; align-items:center; min-height:36px; padding:8px 12px; border:1px solid var(--ui-line); border-radius:10px; background:#fff; }
.button,.icon-button,.field input,.field select,.field textarea,.input,.platform-body button,.platform-body input,.platform-body select { border-radius:10px; }
.button,.platform-body button { background-image:none; box-shadow:0 1px 2px rgb(24 53 36 / 4%); }
.button.primary,.platform-body button.primary {
  background:var(--mint); border-color:var(--mint); color:#174c32; background-image:none;
  box-shadow:0 2px 3px rgb(24 53 36 / 4%); font-weight:600;
}
.button.primary:not(:disabled):hover,.platform-body button.primary:not(:disabled):hover { background:var(--mint-hover); border-color:var(--mint-hover); color:#143e2b; box-shadow:0 3px 8px rgb(24 53 36 / 7%); }
.button.ghost { box-shadow:none; }
.button:not(:disabled):hover { box-shadow:0 2px 6px rgb(24 53 36 / 5%); }
.button.primary.ui-busy::after { border-color:#174c32; border-right-color:transparent; }
.field input:focus-visible,.field select:focus-visible,.field textarea:focus-visible,.input:focus-visible { box-shadow:0 0 0 3px rgb(68 157 103 / 12%); }
.stat { min-height:132px; padding:20px; }
.stat-label { color:var(--ui-secondary); font-size:13px; }
.stat-value { color:var(--ui-ink); font-size:30px; font-weight:600; }
.stat-value em { font-style:normal; }
.stat-foot { color:var(--ui-muted); }
.dashboard-stats { grid-template-columns:minmax(280px,1.05fr) minmax(0,2fr); gap:16px; margin-bottom:24px; }
.dashboard-stats>.featured { position:relative; background:var(--mint); border-color:transparent; box-shadow:none; padding:24px; }
.dashboard-stats>.featured .stat-value { color:#153f2b; font-size:clamp(30px,2.6vw,42px); margin-top:12px; }
.dashboard-stats>.featured .stat-label,.dashboard-stats>.featured .stat-foot { color:#315e44; }
.dashboard-stats>.featured::after {
  content:""; position:absolute; top:0; right:20px; width:30px; height:24px;
  background:rgb(255 255 255 / 62%); clip-path:polygon(0 0,100% 0,100% 100%,84% 82%,67% 100%,50% 82%,33% 100%,16% 82%,0 100%);
}
.dashboard-secondary-stats { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); align-items:stretch; min-width:0; background:#fff; border:1px solid rgb(224 234 227 / 65%); border-radius:18px; box-shadow:var(--shadow); overflow:hidden; }
.dashboard-secondary-stats .stat { position:relative; min-width:0; padding:24px 20px; border:0; border-radius:0; box-shadow:none; background:transparent; }
.dashboard-secondary-stats .stat+.stat::before { content:""; position:absolute; left:0; top:28px; bottom:28px; width:1px; background:var(--ui-line); }
.dashboard-secondary-stats .stat-value { font-size:clamp(22px,2.1vw,30px); margin-top:12px; white-space:nowrap; }
.dashboard-secondary-stats .stat-foot { line-height:1.6; }
.dashboard-stats .stat:has(.profit-eye) .stat-label { padding-right:24px; }
.dashboard-stats .profit-private { display:block; }
.dashboard-stats .profit-eye { position:absolute; top:14px; right:8px; width:36px; height:36px; color:var(--ui-muted); }
.dashboard-stats .stat[data-wide=true] .stat-value { font-size:24px; overflow-wrap:anywhere; white-space:normal; }
.dashboard-grid { grid-template-columns:minmax(0,2fr) minmax(280px,1fr); gap:20px; }
.panel { margin-bottom:20px; }
.panel-head { padding:20px 24px 0; }
.panel-head h3 { font-size:17px; font-weight:600; }
.workflow { padding:8px 24px 16px; }
.workflow-row { min-height:60px; border-color:#eaf0eb; }
.workflow-num { display:inline-flex; align-items:center; justify-content:center; min-width:36px; min-height:28px; padding:0 10px; font-size:16px; font-weight:500; color:#20593a; background:#e1f6e9; border-radius:10px; }
.circle-icon { color:#476553; background:transparent; border-radius:0; }
.badge { border-radius:8px; padding:4px 9px; }
.badge.approved,.badge.paid { color:#246244; background:#e4f8eb; }
.badge.rejected,.badge.lost { color:#9b4145; background:#ffeded; }
.badge.applying { color:#805f21; background:#fff5df; }
th { background:#eff6f1; color:#556e5b; border-color:#e5ede7; }
td { color:#3b5544; border-color:#eaf0eb; }
tbody tr:hover { background:#f7fbf8; }
tbody tr:has(input[type=checkbox]:checked)>td { background:#e4f6eb; }
.orders-panel>.table-wrap tbody tr:has(.row-check:checked)>td:nth-child(-n+3) { background:#e4f6eb; }
.dashboard-recent .panel-table { margin-top:16px; }
.dashboard-recent .table-wrap { padding:0 16px 8px; }
.dashboard-recent th { padding:12px; }
.dashboard-recent th:first-child { border-radius:8px 0 0 8px; }
.dashboard-recent th:last-child { border-radius:0 8px 8px 0; }
.dashboard-recent td { padding:14px 12px; }
.dashboard-recent .link-button { color:var(--ui-ink); font-weight:500; }
.dashboard-ranking .rank-bar { height:5px; background:#edf5ef; border-radius:4px; }
.dashboard-ranking .rank-bar i { background:#93d5b0; }
.dashboard-ranking .rank-row:first-child .rank-bar i { background:#4eb782; }

/* The trend is real data, rendered at the available width so mobile labels stay legible. */
.trend-chart { position:relative; margin:0; padding:16px 24px 12px; min-width:0; }
.trend-chart svg { display:block; width:100%; height:auto; overflow:visible; font-family:inherit; }
.trend-grid { stroke:#e4ece6; stroke-width:1; stroke-dasharray:3 4; }
.trend-axis { fill:#66796c; font-size:11px; }
.trend-line { fill:none; stroke:#20855b; stroke-width:2.5; stroke-linecap:round; stroke-linejoin:round; }
.trend-fill { fill:#dcf4e6; }
.trend-point { fill:#fff; stroke:#20855b; stroke-width:2; opacity:0; }
.trend-hit { outline:none; cursor:crosshair; }
.trend-hit:last-of-type .trend-point,.trend-hit.active .trend-point,.trend-hit:focus-visible .trend-point { opacity:1; }
.trend-hit:focus-visible .trend-point { stroke-width:4; }
.trend-guide { stroke:#9ac9ac; stroke-width:1; stroke-dasharray:3 4; visibility:hidden; }
.trend-chart[data-active] .trend-guide { visibility:visible; }
.trend-tooltip { position:absolute; z-index:2; pointer-events:none; max-width:calc(100% - 24px); padding:10px 12px; border:1px solid var(--ui-line); border-radius:10px; background:#fff; box-shadow:0 4px 16px rgb(24 53 36 / 10%); color:var(--ui-secondary); font-size:12px; line-height:1.6; }
.trend-tooltip strong { display:block; color:var(--ui-ink); font-size:14px; }
.trend-data,.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0; }
.trend-empty { min-height:200px; display:grid; align-content:center; }

/* Portals and total control inherit the same palette without losing their mobile gestures. */
.client-header { border:1px solid rgb(224 234 227 / 70%); background:#fff; box-shadow:0 2px 8px rgb(24 53 36 / 3%); border-radius:18px; }
.client-shell .client-header .brand { color:var(--ui-ink); }
.activity-card h3,.purchase-card h3,.client-order-top h3 { color:var(--ui-ink); font-weight:600; }
.activity-tag,.purchase-task-tag { display:inline-block; color:#2d6948; background:#e6f8ed; padding:3px 8px; border-radius:6px; }
.activity-limit,.purchase-shell .purchase-task-metrics { border-color:#e7eee9; }
.portal-nav-lens { background:var(--mint); border-color:transparent; box-shadow:inset 0 1px 0 rgb(255 255 255 / 70%); }
.client-attention { background:#fffbf1; border:1px solid #ecdec0; border-inline-start:3px solid #bb9250; border-radius:14px; }
.modal,.platform-body dialog { background:#fff; border-color:#e1eae3; box-shadow:0 20px 64px rgb(24 53 36 / 16%); }
.modal-head,.modal-foot { background:#fbfdfb; border-color:var(--ui-line); }
.platform-body .panel,.platform-body .system { border-radius:18px; }
.platform-body .login { padding:32px; border-radius:20px; }
.platform-body .system-number { color:#245f40; background:#e3f6eb; }
.platform-body .badge { background:#e1f6e9; color:#246244; }
.platform-body .badge.off { background:#fff0ef; color:#a34749; }

/* Admin procurement claims: one chronological ledger, with responsive list rows. */
.purchase-claims-panel { margin-top:16px; }
.purchase-claims-filter { display:grid; grid-template-columns:minmax(0,1.5fr) minmax(0,1fr) auto auto; align-items:end; gap:12px; }
.purchase-claims-filter .field { min-width:0; }
.purchase-claims-filter .field input,.purchase-claims-filter .field select { width:100%; min-width:0; }
.claims-list-summary { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:14px 16px; font-size:12px; color:var(--ui-muted); border-bottom:1px solid var(--ui-line); }
.purchase-claims-panel table { width:100%; table-layout:fixed; min-width:900px; white-space:normal; }
.purchase-claims-panel th,.purchase-claims-panel td { padding:12px; vertical-align:top; overflow-wrap:anywhere; max-width:none; }
.purchase-claims-panel th { font-size:12px; }
.purchase-claims-panel th:first-child { width:180px; }
.purchase-claims-panel th:nth-child(2) { width:160px; }
.purchase-claims-panel th:nth-child(3) { width:184px; }
.purchase-claims-panel th:nth-child(4) { width:94px; }
.purchase-claims-panel th:nth-child(5) { width:128px; }
.purchase-claims-panel th:nth-child(6) { width:162px; }
.purchase-claims-panel th:last-child { width:116px; }
.purchase-claims-panel th[aria-sort=descending]::after { content:" ↓"; color:var(--ui-accent); }
.purchase-claims-panel td strong { display:block; color:var(--ui-ink); font-size:13px; font-weight:500; line-height:1.6; }
.purchase-claims-panel td small { display:block; font-size:11px; line-height:1.6; margin-top:3px; color:var(--ui-muted); }
.claim-buyer { display:flex; flex-direction:column; align-items:flex-start; gap:5px; }
.claim-buyer .button { min-height:30px; padding:4px 8px; font-size:11px; }
.claim-phone { font-size:12px; }
.claim-user a { color:var(--ui-ink); }
.claim-accepted time { display:block; font-size:12px; white-space:nowrap; line-height:1.7; font-variant-numeric:tabular-nums; }
.claim-actions { display:flex; flex-wrap:wrap; gap:6px; }
.claim-actions .button { min-height:32px; padding:5px 8px; font-size:12px; }
.claim-status .badge { white-space:normal; font-size:11px; }
.claim-cell-label { display:none; }
@media(max-width:800px) {
  .purchase-claims-filter { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .purchase-claims-filter>.button { width:100%; min-height:40px; }
  .claims-list-summary { padding:12px; font-size:11px; }
  .purchase-claims-panel>.table-wrap { overflow-x:hidden; }
  .purchase-claims-panel table,.purchase-claims-panel tbody { display:block; width:100%; min-width:0; }
  .purchase-claims-panel thead { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); }
  .purchase-claims-panel tbody tr { display:grid; grid-template-columns:minmax(0,1fr) auto; grid-template-areas:"product status" "buyer buyer" "order quantity" "accepted accepted" "actions actions"; gap:12px; padding:16px; border-bottom:1px solid var(--ui-line); }
  .purchase-claims-panel tbody tr:last-child { border-bottom:0; }
  .purchase-claims-panel tbody tr:has(.empty) { display:block; }
  .purchase-claims-panel td { display:block; padding:0; border:0; min-width:0; text-align:left; }
  .purchase-claims-panel td:has(.claim-product) { grid-area:product; }
  .purchase-claims-panel td:has(.claim-buyer) { grid-area:buyer; }
  .purchase-claims-panel td:has(.claim-order) { grid-area:order; }
  .purchase-claims-panel td:has(.claim-quantity) { grid-area:quantity; text-align:right; }
  .purchase-claims-panel td:has(.claim-status) { grid-area:status; }
  .purchase-claims-panel td:has(.claim-accepted) { grid-area:accepted; }
  .purchase-claims-panel td:has(.claim-actions) { grid-area:actions; }
  .purchase-claims-panel td:has(.empty) { grid-column:1/-1; }
  .purchase-claims-panel td strong { font-size:13px; }
  .purchase-claims-panel .claim-product>strong { font-size:16px; }
  .claim-buyer { flex-direction:row; flex-wrap:wrap; align-items:center; gap:6px 10px; }
  .claim-buyer .button { min-height:40px; padding:8px 10px; font-size:12px; }
  .claim-status { max-width:100px; text-align:right; }
  .claim-accepted { display:flex; flex-wrap:wrap; gap:4px 10px; color:var(--ui-secondary); }
  .claim-cell-label { display:block; font-size:11px; color:var(--ui-muted); margin-bottom:3px; }
  .claim-accepted .claim-cell-label { margin:0; line-height:1.85; }
  .claim-accepted time { font-size:12px; }
  .claim-actions { gap:8px; }
  .claim-actions .button { min-height:40px; padding:8px 14px; font-size:12px; }
}

@media(max-width:1200px) and (min-width:801px) {
  :root { --ui-nav:228px; }
  .page { padding:16px 24px 32px; }
  .dashboard-stats { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .dashboard-secondary-stats { display:contents; }
  .dashboard-secondary-stats .stat { padding:20px; background:#fff; border:1px solid var(--ui-line); border-radius:18px; box-shadow:var(--shadow); }
  .dashboard-secondary-stats .stat+.stat::before { display:none; }
  .dashboard-grid { grid-template-columns:minmax(0,1.8fr) minmax(260px,1fr); }
}
@media(max-width:900px) and (min-width:801px) {
  .dashboard-grid { grid-template-columns:minmax(0,1fr); }
  .dashboard-overview,.dashboard-sidebar { display:contents; }
  .dashboard-recent { order:0; }
  .dashboard-tasks { order:1; }
  .dashboard-trend { order:2; }
  .dashboard-ranking { order:3; }
}
@media(max-width:800px) {
  :root { --ui-nav:252px; }
  .sidebar { inset:8px auto 8px 8px; width:244px; transform:translateX(calc(-100% - 12px)); border-radius:20px; box-shadow:0 12px 48px rgb(24 53 36 / 18%); z-index:70; }
  .sidebar.open { transform:translateX(0); }
  .sidebar .nav button { min-height:44px; }
  .main { margin-left:0; }
  body.admin-workspace .topbar { background:#f9fcfa; height:56px; flex-basis:56px; border-bottom:1px solid #e4ece6; }
  .page { padding:20px 12px 28px; }
  .page-head { margin-bottom:16px; }
  .page-head h1,.dashboard-head h1 { font-size:25px; font-weight:600; }
  .dashboard-head { align-items:flex-start; flex-wrap:wrap; gap:8px 12px; }
  .dashboard-head>.actions { gap:6px; }
  .dashboard-date { min-height:32px; padding:6px 8px; border-radius:8px; }
  .dashboard-head .actions .button { min-height:32px; padding:6px 10px; font-size:12px; }
  .dashboard-stats { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-bottom:18px; }
  .dashboard-secondary-stats { display:contents; }
  .dashboard-stats .stat,.dashboard-stats>.featured { min-width:0; min-height:104px; padding:14px; border:1px solid rgb(224 234 227 / 65%); border-radius:15px; box-shadow:0 2px 4px rgb(24 53 36 / 3%); background:#fff; }
  .dashboard-stats>.featured { background:var(--mint); border-color:transparent; box-shadow:none; }
  .dashboard-stats>.featured::after { right:14px; width:22px; height:18px; }
  .dashboard-stats .stat+.stat::before { display:none; }
  .dashboard-stats .stat-label { font-size:12px; }
  .dashboard-stats .stat-value,.dashboard-stats>.featured .stat-value { font-size:clamp(20px,5.5vw,27px); margin-top:12px; font-weight:600; line-height:1.2; white-space:nowrap; }
  .dashboard-stats .stat-value em { font-size:12px; margin-right:4px; }
  .dashboard-stats .stat-foot { font-size:11px; margin-top:10px; line-height:1.5; }
  .dashboard-stats .profit-eye { top:4px; right:2px; width:40px; height:40px; }
  .dashboard-stats .stat[data-wide=true] { grid-column:1/-1; }
  .dashboard-stats .stat[data-wide=true] .stat-value { font-size:27px; white-space:normal; }
  .dashboard-grid { gap:0; grid-template-columns:minmax(0,1fr); }
  .dashboard-overview,.dashboard-sidebar { display:contents; }
  .dashboard-recent { order:0; }
  .dashboard-tasks { order:1; }
  .dashboard-trend { order:2; }
  .dashboard-ranking { order:3; }
  .panel,.purchase-card,.activity-card,.client-order { border-radius:16px; }
  .panel { margin-bottom:16px; }
  .panel-head { padding:16px 16px 0; }
  .panel-head h3 { font-size:16px; }
  .dashboard-recent .table-wrap { padding:0; }
  body.admin-workspace .dashboard-recent tbody tr { gap:4px 10px; padding:10px 16px; }
  body.admin-workspace .dashboard-recent td { padding:0; }
  body.admin-workspace .dashboard-recent td:first-child strong { font-size:13px; }
  body.admin-workspace .dashboard-recent td:first-child .link-button { font-size:13px; }
  body.admin-workspace .dashboard-recent td:nth-child(3) { font-size:13px; font-weight:500; }
  .dashboard-recent .badge { font-size:11px; padding:3px 7px; }
  .workflow { padding:8px 16px 12px; }
  .workflow-row { min-height:48px; }
  .workflow-num { min-width:44px; min-height:36px; font-size:16px; }
  .trend-chart { padding:16px 12px 12px; }
  .trend-empty { min-height:176px; }
  .trend-tooltip { padding:8px 10px; }
  .client-shell:not(.purchase-shell) .client-header,.buyer-page .purchase-shell .client-header { padding:14px 12px; min-height:62px; }
  .client-shell:not(.purchase-shell) .portal-nav,.buyer-page .purchase-shell .portal-nav { background:rgb(252 255 253 / 94%); border-color:#d8e7dd; }
  .client-shell:not(.purchase-shell) .activity-card,.buyer-page .purchase-shell .purchase-card { padding:16px; border-radius:16px; }
  .activity-card .activity-actions .button,.purchase-card .actions .button { min-height:44px; }
  .client-body .modal,.client-body .modal.wide { background:#fff; }
  .platform-body .panel { padding:18px 16px; border-radius:16px; }
  .platform-body .login { padding:24px; }
}
@media(max-width:359px) {
  .dashboard-stats .stat,.dashboard-stats>.featured { padding:14px 10px; }
  .dashboard-stats .stat-value,.dashboard-stats>.featured .stat-value { font-size:20px; }
  .dashboard-head h1 { font-size:24px; }
}
@media(prefers-reduced-transparency:reduce),(prefers-contrast:more),(update:slow) {
  .sidebar,.topbar,.client-header,.modal,.platform-body dialog,
  .client-shell:not(.purchase-shell) .portal-nav,.buyer-page .purchase-shell .portal-nav { background:#fff; -webkit-backdrop-filter:none; backdrop-filter:none; }
}
@media(forced-colors:active) {
  .sidebar,.panel,.stat,.dashboard-secondary-stats,.client-header,.modal { background:Canvas; color:CanvasText; border:1px solid CanvasText; box-shadow:none; }
  .nav button.active,.button.primary { background:Highlight; color:HighlightText; }
  .trend-line,.trend-point { stroke:CanvasText; }
  .trend-fill { fill:Canvas; }
  .trend-axis { fill:CanvasText; }
  .trend-grid { stroke:GrayText; }
}
