@charset "UTF-8";

:root {
  color-scheme: light;
  --navy: #122e3b;
  --navy-deep: #102632;
  --navy-light: #234450;
  --teal: #167d70;
  --teal-dark: #116357;
  --teal-pale: #e9f3ee;
  --canvas: #f4f4ef;
  --paper: #fff;
  --ink: #22353a;
  --muted: #586c63;
  --text-body: 16px;
  --text-secondary: 15px;
  --text-small: 14px;
  --text-help: 13px;
  --text-decorative: 12px;
  --text-title: 32px;
  --stat-number: 44px;
  --line: #e8ebe5;
  --warm: #a66d24;
  --danger: #ad4a43;
  --shadow: 0 20px 70px #122e3b14;
  --font: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --digits: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: var(--font); font-size: var(--text-body); line-height: 1.75; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .55; }
button, a, input, textarea, select, dialog { outline-offset: 4px; }
:focus-visible { outline: 2px solid var(--teal); }
a { color: inherit; }
button { color: inherit; }
button, input, textarea, select { border-radius: 6px; }
button { transition: background .15s, color .15s, border-color .15s, box-shadow .15s; }
input, select, textarea { min-width: 0; }
input, textarea { width: 100%; }
input, textarea, select { color: var(--ink); background: #fff; border: 1px solid #c9d4cc; padding: 11px 14px; font-size: var(--text-body); min-height: 48px; line-height: 1.6; }
input:hover, textarea:hover, select:hover { border-color: #aabdb3; }
input:focus, textarea:focus, select:focus { outline: 2px solid #167d7025; border-color: var(--teal); }
input::placeholder, textarea::placeholder { color: var(--muted); }
textarea { resize: vertical; min-height: 88px; }
input[type="checkbox"] { width: 22px; height: 22px; margin: 0; accent-color: var(--teal); flex: 0 0 22px; min-height: 22px; }
select { cursor: pointer; }
fieldset { min-width: 0; }
fieldset:disabled { opacity: .64; }
h1, h2, h3, h4, p { margin: 0; }
button .icon { flex-shrink: 0; }
.icon { display: inline-block; width: 19px; height: 19px; vertical-align: middle; flex-shrink: 0; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 11px 18px; border: 1px solid transparent; font-weight: 600; text-decoration: none; white-space: nowrap; font-size: var(--text-body); line-height: 1.5; }
.button.primary { background: var(--teal); color: #fff; box-shadow: 0 2px 3px #122e3b08; }
.button.primary:hover { background: var(--teal-dark); }
.button.secondary { background: #fff; color: var(--ink); border-color: #dce3dc; }
.button.secondary:hover { background: #f3f6f2; border-color: #bfcfc4; }
.button.small { min-height: 46px; padding: 10px 14px; font-size: var(--text-body); gap: 8px; }
.button.small .icon { width: 19px; height: 19px; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; padding: 10px; color: var(--muted); background: transparent; border: 1px solid transparent; flex-shrink: 0; }
.icon-button:hover { background: #eaf0eb; color: var(--navy); }
.text-button { padding: 9px 8px; border: 0; background: transparent; color: var(--teal); font-size: var(--text-body); min-height: 44px; }
.text-button:hover { text-decoration: underline; }
.eyebrow { font-family: var(--digits); font-size: var(--text-decorative); font-weight: 600; letter-spacing: .13em; color: var(--teal); line-height: 1.5; }
.eyebrow.light { color: #81b2a9; }
.subtle { color: var(--muted); }
.positive { color: var(--teal); }
.warm-text { color: var(--warm); }
.danger-text { color: var(--danger); }
.skip-link { position: fixed; top: -80px; left: 16px; padding: 10px 20px; color: #fff; background: var(--navy); z-index: 20; border-radius: 0 0 6px 6px; }
.skip-link:focus { top: 0; }
.initial-loading { min-height: 100vh; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 18px; padding: 30px; text-align: center; color: var(--muted); }
.initial-loading h1 { font-size: 30px; color: var(--ink); }
.loading-mark { display: inline-block; width: 26px; height: 26px; border: 2px solid #d9e4dd; border-top-color: var(--teal); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes enter { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }

/* Identity / onboarding */
.demo-bar { display: flex; align-items: center; gap: 16px; min-height: 64px; padding: 8px 26px; color: #705629; background: #f8efd8; border-bottom: 1px solid #ecdfbe; font-size: var(--text-small); flex-wrap: wrap; }
.demo-label { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; font-weight: 700; letter-spacing: .04em; }
.demo-dot { width: 6px; height: 6px; border-radius: 50%; background: #b58636; }
.demo-switch { display: flex; align-items: center; gap: 9px; margin-left: auto; white-space: nowrap; }
.demo-switch select { max-width: 340px; padding: 9px 30px 9px 12px; min-height: 46px; background: #fff9ec; border-color: #dfcfaa; font-size: var(--text-body); }
.auth-layout { display: grid; grid-template-columns: minmax(420px, .95fr) minmax(460px, 1.05fr); min-height: 100vh; }
.demo-bar + .auth-layout { min-height: calc(100vh - 64px); }
.auth-story { position: relative; display: flex; flex-direction: column; padding: 52px 64px 34px; color: #fff; background: var(--navy); overflow: hidden; }
.auth-story::before { content: ""; position: absolute; width: 500px; height: 500px; border: 1px solid #80a69d17; border-radius: 50%; left: 55%; top: 42%; }
.auth-story::after { content: ""; position: absolute; width: 680px; height: 680px; border: 1px solid #80a69d12; border-radius: 50%; left: 43%; top: 33%; }
.wordmark { display: flex; align-items: center; gap: 15px; font-size: var(--text-body); letter-spacing: .1em; }
.brand-text { font-size: 28px; font-weight: 700; letter-spacing: .14em; }
.brand-divider { width: 1px; height: 18px; background: #91aca355; }
.auth-story-main { position: relative; z-index: 1; margin: auto 0; padding: 65px 0 80px; }
.auth-story h1 { font-size: var(--text-title); font-weight: 500; letter-spacing: .03em; line-height: 1.6; margin: 22px 0 24px; }
.auth-story-main > p { color: #a9bbb8; line-height: 2; font-size: var(--text-body); letter-spacing: .03em; }
.auth-route { display: flex; gap: 14px; align-items: center; margin-top: 55px; font-size: var(--text-small); color: #bacbc2; }
.auth-route b { color: #669187; font-size: 16px; font-weight: 400; }
.auth-foot { color: #b1c7c1; font-size: var(--text-decorative); letter-spacing: .1em; }
.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px; position: relative; }
.auth-card { max-width: 420px; width: 100%; animation: enter .4s ease both; }
.auth-card h2 { font-size: 30px; margin: 13px 0; font-weight: 600; letter-spacing: .01em; }
.auth-card > p { font-size: var(--text-body); line-height: 1.9; margin-bottom: 30px; }
.auth-card form { display: flex; flex-direction: column; gap: 18px; }
.auth-submit { margin-top: 7px; width: 100%; justify-content: space-between; padding: 12px 18px; }
.auth-demo-note { color: var(--muted); text-align: center; margin-top: 22px; font-size: var(--text-help); }
.auth-bottom { position: absolute; bottom: 32px; font-size: var(--text-decorative); color: var(--muted); padding: 0 16px; }

/* Workspace skeleton */
.app-layout { display: flex; align-items: stretch; min-height: 100vh; }
.demo-bar + .app-layout { min-height: calc(100vh - 64px); }
.sidebar { width: 216px; flex: 0 0 216px; padding: 32px 16px 24px; background: var(--navy); color: #c5d8d2; display: flex; flex-direction: column; }
.sidebar-brand { display: flex; flex-direction: column; align-items: flex-start; margin-left: 16px; width: fit-content; text-decoration: none; }
.sidebar-brand-cn { font-size: 28px; color: #fff; letter-spacing: .17em; font-weight: 700; line-height: 1.5; }
.sidebar-brand-en { font-size: var(--text-small); margin-top: 5px; letter-spacing: .25em; color: #b6cdc5; }
.sidebar-rule { height: 1px; margin: 27px 13px 26px; background: #68848a30; }
.sidebar-label { display: block; margin: 0 17px 14px; font-size: var(--text-help); color: #abc8c1; letter-spacing: .1em; }
.sidebar nav { display: flex; flex-direction: column; gap: 6px; }
.nav-item { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; padding: 12px 13px; background: transparent; border: 0; color: #c3d6d1; font-size: var(--text-body); font-weight: 500; min-height: 50px; }
.nav-item .icon { width: 21px; height: 21px; color: #a7c6bf; }
.nav-item:hover { color: #fff; background: #ffffff07; }
.nav-item.active { color: #fff; background: var(--navy-light); box-shadow: inset 3px 0 #58aa91; }
.nav-item.active .icon { color: #83bcaa; }
.nav-count { margin-left: auto; background: #ffffff0d; font-family: var(--digits); font-size: var(--text-small); padding: 1px 5px; border-radius: 3px; min-width: 25px; text-align: center; }
.sidebar-bottom { margin: auto 0 0 12px; padding-top: 35px; font-size: var(--text-decorative); display: flex; align-items: center; gap: 7px; color: #aec7bf; white-space: nowrap; }
.sidebar-system-dot { width: 5px; height: 5px; border-radius: 50%; background: #61a188; }
.workspace { display: flex; flex-direction: column; flex: 1 1 0; min-width: 0; }
.topbar { height: 76px; padding: 0 34px; display: flex; align-items: center; justify-content: space-between; background: #ffffffb8; border-bottom: 1px solid var(--line); }
.breadcrumb { color: var(--muted); font-size: var(--text-small); display: flex; gap: 13px; align-items: center; }
.breadcrumb > span { color: var(--muted); }
.breadcrumb strong { color: #5c726a; font-weight: 500; }
.account { display: flex; align-items: center; gap: 10px; }
.avatar { display: inline-flex; justify-content: center; align-items: center; height: 40px; width: 40px; flex: 0 0 40px; border-radius: 50%; background: #eaf0e8; color: #4a6c5f; font-size: var(--text-body); font-weight: 600; }
.account-copy { display: flex; flex-direction: column; line-height: 1.5; }
.account-copy strong { font-size: var(--text-body); font-weight: 600; }
.account-copy small { font-size: var(--text-help); color: var(--muted); }
.logout-button { margin-left: 9px; border-left: 1px solid #e4e9e2; border-radius: 0; width: 46px; height: 46px; padding-left: 13px; }
.main-content { flex: 1; padding: 28px 34px 27px; animation: enter .35s ease both; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 20px; flex-wrap: wrap; }
.page-heading .eyebrow { color: var(--muted); font-size: var(--text-decorative); display: none; }
.page-heading h1 { font-size: var(--text-title); font-weight: 600; line-height: 1.4; letter-spacing: .025em; margin: 0 0 7px; }
.heading-dot { color: var(--teal); padding-left: 3px; }
.page-heading p { color: var(--muted); font-size: var(--text-secondary); line-height: 1.8; }
.heading-actions { display: flex; gap: 10px; }
.workbench-overview { display: grid; flex-wrap: wrap; align-items: center; gap: 12px 20px; background: #fff; padding: 16px 22px 13px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 13px; grid-template-columns: minmax(0, 1fr) auto; }
.workbench-scope { display: flex; flex-direction: row; gap: 6px 12px; margin-right: auto; align-items: baseline; }
.workbench-scope > span { color: var(--muted); font-size: var(--text-help); letter-spacing: .06em; }
.workbench-scope strong { font-size: var(--text-body); font-weight: 500; color: #56705a; }
.workbench-scope small { color: var(--muted); font-size: var(--text-help); }
.workbench-counts { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.workbench-counts > div { display: flex; align-items: baseline; gap: 8px; }
.workbench-counts > div + div { padding-left: 18px; border-left: 1px solid #e7eddf; }
.workbench-counts span { color: var(--muted); font-size: var(--text-small); white-space: nowrap; }
.workbench-counts strong { color: var(--navy); font-family: var(--digits); font-size: var(--stat-number); font-weight: 400; line-height: 1.15; }
.workbench-counts > div:nth-child(2) strong { color: var(--teal); }
.workbench-counts small { color: var(--muted); font-size: var(--text-small); }
.workbench-explanation { flex-basis: 100%; padding-top: 10px; border-top: 1px solid #eff2e9; color: var(--muted); font-size: var(--text-help); line-height: 1.7; grid-column: 1 / -1; }
.pending-operations { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 13px; background: #fbf5e7; border: 1px solid #eee3c7; color: #80602f; border-radius: 7px; padding: 15px 18px; margin-bottom: 20px; }
.pending-operations strong { font-size: var(--text-body); font-weight: 600; }
.pending-operations p { font-size: var(--text-small); margin-top: 4px; }
.pending-operation-list { display: flex; flex-wrap: wrap; gap: 7px; }
.pending-operation-list .button { max-width: 100%; white-space: normal; text-align: left; justify-content: flex-start; font-size: var(--text-body); overflow-wrap: anywhere; }
.workspace-footer { display: flex; justify-content: space-between; margin: auto 34px 0; padding: 19px 0; border-top: 1px solid #e6e9e1; font-size: var(--text-decorative); letter-spacing: .03em; color: var(--muted); gap: 16px; }

/* Counts, filters and list */
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.stat-card { display: grid; flex-direction: column; align-items: center; text-align: left; min-width: 0; background: #fff; border: 1px solid var(--line); padding: 14px 16px; border-radius: 7px; box-shadow: 0 2px 2px #1b3f2c02; min-height: 138px; gap: 8px 10px; grid-template-columns: minmax(0, 1fr) auto; }
.stat-card:hover { border-color: #a8bfb0; box-shadow: 0 3px 12px #122e3b06; }
.stat-card.selected { border-color: #70a58c; background: #f5fbf7; }
.stat-label { display: flex; gap: 7px; align-items: center; font-size: var(--text-body); color: #4e6358; white-space: normal; line-height: 1.5; }
.stat-indicator { width: 7px; height: 7px; border-radius: 50%; background: #8b9a92; flex-shrink: 0; }
.indicator-1 { background: #d2a760; }
.indicator-2 { background: #8c9daf; }
.indicator-3 { background: #7cb4ac; }
.indicator-4 { background: #b4a095; }
.indicator-5 { background: #328469; }
.indicator-6 { background: #9e9b75; }
.stat-card > strong { font-family: var(--digits); color: var(--navy); font-weight: 400; font-size: var(--stat-number); line-height: 1.1; margin: 0; letter-spacing: -.03em; justify-self: end; }
.stat-caption { width: 100%; min-height: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 5px; color: var(--muted); font-size: var(--text-help); line-height: 1.6; text-wrap: pretty; overflow-wrap: anywhere; grid-column: 1 / -1; align-self: start; }
.stat-caption .icon { width: 17px; height: 17px; color: var(--muted); margin-top: 3px; }
.stat-card.selected .stat-label { color: var(--teal-dark); }
.stat-card.selected .stat-caption { color: #4f6e59; }
.stat-card.selected .stat-indicator { background: var(--teal); }
.orders-panel { border: 1px solid var(--line); border-radius: 8px; background: #fff; overflow: hidden; box-shadow: 0 3px 5px #173b2902; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px 14px; gap: 16px; flex-wrap: wrap; }
.panel-heading > div { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.panel-heading h2 { font-size: 20px; font-weight: 600; }
.result-count { color: var(--muted); font-size: var(--text-small); padding: 3px 9px; background: #f0f4ee; border-radius: 4px; }
.panel-caption { font-size: var(--text-help); color: var(--muted); }
.filter-primary { display: flex; gap: 14px; padding: 0 24px 14px; flex-wrap: wrap; }
.search-field { position: relative; flex: 1; max-width: none; display: flex; align-items: center; min-width: 280px; }
.search-field .icon { position: absolute; left: 13px; color: var(--muted); width: 20px; height: 20px; pointer-events: none; }
.search-field input { height: 48px; padding: 11px 14px 11px 43px; font-size: var(--text-body); background: #fbfcf9; border-color: #e2e7df; }
.select-field { display: flex; align-items: center; gap: 9px; }
.select-field > span { color: var(--muted); font-size: var(--text-small); white-space: nowrap; }
.select-field select { min-width: 160px; padding: 10px 12px; height: 48px; font-size: var(--text-body); border-color: #e2e7df; background: #fff; }
.filter-secondary { display: flex; align-items: center; gap: 10px 22px; padding: 10px 24px; background: #fcfdfb; border-top: 1px solid #f0f2ed; border-bottom: 1px solid #e6ebe2; flex-wrap: wrap; }
.filter-secondary label { display: inline-flex; gap: 9px; align-items: center; color: var(--muted); font-size: var(--text-small); min-width: 0; }
.filter-secondary select { padding: 9px 24px 9px 8px; font-size: var(--text-body); border: 1px solid #dce4d6; background: #fff; color: #667b67; max-width: 180px; min-height: 46px; }
.filter-secondary .text-button { font-size: var(--text-body); }
.filter-hint { display: flex; align-items: center; gap: 5px; margin-left: auto; font-size: var(--text-help); color: var(--muted); }
.filter-hint .icon { width: 16px; height: 16px; }
.category-feedback { display: flex; justify-content: space-between; align-items: center; gap: 13px; padding: 16px 24px; background: #f1f8ed; border-bottom: 1px solid #e0ecd9; flex-wrap: wrap; }
.category-feedback > div { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.category-feedback strong { color: var(--muted); font-size: var(--text-secondary); font-weight: 500; }
.category-feedback span { color: var(--muted); font-size: var(--text-help); }
.category-feedback .text-button { white-space: normal; font-size: var(--text-body); }
.table-scroll { overflow-x: auto; scrollbar-width: thin; scrollbar-color: #d5dfd2 #fff; max-width: 100%; overscroll-behavior-x: contain; }
table { width: 100%; border-collapse: collapse; text-align: left; }
.orders-table { min-width: 1100px; }
th { background: #fcfdfb; color: #536b5b; padding: 17px 16px; font-weight: 500; font-size: var(--text-small); letter-spacing: .035em; white-space: nowrap; border-bottom: 1px solid #edf0e9; }
th:first-child, td:first-child { padding-left: 23px; }
th:last-child, td:last-child { padding-right: 23px; }
td { padding: 24px 16px; border-bottom: 1px solid #edf0e9; font-size: var(--text-secondary); vertical-align: middle; color: #4c6354; line-height: 1.7; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fbfdf9; }
.demand-cell { width: 28%; max-width: 380px; min-width: 300px; }
.order-name { border: 0; padding: 0; background: none; font-size: 18px; color: var(--ink); font-weight: 600; text-align: left; border-radius: 2px; line-height: 1.55; max-width: 100%; overflow-wrap: anywhere; min-height: 44px; }
.order-name:hover { color: var(--teal); text-decoration: underline; text-underline-offset: 3px; }
.specification { margin-top: 5px; font-size: var(--text-secondary); color: var(--muted); max-width: 330px; white-space: normal; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.7; }
.order-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: var(--muted); font-size: var(--text-small); margin-top: 11px; }
.order-meta > span + span::before { content: ""; display: inline-block; width: 2px; height: 2px; background: #bdc7b4; vertical-align: middle; margin-right: 7px; }
.order-number { font-family: var(--digits); letter-spacing: .035em; }
.order-work-items { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
.work-item-tag { color: var(--muted); font-size: var(--text-small); line-height: 1.4; background: #f7f9f3; border: 1px solid #e9eee0; border-radius: 3px; padding: 3px 7px; }
.work-item-tag.selected { color: #3f6738; background: #edf6e8; border-color: #cfe0c4; }
.badge { display: inline-flex; align-items: center; justify-content: center; font-size: var(--text-small); padding: 5px 9px; line-height: 1.5; border-radius: 4px; background: #eff3ed; color: var(--muted); white-space: nowrap; }
.stage-selection { color: #4e6753; background: #edf2e9; }
.stage-approval { color: #815920; background: #faf3e1; }
.stage-rejected { color: #963f37; background: #f8ece8; }
.stage-payment { color: #46637d; background: #eef3f8; }
.stage-shipping { color: #3f7063; background: #edf5f1; }
.stage-receiving { color: #226e5f; background: #e8f5ee; }
.stage-invoice { color: #785b47; background: #f6f0e9; }
.stage-completed { color: #286747; background: #e8f3e8; }
.cell-sub { font-size: var(--text-small); color: var(--muted); margin-top: 10px; line-height: 1.75; }
.todo-person { max-width: 190px; overflow-wrap: anywhere; color: var(--muted); display: flex; flex-direction: column; gap: 5px; }
.todo-context { color: var(--muted); font-size: var(--text-help); }
.route-text { font-size: var(--text-secondary); }
.boss-route { color: #4f7982; }
.status-with-dot { display: inline-flex; align-items: center; gap: 7px; font-size: var(--text-secondary); }
.status-with-dot::before { content: ""; height: 6px; width: 6px; background: #b1bdb0; border-radius: 50%; }
.status-with-dot.positive::before { background: #4e987a; }
.table-action-heading { text-align: right; }
.row-actions { text-align: right; width: 156px; white-space: nowrap; }
.row-next { display: inline-flex; align-items: center; justify-content: flex-end; gap: 7px; background: transparent; border: 0; padding: 9px 0; color: var(--teal); font-size: var(--text-body); font-weight: 600; min-height: 44px; }
.row-next:hover { color: var(--teal-dark); text-decoration: underline; text-underline-offset: 3px; }
.row-next .icon { height: 18px; width: 18px; }
.detail-button { display: block; padding: 9px 0; margin: 5px 0 0 auto; background: transparent; border: 0; color: var(--muted); font-size: var(--text-body); min-height: 44px; }
.detail-button:hover { color: var(--teal); }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 310px; text-align: center; padding: 48px 24px; gap: 13px; }
.empty-state > .icon { height: 35px; width: 35px; color: var(--muted); stroke-width: 1; margin-bottom: 3px; }
.empty-state h3 { font-size: 18px; font-weight: 500; }
.empty-state p { font-size: var(--text-body); color: var(--muted); max-width: 520px; }
.empty-state .button { margin-top: 5px; }
.error-state > .icon { color: var(--warm); }
.route-note { display: flex; align-items: center; flex-wrap: wrap; gap: 17px; color: var(--muted); font-size: var(--text-help); margin-top: 20px; }
.route-note-label { color: var(--muted); font-weight: 600; }
.route-note > span { display: inline-flex; align-items: center; gap: 6px; }
.route-line { display: inline-block; width: 12px; height: 2px; background: #75a58e; }
.route-line.boss { background: #809fa8; }
.route-note-end { margin-left: auto; }

/* Procurement detail drawer: consistent reading sizes throughout the record. */
#detail-dialog {
  --text-body: 24px;
  --text-secondary: 24px;
  --text-small: 20px;
  --text-help: 18px;
  --text-decorative: 14px;
  font-size: var(--text-body);
  line-height: 1.7;
  overflow-wrap: anywhere;
}
#detail-dialog .drawer-header h2 { font-size: 30px; }
#detail-dialog .detail-section h3 { font-size: 26px; }
#detail-dialog .quote-product { font-size: 24px; }
#detail-dialog .quote-amount strong { font-size: 32px; font-weight: 600; }
#detail-dialog .fulfillment-grid strong,
#detail-dialog .delivery-record strong,
#detail-dialog .step-timeline li strong,
#detail-dialog .activity-list strong { font-weight: 600; color: var(--ink); }
#detail-dialog .fulfillment-grid > div { min-width: 0; gap: 8px; padding: 0 18px; }
#detail-dialog .step-timeline li > div,
#detail-dialog .activity-list li > div { min-width: 0; }
#detail-dialog .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#detail-dialog .detail-grid > div { min-width: 0; }
#detail-dialog .step-dot { width: 38px; height: 38px; flex-basis: 38px; }
#detail-dialog .step-timeline li::before { left: 18px; top: 39px; }
#detail-dialog .gallery-image { width: 156px; max-width: 100%; }
#detail-dialog .gallery-image > span { white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 480px) {
  #detail-dialog .detail-grid,
  #detail-dialog .fulfillment-grid { grid-template-columns: minmax(0, 1fr); }
  #detail-dialog .fulfillment-grid > div { border-left: 0; }
  #detail-dialog .fulfillment-grid > div + div { padding-top: 18px; border-top: 1px solid var(--line); }
  #detail-dialog .assignment-reference { display: flex; align-items: flex-start; }
  #detail-dialog .assignment-reference .icon { flex-shrink: 0; margin-top: 9px; }
}
dialog { border: none; padding: 0; background: #fff; color: var(--ink); box-shadow: var(--shadow); }
dialog::backdrop { background: #10263270; backdrop-filter: blur(2px); }
.drawer { width: 720px; max-width: 100%; height: 100dvh; max-height: 100dvh; margin: 0 0 0 auto; border-radius: 0; overflow: auto; }
.drawer[open] { animation: drawer-enter .24s ease both; }
@keyframes drawer-enter { from { transform: translateX(32px); opacity: .6; } to { transform: translateX(0); opacity: 1; } }
.drawer-header { padding: 25px 30px 23px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; gap: 15px; justify-content: space-between; background: #fff; position: sticky; top: 0; z-index: 2; }
.drawer-header .eyebrow { font-size: var(--text-help); color: var(--muted); }
.drawer-header h2 { font-size: 26px; margin-top: 7px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.drawer-header .icon-button { margin-right: -8px; }
.drawer-content { padding: 0 30px 24px; }
.detail-stage { margin: 0 -30px; padding: 23px 30px 25px; background: #f7faf5; border-bottom: 1px solid #e8eee3; }
.detail-stage .badge { font-size: var(--text-secondary); padding: 6px 11px; }
.detail-route { color: var(--muted); font-size: var(--text-secondary); margin-left: 12px; }
.detail-stage > p { margin-top: 15px; display: flex; gap: 10px 18px; align-items: baseline; font-size: var(--text-small); color: var(--muted); flex-wrap: wrap; }
.detail-stage > p strong { font-weight: 500; color: #4e6b53; font-size: var(--text-body); }
.detail-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; }
.detail-actions:empty { display: none; }
.detail-section { padding: 28px 0; border-bottom: 1px solid var(--line); }
.detail-section h3 { font-size: 18px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 17px; font-weight: 600; gap: 14px; flex-wrap: wrap; }
.detail-section h3 > span { font-family: var(--digits); font-size: var(--text-decorative); letter-spacing: .13em; color: var(--muted); font-weight: 400; }
.spec-box { background: #f5f7f2; border-left: 2px solid #9ab69b; padding: 13px 15px; margin-bottom: 19px; }
.spec-box > span { font-size: 20px; color: var(--muted); }
.spec-box p { margin-top: 8px; font-size: 24px; line-height:1.65; font-weight:600; color: #243e37; white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 24px; margin: 0; }
.detail-grid dt { color: var(--muted); font-size: 20px; margin-bottom: 9px; }
.detail-grid dd { margin: 0; font-size: 24px; line-height:1.6; font-weight:600; color: #243e37; overflow-wrap: anywhere; }
.quote-summary { position: relative; background: #fafbf8; border: 1px solid #e8eee2; border-radius: 6px; padding: 20px; margin-bottom: 18px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 20px; }
.quote-product { font-size: 18px; font-weight: 600; padding-right: 0; overflow-wrap: anywhere; grid-column: 1; }
.quote-summary > p { font-size: var(--text-small); color: var(--muted); margin-top: 6px; padding-right: 0; overflow-wrap: anywhere; grid-column: 1; margin: 0; }
.quote-amount { position: static; top: auto; right: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; grid-column: 2; grid-row: 1 / span 2; max-width: 280px; overflow-wrap: anywhere; }
.quote-amount strong { font-family: var(--digits); font-size: 28px; font-weight: 500; color: var(--teal); line-height: 1.4; max-width: 100%; }
.quote-amount span { font-size: var(--text-help); color: var(--muted); }
.note-box { margin-top: 20px; font-size: var(--text-small); padding: 16px; border: 1px dashed #dfe6d8; border-radius: 5px; }
.note-box > span { color: var(--muted); font-size: var(--text-small); }
.note-box p { color: var(--muted); margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.section-empty { font-size: var(--text-small); color: var(--muted); line-height: 1.9; }
.fulfillment-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid #e4ebdd; border-radius: 6px; padding: 20px 0; gap: 20px 0; }
.fulfillment-grid > div { display: flex; flex-direction: column; gap: 4px; padding: 0 13px; border-left: 1px solid #e9eee3; }
.fulfillment-grid > div:nth-child(3) { border-left: none; }
.fulfillment-grid > div:first-child { border-left: none; }
.fulfillment-grid small { color: var(--muted); font-size: var(--text-small); }
.fulfillment-grid strong { font-size: var(--text-secondary); font-weight: 500; white-space: normal; }
.fulfillment-grid span { font-size: var(--text-small); color: var(--muted); }
.delivery-records { margin-top: 18px; }
.delivery-records h4 { font-size: var(--text-small); font-weight: 500; color: var(--muted); margin-bottom: 11px; }
.delivery-record { padding: 0 0 11px 12px; border-left: 1px solid #dce6d4; }
.delivery-record:last-child { padding-bottom: 0; }
.delivery-record strong { font-size: var(--text-body); font-weight: 500; }
.delivery-record p { font-size: var(--text-small); color: var(--muted); margin-top: 3px; overflow-wrap: anywhere; white-space: pre-wrap; }
.delivery-record small { font-size: var(--text-help); color: var(--muted); }
.attachment-list { display: flex; flex-direction: column; gap: 8px; }
.attachment { display: flex; align-items: center; gap: 11px; padding: 16px; background: #fafbf8; border: 1px solid #eaf0e3; border-radius: 6px; text-decoration: none; min-height: 64px; }
.attachment:hover { background: #f0f6ed; border-color: #bfcfb3; }
.attachment > .icon:first-child { color: var(--muted); width: 22px; height: 22px; }
.attachment > span { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.attachment strong { font-size: var(--text-body); font-weight: 500; overflow-wrap: anywhere; }
.attachment small { font-size: var(--text-small); color: var(--muted); }
.attachment > .icon:last-child { color: var(--muted); width: 14px; height: 14px; }
.upload-button { margin-top: 15px; min-height: 46px; padding: 10px 14px; font-size: var(--text-body); }
.upload-button .icon { width: 19px; height: 19px; }
.step-timeline { list-style: none; display: flex; flex-direction: column; gap: 0; padding: 0; margin: 0; }
.step-timeline li { position: relative; display: flex; align-items: flex-start; gap: 15px; padding-bottom: 24px; }
.step-timeline li::before { content: ""; position: absolute; left: 14px; top: 31px; bottom: 0; width: 1px; background: #e7ecdf; }
.step-timeline li:last-child { padding-bottom: 0; }
.step-timeline li:last-child::before { display: none; }
.step-dot { display: inline-flex; align-items: center; justify-content: center; border: 1px solid #e1e8d9; color: var(--muted); background: #f9fbf6; width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%; font-family: var(--digits); font-size: var(--text-small); }
.step-dot .icon { width: 17px; height: 17px; }
.step-timeline li.done .step-dot { color: var(--muted); border-color: #d9e6ce; background: #edf5e5; }
.step-timeline li.current .step-dot { color: #fff; border-color: var(--teal); background: var(--teal); box-shadow: 0 0 0 3px #167d7010; }
.step-timeline li strong { font-size: var(--text-body); font-weight: 500; color: var(--muted); }
.step-timeline li.done strong, .step-timeline li.current strong { color: #4f6c4c; }
.step-timeline li small { display: block; font-size: var(--text-small); color: var(--muted); }
.activity-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 19px; }
.activity-list li { display: flex; gap: 13px; align-items: flex-start; }
.activity-dot { margin-top: 7px; width: 5px; height: 5px; flex: 0 0 5px; border-radius: 50%; background: #afc49d; }
.activity-list strong { font-size: var(--text-body); font-weight: 500; color: #607657; }
.activity-list p { font-size: var(--text-small); color: var(--muted); overflow-wrap: anywhere; white-space: pre-wrap; line-height: 1.8; margin-top: 3px; }
.activity-list small { font-size: var(--text-help); color: var(--muted); }
.activity-list small > span { margin: 0 6px; }
.detail-version { margin-top: 20px; font-size: var(--text-help); color: var(--muted); }

/* Forms and confirmations */
.form-dialog { width: 620px; max-width: calc(100% - 32px); max-height: calc(100dvh - 64px); border-radius: 10px; overflow: auto; }
.form-dialog[open] { animation: enter .2s ease both; }
.modal-header { padding: 25px 26px 13px; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.modal-header .eyebrow { font-size: var(--text-decorative); color: var(--muted); }
.modal-header h2 { margin-top: 7px; font-size: 26px; font-weight: 600; }
.modal-header .icon-button { margin: -4px -9px 0 0; }
.modal-subtitle { padding: 0 26px; font-size: var(--text-secondary); color: var(--muted); margin-bottom: 18px; }
.modal-fields { padding: 0 26px 24px; }
.form-fieldset { display: flex; flex-direction: column; gap: 22px; margin: 0; padding: 0; border: 0; }
.field { display: flex; flex-direction: column; gap: 9px; color: #526b4b; font-size: var(--text-body); position: relative; }
.field input, .field select, .field textarea { font-size: var(--text-body); line-height: 1.6; }
.optional { font-size: var(--text-help); color: var(--muted); font-weight: 400; }
.field > .optional { position: absolute; right: 0; top: 1px; }
.field-help { display: block; color: var(--muted); font-size: var(--text-help); font-weight: 400; line-height: 1.8; }
p.field-help { margin-top: 9px; }
.field-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; align-items: start; }
.modal-footer { position: sticky; bottom: 0; display: flex; gap: 10px; align-items: center; justify-content: flex-end; padding: 18px 26px; background: #fbfcf8; border-top: 1px solid var(--line); flex-wrap: wrap; }
.modal-footer .button { min-height: 48px; padding: 11px 16px; font-size: var(--text-body); }
.form-error { background: #fbefeb; padding: 10px 12px; border-radius: 5px; color: #8e4936; font-size: var(--text-small); margin-top: 16px; white-space: pre-wrap; }
.form-error[hidden] { display: none; }
.form-order-summary { background: #f5f8f0; padding: 14px 16px; border: 1px solid #e5ecdc; border-radius: 6px; }
.form-order-summary > strong { font-size: 18px; font-weight: 600; }
.form-order-summary p { font-size: var(--text-secondary); color: var(--muted); margin: 5px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.form-order-summary > span { font-size: var(--text-help); color: var(--muted); }
.form-dialog .form-order-summary, .form-dialog .approval-parties, .form-dialog .confirmation-quote { min-width: 0; overflow-wrap: anywhere; }
.notice { padding: 12px 14px; background: #edf5e8; color: var(--muted); border: 1px solid #e0ebd7; border-radius: 6px; font-size: var(--text-small); line-height: 1.9; }
.notice.warning { background: #fbf5e7; border-color: #eee3c7; color: #80602f; }
.notice p { margin-top: 4px; font-size: var(--text-small); }
.modal-fields > .notice { margin-bottom: 18px; }
.check-field { display: flex; gap: 11px; align-items: center; font-size: var(--text-body); color: var(--muted); cursor: pointer; min-height: 44px; }
.check-field input { margin-top: 0; }
.confirmation-quote { border: 1px solid #e5ebdc; border-radius: 6px; padding: 14px 16px; display: flex; flex-direction: column; align-items: flex-start; }
.confirmation-quote > span { font-size: var(--text-help); color: var(--muted); }
.confirmation-quote > strong { font-size: 18px; font-weight: 500; margin-top: 5px; overflow-wrap: anywhere; }
.confirmation-quote > p { font-size: var(--text-small); color: var(--muted); margin-top: 4px; }
.confirmation-quote > div { display: flex; align-items: center; gap: 10px 20px; margin-top: 18px; width: 100%; padding-top: 12px; border-top: 1px solid #edf1e6; flex-wrap: wrap; }
.confirmation-quote > div span { font-size: var(--text-small); color: var(--muted); }
.confirmation-quote b { margin-left: auto; font-size: 32px; font-family: var(--digits); color: var(--teal); font-weight: 500; overflow-wrap: anywhere; max-width: 100%; }
.confirmation-quote > small { font-size: var(--text-help); color: var(--muted); margin-top: 5px; }
.file-input { font-size: var(--text-body); padding: 9px; background: #fafbf7; }
.file-input::file-selector-button { padding: 9px 12px; margin-right: 10px; background: #e7f0df; color: var(--muted); border: 0; border-radius: 4px; font: inherit; cursor: pointer; min-height: 44px; }
.roles-fieldset { border: 1px solid #e2eada; border-radius: 6px; padding: 13px; margin: 0; }
.roles-fieldset legend { padding: 0 6px; font-size: var(--text-body); color: var(--muted); }
.role-checkboxes { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; padding-top: 3px; }

/* People */
.role-guide { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin: 0 0 25px; }
.role-guide > div { background: #ffffff9e; border: 1px solid #e5eade; border-radius: 7px; padding: 18px; }
.role-guide-icon { width: 30px; height: 30px; background: #ecf2e7; color: var(--muted); border-radius: 6px; display: flex; align-items: center; justify-content: center; margin-bottom: 13px; }
.role-guide-icon .icon { width: 17px; height: 17px; }
.role-guide strong { font-size: var(--text-body); font-weight: 500; }
.role-guide p { font-size: var(--text-small); margin-top: 5px; color: var(--muted); }
.users-table { min-width: 620px; }
.users-table td { padding-top: 20px; padding-bottom: 20px; }
.user-name-cell { display: inline-flex; align-items: center; gap: 12px; }
.user-name-cell strong { font-size: var(--text-body); font-weight: 500; }
.user-name-cell small { color: var(--muted); font-size: var(--text-help); }
.role-badges { display: flex; flex-wrap: wrap; gap: 5px; }
.users-footnote { margin-top: 18px; font-size: var(--text-small); color: var(--muted); }

/* Feedback */
.notifications { position: fixed; left: 50%; top: 25px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 9px; width: max-content; max-width: calc(100vw - 32px); pointer-events: none; }
.toast { border: 1px solid #d4e7ce; background: #f3faed; color: #557b45; border-radius: 7px; box-shadow: 0 7px 30px #122e3b15; padding: 13px 20px; font-size: var(--text-body); animation: enter .2s ease both; line-height: 1.7; }
.toast.error { color: #885037; background: #fff8ed; border-color: #eedcc4; }

/* Keep readable type at every width; change the layout rather than shrink it. */
@media (min-width: 1600px) {
  .main-content { padding: 44px 48px 32px; }
  .topbar { padding: 0 48px; }
  .workspace-footer { margin-left: 48px; margin-right: 48px; }
  .stats-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; }
  .stat-card { padding: 22px 18px 20px; }
  td { padding-top: 28px; padding-bottom: 28px; }
}

@media (max-width: 1180px) {
  .sidebar { width: 200px; flex-basis: 200px; padding-left: 10px; padding-right: 10px; }
  .main-content { padding: 30px 22px 26px; }
  .topbar { padding: 0 23px; }
  .workspace-footer { margin-left: 23px; margin-right: 23px; }
  .workbench-overview { grid-template-columns: minmax(0, 1fr); }
  .workbench-scope { width: 100%; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; }
  .workbench-scope small { margin-left: auto; }
  .workbench-counts { justify-content: space-between; width: 100%; gap: 18px; }
  .workbench-counts > div { flex: 1; min-width: 0; flex-wrap: wrap; }
  .workbench-counts > div + div { padding-left: 18px; }
  .filter-primary { gap: 12px; }
  .route-note-end { margin-left: 0; }
  .role-guide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .auth-layout { display: flex; flex-direction: column; }
  .auth-story { padding: 32px 36px; }
  .auth-story-main { padding: 32px 0 10px; }
  .auth-story h1 br, .auth-story-main > p br { display: none; }
  .auth-route { margin-top: 24px; flex-wrap: wrap; }
  .auth-foot { display: none; }
  .auth-main { padding: 40px 32px 76px; }
  .app-layout { flex-direction: column; }
  .sidebar { width: 100%; flex: none; padding: 22px 22px 0; }
  .sidebar-brand { flex-direction: row; align-items: center; gap: 18px; margin-left: 8px; }
  .sidebar-brand-en { margin-top: 0; padding-left: 18px; border-left: 1px solid #a4b6aa55; letter-spacing: .12em; }
  .sidebar-rule, .sidebar-label, .sidebar-bottom { display: none; }
  .sidebar nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 22px; }
  .nav-item { min-width: 0; justify-content: center; border-radius: 6px 6px 0 0; gap: 9px; padding: 13px 8px; white-space: nowrap; }
  .nav-item.active { box-shadow: inset 0 -3px #58aa91; }
  .nav-count { margin-left: 0; }
  .demo-explanation, .panel-caption { display: none; }
  .demo-bar { padding-left: 22px; padding-right: 22px; }
  .stat-card { padding: 14px 16px; }
  .stat-caption .icon { display: none; }
  .page-heading { align-items: flex-start; }
}

@media (max-width: 700px) {
  :root { --text-title: 30px; --stat-number: 40px; }
  .demo-bar { padding: 12px 16px; gap: 10px; }
  .demo-switch { width: 100%; margin-left: 0; min-width: 0; }
  .demo-switch > span { display: none; }
  .demo-switch select { width: 100%; max-width: none; min-width: 0; }
  .auth-story { padding: 26px 24px; }
  .wordmark { flex-wrap: wrap; gap: 12px; }
  .brand-text { font-size: 26px; }
  .auth-story-main { padding: 26px 0 0; }
  .auth-story-main > .eyebrow, .auth-route { display: none; }
  .auth-story h1 { margin: 0 0 14px; }
  .auth-main { padding: 32px 24px 80px; }
  .auth-bottom { position: static; margin-top: 30px; padding: 0; text-align: center; }
  .sidebar { padding: 20px 16px 0; }
  .sidebar-brand-cn { font-size: 26px; }
  .sidebar nav { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 18px; }
  .nav-item { border-radius: 6px; min-height: 48px; }
  .nav-item.active { box-shadow: inset 3px 0 #58aa91; }
  .topbar { height: auto; min-height: 88px; padding: 14px 16px; flex-wrap: wrap; gap: 12px; }
  .breadcrumb { width: 100%; gap: 10px; }
  .account { width: 100%; min-width: 0; gap: 10px; }
  .account-copy { min-width: 0; }
  .account-copy small { overflow-wrap: anywhere; }
  .logout-button { margin-left: auto; }
  .main-content { padding: 28px 16px 24px; min-width: 0; }
  .page-heading { flex-direction: column; gap: 18px; margin-bottom: 24px; }
  .page-heading > div { min-width: 0; max-width: 100%; }
  .page-heading p { max-width: none; }
  .heading-actions { width: 100%; margin: 0; gap: 10px; flex-wrap: wrap; }
  .heading-actions .button { flex: 1; }
  .workbench-overview { padding: 20px 16px 16px; gap: 18px; margin-bottom: 14px; }
  .workbench-scope { flex-direction: column; align-items: flex-start; gap: 6px; }
  .workbench-scope small { margin-left: 0; }
  .workbench-counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
  .workbench-counts > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 4px; align-items: baseline; }
  .workbench-counts > div > span { grid-column: 1 / -1; white-space: normal; }
  .workbench-counts > div + div { padding-left: 10px; }
  .workbench-counts strong { min-width: 0; overflow-wrap: anywhere; }
  .workbench-counts small { font-size: var(--text-help); }
  .workbench-explanation { padding-top: 16px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; }
  .stat-card { min-height: 158px; padding: 16px 14px; gap: 10px 8px; }
  .stat-card > strong { position: static; margin: 0; max-width: 100%; overflow-wrap: anywhere; }
  .stat-card .stat-caption { display: flex; padding: 0; }
  .panel-heading { padding: 20px 16px; }
  .panel-heading > div { gap: 10px; }
  .panel-heading h2 { font-size: 18px; }
  .filter-primary { padding: 0 16px 16px; gap: 12px; }
  .search-field { flex-basis: 100%; min-width: 0; }
  .select-field { flex: 1 1 calc(50% - 6px); min-width: 0; gap: 8px; }
  .select-field select { min-width: 0; flex: 1; padding: 10px 8px; }
  .filter-secondary { padding: 12px 16px; gap: 12px 16px; }
  .filter-secondary label { flex: 1 1 135px; gap: 8px; }
  .filter-secondary select { flex: 1; min-width: 0; max-width: none; padding: 10px 8px; }
  .filter-secondary .text-button { margin-left: auto; }
  .filter-hint { display: none; }
  .orders-panel { background: transparent; border: none; box-shadow: none; overflow: visible; min-width: 0; }
  .orders-panel > .panel-heading, .orders-panel > .filter-primary, .orders-panel > .filter-secondary { background: #fff; }
  .orders-panel > .panel-heading { border-radius: 8px 8px 0 0; }
  .orders-panel > .filter-secondary { border-radius: 0 0 8px 8px; margin-bottom: 14px; }
  .category-feedback { padding: 16px; margin: -5px 0 14px; border: 1px solid #e0ecd9; border-radius: 7px; align-items: flex-start; }
  .category-feedback > div { align-items: flex-start; gap: 7px; }
  .category-feedback .text-button { padding: 8px 0; }
  .orders-panel > #orders-results .table-scroll { overflow: visible; }
  .orders-table { display: block; min-width: 0; }
  .orders-table thead { display: none; }
  .orders-table tbody { display: flex; flex-direction: column; gap: 16px; }
  .orders-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); background: #fff; border: 1px solid #dce5d5; border-radius: 8px; padding: 0 16px; min-width: 0; }
  .orders-table td { display: flex; flex-direction: column; align-items: flex-start; border: none; padding: 18px 0; min-width: 0; overflow-wrap: anywhere; }
  .orders-table td::before { content: attr(data-label); font-size: var(--text-help); margin-bottom: 9px; color: var(--muted); }
  .orders-table td.demand-cell { grid-column: 1 / -1; padding: 22px 0 20px; border-bottom: 1px solid #e7eddf; max-width: none; width: auto; min-width: 0; }
  .orders-table td.demand-cell::before { display: none; }
  .specification { max-width: 100%; }
  .order-work-items { gap: 6px; margin-top: 12px; }
  .orders-table td:nth-child(2), .orders-table td:nth-child(3) { border-bottom: 1px solid #eaf0e2; }
  .orders-table td:nth-child(2) { padding-right: 12px; }
  .orders-table td:nth-child(4), .orders-table td:nth-child(5) { padding-bottom: 12px; }
  .orders-table td:nth-child(6) { grid-column: 1 / -1; display: grid; grid-template-columns: 44px minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 9px; padding-bottom: 18px; }
  .orders-table td:nth-child(6)::before { margin: 0; }
  .orders-table td:nth-child(6) .cell-sub { margin: 0; }
  .orders-table td.row-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px 18px; width: auto; padding: 12px 0; border-top: 1px solid #e7eddf; }
  .orders-table td.row-actions::before { display: none; }
  .detail-button { margin: 0; }
  .row-next { margin-right: auto; }
  .route-note { gap: 12px; margin-top: 22px; }
  .route-note > span { max-width: 100%; flex-wrap: wrap; }
  .route-note-label { width: 100%; }
  .route-note-end { margin-left: 0; }
  .workspace-footer { flex-wrap: wrap; margin-left: 16px; margin-right: 16px; gap: 8px 16px; }
  .empty-state { background: #fff; border-radius: 8px; padding: 40px 22px; min-height: 300px; }
  .drawer { width: 100%; }
  .drawer-header { padding: 22px 22px 20px; }
  .drawer-header h2 { font-size: 24px; }
  .drawer-content { padding: 0 22px 24px; }
  .detail-stage { margin-left: -22px; margin-right: -22px; padding: 22px; }
  .detail-section { padding: 26px 0; }
  .detail-grid { gap: 22px 18px; }
  .form-dialog { width: calc(100% - 24px); max-width: calc(100% - 24px); max-height: calc(100dvh - 28px); }
  .modal-header { padding: 22px 20px 16px; }
  .modal-header h2 { font-size: 24px; }
  .modal-subtitle { padding: 0 20px; }
  .modal-fields { padding: 0 20px 22px; }
  .modal-footer { padding: 16px 20px max(16px, env(safe-area-inset-bottom)); gap: 10px; }
  .role-guide { gap: 12px; margin-bottom: 24px; }
  .role-guide > div { padding: 18px 16px; }
  .users-table { min-width: 760px; background: #fff; }
  .users-table td, .users-table th { padding-left: 16px; padding-right: 16px; }
  .notifications { top: 16px; }
  .toast { padding: 14px 18px; }
}

@media (max-width: 560px) {
  .field-columns { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .quote-summary { grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .quote-amount { grid-column: 1; grid-row: auto; align-items: flex-start; margin-top: 10px; padding-top: 13px; border-top: 1px solid #dfe8d6; max-width: 100%; }
  .quote-summary > p { grid-row: auto; }
  .role-checkboxes { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .detail-route { display: block; margin: 10px 0 0; }
  .pending-operation-list { width: 100%; }
  .pending-operation-list .button { width: 100%; }
}

/* Personal workbench: keep the information readable while reducing the first screen. */
.personal-heading { margin-bottom: 10px; }
.personal-heading h1 { margin-bottom: 0; }
.personal-summary { color: var(--muted); margin: 0 0 20px; font-size: var(--text-body); }
.personal-summary strong { font-family: var(--digits); color: var(--ink); font-size: 20px; margin: 0 3px; }
.personal-summary > span { padding: 0 10px; }
.workbench-tabs { display: flex; flex-wrap: wrap; gap: 6px 22px; padding: 0 24px; border-bottom: 1px solid var(--line); }
.workbench-tabs button { border: 0; border-radius: 0; background: transparent; color: var(--muted); font-size: var(--text-body); padding: 16px 0 14px; min-height: 54px; border-bottom: 3px solid transparent; }
.workbench-tabs button[aria-selected="true"] { color: var(--teal-dark); border-bottom-color: var(--teal); font-weight: 600; }
.workbench-tabs button > span { font-family: var(--digits); margin-left: 8px; font-weight: 400; }
.personal-search { display: flex; align-items: center; gap: 16px; padding: 18px 24px 10px; }
.personal-search .search-field { min-width: 0; }
.personal-search .result-count { flex-shrink: 0; white-space: nowrap; }
.more-filters { padding: 0 24px 14px; }
.more-filters > summary { cursor: pointer; color: var(--muted); min-height: 44px; padding: 8px 0; width: fit-content; }
.more-filters > summary::marker { color: var(--teal); }
.more-filters > summary > span { color: var(--teal); }
.filter-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px 18px; padding: 10px 0; }
.filter-options .select-field { display: flex; min-width: 0; }
.filter-options .select-field select { flex: 1; min-width: 0; width: 100%; }
.active-filters { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 5px 24px; border-top: 1px solid #e0ecd9; background: #f1f8ed; color: var(--muted); font-size: var(--text-small); }
.active-filters[hidden] { display: none; }
.active-filters strong { font-family: var(--digits); font-size: var(--text-body); }
.personal-orders-table { min-width: 740px; table-layout: fixed; }
.personal-orders-table th:first-child { width: 34%; }
.personal-orders-table th:nth-child(2) { width: 20%; }
.personal-orders-table th:nth-child(3) { width: 26%; }
.personal-orders-table th:last-child { width: 20%; }
.personal-orders-table td { font-size: var(--text-body); padding-top: 20px; padding-bottom: 20px; overflow-wrap: anywhere; }
.personal-orders-table .demand-cell { width: auto; min-width: 0; max-width: none; }
.personal-orders-table .specification { max-width: 100%; }
.personal-orders-table .order-meta { gap: 6px 12px; margin-top: 9px; }
.personal-orders-table .order-meta strong { font-size: var(--text-body); font-weight: 500; color: var(--ink); }
.next-step { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; line-height: 1.65; }
.next-step + .next-step { margin-top: 7px; }
.next-step > span { color: var(--muted); font-size: var(--text-small); }
.next-step > strong { font-weight: 500; font-size: var(--text-body); }
.next-step.own-step > strong { color: var(--teal-dark); font-weight: 600; }
.personal-orders-table .row-actions { width: auto; white-space: normal; }
.personal-orders-table .row-next { white-space: normal; text-align: right; }
.personal-orders-table .detail-button { text-align: right; }
.personal-orders-table .detail-button > span { display: block; font-size: var(--text-help); color: var(--teal); }

@media (max-width: 900px) {
  .sidebar nav { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
}

@media (max-width: 700px) {
  .personal-heading { margin-bottom: 12px; }
  .sidebar nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .personal-summary { margin-bottom: 18px; }
  .personal-summary > span { padding: 0 4px; }
  .workbench-tabs { padding: 0 16px; gap: 20px; background: #fff; border-radius: 8px 8px 0 0; }
  .personal-search { padding: 14px 16px 6px; gap: 10px; background: #fff; }
  .personal-search .search-field input { padding-left: 39px; }
  .more-filters { padding: 0 16px 6px; background: #fff; border-radius: 0 0 8px 8px; margin-bottom: 14px; }
  .filter-options { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .active-filters { padding: 5px 16px; margin-bottom: 14px; border: 1px solid #e0ecd9; border-radius: 7px; }
  .personal-orders-table { min-width: 0; table-layout: auto; }
  .personal-orders-table td { padding: 16px 0; }
  .personal-orders-table td.progress-cell { padding-right: 12px; }
  .personal-orders-table td.next-step-cell { padding-left: 8px; }
  .personal-orders-table td.row-actions { padding: 10px 0; }
  .personal-orders-table .row-next { text-align: left; }
  .personal-orders-table .detail-button { text-align: right; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Pictures stay with the form and the procurement record. */
.stage-assignment { background: #f5eedc; color: #7b5829; }
.refresh-hint { color: var(--muted); font-size: var(--text-help); font-weight: 400; margin-left: 14px; }
.assignment-receipt { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 18px; min-width: 0; }
.assignment-receipt-heading { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 9px; }
.assignment-source { color: var(--teal-dark); }
.buyer-workspace .badge { font-weight: 600; border-radius: 5px; padding: 6px 10px; }
.buyer-workspace .stage-assignment { color: #512900; background: #ffb703; }
.buyer-workspace .stage-approval { color: #fff; background: #db2777; }
.buyer-workspace .stage-rejected { color: #fff; background: #dc2626; }
.buyer-workspace .stage-payment { color: #083344; background: #06b6d4; }
.buyer-workspace .stage-shipping { color: #052e16; background: #10b981; }
.buyer-workspace .stage-invoice { color: #fff; background: #7c3aed; }
.buyer-workspace .badge.assignment-source { color: #fff; background: #2563eb; }
.buyer-workspace .stage-completed { color: #fff; background: #15803d; }
.buyer-workspace .progress-cell > div { display: flex; flex-wrap: wrap; gap: 6px; }
.buyer-workspace .progress-cell .cell-sub > .badge { vertical-align: middle; }
.assignment-receipt > p { line-height: 1.7; font-size: var(--text-small); color: var(--muted); }
.assignment-receipt > p strong { color: var(--ink); font-weight: 500; }
.assignment-times { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 12px 0 0; }
.assignment-times dt { color: var(--muted); font-size: var(--text-help); }
.assignment-times dd { margin: 3px 0 0; font-size: var(--text-small); line-height: 1.6; overflow-wrap: anywhere; }
.assignment-reference { display: inline-flex; align-items: center; gap: 5px; color: var(--teal-dark); min-height: 44px; font-size: var(--text-small); }
.assignment-reference .icon { width: 15px; height: 15px; }
.compact-receipt { padding-top: 11px; margin-top: 12px; }
.compact-receipt .assignment-times { grid-template-columns: minmax(0, 1fr); gap: 5px; }
.compact-receipt .assignment-times > div { display: flex; flex-wrap: wrap; gap: 3px 8px; }
.compact-receipt .assignment-times dd { margin: 0; }
@media (max-width: 700px) {
  .assignment-times { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .refresh-hint { display: block; margin: 6px 0 0; }
}
.media-field { min-width: 0; }
.media-label { font-weight: 500; margin-bottom: 9px; }
.media-composer { border: 1px dashed #a4beb1; background: #f6f9f3; border-radius: 7px; padding: 16px; min-width: 0; }
.media-composer:focus-within { border-color: var(--teal); }
.media-instruction { font-size: var(--text-small); color: var(--muted); margin-bottom: 12px; }
.media-file-label { position: relative; cursor: pointer; width: fit-content; margin-right: 10px; overflow: hidden; }
.media-file-label:focus-within { outline: 2px solid var(--teal); outline-offset: 3px; }
.media-file-label input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; padding: 0; }
.media-items { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.media-items:not(:empty) { margin-top: 16px; }
.media-item { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--line); border-radius: 6px; background: #fff; overflow: hidden; }
.media-thumbnail { background: #eaf0e8; border: 0; padding: 0; height: 112px; width: 100%; border-radius: 0; cursor: zoom-in; }
.media-thumbnail img { display: block; width: 100%; height: 100%; object-fit: contain; }
.media-pdf { display: grid; place-items: center; height: 112px; color: var(--teal); background: #edf2e9; font-family: var(--digits); font-size: 25px; }
.media-name { padding: 8px 9px 0; font-size: var(--text-small); overflow-wrap: anywhere; line-height: 1.5; }
.media-remove { align-self: flex-start; min-height: 44px; font-size: var(--text-small); }
.media-status { color: var(--teal-dark); font-size: var(--text-small); margin-top: 8px; }
.media-status:empty { display: none; }
.media-locked { background: #f5f3ec; }
.order-gallery { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; min-width: 0; }
.gallery-image { width: 116px; min-width: 0; padding: 0; border: 1px solid #dce5d5; border-radius: 6px; overflow: hidden; background: #f3f6ef; cursor: zoom-in; }
.gallery-image img { display: block; width: 100%; height: 90px; object-fit: contain; }
.gallery-image > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--text-help); padding: 4px 7px; background: #fff; }
.gallery-document { display: flex; align-items: center; gap: 7px; color: var(--teal-dark); min-height: 44px; max-width: 100%; font-size: var(--text-small); }
.gallery-document > span { overflow-wrap: anywhere; }
.gallery-caption { flex: 0 0 100%; font-size: var(--text-small); color: var(--muted); }
.approval-parties { display: flex; flex-direction: column; gap: 7px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 6px; }
.approval-parties > span { color: var(--muted); }
.approval-parties > .order-gallery { margin: 2px 0 10px; }
.image-preview-dialog { position: fixed; inset: 0; width: 100vw; width: 100dvw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; border-radius: 0; overflow: hidden; }
.image-preview-dialog[open] { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); }
.image-preview-dialog header { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; padding: 5px 12px; }
.image-preview-name { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.image-preview-dialog header .icon-button { width: 44px; height: 44px; }
.image-preview-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; padding: 0 12px 7px; }
.image-preview-toolbar .button { min-height: 44px; padding: 7px 12px; }
.image-preview-scale { display: inline-flex; align-items: center; justify-content: center; min-width: 58px; min-height: 44px; font-family: var(--digits); font-variant-numeric: tabular-nums; }
.image-preview-stage { min-width: 0; min-height: 0; overflow: auto; overscroll-behavior: contain; background: #14282e; }
.image-preview-canvas { display: grid; place-items: center; width: max-content; height: max-content; min-width: 100%; min-height: 100%; }
.image-preview-image { display: block; max-width: none; max-height: none; object-fit: contain; }

/* Company overview: four readable regions without a wide table. */
.boss-orders { display: flex; flex-direction: column; padding: 0 22px 20px; gap: 14px; min-width: 0; }
.boss-order { display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr) minmax(0, 1.4fr) minmax(130px, .62fr); border: 1px solid #dce5d8; border-radius: 8px; overflow: hidden; background: #fff; }
.boss-order-region { padding: 17px 15px; min-width: 0; overflow-wrap: anywhere; }
.boss-order-region + .boss-order-region { border-left: 1px solid var(--line); }
.boss-region-label { display: block; font-size: var(--text-small); color: var(--muted); margin-bottom: 10px; }
.boss-demand .specification { max-width: 100%; margin-top: 6px; }
.boss-product { display: block; font-size: 18px; line-height: 1.55; margin-bottom: 7px; }
.boss-selection > p { font-size: var(--text-body); }
.boss-amount { display: block; color: var(--teal-dark); font-size: 24px; font-weight: 500; font-family: var(--digits); margin-top: 8px; }
.boss-metadata { color: var(--muted); font-size: var(--text-small); margin-top: 8px; }
.boss-status-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; margin: 0; }
.boss-status-grid > div { min-width: 0; }
.boss-status-grid dt { font-size: var(--text-small); color: var(--muted); }
.boss-status-grid dd { margin: 1px 0 0; font-size: var(--text-body); }
.boss-status-grid dd span { display: block; color: var(--muted); font-family: var(--digits); }
.boss-invoice-status { grid-column: 1 / -1; }
.boss-actions { background: #f8faf5; }
.boss-action-buttons { display: flex; flex-direction: column; gap: 9px; margin-top: 13px; }
.boss-action-buttons .button { width: 100%; white-space: normal; font-size: var(--text-small); padding: 9px 7px; min-height: 44px; }
.boss-action-buttons .icon { width: 16px; height: 16px; }
.boss-actions > .text-button { text-align: left; font-size: var(--text-small); padding-left: 0; margin-top: 5px; }
.compact-gallery { gap: 7px; margin-top: 10px; }
.compact-gallery .gallery-image { width: 54px; }
.compact-gallery .gallery-image img { height: 50px; }
.compact-gallery .gallery-image > span { display: none; }
.compact-gallery .gallery-document { width: 100%; font-size: var(--text-small); }
.role-guide { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Boss approval desk: one clear decision per card. */
.approval-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 20px 24px 6px; }
.approval-tabs button { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; min-width: 0; min-height: 60px; padding: 12px; border: 2px solid transparent; background: #f3f5f1; color: var(--muted); font-size: 18px; font-weight: 600; }
.approval-tabs button[data-tab="pending"][aria-selected="true"] { color: #fff; background: #db2777; border-color: #db2777; }
.approval-tabs button[data-tab="reviewed"][aria-selected="true"] { color: #fff; background: #15803d; border-color: #15803d; }
.approval-tabs button:hover { border-color: #9fb8ad; }
.approval-tabs button:focus-visible { outline: 3px solid var(--navy); }
.approval-tab-count { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; padding: 0 8px; border-radius: 5px; background: #ffffff2e; font-family: var(--digits); font-variant-numeric: tabular-nums; }
.approval-help { padding: 8px 24px 0; color: var(--muted); font-size: var(--text-small); }
.boss-approval-list { display: flex; flex-direction: column; gap: 14px; padding: 10px 24px 24px; min-width: 0; }
.boss-approval-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(168px, .55fr); border: 1px solid #d8e3d9; border-radius: 8px; background: #fff; overflow: hidden; }
.boss-approval-card > section, .boss-approval-card > div { min-width: 0; padding: 18px; overflow-wrap: anywhere; }
.boss-approval-card > :not(:first-child) { border-left: 1px solid var(--line); }
.boss-approval-card .order-name { font-size: 18px; }
.boss-approval-card .specification { max-width: 100%; }
.boss-approval-card .boss-region-label { margin-bottom: 8px; }
.boss-approval-card .boss-amount { font-size: 26px; }
.boss-approval-card .badge { font-weight: 600; }
.approval-decision { background: #f8faf5; }
.approval-decision .stage-approval { color: #fff; background: #db2777; }
.approval-decision .stage-rejected { color: #fff; background: #dc2626; }
.approval-decision .badge.positive { color: #fff; background: #15803d; }
.approval-decision .boss-action-buttons { gap: 8px; }
.approval-decision .button { min-height: 46px; }
.approval-decision > .text-button { text-align: left; padding-left: 0; margin-top: 4px; }
.boss-approval-card .compact-gallery .gallery-image { width: 68px; }
.boss-approval-card .compact-gallery .gallery-image img { height: 62px; }

@media (max-width: 1100px) {
  .boss-approval-card { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .boss-approval-card > .approval-decision { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); }
  .approval-decision .boss-action-buttons { flex-direction: row; flex-wrap: wrap; }
  .approval-decision .boss-action-buttons .button { width: auto; min-width: 120px; }
}
@media (max-width: 700px) {
  .approval-tabs { padding: 14px 16px; gap: 10px; background: #fff; border-radius: 8px; margin-bottom: 14px; }
  .approval-tabs button { min-height: 56px; padding: 10px 6px; font-size: var(--text-body); }
  .approval-help { padding: 0 16px 10px; background: #fff; }
  .boss-approval-list { padding: 12px 0 0; gap: 16px; }
  .boss-approval-card { grid-template-columns: minmax(0, 1fr); }
  .boss-approval-card > section, .boss-approval-card > div { padding: 16px; }
  .boss-approval-card > :not(:first-child) { border-left: 0; border-top: 1px solid var(--line); }
  .boss-approval-card > .approval-decision { grid-column: auto; }
  .approval-decision .boss-action-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .approval-decision .boss-action-buttons .button { width: 100%; min-width: 0; white-space: normal; }
}

@media (max-width: 1180px) and (min-width: 901px) {
  .boss-orders { padding-left: 14px; padding-right: 14px; }
  .boss-order { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .boss-order-region { padding: 16px; }
  .boss-order-region:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .boss-order-region:nth-child(4) { border-top: 1px solid var(--line); }
  .boss-action-buttons { flex-direction: row; flex-wrap: wrap; }
  .boss-action-buttons .button { width: auto; }
}
@media (max-width: 900px) {
  .boss-order { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .boss-order-region:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .boss-order-region:nth-child(4) { border-top: 1px solid var(--line); }
  .boss-action-buttons { flex-direction: row; flex-wrap: wrap; }
  .boss-action-buttons .button { width: auto; }
}
@media (max-width: 700px) {
  .boss-orders { padding: 0; gap: 16px; }
  .boss-order { grid-template-columns: minmax(0, 1fr); }
  .boss-order-region { padding: 18px 16px; }
  .boss-order-region + .boss-order-region { border-left: 0; border-top: 1px solid var(--line); }
  .boss-region-label { margin-bottom: 7px; }
  .boss-actions > .badge { margin-right: 10px; }
  .boss-action-buttons { gap: 8px; }
  .boss-action-buttons .button { font-size: var(--text-body); }
  .compact-gallery .gallery-image { width: 68px; }
  .compact-gallery .gallery-image img { height: 62px; }
  .role-guide { grid-template-columns: minmax(0, 1fr); }
  .media-composer { padding: 13px; }
  .media-items { gap: 8px; }
  .media-thumbnail, .media-pdf { height: 85px; }
  .image-preview-dialog header { padding: 4px 8px; }
  .image-preview-toolbar { gap: 4px; padding: 0 8px 6px; }
  .image-preview-toolbar .button { padding: 7px 9px; font-size: var(--text-small); }
}

/* Recovery and accountable exception handling */
.pagination { display:flex; gap:14px; justify-content:center; align-items:center; padding:20px; flex-wrap:wrap; }
.stage-cancelled,.stage-closed { color:#9f1239; background:#ffe4e6; border:1px solid #fda4af; }
.stage-refunded { color:#7e22ce; background:#f3e8ff; border:1px solid #d8b4fe; }
.stage-exception { color:#9a3412; background:#ffedd5; border:1px solid #fdba74; }
.draft-notice { padding:12px; background:#eff6ff; color:#1e40af; border-radius:8px; font-size:14px; }
.backup-panel { margin-top:20px; padding:20px; border:1px solid var(--line); border-radius:14px; background:white; }
.account-actions { display:flex; gap:12px; flex-wrap:wrap; margin-top:8px; }
.audit-changes { padding-left:20px; color:#475569; line-height:1.7; }
@media (max-width:700px) { .modal-footer { flex-wrap:wrap; } .account-actions .text-button { min-height:44px; } .pagination { gap:10px; padding:16px 8px; } }

/* Account-specific messages remain separate from procurement decisions. */
.message-entry { min-height:44px; gap:8px; white-space:nowrap; padding:8px 14px; }
.message-count { min-width:24px; padding:0 6px; border-radius:20px; background:#dc2626; color:#fff; font-family:var(--digits); font-weight:700; line-height:24px; }
.message-count[hidden] { display:none; }
.message-center-dialog { width:760px; max-width:calc(100vw - 32px); max-height:calc(100dvh - 32px); padding:0; border:1px solid var(--line); border-radius:14px; color:var(--ink); background:#fff; box-shadow:var(--shadow); overflow:auto; }
.message-center-dialog::backdrop { background:#102632a6; }
.message-header { display:flex; justify-content:space-between; align-items:center; gap:16px; padding:22px 24px 12px; }
.message-header h2 { margin:0; font-size:24px; }
.message-header p { margin:2px 0 0; color:var(--muted); }
.message-header .icon-button { min-width:44px; min-height:44px; font-size:28px; }
.message-delivery-status { margin:0 24px 18px; padding:10px 12px; border-radius:6px; background:#fff3d5; color:#7c4b0c; font-size:var(--text-small); overflow-wrap:anywhere; }
.message-toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:0 24px 14px; flex-wrap:wrap; border-bottom:1px solid var(--line); }
.message-tabs { display:flex; gap:8px; }
.message-tabs button { border:1px solid #c9d4cc; padding:8px 14px; min-height:44px; background:#fff; color:var(--muted); }
.message-tabs button[aria-selected="true"] { background:var(--teal); border-color:var(--teal); color:#fff; font-weight:700; }
.message-toolbar .text-button,.message-item-actions .text-button { min-height:44px; }
.message-content { padding:0 24px; min-height:120px; }
.message-list { list-style:none; margin:0; padding:0; }
.message-item { padding:20px 0; border-bottom:1px solid var(--line); overflow-wrap:anywhere; }
.message-item.unread { border-left:4px solid #2563eb; padding-left:14px; }
.message-item-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.message-item-heading strong { font-size:18px; }
.message-read-state,.message-unread-state { flex:none; padding:0 7px; border-radius:4px; font-size:var(--text-small); }
.message-unread-state { color:#fff; background:#2563eb; }
.message-read-state { color:var(--muted); background:#f0f3ef; }
.message-item p { margin:8px 0; white-space:pre-wrap; }
.message-metadata { display:flex; flex-wrap:wrap; gap:6px 12px; color:var(--muted); font-size:var(--text-small); }
.message-item-actions { display:flex; gap:12px; flex-wrap:wrap; }
.message-item-actions .button,.message-pagination .button { min-height:44px; }
.message-pagination { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:18px 24px; font-size:var(--text-small); }
.dingtalk-panel { margin-top:20px; padding:20px; border:1px solid var(--line); border-radius:14px; background:#fff; }
.dingtalk-panel .panel-heading { gap:12px; padding:0; flex-wrap:wrap; }
.dingtalk-panel .panel-heading > div { display:block; }
.dingtalk-panel h2 { margin:0; }
.dingtalk-panel p { margin:8px 0; }
.dingtalk-bindings { list-style:none; padding:0; margin:12px 0 0; }
.dingtalk-bindings li { display:flex; justify-content:space-between; align-items:center; gap:16px; padding:14px 0; border-top:1px solid var(--line); }
.dingtalk-bindings li > div { min-width:0; }
.dingtalk-bindings span { display:block; color:var(--muted); overflow-wrap:anywhere; }
.dingtalk-bindings .button { flex:none; min-height:44px; }
.boss-progress-overview, .buyer-progress-overview { min-width:0; margin:0 0 26px; padding:22px; background:#fff; border:1px solid var(--line); border-radius:12px; }
.boss-progress-heading { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px; margin-bottom:16px; }
.boss-progress-heading h2 { margin:0 0 5px; font-size:23px; }
.boss-progress-heading p { margin:0; color:var(--muted); font-size:16px; }
.overview-live { color:var(--muted); font-size:14px; }
.boss-progress-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.progress-total { display:flex; align-items:center; gap:10px; margin:0 0 16px; padding:10px 18px; border:3px solid transparent; border-radius:9px; font-size:18px; }
.progress-total strong { font-size:28px; line-height:1.2; }
.progress-total[aria-pressed="true"] { border-color:var(--navy); box-shadow:inset 0 0 0 2px #fff; }
.progress-total:focus-visible { outline:3px solid var(--navy); outline-offset:3px; }
.progress-shortcuts { display:flex; flex-wrap:wrap; gap:12px; margin-bottom:16px; }
.progress-shortcuts .progress-total { margin:0; }
.boss-approval-shortcut { color:#fff; background:#9333ea; }
.boss-progress-card { position:relative; display:flex; flex-direction:column; align-items:flex-start; gap:12px; min-width:0; min-height:106px; padding:15px 16px; border:3px solid transparent; border-radius:9px; text-align:left; font-weight:700; font-size:18px; line-height:1.4; }
.boss-progress-card > span { max-width:100%; overflow-wrap:anywhere; }
.boss-progress-count { display:flex; align-items:baseline; gap:7px; font-family:var(--digits); font-size:34px; line-height:1; font-weight:600; font-variant-numeric:tabular-nums; }
.boss-progress-count small { font-family:inherit; font-size:14px; font-weight:500; }
.boss-progress-all { color:#fff; background:#122e3b; }
.boss-progress-unpaid { color:#fff; background:#c2410c; }
.buyer-progress-overview .boss-progress-approval { color:#fff; background:#9333ea; }
.boss-progress-paid { color:#fff; background:#047857; }
.boss-progress-shipping { color:#422006; background:#fbbf24; }
.boss-progress-transit { color:#fff; background:#2563eb; }
.boss-progress-partial { color:#083344; background:#22d3ee; }
.boss-progress-arrived { color:#052e16; background:#4ade80; }
.boss-progress-invoice_issue { color:#fff; background:#7c3aed; }
.boss-progress-invoice_receive { color:#fff; background:#be185d; }
.boss-progress-exception { color:#fff; background:#dc2626; }
.boss-progress-card:hover { filter:brightness(.96); }
.boss-progress-card[aria-pressed="true"] { border-color:var(--navy); box-shadow:inset 0 0 0 2px #fff; }
.boss-progress-card[aria-pressed="true"]::after { position:absolute; top:5px; right:6px; content:'✓'; width:18px; height:18px; border-radius:50%; background:#fff; color:var(--navy); text-align:center; font-size:14px; line-height:18px; }
.boss-progress-card:focus-visible { outline:3px solid var(--navy); outline-offset:3px; }
.boss-progress-help { margin:14px 0 0; color:var(--muted); font-size:15px; line-height:1.7; overflow-wrap:anywhere; }
.boss-progress-list-heading { flex-wrap:wrap; gap:12px; }
.boss-progress-list-heading > div { display:block; }
.boss-progress-list-heading h2 { margin:0; font-size:22px; }
@media (min-width:701px) and (max-width:1180px) {
  .boss-progress-card { padding:12px 10px; font-size:16px; }
}
@media (max-width:700px) {
  .boss-progress-overview, .buyer-progress-overview { padding:16px; margin-bottom:20px; }
  .boss-progress-heading h2 { font-size:22px; }
  .boss-progress-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .boss-progress-card { min-height:98px; padding:12px; font-size:17px; gap:10px; }
  .boss-progress-count { font-size:32px; }
  .boss-progress-list-heading { padding:16px; }
}
.company-categories { min-width:0; margin:0 0 24px; }
.company-categories h2 { margin:0 0 12px; font-size:20px; }
.company-category-grid { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:12px; }
.company-category { position:relative; display:flex; flex-direction:column; align-items:flex-start; justify-content:center; gap:4px; min-width:0; min-height:96px; padding:14px; border:3px solid transparent; border-radius:9px; text-align:left; font-size:17px; font-weight:700; line-height:1.5; }
.company-category span { max-width:100%; overflow-wrap:anywhere; }
.company-category-count { font-family:var(--digits); font-size:30px; line-height:1.1; font-weight:600; font-variant-numeric:tabular-nums; }
.company-category-all { color:#fff; background:#122e3b; }
.company-category-procurement { color:#431407; background:#fb923c; }
.company-category-assignment { color:#422006; background:#fbbf24; }
.company-category-approval { color:#fff; background:#db2777; }
.company-category-payment { color:#083344; background:#06b6d4; }
.company-category-shipping { color:#052e16; background:#10b981; }
.company-category-receiving { color:#fff; background:#2563eb; }
.company-category-invoice { color:#fff; background:#7c3aed; }
.company-category-completion { color:#fff; background:#4f46e5; }
.company-category-completed { color:#fff; background:#15803d; }
.company-category-exception { color:#fff; background:#dc2626; }
.company-category:hover { filter:brightness(.96); }
.company-category[aria-pressed="true"] { border-color:var(--navy); box-shadow:inset 0 0 0 2px #fff; }
.company-category[aria-pressed="true"]::after { position:absolute; top:5px; right:6px; content:'✓'; width:17px; height:17px; border-radius:50%; background:#fff; color:var(--navy); text-align:center; font-size:13px; line-height:17px; }
.company-category:focus-visible { outline:3px solid var(--navy); outline-offset:3px; }
.company-category-help { margin:12px 0 0; color:var(--muted); font-size:var(--text-small); overflow-wrap:anywhere; }
.stage-completion_pending { color:#fff; background:#4f46e5; }
.completion-shortcut { min-height:44px; color:#fff; background:#4f46e5; border:1px solid #4338ca; gap:10px; }
.completion-shortcut:hover { background:#4338ca; }
.completion-shortcut span { min-width:24px; padding:0 6px; background:#fff; color:#3730a3; border-radius:4px; font-family:var(--digits); font-weight:700; }
.completion-followup { margin:8px 0 0; color:#4338ca; font-size:var(--text-small); }
.completion-receipt,.completion-awaiting { padding:12px; margin-top:14px; border:1px solid #c7d2fe; border-radius:7px; background:#eef2ff; color:#3730a3; overflow-wrap:anywhere; }
.completion-receipt { border-color:#bbf7d0; background:#f0fdf4; color:#166534; }
.completion-receipt p,.completion-awaiting p { margin:4px 0; font-size:var(--text-small); }
.completion-awaiting small { font-size:var(--text-small); }
.completion-history { margin-top:14px; font-size:var(--text-small); }
.completion-history summary { cursor:pointer; min-height:44px; }
.completion-history > div { padding:10px 0; border-top:1px solid var(--line); overflow-wrap:anywhere; }
.completion-checks { margin:0 0 18px; }
.boss-action-buttons [data-action="complete"],.detail-actions [data-action="complete"] { color:#fff; background:#4f46e5; border-color:#4338ca; min-height:44px; }
.boss-action-buttons [data-action="complete"]:hover,.detail-actions [data-action="complete"]:hover { background:#4338ca; }
@media (min-width:701px) and (max-width:1180px) { .company-category { padding:12px 10px; font-size:16px; } }
@media (max-width:700px) {
  .company-category-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .company-category { min-height:88px; padding:12px 14px; font-size:16px; }
  .company-category-count { font-size:28px; }
  .account { flex-wrap:wrap; }
  .message-entry { margin-right:auto; }
  .message-center-dialog { width:calc(100vw - 16px); max-width:calc(100vw - 16px); max-height:calc(100dvh - 16px); border-radius:10px; }
  .message-header { padding:16px 16px 10px; }
  .message-delivery-status { margin:0 16px 14px; }
  .message-toolbar { padding:0 16px 12px; }
  .message-content { padding:0 16px; }
  .message-pagination { padding:16px 12px; flex-wrap:wrap; justify-content:center; }
  .message-pagination span { order:3; width:100%; text-align:center; }
  .dingtalk-panel { padding:16px; }
}
.request-batch-dialog { width: min(1060px, calc(100vw - 48px)); max-width: calc(100vw - 48px); }
.request-batch-dialog .modal-fields, .request-batch-dialog .modal-subtitle, .request-batch-dialog .draft-notice,
.request-batch-dialog .field, .request-batch-dialog .button, .request-batch-dialog .text-button,
.request-batch-dialog .media-instruction, .request-batch-dialog .field-help, .request-batch-dialog .media-status,
.request-batch-dialog .field input, .request-batch-dialog .field textarea { font-size: 20px; }
.request-batch-dialog .modal-header h2 { font-size: 30px; }
.request-batch-dialog .modal-footer { flex-wrap: wrap; }
.batch-submit-summary { flex-basis: 100%; font-size: 22px; color: var(--teal-dark); }
.batch-editor-summary { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 22px; color: var(--teal-dark); }
.batch-editor-summary span, .batch-editor-help { font-size: 20px; }
.batch-editor-help { color: var(--muted); line-height: 1.7; margin: 14px 0; }
[data-batch-rows] { display: grid; gap: 24px; }
.request-batch-row { border: 1px solid var(--line); border-radius: 12px; padding: 22px; background: #fafbf6; min-width: 0; }
.batch-row-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.batch-row-heading h3 { font-size: 24px; color: var(--teal-dark); }
.batch-row-heading > div { display: flex; gap: 18px; }
.batch-item-fields { display: grid; grid-template-columns: minmax(0, 1fr) 180px; gap: 18px; }
.batch-specification { grid-column: 1 / -1; }
.batch-add { margin-top: 24px; width: 100%; }
.request-batch-source { font-size: 18px; line-height: 1.6; color: var(--muted); margin-top: 10px; overflow-wrap: anywhere; }
.requester-layout-tabs { display: flex; gap: 12px; flex-wrap: wrap; margin: 18px 0 24px; }
.requester-layout-tabs .button, .request-batches-panel, .request-batches-panel .button { font-size: 20px; }
.batch-list-help { color: var(--muted); margin-bottom: 20px; line-height: 1.7; }
.request-batch-list { display: grid; gap: 22px; }
.request-batch-card { border: 1px solid var(--line); border-radius: 14px; padding: 26px; background: #fff; }
.request-batch-card > header { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.request-batch-card h2 { font-size: 25px; margin: 6px 0; }
.request-batch-number { font-size: 18px; color: var(--muted); overflow-wrap: anywhere; }
.request-batch-counts { display: flex; flex-wrap: wrap; gap: 12px 24px; padding-top: 20px; color: var(--teal-dark); }
.request-batch-list-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; padding: 22px 0; border-top: 1px solid var(--line); }
.request-batch-list-item h3 { font-size: 24px; margin: 8px 0; }
.request-batch-list-item p { line-height: 1.7; margin: 8px 0; overflow-wrap: anywhere; }
.request-batch-items:not([hidden]) { margin-top: 20px; }
/* Keep the boss's comparison cards readable throughout every procurement stage. */
:is(.boss-order, .boss-approval-card) {
  --text-body: 24px;
  --text-secondary: 24px;
  --text-small: 20px;
  --text-help: 18px;
  font-size: 24px;
  line-height: 1.7;
}
:is(.boss-order, .boss-approval-card) :is(.order-name, .boss-product) { font-size: 24px; line-height: 1.6; }
:is(.boss-order, .boss-approval-card) .boss-amount { font-size: 32px; font-weight: 600; }
:is(.boss-order, .boss-approval-card) .boss-status-grid { gap: 18px 20px; }
:is(.boss-order, .boss-approval-card) .boss-status-grid dd { font-weight: 600; color: var(--ink); }
:is(.boss-order, .boss-approval-card) .boss-status-grid dd span { font-size: 22px; }
:is(.boss-order, .boss-approval-card) :is(.button, .text-button) { font-size: 20px; }
:is(.boss-order, .boss-approval-card) .order-name { font-size: 24px; }
:is(.boss-order, .boss-approval-card) .badge { white-space: normal; overflow-wrap: anywhere; text-align: left; }
:is(.boss-order, .boss-approval-card) .request-batch-source { font-size: 20px; }
@media (max-width: 700px) {
  .request-batch-dialog { width: calc(100vw - 20px); max-width: calc(100vw - 20px); }
  .request-batch-dialog .modal-fields { padding-inline: 14px; }
  .request-batch-row { padding: 16px; }
  .batch-item-fields { grid-template-columns: minmax(0, 1fr); }
  .batch-specification { grid-column: auto; }
  .batch-row-heading, .request-batch-card > header { align-items: flex-start; flex-direction: column; }
  .request-batch-card { padding: 20px 16px; }
  .request-batch-list-item { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .request-batch-counts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
}
.request-origin { font-size: 20px; line-height: 1.6; color: var(--muted); }

.buyer-progress-overview .boss-progress-selection { color: #422006; background: #fbbf24; }

.batch-item-fields .batch-assignee { grid-column: 1 / -1; }
.batch-assignee select { min-height: 52px; font-size: 20px; }
