/* Single monthly voucher desk; document details stay in an in-page dialog. */
.voucher-workspace .topbar { height: 56px; gap: 14px; padding-inline: 16px; }
.voucher-workspace .office-layout { height: calc(100dvh - 56px); grid-template-columns: 250px minmax(0, 1fr); }
.voucher-workspace .office-layout.files-collapsed { grid-template-columns: minmax(0, 1fr); }
.voucher-workspace .files-collapsed .document-sidebar { display: none; }
.voucher-workspace #open-files { display: inline-flex; }
.voucher-workspace .queue-button { background: transparent; border-color: transparent; color: #606c67; }
.voucher-workspace #file-count { min-width: 20px; font-size: 10px; font-variant-numeric: tabular-nums; }
.voucher-workspace .document-sidebar { display: flex; padding: 24px 20px 10px; gap: 0; overflow-y: auto; scrollbar-width: thin; }
.office-identity { display: grid; gap: 15px; padding: 0 4px 18px; }
.office-identity a { justify-self: start; }
.office-logo { display: block; width: 115px; height: auto; }
.office-personnel { display: block; width: 100%; max-width: 210px; height: auto; }
.voucher-workspace .desk-lamp { margin: 0 0 25px; flex: none; }
.voucher-workspace .desk-lamp-caption { left: 108px; font-size: 10px; line-height: 1.6; }
.voucher-workspace .desk-lamp-caption .eyebrow { font-size: 8px; }
.voucher-context { display: grid; min-width: 0; }
.voucher-context label { color: #b7c2b8; font-size: 10px; font-weight: 600; }
.voucher-context select, .voucher-context input { width: 100%; min-width: 0; height: 40px; background: #202724; border: 1px solid #424d46; color: #f0f4eb; border-radius: 4px; padding: 0 9px; font: 12px "Segoe UI", sans-serif; color-scheme: dark; }
.voucher-context > select { margin-top: 9px; text-overflow: ellipsis; }
.voucher-context select:focus-visible, .voucher-context input:focus-visible { outline: 2px solid #d2ef78; outline-offset: 3px; }
.context-origin { font-size: 10px; line-height: 1.6; color: #96a69a; margin: 8px 0 22px; }
.period-fields { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 10px; }
.period-fields label { display: grid; gap: 9px; }
.voucher-date { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-top: 1px solid #303b32; border-bottom: 1px solid #303b32; gap: 10px; font-size: 11px; color: #a5b5a7; }
.voucher-date strong { color: #e7eddf; font: 12px Consolas, monospace; }
.voucher-workspace .document-sidebar .add-files { margin: 22px 0 12px; flex: none; }
.voucher-workspace .add-files > span, .voucher-workspace .sidebar-account > span { display: block; }
.source-connection { display: flex; align-items: center; gap: 8px; font-size: 10px; color: #9bad9d; padding: 8px 0; }
.source-connection svg { width: 14px; height: 14px; }
.source-connection svg:last-child { margin-left: auto; }
.source-connection:hover { color: #e0edcf; }
.context-bottom { margin-top: auto; padding: 28px 0 18px; }
.context-bottom .eyebrow { color: #8d9e90; font-size: 9px; }
.context-bottom p { font-size: 12px; color: #ccdac7; margin-top: 5px; }
.voucher-workspace .sidebar-account { margin: 0; justify-content: flex-start; padding-inline: 0; flex: none; }
.voucher-workspace .workspace { padding: 0; background: #fff; }
.voucher-desk { display: flex; flex-direction: column; flex: 1; min-height: 0; min-width: 0; }
.voucher-desk.dragging { outline: 2px dashed #4f7b65; outline-offset: -5px; background: #f5f9ef; }
.voucher-heading { padding: 28px 30px 24px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.voucher-heading .eyebrow { font-size: 9px; color: #8a948e; }
.voucher-heading h2 { font-size: 23px; font-weight: 600; margin-top: 6px; color: #25302b; }
.voucher-heading p { font-size: 12px; color: #758078; margin-top: 9px; line-height: 1.6; overflow-wrap: anywhere; }
.draft-label { display: inline-flex; align-items: center; gap: 7px; flex: none; font-size: 11px; color: #a25b3c; padding-top: 22px; }
.draft-label svg { width: 15px; height: 15px; }
.voucher-overview { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 13px 30px; border-block: 1px solid #e1e6e2; background: #f7f9f7; font-size: 11px; }
.voucher-overview > span:first-child { font-weight: 600; color: #334a3b; }
.voucher-overview > span:last-child { color: #78867b; font-size: 10px; }
.context-notice { padding: 10px 30px; color: #965439; background: #fff7f1; border-bottom: 1px solid #ecdace; font-size: 11px; line-height: 1.6; }
.voucher-scroll { flex: 1; min-height: 0; overflow: auto; scrollbar-width: thin; scrollbar-color: #cbd4c9 transparent; }
.voucher-empty { display: flex; min-height: 100%; flex-direction: column; justify-content: center; align-items: center; padding: 40px 20px; gap: 24px; text-align: center; }
.voucher-empty h3 { font-size: 21px; font-weight: 500; color: #5b6a60; }
.voucher-empty .format-list { margin: 4px 0 0; }
.voucher-groups { padding-inline: 30px; }
.voucher-group { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 18px; padding: 22px 0; border-bottom: 1px solid #dce4dd; }
.invoice-sequence { padding-top: 7px; font: 17px Consolas, monospace; color: #778f73; }
.invoice-accounting { min-width: 0; }
.invoice-group-heading { display: flex; align-items: flex-start; gap: 14px; justify-content: space-between; }
.invoice-identity { min-width: 0; }
.invoice-identity h3 { font: 600 13px/1.6 "Segoe UI", sans-serif; color: #263b31; overflow-wrap: anywhere; }
.voucher-group { cursor: pointer; }
.voucher-group:hover { background: #fafcf8; }
.invoice-open { display: block; padding: 0; text-align: left; font: inherit; overflow-wrap: anywhere; }
.invoice-open:hover { color: #176d61; text-decoration: underline; text-underline-offset: 4px; }
.preview-unavailable { padding: 32px; text-align: center; color: #78877b; font-size: 13px; line-height: 1.8; }
.preview-unavailable .button { margin-top: 18px; }
.native-pdf .zoom-control, .native-pdf #paper-fit { display: none; }
.native-pdf .preview-content { padding: 0; overflow: hidden; }
.invoice-identity p { font-size: 11px; color: #77857b; margin-top: 4px; line-height: 1.7; overflow-wrap: anywhere; }
.invoice-group-meta { display: flex; align-items: center; gap: 16px; flex: none; font: 11px Consolas, monospace; color: #78877b; }
.invoice-source-totals { display: flex; flex-wrap: wrap; gap: 10px 30px; margin: 17px 0; }
.invoice-source-totals > div { display: flex; align-items: baseline; gap: 9px; }
.invoice-source-totals dt { font-size: 10px; color: #929b95; }
.invoice-source-totals dd { margin: 0; font: 12px Consolas, monospace; color: #4c6155; }
.invoice-source-totals > div:last-child dd { color: #2c4738; font-weight: 600; }
.posting-lines { table-layout: fixed; }
.posting-lines th { position: static; background: #f6f8f5; font-size: 10px; color: #8a968c; }
.posting-lines th, .posting-lines td { padding: 9px 10px; border-color: #e5eae4; max-width: none; }
.posting-lines th:first-child { width: 15%; }
.posting-lines th:nth-child(3), .posting-lines th:nth-child(4) { width: 15%; }
.posting-lines td { font-size: 11px; color: #8a958c; }
.invoice-provenance { display: flex; flex-wrap: wrap; gap: 8px; font-size: 9px; color: #a0a8a2; line-height: 1.6; margin-top: 9px; }
.invoice-error { color: #a15c45; }
.voucher-totals { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: baseline; gap: 12px 24px; padding: 18px 30px; border-top: 1px solid #dce4dd; flex: none; background: #fafcf9; }
.voucher-totals > span { margin-right: auto; font-size: 11px; color: #728474; }
.voucher-totals strong { font: 600 18px Consolas, monospace; color: #2b4633; }
.voucher-totals small { width: 100%; text-align: right; color: #a5774d; }
.voucher-workspace .workspace-footer { flex: none; }
.documents-dialog { width: min(580px, calc(100vw - 32px)); padding: 24px; background: #151b17; color: #d6e1d4; border-color: #39443b; }
.documents-dialog[open] { display: flex; flex-direction: column; max-height: 80dvh; }
.documents-dialog .dialog-header { margin-bottom: 18px; gap: 15px; }
.documents-dialog .dialog-header h2 { margin-top: 6px; font-size: 19px; }
.documents-dialog #session-count { font-size: 11px; font-weight: 400; margin-left: 10px; color: #8e9e8e; }
.documents-dialog .queue-tools { display: grid; grid-template-columns: minmax(0, 1fr) 150px; flex: none; margin: 0 0 16px; }
.documents-dialog .queue-search { margin: 0; }
.documents-dialog .queue-search input { margin: 0; padding: 0; height: 34px; }
.documents-dialog .queue-tools select { height: 36px; }
.documents-dialog .file-list { display: block; overflow: auto; min-height: 80px; }
.documents-dialog .session-summary { display: flex; margin-top: 12px; padding-bottom: 0; }
.preview-dialog { width: min(1320px, calc(100vw - 48px)); height: min(880px, calc(100dvh - 48px)); max-width: none; max-height: none; border-radius: 6px; overflow: hidden; }
.preview-dialog[open] { display: flex; flex-direction: column; }
.preview-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: #fff; padding: 7px 16px; min-height: 47px; border-bottom: 1px solid #dce4dd; flex: none; font-size: 12px; }
.preview-heading > div { display: flex; gap: 6px; }
.preview-dialog .work-area { position: relative; grid-template-columns: minmax(0, 1fr) 310px; }
.preview-dialog .work-area.analysis-hidden, .preview-dialog .work-area.document-focus { grid-template-columns: minmax(0, 1fr); }
.preview-dialog .analysis-hidden .analysis-panel, .preview-dialog .document-focus .analysis-panel { display: none; }
.preview-dialog .personnel-header h2 { font-size: 14px; font-weight: 500; color: #d0dfc8; }
.voucher-workspace dialog::backdrop { background: #111b1759; backdrop-filter: blur(3px); }
@media (max-width: 1100px) {
  .voucher-workspace .office-layout { grid-template-columns: 225px minmax(0, 1fr); }
  .voucher-workspace .office-layout.files-collapsed { grid-template-columns: minmax(0, 1fr); }
  .voucher-workspace .document-sidebar { padding-inline: 16px; }
  .voucher-heading { padding: 24px; }
  .voucher-overview, .voucher-totals, .context-notice { padding-inline: 24px; }
  .voucher-groups { padding-inline: 24px; }
  .voucher-group { gap: 10px; grid-template-columns: 25px minmax(0, 1fr); }
  .invoice-source-totals { gap: 10px 20px; }
  .invoice-source-totals > div { display: grid; gap: 5px; }
}
@media (max-width: 730px) {
  .voucher-workspace .office-layout, .voucher-workspace .office-layout.files-collapsed { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .voucher-workspace .document-sidebar { display: none; }
  .voucher-workspace .files-expanded .document-sidebar { display: flex; position: absolute; top: 56px; bottom: 0; width: 260px; z-index: 5; padding: 22px 20px 10px; }
  .voucher-workspace .topbar { padding-inline: 9px; gap: 8px; }
  .voucher-heading { padding: 20px 16px; gap: 12px; }
  .voucher-heading h2 { font-size: 20px; }
  .voucher-heading p { font-size: 11px; }
  .draft-label { font-size: 10px; gap: 4px; }
  .voucher-overview, .voucher-totals, .context-notice { padding-inline: 16px; }
  .voucher-groups { padding-inline: 12px; }
  .voucher-group { grid-template-columns: 21px minmax(0, 1fr); gap: 7px; padding-top: 18px; }
  .invoice-sequence { font-size: 14px; }
  .invoice-group-heading { gap: 8px; }
  .invoice-group-meta { flex-direction: column-reverse; gap: 6px; align-items: flex-end; font-size: 9px; }
  .invoice-identity h3 { font-size: 12px; }
  .invoice-identity p { font-size: 10px; }
  .invoice-source-totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .invoice-source-totals dt { font-size: 9px; }
  .invoice-source-totals dd { font-size: 10px; overflow-wrap: anywhere; }
  .posting-lines th, .posting-lines td { padding: 8px 5px; font-size: 9px; }
  .posting-lines th:first-child { width: 17%; }
  .posting-lines th:nth-child(3), .posting-lines th:nth-child(4) { width: 14%; }
  .voucher-totals { padding-block: 14px; gap: 10px; }
  .voucher-totals strong { font-size: 16px; }
  .voucher-empty h3 { font-size: 18px; }
  .voucher-empty .upload-emblem { width: 55px; height: 65px; }
  .preview-dialog { width: calc(100vw - 12px); height: calc(100dvh - 16px); }
  .preview-dialog .work-area { grid-template-columns: minmax(0, 1fr); }
  .preview-dialog .analysis-mobile-open:not(.document-focus) .analysis-panel { display: flex; position: absolute; inset: 0 0 0 auto; width: min(340px, 100%); z-index: 4; }
  .preview-dialog .document-name svg { display: none; }
  .preview-dialog .document-toolbar { padding-inline: 8px; }
  .preview-dialog .view-controls { padding-right: 6px; }
  .documents-dialog { padding: 18px; }
  .documents-dialog .queue-tools { grid-template-columns: minmax(0, 1fr); }
}
@media (max-height: 700px) and (min-width: 731px) {
  .voucher-workspace .document-sidebar { padding-top: 16px; }
  .office-identity { gap: 8px; padding-bottom: 7px; }
  .office-logo { width: 95px; }
  .office-personnel { max-width: 175px; }
  .voucher-workspace .desk-lamp { height: 74px; min-height: 74px; margin-bottom: 15px; }
  .context-origin { margin-bottom: 15px; }
  .context-bottom { padding: 18px 0 12px; }
}
