/* Keep management tables visually aligned with the dashboard register. */
:is(#projectsView,#contractsView,#invoicesView) .pr-table-card .data-table-wrapper {
  position: relative;
  max-height: min(66vh, 580px);
  overflow: auto !important;
  overscroll-behavior-x: contain;
  overscroll-behavior-y: auto;
  -webkit-overflow-scrolling: touch;
}

:is(#projectsView,#contractsView,#invoicesView) :is(#tblProjects,#tblContracts,#tblInvoices) thead th {
  position: sticky !important;
  top: 0;
  z-index: 8;
  background: linear-gradient(100deg, #e5f2ff, #dfedff) !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  line-height: 1.5 !important;
  white-space: normal;
  box-shadow: 0 1px 0 #c8dbf3;
  border-inline-end: 1px solid #bfd1eb !important;
}

:is(#projectsView,#contractsView,#invoicesView) :is(#tblProjects,#tblContracts,#tblInvoices) thead th:first-child {
  z-index: 12;
}

:is(#projectsView,#contractsView,#invoicesView) :is(#tblProjects,#tblContracts,#tblInvoices) tbody td {
  padding: 7px 8px !important;
  font-size: 16px !important;
  line-height: 1.7 !important;
  border-color: #dbe3ec !important;
}

:is(#projectsView,#contractsView,#invoicesView) :is(#tblProjects,#tblContracts,#tblInvoices) tbody tr:nth-child(even) td {
  background-color: #f7faff;
}

:is(#projectsView,#contractsView,#invoicesView) :is(#tblProjects,#tblContracts,#tblInvoices) tbody tr:hover td {
  background-color: #edf6ff !important;
}

#invoicesView #tblInvoices tbody td.inv-contract-cell span {
  line-height: 1.45;
}

#invoicesView #tblInvoices tfoot td {
  position: sticky;
  bottom: 0;
  z-index: 5;
  background: #eaf4ff !important;
  border-top: 2px solid #9dceff !important;
}

#dashboardView .mc-contract-register-wrap {
  max-height: min(58vh, 440px) !important;
  overflow: auto !important;
  overscroll-behavior-x: contain;
  overscroll-behavior-y: auto;
  -webkit-overflow-scrolling: touch;
}

#dashboardView .mc-contract-register-wrap.is-five-row-page {
  max-height: none !important;
  overflow: visible !important;
}

#dashboardView .mc-contract-register-table thead th {
  position: sticky !important;
  top: 0;
  z-index: 8 !important;
  background: linear-gradient(100deg, #e5f2ff, #dfedff) !important;
  box-shadow: 0 1px 0 #c8dbf3;
  border-inline-end: 1px solid #bfd1eb !important;
}

#dashboardView .mc-contract-register-table thead th:first-child {
  z-index: 12 !important;
}

/* Keep the project-name column visible while scrolling this wide register. */
#dashboardView .mc-contract-register-table th:first-child,
#dashboardView .mc-contract-register-table td:first-child {
  position: sticky !important;
  right: 0;
  z-index: 4;
  background: #fff !important;
  box-shadow: -2px 0 5px #204a8312;
}

#dashboardView .mc-contract-register-table thead th:first-child {
  top: 0;
  z-index: 14 !important;
  background: linear-gradient(100deg, #e5f2ff, #dfedff) !important;
}

#dashboardView .mc-contract-register-table tbody tr:nth-child(even) td:first-child {
  background: #f7fbff !important;
}

#dashboardView .mc-contract-register-table tbody tr:hover td:first-child {
  background: #eaf3ff !important;
}

#dashboardView .mc-contract-register-table tbody td {
  font-size: 16px !important;
}

#dashboardView .mc-contract-register-table tfoot th,
#dashboardView .mc-contract-register-table tfoot td {
  position: sticky !important;
  bottom: 0 !important;
  z-index: 12 !important;
  background: #eaf4ff !important;
}

#dashboardView .mc-contract-register-table tfoot {
  position: sticky !important;
  bottom: 0 !important;
  z-index: 12 !important;
}

#dashboardView .mc-contract-register-table tfoot .mc-contract-total-row th {
  color: #173a78 !important;
  font-weight: 750 !important;
  text-align: center !important;
  white-space: nowrap !important;
}

#dashboardView .mc-contract-register-table tfoot .mc-contract-total-row th:nth-child(3) {
  color: #102f6a !important;
  font-variant-numeric: tabular-nums;
  direction: ltr;
}

#dashboardView .mc-contract-register-table tfoot .mc-contract-total-row th:first-child {
  bottom: 0 !important;
  right: 0;
  z-index: 16 !important;
  background: #eaf4ff !important;
}

#dashboardView .mc-contract-total-count {
  display: inline-flex;
  flex-direction: row;
  align-items: baseline;
  gap: 5px;
  direction: rtl;
}

#dashboardView .mc-contract-total-count b,
#dashboardView .mc-contract-total-value {
  color: #102f6a !important;
  font-variant-numeric: tabular-nums;
  font-weight: 800 !important;
  white-space: nowrap;
}

@media (max-width: 760px) {
  :is(#projectsView,#contractsView,#invoicesView) .pr-table-card .data-table-wrapper {
    max-height: 62vh;
  }
  #dashboardView .mc-contract-register-wrap {
    max-height: min(58vh, 440px) !important;
  }
}

@media print {
  :is(#projectsView,#contractsView,#invoicesView) .pr-table-card .data-table-wrapper,
  #dashboardView .mc-contract-register-wrap {
    max-height: none;
    overflow: visible !important;
  }
}
