/* Shared navigation, directory and detail patterns across both workspaces. */
.edit-state { display: inline-block; flex-basis: 100%; font-size: .78rem; color: var(--muted); min-height: 1.2em; }
.edit-state:empty { display: none; }
.edit-state.has-changes { color: var(--blue); font-weight: 600; }
.discard-dialog { width: min(440px,calc(100% - 32px)); padding: 24px; border: 1px solid var(--line); border-radius: 22px; background: var(--panel); color: var(--text); box-shadow: 0 16px 60px rgba(0,0,0,.25); }
.discard-dialog::backdrop { background: rgba(12,24,40,.45); }
.discard-dialog h2 { font-size: 1.2rem; font-weight: 700; }
.discard-dialog p { color: var(--muted); line-height: 1.6; margin-block: 16px 24px; }
[data-region-action] { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.queue-views { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 16px; }
.queue-views a { white-space: nowrap; flex-shrink: 0; min-height: 44px; }
.workspace-body .form-switch { display: flex; align-items: center; gap: 16px; padding: 12px 0; min-height: 52px; }
.workspace-body .form-switch > .form-check-input { order: 2; flex-shrink: 0; float: none; width: 2.5em; height: 1.4em; margin: 0 0 0 auto; cursor: pointer; }
.workspace-body .form-switch > .form-check-label { order: 1; flex: 1; margin: 0; font-size: .86rem; line-height: 1.5; cursor: pointer; }
.workspace-body .form-switch > .form-check-input:disabled { cursor: not-allowed; }
.workspace-body label.form-switch { justify-content: space-between; font-size: .86rem; }
.workspace-body .settings-switch { padding: 0; min-height: 0; }
.workspace-body .finishing-toggle { display: flex; flex-wrap: wrap; }
.workspace-body .finishing-toggle small { order: 3; }
.directory-filters .row { display: grid; grid-template-columns: repeat(auto-fit,minmax(150px,1fr)); gap: 16px; margin: 0; }
.directory-filters .row > [class*="col-"] { width: auto; padding: 0; margin: 0; min-width: 0; }
.directory-filters:not(.job-filters) .row > :first-child { grid-column: 1 / -1; }
.directory-filters .filter-actions { margin-top: 16px; }
.directory-filters .form-label { margin-bottom: 8px; }
.job-filters { display: block; }
.job-filter-options { margin-top: 16px; }
.upload-panel .card-body { padding-top: 16px; }
.card-header h2 { line-height: 1.4; }
.detail-heading { gap: 16px; }
.settings-toggle-row { gap: 20px; }
.settings-toggle-row > label { min-width: 0; }
.card-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
@media (min-width: 1200px) {
  .directory-filters:not(.job-filters) .row > :first-child { grid-column: span 2; }
  .job-filters { display: grid; grid-template-columns: minmax(200px,1fr) minmax(440px,1.4fr); align-items: end; gap: 24px; }
  .job-filter-options { margin-top: 0; }
}
@media (max-width: 575.98px) {
  .directory-filters .row { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
  .directory-filters .row > :first-child { grid-column: 1 / -1; }
  .card-header.section-heading { align-items: start; flex-wrap: wrap; }
}
.filter-feedback { color: var(--muted); font-size: .76rem; margin: 0; padding: 0 24px 8px; }
.filter-feedback:empty { display: none; }
.copyable-value { display: flex; align-items: start; gap: 8px; min-width: 0; margin-bottom: 12px; }
.copyable-value > :first-child { flex: 1; min-width: 0; margin-bottom: 0 !important; }
.copy-value { flex-shrink: 0; min-height: 44px; }
.help-guide pre { margin-top: 0; }
.topbar-help { color: var(--muted); }
:where(a,button,input,select,textarea,summary):focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
@media (min-width: 992px) { .topbar-context strong { font-size: .9rem; } }
@media (max-width: 767.98px) {
  .workspace-body .form-control, .workspace-body .form-select, .login-body .form-control { font-size: 16px; }
  .workspace-body .btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
  .directory-records, .directory-records tbody { display: block; width: 100%; min-width: 0 !important; }
  .directory-records thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .directory-records tbody tr { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); column-gap: 12px; margin: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
  .directory-records tbody td { display: block; padding: 7px 4px; border: 0; min-width: 0; white-space: normal; overflow-wrap: anywhere; box-shadow: none; background: transparent; }
  .directory-records tbody td:first-child, .directory-records tbody td:last-child, .directory-records tbody td[colspan] { grid-column: 1 / -1; }
  .directory-records tbody td[data-label]:not(:first-child):not(:last-child)::before { content: attr(data-label); display: block; font-size: .68rem; font-weight: 600; color: var(--muted); margin-bottom: 3px; }
  .directory-records tbody td:first-child .record-link { font-size: 1rem; }
  .directory-records tbody td:last-child { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; }
  .directory-records tbody td[colspan] { border: 0; }
  .copyable-value { flex-wrap: wrap; }
  .copyable-value > :first-child { flex-basis: calc(100% - 76px); }
  .topbar-help { display: none; }
  .section-heading > .btn { white-space: nowrap; flex-shrink: 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* A shared record toolbar keeps navigation, state and actions in one row. */
.record-toolbar { gap:1rem; align-items:center; }
.record-toolbar .record-actions,.record-memberships {display:flex;gap:.75rem;align-items:center;flex-wrap:wrap;}
.record-toolbar .record-actions {justify-content:flex-end;}
.record-toolbar .record-actions form {margin:0;}
.record-toolbar .back-link {margin:0;}
@media(max-width:575.98px) {
 .record-toolbar {align-items:flex-start;}
 .record-toolbar .record-actions {gap:.5rem;}
 .record-toolbar #group-counts {flex-basis:100%;order:2;text-align:right;}
 .record-toolbar .btn {min-height:44px;}
}

/* Keep navigation independent of page scrolling. */
.sidebar { overflow: hidden; height: 100dvh; }
.sidebar-brand { flex-shrink: 0; }
.sidebar > .app-nav { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
#group-records table { table-layout: fixed; }
#group-records th:first-child { width: 58%; }
#group-records th:nth-child(2) { width: 22%; }
#group-records th:last-child { width: 20%; }
#group-records td { overflow-wrap: anywhere; }
#group-records td:last-child form { justify-content: flex-end; margin: 0; }
#group-records td:last-child button { min-width: 88px; }
#group-records .edit-state { text-align: right; }
.release-keep { border: 1px solid var(--line); border-radius: 14px; padding: 4px 16px 14px; background: var(--bs-tertiary-bg); }
/* Keep the preview square like the scan region, bounded by available sheet space. */
.scanner-stage { container-type: size; height: clamp(160px, 40dvh, 380px); display: grid; place-items: center; }
.app-sheet .scanner-stage { flex: 1; min-height: 72px; }
.scanner-stage .scanner-frame { flex: none; width: min(100cqw, 100cqh); height: min(100cqw, 100cqh); min-height: 0; max-height: none; aspect-ratio: 1; }
.scanner-frame video { display: block; object-fit: cover; object-position: center; }
@media(max-width:767.98px) {
 #group-records table { min-width: 0; }
 #group-records td:last-child form { width: 100%; }
}

.dashboard-shortcut { display:flex; align-items:center; gap:14px; padding:16px 8px; border-bottom:1px solid var(--line); color:var(--text); text-decoration:none; border-radius:8px; }
.dashboard-shortcut:hover { background:var(--bs-tertiary-bg); color:var(--blue); }
.dashboard-shortcut > i:first-child { font-size:1.3rem; color:var(--blue); }
.dashboard-shortcut > i:last-child { margin-left:auto; font-size:.85rem; }
.dashboard-shortcut span { min-width:0; }
.dashboard-shortcut strong, .dashboard-shortcut small { display:block; }
.dashboard-shortcut small { color:var(--muted); margin-top:4px; line-height:1.5; }
.dashboard-attention { display:flex; align-items:center; gap:16px; padding:18px 22px; border:1px solid var(--bs-warning-border-subtle); border-radius:18px; background:var(--bs-warning-bg-subtle); }
.dashboard-attention > i { font-size:1.5rem; }
.dashboard-attention p { margin:4px 0 0; font-size:.85rem; }
.dashboard-attention .btn { margin-left:auto; flex-shrink:0; }
@media(max-width:575.98px) { .dashboard-attention { flex-wrap:wrap; } .dashboard-attention > div { flex:1; } .dashboard-attention .btn { width:100%; } }

/* Fixed card tracks keep partial rows the same width as full rows. */
.report-hub-grid, .settings-card-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; grid-auto-rows:1fr; }
.report-hub-grid > .report-hub-card, .settings-card-grid .settings-link { min-width:0; height:auto; margin:0; }
.report-hub-grid .report-hub-card .card-body, .settings-card-grid .settings-link .card-body { display:grid; grid-template-columns:minmax(0,1fr) 12px; align-content:start; gap:12px; padding:18px; min-height:144px; height:100%; }
.report-hub-grid .report-hub-icon, .settings-card-grid .report-hub-icon { display:none; }
.report-hub-grid h2, .settings-card-grid h3 { font-size:1rem; font-weight:700; line-height:1.35; margin:0 0 8px; }
.report-hub-grid p, .settings-card-grid p { font-size:.82rem; line-height:1.5; margin:0; }
@media(max-width:1199.98px) { .report-hub-grid,.settings-card-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:575.98px) { .report-hub-grid,.settings-card-grid { grid-template-columns:1fr; } }
.supply-item { padding:14px 0; border-bottom:1px solid var(--line); }
.supply-item:last-child { border-bottom:0; }
.supply-item progress { display:block; width:100%; height:12px; margin-top:8px; accent-color:var(--blue); }
.supply-item.supply-low progress { accent-color:#b45309; }

html { scrollbar-gutter: stable; }

.edit-feedback-host { position:relative; }
.edit-feedback-host > .edit-state { position:absolute; z-index:4; bottom:4px; right:12px; width:auto; min-height:0; padding:2px 8px; border-radius:8px; background:var(--panel); box-shadow:0 1px 6px #0001; pointer-events:none; font-size:.7rem; }
.edit-feedback-host > .edit-state:empty { display:none; }
.app-sheet:has(.release-receipt) { width:min(760px,calc(100% - 40px)); }
.app-sheet .release-receipt .receipt-symbol { width:48px; height:48px; font-size:1.5rem; border-radius:16px; margin:16px auto 8px; }
.app-sheet .release-receipt .receipt-content { padding:0 20px 12px; }
.app-sheet .release-receipt .receipt-content h2 { font-size:1.4rem; margin:8px 0; }
.app-sheet .release-receipt .receipt-document { margin-bottom:6px; }
.app-sheet .release-receipt .receipt-timeline { margin-top:12px; gap:8px; }
.app-sheet .release-receipt .review-output { gap:8px; padding:10px; }
.app-sheet .release-receipt .receipt-content > p { margin-bottom:8px; }
@media(max-width:575.98px) {
 .app-sheet:has(.release-receipt) { width:100%; }
 .app-sheet .release-receipt .review-output { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .app-sheet .release-receipt .card-footer { padding:12px 16px max(12px,env(safe-area-inset-bottom)); }
}
@media(max-height:600px) {
 .app-sheet .release-receipt .receipt-symbol, .app-sheet .release-receipt .eyebrow { display:none; }
 .app-sheet .release-receipt .receipt-content { padding-top:8px; }
 .app-sheet .release-receipt .receipt-timeline { margin-top:6px; }
}

.app-sheet .batch-documents { max-height:45dvh; overflow:auto; overscroll-behavior:contain; }

@media (max-height:650px) {
 .app-sheet .release-receipt .review-output > span { padding:8px; }
 .app-sheet .release-receipt .receipt-timeline > span { padding:6px 4px; }
 .app-sheet .release-receipt .receipt-timeline i { display:inline; font-size:1rem; margin:0 3px 0 0; }
 .app-sheet .release-receipt .receipt-content { padding:6px 16px; }
 .app-sheet .release-receipt .review-output { margin-bottom:6px !important; padding:0; }
 .app-sheet .release-receipt .card-footer { padding:8px 12px; }
}

/* PrintQLock: shared product mark and wordmark. */
.brand-mark { background:transparent; box-shadow:none; border-radius:0; }
.brand-mark img { display:block; width:100%; height:100%; object-fit:contain; }
.brand-text strong { color:#082c5e; white-space:nowrap; }
.brand-q { color:#3ba348; }
[data-bs-theme="dark"] .brand-text strong { color:#f2f6fa; }
[data-bs-theme="dark"] .brand-q { color:#52c766; }

/* Directory workspaces: four focused views and compact operation feedback. */
.integration-tabs {display:flex;gap:6px;overflow-x:auto;border-bottom:1px solid var(--line);margin-bottom:16px;padding-bottom:8px;}
.integration-tabs a {white-space:nowrap;color:var(--muted);padding:12px 16px;text-decoration:none;border-radius:12px;font-weight:600;}
.integration-tabs a[aria-current=page] {background:var(--blue);color:var(--panel);}
.integration-status {display:flex;flex-wrap:wrap;align-items:center;gap:12px 24px;margin-bottom:24px;color:var(--muted);font-size:.85rem;}
.integration-status a {margin-left:auto;}
.integration-section-title {font-size:.85rem;font-weight:700;color:var(--muted);margin:16px 0 0;padding-top:12px;border-top:1px solid var(--line);}
.integration-rules .form-check {min-height:28px;}
.integration-rules .form-text {margin-bottom:4px;max-width:55ch;}
.integration-mappings td {overflow-wrap:anywhere;}
.integration-search-result .card-header {display:flex;align-items:center;flex-wrap:wrap;gap:8px 16px;}
.integration-search-result .card-header h3 {font-size:1rem;margin:0;}
.integration-search-result .card-header p {width:100%;font-size:.8rem;margin:0;overflow-wrap:anywhere;}
.integration-search-result .card-header button {margin-left:auto;}
.integration-user-results {max-height:260px;overflow:auto;}
.app-sheet:has(.integration-search-result) {width:min(780px,calc(100% - 24px));}
@media(max-width:575.98px){.integration-tabs {display:grid;grid-template-columns:1fr 1fr;gap:6px;border:0;}.integration-tabs a {padding:12px 8px;text-align:center;font-size:.85rem;background:var(--bs-tertiary-bg);}.integration-status {gap:8px 16px;}.integration-mappings th,.integration-mappings td {padding:10px 8px;font-size:.82rem;}.integration-mappings th:nth-child(3),.integration-mappings td:nth-child(3){display:none;}.app-sheet:has(.integration-search-result){width:100%;}}

.app-sheet [data-integration-sheet] > .card-header h2 {display:none;}
.app-sheet [data-integration-sheet] > .card > .card-header {display:none;}

[data-job-selection-toolbar][hidden] { display: none !important; }
[data-select-job] { width: 1.25rem; height: 1.25rem; cursor: pointer; }
html[data-workflow-ready="true"] .table-filters button:not([type="button"]) { display: none; }

@media (max-width: 767.98px) {
 .client-workspace .dashboard-stats { display:none; }
}

[data-directory-picker] { position:relative; min-width:0; }
.directory-picker-popup { position:absolute; top:100%; left:0; right:0; z-index:20; padding:.5rem; margin-top:.25rem; border:1px solid var(--bs-border-color); border-radius:1rem; background:var(--bs-body-bg); box-shadow:0 .5rem 1.5rem #0003; max-height:var(--picker-height,240px); overflow-y:auto; overscroll-behavior:contain; }
.directory-picker-popup[hidden] { display:none; }
.directory-picker-popup.opens-up { top:auto; bottom:calc(100% - 1.75rem); }
.directory-picker-popup .list-group { margin-top:0 !important; }
.directory-picker-popup button { overflow-wrap:anywhere; min-height:44px; }

@media (max-width: 767.98px) {
 .health-table, .health-table tbody, .health-table tr, .health-table td { display: block; width: 100%; }
 .health-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
 .health-table tr { padding: .75rem; border-bottom: 1px solid var(--bs-border-color); }
 .health-table td { border: 0; padding: .45rem .25rem; }
 .health-table td[data-label]::before { content: attr(data-label); display: block; font-size: .75rem; font-weight: 600; color: var(--bs-secondary-color); margin-bottom: .35rem; }
}
