.selectize-dropdown.selectize-dropdown--main-recordlist-body{z-index:1060!important}

/* ============================================================
   Sticky list headers
   ============================================================ */

/* Base offset variable – top navbar height */
.detail{--list-sticky-top:var(--navbar-height,40px)}
body[data-navbar=side] .detail{--list-sticky-top:var(--top-bar-height,0px)}
@media screen and (max-width:767px){
  body:not([data-navbar=side]) .detail{--list-sticky-top:0}
}

/* ==========================================================
   Pattern A: Field-based tables with .recordList.overflow
   These need max-height container + sticky inside it (top:0)
   ========================================================== */

/* BOM (ProductionOrder), items (PurchaseOrder), items (Cooperation) */
.detail[data-scope="ProductionOrder"] .cell[data-name="billOfMaterials"] .recordList.overflow,
.detail[data-scope="PurchaseOrder"] .cell[data-name="items"] .recordList.overflow,
.detail[data-scope="Cooperation"] .cell[data-name="items"] .recordList.overflow{
  max-height:70vh;
  overflow:auto;
}
.detail[data-scope="ProductionOrder"] .cell[data-name="billOfMaterials"] .list table thead th,
.detail[data-scope="PurchaseOrder"] .cell[data-name="items"] .list table thead th,
.detail[data-scope="Cooperation"] .cell[data-name="items"] .list table thead th{
  position:sticky;
  top:0;
  z-index:3;
  background-color:var(--table-th-bg-color,#4a7c8a);
  color:#fff;
  box-shadow:0 1px 0 0 var(--default-border-color,#ddd);
}

/* ==========================================================
   Pattern B: Panel-based tables with NO overflow ancestor
   Page-level sticky works directly (top = navbar height)
   ========================================================== */

/* Stav výroby (production-status custom table) */
.production-status-table>thead>tr>th{
  position:sticky;
  top:var(--list-sticky-top,40px);
  z-index:3;
  background-color:var(--table-th-bg-color,#4a7c8a);
  color:#fff;
  box-shadow:0 1px 0 0 var(--default-border-color,#ddd);
}

/* relatedOperations (ProductionOrder bottom panel) */
.panel[data-name="relatedOperations"] .list table thead th{
  position:sticky;
  top:var(--list-sticky-top,40px);
  z-index:3;
  background-color:var(--table-th-bg-color,#4a7c8a);
  color:#fff;
  box-shadow:0 1px 0 0 var(--default-border-color,#ddd);
}

/* Works Performed (ProductionOrder bottom panel) */
.detail[data-scope="ProductionOrder"] .panel[data-name="worksPerformed"] .list table>thead{
  display:table-header-group!important;
}
.detail[data-scope="ProductionOrder"] .panel[data-name="worksPerformed"] .list table thead th{
  position:sticky;
  top:var(--list-sticky-top,40px);
  z-index:3;
  background-color:var(--table-th-bg-color,#4a7c8a);
  color:#fff;
  box-shadow:0 1px 0 0 var(--default-border-color,#ddd);
}

/* ==========================================================
   Numeric columns – right-align for readability
   ========================================================== */

/* BOM list (ProductionOrder) – all numeric columns */
.detail[data-scope="ProductionOrder"] .cell[data-name="billOfMaterials"] .list td[data-name="quantity"],
.detail[data-scope="ProductionOrder"] .cell[data-name="billOfMaterials"] .list td[data-name="warehouseQuantity"],
.detail[data-scope="ProductionOrder"] .cell[data-name="billOfMaterials"] .list td[data-name="quantityRemaining"],
.detail[data-scope="ProductionOrder"] .cell[data-name="billOfMaterials"] .list td[data-name="quantityRequired"],
.detail[data-scope="ProductionOrder"] .cell[data-name="billOfMaterials"] .list td[data-name="quantityProduced"],
.detail[data-scope="ProductionOrder"] .cell[data-name="billOfMaterials"] .list td[data-name="quantityReserved"],
.detail[data-scope="ProductionOrder"] .cell[data-name="billOfMaterials"] .list td[data-name="quantityWithdrawnPlanned"],
.detail[data-scope="ProductionOrder"] .cell[data-name="billOfMaterials"] .list td[data-name="quantityWithdrawnActual"],
.detail[data-scope="ProductionOrder"] .cell[data-name="billOfMaterials"] .list td[data-name="totalAvailableQuantity"],
.detail[data-scope="ProductionOrder"] .cell[data-name="billOfMaterials"] .list td[data-name="semiFinishedCoefficient"],
.detail[data-scope="ProductionOrder"] .cell[data-name="billOfMaterials"] .list th[data-name="quantity"],
.detail[data-scope="ProductionOrder"] .cell[data-name="billOfMaterials"] .list th[data-name="warehouseQuantity"],
.detail[data-scope="ProductionOrder"] .cell[data-name="billOfMaterials"] .list th[data-name="quantityRemaining"],
.detail[data-scope="ProductionOrder"] .cell[data-name="billOfMaterials"] .list th[data-name="quantityRequired"],
.detail[data-scope="ProductionOrder"] .cell[data-name="billOfMaterials"] .list th[data-name="quantityProduced"],
.detail[data-scope="ProductionOrder"] .cell[data-name="billOfMaterials"] .list th[data-name="quantityReserved"],
.detail[data-scope="ProductionOrder"] .cell[data-name="billOfMaterials"] .list th[data-name="quantityWithdrawnPlanned"],
.detail[data-scope="ProductionOrder"] .cell[data-name="billOfMaterials"] .list th[data-name="quantityWithdrawnActual"],
.detail[data-scope="ProductionOrder"] .cell[data-name="billOfMaterials"] .list th[data-name="totalAvailableQuantity"],
.detail[data-scope="ProductionOrder"] .cell[data-name="billOfMaterials"] .list th[data-name="semiFinishedCoefficient"]{
  text-align:right;
}

/* PurchaseOrder items */
.detail[data-scope="PurchaseOrder"] .cell[data-name="items"] .list td[data-name="quantity"],
.detail[data-scope="PurchaseOrder"] .cell[data-name="items"] .list td[data-name="unitPrice"],
.detail[data-scope="PurchaseOrder"] .cell[data-name="items"] .list td[data-name="amount"],
.detail[data-scope="PurchaseOrder"] .cell[data-name="items"] .list th[data-name="quantity"],
.detail[data-scope="PurchaseOrder"] .cell[data-name="items"] .list th[data-name="unitPrice"],
.detail[data-scope="PurchaseOrder"] .cell[data-name="items"] .list th[data-name="amount"]{
  text-align:right;
}

/* Cooperation items */
.detail[data-scope="Cooperation"] .cell[data-name="items"] .list td[data-name="quantity"],
.detail[data-scope="Cooperation"] .cell[data-name="items"] .list th[data-name="quantity"]{
  text-align:right;
}

/* ==========================================================
   BOM modal table sticky header
   ========================================================== */
.modal .list table>thead>tr>th{
  position:sticky;
  top:0;
  z-index:3;
  background-color:var(--table-th-bg-color,#4a7c8a);
  color:#fff;
  box-shadow:0 1px 0 0 var(--default-border-color,#ddd);
}
.modal .modal-body .list{
  overflow:auto;
}

/* ==========================================================
   Sticky bottom panel tabs (ProductionOrder)
   ========================================================== */
.detail[data-scope="ProductionOrder"] .bottom>.tabs{
  position:sticky;
  top:var(--list-sticky-top,40px);
  z-index:4;
  background-color:var(--body-bg,#f5f7fa);
  box-shadow:0 1px 0 0 var(--default-border-color,#ddd);
  margin-left:-1px;
  margin-right:-1px;
  padding-left:1px;
  padding-right:1px;
}

/* ==========================================================
   Dashlet & Panel shared styles
   ========================================================== */

/* --- Shared: loading / empty / error states --- */
.dashlet-state {
  text-align: center;
  padding: 8px;
  font-size: 12px;
}
.dashlet-state--muted {
  color: #999;
}
.dashlet-state--error {
  color: #a94442;
}
.dashlet-state--lg {
  padding: 20px;
}

/* --- Shared: drilldown link style (used in PL dashlet + budget panel) --- */
.dashlet-dd-link {
  color: #2196F3;
  cursor: pointer;
  border-bottom: 1px dashed #2196F3;
  text-decoration: none;
}
.dashlet-dd-link:hover {
  border-bottom-style: solid;
  text-decoration: none;
}
.dashlet-dd-link.active {
  font-weight: 600;
  border-bottom-style: solid;
}

/* --- Shared: drilldown detail table --- */
.dashlet-dd-table {
  margin: 8px 0 0;
  background: #f9f9f9;
  border: 1px solid #ddd;
}
.dashlet-dd-table td {
  padding: 4px 8px !important;
  font-size: 12px;
  color: #555;
}
.dashlet-dd-table th {
  padding: 4px 8px !important;
  font-size: 11px;
  color: #888;
  font-weight: 600;
  text-transform: uppercase;
}
.dashlet-dd-table a {
  color: #2196F3;
}

/* --- Shared: secondary text in table cells --- */
.dashlet-secondary-text {
  color: #999;
  font-size: 11px;
}

/* --- Shared: totals row border --- */
.dashlet-totals-row {
  border-top: 2px solid #333;
  font-weight: bold;
}

/* --- Shared: period selector bottom margin --- */
.dashlet-period-selector {
  margin-bottom: 10px;
}

/* --- Shared: section heading with margin --- */
.dashlet-section-heading {
  margin-top: 10px;
}

/* --- Shared: monthly table container spacing --- */
.dashlet-monthly-container {
  margin-top: 15px;
}

/* ==========================================================
   Company Profit/Loss dashlet
   ========================================================== */

/* (all rules above via shared .dashlet-dd-link / .dashlet-dd-table) */

/* ==========================================================
   Budget Finance panel
   ========================================================== */

.budget-finance-panel h5 {
  margin-top: 5px;
  margin-bottom: 8px;
  font-weight: 600;
  color: #333;
}
.budget-finance-panel .table-condensed > thead > tr > th,
.budget-finance-panel .table-condensed > tbody > tr > td {
  padding: 5px 8px;
}
.budget-finance-panel .text-success {
  color: #3c763d;
}
.budget-finance-panel .text-danger {
  color: #a94442;
}
.budget-finance-panel .bg-success td {
  background-color: #dff0d8 !important;
}
.budget-finance-panel .bg-danger td {
  background-color: #f2dede !important;
}
.budget-finance-panel .drilldown-link {
  color: #2196F3;
  text-decoration: none;
  cursor: pointer;
  border-bottom: 1px dashed #2196F3;
}
.budget-finance-panel .drilldown-link:hover {
  text-decoration: none;
  border-bottom-style: solid;
}
.budget-finance-panel .drilldown-link.active {
  font-weight: 600;
  border-bottom-style: solid;
}
.budget-finance-panel .drilldown-container {
  margin-top: 8px;
}
.budget-finance-panel .drilldown-table {
  margin: 0;
  background: #f9f9f9;
  border: 1px solid #ddd;
}
.budget-finance-panel .drilldown-table td {
  padding: 4px 8px !important;
  font-size: 12px;
  color: #555;
}
.budget-finance-panel .drilldown-table th {
  padding: 4px 8px !important;
  font-size: 11px;
  color: #888;
  font-weight: 600;
  text-transform: uppercase;
}
.budget-finance-panel .drilldown-table a {
  color: #2196F3;
}
.budget-finance-panel .member-link {
  color: #2196F3;
  text-decoration: none;
  cursor: pointer;
}
.budget-finance-panel .member-link:hover {
  text-decoration: underline;
}
.budget-finance-panel .member-row.expanded .member-chevron {
  transform: rotate(90deg);
}
.budget-finance-panel .member-detail-row td {
  padding: 0 !important;
  border-top: none !important;
}
.budget-finance-panel .member-detail-table {
  margin: 0;
  background: #f9f9f9;
}
.budget-finance-panel .member-detail-table td {
  padding: 4px 8px !important;
  font-size: 12px;
  color: #555;
}
.budget-finance-panel .member-detail-table th {
  padding: 4px 8px !important;
  font-size: 11px;
  color: #888;
  font-weight: 600;
  text-transform: uppercase;
}
.budget-finance-panel .member-detail-table a {
  color: #2196F3;
}
.budget-finance-panel .monthly-table td,
.budget-finance-panel .monthly-table th {
  padding: 4px 8px !important;
  font-size: 12px;
}
.budget-finance-panel .monthly-table th {
  font-size: 11px;
  color: #888;
  font-weight: 600;
}
.budget-finance-panel .period-select {
  vertical-align: middle;
}
.budget-finance-panel .bf-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.budget-finance-panel .bf-period-select {
  font-size: 12px;
  padding: 2px 6px;
  border: 1px solid #ccc;
  border-radius: 3px;
  margin-right: 6px;
}
.budget-finance-panel .bf-saldo-value {
  font-size: 14px;
}
.budget-finance-panel .bf-members-section {
  margin-top: 10px;
}
.budget-finance-panel .bf-monthly-heading {
  margin-top: 12px;
}
.budget-finance-panel .bf-chevron {
  font-size: 10px;
  margin-right: 5px;
  transition: transform 0.15s;
}
.budget-finance-panel .no-data {
  padding: 20px;
  text-align: center;
  color: #999;
}
.budget-finance-panel .bf-revenue-subtotal {
  border-top: 2px solid #ddd;
}

/* ==========================================================
   Production Status panel
   ========================================================== */

.production-status-panel .quantity-badge {
  font-size: 14px;
  font-weight: normal;
  color: #666;
}
.production-status-table .is-last-operation {
  background-color: #f0f8ff;
}
.production-status-table .is-purchased {
  background-color: #fff8e6;
}
.production-status-table .progress-bar {
  line-height: 20px;
  font-size: 12px;
}
.production-status-table .progress-bar-success {
  background-color: #5cb85c;
}
.production-status-table .progress-bar-warning {
  background-color: #f0ad4e;
}
.production-status-table .progress-bar-info {
  background-color: #5bc0de;
}
.production-status-panel .ps-progress-no-margin {
  margin-bottom: 0;
  height: 20px;
}
.production-status-panel .ps-label-spacer {
  margin-left: 5px;
}
.production-status-panel .ps-col-narrow {
  width: 40px;
}
.production-status-panel .ps-col-supplier {
  width: 120px;
}
.production-status-panel .ps-col-type {
  width: 80px;
}
.production-status-panel .ps-col-completed {
  width: 100px;
}
.production-status-panel .ps-col-progress {
  width: 200px;
}
.production-status-panel .no-data {
  padding: 20px;
  text-align: center;
  color: #999;
}
