body.openbox-fixed-table-page { overflow: hidden; }
body.openbox-fixed-table-page .page { width: 100%; max-width: none; height: calc(100vh - 66px); overflow: hidden; }
body.openbox-fixed-table-page .page-content { height: 100%; overflow: hidden; padding-bottom: 0; }
body.openbox-fixed-table-page .panel { width: 100%; margin-bottom: 0; }
body.openbox-fixed-table-page .panel-body.table-responsive { overflow-x: visible; }
body.openbox-fixed-table-page .openbox-table-horizontal-scroll {
  position: relative;
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-gutter: auto;
  overscroll-behavior-x: contain;
}
body.openbox-fixed-table-page .dataTables_wrapper { min-height: 0; }
.managed-table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.openbox-global-table-search { width: 280px; margin-left: auto; }
.openbox-global-table-search .form-control { width: 100%; height: 36px; }
body.openbox-fixed-table-page #viewResults { margin-bottom: 0 !important; }
body.openbox-fixed-table-page #viewResults > thead { display: table; width: 100%; table-layout: fixed; }
body.openbox-fixed-table-page #viewResults > tbody {
  display: block;
  height: calc(100vh - 455px);
  min-height: 120px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}
body.openbox-fixed-table-page #viewResults > tbody > tr { display: table; width: 100%; table-layout: fixed; }
body.openbox-fixed-table-page .dataTables_wrapper > .bottom {
  position: relative;
  z-index: 3;
  min-height: 64px;
  margin: 0;
  padding-top: 12px;
  background: #fff;
}
.openbox-table-context-menu {
  position: fixed;
  z-index: 1900;
  display: none;
  min-width: 240px;
  padding: 6px 0;
  color: #526069;
  background: #fff;
  border: 1px solid #e4eaec;
  border-radius: 3px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .16);
}
.openbox-table-context-menu.is-open { display: block; }
.openbox-table-context-title {
  padding: 7px 14px;
  overflow: hidden;
  color: #a3afb7;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.openbox-pin-toggle { display: flex; align-items: center; gap: 9px; margin: 0; padding: 9px 14px; cursor: pointer; }
.openbox-pin-toggle:hover { background: #f3f7f9; }
.openbox-pin-toggle input { width: 16px; height: 16px; margin: 0; }
.openbox-pin-toggle input:disabled + span { color: #ccd5db; }
#viewResults .openbox-pinned-column { position: relative !important; z-index: 4; background-clip: padding-box; will-change: transform; }
#viewResults thead .openbox-pinned-column { z-index: 8; background: #fff; }
#viewResults tbody .openbox-pinned-column { background-color: #fff; }
#viewResults tbody tr:nth-child(odd) .openbox-pinned-column { background-color: #f3f3f3; }
#viewResults .openbox-pinned-boundary {
  border-right: 0 !important;
  box-shadow: 7px 0 10px rgba(82, 96, 105, .22);
}
.openbox-pinned-boundary-guide {
  position: absolute;
  z-index: 30;
  display: block;
  width: 2px;
  background: #526069;
  box-shadow: 4px 0 8px rgba(82,96,105,.2);
  pointer-events: none;
}
.openbox-context-separator { height: 1px; margin: 5px 0; background: #e4eaec; }
.openbox-row-color-title { padding: 7px 14px 5px; color: #76838f; font-size: 12px; font-weight: 600; }
.openbox-row-color-options { display: flex; align-items: center; gap: 8px; padding: 4px 14px 8px; }
.openbox-row-color-options label { position: relative; margin: 0; cursor: pointer; }
.openbox-row-color-options input { position: absolute; opacity: 0; pointer-events: none; }
.openbox-color-radio { display: block; width: 18px; height: 18px; border: 1px solid rgba(82,96,105,.28); border-radius: 50%; }
.openbox-color-radio.is-yellow { background: #fff4b8; }
.openbox-color-radio.is-pink { background: #ffd9e5; }
.openbox-color-radio.is-blue { background: #d9efff; }
.openbox-color-radio.is-green { background: #dcf5df; }
.openbox-color-radio.is-gray { background: #e8ecef; }
.openbox-color-radio.is-clear { background: #fff; }
.openbox-row-color-options input:checked + .openbox-color-radio { border-color: #3e8ef7; box-shadow: 0 0 0 2px #3e8ef7; }
.openbox-row-color-options input:disabled + .openbox-color-radio { opacity: .45; cursor: default; }
.openbox-row-color-hint { padding: 5px 14px 8px; color: #a3afb7; font-size: 12px; }
#viewResults tbody tr.openbox-row-fill-yellow > td { background: #fff4b8 !important; }
#viewResults tbody tr.openbox-row-fill-pink > td { background: #ffd9e5 !important; }
#viewResults tbody tr.openbox-row-fill-blue > td { background: #d9efff !important; }
#viewResults tbody tr.openbox-row-fill-green > td { background: #dcf5df !important; }
#viewResults tbody tr.openbox-row-fill-gray > td { background: #e8ecef !important; }
@media (max-width: 767px) {
  .managed-table-toolbar { align-items: stretch; flex-wrap: wrap; }
  .openbox-global-table-search { width: 100%; margin-left: 0; }
  body.openbox-fixed-table-page .page { height: calc(100vh - 67px); }
  body.openbox-fixed-table-page #viewResults > tbody { height: calc(100vh - 445px); }
}


body.openbox-fixed-table-page .page {
  width: auto;
}

body.openbox-fixed-table-page .page-content,
body.openbox-fixed-table-page .panel,
body.openbox-fixed-table-page .panel-body.table-responsive,
body.openbox-fixed-table-page .dataTables_wrapper,
body.openbox-fixed-table-page .managed-table-toolbar,
body.openbox-fixed-table-page .openbox-table-horizontal-scroll {
  width: 100%;
  max-width: none;
}

body.openbox-fixed-table-page #viewResults > thead > tr::after,
body.openbox-fixed-table-page #viewResults > tbody > tr:not(.child)::after {
  display: table-cell;
  width: auto;
  padding: 0;
  border: 0;
  background: transparent;
  content: '';
}


[data-openbox-component="managed-table"][data-openbox-loading="true"] {
  position: relative;
  min-height: 120px;
}

[data-openbox-component="managed-table"][data-openbox-loading="true"]:not(.openbox-table-ready) table {
  visibility: hidden;
}

[data-openbox-component="managed-table"][data-openbox-loading="true"]:not(.openbox-table-ready)::before {
  content: "";
  position: absolute;
  top: 34px;
  left: 50%;
  z-index: 2;
  width: 28px;
  height: 28px;
  margin-left: -14px;
  border: 3px solid #d9e2ec;
  border-top-color: #3e8ef7;
  border-radius: 50%;
  animation: openbox-table-loading-spin .75s linear infinite;
}

[data-openbox-component="managed-table"][data-openbox-loading="true"]:not(.openbox-table-ready)::after {
  content: "Загрузка…";
  position: absolute;
  top: 72px;
  left: 0;
  right: 0;
  color: #76838f;
  text-align: center;
  font-size: 14px;
}

@keyframes openbox-table-loading-spin {
  to { transform: rotate(360deg); }
}

@font-face {
    font-family: "Mfglabs iconset";
    src: url("./mfglabs.woff") format("woff");
    font-style: normal;
    font-weight: normal;
    font-display: block;
}

.managed-table-toolbar .ml-reply {
    display: inline-block;
    font-family: "Mfglabs iconset";
    font-style: normal;
    font-weight: normal;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.managed-table-toolbar .ml-reply::before {
    content: "\f02a";
}

/* Match the production portal panel rhythm on every full-page table. */
body.openbox-fixed-table-page .page-content > .panel > .panel-body {
    padding: 30px !important;
}

@media (max-width: 900px) {
    body.openbox-fixed-table-page .page-content > .panel > .panel-body {
        padding: 10px !important;
    }
}

/* Keep the grey page frame even on every side of the table panel. */
body.openbox-fixed-table-page .page {
    display: flex;
    flex-direction: column;
}

body.openbox-fixed-table-page .page > .page-header {
    flex: 0 0 auto;
}

body.openbox-fixed-table-page .page > .page-content {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    height: auto;
    min-height: 0;
    padding-bottom: 30px;
}

body.openbox-fixed-table-page .page-content > .panel {
    flex: 1 1 auto;
    min-height: 0;
}

@media (max-width: 767px) {
    body.openbox-fixed-table-page .page > .page-content {
        padding-bottom: 15px;
    }

    body.openbox-fixed-table-page .page-header .breadcrumb,
    body.openbox-fixed-table-page .openbox-global-table-search {
        display: none !important;
    }
}

#viewResults tbody td.openbox-global-search-match {
    position: relative;
    box-shadow: inset 0 0 0 1px #3e8ef7;
}

.managed-table-toolbar .openbox-global-table-search {
    position: relative;
    display: flex;
    align-items: center;
    width: 70px;
    flex: 0 0 auto;
    margin-left: auto;
    transition: width .18s ease;
}

.managed-table-toolbar .openbox-global-table-search:focus-within {
    width: 200px;
}

.managed-table-toolbar .openbox-global-table-search input.form-control {
    width: 100%;
    min-width: 0;
    padding-right: 40px;
}

.managed-table-toolbar .openbox-global-table-search:not(:focus-within) input::placeholder {
    color: transparent;
}

.managed-table-toolbar .openbox-global-search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #76838f;
    pointer-events: none;
}

.managed-table-toolbar .openbox-global-table-search input::-webkit-search-cancel-button {
    display: none;
}

#viewResults thead .openbox-filter-field .select2-container {
    width: 100% !important;
}

#viewResults td.openbox-options-loading {
    cursor: wait;
    opacity: .65;
}

#viewResults tbody tr.openbox-row-selected > td {
    background-color: #C0C0C0 !important;
}

#viewResults input[type="date"],
#viewResults input[type="date"]::-webkit-datetime-edit,
#openboxCellEditorModal input[type="date"],
#openboxCellEditorModal input[type="date"]::-webkit-datetime-edit {
    font-family: Roboto, "Helvetica Neue", Arial, sans-serif !important;
}


.managed-table-toolbar .openbox-history-redo-icon {
    transform: scaleX(-1);
}

.managed-table-toolbar .managed-toolbar-separator {
    border-left-color: #76838F;
}

.openbox-pinned-boundary-guide {
    background-color: #76838F;
}

@media (min-width: 768px) {
    body.openbox-fixed-table-page #viewResults > tbody {
        height: calc(100vh - 420px);
    }
}

#openboxCellEditorModal .select2-container {
    width: 100% !important;
}

#openboxCellEditorModal .select2-selection--single {
    min-height: 36px;
}

/* Keep an inline Select2 dropdown anchored to its horizontally scrolled cell. */
#viewResults tbody td.openbox-editable-cell.edit-mode {
    position: relative;
    z-index: 20;
}

#viewResults tbody td.openbox-editable-cell.edit-mode > .select2 {
    width: 100% !important;
}

#viewResults tbody td.openbox-editable-cell.edit-mode > textarea.form-control {
    box-sizing: border-box;
    min-height: 36px;
    resize: vertical;
}

.openbox-table-horizontal-scroll > .openbox-table-vertical-scrollbar {
    position: absolute;
    z-index: 30;
    width: 17px;
    overflow-x: hidden;
    overflow-y: scroll;
    background: rgba(255,255,255,.92);
    scrollbar-gutter: stable;
}

.openbox-table-horizontal-scroll > .openbox-table-vertical-scrollbar > span {
    display: block;
    width: 1px;
}

/* Export control follows the ERP managed-table donor. */
/* Keep action links inside the standard 32px table row. */
#viewResults tbody td.openbox-static-cell > .btn.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin: 0;
    padding: 0 !important;
    line-height: 1;
}
.managed-table-toolbar .managed-export-wrap {
    position: relative;
    display: inline-flex;
}

.managed-table-toolbar .managed-export-menu {
    display: none;
    position: fixed;
    z-index: 10000;
    bottom: auto;
    left: 0;
    top: 0;
    transform: none;
    padding: 4px;
    white-space: nowrap;
    background: #fff;
    border: 1px solid #e4eaec;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}

.managed-table-toolbar .managed-export-menu.show {
    display: flex;
}

.managed-table-toolbar .managed-export-menu .btn {
    min-width: 58px;
    margin: 0;
    padding: 7px 10px;
    color: #76838f;
    background: #fff;
    border: 1px solid #e4eaec;
    border-radius: 0;
}

.managed-table-toolbar .managed-export-menu .btn:hover {
    color: #3e8ef7;
    border-color: #3e8ef7;
}
#viewResults thead .openbox-column-sum{display:block;margin-top:2px;color:#a3afb7;font-size:11px;font-weight:400;line-height:14px;white-space:nowrap}

#viewResults tbody td.dataTables_empty {
  width: 100% !important;
  min-width: 100% !important;
  max-width: none !important;
  flex: 1 0 100%;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  text-align: left !important;
  padding: 10px !important;
  background: #f7f7f7 !important;
}

/* Equal inset around toolbar, table and pagination. */
body.openbox-fixed-table-page .page-content > .panel {
    display: flex;
    flex-direction: column;
}
body.openbox-fixed-table-page .page-content > .panel > .panel-body,
body.openbox-fixed-table-page .panel-body > [data-openbox-template="page-with-table"],
body.openbox-fixed-table-page [data-openbox-template="page-with-table"] > .openbox-table-ready,
body.openbox-fixed-table-page .dataTables_wrapper {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}
body.openbox-fixed-table-page .dataTables_wrapper > .bottom {
    margin-top: auto;
}

/* Version 1.0.3: explicit panel and pagination spacing. */
body.openbox-fixed-table-page .page-content > .panel > .panel-body {
    padding: 30px !important;
}
body.openbox-fixed-table-page .dataTables_wrapper > .bottom {
    flex: 0 0 auto;
    margin: 30px 0 0 !important;
    padding: 0 !important;
}
body.openbox-fixed-table-page .openbox-table-horizontal-scroll {
    flex: 0 0 auto;
    margin-bottom: 0 !important;
}

/* Measure the footer spacing from the controls, not an empty 64px container. */
body.openbox-fixed-table-page .dataTables_wrapper > .bottom {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    height: auto !important;
    min-height: 0 !important;
}
body.openbox-fixed-table-page .dataTables_wrapper > .bottom > .dataTables_length,
body.openbox-fixed-table-page .dataTables_wrapper > .bottom > .dataTables_info,
body.openbox-fixed-table-page .dataTables_wrapper > .bottom > .dataTables_paginate {
    float: none !important;
    position: static !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
}
body.openbox-fixed-table-page .dataTables_wrapper > .bottom .pagination,
body.openbox-fixed-table-page .dataTables_wrapper > .bottom .dataTables_length label {
    margin: 0 !important;
}
body.openbox-fixed-table-page .dataTables_wrapper > .bottom::before,
body.openbox-fixed-table-page .dataTables_wrapper > .bottom::after {
    display: none !important;
}

/* Embedded record forms contain overlays; their wrapper must not consume table height. */
body.openbox-fixed-table-page .page-content > .panel > .tabular-form-preview--embedded {
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
}
