/* One responsive workspace for the material document lists. */
.doc-workspace > .toolbar { justify-content: flex-end; margin-bottom: 12px; }
.doc-workspace > .toolbar > div { display: none; }
.doc-workspace > .toolbar .primary { min-height: 42px; font-size: 13px; }
.doc-workspace .doc-filter-bar { display: block; margin-bottom: 14px; }
.doc-main-filters { display: grid; grid-template-columns: minmax(240px,1fr) minmax(185px,220px) 160px 148px; gap: 9px; }
.doc-filter-bar label { min-width: 0; margin: 0; }
.doc-main-filters input, .doc-main-filters select, .doc-period-button { width: 100%; min-width: 0; height: 42px; margin: 0; padding: 10px 12px; border: 1px solid #d7e2dc; border-radius: 9px; background: #fff; color: var(--ink); font-size: 12px; outline: none; }
.doc-main-filters input:focus, .doc-main-filters select:focus, .doc-period-button:focus-visible { border-color: var(--green2); box-shadow: 0 0 0 3px #24956b15; }
.doc-search { position: relative; display: block; }
.doc-search > svg { position: absolute; top: 12px; left: 12px; width: 18px; height: 18px; fill: none; stroke: #80988a; stroke-width: 1.5; }
.doc-search input { padding-left: 38px; }
.doc-period-button { display: flex; align-items: center; gap: 9px; text-align: left; cursor: pointer; }
.doc-period-button b { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.doc-period-button > span { color: #82968b; }
.doc-view-filters { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding-top: 10px; }
.doc-view-filters > span { flex: 1; }
.doc-view-filters select { width: 190px; max-width: 100%; height: 30px; margin: 0; padding: 4px 10px; border: 1px solid #dce6df; border-radius: 7px; background: transparent; font-size: 11px; color: #486d59; }
.doc-view-filters button { padding: 4px 0; border: 0; background: transparent; color: #477a5b; font-size: 11px; cursor: pointer; }
.doc-view-filters button:hover { color: #155f42; text-decoration: underline; }
.doc-view-filters button:disabled { color: #9ba79f; cursor: default; }
.doc-workspace > .panel { padding: 0; border-radius: 12px; overflow: hidden; }
.doc-table-scroll { overflow: auto; max-height: max(280px,calc(100vh - 335px)); scrollbar-width: thin; scrollbar-color: #c7d5cc #fafcfb; }
#documents-table .doc-table { width: 100%; min-width: 930px; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: 12px; }
#documents-table .doc-table th { position: sticky; top: 0; z-index: 2; height: 39px; padding: 4px 5px; background: #f5f8f6; color: #607867; font-size: 11px; font-weight: 650; letter-spacing: 0; text-transform: none; white-space: nowrap; border-bottom: 1px solid #dce6df; }
#documents-table .doc-table th.doc-col-date { width: 120px; }
#documents-table .doc-table th.doc-col-number { width: 202px; }
#documents-table .doc-table th.doc-col-type { width: 106px; }
#documents-table .doc-table-combined { min-width: 1040px; }
#documents-table .doc-table th.doc-col-warehouse { width: 118px; }
#documents-table .doc-table th.doc-col-lines { width: 64px; }
#documents-table .doc-table th.doc-col-total { width: 124px; }
#documents-table .doc-table th.doc-col-status { width: 96px; }
#documents-table .doc-table th.doc-col-actions { width: 44px; }
#documents-table .doc-table th.doc-col-actions > span { font-size: 0; }
#documents-table .doc-table .document-column-filter { min-height: 29px; gap: 3px; padding: 4px 2px; border-radius: 5px; }
#documents-table .doc-table .document-column-filter i { width: 14px; height: 16px; flex-basis: 14px; }
#documents-table .doc-table .document-column-filter svg { width: 12px; height: 12px; }
#documents-table .doc-table td { height: 45px; padding: 8px; border-bottom: 1px solid #eaf0ec; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: #fff; cursor: pointer; }
#documents-table .doc-table tr:nth-child(even) td { background: #fafcfb; }
#documents-table .doc-table tr:hover td, #documents-table .doc-table tr:focus-visible td { background: #eef6f1; }
#documents-table .doc-table tr:focus-visible { outline: 2px solid var(--green2); outline-offset: -2px; }
#documents-table .doc-table .doc-date { color: #788b7d; font-size: 11px; font-variant-numeric: tabular-nums; }
#documents-table .doc-table .document-number-button { font-weight: 650; font-size: 12px; text-decoration: none; white-space: nowrap; }
#documents-table .doc-table .document-number-button:hover { text-decoration: underline; }
#documents-table .doc-table .numeric { text-align: right; font-variant-numeric: tabular-nums; }
#documents-table .doc-table .doc-amount { color: #203c2d; font-weight: 650; }
#documents-table .doc-table .tag { font-size: 10px; padding: 4px 8px; }
#documents-table .doc-table .doc-actions { padding: 2px 4px; text-align: center; }
.doc-more { width: 32px; height: 34px; padding: 0; border: 0; border-radius: 7px; color: #718c7d; background: transparent; font-size: 23px; line-height: 1; cursor: pointer; }
.doc-more:hover, .doc-more[aria-expanded=true] { color: #176e50; background: #dfeee5; }
.doc-workspace .materials-filter-chips { padding: 10px 12px; border-bottom: 1px solid #e3ebe6; }
.doc-workspace .materials-filter-chips:empty { border: 0; }
.doc-workspace .materials-list-footer { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 11px 14px; background: #fbfcfb; border-top: 1px solid #dce6df; color: #788c7e; font-size: 11px; }
.doc-footer-total { display: flex; align-items: baseline; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.doc-footer-total b { color: #176c4c; font-size: 15px; font-variant-numeric: tabular-nums; }
.doc-footer-total small { font-size: 10px; font-weight: 500; }
.doc-row-menu { position: fixed; z-index: 230; width: 230px; padding: 6px; border: 1px solid #dce6df; border-radius: 11px; background: #fff; box-shadow: 0 10px 35px #183e2b26; }
.doc-row-menu button { display: block; width: 100%; min-height: 38px; padding: 9px 11px; border: 0; border-radius: 6px; background: transparent; color: #2c5139; text-align: left; font-size: 12px; cursor: pointer; }
.doc-row-menu button:hover, .doc-row-menu button:focus-visible { background: #eef6f1; outline: none; }
.doc-row-menu .danger { margin-top: 5px; border-top: 1px solid #edf0ee; border-radius: 0; color: #a14740; }
.doc-period-dialog, .doc-save-view-dialog { width: min(420px,calc(100vw - 24px)); max-height: calc(100dvh - 32px); border: 1px solid #e0e9e3; border-radius: 16px; }
.doc-period-dialog::backdrop, .doc-save-view-dialog::backdrop { background: #14332436; backdrop-filter: blur(2px); }
.doc-period-dialog form, .doc-save-view-dialog form { padding: 21px; }
.doc-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.doc-dialog-head h2 { margin: 0; font-size: 18px; }
.doc-save-view-dialog p { color: #768b7c; font-size: 12px; line-height: 1.5; }
.doc-period-presets { display: grid; grid-template-columns: repeat(4,1fr); gap: 6px; margin-top: 18px; }
.doc-period-presets button { min-height: 38px; padding: 7px 4px; border: 1px solid #e2e9e5; border-radius: 8px; color: #53745f; background: #f7faf8; font-size: 11px; cursor: pointer; }
.doc-period-presets button.active { background: #e6f3eb; color: #176c4c; border-color: #a8ceba; }
.doc-period-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.doc-period-fields input, .doc-save-view-dialog input { width: 100%; min-width: 0; background: #fff; }
.doc-period-fields label { min-width: 0; }
.doc-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.doc-dialog-actions .primary, .doc-dialog-actions .secondary { width: auto; margin: 0; min-height: 42px; font-size: 12px; }
@media (max-width: 960px) and (min-width: 721px) {
 .doc-main-filters { grid-template-columns: minmax(210px,1fr) 180px; }
 .doc-main-filters > label:nth-last-child(-n+2) { min-width: 0; }
}
@media (max-width: 720px) {
 .doc-main-filters { grid-template-columns: 1fr 1fr; gap: 8px; }
 .doc-search, .doc-period-button { grid-column: 1/-1; }
 .doc-view-filters { gap: 10px; }
 .doc-view-filters label { flex: 1; min-width: 150px; }
 .doc-view-filters select { width: 100%; height: 36px; }
 .doc-view-filters > span { display: none; }
 .doc-view-filters button { min-height: 36px; }
 .doc-workspace > .panel { background: #f5f8f6; overflow: visible; }
 .doc-table-scroll { max-height: none; overflow: visible; }
 #documents-table .doc-table { display: block; min-width: 0; width: 100%; }
 #documents-table .doc-table thead { display: none; }
 #documents-table .doc-table tbody { display: grid; gap: 9px; padding: 10px; }
 #documents-table .doc-table tr { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 5px 10px; padding: 12px; border: 1px solid #e1e9e4; border-radius: 10px; background: white; box-shadow: none; }
 #documents-table .doc-table td { display: block; width: auto; height: auto; min-height: 0; padding: 0; border: 0; background: transparent; text-align: left; overflow-wrap: normal; }
 #documents-table .doc-table td:before { display: none; }
 #documents-table .doc-table tr:hover td, #documents-table .doc-table tr:nth-child(even) td { background: transparent; }
 #documents-table .doc-table td.doc-date { grid-column: 1; grid-row: 3; }
 #documents-table .doc-table td.doc-number { grid-column: 1; grid-row: 1; }
 #documents-table .doc-table td.doc-party { grid-column: 1/-1; grid-row: 2; color: #526e5b; }
 #documents-table .doc-table td.doc-warehouse { grid-column: 2; grid-row: 3; text-align: right; font-size: 10px; color: #788b7d; }
 #documents-table .doc-table td.doc-lines { display: none; }
 #documents-table .doc-table td.doc-amount { grid-column: 2; grid-row: 1; text-align: right; font-size: 12px; }
 #documents-table .doc-table td.doc-status { grid-column: 1; grid-row: 4; align-self: center; }
 #documents-table .doc-table td.doc-actions { grid-column: 2; grid-row: 4; text-align: right; }
 #documents-table .doc-table td.doc-type { grid-column: 1/-1; grid-row: 5; font-size: 10px; color: #788b7d; }
 #documents-table .doc-table .document-number-button { max-width: 100%; min-height: 0; padding: 0; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
 .doc-more { width: 40px; min-height: 40px; }
 .doc-workspace .materials-list-footer { flex-direction: column; align-items: flex-start; gap: 7px; border-radius: 0 0 12px 12px; }
 .doc-row-menu { width: min(280px,calc(100vw - 24px)); }
 .doc-row-menu button { min-height: 44px; }
 .doc-period-fields input { padding: 10px 6px; font-size: 12px; }
 .doc-period-dialog, .doc-save-view-dialog { border-radius: 16px; }
}
