/* Task-first workspace: shared by every role, after the existing component styles. */
:root { --workspace-ink: #172c40; --workspace-muted: #536779; --workspace-line: #dce5ec; }
body, body[data-user-role] { background: #f3f6f9; color: var(--workspace-ink); }
.app-main.container { padding-top: 20px; }
.app-topbar, .purchaser-page .app-topbar, .manager-page .app-topbar {
  position: relative; z-index: 30; overflow: visible; transform: none;
  padding: 16px 20px; border-radius: 16px; box-shadow: 0 2px 6px #17314a05;
}
.app-topbar h1 { letter-spacing: -.035em; }
.app-topbar .topbar-actions { gap: 10px; }
.user-menu { position: relative; z-index: 40; }
.user-menu-panel.card { z-index: 50; border: 1px solid var(--workspace-line); box-shadow: 0 12px 32px #172c4026; }
.app-main > .card, .app-main > section.card { box-shadow: none; }
.card h2 { letter-spacing: -.025em; }
.muted, .page-meta { color: var(--workspace-muted); }
.sync-status { margin: 10px 4px 16px; font-size: 12px; color: #657787; }
.app-topbar .topbar-site-form { padding: 0; border: 0; background: transparent; box-shadow: none; }
.topbar-site-label { gap: 3px; }
.topbar-site-form select { min-height: 42px; }
.topbar-site-form button { min-height: 42px; }
.app-nav-link { min-height: 44px; }
.app-nav-link.active { box-shadow: inset 3px 0 0 #a8e4db; }
body [hidden] { display: none !important; }
body :is(a, button, summary, input, select, textarea):focus-visible { outline: 3px solid #267bca; outline-offset: 3px; }
.record-summary { gap: 14px; }
.record-card[open] { border-color: #aac5d6; }
.record-card[open] > .record-summary { background: #f3f8fb; border-radius: 14px 14px 0 0; }
.queue-tabs, .manager-workspace-nav { scrollbar-width: thin; }
.queue-tabs a { white-space: nowrap; }
.table-wrap { scrollbar-width: thin; }
section[id], details[id] { scroll-margin-top: 24px; }

/* Material descriptions are documents to read, not status pills. */
.indent-item-list { min-width: 0; max-width: 100%; }
.indent-item-chip { max-width: 100%; box-sizing: border-box; border-radius: 10px; padding: 8px 12px; line-height: 1.55; text-align: left; overflow-wrap: break-word; box-shadow: none; }
.material-list { display: grid; gap: 12px; list-style: none; margin: 8px 0 18px; padding: 0; min-width: 0; }
.material-list-item { min-width: 0; padding: 16px; border: 1px solid #d6e2e9; border-radius: 12px; background: #f7fafc; color: var(--workspace-ink); overflow-wrap: anywhere; }
.material-list-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; }
.material-list-name { font-size: 16px; line-height: 1.5; }
.material-list-scope { font-size: 12px; color: #536779; }
.material-list-scope.is-included { font-weight: 700; color: #23695a; }
.material-list-details { display: grid; gap: 10px; margin: 12px 0 0; }
.material-list-details > div { display: grid; grid-template-columns: minmax(90px, 115px) minmax(0, 1fr); gap: 8px 16px; }
.material-list-details dt { font-size: 13px; color: #536779; }
.material-list-details dd { margin: 0; font-size: 14px; line-height: 1.6; white-space: pre-line; }
.material-list-specification dd { color: #3d5366; }
.table-wrap .material-list { min-width: 13rem; }
.table-wrap .material-list-details > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
.request-scope-note { padding: 12px 16px; border-left: 3px solid #6a9eb7; border-radius: 0 8px 8px 0; background: #f0f7fb; line-height: 1.6; }
.request-other-items { margin-bottom: 18px; }
.request-other-items > summary { padding: 10px 0; min-height: 44px; box-sizing: border-box; cursor: pointer; color: #365d76; font-weight: 650; }
.manager-work-summary-main :is(strong, .manager-work-summary-line) { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
@media (max-width: 480px) {
  .material-list-item { padding: 12px; }
  .material-list-details > div { grid-template-columns: minmax(0,1fr); gap: 2px; }
}

/* Editable inspection quantities stay together with their material at every width. */
.inspection-review-lines { display: grid; gap: 20px; min-width: 0; }
.inspection-review-item { min-width: 0; margin: 0; padding: 12px; border: 1px solid #cddde7; border-radius: 14px; background: #f7fafc; overflow-wrap: normal; }
.inspection-review-item legend { max-width: 100%; padding: 0 6px; font-size: 17px; font-weight: 750; color: #23415a; overflow-wrap: anywhere; }
.inspection-review-item .inspection-received { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 0 0 16px; color: #536779; }
.inspection-received strong { color: #23415a; }
.inspection-quantity-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
.inspection-review-item label { display: flex; flex-direction: column; gap: 7px; min-width: 0; font-size: 14px; overflow-wrap: normal; }
.inspection-review-item :is(input[type="number"], textarea) { box-sizing: border-box; width: 100%; min-width: 0; min-height: 48px; border-radius: 10px; padding: 10px 12px; font-size: 16px; }
.inspection-review-item .inspection-quantity-help { margin: 12px 0 18px; color: #536779; font-size: 13px; line-height: 1.5; }
@media (max-width: 1000px) { .inspection-quantity-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 380px) { .inspection-quantity-grid { grid-template-columns: minmax(0,1fr); } }

.workspace-focus { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 24px; margin: 0 0 20px; border: 1px solid #cce1e6; border-radius: 18px; background: linear-gradient(115deg,#e6f4f2,#f5f9fc 80%); position: relative; overflow: hidden; }
.workspace-focus::after { content: ''; position: absolute; right: -30px; top: -65px; width: 180px; height: 180px; border: 25px solid #ffffff70; border-radius: 50%; pointer-events: none; }
.workspace-focus > * { position: relative; z-index: 1; }
.workspace-eyebrow { margin: 0 0 7px; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #38616b; }
.workspace-focus h2 { margin: 0 0 8px; font-size: clamp(22px,2.1vw,30px); line-height: 1.2; letter-spacing: -.035em; }
.workspace-focus p:last-child { margin-bottom: 0; max-width: 68ch; }
.workspace-focus .actions { flex-shrink: 0; }
.workspace-focus .button-link, .workspace-focus a.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; padding: 11px 16px; border: 1px solid #246978; border-radius: 10px; background: #246978; color: #fff; font-weight: 700; text-decoration: none; box-shadow: none; }
.workspace-focus .button-link.secondary { background: #fff; color: #28586a; border-color: #c0d8df; }
.workspace-focus .button-link svg { width: 18px; height: 18px; }
.workspace-focus-meta { display: grid; justify-items: center; gap: 4px; min-width: 120px; }
.workspace-focus-meta > strong { font-size: 34px; color: #245c6c; }
.manager-operational-stat-grid .status-card { box-shadow: none; padding: 17px; }
.manager-operational-stat-grid .status-card .muted { font-size: 12px; line-height: 1.5; }
.workspace-task-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 12px; }
.workspace-task-grid .action-card { min-height: 150px; box-shadow: none; position: relative; padding: 20px; }
.workspace-task-grid .action-card strong { font-size: 17px; }
.workspace-task-icon { width: 38px; height: 38px; padding: 9px; border-radius: 12px; background: #e7f3f1; color: #267666; }
.workspace-task-grid .action-card:hover { border-color: #8bb6c0; box-shadow: 0 5px 16px #172c400a; }
.workspace-task-grid .action-card .muted { line-height: 1.5; }
.workspace-steps { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 20px; padding: 0; list-style: none; counter-reset: workspace-step; }
.workspace-steps li { display: flex; align-items: center; gap: 8px; background: #f0f5f8; padding: 8px 12px; border-radius: 9px; color: #3c5566; font-size: 13px; counter-increment: workspace-step; }
.workspace-steps li > span { display: grid; place-items: center; width: 23px; height: 23px; background: #fff; border: 1px solid #d3e1e8; border-radius: 50%; font-weight: 800; }
.workspace-context { padding: 14px 18px; }
.workspace-context-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 32px; cursor: pointer; font-weight: 650; }
.workspace-context[open] .workspace-context-summary { margin-bottom: 14px; }
.workspace-shortcuts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 18px; }
.workspace-shortcut { display: inline-flex; align-items: center; gap: 7px; min-height: 42px; padding: 9px 13px; border: 1px solid #d7e4ea; border-radius: 10px; background: #fff; color: #285e77; font-weight: 650; text-decoration: none; }
.workspace-shortcut:hover { background: #eaf4f6; border-color: #9cbdcc; }
.workspace-empty { padding: 24px; border: 1px dashed #b9d4d8; border-radius: 14px; background: #f1f8f7; color: #345762; }
.workspace-empty p { margin: 6px 0; }
.workspace-batch-summary { display: flex; gap: 12px 24px; align-items: center; flex-wrap: wrap; padding: 16px; margin: 12px 0; border: 1px solid #b8d8d2; border-radius: 12px; background: #edf7f4; }
.workspace-mapping { border: 1px solid var(--workspace-line); border-radius: 12px; padding: 12px 16px; grid-column: 1 / -1; }
.workspace-mapping summary { cursor: pointer; min-height: 32px; font-weight: 650; }
.workspace-mapping[open] summary { margin-bottom: 14px; }

/* Page finder remains separate from record filters and exposes only permitted navigation. */
.workspace-search-trigger { display: inline-flex; gap: 9px; align-items: center; justify-content: flex-start; min-height: 42px; padding: 9px 12px; border: 1px solid #d3e1e9; border-radius: 10px; color: #486274; background: #f7fafc; box-shadow: none; font-weight: 550; white-space: nowrap; }
.workspace-search-trigger:hover { color: #183f5c; background: #eaf3f7; }
.workspace-search-icon { width: 17px; height: 17px; }
.workspace-search-shortcut { padding: 2px 5px; border: 1px solid #d6e1e9; border-radius: 5px; font-size: 11px; color: #60798b; background: #fff; }
.workspace-skip-link { position: fixed; top: 8px; left: 12px; z-index: 10000; padding: 12px 18px; background: white; border: 2px solid #267bca; border-radius: 8px; transform: translateY(-160%); }
.workspace-skip-link:focus { transform: translateY(0); }
dialog.workspace-search-dialog { width: min(620px,calc(100vw - 28px)); max-height: min(720px,85dvh); padding: 0; border: 1px solid #bdcdd8; border-radius: 19px; color: var(--workspace-ink); background: #fff; box-shadow: 0 24px 90px #102f4d45; }
.workspace-search-dialog::backdrop { background: #102b486b; backdrop-filter: blur(3px); }
.workspace-search-header { padding: 20px 20px 10px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.workspace-search-title { font-size: 20px; margin: 0; }
.workspace-search-close { min-width: 40px; min-height: 40px; padding: 8px; background: #eff4f7; color: #425f71; box-shadow: none; border: 0; }
.workspace-search-input { display: block; width: calc(100% - 40px); margin: 4px 20px 14px; padding: 13px 14px; }
.workspace-search-input-label { display: block; margin: 0 20px 6px; font-size: 12px; color: #536b7b; }
.workspace-search-footer { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.workspace-focus-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.workspace-focus-meta { font-size: 12px; color: #577381; }
.workspace-needs-review { background: #fff7e8; border-color: #e5c880; }
.workspace-search-results { list-style: none; margin: 0; padding: 4px 10px 12px; max-height: 48dvh; overflow: auto; }
.workspace-search-result { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 12px; margin: 2px 0; min-height: 46px; border: 1px solid transparent; border-radius: 10px; color: #26495f; text-decoration: none; }
.workspace-search-result.is-selected, .workspace-search-result:hover, .workspace-search-result:focus-visible { background: #e9f4f3; border-color: #bddeDA; }
.workspace-search-result-label { font-weight: 650; }
.workspace-search-result-meta { font-size: 11px; color: #667d8d; text-align: right; flex-shrink: 0; }
.workspace-search-empty { padding: 20px; color: #607888; }
.workspace-search-footer { padding: 12px 20px; font-size: 12px; color: #657a8a; border-top: 1px solid #e4ebf0; background: #f8fafc; }
.flash.toast { display: flex; gap: 14px; align-items: center; cursor: default; }
.toast-message { flex: 1; }
.toast-dismiss { background: transparent; color: inherit; border: 1px solid currentColor; padding: 3px 9px; min-width: 44px; min-height: 44px; box-shadow: none; flex-shrink: 0; }

@media (max-width: 1100px) {
  .app-topbar .topbar-actions { flex-wrap: wrap; }
  .workspace-search-shortcut { display: none; }
}
@media (max-width: 700px) {
  .app-main.container { padding-top: 12px; }
  .app-topbar, .purchaser-page .app-topbar, .manager-page .app-topbar { padding: 14px; gap: 12px; }
  .app-topbar .topbar-actions { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
  .app-topbar .topbar-site-form { width: 100%; order: 2; padding: 0; border: 0; background: transparent; }
  .app-topbar .topbar-site-form button { flex-shrink: 0; }
  .app-topbar .workspace-search-trigger { flex: 1; width: auto; order: 0; }
  .app-topbar .user-menu { width: auto; min-width: 90px; flex: 0 1 auto; order: 1; }
  .app-topbar .user-menu-button { min-height: 44px; padding: 10px 14px; }
  .manager-page .settings-shortcut { order: 1; width: 44px; min-width: 44px; }
  .manager-page .settings-shortcut span { display: none; }
  .workspace-focus { padding: 20px; flex-direction: column; align-items: start; gap: 16px; }
  .workspace-focus h2 { font-size: 24px; }
  .workspace-focus .actions { width: 100%; }
  .workspace-task-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .workspace-task-grid .action-card { padding: 15px; min-height: 180px; }
  .workspace-task-grid .action-card strong { font-size: 15px; }
  .workspace-task-grid .action-card .muted { font-size: 12px; }
  .workspace-shortcuts { gap: 6px; }
  .workspace-shortcut { min-height: 44px; font-size: 12px; padding: 8px 10px; }
  .workspace-search-result-meta { max-width: 90px; }
  .app-main .queue-toolbar { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 8px; padding: 10px; }
  .app-main .queue-toolbar .queue-search-field { min-width: 0; width: auto; grid-column: auto; }
  .app-main .queue-toolbar button { width: auto; min-width: 65px; }
  .app-main .queue-tabs { padding: 5px; gap: 4px; }
  .app-main .queue-tab { padding: 10px 8px; font-size: 12px; gap: 5px; }
  .app-main .queue-count { min-width: 18px; padding: 2px 4px; }
  .workspace-context { padding: 10px 14px; }
  .workspace-focus-meta { display: flex; flex-wrap: wrap; justify-content: flex-start; align-items: baseline; gap: 5px 9px; padding: 0; border: 0; }
  .workspace-focus-meta > svg { display: none; }
  .workspace-focus-meta > strong { font-size: 24px; }
}
@media (prefers-reduced-motion: no-preference) {
  .workspace-task-grid .action-card { transition: border-color .16s, box-shadow .16s, transform .16s; }
}
@media print { .workspace-search-trigger, .workspace-skip-link, .workspace-search-dialog { display: none !important; } }

/* Expanded tables keep complete words and usable fields; wide grids scroll locally. */
@media (max-width: 760px) {
  .table-wrap.delivery-calendar-wrap { border: 0; background: transparent; overflow: visible; }
  .delivery-calendar-wrap > .delivery-calendar-table { display: block; width: 100%; }
  .delivery-calendar-table > thead { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .delivery-calendar-table > tbody { display: grid; gap: 16px; }
  .delivery-calendar-table > tbody > tr { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); min-width: 0; padding: 12px; border: 1px solid #cddde7; border-radius: 14px; background: #fff; }
  .delivery-calendar-table > tbody > tr.delivery-missed-highlight { border-color: #e8b8b8; }
  .delivery-calendar-table > tbody > tr > td { display: block; min-width: 0; padding: 8px 0; border: 0; background: transparent; overflow-wrap: anywhere; }
  .delivery-calendar-table > tbody > tr > td:nth-child(n+3) { grid-column: 1 / -1; }
  .delivery-calendar-table > tbody > tr > td::before { content: attr(data-label); display: block; margin-bottom: 5px; font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .04em; color: #536779; }
  .delivery-calendar-table > tbody > tr > td .record-card { min-width: 0; margin-top: 8px; }
  .delivery-calendar-table > tbody > tr > td .record-card > .record-details { padding: 12px 8px; }
}
.table-wrap { min-width: 0; box-sizing: border-box; }
.table-wrap > table { table-layout: auto; overflow-wrap: normal; word-break: normal; }
.table-wrap :is(th, td) { overflow-wrap: normal; word-break: normal; }
.form-grid fieldset:has(> .table-wrap) { min-width: 0; }
.table-wrap table :is(input, select, textarea) { box-sizing: border-box; }
.table-wrap table input[type="number"] { min-width: 8rem; font-variant-numeric: tabular-nums; }
.table-wrap table input:not([type]),
.table-wrap table input:is([type="text"], [type="search"], [type="email"], [type="tel"], [type="url"], [type="password"], [type="date"], [type="time"]),
.table-wrap table select { min-width: 10rem; }
.table-wrap table textarea { min-width: 12rem; }
.table-wrap table input[name$="_quantity_unit"] { min-width: 6rem; }
.table-wrap > .workspace-table-pricing { min-width: 1080px; }
.workspace-table-hint { margin: 4px 0 8px; font-size: 12px; line-height: 1.5; color: #536779; grid-column: 1 / -1; }
@media (min-width: 1501px) { .workspace-table-hint { display: none; } }
.workspace-table-pricing :is(th, td):first-child { min-width: 14rem; }
.table-wrap > :is(.workspace-table-quotation, .workspace-table-quantities) { min-width: 680px; }
:is(.workspace-table-quotation, .workspace-table-quantities) :is(th, td):nth-child(2) { min-width: 12rem; }
@media (max-width: 760px) {
  .table-wrap table input:not([type]),
  .table-wrap table input:is([type="number"], [type="text"], [type="search"], [type="email"], [type="tel"], [type="url"], [type="password"], [type="date"], [type="time"]),
  .table-wrap table :is(select, textarea) { min-height: 44px; font-size: 16px; }
}

/* One quiet visual language across roles; colour signals actions and status. */
:root {
  --workspace-ink: #202c29;
  --workspace-muted: #5d6b62;
  --workspace-line: #dce3dc;
  --workspace-accent: #226854;
  --workspace-accent-soft: #eaf2ed;
  --workspace-shadow: none;
}
body, body[data-user-role], body.manager-page, body.purchaser-page {
  --accent: var(--workspace-accent);
  --accent-strong: #194f40;
  --accent-soft: var(--workspace-accent-soft);
  --accent-ink: #245942;
  --erp-accent: var(--workspace-accent);
  --erp-accent-2: var(--workspace-accent);
  --erp-shadow: none;
  --shadow-card: none;
  --shadow-soft: none;
  background: #f6f7f5;
  color: var(--workspace-ink);
}
.app-sidebar, .purchaser-page .app-sidebar { background: #fff; box-shadow: none; border-right: 1px solid var(--workspace-line); }
.app-sidebar .app-brand { color: #223d30; letter-spacing: -.025em; }
.app-sidebar .app-brand::before { background: #226854; box-shadow: none; border-radius: 6px; }
.app-sidebar .app-role { color: #647269; letter-spacing: .08em; }
.app-sidebar .app-nav-link, .app-sidebar .purchaser-nav-group > summary.app-nav-link { color: #4d5e54; background: transparent; box-shadow: none; }
.app-sidebar .app-nav-link.active,
.app-sidebar .purchaser-nav-group[open] > summary.app-nav-link { background: #eaf2ed; color: #20543d; box-shadow: none; font-weight: 700; }
.app-sidebar .app-nav-link:hover, .app-sidebar .purchaser-nav-group > summary.app-nav-link:hover { background: #f0f4ef; color: #20543d; transform: none; }
.app-sidebar .purchaser-sidebar-subnav { background: #f8faf7; }
.app-sidebar .purchaser-sidebar-subnav a { color: #516359; }
.app-sidebar .purchaser-sidebar-subnav a.active { background: #e5eee7; color: #20543d; box-shadow: none; }
.app-topbar, .purchaser-page .app-topbar, .manager-page .app-topbar {
  padding: 4px 0 20px; border: 0; border-bottom: 1px solid var(--workspace-line);
  border-radius: 0; background: transparent; box-shadow: none; backdrop-filter: none;
}
.app-topbar h1, .purchaser-page .app-topbar h1, .manager-page .app-topbar h1 { color: var(--workspace-ink); font-size: clamp(23px,2vw,29px); line-height: 1.25; letter-spacing: -.03em; }
.purchaser-page .app-topbar .page-meta, .purchaser-page .topbar-site-label { color: var(--workspace-muted); }
.manager-page .page-meta { font-size: 13px; }
/* Newly loaded queues and forms remain readable throughout their arrival. */
.app-main > :is(.card, .record-card, .approval-collapsible, .status-card-grid) { animation: none; }
.app-main .card, .app-main .item, .app-main .record-card, .app-main .status-card,
.app-main .approval-collapsible, .app-main .quotation-approval-card,
.app-main .purchaser-section-card, .app-main .manager-settings-section,
.app-main .manager-section-card, .app-main .timeline, .app-main .audit-card {
  border-color: var(--workspace-line); box-shadow: none; background-image: none;
}
.app-main .card:hover, .app-main .item:hover, .app-main .record-card:hover,
.app-main .status-card:hover, .app-main .purchaser-dashboard-card:hover { box-shadow: none; }
.card h2 { color: var(--workspace-ink); font-size: 19px; line-height: 1.4; }
.app-main .card .card, .app-main .card .item { box-shadow: none; }
.purchaser-page #purchaser-ai-assistant { box-shadow: none; }
/* Expanded entry forms share the same flat reading surface as their work queues. */
.app-main :is(.indent-item-row, .staff-receipt-item-row, .live-capture-card) { background: #f8faf6; box-shadow: none; }
.app-main :is(.staff-nested-details, .site-receipt-media) > summary { background: #f8faf6; box-shadow: none; }
.app-main .staff-note-callout { background: #fff8df; }
.app-main .quality-result-option:has(input:checked) { background: #edf3f1; border-color: #226854; box-shadow: none; }
.app-main .quality-result-option:has(input[value="problem"]:checked) { background: #fff8df; border-color: #a17a19; }
.quality-result-option > span, .quality-problem-row > label { min-width: 0; }
.quality-problem-row :is(input, select, textarea) { min-width: 0; max-width: 100%; }
@media (max-width: 760px) {
  .quality-result-options, .quality-problem-row { grid-template-columns: minmax(0, 1fr); }
}
.workspace-focus { padding: 24px; border: 1px solid #dce7dd; background: #edf3ed; color: var(--workspace-ink); border-radius: 12px; box-shadow: none; }
.workspace-focus::after { display: none; }
.workspace-focus h2 { color: #244936; font-size: clamp(23px,2.1vw,28px); max-width: 36ch; line-height: 1.25; }
.workspace-focus :is(p, .muted) { color: #506458; line-height: 1.6; }
.workspace-focus .workspace-eyebrow { display: block; color: #546c5d; letter-spacing: .08em; margin-bottom: 10px; }
.workspace-focus .button-link { background: #226854; color: #fff; border-color: #226854; box-shadow: none; }
.workspace-focus .button-link.secondary { background: #fff; color: #28573f; border-color: #bccfbe; }
.workspace-focus .button-link:hover { background: #194f40; }
.workspace-focus .button-link.secondary:hover { background: #f7faf5; }
.workspace-focus-meta { min-width: 120px; padding: 0 12px 0 24px; border: 0; border-left: 1px solid #cbdccb; border-radius: 0; background: transparent; color: #536d59; }
.workspace-focus-meta > strong { color: #28533b; font-size: 38px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.workspace-focus-meta > svg { width: 24px; height: 24px; color: #436d53; margin-bottom: 8px; }
.workspace-role-heading { display: flex; align-items: center; gap: 14px; min-width: 0; }
.workspace-role-copy { min-width: 0; }
.workspace-role-copy > .workspace-eyebrow { margin: 0 0 7px; color: #647269; }
.workspace-role-mark { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 42px; border-radius: 10px; background: #eaf1e9; color: #356348; }
.workspace-role-mark svg { width: 22px; height: 22px; }
.status-card.action-card { background: #fff; border-color: var(--workspace-line); box-shadow: none; border-radius: 10px; }
.status-card.action-card::after { display: none; }
.status-card.action-card > .workspace-card-icon { width: 21px; height: 21px; padding: 0; box-sizing: content-box; border: 0; border-radius: 0; color: #50715b; background: transparent; margin-bottom: 8px; }
.manager-operational-stat-grid .status-card > strong.manager-operational-metric { color: #294d36; font-size: 30px; line-height: 1.2; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.status-card.action-card:hover { border-color: #8eac96; box-shadow: none; }
.app-main .record-summary, .app-main .approval-collapsible-summary { background: transparent; }
.record-card > summary { border-radius: inherit; }
.app-main .record-card[open] { border-color: #a8bfab; box-shadow: none; }
.app-main .record-card[open] > .record-summary { background: #f5f8f3; }
.record-summary .record-link { display: inline-flex; align-items: center; gap: 7px; color: #285f47; font-size: 12px; font-weight: 650; }
.record-summary span.record-link::after { content: ''; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); margin: -3px 3px 0; flex-shrink: 0; }
.record-card[open] > .record-summary span.record-link::after { transform: rotate(225deg); margin-top: 3px; }
.approval-collapsible > summary { border-left: 3px solid transparent; }
.app-main .approval-collapsible[open] > summary { background: #f5f8f3; border-left-color: #497c58; }
.queue-tabs, .queue-subtabs { background: #eef1ec; border-color: var(--workspace-line); box-shadow: none; }
.queue-tabs .queue-tab.active, .queue-subtabs .queue-subtab.active { background: #fff; border-color: #bbcdbd; color: #245a3f; box-shadow: 0 1px 3px #223d300a; }
.queue-tab:not(.active):hover, .queue-subtab:not(.active):hover { background: #f8faf6; color: #245a3f; }
body :is(button, .button, a.button, .button-link, input[type="submit"]) { box-shadow: none; border-radius: 8px; filter: none; }
body :is(button, .button, a.button, input[type="submit"]):not(.secondary):not(.danger):not(.ghost-button):not(.icon-button),
body :is(button, .button, a.button, input[type="submit"]):not(.secondary):not(.danger):not(.ghost-button):not(.icon-button):hover { background-image: none; filter: none; transform: none; box-shadow: none; }
body :is(button, .button, a.button).danger { background: #aa3939; }
body :is(button, .button, a.button).secondary:not(:disabled):not([aria-disabled="true"]) { border-color: #cbd5cb; background: #fff; color: #3d5546; }
.app-main :is(button, .button, .button-link) { min-height: 44px; }
body :is(button, .button, a.button, .button-link, input[type="submit"]):hover { transform: none; box-shadow: none; filter: none; }
body .topbar-actions :is(.workspace-search-trigger, .workspace-display-trigger) { background: #fff; border-color: #cbd5cb; color: #435b4c; }
.form-grid label:focus-within { color: #245c43; }
input:not([type="checkbox"]):not([type="radio"]):focus, select:focus, textarea:focus { border-color: #59896a; box-shadow: 0 0 0 3px #59896a18; }
input[type="checkbox"], input[type="radio"] { accent-color: #226854; }
.material-list-item { background: #fafbf9; border-color: #e0e7dc; }
.material-list-details dt { color: #617061; }
.workspace-empty { border-style: solid; background: #f7f9f4; border-color: #d7e3d1; }
.workspace-shortcut { border-color: #d2dfcf; color: #3c6546; }
.workspace-shortcut:hover { background: #f1f6ee; }
.workspace-supporting-section { margin-top: 16px; }
.workspace-supporting-section > summary { color: #435b49; }
.catalog-create-tools { display: grid; gap: 12px; margin: 18px 0; }
.catalog-create-tools > details, .catalog-setup-disclosure { min-width: 0; }
.app-main .workspace-primary-section { margin-top: 20px; }
.app-main :is(.filters, .toolbar, .list-tools, .queue-toolbar) { background: #f8faf6; box-shadow: none; border-color: #e0e7dc; }
.mobile-bottom-nav { background: #fff; border: 1px solid #d7e1d5; box-shadow: 0 2px 14px #294a3210; }
.mobile-bottom-nav a { color: #56674f; background: transparent; }
.mobile-bottom-nav a.active { background: #e7f0e2; color: #28523b; box-shadow: none; }

@media (min-width: 1101px) {
  .manager-page .manager-operational-stat-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
}
@media (max-width: 700px) {
  .workspace-focus-meta { display: flex; flex-wrap: wrap; justify-content: flex-start; align-items: baseline; gap: 5px 9px; padding: 0; border: 0; }
  .workspace-focus-meta > svg { display: none; }
  .workspace-focus-meta > strong { font-size: 24px; }
}
.status-card > .badge:not([class*="status-"]) { background: transparent; border: 0; padding: 0; min-height: 0; color: #53654f; font-size: 12px; font-weight: 650; text-transform: none; }
.workspace-focus .manager-focus-breakdown { font-size: 13px; }
.app-topbar .user-menu-button { border-radius: 8px; background: #fff; color: #405548; border-color: #cbd5cb; box-shadow: none; }

/* Flatten document content inside a record so mobile forms keep their reading width. */
.app-main .record-details > .small-note { padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
@media (max-width: 760px) {
  .manager-page[data-manager-view="approvals"] .approval-collapsible-body { padding: 12px 7px; }
  .manager-page[data-manager-view="approvals"] .record-details { padding: 12px; }
  .manager-page[data-manager-view="approvals"] .approval-collapsible { padding: 0; }
}

.manager-bill-reference { margin: 0 0 16px; border: 1px solid var(--workspace-line); border-radius: 8px; padding: 0 12px; }
.manager-bill-reference > summary { min-height: 48px; padding: 12px 0; box-sizing: border-box; font-weight: 650; color: #355c43; }
.manager-bill-reference[open] { padding-bottom: 12px; }
.manager-decision-error { grid-column: 1 / -1; margin: 6px 0 0; color: #9f2727; font-size: 14px; font-weight: 500; line-height: 1.5; }
body :is(input,select,textarea)[aria-invalid="true"] { border-color: #b54141; box-shadow: 0 0 0 2px #b5414114; }

/* Match primary-action specificity so disabled submits also override hover styling. */
body :is(button, .button, a.button, input[type="submit"]):is(:disabled,[aria-disabled="true"]),
body :is(button, .button, a.button, input[type="submit"]):not(.secondary):not(.danger):not(.ghost-button):not(.icon-button):is(:disabled,[aria-disabled="true"]) { color: #667263; background: #edf1e9; border-color: #dce3d7; box-shadow: none; opacity: 1; filter: none; cursor: not-allowed; }

.staff-selected-order:empty { display: none; }
.staff-selected-order { padding: 14px 16px; border-left: 3px solid #8eaf90; background: #f4f8f1; border-radius: 0 8px 8px 0; }
.staff-selected-order > p { margin: 5px 0; color: #52674e; }
.staff-selected-order > details > summary { min-height: 44px; padding: 12px 0; box-sizing: border-box; color: #3e6947; font-weight: 650; cursor: pointer; }
.receipt-order-details { margin: 6px 0 0; display: grid; gap: 12px; }
.receipt-order-details dt { color: #5d7155; font-size: 12px; font-weight: 650; }
.receipt-order-details dd { margin: 4px 0 0; color: #354b2f; line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }
.staff-receipt-material-detail { display: block; margin-top: 5px; color: #5d6b56; font-size: 13px; line-height: 1.5; font-weight: 400; }

/* The display picker changes density only; it never removes content. */
.workspace-display-trigger { display: inline-flex; gap: 8px; align-items: center; justify-content: center; min-height: 44px; padding: 10px 12px; border: 1px solid #d4e1e4; background: #f8fbfa; color: #355b64; box-shadow: none; }
.workspace-display-trigger svg { width: 18px; height: 18px; }
.workspace-search-icon { flex: 0 0 18px; }
.app-topbar .topbar-actions { flex-wrap: wrap; min-width: 0; }
.manager-page .manager-topbar-copy { min-width: 0; }
.manager-page .settings-shortcut { background: #eef6f3; color: #276959; border: 1px solid #cbded8; box-shadow: none; }
.manager-page .settings-shortcut:hover { background: #e1f0e9; }
dialog.workspace-display-dialog { width: min(500px,calc(100vw - 28px)); max-height: 85dvh; padding: 24px; box-sizing: border-box; border: 1px solid #c8dbd8; border-radius: 20px; background: #fff; color: #19394a; box-shadow: 0 22px 70px #16394040; }
.workspace-display-dialog::backdrop { background: #15344466; backdrop-filter: blur(3px); }
.workspace-display-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.workspace-display-heading { margin: 0; font-size: 22px; }
.workspace-display-close { width: 44px; height: 44px; min-width: 44px; padding: 8px; border: 1px solid #dbe7e4; background: #f2f7f4; color: #3a615a; box-shadow: none; }
.workspace-display-help { color: #526c70; line-height: 1.6; font-size: 14px; }
.workspace-density-options { display: grid; gap: 10px; border: 0; padding: 0; margin: 20px 0 0; min-width: 0; }
.workspace-density-option { display: flex; align-items: center; gap: 14px; min-height: 76px; padding: 16px; border: 1px solid #d6e3df; border-radius: 13px; cursor: pointer; background: #fff; color: #254b50; }
.workspace-density-option:has(input:checked) { background: #eef8f2; border-color: #368975; box-shadow: inset 0 0 0 1px #368975; }
.workspace-density-option:focus-within { outline: 3px solid #287aaf; outline-offset: 3px; }
.workspace-density-option input[type="radio"] { width: 20px; height: 20px; flex: 0 0 20px; margin: 0; }
.workspace-density-option strong { display: block; margin-bottom: 5px; font-size: 15px; }
.workspace-density-description { display: block; font-size: 13px; font-weight: 400; line-height: 1.5; color: #526c70; }
body[data-workspace-density="compact"] .record-summary { padding: 12px 14px; gap: 10px; }
body[data-workspace-density="compact"] .record-details { padding: 14px; }
body[data-workspace-density="compact"] :is(.record-list, .list, .material-list) { gap: 8px; }
body[data-workspace-density="compact"] .material-list-item { padding: 12px; }
body[data-workspace-density="compact"] .table-wrap :is(th, td) { padding-top: 8px; padding-bottom: 8px; }
body[data-workspace-density="compact"] .material-list-details { gap: 6px; margin-top: 8px; }
body[data-workspace-density="compact"] .status-card.action-card { min-height: 0; padding: 14px; }
body[data-workspace-density="compact"] .workspace-card-icon { padding: 7px; margin-bottom: 2px; }
body[data-workspace-density="compact"] .form-grid { row-gap: 12px; }

/* Wide-table navigation stays outside the table and is hidden when it is not needed. */
.workspace-table-controls { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: 10px 0 7px; width: 100%; min-width: 0; grid-column: 1 / -1; }
.workspace-table-controls button { width: 44px; min-width: 44px; min-height: 44px; padding: 8px; border: 1px solid #cadeda; border-radius: 10px; background: #f3f9f6; color: #276959; box-shadow: none; }
.workspace-table-controls button:disabled { opacity: .45; cursor: default; }
.workspace-table-position { margin-right: auto; color: #526e70; font-size: 12px; line-height: 1.5; }
@media (hover: hover) and (pointer: fine) {
  .record-card > .record-summary:hover { background: #f1f8f6; }
  .workspace-task-grid .action-card:hover, .purchaser-action-summary .action-card:hover { transform: none; }
}
@media (max-width: 1500px) {
  .manager-page .app-topbar { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 700px) {
  .workspace-focus { padding: 20px; }
  .app-topbar, .purchaser-page .app-topbar, .manager-page .app-topbar { padding: 4px 0 16px; }
  .workspace-focus h2 { font-size: 25px; }
  .workspace-focus::after { width: 150px; height: 150px; top: -45px; right: -70px; border-width: 25px; }
  .workspace-display-trigger { width: 44px; min-width: 44px; padding: 10px; order: 0; }
  .workspace-display-label { display: none; }
  :root .app-topbar .workspace-search-trigger { min-width: max-content; }
  .manager-page .app-topbar .workspace-search-trigger { flex: 0 0 44px; width: 44px; min-width: 44px; justify-content: center; padding: 10px; }
  .manager-page .workspace-search-label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .workspace-role-heading { gap: 11px; }
  .workspace-role-mark { width: 42px; height: 42px; flex-basis: 42px; border-radius: 12px; }
  .workspace-role-copy .workspace-eyebrow { font-size: 10px; }
  .status-card.action-card > .workspace-card-icon { width: 19px; height: 19px; padding: 0; }
  .workspace-display-dialog { padding: 18px; }
}
@media (prefers-reduced-motion: no-preference) {
  .record-card, .record-summary, .workspace-shortcut, .queue-tab, .workspace-display-trigger { transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease; }
  .record-summary span.record-link::after { transition: transform .18s ease; }
  .workspace-card-icon { transition: transform .18s ease; }

  .workspace-focus-actions .button-link { transition: background-color .16s ease; }
}
@media (prefers-reduced-motion: reduce) {
  .app-main *, .workspace-display-dialog, .workspace-search-dialog { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .status-card:hover, .workspace-task-grid .action-card:hover, .purchaser-action-summary .action-card:hover { transform: none; }
}
@media print {
  .workspace-display-trigger, .workspace-display-dialog, .workspace-table-controls { display: none !important; }
  .workspace-focus { background: white; color: black; box-shadow: none; }
  .workspace-focus :is(h2,p,.muted,.workspace-eyebrow,.workspace-focus-meta,.workspace-focus-meta strong) { color: black; }
}

/* Catalog editors use the whole record width on phones; desktop stays tabular. */
@media (max-width: 760px) {
  .table-wrap.catalog-table-wrap { overflow: visible; border: 0; background: transparent; }
  .catalog-table-wrap > .catalog-material-table { display: block; width: 100%; min-width: 0; }
  .catalog-material-table > thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .catalog-material-table > tbody { display: grid; gap: 12px; }
  .catalog-material-table > tbody > tr { display: grid; grid-template-columns: minmax(0, 1fr); padding: 12px; border: 1px solid var(--workspace-line); border-radius: 8px; background: #fff; }
  .catalog-material-table > tbody > tr[hidden] { display: none; }
  .catalog-material-table > tbody > tr > td { display: block; min-width: 0; width: auto; padding: 7px 0; border: 0; overflow-wrap: anywhere; }
  .catalog-material-table > tbody > tr > td::before { content: attr(data-label); display: block; margin-bottom: 4px; color: #5b6c58; font-size: 12px; font-weight: 650; }
  .catalog-material-table .catalog-item-actions-panel { min-width: 0; padding: 0; }
  .catalog-material-table .catalog-item-actions-panel .form-grid { grid-template-columns: minmax(0, 1fr); }
  .catalog-material-table .catalog-item-actions-panel :is(input:not([type="hidden"]), select, textarea) { min-width: 0; width: 100%; }
  .catalog-material-table .catalog-item-actions-panel .actions { flex-wrap: wrap; }
}
