/* PrintLocker workspace: touch-first layouts over the shared Bootstrap components. */
:root { --sidebar-width: 248px; --topbar-height: 76px; }
[data-bs-theme="light"] {
  --bg: #f2f5fa; --panel: #fff; --text: #1b2d45; --muted: #64758a;
  --line: #dce5ef; --blue: #1766b1; --green: #319c69; --tda-card-cap-bg: #fbfcfe;
  --bs-body-color: var(--text); --bs-body-bg: var(--bg); --bs-secondary-color: var(--muted);
}
[data-bs-theme="dark"] {
  --bg: #0b1220; --panel: #131f30; --text: #e9f0f9; --muted: #a2b2c8;
  --line: #2a3a50; --tda-card-cap-bg: #162337; --bs-body-bg: var(--bg);
  --bs-body-color: var(--text); --bs-secondary-color: var(--muted); --bs-tertiary-bg: #19283c;
}
body { -webkit-font-smoothing: antialiased; line-height: 1.55; }
html { scroll-padding-top: 100px; scroll-padding-bottom: 120px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.btn { min-height: 44px; padding: .6rem 1rem; border-radius: 11px; font-size: .86rem; font-weight: 600; }
.btn-sm { min-height: 38px; padding: .4rem .75rem; font-size: .8rem; }
.btn-primary { box-shadow: 0 3px 8px rgba(21,90,156,.12); }
.btn:active { box-shadow: none; }
.form-control, .form-select, .input-group-text { min-height: 46px; border-radius: 10px; }
.form-control, .form-select { background-color: var(--panel); color: var(--text); }
.form-check-input { cursor: pointer; }
.form-switch .form-check-input { width: 2.6em; height: 1.4em; }
.form-label { margin-bottom: .45rem; color: var(--muted); font-weight: 600; }
[data-bs-theme] .card { --bs-card-border-radius: 18px; --bs-card-inner-border-radius: 17px; --bs-card-spacer-x: 24px; --bs-card-spacer-y: 24px; box-shadow: 0 3px 18px rgba(18,42,72,.035); }
.card-header { padding: 20px 24px; border-bottom-color: var(--line); }
.card-footer { padding: 16px 24px; }
.card h2 { font-weight: 650; letter-spacing: -.015em; font-size: 1.02rem; }
.card-header p { line-height: 1.55; }
.card-header:first-child { border-radius: 17px 17px 0 0; }
.card-footer:last-child { border-radius: 0 0 17px 17px; }
.badge { border-radius: 7px; padding: .45em .7em; font-weight: 600; font-size: .7rem; letter-spacing: .01em; }
.alert { border-radius: 13px; padding: 16px 20px; }
.sidebar { border-right: 1px solid var(--line); }
.sidebar-brand { border-bottom: 1px solid var(--line); padding: 18px 22px; }
.brand-mark { width: 42px; height: 42px; border-radius: 13px; background: #155a9c; box-shadow: 0 4px 12px rgba(21,90,156,.18); }
.brand-text strong { font-size: 1.17rem; letter-spacing: -.03em; font-weight: 700; }
.app-nav { padding: 28px 16px; }
.app-nav a { border-radius: 12px; min-height: 48px; margin: 5px 0; padding: 12px 14px; font-weight: 500; }
.app-nav a i { width: 22px; font-size: 1.15rem; }
.app-nav a.active { background: rgba(var(--bs-primary-rgb),.1); box-shadow: inset 3px 0 0 var(--green); }
.nav-section { font-size: .64rem; letter-spacing: .12em; padding-left: 14px; }
.sidebar-footer { font-size: .73rem; padding: 22px; }
.topbar { padding: 0 32px; border-bottom: 1px solid var(--line); background: var(--panel); }
@supports (backdrop-filter: blur(12px)) { .topbar, .mobile-navigation { background: color-mix(in srgb, var(--panel) 94%, transparent); backdrop-filter: blur(16px); } }
.topbar-context small { font-size: .68rem; letter-spacing: .03em; }
.topbar-context strong { font-weight: 650; }
.topbar-actions { gap: 12px; }
.user-avatar { width: 38px; height: 38px; display: grid; place-items: center; flex-shrink: 0; border-radius: 50%; background: rgba(var(--bs-primary-rgb),.09); color: var(--blue); font-size: 1.15rem; }
.user-summary { max-width: 210px; }
.user-summary strong, .user-summary small { white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.user-summary strong { font-size: .82rem; font-weight: 600; }
.icon-button { width: 44px; height: 44px; border-radius: 12px; font-size: 1.1rem; display: inline-grid; place-items: center; }
.app-main { padding: calc(var(--topbar-height) + 32px) 32px 0; }
.page-title { margin-bottom: 28px; }
.page-title h1 { font-size: clamp(1.6rem,2.5vw,2rem); font-weight: 700; letter-spacing: -.04em; }
.page-title p { font-size: .86rem; max-width: 65ch; }
.workspace-label { padding: 8px 12px; border-radius: 30px; font-size: .7rem; }
.workspace-welcome { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 30px 32px; margin-bottom: 24px; border: 1px solid var(--line); border-radius: 22px; background: linear-gradient(115deg,rgba(var(--bs-primary-rgb),.09),rgba(var(--bs-primary-rgb),.02)),var(--panel); }
.workspace-welcome h2 { margin: 10px 0; font-size: clamp(1.45rem,2.5vw,2rem); letter-spacing: -.04em; font-weight: 700; }
.workspace-welcome p { color: var(--muted); font-size: .88rem; max-width: 55ch; margin-bottom: 20px; }
.eyebrow { display: inline-flex; align-items: center; gap: 7px; font-size: .7rem; font-weight: 650; letter-spacing: .025em; color: var(--blue); }
.welcome-mark { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 12px 18px; color: var(--blue); flex-shrink: 0; }
.welcome-mark > i { font-size: 4.2rem; line-height: 1.1; }
.welcome-mark span { padding: 6px 12px; border-radius: 30px; background: var(--panel); border: 1px solid var(--line); font-size: .7rem; }
.stat-card { height: 100%; }
.stat-card .card-body { padding: 20px; }
.stat-icon { top: 18px; right: 18px; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: rgba(var(--bs-primary-rgb),.06); font-size: 1.05rem; }
.stat-label { font-size: .76rem; padding-right: 30px; }
.stat-value { font-size: 2rem; font-weight: 650; letter-spacing: -.04em; margin: 14px 0 5px; }
.stat-card small { font-size: .68rem; }
.table-filters { padding: 20px 24px; background: transparent; }
.table-filters .form-label { font-size: .73rem; }
.filter-actions { gap: 10px; }
.table th { font-size: .68rem; text-transform: uppercase; letter-spacing: .055em; padding: 14px 24px; }
.table td { padding: 18px 24px; }
.table-responsive { border-radius: 0 0 17px 17px; scrollbar-width: thin; }
.jobs-table .job-document { min-width: 205px; }
.jobs-table .record-link { line-height: 1.5; }
.jobs-table .job-settings { min-width: 165px; }
.jobs-table .job-actions { min-width: 250px; }
.table-pagination { padding: 18px 24px; }
.upload-icon, .report-hub-icon { display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; border-radius: 13px; background: rgba(var(--bs-primary-rgb),.08); color: var(--blue); font-size: 1.25rem; }
.upload-toggle { margin-left: auto; color: var(--blue); transition: transform .15s; }
.report-hub-card .card-body { padding: 24px; gap: 14px; }
.report-hub-card:hover { box-shadow: 0 5px 20px rgba(18,42,72,.08); }
.report-hub-grid { display: flex; flex-wrap: wrap; }
.report-hub-grid > .report-hub-card { flex: 1 1 340px; min-width: 0; }
@media (max-width: 767.98px) { .report-hub-grid > .report-hub-card { flex-basis: 100%; } }
.hub-section-heading { border-left-width: 3px; padding-left: 12px; }
.settings-toggle-row { padding: 18px 24px; }
.settings-card-body { padding: 24px; }
.settings-card-body-flush { padding: 0; }
.settings-card-footer { padding: 16px 24px; }
.time-options span { border-radius: 12px; min-height: 82px; }
.summary-line { padding: 14px 0; gap: 16px; }
.summary-line > * { min-width: 0; overflow-wrap: anywhere; }
.detail-heading { align-items: flex-start; gap: 12px; }
.detail-heading h2 { font-weight: 650; letter-spacing: -.025em; font-size: 1.3rem; }
.back-link { min-height: 36px; }
.detail-save { padding: 16px 0; }
.editor-card { width: 100%; min-width: 0; max-width: none; }
.release-steps { display: flex; gap: 12px; padding: 0; margin: 0 0 24px; width: 100%; min-width: 0; list-style: none; }
.release-steps li { display: flex; align-items: center; justify-content: center; gap: 8px; flex: 1; padding: 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); font-size: .75rem; background: var(--panel); }
.release-steps .active { color: var(--blue); border-color: var(--blue); background: rgba(var(--bs-primary-rgb),.06); font-weight: 650; }
.release-steps .complete { color: var(--green); }
.scanner-frame { width: 100%; background: #0e1c2e; border: 0; border-radius: 18px; aspect-ratio: 4/3; max-height: 440px; }
.scanner-placeholder { color: #c7d6e9; background: radial-gradient(ellipse at center,rgba(79,163,227,.13),transparent 70%); padding: 24px; text-align: center; }
.scanner-placeholder > i { padding: 24px; border: 2px solid rgba(131,184,225,.5); border-radius: 24px; color: #fff; font-size: 3rem; margin-bottom: 20px; }
#start-scanner { width: 100%; min-height: 52px; font-size: .95rem; }
#manual-scan { padding-top: 4px; }
.review-output { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.review-output span { border: 1px solid var(--line); border-radius: 13px; padding: 18px; font-size: .73rem; overflow-wrap: anywhere; }
.review-output strong { font-size: .9rem; font-weight: 650; }
.release-actions > .btn-primary { min-height: 50px; padding-inline: 24px; }
.document-preview { display: block; width: 100%; height: auto; min-height: 0; border-radius: 0; }
.pdf-toolbar { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 12px; border-bottom: 1px solid var(--line); }
.pdf-message { padding: 16px; margin: 0; text-align: center; }
.pdf-pages { display: grid; gap: 20px; margin: 20px; min-width: 0; }
.pdf-page { position: relative; width: 100%; background: white; box-shadow: 0 2px 8px rgba(0,0,0,.12); scroll-margin-top: 110px; }
.pdf-page canvas { display: block; max-width: 100%; }
.login-shell { background: radial-gradient(ellipse at 20% 20%,rgba(var(--bs-primary-rgb),.1),transparent 65%); padding-block: max(32px,env(safe-area-inset-top)); }
.login-card { border-radius: 24px; padding: 36px; box-shadow: 0 12px 45px rgba(18,42,72,.08); }
.login-card h1 { font-weight: 700; letter-spacing: -.035em; }
.login-brand { border: 0; padding-bottom: 12px; }
.app-footer { padding-bottom: 28px; font-size: .68rem; }
.offcanvas { --bs-offcanvas-bg: var(--panel); --bs-offcanvas-color: var(--text); --bs-offcanvas-width: min(340px,90vw); }
.offcanvas-header { border-bottom: 1px solid var(--line); padding: 12px 18px; }
.offcanvas-header .sidebar-brand { border: 0; padding: 0; height: auto; }
.offcanvas .btn-close { padding: 14px; margin-right: 0; }
.mobile-account { display: flex; align-items: center; gap: 14px; margin: 0 24px; border-top: 1px solid var(--line); padding: 22px 0; }
.mobile-account > i { font-size: 1.8rem; color: var(--blue); }
.mobile-account strong, .mobile-account small { display: block; overflow-wrap: anywhere; }
.mobile-account small { color: var(--muted); }
.mobile-navigation { display: none; }
@media (min-width: 992px) and (max-width: 1199.98px) {
  :root { --sidebar-width: 88px; }
  .sidebar-brand { justify-content: center; padding: 12px; }
  .sidebar .brand-text, .sidebar .nav-section, .sidebar-footer { display: none; }
  .sidebar .app-nav { padding: 24px 12px; }
  .sidebar .app-nav a { justify-content: center; flex-direction: column; gap: 6px; padding: 10px 4px; margin-bottom: 10px; }
  .sidebar .app-nav a span { font-size: .6rem; text-align: center; }
  .sidebar .app-nav a i { width: auto; font-size: 1.3rem; }
  .app-main { padding-inline: 24px; }
}
@media (max-width: 991.98px) {
  .topbar { left: 0; padding: 0 22px; }
  .app-main { margin-left: 0; padding: calc(var(--topbar-height) + 26px) 24px calc(100px + env(safe-area-inset-bottom)); }
  .mobile-navigation { display: flex; align-items: center; justify-content: space-around; gap: 6px; position: fixed; bottom: 0; inset-inline: 0; z-index: 1030; padding: 10px max(16px,env(safe-area-inset-left)) calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background-color: var(--panel); }
  .mobile-navigation a, .mobile-navigation button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 54px; max-width: 180px; flex: 1; padding: 6px 10px; border: 0; border-radius: 14px; background: transparent; color: var(--muted); font-size: .68rem; font-weight: 600; }
  .mobile-navigation i { font-size: 1.25rem; line-height: 1.25; }
  .mobile-navigation .active { color: var(--blue); background: rgba(var(--bs-primary-rgb),.09); }
  .mobile-navigation .jobs-tab i { font-size: 1.4rem; }
  .workspace-welcome { padding: 26px; }
  .btn-sm { min-height: 44px; }
  .form-check-input { min-height: 1.2em; min-width: 1.2em; }
}
@media (max-width: 767.98px) {
  .review-output { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .workspace-welcome { align-items: flex-start; }
  .welcome-mark { display: none; }
  .table-pagination { justify-content: center; padding: 16px 12px; }
  .table-pagination > span { width: 100%; text-align: center; }
  .table-pagination nav { justify-content: center; flex-wrap: wrap; }
  .table-filters .row > [class*="col-"] { flex: 1 1 130px; width: auto; }
  .table-filters .row > :first-child { flex-basis: 100%; }
  .jobs-table, .jobs-table tbody, .release-table, .release-table tbody { display: block; width: 100%; }
  .jobs-table thead, .release-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .jobs-table tbody, .release-table tbody { padding: 14px; }
  .jobs-table tr, .release-table tr { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; margin-bottom: 12px; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: var(--panel); }
  .jobs-table tr:last-child, .release-table tr:last-child { margin-bottom: 0; }
  .jobs-table td, .release-table td { display: block; border: 0; padding: 0; min-width: 0 !important; box-shadow: none; background: transparent; }
  .jobs-table .job-document { grid-column: 1; grid-row: 1; overflow-wrap: anywhere; }
  .jobs-table .job-status { grid-column: 2; grid-row: 1; text-align: right; }
  .jobs-table .job-settings, .jobs-table .job-owner { grid-column: 1/-1; font-size: .8rem; color: var(--muted); }
  .jobs-table .job-actions { grid-column: 1/-1; border-top: 1px solid var(--line); padding-top: 14px; }
  .jobs-table .job-actions > div { flex-wrap: nowrap !important; gap: 7px !important; }
  .jobs-table .job-actions a { flex: 1; padding-inline: 8px; font-size: .75rem; }
  .jobs-table .job-action-release { order: -1; }
  .jobs-table .job-actions form { flex: 0; }
  .jobs-table .job-actions form button { width: 44px; padding-inline: 0; }
  .jobs-table .status-reason { max-width: none; }
  .job-owner::before { content: "Owner · "; font-size: .7rem; }
  .release-table td:first-child { grid-column: 1/-1; }
  .release-table td:last-child { grid-column: 1/-1; padding-top: 4px; }
  .release-table td:last-child a { width: 100%; }
  .release-table td[colspan] { grid-column: 1/-1; }
  .detail-save { position: sticky; bottom: calc(88px + env(safe-area-inset-bottom)); padding: 12px; border: 1px solid var(--line); border-radius: 15px; background: var(--panel); z-index: 1010; box-shadow: 0 5px 20px rgba(18,42,72,.09); }
}
@media (max-width: 575.98px) {
  :root { --topbar-height: 68px; }
  .topbar { padding-inline: 16px; gap: 10px; }
  .topbar-context { min-width: 0; flex: 1; }
  .topbar-context strong { font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .topbar-context small { font-size: .63rem; }
  .topbar-actions { gap: 6px; flex-shrink: 0; }
  .topbar > .icon-button { flex-shrink: 0; }
  .user-avatar { display: grid; }
  .app-main { padding-inline: 16px; padding-top: calc(var(--topbar-height) + 24px); }
  .page-title { margin-bottom: 22px; }
  .page-title p { font-size: .82rem; }
  .workspace-welcome { padding: 22px; border-radius: 18px; margin-bottom: 18px; }
  .workspace-welcome .btn { width: 100%; }
  .workspace-welcome h2 { font-size: 1.45rem; }
  .stat-card .card-body { padding: 16px; }
  .stat-icon { display: none; }
  .stat-label { padding: 0; font-size: .72rem; }
  .stat-value { font-size: 1.8rem; margin-top: 10px; }
  [data-bs-theme] .card { --bs-card-spacer-x: 18px; --bs-card-spacer-y: 18px; }
  .card-header, .card-footer, .settings-card-body, .table-filters { padding: 18px; }
  .settings-card-body-flush { padding: 0; }
  .settings-toggle-row { padding: 16px 18px; gap: 14px; }
  .settings-toggle-row strong { font-size: .86rem; }
  .settings-card-footer { padding: 14px 18px; }
  .settings-card-footer .btn { width: 100%; }
  .report-hub-card .card-body { padding: 18px; grid-template-columns: 44px minmax(0,1fr) auto; min-height: 116px; }
  .report-hub-card h2 { font-size: .94rem; }
  .report-hub-card p { font-size: .78rem; }
  .upload-panel form > .btn { width: 100%; }
  .release-steps { gap: 6px; margin-bottom: 18px; }
  .release-steps li { padding: 10px 6px; flex-direction: column; font-size: .65rem; text-align: center; }
  .release-steps li i { font-size: 1rem; }
  .scanner-frame { aspect-ratio: 1; }
  .scanner-card .input-group { flex-direction: column; gap: 10px; }
  .scanner-card .input-group > * { width: 100%; border-radius: 10px !important; margin: 0; }
  .release-actions .btn-primary { width: 100%; }
  .release-actions a { flex: 1; }
  .detail-save .btn { flex: 1; padding-inline: 10px; }
  .login-card { padding: 28px 24px; border-radius: 22px; }
  .app-footer { margin-top: 12px; gap: 10px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
@media print { .mobile-navigation, .workspace-welcome, .release-steps { display: none !important; } .app-main { margin: 0; padding: 0; } }

.job-filters { display: grid; grid-template-columns: minmax(220px,1fr) minmax(0,1.4fr); gap: 20px; align-items: start; }
.job-filter-options > .row > [class*="col-"] { min-width: 0; }
.job-filters .filter-actions { margin-top: 12px; }
@media (max-width: 767.98px) {
  .job-filters { grid-template-columns: minmax(0,1fr); gap: 12px; }
  .table-filters .row > [class*="col-"] { min-width: 0; }
  .job-filter-options .row > :first-child { flex-basis: 130px; }
}

.card-header p, .job-owner, .job-settings { overflow-wrap: anywhere; }
@media (max-width: 380px) {
  .jobs-table .job-actions > div { display: grid !important; grid-template-columns: minmax(0,1fr) minmax(0,1fr) 44px; }
  .jobs-table .job-action-release { grid-column: 1/-1; }
}

.job-status .badge { max-width: 115px; white-space: normal; line-height: 1.35; }
@media (max-width: 767.98px) { .release-table td[data-label]::before { content: attr(data-label); display: block; color: var(--muted); font-size: .7rem; margin-bottom: 4px; } }

.page-hero h1 { margin: 10px 0; font-size: clamp(1.45rem,2.5vw,2rem); letter-spacing: -.04em; font-weight: 700; }
.page-hero p { margin-bottom: 0; }
.page-hero .btn { margin-top: 20px; }
.stat-link { color: var(--text); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.stat-link:hover, .stat-link:focus-visible { color: var(--text); border-color: var(--blue); box-shadow: 0 5px 20px rgba(18,42,72,.08); }
.camera-controls { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); align-items: end; gap: 14px; }
.camera-controls #start-scanner { min-height: 46px; }
@media (max-width: 575.98px) { .page-hero { display: none; } .camera-controls { grid-template-columns: minmax(0,1fr); } }

.mobile-page-title { display: none; }
@media (max-width: 575.98px) { .mobile-page-title { display: block; } }

/* Printer health history: responsive, locally rendered charts. */
.printer-history-chart { display:block; width:100%; height:auto; max-height:320px; overflow:visible; }
.history-grid { fill:none; stroke:var(--bs-border-color); stroke-width:1; }
.history-axis { fill:var(--bs-secondary-color); font-size:12px; }
.history-line { fill:none; stroke:var(--bs-primary); stroke-width:2; stroke-linejoin:round; }
.history-point,.history-bar-color { fill:var(--bs-primary); }
.history-bar-mono { fill:var(--bs-secondary); }

/* A shared supply plot with an accessible, wrapping legend. */
.supply-color-cyan { --supply-color:#00bcd4; }
.supply-color-magenta { --supply-color:#d12b9b; }
.supply-color-yellow { --supply-color:#ffe000; }
.supply-color-black { --supply-color:#252a32; }
.supply-color-neutral { --supply-color:#78869b; }
[data-bs-theme="dark"] .supply-color-black { --supply-color:#c2c8d0; }
[data-supply-chart] .history-line { stroke:var(--supply-color); stroke-width:2.5; }
[data-supply-chart] .history-point { fill:var(--supply-color); }
.history-line-outline { fill:none; stroke:var(--bs-body-bg); stroke-width:4.5; stroke-linejoin:round; }
.supply-color-yellow .history-line-outline { stroke:#8a7100; }
[data-supply-series][hidden] { display:none; }
.history-legend { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,180px),1fr)); gap:.5rem; }
.history-legend-item { display:flex; align-items:center; gap:.65rem; min-height:52px; text-align:left; border:1px solid var(--bs-border-color); border-radius:.75rem; padding:.65rem; background:var(--bs-body-bg); color:var(--bs-body-color); overflow-wrap:anywhere; }
.history-legend-item:focus-visible { outline:2px solid var(--bs-primary); outline-offset:2px; }
.history-legend-item[aria-pressed="false"] { opacity:.55; }
.history-legend-item[aria-pressed="false"] i { visibility:hidden; }
.history-swatch { width:1rem; height:1rem; flex-shrink:0; border-radius:50%; background:var(--supply-color); border:1px solid #888; }
