/*
 * 汇单 · business ledger interface
 * Design pass using unslop by Damir Sokolovsky (@heydamir), CC BY 4.0
 * https://heydamir.design/unslop
 * Shared presentation layer. Business rules and responsive section order stay in their modules.
 */

/* 1. Spacing: one rhythm for the workspace, forms and portals. */
:root { --ui-4:4px; --ui-8:8px; --ui-12:12px; --ui-16:16px; --ui-20:20px; --ui-24:24px; --ui-32:32px; --ui-nav:240px; }
.sidebar { width:var(--ui-nav); }
.main { margin-left:var(--ui-nav); }
.brand { gap:12px; padding:24px 20px; }
.workspace-chip { margin:0 16px 16px; padding:12px; }
.nav { padding:0 12px 20px; }
.nav-label { padding:24px 12px 8px; }
.nav button { min-height:36px; padding:8px 12px; margin:2px 0; gap:12px; }
.sidebar-foot { padding:16px 20px; }
.topbar { height:64px; padding:0 32px; gap:16px; }
.top-actions { gap:12px; }
.page { max-width:1600px; padding:28px 32px 40px; }
.page-head { margin-bottom:24px; gap:16px; }
.cards { gap:16px; margin-bottom:24px; }
.stat { padding:20px; min-height:136px; }
.stat-value { margin-top:16px; }
.stat-foot { margin-top:12px; }
.dashboard-grid { gap:24px; }
.panel { margin-bottom:24px; }
.panel-head { padding:20px 24px 0; gap:12px; }
.panel-head p { margin-top:4px; }
.panel-content { padding:24px; }
.filter { padding:16px 20px; gap:12px 16px; }
.toolbar { padding:12px 20px; gap:12px; }
.form-grid { gap:20px; }
.field { gap:8px; }
.workflow { padding:12px 24px 16px; }
.workflow-row { min-height:56px; padding:12px 0; }
.ranking { padding:8px 24px 20px; }
.rank-row { gap:12px; margin-top:16px; }
.purchase-page-head { gap:16px; margin-bottom:20px; }
.purchase-list,.purchase-stock-grid { gap:16px; }
.purchase-card { padding:20px; }
.purchase-meta { margin:4px 0; }
.purchase-facts { gap:8px 16px; margin:12px 0; }
.purchase-card .actions { margin-top:12px; gap:8px; }
.purchase-filter,.inventory-filter { gap:12px; margin:16px 0; }
.client-shell { max-width:1280px; padding:0 24px 32px; }
.client-header { min-height:72px; padding:16px 0; margin:0 0 24px; gap:16px; }
.client-toolbar { gap:16px; margin-bottom:20px; }
.activity-grid { gap:16px; }
.activity-card { padding:20px; }
.activity-card-heading h3 { margin:8px 0 12px; }
.activity-description { margin:0 0 12px; }
.activity-limit { padding:12px 0; margin:12px 0; gap:12px; }
.activity-limit small { margin-bottom:4px; }
.activity-card .activity-actions { margin-top:16px; gap:8px; }
.client-body .panel-content { padding:20px; }
.client-body .form-grid { gap:16px; }
.modal-head { padding:20px 24px; }
.modal-body { padding:24px; }
.modal-foot { padding:16px 24px; gap:8px; }
.client-body .modal-head,.client-body .modal-foot { padding:16px 20px; }
.client-body .modal-body { padding:20px; }

/* 2. Color: neutral chrome; green belongs to actions and meaningful figures. */
:root {
  --ui-bg:#f6f7f7; --ui-surface:#fff; --ui-raised:#f0f3f1; --ui-line:#dde3df;
  --ui-ink:#202924; --ui-secondary:#4d5b53; --ui-muted:#68766d;
  --ui-accent:#00755f; --ui-accent-hover:#005e4c; --ui-accent-soft:#edf5f0;
  --ui-danger:#b13d42; --ui-danger-soft:#fff2f1; --ui-warning:#8c5c16; --ui-warning-soft:#fff8e9;
  --green:var(--ui-accent); --accent:var(--ui-accent); --nav:#202824; --line:var(--ui-line);
  --muted:var(--ui-muted); --purple:var(--ui-secondary); --surface:var(--ui-surface); --border:var(--ui-line);
  --shadow:0 8px 24px rgb(23 32 27 / 8%);
  color:var(--ui-ink); background:var(--ui-bg);
}
body,.client-body,.system-loading { background:var(--ui-bg); color:var(--ui-ink); }
.sidebar { color:#c1cdc5; }
.sidebar .brand { color:#f3f6f4; }
.sidebar .brand-mark { background:#d7eee2; color:#006950; }
.workspace-chip { border-color:#455149; }
.nav-label,.sidebar-foot { color:#a6b4ab; }
.nav button { color:#c1cdc5; }
.nav button:hover { background:#2a3630; color:#fff; }
.nav button.active { background:#33473d; color:#f0faf4; }
.topbar,.panel,.stat,.activity-card,.purchase-card,.client-order { background:var(--ui-surface); border-color:var(--ui-line); }
.breadcrumb,.user-chip,.stat-label,.chart-legend,.panel-head p,.rank-amount,.purchase-meta,
.purchase-task-spec,.purchase-intro,.activity-description,.activity-window,.activity-limit small,
.purchase-details dt,.purchase-timeline small,.form-note,.help-prose,.client-order-summary,
.subtle,.muted,td small,.stat-foot,.client-header .brand small { color:var(--ui-muted); }
.avatar { color:var(--ui-secondary); background:var(--ui-raised); }
.stat.featured { background:#fff; border-color:var(--ui-line); }
.stat.featured .stat-value { color:var(--ui-accent); }
.stat-foot strong,.activity-card h3,.activity-limit strong,.client-header .brand,.brand.login-brand { color:var(--ui-ink); }
.button,.link-button,.icon-button { color:var(--ui-secondary); }
.button { background:#fff; border-color:var(--ui-line); box-shadow:none; }
.button:hover { color:var(--ui-ink); border-color:#a8b7ad; background:#f5f7f5; }
.button.primary { background:var(--ui-accent); border-color:var(--ui-accent); color:white; box-shadow:none; }
.button.primary:hover { background:var(--ui-accent-hover); border-color:var(--ui-accent-hover); }
.button.danger,.link-button.danger { color:var(--ui-danger); border-color:#e7c8ca; }
.button.ghost { background:transparent; border-color:transparent; color:var(--ui-muted); }
.link-button:hover { color:var(--ui-accent); }
.field input,.field select,.field textarea,.input { border-color:#cdd6cf; color:var(--ui-ink); background:#fff; }
.field input::placeholder,.field textarea::placeholder,.input::placeholder { color:#778279; opacity:1; }
.field>span,.field label>span,.field small { color:var(--ui-muted); }
.callout,.metric-pill { color:var(--ui-secondary); border-color:var(--ui-line); background:#f4f7f5; }
.callout.warning { color:var(--ui-warning); border-color:#ebd6ad; background:var(--ui-warning-soft); }
.client-attention { background:#fffaf0; border-color:#e8d5b0; color:#785015; border-inline-start-color:#b17a28; }
.client-attention-order { border-color:#eadcc4; }
.client-attention-row .button { color:#785015; border-color:#d6bb8c; background:#fff; }
.inventory-admin .inventory-low { background:#fff; border-color:var(--ui-line); }
.inventory-warning { color:var(--ui-warning); background:var(--ui-warning-soft); border-color:#ead8b5; }
.inventory-low>.inventory-warning { background:transparent; border:0; padding:8px 0 0; }
.inventory-alert { border-inline-start:3px solid #ad7726; }
.badge { color:var(--ui-secondary); background:#f0f3f1; }
.badge.followed { color:#416980; background:#edf3f6; }
.badge.applying { color:#855b1d; background:#fcf5e8; }
.badge.approved,.badge.paid { color:#176f53; background:#edf6ef; }
.badge.rejected,.badge.lost { color:#aa3e45; background:#fff1f1; }
.activity-tag,.purchase-task-tag { background:transparent; color:var(--ui-muted); border:0; padding:0; }
.overlay { background:rgb(24 32 27 / 42%); backdrop-filter:none; }
.modal { box-shadow:0 16px 48px rgb(24 32 27 / 16%); }
.icon-button { background:var(--ui-raised); }
.login-form-wrap { background:var(--ui-bg); }
.login-form p,.login-alt { color:var(--ui-muted); }
.login-error,#form-error { color:var(--ui-danger); }
#toast { background:#263c30; box-shadow:var(--shadow); }
.client-nav,.buyer-page .purchase-shell .client-nav,.client-shell:not(.purchase-shell) .client-nav { box-shadow:none; border-color:var(--ui-line); }
.circle-icon,.circle-icon.purple,.circle-icon.green { color:var(--ui-muted); background:var(--ui-raised); }

/* 3. Icons: the existing SVG set, at one size and stroke. */
.menu-icon,.nav-icon { width:18px; height:18px; flex:0 0 18px; }
.menu-icon { stroke-width:1.5; }
.mobile-menu .menu-icon { width:18px; height:18px; }
.circle-icon { width:32px; height:32px; border-radius:8px; }
.empty-icon { display:block; width:24px; height:24px; margin:0 auto 12px; fill:none; stroke:currentColor; stroke-width:1.5; }
.inventory-more summary svg { width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:1.5; }

/* 4. Copy: short labels in controls; explanations sit below their work group. */
.form-note { max-width:86ch; line-height:1.65; }
.purchase-admin>.callout { margin-bottom:16px; padding:16px 20px; line-height:1.7; }
.client-attention>strong { display:block; margin-bottom:8px; }
.client-attention-row { gap:12px; margin-top:8px; }
.client-attention-order { padding-top:12px; }
.client-attention-order b { margin-bottom:4px; }

/* 5. Type: Chinese UI first, tabular figures, no decorative tracking. */
:root { font-family:system-ui,-apple-system,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif; font-size:14px; font-variant-numeric:tabular-nums; }
body { font-size:14px; line-height:1.5; }
h1 { font-size:28px; line-height:1.25; font-weight:500; letter-spacing:0; }
h2 { font-size:20px; line-height:1.4; font-weight:500; letter-spacing:0; }
h3 { font-size:16px; line-height:1.5; font-weight:500; }
strong,b { font-weight:600; }
.brand strong { font-size:20px; font-weight:600; letter-spacing:0; }
.brand-mark { font-weight:600; }
.nav button { font-size:14px; font-weight:400; }
.nav-label { font-size:12px; letter-spacing:0; }
.sidebar-foot { font-size:12px; }
.breadcrumb,.user-chip,.stat-label,.stat-foot,.panel-head p,.chart-legend,.purchase-meta,.form-note,
.activity-window,.activity-limit small,.subtle,.muted,small,.rank-row,.field>span { font-size:12px; letter-spacing:0; }
.stat-value { font-size:30px; font-weight:500; line-height:1.2; letter-spacing:0; }
.stat-value em { font-size:16px; }
.stat-foot strong { font-weight:500; }
.panel-head h3 { font-size:16px; font-weight:500; }
.workflow-label { font-size:14px; }
.workflow-num { font-size:20px; font-weight:500; }
.purchase-admin h1,.client-toolbar h1,.client-hero h1 { font-size:24px; font-weight:500; letter-spacing:0; }
.purchase-card h3,.activity-card-heading h3,.client-order-top h3 { font-size:18px; font-weight:500; line-height:1.5; }
.activity-metrics { font-size:14px; }
.activity-limit strong { font-size:20px; font-weight:500; }
.purchase-facts,.purchase-details,.callout { font-size:14px; }
.purchase-card h3 small { font-size:13px; font-weight:400; }
.activity-tag,.purchase-task-tag { font-size:12px; font-weight:400; }
.badge { font-size:12px; line-height:1.5; font-weight:400; }
table { font-size:13px; }
th { font-size:12px; font-weight:500; }
td,td strong,.money { font-weight:400; }
td strong { color:var(--ui-ink); }
td small { font-size:12px; margin-top:4px; }
.stock-count strong { font-size:28px; font-weight:500; }
.stock-count span { font-size:14px; }
.chart-label { font-size:11px; color:var(--ui-muted); }
.modal-foot #form-error { font-size:13px; }
.login-form h2 { font-size:24px; font-weight:500; }
.login-form p,.login-alt { font-size:13px; }

/* 6. Layout: keep the sections; give primary work and secondary tools different weight. */
.button { min-height:36px; padding:8px 12px; gap:8px; font-size:13px; font-weight:500; }
.button.small { min-height:32px; padding:4px 8px; font-size:12px; }
.field input:not([type=checkbox]):not([type=radio]),.field select,.input { min-height:40px; padding:8px 12px; }
.field textarea { padding:12px; }
.purchase-card .button,.purchase-tabs .button { min-height:36px; padding:8px 12px; font-size:13px; }
.purchase-tabs { gap:4px; padding-bottom:8px; border-bottom:1px solid var(--ui-line); margin-bottom:16px; }
.purchase-tabs .button { background:transparent; border-color:transparent; color:var(--ui-muted); }
.purchase-tabs .button.active { color:var(--ui-accent); background:var(--ui-accent-soft); border-color:transparent; }
.inventory-admin .purchase-page-head { align-items:center; }
.inventory-admin .purchase-page-head>.actions { flex-wrap:nowrap; gap:8px; }
.inventory-more { position:relative; }
.inventory-more summary { cursor:pointer; list-style:none; }
.inventory-more summary::-webkit-details-marker { display:none; }
.inventory-more summary::marker { content:""; }
.inventory-more[open]>summary { border-color:#a8b7ad; background:var(--ui-raised); }
.inventory-more-menu { position:absolute; z-index:45; right:0; top:calc(100% + 8px); display:grid; gap:4px; width:208px; padding:8px; background:#fff; border:1px solid var(--ui-line); border-radius:12px; box-shadow:var(--shadow); }
.inventory-more-menu .button { justify-content:flex-start; border:0; width:100%; color:var(--ui-secondary); }
.inventory-more-menu .button:hover { background:var(--ui-raised); }
.inventory-admin .purchase-tabs { flex-wrap:nowrap; }
.inventory-admin .inventory-filter { align-items:end; }
.inventory-photo { flex:0 0 64px; }
.client-shell .client-header .brand { gap:8px; }
.client-header .brand strong { font-size:18px; }
.client-header .brand-mark { width:32px; height:32px; font-size:20px; }
.client-toolbar .search-inline input { min-width:0; }
.client-order { padding:20px; margin-bottom:16px; }
.client-order-top { align-items:flex-start; gap:12px; }
.client-order-top .muted { display:block; margin-top:4px; }
.activity-card .activity-actions .button { min-height:44px; }
.login-form { width:360px; max-width:100%; }
.login-form-wrap { padding:32px 24px; }
.login-form .field { margin-bottom:20px; }
.login-form p { margin-bottom:20px; }
.login-alt { margin-top:24px; }
.client-body .login-form-wrap { min-height:calc(100dvh - 80px); }

/* 7. Details: table states, one status mark, consistent radii and keyboard focus. */
.button,.icon-button,.field input,.field select,.field textarea,.input,.code,.metric-pill { border-radius:8px; }
.panel,.stat,.purchase-card,.activity-card,.client-order { border-radius:12px; }
.modal { border-radius:16px; }
.brand-mark { border-radius:8px; }
.badge { border-radius:4px; padding:4px 8px; gap:6px; }
.badge i { display:inline-block; flex:0 0 5px; width:5px; height:5px; border-radius:50%; background:currentColor; }
.icon-button { width:36px; height:36px; }
.link-button { border-radius:4px; }
th { color:var(--ui-secondary); background:#f4f6f4; padding:12px 16px; border-color:var(--ui-line); }
td { padding:16px; border-color:#e9edea; color:var(--ui-secondary); }
th.numeric-cell,td.numeric-cell { text-align:right; font-variant-numeric:tabular-nums; }
tbody tr:hover { background:#f7f9f7; }
tbody tr:has(input[type=checkbox]:checked)>td { background:#edf5ef; }
.orders-panel>.table-wrap tbody tr:has(.row-check:checked)>td:nth-child(-n+3) { background:#edf5ef; }
tbody tr:focus-within { outline:1px solid #93b6a3; outline-offset:-1px; }
.button:focus-visible,.link-button:focus-visible,a:focus-visible,summary:focus-visible,
.field input:focus-visible,.field select:focus-visible,.field textarea:focus-visible,
.input:focus-visible,.icon-button:focus-visible { outline:2px solid var(--ui-accent); outline-offset:3px; }
input[type=checkbox],input[type=radio] { accent-color:var(--ui-accent); }
.button:disabled { cursor:not-allowed; opacity:.55; }
.rank-number,.rank-row:first-child .rank-number { color:var(--ui-muted); background:transparent; font-size:12px; }
.code { background:var(--ui-raised); color:var(--ui-secondary); }
.report-purchase { border:1px solid var(--ui-line); border-radius:8px; padding:12px; background:var(--ui-raised); }
.button.pricing-toggle { background:var(--ui-accent-soft); border-color:#bdd3c6; color:var(--ui-accent); }
.detail-grid small,.scope-label { color:var(--ui-muted); font-size:12px; }
.field small { font-size:12px; }

/* 8. Visuals: actual amounts and the existing trend, without decorative artwork. */
.chart { height:260px; padding:16px 8px 28px; margin-top:20px; gap:12px; }
.chart-wrap { padding:0 24px 16px; }
.chart-bar { max-width:24px; border-radius:3px 3px 0 0; background:#c7d2ca; }
.chart-col:last-child .chart-bar { background:var(--ui-accent); }
.chart-label { bottom:4px; }
.dot { width:6px; height:6px; background:var(--ui-accent); }
.rank-bar { background:#e9eeeb; border-radius:2px; }
.rank-bar i { background:#b8c8bd; }
.rank-row:first-child .rank-bar i { background:var(--ui-accent); }
.empty { padding:32px 20px; color:var(--ui-muted); }
.empty strong { font-size:14px; font-weight:500; }

/* Platform owner uses the same material, controls and figures as the tenant tools. */
.platform-body main { max-width:1440px; padding:32px; }
.platform-body h1 { font-size:28px; font-weight:500; }
.platform-body h2 { font-size:20px; font-weight:500; margin-bottom:16px; }
.platform-body header { gap:16px; margin-bottom:24px; }
.platform-body .panel { border-color:var(--ui-line); border-radius:12px; padding:24px; margin-bottom:20px; }
.platform-body .grid { gap:16px; }
.platform-body label { gap:8px; margin-bottom:16px; font-size:13px; color:var(--ui-secondary); }
.platform-body input,.platform-body select,.platform-body button { border-radius:8px; border-color:#cdd6cf; min-height:40px; padding:8px 12px; color:var(--ui-ink); font-family:inherit; font-size:14px; }
.platform-body button { min-height:36px; color:var(--ui-secondary); }
.platform-body button.primary { background:var(--ui-accent); border-color:var(--ui-accent); color:#fff; }
.platform-body button.primary:hover { background:var(--ui-accent-hover); }
.platform-body button.danger { color:var(--ui-danger); }
.platform-body .actions { gap:8px; }
.platform-body .badge { color:#176f53; background:#edf6ef; }
.platform-body .badge.off { color:var(--ui-danger); background:var(--ui-danger-soft); }
.platform-body .muted,.platform-body .customer-row small { color:var(--ui-muted); font-size:13px; }
.platform-body .systems { gap:20px; }
.platform-body .system header { margin-bottom:12px; }
.platform-body .system .links { grid-template-columns:72px minmax(0,1fr); gap:8px 16px; margin:16px 0; font-size:14px; }
.platform-body .system .links>span { color:var(--ui-muted); }
.platform-body .system .links>a { text-decoration:underline; text-underline-offset:3px; }
.platform-body .customer-row { gap:16px; padding:16px 0; border-color:var(--ui-line); }
.platform-body .system .actions,.platform-body .edit { margin-top:16px; }
.platform-body .login { max-width:440px; margin:10vh auto; padding:32px; }
.platform-body .login h1 { margin-bottom:24px; }
.platform-body .login form>button { width:100%; min-height:44px; }
.platform-body .login small { margin-top:16px; line-height:1.65; }
.platform-body .password-visibility { display:flex; flex-direction:row; gap:8px; align-items:center; }
.platform-body .password-visibility input { min-height:0; width:auto; }
.platform-body dialog { border-radius:16px; padding:24px; border-color:var(--ui-line); color:var(--ui-ink); }
.platform-body dialog::backdrop { background:rgb(24 32 27 / 42%); }
.platform-body button:focus-visible,.platform-body input:focus-visible,.platform-body select:focus-visible { outline:2px solid var(--ui-accent); outline-offset:3px; }
.platform-body .credentials,.platform-body .recovery-codes { background:var(--ui-accent-soft); border-color:#bed6c8; }
.platform-body #notice { background:#263c30; border-radius:8px; padding:12px 20px; }

/* 9. Motion: only short feedback, no moving content or layout animations. */
:root { --ui-ease:cubic-bezier(.22,1,.36,1); }
.button,.link-button,.icon-button,.nav button,.client-nav .button,.platform-body button {
  transition:color 140ms var(--ui-ease),background-color 140ms var(--ui-ease),border-color 140ms var(--ui-ease);
}
#toast { transition:opacity 180ms var(--ui-ease),transform 180ms var(--ui-ease); }
.sidebar { transition:transform 180ms var(--ui-ease); }
.upload-progress-window progress::-webkit-progress-value { transition:none; }
@media(prefers-reduced-motion:reduce) { .button,.link-button,.icon-button,.nav button,.sidebar,#toast,.platform-body button { transition:none; } }

@media(max-width:1000px) and (min-width:801px) {
  :root { --ui-nav:224px; }
  .page { padding:24px; }
  .cards { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media(max-width:800px) {
  :root { --ui-nav:240px; }
  body { font-size:14px; }
  .main { margin-left:0; }
  .sidebar .brand { padding:20px 16px; }
  .sidebar .workspace-chip { margin:0 16px 12px; padding:12px; }
  .sidebar .nav-label { padding:20px 12px 8px; }
  .sidebar .nav button { min-height:40px; padding:8px 12px; margin:2px 0; }
  body.admin-workspace .topbar { height:56px; flex-basis:56px; padding:0 12px; gap:8px; grid-template-columns:36px minmax(0,1fr) auto; }
  .topbar #menu-toggle { width:36px; min-width:36px; height:40px; min-height:40px; }
  .topbar .top-actions { gap:4px; }
  .topbar .top-actions .button { min-height:36px; height:36px; padding:0 8px; font-size:12px; }
  .topbar .top-actions .account-settings { width:32px; padding:0; }
  .topbar .top-actions .avatar { width:28px; height:28px; }
  .page { padding:16px 12px 24px; }
  .page-head { margin-bottom:16px; gap:8px; }
  .page-head h1,.client-hero h1,.client-toolbar h1,.purchase-admin h1 { font-size:22px; font-weight:500; letter-spacing:0; line-height:1.35; }
  .dashboard-head .dashboard-date { font-size:11px; }
  .cards { gap:8px; margin-bottom:16px; }
  .stat { display:block; min-height:108px; padding:12px; border-radius:10px; }
  .stat-label { font-size:12px; }
  .stat-value { font-size:clamp(18px,5.2vw,24px); margin-top:8px; text-align:left; line-height:1.2; letter-spacing:0; overflow-wrap:normal; white-space:nowrap; }
  .stat-value em { font-size:12px; margin-right:4px; }
  .stat-foot { margin-top:8px; font-size:11px; line-height:1.5; }
  .dashboard-grid { gap:0; }
  .panel { margin-bottom:16px; border-radius:12px; }
  .panel-head { padding:16px 16px 0; gap:8px; }
  .panel-head h3 { font-size:15px; }
  .panel-head p,.chart-legend { font-size:12px; }
  .panel-content,.client-body .panel-content { padding:16px; }
  .panel-table { margin-top:12px; }
  body.admin-workspace .dashboard-recent .table-wrap { overflow-x:hidden; }
  body.admin-workspace .dashboard-recent table { display:block; min-width:0; width:100%; white-space:normal; }
  body.admin-workspace .dashboard-recent thead { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); }
  body.admin-workspace .dashboard-recent tbody { display:block; width:100%; }
  body.admin-workspace .dashboard-recent tbody tr { display:grid; grid-template-columns:minmax(0,1fr) auto; grid-template-areas:"identity status" "product amount"; gap:4px 12px; padding:12px 16px; border-top:1px solid var(--ui-line); }
  body.admin-workspace .dashboard-recent tbody tr:nth-child(n+6) { display:none; }
  body.admin-workspace .dashboard-recent td { display:block; padding:0; border:0; min-width:0; font-size:12px; white-space:normal; overflow-wrap:normal; }
  body.admin-workspace .dashboard-recent td:first-child { grid-area:identity; display:flex; flex-wrap:wrap; align-items:baseline; gap:0 8px; }
  body.admin-workspace .dashboard-recent td:first-child strong { white-space:nowrap; max-width:100%; }
  body.admin-workspace .dashboard-recent td:first-child .link-button { font-size:12px; }
  body.admin-workspace .dashboard-recent td:nth-child(2) { grid-area:product; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  body.admin-workspace .dashboard-recent td:nth-child(3) { grid-area:amount; text-align:right; align-self:end; white-space:nowrap; }
  body.admin-workspace .dashboard-recent td:nth-child(4) { grid-area:status; text-align:right; }
  body.admin-workspace .dashboard-recent td small { display:inline; font-size:11px; margin-top:0; }
  .dashboard-recent .badge { font-size:11px; padding:3px 6px; }
  .workflow { padding:8px 16px 12px; }
  .workflow-row { min-height:48px; padding:8px 0; }
  .workflow-label { gap:12px; font-size:14px; }
  .workflow-num { min-width:44px; min-height:44px; font-size:20px; }
  .circle-icon { width:28px; height:28px; }
  .ranking { padding:0 16px 16px; }
  .chart { height:192px; gap:8px; margin-top:16px; }
  .chart-wrap { padding:0 16px 12px; }
  .chart-col:nth-child(even) .chart-label { visibility:hidden; }
  .button { min-height:40px; padding:8px 12px; font-size:13px; }
  .button.primary { min-height:44px; }
  .button.small { min-height:36px; font-size:12px; }
  .filter,.toolbar { padding:12px; gap:12px; }
  body.admin-workspace .page-head.orders-head { gap:8px; padding:0; margin-bottom:12px; }
  body.admin-workspace .orders-head .orders-heading h1 { font-size:20px; font-weight:500; line-height:1.4; }
  body.admin-workspace .orders-head .order-all-tab,
  body.admin-workspace .orders-head .order-quick-filters .button,
  body.admin-workspace .orders-head>.actions .button,
  body.admin-workspace .orders-head .order-quick-filters .quick-edit { min-height:36px; height:36px; padding:8px; font-size:12px; line-height:18px; }
  body.admin-workspace .orders-panel>.toolbar { padding:12px; gap:8px; }
  body.admin-workspace .orders-panel>.toolbar .button { min-height:36px; padding:8px; font-size:12px; }
  body.admin-workspace .orders-panel .selection { font-size:12px; }
  body.admin-workspace .main .orders-panel .filter .field input,
  body.admin-workspace .main .orders-panel .filter .field select { min-height:44px; height:44px; padding:8px; font-size:16px; }
  body.admin-workspace .orders-panel>.table-wrap th,
  body.admin-workspace .orders-panel>.table-wrap td { font-size:12px; }
  body.admin-workspace .orders-panel>.table-wrap td small,
  body.admin-workspace .orders-panel .order-identity-product,
  body.admin-workspace .orders-panel .order-identity-mobile small,
  body.admin-workspace .orders-panel .order-identity-mobile time { font-size:11px; color:var(--ui-muted); }
  body.admin-workspace .orders-panel>.table-wrap .row-actions .link-button { min-height:32px; font-size:12px; }
  body.admin-workspace .reports-tabs { gap:4px; margin-bottom:12px; }
  body.admin-workspace .reports-tabs button { min-height:40px; padding:8px 4px; font-size:12px; }
  body.admin-workspace .main #report-filters .field input,
  body.admin-workspace .main #report-filters .field select { min-height:44px; height:44px; padding:8px; font-size:16px; }
  .field>span,.form-note,.purchase-meta,.client-order-summary { font-size:12px; }
  .form-grid,.client-body .form-grid { gap:16px 12px; }
  .modal .form-grid:has(input[name=barcode])>.field:nth-child(-n+4),
  .modal .form-grid:has(input[name=barcode])>.field:has(input[type=file]) { grid-column:1/-1; }
  .field input:not([type=checkbox]):not([type=radio]),.field select,.input { min-height:44px; padding:8px 12px; font-size:16px; }
  .field textarea { font-size:16px; }
  .overlay { padding:12px; }
  .modal { max-height:calc(100dvh - 24px); border-radius:16px; }
  .modal-head,.modal-body,.modal-foot,.client-body .modal-head,.client-body .modal-body,.client-body .modal-foot { padding:16px; }
  .modal-head h2 { font-size:20px; }
  .modal-foot { flex-wrap:wrap; }
  .modal-foot #form-error { width:100%; max-width:none; flex:1 0 100%; font-size:13px; }
  .modal-foot #form-error:empty { display:none; }
  .modal-foot .button { min-height:44px; }
  .client-shell:not(.purchase-shell),.buyer-page .purchase-shell { padding:0 12px calc(88px + env(safe-area-inset-bottom)); }
  .client-shell:not(.purchase-shell) .client-header,.buyer-page .purchase-shell .client-header { margin:0 0 16px; padding:16px 0; min-height:64px; gap:8px; }
  .client-shell:not(.purchase-shell) .client-header .brand strong,.buyer-page .purchase-shell .client-header .brand strong { font-size:18px; }
  .client-shell:not(.purchase-shell) .client-nav,.buyer-page .purchase-shell .client-nav { gap:4px; padding:8px 8px calc(8px + env(safe-area-inset-bottom)); border-color:var(--ui-line); box-shadow:none; }
  .client-shell:not(.purchase-shell) .client-nav .button,.buyer-page .purchase-shell .client-nav .button { min-height:44px; padding:8px 4px; font-size:13px; border-radius:8px; }
  .client-nav .button.active { background:var(--ui-accent-soft); color:var(--ui-accent); border-color:transparent; }
  .client-shell:not(.purchase-shell) .client-toolbar { margin-bottom:16px; gap:12px; align-items:center; }
  .client-shell:not(.purchase-shell) .client-toolbar h1 { font-size:22px; }
  .client-toolbar .search-inline { gap:8px; }
  .client-toolbar .search-inline .button { min-height:44px; }
  .client-shell:not(.purchase-shell) .activity-grid { gap:12px; }
  .client-shell:not(.purchase-shell) .activity-card { padding:16px; border-radius:12px; }
  .client-shell:not(.purchase-shell) .activity-card h3 { font-size:18px; line-height:1.5; margin:8px 0 12px; }
  .client-shell:not(.purchase-shell) .activity-description { margin-bottom:12px; font-size:13px; }
  .client-shell:not(.purchase-shell) .activity-metrics { font-size:14px; }
  .client-shell:not(.purchase-shell) .activity-limit { padding:12px 0; margin:12px 0; }
  .client-shell:not(.purchase-shell) .activity-limit strong { font-size:20px; }
  .client-shell:not(.purchase-shell) .activity-limit small { font-size:12px; }
  .client-shell:not(.purchase-shell) .activity-card .activity-actions { margin-top:12px; gap:8px; }
  .client-shell:not(.purchase-shell) .activity-card .activity-actions .button { min-height:44px; font-size:14px; }
  .client-attention { padding:12px 16px; margin-bottom:16px; }
  .client-attention-row { gap:8px; font-size:13px; }
  .client-attention-row .button { min-height:44px; padding:8px; font-size:13px; }
  .client-order { padding:16px; margin-bottom:12px; }
  .client-order-top h3 { font-size:17px; }
  .client-order-top .muted { font-size:12px; }
  .client-order-filters { padding:12px; gap:12px; }
  .client-order-filters input,.client-order-filters select,.client-order-search .button { min-height:44px; height:44px; }
  .buyer-page .purchase-shell .purchase-client-toolbar { gap:12px; margin-bottom:16px; }
  .buyer-page .purchase-shell .purchase-client-toolbar h1 { font-size:22px; }
  .buyer-page .purchase-shell .purchase-intro { margin-top:4px; font-size:13px; }
  .buyer-page .purchase-shell .search-inline { gap:8px; }
  .buyer-page .purchase-shell .search-inline input,.buyer-page .purchase-shell .search-inline .button { min-height:44px; padding:8px 12px; }
  .buyer-page .purchase-shell .purchase-list { gap:12px; }
  .buyer-page .purchase-shell .purchase-card { padding:16px; }
  .buyer-page .purchase-shell .purchase-card h3 { font-size:18px; line-height:1.5; }
  .buyer-page .purchase-shell .purchase-task-tag { padding:0; margin-bottom:4px; }
  .buyer-page .purchase-shell .purchase-task-spec { margin:4px 0; font-size:13px; }
  .buyer-page .purchase-shell .purchase-meta { margin:4px 0; font-size:12px; }
  .buyer-page .purchase-shell .purchase-task-metrics { gap:12px; padding:12px 0; margin:8px 0; }
  .buyer-page .purchase-shell .purchase-task-metrics small { font-size:12px; margin-bottom:4px; }
  .buyer-page .purchase-shell .purchase-task-metrics strong { font-size:22px; font-weight:500; }
  .buyer-page .purchase-shell .purchase-card .actions { margin-top:8px; gap:8px; }
  .buyer-page .purchase-shell .purchase-card .actions .button { min-height:44px; font-size:14px; }
  .purchase-admin h1 { font-size:22px; }
  .purchase-card { padding:16px; }
  .purchase-list,.purchase-stock-grid { gap:12px; }
  .purchase-admin .purchase-tabs { gap:4px; padding-bottom:8px; margin-bottom:16px; }
  .inventory-admin .purchase-page-head { display:flex; flex-wrap:wrap; gap:12px; margin-bottom:16px; }
  .inventory-admin .purchase-page-head>.actions { width:100%; justify-content:flex-start; margin-top:0; gap:8px; }
  .inventory-admin .purchase-page-head .button { min-height:40px; padding:8px 12px; font-size:13px; }
  .inventory-more { margin-left:auto; }
  .inventory-more-menu .button { min-height:44px; }
  .inventory-admin .purchase-tabs { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:4px; }
  .inventory-admin .purchase-tabs .button { padding:8px 4px; min-height:40px; font-size:13px; }
  .inventory-admin .inventory-filter { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:12px; margin:16px 0; }
  .inventory-admin .inventory-filter .field { min-width:0; }
  .inventory-admin .inventory-filter .check { padding-bottom:0; align-self:center; }
  .inventory-admin .inventory-filter>.button { justify-self:end; min-width:64px; }
  .inventory-admin .purchase-stock-grid { grid-template-columns:minmax(0,1fr); }
  .inventory-admin .purchase-card { padding:16px; }
  .inventory-admin .purchase-card h3 { font-size:18px; }
  .inventory-alert { padding:12px; margin:0 0 16px; gap:8px; font-size:13px; }
  .inventory-alert .button { padding:8px; min-height:36px; }
  .platform-body main { padding:20px 12px; }
  .platform-body h1 { font-size:22px; }
  .platform-body h2 { font-size:18px; }
  .platform-body header { gap:12px; margin-bottom:20px; }
  .platform-body .panel { padding:16px; margin-bottom:16px; }
  .platform-body .grid,.platform-body .systems { gap:12px; }
  .platform-body .actions button { min-height:40px; padding:8px 12px; font-size:13px; }
  .platform-body input:not([type=checkbox]),.platform-body select { min-height:44px; font-size:16px; }
  .platform-body .system .links { grid-template-columns:64px minmax(0,1fr); gap:8px 12px; font-size:13px; }
  .platform-body .customer-row { padding:16px 0; gap:12px; font-size:13px; }
  .platform-body .login { margin:5vh auto; padding:24px; }
  .platform-body dialog { padding:20px; width:calc(100% - 24px); max-width:480px; }
}
@media(max-width:359px) {
  .stat { padding:12px 8px; }
  .stat-value { font-size:18px; }
  .stat-foot { font-size:11px; }
  .inventory-admin .purchase-page-head .button { padding:8px; font-size:12px; }
  .client-shell:not(.purchase-shell) .client-toolbar { flex-wrap:wrap; }
  .client-shell:not(.purchase-shell) .client-toolbar .search-inline { flex-basis:100%; max-width:none; }
}
